[dw-free] Add yet more classes to the basic style
[commit: http://hg.dwscoalition.org/dw-free/rev/79c4ab0f0a2c]
http://bugs.dwscoalition.org/show_bug.cgi?id=2017
Add more classes to the body. e.g., one-column has no changes. two-columns-
left now has: two-columns column-left two-columns-left. two-columns-right
now has: two-columns column-right two-columns-right. three-columns-sides now
has: two-columns column-left columns-right three-columns-sides.
Patch by
ninetydegrees.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=2017
Add more classes to the body. e.g., one-column has no changes. two-columns-
left now has: two-columns column-left two-columns-left. two-columns-right
now has: two-columns column-right two-columns-right. three-columns-sides now
has: two-columns column-left columns-right three-columns-sides.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- bin/upgrading/s2layers/core2.s2
-------------------------------------------------------------------------------- diff -r b590dd2b0348 -r 79c4ab0f0a2c bin/upgrading/s2layers/core2.s2 --- a/bin/upgrading/s2layers/core2.s2 Sun Nov 08 16:09:20 2009 +0000 +++ b/bin/upgrading/s2layers/core2.s2 Sun Nov 08 16:52:38 2009 +0000 @@ -3167,10 +3167,19 @@ function Page::print_wrapper_start(strin function Page::print_wrapper_start(string{} opts) "This function adds standard classes to the body of a page. Pass extra options to it if necessary. Overriding this function is NOT RECOMMENDED. Overriding this function could prevent sitewide improvements to styles, accessibility, or other functionality from operating in your layout." { -# FIXME: this should also print classes that identify the layout/style and other options like the number of columns. var string class = $opts{"class"} ? """class="$opts{"class"}" """ : ""; var string control_strip = viewer_sees_control_strip() ? "has-navstrip" : "no-navstrip"; - """<body class="page-$.view $*layout_type $class $control_strip">\n"""; + var string column_count = ""; + var string column_side = ""; + + if ( $*layout_type->contains("two") ) { $column_count = "two-columns"; } + if ( $*layout_type->contains("three") ) { $column_count = "three-columns"; } + + if ( $*layout_type->contains("right") ) { $column_side = " column-right"; } + if ( $*layout_type->contains("left") ) { $column_side = " column-left"; } + if ( $*layout_type->contains("sides") ) { $column_side = " column-left column-right"; } + + """<body class="page-$.view $column_count$column_side $*layout_type $class $control_strip">\n"""; } function Page::print_wrapper_end() --------------------------------------------------------------------------------