From dde5d4c9b527283984462a2e1f95c3430e45454a Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 13 Mar 2012 06:33:21 +0000 Subject: [PATCH 1/7] html5 validation --- contrib/qr_code/theme.php | 2 +- core/imageboard.pack.php | 1 + ext/handle_pixel/theme.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/contrib/qr_code/theme.php b/contrib/qr_code/theme.php index 92e2a01f..8f6103de 100644 --- a/contrib/qr_code/theme.php +++ b/contrib/qr_code/theme.php @@ -3,7 +3,7 @@ class QRImageTheme extends Themelet { public function links_block($link) { global $page; $page->add_block( new Block( - "QR Code","","left",50)); + "QR Code","QR Code","left",50)); } } ?> diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index ea5815c9..a465eadf 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -563,6 +563,7 @@ class Image { $tmpl = str_replace('$filesize', to_shorthand_int($this->filesize), $tmpl); $tmpl = str_replace('$filename', $_escape($base_fname), $tmpl); $tmpl = str_replace('$title', $_escape($config->get_string("title")), $tmpl); + $tmpl = str_replace(' ', '%20', $tmpl); // nothing seems to use this, sending the event out to 50 exts is a lot of overhead if(!SPEED_HAX) { diff --git a/ext/handle_pixel/theme.php b/ext/handle_pixel/theme.php index 84957ac3..565375cb 100644 --- a/ext/handle_pixel/theme.php +++ b/ext/handle_pixel/theme.php @@ -5,7 +5,7 @@ class PixelFileHandlerTheme extends Themelet { global $config; $u_ilink = $image->get_image_link(); - $html = ""; + $html = "main image"; if($config->get_bool("image_show_meta")) { # FIXME: only read from jpegs? $exif = @exif_read_data($image->get_image_filename(), 0, true); From 69f4928916938a195df86454276bb6c05bccf8ad Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 13 Mar 2012 07:01:01 +0000 Subject: [PATCH 2/7] remove excess html --- contrib/featured/theme.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/contrib/featured/theme.php b/contrib/featured/theme.php index 76503e34..77afe5ff 100644 --- a/contrib/featured/theme.php +++ b/contrib/featured/theme.php @@ -27,15 +27,10 @@ class FeaturedTheme extends Themelet { $h_tip = html_escape($image->get_tooltip()); $tsize = get_thumbnail_size($image->width, $image->height); - return " -
- - - $h_tip - - -
+ + $h_tip + "; } } From d54580e453c630a328209add7d780f335f557746 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 13 Mar 2012 07:01:15 +0000 Subject: [PATCH 3/7] PLT is used by tooltips too... --- core/imageboard.pack.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/imageboard.pack.php b/core/imageboard.pack.php index a465eadf..83a30d3a 100644 --- a/core/imageboard.pack.php +++ b/core/imageboard.pack.php @@ -284,7 +284,7 @@ class Image { return $this->parse_link_template($image_ilink); } else if($config->get_bool('nice_urls', false)) { - return $this->parse_link_template(make_link('_images/$hash/$id - $tags.$ext')); + return $this->parse_link_template(make_link('_images/$hash/$id%20-%20$tags.$ext')); } else { return $this->parse_link_template(make_link('image/$id.$ext')); @@ -563,7 +563,6 @@ class Image { $tmpl = str_replace('$filesize', to_shorthand_int($this->filesize), $tmpl); $tmpl = str_replace('$filename', $_escape($base_fname), $tmpl); $tmpl = str_replace('$title', $_escape($config->get_string("title")), $tmpl); - $tmpl = str_replace(' ', '%20', $tmpl); // nothing seems to use this, sending the event out to 50 exts is a lot of overhead if(!SPEED_HAX) { From 9a0228720a3a56ecc103a6192a1463912c92a3c0 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 13 Mar 2012 07:01:27 +0000 Subject: [PATCH 4/7] truncate as a function, which works --- core/util.inc.php | 16 ++++++++++++++++ ext/comment/theme.php | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/core/util.inc.php b/core/util.inc.php index 552266be..18b245f2 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -83,6 +83,22 @@ function no_escape($input) { return $input; } +// Original PHP code by Chirp Internet: www.chirp.com.au +// Please acknowledge use of this code by including this header. +function truncate($string, $limit, $break=" ", $pad="...") { + // return with no change if string is shorter than $limit + if(strlen($string) <= $limit) return $string; + + // is $break present between $limit and the end of the string? + if(false !== ($breakpoint = strpos($string, $break, $limit))) { + if($breakpoint < strlen($string) - 1) { + $string = substr($string, 0, $breakpoint) . $pad; + } + } + + return $string; +} + /** * Turn a human readable filesize into an integer, eg 1KB -> 1024 * diff --git a/ext/comment/theme.php b/ext/comment/theme.php index 8023b9d0..281bf17c 100644 --- a/ext/comment/theme.php +++ b/ext/comment/theme.php @@ -161,7 +161,7 @@ class CommentListTheme extends Themelet { $h_name = html_escape($comment->owner_name); $h_poster_ip = html_escape($comment->poster_ip); $h_timestamp = autodate($comment->posted); - $h_comment = ($trim ? substr($tfe->stripped, 0, 50) . (strlen($tfe->stripped) > 50 ? "..." : "") : $tfe->formatted); + $h_comment = ($trim ? truncate($tfe->stripped, 50) : $tfe->formatted); $i_comment_id = int_escape($comment->comment_id); $i_image_id = int_escape($comment->image_id); From 028457ec32d5fef59c9bb3f7ff33eb4f108c2cc6 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 13 Mar 2012 07:34:39 +0000 Subject: [PATCH 5/7] parsing --- ext/upload/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/upload/style.css b/ext/upload/style.css index 7102f3cc..d6d80384 100644 --- a/ext/upload/style.css +++ b/ext/upload/style.css @@ -6,8 +6,8 @@ width: auto; } #wrapper { - opacity : 0.4; - filter: alpha(opacity=40); // msie + opacity: 0.4; + filter: alpha(opacity=40); /* msie */ } /* This is needed since the theme style.css forcibly sets vertical align to "top". */ From 8f020993acb7248cb6bac798a4b99b454ec851fa Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 13 Mar 2012 07:53:41 +0000 Subject: [PATCH 6/7] forminess --- contrib/pm/theme.php | 11 +++-------- themes/default/style.css | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/contrib/pm/theme.php b/contrib/pm/theme.php index ca7d205b..449fdaa3 100644 --- a/contrib/pm/theme.php +++ b/contrib/pm/theme.php @@ -5,12 +5,7 @@ class PrivMsgTheme extends Themelet { global $user; $html = " - - +
"; $n = 0; @@ -49,8 +44,8 @@ class PrivMsgTheme extends Themelet { $auth -
SubjectFromDateAction
- +
Subject:
+
Subject:
diff --git a/themes/default/style.css b/themes/default/style.css index 2b7824a7..c39a123a 100644 --- a/themes/default/style.css +++ b/themes/default/style.css @@ -65,7 +65,7 @@ TABLE.zebra TR:nth-child(even) {background: #E0E0E0;} TABLE.form TD, TABLE.form TH {vertical-align: middle;} TABLE.form TBODY TD {text-align: left;} -TABLE.form TBODY TH {text-align: right; padding-right: 4px;} +TABLE.form TBODY TH {text-align: right; padding-right: 4px; width: 1%;} FOOTER { clear: both; From 5dd2886b53e919ce97966d3c0a70748afba7582d Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 13 Mar 2012 08:03:53 +0000 Subject: [PATCH 7/7] common shimmie styles --- themes/danbooru/style.css | 570 +++++++++++++++++++------------------- themes/default/style.css | 16 -- themes/futaba/style.css | 3 - themes/lite/style.css | 10 - themes/warm/style.css | 15 +- 5 files changed, 280 insertions(+), 334 deletions(-) diff --git a/themes/danbooru/style.css b/themes/danbooru/style.css index 3d6fefd8..96dd79f3 100644 --- a/themes/danbooru/style.css +++ b/themes/danbooru/style.css @@ -1,291 +1,279 @@ -.noleft{ -padding-left:20px; -} -HEADER { -margin-bottom:1em; -} -HEADER #site-title { -padding:10px 20px 0; -} -HEADER ul#navbar { -margin:0; -padding:5px 20px 2px 10px; -} -HEADER ul#navbar li { -font-size:120%; -margin:0; -padding:0 10px 2px; -} -HEADER ul#navbar li.current-page { -background-color:#F7F7FF; -} -HEADER ul#navbar li.current-page a { -font-weight:bold; -} -HEADER ul#subnavbar { -background-color:#F7F7FF; -margin:0 0 1em; -padding:5px 20px 5px 15px; -} -HEADER ul#subnavbar li { -padding:0 5px; -} -HEADER #site-title { -padding:10px 20px 0; -} -body { --x-system-font:none; -background-color:#FFFFFF; -font-family:verdana,sans-serif; -font-size:80%; -font-size-adjust:none; -font-stretch:normal; -font-style:normal; -font-variant:normal; -font-weight:normal; -line-height:normal; -} -h1 { -font-size:2em; -margin-bottom:0; -margin-top:0; -padding:2px; -} -h1 a { -color:black; -} -h3 { -font-size:1.2em; -margin-bottom:0; -margin-top:0.5em; -padding:1px; -} -h4 { -font-size:1.4em; -} -h5 { -font-size:1.2em; -} -table.zebra {border-collapse: collapse;border-spacing: 0;} -table.zebra > tbody > tr:hover {background: #FFD;} -table.zebra th {color: #171BB3; padding-right: 8px;} -table.zebra td {border: 1px dotted #EEE;margin: 0;padding-right: 8px;} -table.zebra th {margin: 0;text-align: left;} -thead { --moz-background-clip:border; --moz-background-inline-policy:continuous; --moz-background-origin:padding; -font-weight:bold; -} -td { -vertical-align:top; -} -#subtitle { -border-top:medium none; -font-size:0.75em; -margin:auto; -text-align:center; -width:256px; -} -ARTICLE select { -width:150px; -} -td > input[type="submit"] {width: 100%;} -td > input[type="text"] {width: 100%;} -td > input[type="password"] {width: 100%;} -FOOTER { -clear:both; -color:#CCCCCC; -font-size:0.9em; -padding-left:10px; -padding-top:8px; -} -[onclick] { -cursor:pointer; -} -img { -border:medium none; -} -form { -margin:0; -} -a { -text-decoration:none; -} -a:hover { -text-decoration:underline; -} -NAV { -float:left; -text-align:left; -width:150px; -padding:5px 20px 2px 10px; -} -NAV table { -width:150px; -} -NAV td { -vertical-align:middle; -} -NAV input { -padding:0; -width:100%; -} -NAV select { -padding:0; -width:100%; -} -NAV h3 { -text-align:left; -} -#comments p { -max-width:150px; -overflow:hidden; -text-align:left; -width:150px; -} -.tag_count { -color:#AAAAAA; -} -.more { -content:"More "; -} -.comment { -margin-bottom:8px; -} -.comment .meta { -width: 150px; -color: gray; -} -.comment TD { -text-align: left; -} -.withleft { -margin-left:180px; -} -div#paginator { -clear:both; -display:block; -font-size:1em; -font-weight:bold; -padding:2em 0 1em; -text-align:center; -} -.paginator { -margin:16px; -text-align:center; -} -div#paginator b { -margin:3px; -padding:4px 8px; -} -div#paginator a { -border:1px solid #EEEEEE; -margin:3px; -padding:4px 8px; -} -div#paginator a:hover { --moz-background-clip:border; --moz-background-inline-policy:continuous; --moz-background-origin:padding; -background:blue none repeat scroll 0 0; -border:1px solid #EEEEEE; -color:white; -} -span.thumb { -display:inline-block; -float:left; -height:220px; -text-align:center; -width:220px; -} -#pagelist { -margin-top:32px; -} -#large_upload_form { -width:600px; -} -.setupblock { -border:1px solid #AAAAAA; -margin:16px; -padding:8px; -width:350px; -} -.helpable { -border-bottom:1px dashed gray; -} -.ok { --moz-background-clip:border; --moz-background-inline-policy:continuous; --moz-background-origin:padding; -background:#AAFFAA none repeat scroll 0 0; -} -.bad { --moz-background-clip:border; --moz-background-inline-policy:continuous; --moz-background-origin:padding; -background:#FFAAAA none repeat scroll 0 0; -} -.comment .username { -font-size:1.5em; -font-weight:bold; -} -HEADER { -text-align:left; -} -HEADER h1 { -text-align:left; -} -* { -font-family:verdana,sans-serif; -margin:0; -padding:0; -} -a:link { -color:#006FFA; -text-decoration:none; -} -a:visited { -color:#006FFA; -text-decoration:none; -} -a:hover { -color:#33CFFF; -text-decoration:none; -} -a:active { -color:#006FFA; -text-decoration:none; -} -ul.flat-list { -display:block; -margin:0; -padding:0; -} -ul.flat-list * { -display:inline; -text-align:left; -} -ul.flat-list li { -font-weight:bold; -list-style-type:none; -margin:0 1.3em 0 0; -text-align:left; -} -ul.flat-list li a { -font-weight:normal; -} -#tips { -margin-left:16px; -} -#blotter1 { -margin-left:16px; -margin-right:16px; -font-size: 90%; -position: relative; -} -#blotter2 { -margin-left:16px; -margin-right:16px; -font-size: 90%; -} +.noleft{ +padding-left:20px; +} +HEADER { +margin-bottom:1em; +} +HEADER #site-title { +padding:10px 20px 0; +} +HEADER ul#navbar { +margin:0; +padding:5px 20px 2px 10px; +} +HEADER ul#navbar li { +font-size:120%; +margin:0; +padding:0 10px 2px; +} +HEADER ul#navbar li.current-page { +background-color:#F7F7FF; +} +HEADER ul#navbar li.current-page a { +font-weight:bold; +} +HEADER ul#subnavbar { +background-color:#F7F7FF; +margin:0 0 1em; +padding:5px 20px 5px 15px; +} +HEADER ul#subnavbar li { +padding:0 5px; +} +HEADER #site-title { +padding:10px 20px 0; +} +body { +-x-system-font:none; +background-color:#FFFFFF; +font-family:verdana,sans-serif; +font-size:80%; +font-size-adjust:none; +font-stretch:normal; +font-style:normal; +font-variant:normal; +font-weight:normal; +line-height:normal; +} +h1 { +font-size:2em; +margin-bottom:0; +margin-top:0; +padding:2px; +} +h1 a { +color:black; +} +h3 { +font-size:1.2em; +margin-bottom:0; +margin-top:0.5em; +padding:1px; +} +h4 { +font-size:1.4em; +} +h5 { +font-size:1.2em; +} +table.zebra {border-collapse: collapse;border-spacing: 0;} +table.zebra > tbody > tr:hover {background: #FFD;} +table.zebra th {color: #171BB3; padding-right: 8px;} +table.zebra td {border: 1px dotted #EEE;margin: 0;padding-right: 8px;} +table.zebra th {margin: 0;text-align: left;} +thead { +-moz-background-clip:border; +-moz-background-inline-policy:continuous; +-moz-background-origin:padding; +font-weight:bold; +} +td { +vertical-align:top; +} +#subtitle { +border-top:medium none; +font-size:0.75em; +margin:auto; +text-align:center; +width:256px; +} +FOOTER { +clear:both; +color:#CCCCCC; +font-size:0.9em; +padding-left:10px; +padding-top:8px; +} +form { +margin:0; +} +a { +text-decoration:none; +} +a:hover { +text-decoration:underline; +} +NAV { +float:left; +text-align:left; +width:150px; +padding:5px 20px 2px 10px; +} +NAV table { +width:150px; +} +NAV td { +vertical-align:middle; +} +NAV input { +padding:0; +width:100%; +} +NAV select { +padding:0; +width:100%; +} +NAV h3 { +text-align:left; +} +#comments p { +max-width:150px; +overflow:hidden; +text-align:left; +width:150px; +} +.tag_count { +color:#AAAAAA; +} +.more { +content:"More â"; +} +.comment { +margin-bottom:8px; +} +.comment .meta { +width: 150px; +color: gray; +} +.comment TD { +text-align: left; +} +.withleft { +margin-left:180px; +} +div#paginator { +clear:both; +display:block; +font-size:1em; +font-weight:bold; +padding:2em 0 1em; +text-align:center; +} +.paginator { +margin:16px; +text-align:center; +} +div#paginator b { +margin:3px; +padding:4px 8px; +} +div#paginator a { +border:1px solid #EEEEEE; +margin:3px; +padding:4px 8px; +} +div#paginator a:hover { +-moz-background-clip:border; +-moz-background-inline-policy:continuous; +-moz-background-origin:padding; +background:blue none repeat scroll 0 0; +border:1px solid #EEEEEE; +color:white; +} +span.thumb { +display:inline-block; +float:left; +height:220px; +text-align:center; +width:220px; +} +#pagelist { +margin-top:32px; +} +#large_upload_form { +width:600px; +} +.setupblock { +border:1px solid #AAAAAA; +margin:16px; +padding:8px; +width:350px; +} +.helpable { +border-bottom:1px dashed gray; +} +.ok { +-moz-background-clip:border; +-moz-background-inline-policy:continuous; +-moz-background-origin:padding; +background:#AAFFAA none repeat scroll 0 0; +} +.bad { +-moz-background-clip:border; +-moz-background-inline-policy:continuous; +-moz-background-origin:padding; +background:#FFAAAA none repeat scroll 0 0; +} +.comment .username { +font-size:1.5em; +font-weight:bold; +} +HEADER { +text-align:left; +} +HEADER h1 { +text-align:left; +} +* { +font-family:verdana,sans-serif; +margin:0; +padding:0; +} +a:link { +color:#006FFA; +text-decoration:none; +} +a:visited { +color:#006FFA; +text-decoration:none; +} +a:hover { +color:#33CFFF; +text-decoration:none; +} +a:active { +color:#006FFA; +text-decoration:none; +} +ul.flat-list { +display:block; +margin:0; +padding:0; +} +ul.flat-list * { +display:inline; +text-align:left; +} +ul.flat-list li { +font-weight:bold; +list-style-type:none; +margin:0 1.3em 0 0; +text-align:left; +} +ul.flat-list li a { +font-weight:normal; +} +#tips { +margin-left:16px; +} +#blotter1 { +margin-left:16px; +margin-right:16px; +font-size: 90%; +position: relative; +} +#blotter2 { +margin-left:16px; +margin-right:16px; +font-size: 90%; +} diff --git a/themes/default/style.css b/themes/default/style.css index c39a123a..284119b8 100644 --- a/themes/default/style.css +++ b/themes/default/style.css @@ -45,15 +45,6 @@ TD { vertical-align: top; text-align: center; } -ARTICLE SELECT {width: 150px;} -INPUT, TEXTAREA {box-sizing: border-box;} -TD>INPUT[type="button"] {width: 100%;} -TD>INPUT[type="submit"] {width: 100%;} -TD>INPUT[type="text"] {width: 100%;} -TD>INPUT[type="password"] {width: 100%;} -TD>TEXTAREA {width: 100%;} -TD>SELECT {width: 100%;} -[onclick] {cursor:pointer;} TABLE.zebra {border-spacing: 0px; border: 2px solid #CCC;} TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} @@ -63,10 +54,6 @@ TABLE.zebra TR TD {border-bottom: 1px solid #DDD;} TABLE.zebra TR:nth-child(odd) {background: #EFEFEF;} TABLE.zebra TR:nth-child(even) {background: #E0E0E0;} -TABLE.form TD, TABLE.form TH {vertical-align: middle;} -TABLE.form TBODY TD {text-align: left;} -TABLE.form TBODY TH {text-align: right; padding-right: 4px; width: 1%;} - FOOTER { clear: both; font-size: 0.7em; @@ -75,9 +62,6 @@ FOOTER { border: 1px solid #AAA; } -*[onclick] {cursor: pointer;} -IMG {border: none;} -FORM {margin: 0px;} A {text-decoration: none;} A:hover {text-decoration: underline;} diff --git a/themes/futaba/style.css b/themes/futaba/style.css index 10259612..f58cbda1 100644 --- a/themes/futaba/style.css +++ b/themes/futaba/style.css @@ -28,9 +28,6 @@ FOOTER { text-align: center; } -*[onclick] {cursor: pointer;} -IMG {border: none;} -FORM {margin: 0px;} A, A:visited {text-decoration: none; color: #0000EE;} A:hover {text-decoration: underline; color: #DD0000;} HR {border: none; border-top: 1px solid #D9BFB7; height: 0px; clear: both;} diff --git a/themes/lite/style.css b/themes/lite/style.css index c61cded0..1560e7d0 100644 --- a/themes/lite/style.css +++ b/themes/lite/style.css @@ -133,13 +133,6 @@ CODE { border-top: none; background: #DDD; } -ARTICLE SELECT {width: 150px;} -TD>INPUT[type="submit"] {width: 100%;} -TD>INPUT[type="text"] {width: 100%;} -TD>INPUT[type="password"] {width: 100%;} -TD>TEXTAREA {width: 100%;} -TD>SELECT {width: 100%;} -[onclick] {cursor:pointer;} TABLE.zebra {border-spacing: 0px; border: 2px solid #C3D2E0;} TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} @@ -173,9 +166,6 @@ FOOTER { background: #E3EFFA; } -*[onclick] {cursor: pointer;} -IMG {border: none;} -FORM {margin: 0px;} A {text-decoration: none;} A:hover {text-decoration: underline;} diff --git a/themes/warm/style.css b/themes/warm/style.css index eb9b1c61..9a6b6be9 100644 --- a/themes/warm/style.css +++ b/themes/warm/style.css @@ -1,6 +1,6 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -3 things common to all pages * +* things common to all pages * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ BODY { @@ -50,12 +50,6 @@ CODE { border-top: none; background: #DDD; } -ARTICLE SELECT {width: 150px;} -INPUT, TEXTAREA {box-sizing: border-box;} -TD>INPUT[type="submit"] {width: 100%;} -TD>INPUT[type="text"] {width: 100%;} -TD>INPUT[type="password"] {width: 100%;} -TD>SELECT {width: 100%;} TABLE.zebra {border-spacing: 0px; border: 1px solid #B89F7C; } TABLE.zebra TD, TABLE.zebra TH {vertical-align: middle; padding: 4px;} @@ -65,10 +59,6 @@ TABLE.zebra TD {border-top: 1px solid #B89F7C;} TABLE.zebra TR:nth-child(odd) {background: #FCD9A9;} TABLE.zebra TR:nth-child(even) {background: #DABC92;} -TABLE.form TD, TABLE.form TH {vertical-align: middle;} -TABLE.form TBODY TD {text-align: left;} -TABLE.form TBODY TH {text-align: right; padding-right: 4px;} - FOOTER { clear: both; padding: 8px; @@ -78,9 +68,6 @@ FOOTER { background: #FCD9A9; } -*[onclick] {cursor: pointer;} -IMG {border: none;} -FORM {margin: 0px;} A {color: #665844; text-decoration: none; font-weight: bold;} A:hover {color: #665844; text-decoration: underline;} A:visited {color: #665844; text-decoration: none}