# -*-s2-*- layerinfo "type" = "layout"; layerinfo "name" = "A Novel Conundrum"; layerinfo "source_viewable" = 1; layerinfo "redist_uniq" = "anovelconundrum/layout"; layerinfo "author_name" = "taion"; propgroup colors { property Color page_back { des = "Page background"; } property Color entry_text { des = "Entry text color"; } property Color text_weaker { des = "Weaker text color"; } property Color page_link { des = "Link color"; } property Color page_vlink { des = "Visited link color"; } property Color page_alink { des = "Active link color"; } } # From my last e-mail with Taion, the plan was to rasterize the leading fonts so that # appearance issues could be avoided. However, I don't have access to many of the fonts # that he tested with, so I'll have to put that off for later. # You will need access to Microsoft provided fonts for most accurate rendering, but # we are working on specifying usable alternatives that are cross platform friendly. propgroup fonts { property use font_base; property string font_fallback { des = "Alternative font style"; } property string font_type { des = "Body font type"; note = "General font class for body text"; } property int font_size { des = "Body font size (points)"; } property int font_leading { des = "Body font leading (points)"; } property string title_letterspacing { des = "Letterspacing in titles"; } property bool title_smallcaps { des = "Smallcaps in titles"; } property bool title_underline { des = "Underlined titles"; } property string font_flourish_base { des = "Font face for decorative flourishes"; } property string font_flourish_fallback { des = "Alternate font face for decorative flourishes"; } property string font_flourish_type { des = "Font type for decorative flourishes"; } property string font_secondary_base { des = "Font face for secondary text"; } property string font_secondary_fallback { des = "Alternate font face for secondary text"; } property string font_secondary_type { des = "Font type for secondary text"; } property int font_secondary_size { des = "Secondary font size (points)"; note = "For best results, match optical x-height with the body font"; } property string flourish_rm { des = "Right margin for flourishes"; } property string dc_rm { des = "Right margin for drop caps"; } } propgroup presentation { property string dingbar_url { des = "URL to spacer image between portions of content"; note = "A default will be chosen for you if left blank."; } property use page_recent_items; property use page_friends_items; property string body_width { des = "Text body width"; } property int dcLen { des = "Minimum length in characters before using drop caps"; } property use view_entry_disabled; property use use_shared_pic; property use comment_userpic_style; 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 external_stylesheet; } propgroup text { 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_meta_music; property use text_meta_mood; property string text_dingbar_alt { des = "Alternative text for dingbar images"; noui = 1; } } # Set default colors set entry_text = "#000000"; set text_weaker = "#666666"; set page_link = "#000000"; set page_vlink = "#666666"; set page_alink = "#333333"; set page_back = "#F5F5DC"; set body_width = "35em"; set dcLen = 200; set show_entrynav_icons = true; set page_background_image = ""; set font_base = "Palatino Linotype"; set font_fallback = "Book Antiqua"; set font_type = "serif"; set font_flourish_base = "Edwardian Script ITC\", \"Edwardian Script ITC Semi-Expanded"; set font_flourish_fallback = "Zapfino\", \"Viner Hand ITC"; set font_flourish_type = "cursive"; set font_secondary_base = "Frutiger Linotype"; set font_secondary_fallback = "Tahoma"; set font_secondary_type = "sans-serif"; set font_size = 10; set font_leading = 14; set title_smallcaps = true; set title_underline = false; set title_letterspacing = "0.08em"; set font_secondary_size = 9; set flourish_rm = "0.093em"; set dc_rm = "0.2em"; set dingbar_url = ""; set text_poster_anonymous = "an anonymous reader"; set text_dingbar_alt = "* * *"; set text_view_recent = "Entries"; set text_view_friends = "Friends"; set text_view_archive = "Archive"; set text_view_userinfo = "Profile"; function prop_init() { var PalItem start = PalItem(0, $*entry_text); var PalItem end = PalItem(13, $*page_back); if ($*dingbar_url == "") { $*dingbar_url = palimg_gradient("anovelconundrum/dingbar.gif", $start, $end); } } function print_stylesheet() { print clean_url($*page_background_image) != "" ? "body { background-image: url($*page_background_image); }" : ""; """ body { margin-top: 1in; margin-bottom: 0.6in; } body, td, h2, .caption, h1, h3 { """; if ($*font_base != "" or $*font_fallback != "" or $*font_type != "") { "font-family: "; if ($*font_base != "") { "\"$*font_base\""; if ($*font_fallback != "" or $*font_type != "") { ", "; } } if ($*font_fallback != "") { "\"$*font_fallback\""; if ($*font_type != "") { ", "; } } if ($*font_type != "") { "$*font_type"; } ";\n"; } """ font-size: ${*font_size}pt; line-height: ${*font_leading}pt; font-weight: normal; } .caption, h1, h3 { """; if($*title_smallcaps) {""" font-variant: small-caps; text-transform: lowercase; """; } """ letter-spacing: $*title_letterspacing; } h1 { font-size: 16pt; } h3 { font-size: 12pt; } h2, .noul, .ult { font-style: italic; margin: 0px; } .caption { """; if($*title_underline) {""" text-decoration: underline; """; } """ } .flourish, .bodyl:first-letter { """; if ($*font_flourish_base != "" or $*font_flourish_fallback != "" or $*font_flourish_type != "") { "font-family: "; if ($*font_flourish_base != "") { "\"$*font_flourish_base\""; if ($*font_flourish_fallback != "" or $*font_flourish_type != "") { ", "; } } if ($*font_flourish_fallback != "") { "\"$*font_flourish_fallback\""; if ($*font_flourish_type != "") { ", "; } } if ($*font_flourish_type != "") { "$*font_flourish_type"; } ";\n"; } """ } .flourish { margin-right: ${*flourish_rm}; z-index: 1; font-size: 34pt; position: relative; top: 0.1em; text-transform: uppercase; } .sfon, .index, .author, select, input { """; if ($*font_secondary_base != "" or $*font_secondary_fallback != "" or $*font_secondary_type != "") { "font-family: "; if ($*font_secondary_base != "") { "\"$*font_secondary_base\""; if ($*font_secondary_fallback != "" or $*font_secondary_type != "") { ", "; } } if ($*font_secondary_fallback != "") { "\"$*font_secondary_fallback\""; if ($*font_secondary_type != "") { ", "; } } if ($*font_secondary_type != "") { "$*font_secondary_type"; } ";\n"; } """ font-size: ${*font_secondary_size}pt; line-height: ${*font_leading}pt; } .index { width: 10em; margin-right: 1.2em; } .bodybox { width: $*body_width; } .body, .bodyl, .bodyns { text-align: justify; } .bodyl:first-letter { font-size: """ + (2* $*font_leading) + """pt; margin-bottom: -""" + $*font_size + """pt; margin-right: ${*dc_rm}; float: left; border-bottom: none; text-transform: uppercase; line-height: """ + (2* $*font_leading) + """pt; } .bodyns:first-line, .sc, small, .sct { """; if($*title_smallcaps) {""" font-variant: small-caps; text-transform: lowercase; """; } if($*title_underline) {""" text-decoration: underline; """; } """ letter-spacing: 0.05em; } .sct { letter-spacing: $*title_letterspacing; text-align: center; } .author { float: right; text-align: center; margin-left: 1.5em; margin-bottom: 0.5em; } .ywp { width: 2em; margin-left: 0.5em; margin-right: 0.5em; } blockquote { margin-top: ${*font_leading}pt; margin-bottom: ${*font_leading}pt; margin-left: 2em; } tt, pre, textarea { font-family: "Lucida Console", monospace; font-size:"""+ ((${*font_size}*4)/5) + """pt; } a {text-decoration: none;} .body a, .bodyl a, .bodyns a, .bodynsl a, .author a, .ult a, .uts a { border-bottom: 1px dotted; } .ljuser a, a img, .smallbar a, .noul a { border-bottom: none; } a:hover, .ljuser a:hover { border-bottom: 1px solid; } p { text-indent: 1.5em; margin: 0px; padding: 0px; } blockquote + p { text-indent: 0px; } .uts { font-size: 80%; font-style: italic; text-align: center; line-height: """ + $*font_size + """pt; margin-bottom: """ + ($*font_leading-$*font_size) + """pt; } .smallbar { font-size: 80%; font-style: italic; text-align: center; line-height: """ + (2*$*font_leading) + """pt; clear: right; } .ljcomsel { position: relative; top: 0.75pt; height: 7.5pt; padding-left: 1pt; } input#username, input#password { margin-right: 0.5em; } .bs { margin-top: """ + (2*$*font_leading) + """pt; margin-bottom: """ + (2*$*font_leading) + """pt; text-align: center; line-height: ${*font_leading}pt; } """; } function find_lpar(string t) : int { foreach var int i (reverse (0 .. ($t->length()-1))) { if($t->substr($i,1)=="(") { return $i; } } return -1; } function render_title(string t, int len) { foreach var int i (0 .. ($len-1)) { var string pc = $t->substr($i-1,1); var string cc = $t->substr($i,1); if($cc==" ") { " · "; } elseif( $i > 0 and $pc != " ") { "$cc"; } elseif ($cc=="A" or $cc=="B" or $cc=="C" or $cc=="D" or $cc=="E" or $cc=="F" or $cc=="G" or $cc=="H" or $cc=="I" or $cc=="J" or $cc=="K" or $cc=="L" or $cc=="M" or $cc=="N" or $cc=="O" or $cc=="P" or $cc=="Q" or $cc=="R" or $cc=="S" or $cc=="T" or $cc=="U" or $cc=="V" or $cc=="W" or $cc=="X" or $cc=="Y" or $cc=="Z") { "$cc"; } else { "$cc"; } } } function render_body(string t) { var int str=0; var bool par=false; var bool pars=false; $str = ($t->substr(0,6) == "
" ? 6 : 0); if($t->substr(0,3) == "

