From d2535f46bcb57b44be3b5d745ece8da3f72b40c6 Mon Sep 17 00:00:00 2001 From: dave Date: Sun, 13 Sep 2009 19:25:03 +0000 Subject: [PATCH] - Add status area on each page for award div - Redirect all ajax load output to a debug div (which can be turned on with debug=true). The output has to go somewhere, and it can't go to the notification div, because it will overwrite what's already there. The ajax methods emit javascript now to add notifications. --- admin/award_awards.php | 34 +++++++++++++++++++--------------- common.inc.php | 1 + sfiab.js | 28 ++++++++++++++-------------- theme/default/sfiab.css | 5 +++++ 4 files changed, 39 insertions(+), 29 deletions(-) diff --git a/admin/award_awards.php b/admin/award_awards.php index 121711e..84b22d2 100644 --- a/admin/award_awards.php +++ b/admin/award_awards.php @@ -65,7 +65,7 @@ criteria='".mysql_escape_string(stripslashes($_POST['criteria']))."', description='".mysql_escape_string(stripslashes($_POST['description']))."' WHERE id='$id'"; - echo happy(i18n('Award Info Saved')); + happy_("Award Information Saved."); mysql_query($q); exit; @@ -111,7 +111,7 @@ mysql_query("INSERT INTO award_awards_projectdivisions (award_awards_id,projectdivisions_id,year) VALUES ('$id','$div','{$config['FAIRYEAR']}')"); } - echo happy(i18n("Saved.")); + happy_("Saved."); exit; case 'prize_order': @@ -122,7 +122,7 @@ mysql_query("UPDATE `award_prizes` SET `order`='$order' WHERE `id`='$id'"); } // print_r($_GET); -// echo happy(i18n("Order Updated.")); + happy_("Order Updated."); exit; case 'award_order': @@ -132,7 +132,7 @@ $order++; mysql_query("UPDATE `award_awards` SET `order`='$order' WHERE `id`='$id'"); } -// echo happy(i18n("Order Updated.")); + happy_("Order Updated."); exit; case 'prizeinfo_load': @@ -183,14 +183,14 @@ mysql_query($q); // echo $q; // echo mysql_error(); - echo happy(i18n("Prize saved")); + happy_("Prize saved"); exit; case 'prize_delete': $id = intval($_GET['id']); mysql_query("DELETE FROM award_prizes WHERE id='$id'"); // echo "DELETE FROM award_prizes WHERE id='$id'"; - echo happy(i18n("Prize deleted")); + happy_("Prize deleted"); exit; case 'feeder_load': @@ -207,6 +207,7 @@ case 'feeder_save': // print_r($_POST); + $id = intval($_POST['award_awards_id']); $dl = is_array($_POST['feeder_dl']) ? $_POST['feeder_dl'] : array(); $ul = is_array($_POST['feeder_ul']) ? $_POST['feeder_ul'] : array(); @@ -245,6 +246,7 @@ function update_awardinfo() { var id = award_id; // alert("id="+award_id); + notice_div_id('award_notice'); $.getJSON("?action=awardinfo_load&id="+id, function(json){ $("#awardinfo_id").val(json.id); @@ -265,13 +267,14 @@ function update_awardinfo() function awardinfo_save() { - $("#awardinfo_info").load("?action=awardinfo_save", $("#awardinfo").serializeArray()); + $("#debug").load("?action=awardinfo_save", $("#awardinfo").serializeArray()); return 0; } function update_eligibility() { var id = award_id; + notice_div_id('eligibility_notice'); $.getJSON("?action=eligibilty_load&id="+id, function(json){ $("#eligibility_id").val(json.id); @@ -299,6 +302,7 @@ function prizelist_refresh() function update_prizeinfo() { var id = award_id; + notice_div_id('prize_notice'); $.getJSON("?action=prizeinfo_load&id="+id, function(json) { $(".prizelist_tr").remove(); @@ -343,13 +347,13 @@ function edit_prize(id) function eligibility_save() { - $("#eligibility_info").load("?action=eligibility_save", $("#eligibility").serializeArray()); + $("#debug").load("?action=eligibility_save", $("#eligibility").serializeArray()); return 0; } function prize_save() { - $("#prizeinfo_info").load("?action=prize_save", $("#prizeinfo").serializeArray()); + $("#debug").load("?action=prize_save", $("#prizeinfo").serializeArray()); update_prizeinfo(); return 0; } @@ -383,7 +387,7 @@ function prize_create() function update_feeder() { var id = award_id; - notice_div_id('feeder_info'); + notice_div_id('feeder_notice'); $.getJSON("?action=feeder_load&id="+id, function(json) { $("#feeder_id").val(id); @@ -396,7 +400,7 @@ function update_feeder() function feeder_save() { - $("#feeder_info").load("?action=feeder_save", $("#feeder_form").serializeArray()); + $("#debug").load("?action=feeder_save", $("#feeder_form").serializeArray()); return 0; } @@ -447,7 +451,7 @@ $(document).ready(function() {

