# -*-s2-*- layerinfo type = "layout"; layerinfo name = "Haven"; layerinfo lang = "en"; layerinfo author_name = "Jesse Proulx"; layerinfo author_email = "jproulx@livejournal.com"; layerinfo redist_uniq = "haven/layout"; layerinfo des = "This style is more conceptual and boring than it is innovative and pretty. The goal for this style was to see how well I could automate color palette generation, given the functions available in S2."; layerinfo previews = "haven/haven.png"; propgroup presentation { property use page_recent_items; property use page_friends_items; property use view_entry_disabled; property bool show_entry_userpic { des = "Show user picture icons with each of your entries?"; } set show_entry_userpic = true; property string content_width { des = "Entire width of the main content, in percentages"; values = "60%|60%|70%|70%|80%|80%|90%|90%|100%|100%"; } set content_width = "90%"; property string title_position { des = "Location of the title bar in regards to the entire page"; values = "top|Top of the page|bottom|Bottom of the page|both|Both top and bottom of the page"; } set title_position = "both"; } propgroup background = "Background"; propgroup background { property string page_background_image { des = "Background image"; note = "URL to an image to be used for the page background (leave blank for none)."; } property string page_background_repeat { des = "Background image repeat"; values = "repeat|Repeat|no-repeat|Don't repeat|repeat-x|Repeat across only|repeat-y|Repeat down only"; } property string page_background_position { des = "Background image position"; note = "Does not apply if background image is repeating in both directions."; values = "center|Center|center left|Center-left|center right|Center-right|top|Top|top left|Top-left|top right|Top-right|bottom|Bottom|bottom left|Bottom-left|bottom right|Bottom-right|left|Left|right|Right"; } property string page_background_scrolling { des = "Background image scrolling"; note = "Not supported in all browsers, but allows for the background image to be in a fixed position when scrolling."; values = "scroll|Scroll|fixed|Fixed"; } set page_background_image = ""; set page_background_repeat = "repeat"; set page_background_position = "center"; set page_background_scrolling = "scroll"; } propgroup fonts { property string main_font { des = "Preferred Font"; maxlength = 25; size = 10; example = "Arial"; note = "Leave blank for your browser's default font"; } property string main_font_fallback { des = "Alternative font style"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; note = "This general style will serve as a fallback if your preferred font is unavailable."; } set main_font = "Trebuchet MS"; set main_font_fallback = "sans-serif"; property string sidebar_font { des = "Font for the sidebar boxes"; maxlength = 25; size = 10; example = "Arial"; note = "Leave blank for your browser's default font"; } property string sidebar_font_fallback { des = "Alternative font style"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; note = "This general style will serve as a fallback if your preferred font is unavailable."; } set sidebar_font = "Verdana"; set sidebar_font_fallback = "sans-serif"; property string content_font { des = "Font for the content boxes"; maxlength = 25; size = 10; example = "Arial"; note = "Leave blank for your browser's default font"; } property string content_font_fallback { des = "Alternative font style"; values = "sans-serif|Sans-serif|serif|Serif|cursive|Cursive|monospace|Monospaced|none|Use browser's default"; note = "This general style will serve as a fallback if your preferred font is unavailable."; } set content_font = "Tahoma"; set content_font_fallback = "sans-serif"; } propgroup colors { ### Main page colors ### property Color page_bgcolor { des = "Background color for the page"; } property Color page_fgcolor { des = "Text color for the page"; } #set page_bgcolor = "#ffffff"; #set page_fgcolor = "#000000"; ### Content colors ### property Color content_bgcolor { des = "Background color for content on the page"; } property Color content_fgcolor { des = "Text color for the content on the page"; } property Color content_border { des = "Color for borders around content"; } #set content_bgcolor = "#ffffff"; #set content_fgcolor = "#000000"; #set content_border = "#c2c2c2"; ### Page title colors ### property Color title_bgcolor { des = "Title box background color"; } property Color title_fgcolor { des = "Title box text color"; } property Color title_border { des = "Border color between title bar boxes"; } #set title_bgcolor = "#cccccc"; #set title_fgcolor = "#000000"; #set title_border = "#cccccc"; ### Navigation box colors ### property Color nav_bgcolor { des = "Background color on navigation box"; } property Color nav_fgcolor { des = "Text color on navigation box"; } #set nav_bgcolor = "#e2e2e2"; #set nav_fgcolor = "#000000"; ### Tabbed box title colors ### property Color tabs_bgcolor { des = "Background color on tabs and headers"; } property Color tabs_fgcolor { des = "Text color on tabs and headers"; } ### Sidebar boxes ### property Color sidebar_box_bgcolor { des = "Background color on sidebar boxes"; } property Color sidebar_box_fgcolor { des = "Text color on sidebar boxes"; } property Color sidebar_box_title_bgcolor { des = "Background color on sidebar box titles"; } property Color sidebar_box_title_fgcolor { des = "Text color on sidebar box titles"; } property Color sidebar_box_border { des = "Border color on sidebar boxes"; } #set sidebar_box_bgcolor = "#ffffff"; #set sidebar_box_fgcolor = "#000000"; #set sidebar_box_title_bgcolor = "#cccccc"; #set sidebar_box_title_fgcolor = "#000000"; #set sidebar_box_border = "#000000"; ### Accent color ### property Color accent_bgcolor { des = "Color used to accent hotspot areas"; } property Color accent_fgcolor { des = "Text color used on accent hotspot areas"; } #set accent_bgcolor = "#c0c0c0"; #set accent_fgcolor = "#000000"; ### Comment bar colors ### property Color comment_bar_one_bgcolor { des = "Background color for comment bars"; } property Color comment_bar_one_fgcolor { des = "Text color on comment bars"; } property Color comment_bar_two_bgcolor { des = "Alternating background color for comment bars"; } property Color comment_bar_two_fgcolor { des = "Text color on alternating comment bars"; } 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 comment_bar_one_bgcolor = "#c0c0c0"; #set comment_bar_one_fgcolor = "#000000"; #set comment_bar_two_bgcolor = "#dddddd"; #set comment_bar_two_fgcolor = "#000000"; #set comment_bar_screened_bgcolor = "#f1f1f1"; #set comment_bar_screened_fgcolor = "#000000"; ### Footer colors ### property Color footer_bgcolor { des = "Background color on the footer"; } property Color footer_fgcolor { des = "Text color on the footer"; } } propgroup automatic_color_palettes = "Automatic Color Palettes"; propgroup automatic_color_palettes { property Color color_scheme_base { des = "Core color used to determine the entire color scheme."; note = "After you select a base color and choose a color scheme, an entire palette will be built automatically for your journal colors."; } property string color_scheme { des = "Color scheme"; values = "monochromatic|Monochromatic: use variations of light and saturation without straying from your suggested color|analogous|Analogous: use slightly similar hues to enhance your suggested color|complementary|Complementary: create a high contrast scheme based on your suggested color|split_complementary|Split Complementary: A variation of the Complementary scheme using varying hues of the complementary color|double_complementary|Double Complementary: use slightly varying hues of the base and complementary colors|triadic|Triadic: offers less contrast than the complementary scheme, but is richer in color|tetradic|Tetradic: a combination of the Complementary and Triadic schemes"; } set color_scheme_base = "#1111cc"; set color_scheme = "analogous"; } propgroup sidebar = "Sidebar"; propgroup sidebar { property string sidebar_width { des = "Sidebar width specification"; values = "10%|Skinny|15%|Default|25%|Wide"; } property string sidebar_position { des = "Page position of the sidebar"; values = "left|Left|right|Right"; } set sidebar_width = "15%"; set sidebar_position = "left"; property string sidebar_blurb { des = "Text to be added to the sidebar"; note = "Appears in the sidebar 'Blurb'"; rows = 10; cols = 25; } ### Positions ### property string sidebar_position_one { note = "Set to 'Nothing' to hide box"; des = "First Sidebar Box"; values = "nothing|Nothing|summary|Page Summary|links|Link List|blurb|Blurb|calendar|Calendar"; } set sidebar_position_one = "summary"; property string sidebar_position_two { note = "Set to 'Nothing' to hide box"; des = "Second Sidebar Box"; values = "nothing|Nothing|summary|Page Summary|links|Link List|blurb|Blurb|calendar|Calendar"; } set sidebar_position_two = "links"; property string sidebar_position_three { note = "Set to 'Nothing' to hide box"; des = "Third Sidebar Box"; values = "nothing|Nothing|summary|Page Summary|links|Link List|blurb|Blurb|calendar|Calendar"; } set sidebar_position_three = "blurb"; property string sidebar_position_four { note = "Set to 'Nothing' to hide box"; des = "Fourth Sidebar Box"; values = "nothing|Nothing|summary|Page Summary|links|Link List|blurb|Blurb|calendar|Calendar"; } set sidebar_position_four = "calendar"; } propgroup text { property use text_meta_music; property use text_meta_mood; property use text_post_comment; property use text_read_comments; property use text_post_comment_friends; property use text_read_comments_friends; property use text_website_default_name; property string text_sidebar_profile { des = "Title of the profile sidebar box"; noui = 1; } property string text_sidebar_blurb { des = "Title of the blurb sidebar box"; noui = 1; } property string text_sidebar_links { des = "Title of the links sidebar box"; noui = 1; } property string text_sidebar_summary { des = "Title of the summary sidebar box"; noui = 1; } set text_sidebar_profile = "Profile"; set text_sidebar_blurb = "Blurb"; set text_sidebar_links = "Links"; set text_sidebar_summary = "Page Summary"; } set tags_aware = true; ################################################################################ # # Color scheme functions # function color_triadic(Color base) : Color[] { var int red = $base->red(); var int green = $base->green(); var int blue = $base->blue(); var Color color_two = $base->clone(); var Color color_one = $base->clone(); $color_one->blue($red); $color_one->red($green); $color_one->green($blue); $color_two->red($blue); $color_two->green($red); $color_two->blue($green); return [$base, $color_one, $color_two]; } function color_tetradic(Color base) : Color[] { var Color[] tetradic_one = color_triadic($base); var Color[] tetradic_two = color_triadic($base->inverse()); var Color color_one = $tetradic_one[1]->average($tetradic_two[2]); var Color color_two = $tetradic_one[2]->average($tetradic_two[1]); return [$base, $base->inverse(), $color_one, $color_two]; } function color_analogous(Color base) : Color[] { var Color[] triad = color_triadic($base->inverse()); var Color color_one = $base->average($triad[1]); var Color color_two = $base->average($triad[2]); return [$base, $color_one, $color_two]; } function color_split_complementary(Color base) : Color[] { var Color[] analogous = color_analogous($base->inverse()); var Color color_one = $analogous[1]; var Color color_two = $analogous[2]; return [$base, $color_one, $color_two]; } function color_double_complementary(Color base) : Color[] { var Color[] analogous_one = color_analogous($base); var Color color_one = $analogous_one[1]; var Color color_two = $analogous_one[2]; var Color[] analogous_two = color_analogous($base->inverse()); var Color color_three = $analogous_two[1]; var Color color_four = $analogous_two[2]; return [$base, $color_one, $color_two, $color_three, $color_four]; } function color_ideal_foreground(Color bg) : Color "Used to determine the best text color (out of white and black currently) given a single solid background color" { var Color fg = $bg->inverse(); var int saturation = $fg->saturation(); $saturation = $saturation >= 127 ? 255 : 0; $fg->saturation($saturation); var int lightness = $fg->lightness(); $lightness = $lightness >= 120 ? 255 : 0; $fg->lightness($lightness); return $fg; } function prop_init() { # If the user has selected a base color for a scheme, we build a palette # with that color as the base. All of the isnull checks allows a user to tweak individual # color settings without having to set them all explicitly. if ($*color_scheme_base) { if (isnull $*title_bgcolor) { $*title_bgcolor = $*color_scheme_base->clone(); } if (isnull $*sidebar_box_bgcolor) { $*sidebar_box_bgcolor = "#ffffff"; } if (isnull $*footer_bgcolor) { $*footer_bgcolor = "#ffffff"; } if ($*color_scheme == "monochromatic") { if (isnull $*tabs_bgcolor) { $*tabs_bgcolor = $*title_bgcolor->lighter(20); } if (isnull $*page_bgcolor) { $*page_bgcolor = $*title_bgcolor->darker(40); } if (isnull $*nav_bgcolor) { $*nav_bgcolor = $*title_bgcolor->darker(20); } if (isnull $*sidebar_box_title_bgcolor) { $*sidebar_box_title_bgcolor = $*title_bgcolor->lighter(40); } } elseif ($*color_scheme == "complementary") { var Color inverse = $*title_bgcolor->inverse(); if (isnull $*page_bgcolor) { $*page_bgcolor = $inverse->lighter(20); } if (isnull $*nav_bgcolor) { $*nav_bgcolor = $inverse->darker(20); } if (isnull $*tabs_bgcolor) { $*tabs_bgcolor = $*title_bgcolor->lighter(20); } if (isnull $*sidebar_box_title_bgcolor) { $*sidebar_box_title_bgcolor = $*title_bgcolor->darker(20); } } elseif ($*color_scheme == "split_complementary") { var Color[] split_complementary = color_split_complementary($*title_bgcolor); if (isnull $*page_bgcolor) { $*page_bgcolor = $split_complementary[1]->lighter(20); } if (isnull $*nav_bgcolor) { $*nav_bgcolor = $split_complementary[0]->darker(20); } if (isnull $*tabs_bgcolor) { $*tabs_bgcolor = $split_complementary[1]; } if (isnull $*sidebar_box_title_bgcolor) { $*sidebar_box_title_bgcolor = $split_complementary[2]; } } elseif ($*color_scheme == "double_complementary") { var Color[] double_complementary = color_double_complementary($*title_bgcolor); if (isnull $*page_bgcolor) { $*page_bgcolor = $double_complementary[3]; } if (isnull $*nav_bgcolor) { $*nav_bgcolor = $double_complementary[1]; } if (isnull $*tabs_bgcolor) { $*tabs_bgcolor = $double_complementary[4]; } if (isnull $*sidebar_box_title_bgcolor) { $*sidebar_box_title_bgcolor = $double_complementary[2]; } } elseif ($*color_scheme == "analogous") { var Color[] analogous = color_analogous($*title_bgcolor); if (isnull $*page_bgcolor) { $*page_bgcolor = $analogous[1]; } if (isnull $*tabs_bgcolor) { $*tabs_bgcolor = $*page_bgcolor->average($analogous[0]); } if (isnull $*nav_bgcolor) { $*nav_bgcolor = $analogous[2]; } if (isnull $*sidebar_box_title_bgcolor) { $*sidebar_box_title_bgcolor = $*nav_bgcolor->average($analogous[0]); } } elseif ($*color_scheme == "triadic") { var Color[] triadic = color_triadic($*title_bgcolor); if (isnull $*page_bgcolor) { $*page_bgcolor = $triadic[1]->lighter(20); } if (isnull $*tabs_bgcolor) { $*tabs_bgcolor = $triadic[1]->darker(20); } if (isnull $*nav_bgcolor) { $*nav_bgcolor = $triadic[2]->lighter(20); } if (isnull $*sidebar_box_title_bgcolor) { $*sidebar_box_title_bgcolor = $triadic[2]->darker(20); } } elseif ($*color_scheme == "tetradic") { var Color[] tetradic = color_tetradic($*title_bgcolor); if (isnull $*page_bgcolor) { $*page_bgcolor = $tetradic[1]; } if (isnull $*nav_bgcolor) { $*nav_bgcolor = $tetradic[0]->darker(20); } if (isnull $*tabs_bgcolor) { $*tabs_bgcolor = $tetradic[2]; } if (isnull $*sidebar_box_title_bgcolor) { $*sidebar_box_title_bgcolor = $tetradic[3]; } } } if (isnull $*page_fgcolor) { $*page_fgcolor = color_ideal_foreground($*page_bgcolor); } if (isnull $*title_fgcolor) { $*title_fgcolor = color_ideal_foreground($*title_bgcolor); } if (isnull $*tabs_fgcolor) { $*tabs_fgcolor = color_ideal_foreground($*tabs_bgcolor); } if (isnull $*title_border) { $*title_border = $*title_bgcolor->average($*nav_bgcolor); } if (isnull $*footer_fgcolor) { $*footer_fgcolor = color_ideal_foreground($*footer_bgcolor); } # Content if (isnull $*content_bgcolor) { $*content_bgcolor = "#ffffff"; } if (isnull $*content_fgcolor) { $*content_fgcolor = color_ideal_foreground($*content_bgcolor); } if (isnull $*content_border) { $*content_border = $*content_fgcolor; } # Sidebar if (isnull $*sidebar_box_title_fgcolor) { $*sidebar_box_title_fgcolor = color_ideal_foreground($*sidebar_box_title_bgcolor); } if (isnull $*sidebar_box_fgcolor) { $*sidebar_box_fgcolor = color_ideal_foreground($*sidebar_box_bgcolor); } if (isnull $*sidebar_box_border) { $*sidebar_box_border = $*sidebar_box_fgcolor; } # Accent if (isnull $*accent_bgcolor) { $*accent_bgcolor = $*nav_bgcolor; } if (isnull $*accent_fgcolor) { $*accent_fgcolor = color_ideal_foreground($*accent_bgcolor); } # Comment bar colors if (isnull $*comment_bar_one_bgcolor) { $*comment_bar_one_bgcolor = $*nav_bgcolor; } if (isnull $*comment_bar_two_bgcolor) { $*comment_bar_two_bgcolor = $*sidebar_box_title_bgcolor; } if (isnull $*comment_bar_one_fgcolor) { $*comment_bar_one_fgcolor = color_ideal_foreground($*comment_bar_one_bgcolor); } if (isnull $*comment_bar_two_fgcolor) { $*comment_bar_two_fgcolor = color_ideal_foreground($*comment_bar_two_bgcolor); } } function css_font_family(string base, string fallback) : string { var string return; if ($base != "" or $fallback != "none") { $return = $return + "font-family: "; if ($base != "") { $return = $return + "\"$base\""; if ($fallback != "none") { $return = $return + ", "; } } if ($fallback != "none") { $return = $return + $fallback; } } return $return; } function print_stylesheet () { var string body_font_family = css_font_family($*main_font, $*main_font_fallback); var string sidebar_font_family = css_font_family($*sidebar_font, $*sidebar_font_fallback); var string content_font_family = css_font_family($*content_font, $*content_font_fallback); var string body_background = ""; if ($*page_background_image != "") { $body_background = """ background-image: url("$*page_background_image"); background-repeat: $*page_background_repeat; background-position: $*page_background_position; background-attachment: $*page_background_scrolling; """; } print """ body { background-color: $*page_bgcolor; $body_background color: $*page_fgcolor; $body_font_family; font-size: 100%; margin: 0px; } a { color: $*page_fgcolor; } p, td, blockquote { font-size: 1.0em; } code, kbd, pre, tt { font-family: monospace; } h1 { font-size: 2.0em; } h2 { font-size: 1.5em; } .title_navigation { border: 1px solid $*title_border; width: 100%; } .title { background-color: $*title_bgcolor; color: $*title_fgcolor; text-align: center; width: 40%; } .main_subtitle { line-height: .5em; } .navigation { background-color: $*nav_bgcolor; color: $*nav_fgcolor; text-align: left; white-space: nowrap; } .navigation_title { width: 100%; border-bottom: $*nav_fgcolor 1px solid; text-align: left; } #sidebar { $sidebar_font_family; width: $*sidebar_width; } .sidebar_box { background-color: $*sidebar_box_bgcolor; color: $*sidebar_box_fgcolor; width: 100%; } .sidebar_box th { border-left: 1px solid $*sidebar_box_border; border-right: 1px solid $*sidebar_box_border; border-top: 1px solid $*sidebar_box_border; background-color: $*sidebar_box_title_bgcolor; color: $*sidebar_box_title_fgcolor; text-align: center; } .sidebar_box td { border: 1px solid $*sidebar_box_border; font-size: .85em; width: 100%; } .sidebar_box a { color: $*sidebar_box_fgcolor; } .tabs { background-color: $*tabs_bgcolor; border-left: 1px solid $*content_border; border-right: 1px solid $*content_border; border-top: 1px solid $*content_border; color: $*tabs_fgcolor; $content_font_family; margin-bottom: 0; padding: 1em 1em .5em 1em; text-decoration: none; width: 40%; } .content { background-color: $*content_bgcolor; border: 1px solid $*content_border; color: $*content_fgcolor; $content_font_family; width: 100%; padding: .5em; } .content a { color: $*content_fgcolor; } /* Box effect */ .entry, .calendar_month, .month_day, .comment_page, .replyto { margin: 0.25em 0.5em 0.25em 0.5em; padding: 0.25em 0.5em 0.25em 0.5em; text-align: justify; } .entry .text, .calendar_month .calendar, .month_day .posts, .comment_page .comments, .replyto .text { margin: 0; border-right: 1px solid $*content_border; border-left: 1px solid $*content_border; border-bottom: 1px solid $*content_bgcolor; padding: .5em; } html>body .entry .text, html>body .calendar_month .calendar, html>body .month_day .posts, html>body .comment_page .comments, html>body .replyto .text { border-bottom-width: 0; } .entry .subject, .calendar_month .header, .month_day .header, .comment_page .header, .replyto .subject { border-bottom: 1px solid $*content_border; border-left: 1em solid $*content_border; font-size: 0.8em; margin-bottom: 0; padding-left: 0.8em; } .entry .comments, .calendar_month .subjects, .month_day .footer, .comment_page .footer, .replyto .footer { border-right: 1em solid $*content_border; border-top: 1px solid $*content_border; font-size: 0.8em; margin-top: 0; padding-right: 0.8em; text-align: right; } /* Entry */ .entry .text .userpic, .replyto .text .userpic { float: left; margin: .1em .5em .1em .5em; } .entry .text .clearer, .replyto .text .clearer { clear: left; display: block; } .entry .text .currents { margin-top: 0; } /* Comments */ .comment_page .leave_comment, .selector { text-align: center; } .comment_page .footer .pages { text-align: left; } /* YearPage specific CSS */ .calendar { width: 100%; } .calendar .day, .calendar .day_with_posts { border: 1px solid #000; width: 14%; } .calendar .day_with_posts { background-color: $*accent_bgcolor; } .calendar .day_with_posts a { display: block; text-decoration: none; width: 100%; } .comment_bar_one, .comment_bar_two, .comment_bar_screened { width: 100%; margin-top: 1em; } .comment_bar_one { background-color: $*comment_bar_one_bgcolor; color: $*comment_bar_one_fgcolor; } .comment_bar_two { background-color: $*comment_bar_two_bgcolor; color: $*comment_bar_two_fgcolor; } .comment_bar_screened { background-color: $*comment_bar_screened_bgcolor; color: $*comment_bar_screened_fgcolor; } #footer { background-color: $*footer_bgcolor; color: $*footer_fgcolor; font-size: .8em; margin-left: 10%; margin-right: 10%; text-align: center; width: 80%; } #footer a { color: $*footer_fgcolor; } """; } ################################################################################ # # Sidebar Boxes # # A simple sidebar box: # print_sidebar_box("Title", "My screenname: test"); # # The same sidebar box, but with some additional css rules: # print_sidebar_box("Title", "My screenname: test", "text-decoration: underline"); function print_sidebar_box(string title, string body, string style) { println """"""; println """ """; println """ """; println """
"""; } function print_sidebar_box(string title, string body) { print_sidebar_box($title, $body, ""); } function Page::lay_sidebar_view_userpic() : string { return ""; } function print_sidebar_userpic () { var Page page = get_page(); var string return; var Image up_img = $page.journal.default_pic; if ($page->lay_sidebar_view_userpic() != "") { $return = $page->lay_sidebar_view_userpic(); } else { if (defined $up_img) { $return = """
"""; } $return = $return + $page.journal.name + "
" + $page.journal; } print_sidebar_box($*text_sidebar_profile,$return,"text-align: center"); } function Page::lay_sidebar_view_summary() : string { return ""; } function print_sidebar_summary() { var Page page = get_page(); if ($page->lay_sidebar_view_summary() != "") { var string summary = """
"""; $summary = $summary + $page->lay_sidebar_view_summary(); $summary = $summary + "
"; print_sidebar_box($*text_sidebar_summary,$summary); } } function print_sidebar_linklist() { var Page p = get_page(); if (size $p.linklist <= 0) { return; } elseif (not $*linklist_support) { return; } var string list = "
"; foreach var UserLink l ($p.linklist) { if ($l.title) { if ($l.is_heading) { $list = $list + """$l.title
"""; } else { $list = $list + """$l.title
"""; } } else { $list = $list + "

"; } } $list = $list + "
"; print_sidebar_box($*text_sidebar_links, $list); } function print_sidebar_blurb () { if ($*sidebar_blurb != "") { print_sidebar_box($*text_sidebar_blurb,$*sidebar_blurb); } } function print_sidebar_calendar() { var string calendar; var Page p = get_page(); var YearMonth m = $p->get_latest_month(); var string month = $m->month_format(); if($m.has_entries) { $calendar = """"""; var YearWeek[] theWeeks = $m.weeks; foreach var YearWeek w ($theWeeks) { $calendar = $calendar + ""; var YearDay[] theDays = $w.days; var int pre = $w.pre_empty; if($pre > 0) { $calendar = $calendar + """"""; } foreach var YearDay d ($theDays) { if ($d.num_entries) { $calendar = $calendar + """"""; } else { $calendar = $calendar + """"""; } } $calendar = $calendar + "\n"; } $calendar = $calendar + "
 $d.day$d.day
"; } if ($calendar != "") { print_sidebar_box($month, $calendar, "text-align: left"); } } # By default, the first sidebar box (profile) is fixed, # and the order of the rest is determined by the sidebar properties. # # If you want to override the top two boxes, or want to define the order # of boxes without using the provided properties, just write a new user layer # and put each print_sidebar_foo function in the order that you want them: # # function print_sidebar() # { # print_sidebar_linklist(); # print_sidebar_calendar(); # [etc] # } function print_sidebar() { print_sidebar_userpic(); if ($*sidebar_position_one != "nothing") { if ($*sidebar_position_one == "summary") { print_sidebar_summary(); } elseif ($*sidebar_position_one == "links") { print_sidebar_linklist(); } elseif ($*sidebar_position_one == "blurb") { print_sidebar_blurb(); } elseif ($*sidebar_position_one == "calendar") { print_sidebar_calendar(); } } if ($*sidebar_position_two != "nothing") { if ($*sidebar_position_two == "summary") { print_sidebar_summary(); } elseif ($*sidebar_position_two == "links") { print_sidebar_linklist(); } elseif ($*sidebar_position_two == "blurb") { print_sidebar_blurb(); } elseif ($*sidebar_position_two == "calendar") { print_sidebar_calendar(); } } if ($*sidebar_position_three != "nothing") { if ($*sidebar_position_three == "summary") { print_sidebar_summary(); } elseif ($*sidebar_position_three == "links") { print_sidebar_linklist(); } elseif ($*sidebar_position_three == "blurb") { print_sidebar_blurb(); } elseif ($*sidebar_position_three == "calendar") { print_sidebar_calendar(); } } if ($*sidebar_position_four != "nothing") { if ($*sidebar_position_four == "summary") { print_sidebar_summary(); } elseif ($*sidebar_position_four == "links") { print_sidebar_linklist(); } elseif ($*sidebar_position_four == "blurb") { print_sidebar_blurb(); } elseif ($*sidebar_position_four == "calendar") { print_sidebar_calendar(); } } } ################################################################################ # # Content Boxes # # Main body content should be placed in these generic content boxes function print_content_box (string title, string body) { # title println """"""; println """ """; println """
"""; println """  $title"""; println """
"""; # body println """"""; println """
$body
"""; } function print_content_tab (string content) { println """

