# -*-s2-*-
layerinfo type = "layout";
layerinfo name = "Generator";
layerinfo redist_uniq = "generator/layout";
layerinfo previews = "generator/generator.jpg";
propgroup colors {
property Color entry_back {
des = "Entry background";
s1color = "page_back";
}
property Color entry_text {
des = "Entry text color";
s1color = "page_text";
}
property Color page_link {
des = "Link color";
s1color = "page_link";
}
property Color page_vlink {
des = "Visited link color";
s1color = "page_vlink";
}
property Color page_alink {
des = "Active link color";
s1color = "page_alink";
}
property Color page_back {
des = "Page background color (and around userpics)";
s1color = "strong_back";
}
property Color stronger_back {
des = "Background color for the bar above entries";
s1color = "strong_back";
}
property Color stronger_text {
des = "Text color for the bar above entries";
s1color = "stronger_text";
}
property Color weak_back {
des = "Background color for the bar below entries";
s1color = "weak_back";
}
property Color weak_text {
des = "Text color for the bar below entries";
s1color = "weak_text";
}
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";
}
}
propgroup fonts {
property use font_base;
property use font_fallback;
}
propgroup presentation {
property use page_recent_items;
property use page_friends_items;
property int box_width {
des = "Box width (pixels)";
}
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;
property use linklist_support;
}
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_website {
des = "The label for the 'website' field";
noui = 1;
}
}
# Set default colors
set entry_back = "#ffffff";
set entry_text = "#000000";
set page_link = "#0000ff";
set page_vlink = "#0000ff";
set page_alink = "#00ffff";
set page_back = "#2d4f89";
set stronger_back = "#000000";
set stronger_text = "#ffffff";
set weak_back = "#aaaaaa";
set weak_text = "#000000";
set comment_bar_one_bgcolor = "#aaaaaa";
set comment_bar_one_fgcolor = "#000000";
set comment_bar_two_bgcolor = "#dddddd";
set comment_bar_two_fgcolor = "#000000";
set comment_bar_screened_bgcolor = "#5f6f99";
set comment_bar_screened_fgcolor = "#000000";
set box_width = 600;
set show_entrynav_icons = true;
set page_background_image = "";
set font_base = "Verdana";
set font_fallback = "sans-serif";
# Customize the view names to be short and lowercase
# (Sorry translators, you'll have to do these again - keep them short!)
set text_view_recent = "entries";
set text_view_friends = "friends";
set text_view_archive = "archive";
set text_view_userinfo = "userinfo";
set tags_aware = true;
set text_website = "website";
function print_stylesheet () {
print clean_url($*page_background_image) != "" ? "body { background-image: url($*page_background_image); }" : "";
"""body, td {
""";
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;
}
";\n";
}
"""font-size: 10pt;
}
tt, pre {
font-family: monospace;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.shadowed {
font-size: 8pt;
background: $*weak_back;
}
.meta {
font-size: 8pt;
}
.index {
font-size: 8pt;
}
.caption, .index {
color: $*stronger_text;
}
.comments {
font-size: 8pt;
}
""";
}
function Page::lay_top_userpic () {
var Image up_img = $.journal.default_pic;
if (defined $up_img) {
"""
""";
}
}
function FriendsPage::lay_top_userpic () { }
function Page::print_linklist() {
if (size $.linklist <= 0) {
return;
}
println """
Links
""";
var bool section_open = false;
if (not $.linklist[0].is_heading) {
println """
[
Links:
|
""";
$section_open = true;
}
foreach var UserLink l ($.linklist) {
if ($l.title) {
if ($l.is_heading) {
if ($section_open) {
println """
";
}
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";
}
$metadata = """$metadata\n
[
$text
|
$val
]
""";
}
$metadata = """$metadata
""";
}
var string tags;
if ($e.tags) {
var int tcount = 0;
$tags = """
[Tags
""";
$tags = """$tags
|
""";
foreach var Tag t ($e.tags) {
$tags = """$tags$t.name""";
$tcount++;
if ($tcount != size $e.tags) { $tags = """$tags, """; }
}
$tags = """$tags
]
""";
}
if (not $hide_text) {
if ($tags or $metadata) {
print $tags;
print $metadata;
print " ";
}
print $e.text;
}
"""
""";
if ($p.view != "entry" and $p.view != "reply") {
"
"; $e.comments->print(); "
";
} elseif ($e.comments.enabled) {
"
"; $e.comments->print_postlink(); "
";
} else {
"
";
}
"""
""";
} # print_entry(Page,Entry,Color,Color,bool)
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 RecentPage::print_body ()
{
foreach var Entry e ($.entries) {
$this->print_entry($e);
}
var string range = "most recent entries";
if ($.nav.skip > 0) {
$range = "$.nav.skip entries back";
}
"""
navigation
[
viewing
|
$range
]
""";
# 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 = """earlier""";
}
if ($.nav.forward_url != "") {
$forward = """later""";
}
if ($back != "" and $forward != "") { $sep = "/"; }
"""
[
go
|
$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 ()
{
"""
Years
""";
foreach var YearYear y ($.years) {
if ($y.displayed) {
"$y.year ";
} else {
"$y.year ";
}
}
"""
""";
}
function YearPage::print_month (YearMonth m)
{
if (not $m.has_entries) { return; }
"""
""";
foreach var Entry e ($.entries) {
$this->print_entry($e);
}
var string tprev = ehtml($*text_day_prev);
var string tnext = ehtml($*text_day_next);
var string daylong = $.date->date_format("long");
"""
""";
$this->print_multiform_end();
}
}
}
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 "