") { $str = 3; $pars=true; } foreach var int i ($str .. ($t->length()-1)) { if($t->substr($i,12) == "

") { $str=$i+12; if($par) { "

"; } else { "

"; $par=true; } } elseif($pars and $t->substr($i,4) == "

") { $str=$i+4; $pars=false; } elseif($i >= $str) { print $t->substr($i,1); } } if($par) { "

"; } } function display_title(Page p) { var string dtitle = $p.global_title; var string stitle = $p->view_title(); $stitle = ($p.view == "recent" ? $p.global_subtitle : $stitle); var int lenm=$stitle->length()-1; var int i=$dtitle->length()+1; if ($dtitle == "") { $dtitle = $p.journal.name; $i=$dtitle->length()+1; } if ($p.view == "friends") { $dtitle = $p->view_title(); $i=find_lpar($dtitle); if($i==-1) { $i = $lenm+2; } } """

"""; render_title($dtitle,$i-1); """

"""; if($p.view != "friends" and $stitle != "") { """

$stitle

"""; } elseif($p.view == "friends" and $i<$lenm) { "

" + $dtitle->substr($i+1,($lenm-$i)-1) + "

"; } """
"""; } function Page::print() { var string title = $this->title(); var string links; var bool firstlink = true; foreach var string v ($.views_order) { if ($firstlink == false) { $links = "$links · "; } else { $firstlink = false; } $links = $links + (""+lang_viewname($v)+""); } """\n\n\n"""; if ($*external_stylesheet) { println """"""; } else { println """"; } $this->print_head(); """$title """; display_title($this); """