$content

"""; } function format_replyto(Page p, Entry e, EntryLite el) : string { var string replyto = ""; # Named anchor to link from page summary $replyto = $replyto + """
"""; var string subject = $el.subject != "" ? $el.subject : $*text_nosubject; var string time = $el.time->time_format(); $replyto = $replyto + """

$subject @ $time

"""; $replyto = $replyto + """
"""; if (defined $el.poster) { if (defined $el.userpic) { $replyto = $replyto + """"""; } $replyto = $replyto + $el.poster->as_string(); if ($el.poster.username != $e.poster.username) { $replyto = $replyto + " commented on " + $e.poster->as_string() + "'s post"; } if ($e.poster.username != $e.journal.username) { var string preposition = $e.poster.username == $el.poster.username ? " posted in " : " in "; $replyto = $replyto + $preposition + $e.journal->as_string(); } } else { $replyto = $replyto + "Anonymous commented on " + $e.poster->as_string() + "'s post"; if ($e.poster.username != $e.journal.username) { $replyto = $replyto + " in " + $e.journal->as_string(); } } $replyto = $replyto + ":

" + $el.text; $replyto = $replyto + """
 
"""; $replyto = $replyto + "
"; $replyto = $replyto + """
"""; return $replyto; } function print_replyto(Page p, Entry e, EntryLite el) { print format_replyto($p, $e, $el); } function format_entry(Page p, Entry e, Color bgcolor, Color fgcolor, bool viewing_thread) : string { var string entry = ""; # Named anchor to link from page summary $entry = $entry + """"""; $entry = $entry + """
"""; var string subject = $e.subject != "" ? $e.subject : $*text_nosubject; var string time = $e.time->time_format(); $entry = $entry + """

