[dw-free] Negatives layout
[commit: http://hg.dwscoalition.org/dw-free/rev/2b08050d940c]
http://bugs.dwscoalition.org/show_bug.cgi?id=564
Initial version of Negatives, a style by
phoenix.
Patch assembled by
afuna.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=564
Initial version of Negatives, a style by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Patch assembled by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/s2layers.dat
- bin/upgrading/s2layers/negatives/layout.s2
- bin/upgrading/s2layers/negatives/themes.s2
- cgi-bin/LJ/S2Theme.pm
- cgi-bin/LJ/S2Theme/negatives.pm
- etc/config.pl
-------------------------------------------------------------------------------- diff -r 34f13da81a81 -r 2b08050d940c bin/upgrading/s2layers.dat --- a/bin/upgrading/s2layers.dat Sun Mar 29 05:23:48 2009 +0000 +++ b/bin/upgrading/s2layers.dat Sun Mar 29 05:45:09 2009 +0000 @@ -5,7 +5,10 @@ core2 core core2 core - core2base/layout layout core2 -core2base/themes theme+ core2base/layout +core2base/themes theme+ core2base/layout + +negatives/layout layout core2 +negatives/themes theme+ negatives/layout # include local file s2layers-local.dat INCLUDE diff -r 34f13da81a81 -r 2b08050d940c bin/upgrading/s2layers/negatives/layout.s2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/upgrading/s2layers/negatives/layout.s2 Sun Mar 29 05:45:09 2009 +0000 @@ -0,0 +1,638 @@ +layerinfo type = "layout"; +layerinfo name = "Negatives"; +layerinfo redist_uniq = "negatives/layout"; +layerinfo author_name = "phoenix"; +layerinfo des = "Highly customisable div-based layout"; +layerinfo lang = "en"; + +####################### +#Properties + +propgroup colors { + + property Color middle_background { noui=1; des="Background of middle section, behind entry boxes"; } + +######### +#Linklist + property Color linklist_link { + noui=1; + des="Color of linklist link text"; + note="Should be readable on Page Background color"; + } + property Color linklist_link_hover { noui=1; des="Color of linklist links when hovered over"; } + property Color linklist_hover_background { noui=1; des="Color of linklist link background when hovered over"; } + property Color linklist_hover_underline { noui=1; des="Color of linklist link underline"; } + +############### +#Top Navigation + property Color navigation_background { noui=1; des="Background color of top navigation links"; } + property Color navigation_link { noui=1; des="Color of top navigation links; should be readable on navigation background color"; } + property Color navigation_link_hover { noui=1; des="Color of top navigation links when hovered"; } + +############## +#Mini-calendar + property Color minical_color { noui=1; des="Mini-calendar link/text color"; } + property Color minical_hover { noui=1; des="Mini-calendar link hover color"; } + property Color minical_back { noui=1; des="Background colour of mini-calendar"; } + +######## +#Border Color + property Color middle_edge { noui=1; des="Color of middle section border"; } +} + +set theme_bgcolor = "#000000"; +set theme_fgcolor = "#000000"; +set entry_link_color = "#000000"; +set entry_link_color_hover = "#cccccc"; +set entry_link_color_visited = "#000000"; +set entry_border="#000000"; +set linklist_link = "#cccccc"; +set linklist_link_hover = "#ffffff"; +set linklist_hover_background = "#222222"; +set linklist_hover_underline ="#ffffff"; +set navigation_background ="#000000"; +set navigation_link = "#dddddd"; +set navigation_link_hover = "#ffffff"; +set middle_background = "#ffffff"; +set middle_edge = "#aaaaaa"; +set entry_background = "#ffffff"; +set comments_link_color = "#cccccc"; +set comments_link_color_hover="#ffffff"; +set metadata_color = "#cccccc"; +set minical_color="#cccccc"; +set minical_back = ""; +set minical_hover = "#ffffff"; + +propgroup text { + property string text_comments_heading { noui=1; des ="Text for comment section heading"; } +} +set text_skiplinks_forward = "Next #"; +set text_skiplinks_back = "Previous #"; +set text_comments_heading = "«Comments»"; +set text_view_recent = "Journal"; +set text_view_archive = "Calendar"; + +propgroup presentation { + property bool display_ljtag { noui=1; des="Display lj-user tags instead of displayed name/user name links on entries"; } + property bool enable_subjecticons { noui=1; des = "Enable comment subject icons?"; } +} + +set display_ljtag = false; +set enable_subjecticons = true; + +set font_base ="Georgia"; +set font_fallback = "serif"; +set entry_management_links = "text"; +set comment_management_links = "text"; + +set text_interaction_links_sep = " "; +set text_entry_prev = "«"; +set text_entry_next = "»"; + +####################### +#Functions +####################### + +######################## +#Prop_init + +function prop_init() { + +#initialize $*module_group_primary and $*module_group_secondary and $module_group_tertiary + + #first sidebar prints in-journal navigation links + $*module_group_primary = [["navlinks", ""]]; + + $*module_group_secondary = [["tags", $*text_tags_section_header, ""],["links", $*text_links], ["pagesummary", $*text_page_summary],]; + + #third sidebar prints a horizontal calendar + $*module_group_tertiary = [["calendar", "horizontal"]]; +} + + +######################## +#Prints the stylesheet +function print_stylesheet() +{ + +""" + body { + margin: 0; + padding: 0; + font-family: $*font_base, $*font_fallback; + font-size: 101%; + background-color: $*theme_bgcolor; + } + a { + text-decoration: none; + font-weight: bold; + color: $*entry_link_color; + outline: none; + } + a:visited, a:active { + color: $*entry_link_color_visited; + } + a:hover { + color: $*entry_link_color_hover; + } + img, img a { + border: 0!important; + } + #primary { + float: left; + font-size: 0.9em; + padding: 10px; + padding-bottom: 5px; + border: 0px; + border-left:5px double $*middle_edge; + border-right:5px double $*middle_edge; + background: $*middle_background; + color:$*theme_fgcolor; + margin-left: 10%; + width: 70%; + } + #secondary { + /*position: absolute;*/ + float: left; + /*top: 40px;*/ + right: 0px; /* Opera5.02 will show a space at right when there is no scroll bar */ + margin: 0px; + padding: 10px; + border: 0px; + padding-bottom: 10px; + width: 15%; + font-size: 0.85em; + color: #ffffff; + } + #secondary a, #secondary a:visited { + color:$*linklist_link; + font-weight:normal; + padding-bottom:1px; + } + #secondary a:hover, #secondary a:active{ + color:$*linklist_link_hover; + background-color:$*linklist_hover_background; + padding-bottom: 0px; + border-bottom:1px solid $*linklist_hover_underline; + } + #secondary .module-header { + border-bottom:1px solid #ffffff; + font-weight:bold; + letter-spacing:.3em; + font-size: 1em; + text-align: right; + } + #secondary .module-header a { + color: #ffffff; + } + #secondary .manage-tags-link { + text-align: center; + } + .module-group-primary { + background-color: $*navigation_background; + font-size: 0.8em; + letter-spacing:.3em; + border-bottom: 5px double #ffffff; + padding: 3px 0; + position: relative; } /*** IE6 needs this to display the div ***/ + /* Hide from IE5-Mac \*/ + * html .module-group-primary {height: 1%;} + /* end hide *//*** This hack will make IE5-win display the background color for the nav ***/ + .module-group-primary ul { + display: block; + list-style: none; + padding: 0; + margin: 0 0 0 2em; + text-align: left; + line-height: 1.2em; } + .module-group-primary ul li { + font-weight: bold; + display: inline-block; + padding: 1px 0; + margin: 3px 0; + width: 10em; + } + .module-group-primary ul li.first { + margin-left: 0; + list-style: none; } + .module-group-primary ul li.last { + border-right: none; } + .module-group-primary a, .module-group-primary a:visited { + padding: 3px 0; + color: $*navigation_link; } + .module-group-primary a:hover, .module-group-primary a:active { + color: $*navigation_link_hover; } + /*test*/ + .userpic{ + float:right;} + .mood,.music{ + color: $*metadata_color; + font-size:0.8em;} + .entry{ + min-height: 110px; + border:5px solid $*entry_border; + padding:5px; + background-color: $*entry_background; + } + .comments{ + width:100%; + background-color: $*entry_border; + text-align:center; + padding-bottom:5px; + font-size:0.7em; + letter-spacing:.3em; + color: $*comments_link_color_hover; + } + .comments a, .comments a:visited{ + color: $*comments_link_color; + } + .comments a:hover, .comments a:active{ + color: $*comments_link_color_hover; + } + .comment-poster .anonymous { + font-weight: bold; + } + .comments div, .comments ul, .entry-management-links li, + .comment-interaction-links li, .comment-management-links li, + .entry-title { + display: inline; + padding-left: 0.5em; + } + .datetime{ + margin-bottom:10px; + font-style:italic; + } + .subject, .subject a, .subject a:visited, .subject a:hover, .subject a:active { + font-weight:bold; + font-size:1.1em; + } + .module-calendar{ + font-size: .80em; + text-align: center; + padding:5px; + margin: -20px 200px 0px 110px; /* ie5win fudge begins */ + voice-family: "\\"}\\""; + voice-family:inherit; + margin: 0px 190px 0px 100px; + } + html>body #module-calendar { + margin: 0px 190px 0px 100px; /* ie5win fudge ends */ + } + .module-group-tertiary { + clear:both; + background-color: $*minical_back; + border-top:#ffffff double 5px; + } + .module-calendar, .module-calendar a{ + color: $*minical_color; + } + .module-calendar a:hover{ + color: $*minical_hover; + } + + /*Holly Hack*/ + /* Hides from IE-mac \*/ + + * html .entry {height: 1%;} + * html #primary {height: 1%;} + /* End hide from IE-mac */ + + .floatclear { + visibility: hidden; + clear:both; + height:0; + } + + /*separators*/ + span.invis{ + display:none; + } + /* correct LJ breaking the comment page */ + textarea.textbox{ + width: 100%; + } + q{ + font-style: italic; + } + """; +} + +########################## View-spec - YearPage ######################## +# define the YearPage navigation links! +function YearPage::print_year_links () +{ + foreach var YearYear y ($.years) { + if ($y.displayed) { + println "» <b>$y.year</b> "; + } else { + println "» <a href=\"$y.url\">$y.year</a>"; + } + } +} +##################################### +#Print entry poster +function Page::print_entry_poster(EntryLite e) { + var Page p = get_page(); + if ($p isa FriendsPage or $p isa EntryPage or $p isa ReplyPage) { + $e.poster->print(); + if (not $e.poster->equals($e.journal)) { + print $*text_posting_in; + $e.journal->print(); + } + } + else { + $e.poster->print(); + } +} +#Print_body +function Page::print_entry (Entry e) +{ + print "<div class=\"entry\">"; + $e->print_userpic(); + print "<div class=\"subject\">»"; + $e->print_metatypes(); + $e->print_subject(); + println "</div>"; + print "<div class=\"datetime\">(posted by "; + $this->print_entry_poster($e); + print " on "; + $e->print_time(); + print ")"; + println "</div>"; + + print "<div>"; + $e->print_text(); + print "</div>"; + $e->print_metadata(); + $e->print_tags(); + println "</div>"; + + println "<div class=\"comments\">"; + var string targetted = "qrtlink1"; + $e->print_interaction_links( $targetted ); + $e->print_management_links(); + println "</div>"; + + $this->print_reply_container({"target" => $targetted, "class" => "entry"}); + println "<br />"; +} +function RecentPage::print_body() { + foreach var Entry e ($.entries) { + $this->print_entry($e); + } +} +####################################### +#Year Page +function YearPage::print_body() +{ + println "<div class=\"entry\">"; + + "<div class=\"subject\">"; + $this->print_year_links(); + println "</div>"; + + println "<center>"; + foreach var YearMonth m ($.months) { + $this->print_month($m); + } + println "</center>"; + + println "</div>"; +} + +function YearPage::print_month(YearMonth m) { + if (not $m.has_entries) { return; } + """<br /><div style="border: 5px solid $*entry_border"><table style="width: 100%; border-collapse: collapse;">\n + <tr><th class="comments" colspan="7" style="text-align: center; font-size: 85%">"""; + print $m->month_format(); + """</th></tr>\n"""; + foreach var int d (weekdays()) { + "<th>"+$*lang_dayname_short[$d]+"</th>\n"; + } + "</tr>\n"; + foreach var YearWeek w ($m.weeks) { + $w->print(); + } + """<tr><td class="comments" colspan="7" style="text-align: center; font-size: 85%"> + « <a href="$m.url">$*text_view_month</a> »</td></tr>\n"""; + "</table></div>"; +} + + + +function YearWeek::print() { + """<tr valign="top" style="height: 2em;">\n"""; + if ($.pre_empty > 0) { + """<td class="emptyday" colspan="$.pre_empty"> </td>\n"""; + } + foreach var YearDay d ($.days) { + """<td style="border: 1px solid $*theme_fgcolor;" width="14%">\n"""; + """<div style="text-align: right;">$d.day</div>\n"""; + if ($d.num_entries > 0) { + """<div style="text-align: center;"><a href="$d.url">$d.num_entries</a></div>\n"""; + } + """</td>\n"""; + } + if ($.post_empty > 0) { + """<td colspan="$.post_empty"> </td>\n"""; + } + "</tr>"; +} + + + +function MonthPage::print_body +{ + println "<div class=\"entry\">"; + println "<div class=\"subject\">" + $.date->date_format($*lang_fmt_month_long) + "</div>"; + "<form method='post' action='$.redir.url'><center>"; + $.redir->print_hiddens(); + if ($.prev_url != "") { "[<a href='$.prev_url'><<<</a>]\n"; } + if (size $.months > 1) { + "<select name='redir_key'>\n"; + foreach var MonthEntryInfo mei ($.months) + { + var string sel; + if ($mei.date.year == $.date.year and $mei.date.month == $.date.month) { + $sel = " selected='selected'"; + } + println "<option value='$mei.redir_key'$sel>" + $mei.date->date_format($*lang_fmt_month_long) + "</option>"; + } + println "</select>\n<input type='submit' value='View' />"; + } + if ($.next_url != "") { "\n[<a href='$.next_url'>>>></a>]\n"; } + "</center></form>"; + foreach var MonthDay d ($.days) { + if ($d.has_entries) { + println "<div class='subject'>"; + println "<a href=\"$d.url\">" + lang_ordinal($d.day) + " " + $.date->date_format($*lang_fmt_month_long) + "</a></div>"; + println "<div style='margin-left: 20px;'>"; + $d->print_subjectlist(); + println "</div>\n<br />\n"; + } + } + println "</div>"; +} + +function DayPage::print_body() +{ + if (not $.has_entries) { + println $*text_noentries_day; + } + foreach var Entry e ($.entries) { + $this->print_entry($e); + } +} + +function EntryPage::print_body () +{ + var Entry e = $.entry; + var Page p; + $this->print_entry($e); + if ($.entry.comments.enabled and $.comment_pages.total_subitems > 0) { + $this->print_multiform_start(); + println "<div class=\"comments\">$*text_comments_heading</div>"; + if ($.comment_pages.total_subitems > 0) { + println "<div class=\"entry\">"; + $.comment_pages->print(); + $this->print_comments($.comments); + } + println "</div>"; + println "<div class=\"comments\">"; + var string targetted = "qrtlink2"; + $e->print_interaction_links( $targetted ); + $e->print_management_links(); + println "</div>"; + $p->print_reply_container({"target" => $targetted, "class" => "entry"}); + if ($this.multiform_on) { + println "<div class=\"entry\" style=\"min-height: 0;\"><div class=\"subject\">Mass Action</div>"; + $this->print_multiform_actionline(); + $this->print_multiform_end(); + println "</div>"; + } + } +} + + +function ReplyPage::print_body () +{ + print "<div class=\"entry\">"; + $.replyto->print_userpic(); + print "<div class=\"subject\">»"; + $.entry->print_metatypes(); + $.entry->print_subject(); + print "</div>"; + + print "<div class=\"datetime\">(posted by "; + $this->print_entry_poster($.replyto); + println " on"; + $.replyto->print_time(); + println "</div>"; + + print $.replyto.text; + println "</div>"; + + println "<div class=\"comments\">"; + println "<a href=\"$.entry.comments.read_url\">«Comments on this Entry»</a>"; + println "</div><br />"; + + println "<div class=\"comments\">«Post a Reply»</div>"; + + println "<div class=\"entry\">"; + $.form->print(); + println "</div>"; +} +##################################### +#Comment Links + +function EntryPage::print_comment (Comment c) +{ + println "<div class=\"entry\">"; + var string sub_icon; + if (defined $c.subject_icon and $*enable_subjecticons) + { + $sub_icon = $c.subject_icon->as_string(); + } + println "<a name=\"$c.anchor\"></a>"; + $c->print_userpic(); + println "<div class='datetime'><a href='$c.permalink_url' title='Permalink'>"; + $c->print_time(); + println "</a>"; + + $c->print_management_links(); + + print "</div>"; + + if ($c.subject and $c.metadata{"poster_ip"}) + { + println " » "; + } + if ($c.metadata{"poster_ip"}) { + println " (" + $c.metadata{"poster_ip"} + ")"; + } + println ""; + + if(not $*display_ljtag and defined $c.poster){ + var string userlink = get_url($c.poster,"recent"); + println "<a href=\"$userlink\">$c.poster.name</a> (<a href=\"$*SITEROOT/userinfo.bml?user=$c.poster.username&mode=full\">$c.poster.username</a>)"; + } else { + $c->print_poster(); + } + + print " said: "; + if (defined $c.subject_icon) { + print "$c.subject_icon"; + } + + $c->print_subject(); + + if ($this.multiform_on) + { + println " <br /><label for='ljcomsel_$c.talkid'>$*text_multiform_check</label>"; + $c->print_multiform_check(); + println ""; + } + print "<br />"; + println ""; + $c->print_text(); + println "</div>"; + + print "<div class=\"comments\">"; + $c->print_interaction_links(); + println "</div>"; + + $c->print_reply_container(); +} + +#################################### +#Layout Frame +function Page::print() +{ + println """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head>"""; + $this->print_head(); + $this->print_stylesheets(); + println "</head>"; + + println "<body>"; + $this->print_control_strip(); + $this->print_module_group_primary(); + + println "<div id=\"primary\">"; + $this->print_body(); + println "<div class=\"floatclear\">.</div>"; + println "</div>"; + + println"<div id=\"secondary\">"; + if ($this.view != "archive" and $this.view != "month"){ + $this->print_navigation(); + } + $this->print_module_group_secondary(); + println"</div>"; + + $this->print_module_group_tertiary(); + + println "</body>"; + println "</html>"; +} \ No newline at end of file diff -r 34f13da81a81 -r 2b08050d940c bin/upgrading/s2layers/negatives/themes.s2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/upgrading/s2layers/negatives/themes.s2 Sun Mar 29 05:45:09 2009 +0000 @@ -0,0 +1,5 @@ +#NEWLAYER: negatives/black +layerinfo type = "theme"; +layerinfo name = "Negatives Black"; +layerinfo redist_uniq = "negatives/black"; + diff -r 34f13da81a81 -r 2b08050d940c cgi-bin/LJ/S2Theme.pm --- a/cgi-bin/LJ/S2Theme.pm Sun Mar 29 05:23:48 2009 +0000 +++ b/cgi-bin/LJ/S2Theme.pm Sun Mar 29 05:45:09 2009 +0000 @@ -35,6 +35,7 @@ sub default_theme { my %default_themes = ( core2base => 'core2base/testing', + negatives => 'negatives/black', ); my %local_default_themes = eval "use LJ::S2Theme_local; 1;" ? $class->local_default_themes($layout, %opts) : (); diff -r 34f13da81a81 -r 2b08050d940c cgi-bin/LJ/S2Theme/negatives.pm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cgi-bin/LJ/S2Theme/negatives.pm Sun Mar 29 05:45:09 2009 +0000 @@ -0,0 +1,7 @@ +package LJ::S2Theme::negatives; +use base qw( LJ::S2Theme ); + +sub cats { qw( featured ) } +sub designer { "phoenixdreaming" } + +1; \ No newline at end of file diff -r 34f13da81a81 -r 2b08050d940c etc/config.pl --- a/etc/config.pl Sun Mar 29 05:23:48 2009 +0000 +++ b/etc/config.pl Sun Mar 29 05:45:09 2009 +0000 @@ -609,12 +609,11 @@ # (16 bit unsigned int ... each bit is capability class flag) $NEWUSER_CAPS = 2; - + # by default, give users a style $DEFAULT_STYLE = { 'core' => 'core1', - 'layout' => 'generator/layout', - 'i18n' => 'generator/en', - 'theme' => 'generator/nautical', + 'layout' => 'negatives/layout', + 'theme' => 'negatives/black', }; ### /admin/fileedit setup --------------------------------------------------------------------------------