$links

"""; $this->print_body(); """ """; } function print_entry(Page p, Entry e) { var string date=$e.time->date_format("short"); var string time=$e.time->time_format(); """ """; if ($p.view == "entry" and $*show_entrynav_icons) { """"""; } "
$*text_dingbar_alt
"""; """ $time
$date


"""; $e.comments->print(); """
"""; if (defined $e.userpic) { """
"""; } elseif ($e.poster.journal_type == "C") { """
"""; } elseif ($e.poster.journal_type == "Y") { """
"""; } else { """
"""; } "base_url() + "/\">$e.poster.username"; if ($e.security != "") { $e.security_icon->print(); } if ($e.poster.username != $e.journal.username and $e.journal.journal_type =="C") { """,
base_url() + """/">$e.journal.username"""; } var string subject=$e.subject; if($p.view=="entry") { $subject=""; } """
$subject
"""; if ($subject == "" and $p.view!="entry") {"
";} elseif ($e.text->length() > $*dcLen) {"
";} else {"
";} render_body($e.text); var string metadata; if ($e.metadata) { $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 $val"; } $metadata = """$metadata\n"""; } $metadata = """$metadata
$text:
$val
"""; } """$metadata
$*text_dingbar_alt
"""; $e->print_linkbar(); """
"; } # print_entry(Page,Entry,Color,Color) function Entry::print_linkbar() { ## There's no point in showing previous/next links on pages which show ## multiple entries anyway, so we only print them on EntryPage and ReplyPage. var Page p = get_page(); var Link link; var bool show_interentry = ($p.view == "entry" or $p.view == "reply"); "

"; if ($show_interentry) { var Link prev = $this->get_link("nav_prev"); """$prev.caption · """; } if ($p.view == "entry" and $.comments.enabled) { if ($.comments.maxcomments) { "Maximum Comments Reached"; } else { "Leave a Comment"; } " · "; } var int i=0; foreach var string k ($.link_keyseq) { $link = $this->get_link($k); if($link.caption != "") { if($i>0) { " · "; } "$link.caption"; $i++; } } if ($show_interentry) { var Link next = $this->get_link("nav_next"); """ · $next.caption"""; } "

"; } function Page::print_entry(Entry e) { print_entry($this, $e); } function FriendsPage::print_entry(Entry e) { print_entry($this, $e); } function RecentPage::print_body() { foreach var Entry e ($.entries) { $this->print_entry($e); } """
$*text_dingbar_alt