$e.security_icon $subject @ $time

"""; $entry = $entry + """
"""; if (($p.view == "friends" or $e.poster.username != $e.journal.username or ($*show_entry_userpic and defined $e.userpic))) { if ($p.view == "friends") { if (defined $e.userpic) { $entry = $entry + """"""; } if ($e.poster.username != $e.journal.username) { $entry = $entry + $e.poster->as_string() + ", posting in "; } $entry = $entry + $e.journal->as_string() + ":
"; } elseif ($e.poster.username != $e.journal.username) { if (defined $e.userpic) { $entry = $entry + """"""; } $entry = $entry + $e.poster->as_string() + ":
"; } elseif (defined $e.userpic) { $entry = $entry + """

"""; } } if (size $e.metadata) { $entry = $entry + """

"""; 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"; } $entry = $entry + """
$text: $val
"""; } $entry = $entry + "
\n"; } if ($e.tags) { var int tcount = 0; $entry = $entry + """
Tags: """; foreach var Tag t ($e.tags) { $entry = """$entry"""; $tcount++; if ($tcount != size $e.tags) { $entry = """$entry, """; } } $entry = """$entry
"""; } if (size $e.tags or size $e.metadata) { $entry = "$entry
"; } if (not $viewing_thread) { $entry = $entry + $e.text; } $entry = $entry + """
 
"""; $entry = $entry + "
"; # Comments $entry = $entry + """
"""; if ($e.comments.enabled and $p.view != "entry") { if ($e.comments.count > 0 or $e.comments.screened) { $entry = $entry + """""" + get_plural_phrase($e.comments.count, $p.view == "friends" ? "text_read_comments_friends" : "text_read_comments") + ""; $entry = $entry + " | "; } $entry = $entry + """""" + ($p.view == "friends" ? $*text_post_comment_friends : $*text_post_comment) + ""; } elseif ($p.view == "entry") { var Link l = new Link; foreach var string ls ($e.link_keyseq) { $l = $e->get_link($ls); if (defined $l) { $entry = $entry + """$l.caption """; } if($ls != $e.link_keyseq[size($e.link_keyseq) - 1]) { $entry = $entry + """ | """; } } } else { $entry = $entry + " "; } $entry = $entry + "
"; $entry = $entry + """
"""; return $entry; } function print_entry(Page p, Entry e, Color bgcolor, Color fgcolor, bool viewing_thread) { print format_entry($p, $e, $bgcolor, $fgcolor, $viewing_thread); } ################################################################################ # # Page # function Page::lay_view_nav() : string { return ""; } function Page::print_entry(Entry e) { print_entry($this, $e, null Color, null Color, false); } function Page::print() { var string subtitle = $.global_subtitle ? """

