diff --git a/inc/html.php b/inc/html.php index 6da31045a31b7bc22ae3f83711e5177865ae4fc8..0255670e312aa3362f6b40cd5fc1a1d0c48d13f6 100644 --- a/inc/html.php +++ b/inc/html.php @@ -1044,7 +1044,7 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed? </tr> <tr> <td colspan="3"> - <textarea name="wikitext" id="wikitext" <?=$ro?> cols="80" rows="10" class="edit" onchange="textChanged = true;" tabindex="1"><?="\n".formText($text)?></textarea> + <textarea name="wikitext" id="wikitext" <?=$ro?> cols="80" rows="10" class="edit" onchange="textChanged = true;" onkeyup="summaryCheck();" tabindex="1"><?="\n".formText($text)?></textarea> </td> </tr> <tr> @@ -1058,7 +1058,7 @@ function html_edit($text=null,$include='edit'){ //FIXME: include needed? <td> <?if($wr){?> <?=$lang['summary']?>: - <input type="text" class="edit" name="summary" size="50" value="<?=formText($SUM)?>" tabindex="2" /> + <input type="text" class="edit" name="summary" id="summary" size="50" onkeyup="summaryCheck();" value="<?=formText($SUM)?>" tabindex="2" /> <?}?> </td> <td align="right"> @@ -1153,4 +1153,4 @@ function html_debug(){ print '</body></html>'; } -?> +?> \ No newline at end of file diff --git a/script.js b/script.js index 239f94b07bfa850be2ff030cb571a20ac8b7e638..db22d32b151f504398c88ff39c17780bec4b43ec 100644 --- a/script.js +++ b/script.js @@ -30,6 +30,22 @@ function escapeQuotes(text) { return text; } +/** + * Checks if a summary was entered - if not the style is changed + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function summaryCheck(){ + if(document.getElementById){ + var sum = document.getElementById('summary'); + if(sum.value == ''){ + sum.className='missing'; + }else{ + sum.className='edit'; + } + } +} + /** * This function generates the actual toolbar buttons with localized text * we use it to avoid creating the toolbar where javascript is not enabled diff --git a/style.css b/style.css index ab730dbdc16c80461b67191860d96d5653aa6c89..93c7c3341737dfd304c59bd9a005171ed91627af 100644 --- a/style.css +++ b/style.css @@ -1,4 +1,3 @@ - body { font: 80% "Lucida Grande", Verdana, Lucida, Helvetica, Arial, sans-serif; background-color: White; @@ -89,6 +88,19 @@ input.edit { display: inline; } +input.missing { + font-size: 100%; + border: 1px solid #8cacbb; + height: 22px ! important; + max-height: 22px ! important; + min-height: 22px ! important; + color: Black; + background-color: #ffcccc; + vertical-align: middle; + padding: 1px; + display: inline; +} + input.button { border: 1px solid #8cacbb; color: Black; @@ -153,24 +165,21 @@ span.user{ } div.error{ - background: transparent url(images/error.png) 0.5em 0px no-repeat; - background-color: #ff6666; + background: #ff6666; url(images/error.png) 0.5em 0px no-repeat; font-size: 90%; margin: 0px; padding-left: 3em; } div.info{ - background: transparent url(images/info.png) 0.5em 0px no-repeat; - background-color: #ffff66; + background: #ffff66; url(images/info.png) 0.5em 0px no-repeat; font-size: 90%; margin: 0; padding-left: 3em; } div.success{ - background: transparent url(images/thumbup.gif) 0.5em 0px no-repeat; - background-color: #66ff66; + background: #66ff66; url(images/thumbup.gif) 0.5em 0px no-repeat; font-size: 90%; margin: 0; padding-left: 3em;