"""; # go forward/backward if possible if ($.nav.forward_url != "" or $.nav.backward_url != "") { var string sep; var string back; var string forward; if ($.nav.backward_url != "") { $back = """Previous"""; } if ($.nav.forward_url != "") { $forward = """Next"""; } if ($back != "" and $forward != "") { $sep = " · "; } "$back$sep$forward"; } "

"; } function CommentInfo::print() { if (not $.enabled) { return; } if ($.count > 0 or $.screened) { $this->print_readlink(); "
"; } $this->print_postlink(); } function YearPage::print_year_links() { """
$*text_dingbar_alt
Years

"""; var bool d=false; foreach var YearYear y ($.years) { if($d) { " · "; } else { $d=true; } if ($y.displayed) { "$y.year"; } else { "$y.year"; } } "

"; } function YearPage::print_month(YearMonth m) { if (not $m.has_entries) { return; } """
"""; print $m->month_format(); """
"""; foreach var int d (weekdays()) { "\n"; } ""; foreach var YearWeek w ($m.weeks) { $w->print(); } """
"+$*lang_dayname_short[$d]+"
"""; } function YearWeek::print() { ""; if ($.pre_empty) { ""; } foreach var YearDay d ($.days) { """
$d.day
"""; if ($d.num_entries) { """"""; } else { " "; } "
"; } if ($.post_empty) { ""; } ""; } function DayPage::print_body() { if (not $.has_entries) { print "
" + ehtml($*text_noentries_day) + "
"; } foreach var Entry e ($.entries) { $this->print_entry($e); } """
$*text_dingbar_alt
"""; var string tprev = ehtml($*text_day_prev); var string tnext = ehtml($*text_day_next); """

$tprev · $tnext

"""; } function MonthPage::print_body() { """
$*text_dingbar_alt
"""; "
"; foreach var MonthDay d ($.days) { if ($d.has_entries) { "
"; print lang_ordinal($d.day); ":
\n
"; $d->print_subjectlist(); "
\n"; } } "
\n"; """
$*text_dingbar_alt
"""; "
"; $.redir->print_hiddens(); if ($.prev_url != "") { " "; } if (size $.months > 1) { "\n"; } if ($.next_url != "") { " \n"; } "
"; } function EntryPage::print_body() { print_entry($this, $.entry); if ($.entry.comments.enabled and $.comment_pages.total_subitems > 0) { $.comment_pages->print(); $this->print_multiform_start(); "
"; "
"; $this->print_comments($.comments); "
"; $.comment_pages->print(); if ($*show_entrynav_icons) { """
$*text_dingbar_alt
"""; """
"""; $.entry->print_linkbar(); """
"""; } if ($this.multiform_on) {"""
$*text_dingbar_alt
"""; $this->print_multiform_actionline(); $this->print_multiform_end(); "
"; } } } function ItemRange::print() { if ($.all_subitems_displayed) { return; } """
$*text_dingbar_alt
"""; "
"; "
"; "

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

"; var string url_prev = $this->url_of($.current - 1); "
"; if ($.current != 1) { print ""; } else { print "☜"; } print " "; foreach var int i (1..$.total) { if ($i == $.current) { "$i"; } else { var string url_of = $this->url_of($i); "$i"; } if ($i != $.total) { ", "; } } " "; var string url_next = $this->url_of($.current + 1); if ($.current != $.total) { print ""; } else { print "☞"; } "
"; } function EntryPage::print_comments(Comment[] cs) { if (size $cs == 0) { return; } foreach var Comment c ($cs) { if($c.depth==1) { ""; """
$*text_dingbar_alt
"""; "
"; } var int indent = ($c.depth - 1) * 21; "
\n"; if ($c.full) { $this->print_comment($c); } else { $this->print_comment_partial($c); } "
"; $this->print_comments($c.replies); } } function EntryPage::print_comment(Comment c) { var string poster = defined $c.poster ? $c.poster->as_string() : $*text_poster_anonymous; var string sub_icon; if (defined $c.subject_icon) { $sub_icon = $c.subject_icon->as_string(); } ""; "
1? " style='margin-top:${*font_leading}pt;'" : "") + ">"; 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; } "[User Picture]"; } ### From, date, etc "
"; if ($c.screened) { "(Screened) "; } "On " + $c.time->date_format("long") + ", " + $c.time->time_format() + ", $poster "; if ($c.metadata{"poster_ip"}) { "(" + $c.metadata{"poster_ip"} + ") "; } ""; if ($c.depth == 1) { "commented"; } else { "replied"; } ":
"; print (defined $c.subject_icon or $c.subject != "") ? "
$c.subject_icon $c.subject
" : ""; "
"; render_body($c.text); print "
"; if ($c.frozen) { "Replies Frozen"; } else { "Reply"; } if ($c.parent_url != "") { " · Parent"; } if ($c.thread_url != "") { " · Thread"; } $c->print_linkbar(); if ($this.multiform_on) { " · "; ""; $c->print_multiform_check(); } "
"; } function EntryPage::print_comment_partial(Comment c) { var string poster = defined $c.poster ? $c.poster->as_string() : $*text_poster_anonymous; var bool subj = $c.subject != ""; "
"; "— On " + $c.time->date_format("long") + ", " + $c.time->time_format() + ", $poster "; if ($c.metadata{"poster_ip"}) { "(" + $c.metadata{"poster_ip"} + ") "; } if($subj) { """replied, “$c.subject”"""; } else { """posted a reply"""; } ".
"; } function Comment::print_linkbar() { var Link link; foreach var string k ($.link_keyseq) { $link = $this->get_link($k); ($link.caption != "") ? " · $link.caption" : ""; } } function ReplyPage::print_body() { var bool ent = $.replyto.permalink_url == $.entry.permalink_url; if($ent) { print_entry($this, $.entry); } else { """
$*text_dingbar_alt
"""; var EntryLite c = $.replyto; var string poster = defined $c.poster ? $c.poster->as_string() : $*text_poster_anonymous; "
"; 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; } "[User Picture]"; } ### From, date, etc "
"; "On " + $c.time->date_format("long") + ", " + $c.time->time_format() + ", $poster "; if ($c.metadata{"poster_ip"}) { "(" + $c.metadata{"poster_ip"} + ") "; } "commented:
"; print ($c.subject != "") ? "
$c.subject
" : ""; "
"; render_body($c.text); "
"; } """
$*text_dingbar_alt
"""; ""; """
$*text_dingbar_alt
"""; if (not $.entry.comments.enabled) { print "
$*text_reply_nocomments
"; return; } "

Reply " + ($ent ? "to this entry" : "to this comment") + ":

"; $.form->print(); "
"; }