$.global_subtitle

""": ""; var string view_title = $this->view_title() != "" ? $this->view_title() + ":" : " "; var string title_bar = """"""; $title_bar = $title_bar + """ """; $title_bar = $title_bar + """ """; $title_bar = $title_bar + """

$.global_title

$subtitle
"""; println """"""; # Head println ""; if ($*external_stylesheet) { println """"""; } else { println """"; } $this->print_head(); println """$.global_title"""; println ""; if ($*title_position == "top" or $*title_position == "both") { println $title_bar; print "
"; } println """"""; if ($*sidebar_position == "left") { println """"; } println """"; if ($*sidebar_position == "right") { println """"; } println """
"""; $this->print_body(); "
"""; println """
"""; if ($*title_position == "bottom" or $*title_position == "both") { println $title_bar; } println ""; } ################################################################################ # # RecentPage # function RecentPage::lay_view_nav() : string { var string return; if ($.nav.forward_url != "" or $.nav.backward_url != "") { $return = $return + " | "; if ($.nav.backward_url != "") { $return = $return + """Previous Page"""; } if ($.nav.forward_url != "" and $.nav.backward_url != "") { $return = $return + " | "; } if ($.nav.forward_url != "") { $return = $return + """Next Page"""; } } return $return; } function RecentPage::lay_sidebar_view_summary() : string { var string return; foreach var Entry e ($.entries) { var string subject = $e.subject != "" ? $e.subject : $*text_nosubject; $return = $return + "→"; if ($e.security) { $return = $return + " $e.security_icon"; } $return = $e.poster.username != $.journal.username ? $return + """ $e.poster:
$subject
""" : $return + """ $subject
"""; } return $return; } function RecentPage::print_body() { foreach var Entry e ($.entries) { if ($e.new_day) { print_content_tab($e.time->date_format("long")); print """
"""; } $this->print_entry($e); if ($e.end_day) { print """
"""; } } } ################################################################################ # # FriendsPage # function FriendsPage::lay_sidebar_view_summary() : string { var string return; foreach var Entry e ($.entries) { var string poster = $e.poster.username != $e.journal.username ? $e.poster->as_string() + ", posting in " + $e.journal->as_string() : $e.journal->as_string(); var string subject = $e.subject != "" ? $e.subject : $*text_nosubject; $return = $return + "→"; if ($e.security) { $return = $return + " $e.security_icon"; } $return = $return + """ $poster:
$subject
"""; } return $return; } ################################################################################ # # EntryPage # function EntryPage::lay_view_nav() : string { var Link prev = $.entry->get_link("nav_prev"); var Link next = $.entry->get_link("nav_next"); var string return; if ($prev.url != "" or $next.url != "") { $return = $return + " | "; if ($prev.url != "") { $return = $return + """$prev.caption"""; } if ($prev.url != "" and $next.url != "") { $return = $return + " | "; } if ($next.url != "") { $return = $return + """$next.caption"""; } } return $return; } function EntryPage::lay_sidebar_view_summary() : string { var string return; foreach var Comment c ($.comments) { var string poster = defined $c.poster ? $c.poster->as_string() : "(Anonymous)"; var string subject = $c.subject != "" ? $c.subject : $*text_nosubject; $return = $return + """→ $poster:
$subject
"""; } return $return; } function EntryPage::print_body () { print_content_tab($.entry.time->date_format("long")); println """
"""; print_entry($this, $.entry, null Color, null Color, $.viewing_thread); println "
"; if ($.entry.comments.enabled) { print_content_tab("Comments"); println """
"""; var string pages; if (not $.comment_pages.all_subitems_displayed) { $pages = lang_page_of_pages($.comment_pages.current, $.comment_pages.total) + " - "; foreach var int i (1 .. $.comment_pages.total) { if ($i == $.comment_pages.current) { $pages = "$pages [$i] "; } else { var string url_of = $.comment_pages->url_of($i); $pages = """$pages [$i] """; } } println $pages; } else { println " "; } println """
"""; if ($.comment_pages.total_subitems > 0) { if ($this.multiform_on) { $this->print_multiform_start(); } $this->print_comments($.comments); } if ($.entry.comments.count > 5) { println """"""; } println """
"; if ($this.multiform_on) { println """
"""; $this->print_multiform_actionline(); println "
"; $this->print_multiform_end(); } println "
"; } } function EntryPage::print_comment(Comment c) { var string class = ""; if ($c.screened) { $class = "comment_bar_screened"; } elseif ($c.depth % 2) { $class = "comment_bar_one"; } else { $class = "comment_bar_two"; } 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(); } println """
"""; println """"""; if (defined $c.userpic and $*comment_userpic_style != "off") { var int w = $c.userpic.width; var int h = $c.userpic.height; if ($*comment_userpic_style == "small") { $w = $w / 2; $h = $h / 2; } println """"""; } println """
[User Picture Icon]"""; println """"; println """"; println """"; println """"""; println "
"""; println ""; println """"""; println """"; if ($c.metadata{"poster_ip"}) { println """"; } println "
From:$poster
Date:"""; println $c.time->date_format("long") + " - " + $c.time->time_format() + "
IP Address:(""" + $c.metadata{"poster_ip"} + ")
"""; if ($this.multiform_on) { println """ """; $c->print_multiform_check(); } $c->print_linkbar(); println "
"""; println (defined $c.subject_icon or $c.subject != "") ? """

$c.subject_icon $c.subject

""" : ""; println "
(Link)
"; println """
$c.text
"""; println """
"""; if ($c.frozen) { println """(Replies frozen) """; } else { println """(Reply to this) """; } if ($c.parent_url != "") { println """(Parent) """; } if ($c.thread_url != "") { println """(Thread) """; } println "
"; } ################################################################################ # # ReplyPage # function ReplyPage::print_body () { print_content_tab("Reply To:"); println """
"""; print_replyto($this, $.entry, $.replyto); println "
"; print_content_tab("Your Reply:"); println """
"""; $.form->print(); println "
"; } ################################################################################ # # YearPage # function YearPage::lay_view_nav() : string { var string return = " | "; foreach var YearYear y ($.years) { $return = $y.displayed ? $return + $y.year : $return + """$y.year"""; if ($y.url != $.years[size($.years) - 1].url) { $return = $return + """ | """; } } return $return; } function YearPage::lay_sidebar_view_summary () : string { var string return; foreach var YearMonth m ($.months) { if ($m.has_entries) { $return = $return + """→ """ + $m->month_format() + "
"; } } return $return; } function YearPage::print_body() { print_content_tab(string($.year)); println """
"""; foreach var YearMonth m ($.months) { $this->print_month($m); } println "
"; } function YearPage::print_month(YearMonth m) { if (not $m.has_entries) { return; } println """
"""; println $m->month_format(); println "
"; println """"""; foreach var int d (weekdays()) { println """"; } println "\n"; foreach var YearWeek w ($m.weeks) { $w->print(); } println "
""" + $*lang_dayname_short[$d] + "
"; println """
$*text_view_month
"""; } function YearWeek::print () { println ""; if ($.pre_empty) { println """ """; } foreach var YearDay d ($.days) { if ($d.num_entries) { println """$d.day ($d.num_entries)"""; } else { println """$d.day"""; } } if ($.post_empty) { println """ """; } println ""; } ################################################################################ # # MonthPage # function MonthPage::lay_view_nav() : string { var string return; if ($.prev_url != "" or $.next_url != "") { $return = $return + " | "; if ($.prev_url != "") { $return = $return + """Previous Month"""; } if ($.prev_url != "" and $.next_url != "") { $return = $return + " | "; } if ($.next_url != "") { $return = $return + """Next Month"""; } } return $return; } function MonthPage::lay_sidebar_view_summary () : string { var string return; foreach var MonthDay d ($.days) { if ($d.has_entries) { $return = $return + """→ """ + lang_ordinal($d.day) + "
"; } } return $return; } function MonthPage::print_body() { println """
"""; $.redir->print_hiddens(); var string selector; if (size $.months > 1) { $selector = "\n"; } print_content_tab($.date->date_format($*lang_fmt_month_long)); println """
"""; if ($selector != "") { println """
Switch to: $selector
"""; } foreach var MonthDay d ($.days) { if ($d.has_entries) { println """

"""; print lang_ordinal($d.day); println """

\n
"""; $d->print_subjectlist(); println """
\n
"""; } } println "
\n"; } ################################################################################ # # DayPage # function DayPage::lay_view_nav() : string { var string return; if ($.prev_url != "" or $.next_url != "") { $return = $return + " | "; if ($.prev_url != "") { $return = $return + """$*text_day_prev"""; } if ($.prev_url != "" and $.next_url != "") { $return = $return + " | "; } if ($.next_url != "") { $return = $return + """$*text_day_next"""; } } return $return; } function DayPage::print_body() { if ($.has_entries) { println """
"""; foreach var Entry e ($.entries) { $this->print_entry($e); } println "
"; } else { println """

$*text_noentries_day

"""; } } ################################################################################ # # DayPage # function print_theme_preview () { print """
Journal Title
Sed ut perspiciatis:
Recent Entries | Archive | Friends | User Info

 Profile 
John Doe
test

Sed ut perspiciatis:
gfdsgdsgfdsgd @ 01:18 am
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
 
 
"""; }