Author: andre
Date: 2009-06-26 17:47:12 +0200 (Fri, 26 Jun 2009)
New Revision: 36442
Modified:
openimages/trunk/src/main/webapp/style/css/editors.css
openimages/trunk/src/main/webapp/style/js/mmajaxeditor.js
Log:
better message reports
Modified: openimages/trunk/src/main/webapp/style/css/editors.css
===================================================================
--- openimages/trunk/src/main/webapp/style/css/editors.css 2009-06-26
10:51:14 UTC (rev 36441)
+++ openimages/trunk/src/main/webapp/style/css/editors.css 2009-06-26
15:47:12 UTC (rev 36442)
@@ -25,6 +25,7 @@
{
padding: 0;
margin: 2px 0;
+ list-style: none;
}
/* pagina layout */
@@ -58,9 +59,11 @@
div#content
{
float: left;
- width: 600px;
+ width: 580px;
margin-bottom: 120px;
+ /*background-color: #efefef;*/
/*border: 1px solid #666;*/
+ padding-right: 20px;
}
div#sidebar
@@ -68,6 +71,7 @@
float: right;
width: 380px;
margin-bottom: 120px;
+ /*background-color: #cfcfcf;*/
/*border: 1px solid #666;*/
}
@@ -109,7 +113,7 @@
/* navigatie */
#topnav
{
- height: 34px;
+ height: 32px;
margin-bottom: 10px;
background-color: #666;
width: 100%;
@@ -119,8 +123,9 @@
#nav
{
float: left;
+ width: 100%;
margin: 0;
- padding: 11px 0 0 12px;
+ padding: 10px 0 0 20px;
list-style: none;
background: #666 url(images/nav_bg666.png) repeat-x bottom left;
}
@@ -144,7 +149,7 @@
text-decoration: none;
border: 1px solid #666;
border-bottom: none;
- background: #ccc;
+ background-color: #ccc;
}
/* selected tabs and hover */
@@ -190,7 +195,7 @@
p.msg, div.msg, p.err, div.err
{
- margin: 4px 0 4px 0;
+ margin: 8px 0;
padding: 0.5em;
}
@@ -380,11 +385,19 @@
div.mmajaxeditor
{
- border: 2px #030 solid;
+ border: 1px #030 solid;
background: #efefef;
- padding: 6px;
+ padding: 6px 6px 0 6px;
+ margin: 6px 0;
+ width: 100%;
}
+div.mmajaxeditor p
+{
+ margin: 0;
+ padding: 0;
+}
+
a.mmajaxeditor_close
{
background-image: url(../../mmbase/style/images/cancel.png);
@@ -395,33 +408,6 @@
color: transparent;
}
-div.alert p
-{
- margin: 0;
- width: 340px;
- padding: 8px;
- border: 2px solid #666;
- border-top: none;
- background-color: #efefef;
-}
-
-div.alert div p
-{
- padding: 0 0 6px 0;
- margin: 0;
- width: auto;
-}
-
-div.alert h4
-{
- margin-bottom: 0;
- padding: 6px 8px 6px 8px;
- width: 340px;
- color: #000;
- background-color: #FC0;
- border: 2px solid #666;
-}
-
div#content div.mm_related
{
border: 1px #ccc solid;
Modified: openimages/trunk/src/main/webapp/style/js/mmajaxeditor.js
===================================================================
--- openimages/trunk/src/main/webapp/style/js/mmajaxeditor.js 2009-06-26
10:51:14 UTC (rev 36441)
+++ openimages/trunk/src/main/webapp/style/js/mmajaxeditor.js 2009-06-26
15:47:12 UTC (rev 36442)
@@ -66,7 +66,7 @@
MMAjaxeditor.prototype.bindFormEvents = function() {
// bind save with form plugin
- var options = { target: this.div, success: this.afterSubmit };
+ var options = { target: '#mmajaxeditor-msg', success: this.afterSubmit
};
$(this.div).find("form").ajaxForm(options);
if (typeof MMBaseValidator == "function") {
@@ -107,24 +107,23 @@
// this function gets the response passed from ajaxForm()
// so, 'this' contains the returned form/html (not the current
mmmajaxeditor div)
$("#" + this.id).removeClass("mmajaxeditor");
- $(this).find(".msg").fadeOut(4000);
-
- $(this).find("a.mmajaxeditor").click(function(ev) {
- ev.preventDefault();
- var anchor = ev.target;
- new MMAjaxeditor(anchor);
- });
+ $(this).find(".msg").hide(); // find the msg from the result and
hide it
+ var msg = $(this).find('.msg').text(); // but get its text
- $(document).ready(function() {
- setTimeout(reload, 4500);
- });
+ var loc = "" + document.location;
+ var pos = loc.indexOf('msg=');
+ if (pos > -1) {
+ var epos = loc.indexOf(pos, '&');
+ if (epos < 0) epos = loc.length;
+ var start = loc.substring(0, pos);
+ var end = loc.substring(epos, loc.length);
+ loc = start + end;
+ }
+ var connector = (loc.indexOf('?') > -1) ? '&' : '?';
+ loc = loc + connector + "msg=" + msg;
+ document.location = loc;
}
-function reload() {
- document.location.reload();
-}
-
-
/*
* Returns the parameters from a query string in an object.
*/
@@ -150,7 +149,16 @@
});
}
+function initHideMsg() {
+ setTimeout("hideMsg();", 10000);
+}
+
+function hideMsg() {
+ $('p.msg').slideUp(800);
+}
+
$(document).ready(function() {
prepMMAjaxeditor();
+ initHideMsg();
});
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs