Add a small cross to close notifications

This commit is contained in:
Eike Foken
2011-08-11 17:46:10 +02:00
parent 808faf8e1a
commit 6de1d1850a
2 changed files with 51 additions and 60 deletions

View File

@@ -1,33 +1,16 @@
<?
/*
* Copyright (c) 2011 Karsten Heiken <karsten@disposed.de>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
if (is_array($messages)):
<?php
if (is_array($messages)):
foreach ($messages as $type => $msgs):
if (count($msgs > 0)):
foreach ($msgs as $message):
echo ('<div class="' . $type .'">' . $message . '</div>');
?>
<div class="<?=$type;?>">
<?=$message;?>
<a href="javascript:void(0);" onclick="$(this).parent().hide()" class="cross"><span>X</span></a>
</div>
<?php
endforeach;
endif;
endforeach;
endif;
endif;
?>

View File

@@ -21,39 +21,47 @@ p { margin: 0px 0px 20px 0px; line-height: 18px;}
ul { margin: 5px 0px 15px 0px; padding: 0px;}
li { margin-left: 20px;}
div.notice {
margin: 0 0 15px;
padding: 0 10px;
background: #fffbcc;
border: 1px solid #e6db55;
line-height: 25px;
color: #222;
}
div.success {
margin: 0 0 15px;
padding: 0 10px;
background: #d1ecb8;
border: 1px solid #81c445;
line-height: 25px;
color: #222;
}
div.error {
margin: 0 0 15px;
padding: 0 10px;
background: #ffebe8;
border: 1px solid #f0baa2;
line-height: 25px;
color: #222;
}
.editable {
background: #fffbcc;
}
.clear { clear:both;}
/* Notifications */
#notifications div {
margin: 0 0 15px;
padding: 0 10px;
line-height: 25px;
color: #222;
}
#notifications div a.cross {
float: right;
background: url(../images/icons/cross-small.png) right center no-repeat;
width: 16px;
height: 25px;
}
#notifications div a.cross span {
display: none;
}
div.notice {
background: #fffbcc;
border: 1px solid #e6db55;
}
div.success {
background: #d1ecb8;
border: 1px solid #81c445;
}
div.error {
background: #ffebe8;
border: 1px solid #f0baa2;
}
/* Header */
#header {