-
+
@@ -506,7 +510,7 @@ $(document).ready(function() {

-
+
@@ -542,7 +546,7 @@ $(document).ready(function() {
-
+


@@ -607,7 +611,7 @@ $(document).ready(function() {
-
+

diff --git a/common.inc.php b/common.inc.php index 5bdee62..a26077d 100644 --- a/common.inc.php +++ b/common.inc.php @@ -602,6 +602,7 @@ if(substr($config['version'], -1) % 2 != 0) } echo "SFIAB Version ".$config['version']."{$extra}"; ?> +
diff --git a/sfiab.js b/sfiab.js index 298ec9d..13a8266 100644 --- a/sfiab.js +++ b/sfiab.js @@ -44,33 +44,33 @@ var _notice_div_id = 'notice_div'; function notice_delete(id) { - $("notice_"+_notice_id).remove(); + $("#notice_"+id).slideUp('slow', function() { + $("#notice_"+id).remove(); + }); } function notice_create(type,str,timeout) { _notice_id++; - var style="padding: 0.1em 0; text-align: center;"; - $("#"+_notice_div_id).append("
"+str+"

"); - $("#"+_notice_div_id).fadeTo('fast', 0.75); - setTimeout(function() { - $("#notice_"+_notice_id).slideUp('slow', function() { notice_delete(_notice_id); }); - }, timeout); + var style="padding: 0.1em 0; text-align: center; position: relative; "; + $("#"+_notice_div_id).append("
"+str+"
"); + $("#"+_notice_div_id).fadeTo('fast', 0.85); + $("#notice_"+_notice_id).effect('bounce'); + setTimeout("notice_delete("+_notice_id+")", timeout); } function notice_div_id(id) { + if(id == '') id = 'notice_div'; + var par = $("#"+id).parent(); var o = par.offset(); var w = par.outerWidth(); -// var h = par.outerHeight(); -// $("#"+id).css( { "left": 0, "top": 0 } ); - $("#"+id).css( { left: o.left+"px", top: o.top+"px" } ); - $("#"+id).css( { width: w+"px"} ); + $("#"+id).css( { left: o.left+"px", top: o.top+"px", width: w+"px"} ); +// $("#"+id).css( { left: 0, top: 0, width: "100%" }); $("#"+id).show(); - - if(id == '') _notice_div_id = 'notice_div'; - else _notice_div_id = id; + + _notice_div_id = id; } diff --git a/theme/default/sfiab.css b/theme/default/sfiab.css index a1f1972..f8ad78b 100644 --- a/theme/default/sfiab.css +++ b/theme/default/sfiab.css @@ -331,6 +331,7 @@ tr.externalaward { } #FadeScreenDiv { + filter:alpha(opacity=50); -moz-opacity:.50; opacity:.50; position: fixed; @@ -371,6 +372,10 @@ tr.externalaward { padding: 2px; } +div.notice_area { + position: fixed; +} + /* The popup windows created with jquery-ui use the following classes: * div.ui-dialog * div.ui-dialog-titlebar - includes the next 2 items in the div