# HG changeset patch # User Pawel Solyga # Date 1236195081 0 # Node ID 42b8e294792e0b0d42f506e4bae7bde8351da2f9 # Parent c7e05dafaede74b22c4af6b6c7ee4f357dd0474c Add date postfix to the filename of each our JS or CSS files that still don't have it. Update filename changes in soc/base.html template. Patch by: Pawel Solyga Reviewed by: to-be-reviewed diff -r c7e05dafaede -r 42b8e294792e app/soc/content/css/jquery-autocomplete-090304.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/css/jquery-autocomplete-090304.css Wed Mar 04 19:31:21 2009 +0000 @@ -0,0 +1,48 @@ +.ac_results { + padding: 0px; + border: 1px solid black; + background-color: white; + overflow: hidden; + z-index: 99999; +} + +.ac_results ul { + width: 100%; + list-style-position: outside; + list-style: none; + padding: 0; + margin: 0; +} + +.ac_results li { + margin: 0px; + padding: 2px 5px; + cursor: default; + display: block; + /* + if width will be 100% horizontal scrollbar will apear + when scroll mode will be used + */ + /*width: 100%;*/ + font: menu; + font-size: 12px; + /* + it is very important, if line-height not setted or setted + in relative units scroll will be broken in firefox + */ + line-height: 16px; + overflow: hidden; +} + +.ac_loading { + background: white url('/soc/content/images/loadingAnimation.gif') right center no-repeat; +} + +.ac_odd { + background-color: #eee; +} + +.ac_over { + background-color: #0A246A; + color: white; +} diff -r c7e05dafaede -r 42b8e294792e app/soc/content/css/jquery-autocomplete.css --- a/app/soc/content/css/jquery-autocomplete.css Wed Mar 04 19:00:44 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -.ac_results { - padding: 0px; - border: 1px solid black; - background-color: white; - overflow: hidden; - z-index: 99999; -} - -.ac_results ul { - width: 100%; - list-style-position: outside; - list-style: none; - padding: 0; - margin: 0; -} - -.ac_results li { - margin: 0px; - padding: 2px 5px; - cursor: default; - display: block; - /* - if width will be 100% horizontal scrollbar will apear - when scroll mode will be used - */ - /*width: 100%;*/ - font: menu; - font-size: 12px; - /* - it is very important, if line-height not setted or setted - in relative units scroll will be broken in firefox - */ - line-height: 16px; - overflow: hidden; -} - -.ac_loading { - background: white url('/soc/content/images/loadingAnimation.gif') right center no-repeat; -} - -.ac_odd { - background-color: #eee; -} - -.ac_over { - background-color: #0A246A; - color: white; -} diff -r c7e05dafaede -r 42b8e294792e app/soc/content/css/jquery-thickbox-090304.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/css/jquery-thickbox-090304.css Wed Mar 04 19:31:21 2009 +0000 @@ -0,0 +1,164 @@ +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +/* The line below breaks the notification area. */ +/* *{padding: 0; margin: 0;} */ + +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +#TB_window { + font: 12px Arial, Helvetica, sans-serif; + color: #333333; +} + +#TB_secondLine { + font: 10px Arial, Helvetica, sans-serif; + color:#666666; +} + +#TB_window a:link {color: #666666;} +#TB_window a:visited {color: #666666;} +#TB_window a:hover {color: #000;} +#TB_window a:active {color: #666666;} +#TB_window a:focus{color: #666666;} + +/* ----------------------------------------------------------------------------------------------------------------*/ +/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ +/* ----------------------------------------------------------------------------------------------------------------*/ +#TB_overlay { + position: fixed; + z-index:100; + top: 0px; + left: 0px; + height:100%; + width:100%; +} + +.TB_overlayMacFFBGHack {background: url('/soc/content/images/macFFBgHack.png') repeat;} +.TB_overlayBG { + background-color:#000; + filter:alpha(opacity=75); + -moz-opacity: 0.75; + opacity: 0.75; +} + +* html #TB_overlay { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_window { + position: fixed; + background: #ffffff; + z-index: 102; + color:#000000; + display:none; + border: 4px solid #525252; + text-align:left; + top:50%; + left:50%; +} + +* html #TB_window { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_window img#TB_Image { + display:block; + margin: 15px 0 0 15px; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; + border-top: 1px solid #666; + border-left: 1px solid #666; +} + +#TB_caption{ + height:25px; + padding:7px 30px 10px 25px; + float:left; +} + +#TB_closeWindow{ + height:25px; + padding:11px 25px 10px 0; + float:right; +} + +#TB_closeAjaxWindow{ + padding:7px 10px 5px 0; + margin-bottom:1px; + text-align:right; + float:right; +} + +#TB_ajaxWindowTitle{ + float:left; + padding:7px 0 5px 10px; + margin-bottom:1px; +} + +#TB_title{ + background-color:#e8e8e8; + height:27px; +} + +#TB_ajaxContent{ + clear:both; + padding:2px 15px 15px 15px; + overflow:auto; + text-align:left; + line-height:1.4em; +} + +#TB_ajaxContent.TB_modal{ + padding:15px; +} + +#TB_ajaxContent p{ + padding:5px 0px 5px 0px; +} + +#TB_load{ + position: fixed; + display:none; + height:13px; + width:208px; + z-index:103; + top: 50%; + left: 50%; + margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ +} + +* html #TB_load { /* ie6 hack */ +position: absolute; +margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); +} + +#TB_HideSelect{ + z-index:99; + position:fixed; + top: 0; + left: 0; + background-color:#fff; + border:none; + filter:alpha(opacity=0); + -moz-opacity: 0; + opacity: 0; + height:100%; + width:100%; +} + +* html #TB_HideSelect { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} + +#TB_iframeContent{ + clear:both; + border:none; + margin-bottom:-1px; + margin-top:1px; + _margin-bottom:1px; +} diff -r c7e05dafaede -r 42b8e294792e app/soc/content/css/jquery-thickbox.css --- a/app/soc/content/css/jquery-thickbox.css Wed Mar 04 19:00:44 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,164 +0,0 @@ -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -/* The line below breaks the notification area. */ -/* *{padding: 0; margin: 0;} */ - -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -#TB_window { - font: 12px Arial, Helvetica, sans-serif; - color: #333333; -} - -#TB_secondLine { - font: 10px Arial, Helvetica, sans-serif; - color:#666666; -} - -#TB_window a:link {color: #666666;} -#TB_window a:visited {color: #666666;} -#TB_window a:hover {color: #000;} -#TB_window a:active {color: #666666;} -#TB_window a:focus{color: #666666;} - -/* ----------------------------------------------------------------------------------------------------------------*/ -/* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/ -/* ----------------------------------------------------------------------------------------------------------------*/ -#TB_overlay { - position: fixed; - z-index:100; - top: 0px; - left: 0px; - height:100%; - width:100%; -} - -.TB_overlayMacFFBGHack {background: url('/soc/content/images/macFFBgHack.png') repeat;} -.TB_overlayBG { - background-color:#000; - filter:alpha(opacity=75); - -moz-opacity: 0.75; - opacity: 0.75; -} - -* html #TB_overlay { /* ie6 hack */ - position: absolute; - height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); -} - -#TB_window { - position: fixed; - background: #ffffff; - z-index: 102; - color:#000000; - display:none; - border: 4px solid #525252; - text-align:left; - top:50%; - left:50%; -} - -* html #TB_window { /* ie6 hack */ -position: absolute; -margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); -} - -#TB_window img#TB_Image { - display:block; - margin: 15px 0 0 15px; - border-right: 1px solid #ccc; - border-bottom: 1px solid #ccc; - border-top: 1px solid #666; - border-left: 1px solid #666; -} - -#TB_caption{ - height:25px; - padding:7px 30px 10px 25px; - float:left; -} - -#TB_closeWindow{ - height:25px; - padding:11px 25px 10px 0; - float:right; -} - -#TB_closeAjaxWindow{ - padding:7px 10px 5px 0; - margin-bottom:1px; - text-align:right; - float:right; -} - -#TB_ajaxWindowTitle{ - float:left; - padding:7px 0 5px 10px; - margin-bottom:1px; -} - -#TB_title{ - background-color:#e8e8e8; - height:27px; -} - -#TB_ajaxContent{ - clear:both; - padding:2px 15px 15px 15px; - overflow:auto; - text-align:left; - line-height:1.4em; -} - -#TB_ajaxContent.TB_modal{ - padding:15px; -} - -#TB_ajaxContent p{ - padding:5px 0px 5px 0px; -} - -#TB_load{ - position: fixed; - display:none; - height:13px; - width:208px; - z-index:103; - top: 50%; - left: 50%; - margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */ -} - -* html #TB_load { /* ie6 hack */ -position: absolute; -margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); -} - -#TB_HideSelect{ - z-index:99; - position:fixed; - top: 0; - left: 0; - background-color:#fff; - border:none; - filter:alpha(opacity=0); - -moz-opacity: 0; - opacity: 0; - height:100%; - width:100%; -} - -* html #TB_HideSelect { /* ie6 hack */ - position: absolute; - height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); -} - -#TB_iframeContent{ - clear:both; - border:none; - margin-bottom:-1px; - margin-top:1px; - _margin-bottom:1px; -} diff -r c7e05dafaede -r 42b8e294792e app/soc/content/css/ui.datetimepicker-090304.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/css/ui.datetimepicker-090304.css Wed Mar 04 19:31:21 2009 +0000 @@ -0,0 +1,178 @@ +/* Main Dark Style Sheet for jQuery UI Datepicker */ + #datetimepicker_div, .datetimepicker_inline { + font-family: Arial, Helvetica, sans-serif; + font-size: 14px; + padding: 0; + margin: 0; + background: #222; + width: 185px; +} + #datetimepicker_div { + display: none; + border: 1px solid #07F; + z-index: 10; +} + .datetimepicker_inline { + float: left; + display: block; + border: 0; +} + .datetimepicker_dialog { + padding: 5px !important; + border: 4px ridge #222 !important; +} + button.datetimepicker_trigger { + width: 25px; +} + img.datetimepicker_trigger { + margin: 2px; + vertical-align: middle; +} + .datetimepicker_prompt { + float: left; + padding: 2px; + background: #222; + color: snow; +} +*html .datetimepicker_prompt { + width: 185px; +} + .datetimepicker_control, .datetimepicker_links, .datetimepicker_header, .datetimepicker { + clear: both; + float: left; + width: 100%; + color: #111; +} + .datetimepicker_control { + background: #469; + padding: 2px 0px; +} + .datetimepicker_links { + background: #347; + padding: 2px 0px; +} + .datetimepicker_control, .datetimepicker_links { + font-weight: bold; + font-size: 80%; + letter-spacing: 1px; +} + .datetimepicker_links label { + padding: 2px 5px; + color: #888; +} + .datetimepicker_clear, .datetimepicker_prev { + float: left; + width: 34%; +} + .datetimepicker_current { + float: left; + width: 30%; + text-align: center; +} + .datetimepicker_close, .datetimepicker_next { + float: right; + width: 34%; + text-align: right; +} + .datetimepicker_header { + padding: 1px 0 3px; + background: #944; + text-align: center; + font-weight: bold; + /*height: 3em;*/ +} + .datetimepicker_header select { + background: #944; + color: snow; + border: 0px; + font-weight: bold; +} + .datetimepicker { + background: #333; + text-align: center; + font-size: 100%; +} + .datetimepicker a { + display: block; + width: 100%; +} + .datetimepicker .datetimepicker_titleRow { + background: #733; + color: snow; +} + .datetimepicker .datetimepicker_daysRow { + background: #111; + color: #AAA; +} + .datetimepicker_weekCol { + background: #733; + color: #FFF; +} + .datetimepicker .datetimepicker_daysCell { + color: snow; + border: 1px solid #222; +} + #datetimepicker .datetimepicker_daysCell a { + display: block; +} + .datetimepicker .datetimepicker_weekEndCell { + background: #444; +} + .datetimepicker .datetimepicker_daysCellOver { + background: #111; + border: 1px solid #999; +} + .datetimepicker .datetimepicker_unselectable { + color: #888; +} + .datetimepicker_today { + background: #944 !important; +} + .datetimepicker_currentDay { + background: #733 !important; +} + #datetimepicker_div a, .datetimepicker_inline a { + cursor: pointer; + margin: 0; + padding: 0; + background: none; + color: snow; +} + .datetimepicker_inline .datetimepicker_links a { + padding: 0 5px !important; +} + .datetimepicker_control a, .datetimepicker_links a { + padding: 2px 5px !important; + color: snow !important; +} + .datetimepicker_titleRow a { + color: snow !important; +} + .datetimepicker_control a: hover { + color: #ccc !important; +} + .datetimepicker_links a: hover, .datetimepicker_titleRow a: hover { + background: #111 !important; + color: #CCC !important; +} + .datetimepicker_multi .datetimepicker { + border: 1px solid #944; +} + .datetimepicker_oneMonth { + float: left; + width: 185px; +} + .datetimepicker_newRow { + clear: left; +} + .datetimepicker_cover { + display: none; + display/**/: block; + position: absolute; + z-index: -1; + filter: mask(); + top: -4px; + left: -4px; + width: 193px; + height: 200px; +} diff -r c7e05dafaede -r 42b8e294792e app/soc/content/css/ui.datetimepicker.css --- a/app/soc/content/css/ui.datetimepicker.css Wed Mar 04 19:00:44 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,178 +0,0 @@ -/* Main Dark Style Sheet for jQuery UI Datepicker */ - #datetimepicker_div, .datetimepicker_inline { - font-family: Arial, Helvetica, sans-serif; - font-size: 14px; - padding: 0; - margin: 0; - background: #222; - width: 185px; -} - #datetimepicker_div { - display: none; - border: 1px solid #07F; - z-index: 10; -} - .datetimepicker_inline { - float: left; - display: block; - border: 0; -} - .datetimepicker_dialog { - padding: 5px !important; - border: 4px ridge #222 !important; -} - button.datetimepicker_trigger { - width: 25px; -} - img.datetimepicker_trigger { - margin: 2px; - vertical-align: middle; -} - .datetimepicker_prompt { - float: left; - padding: 2px; - background: #222; - color: snow; -} -*html .datetimepicker_prompt { - width: 185px; -} - .datetimepicker_control, .datetimepicker_links, .datetimepicker_header, .datetimepicker { - clear: both; - float: left; - width: 100%; - color: #111; -} - .datetimepicker_control { - background: #469; - padding: 2px 0px; -} - .datetimepicker_links { - background: #347; - padding: 2px 0px; -} - .datetimepicker_control, .datetimepicker_links { - font-weight: bold; - font-size: 80%; - letter-spacing: 1px; -} - .datetimepicker_links label { - padding: 2px 5px; - color: #888; -} - .datetimepicker_clear, .datetimepicker_prev { - float: left; - width: 34%; -} - .datetimepicker_current { - float: left; - width: 30%; - text-align: center; -} - .datetimepicker_close, .datetimepicker_next { - float: right; - width: 34%; - text-align: right; -} - .datetimepicker_header { - padding: 1px 0 3px; - background: #944; - text-align: center; - font-weight: bold; - /*height: 3em;*/ -} - .datetimepicker_header select { - background: #944; - color: snow; - border: 0px; - font-weight: bold; -} - .datetimepicker { - background: #333; - text-align: center; - font-size: 100%; -} - .datetimepicker a { - display: block; - width: 100%; -} - .datetimepicker .datetimepicker_titleRow { - background: #733; - color: snow; -} - .datetimepicker .datetimepicker_daysRow { - background: #111; - color: #AAA; -} - .datetimepicker_weekCol { - background: #733; - color: #FFF; -} - .datetimepicker .datetimepicker_daysCell { - color: snow; - border: 1px solid #222; -} - #datetimepicker .datetimepicker_daysCell a { - display: block; -} - .datetimepicker .datetimepicker_weekEndCell { - background: #444; -} - .datetimepicker .datetimepicker_daysCellOver { - background: #111; - border: 1px solid #999; -} - .datetimepicker .datetimepicker_unselectable { - color: #888; -} - .datetimepicker_today { - background: #944 !important; -} - .datetimepicker_currentDay { - background: #733 !important; -} - #datetimepicker_div a, .datetimepicker_inline a { - cursor: pointer; - margin: 0; - padding: 0; - background: none; - color: snow; -} - .datetimepicker_inline .datetimepicker_links a { - padding: 0 5px !important; -} - .datetimepicker_control a, .datetimepicker_links a { - padding: 2px 5px !important; - color: snow !important; -} - .datetimepicker_titleRow a { - color: snow !important; -} - .datetimepicker_control a: hover { - color: #ccc !important; -} - .datetimepicker_links a: hover, .datetimepicker_titleRow a: hover { - background: #111 !important; - color: #CCC !important; -} - .datetimepicker_multi .datetimepicker { - border: 1px solid #944; -} - .datetimepicker_oneMonth { - float: left; - width: 185px; -} - .datetimepicker_newRow { - clear: left; -} - .datetimepicker_cover { - display: none; - display/**/: block; - position: absolute; - z-index: -1; - filter: mask(); - top: -4px; - left: -4px; - width: 193px; - height: 200px; -} diff -r c7e05dafaede -r 42b8e294792e app/soc/content/js/bulk-review-090304.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/js/bulk-review-090304.js Wed Mar 04 19:31:21 2009 +0000 @@ -0,0 +1,99 @@ +$(document).ready(function() { + $("#applications_progress_bar").progressBar({showText: false}); +}); + +function bulkReviewInit(bulk_review_link,button) { + // get the JSON object with details of every application for bulk acceptance + $.getJSON(bulk_review_link+"?_="+(new Date().getTime()), + function(data){ + // If there are applications to review... + if (data.nr_applications != 0) { + //...then fade out the button, show the progress bar and call the function for review + $("[id^=button_bulk_]").fadeOut("slow", + function() { + $("#applications_progress_bar").progressBar(0); + $("#description_done").html(""); + $("#applications_progress_bar").fadeIn("slow", bulkReview(data)); + } + ); + }else { + var no_organization_text="No organizations to "; + if ($(button).attr("id").indexOf("reject")!=-1) { + no_organization_text+="reject"; + } + else { + no_organization_text+="accept"; + } + $("#description_done").html(""+no_organization_text+""); + } + } + ); +} + +function bulkReview(data) { + // some global constants + var GLOBAL_LINK = data.link; + var TOTAL_APPLICATIONS = data.nr_applications; + + // some global variables set needed for internal iteration + var application_index = 0; + // number of iteration is not taken from data.nr_applications + // to ensure avoidance of array out of bounds errors + var total_index = data.applications.length; + + + // call immediately the function for review + // real iteration is inside + setTimeout(function(){ + var error_happened = false; + + var application = data.applications[application_index]; + var current_application = application_index + 1; + // regular expression to find a valid scope path inside matching parenthesis + var re = /\((\w*)\)/; + var scope_path = GLOBAL_LINK.match(re)[1]; + // the URL is obtained by using the scope path found in the matching parenthesis + var url_to_call = GLOBAL_LINK.replace(re, eval("application." + scope_path)); + // now we can call the URL found + $.ajax({ + async: false, + cache: false, + url: url_to_call, + timeout: 10000, + success: function(data) { + if (data) { + // update progress bar percentage and description + var percentage = Math.floor(100 * (current_application) / (TOTAL_APPLICATIONS)); + $("#description_progressbar").html(" Processed application " + application.name + " (" + (current_application) + "/" + TOTAL_APPLICATIONS + ")"); + $("#applications_progress_bar").progressBar(percentage); + } + }, + error: function(XMLHttpRequest, textStatus, errorThrown) { + // if there is an error return the button and leave a try again message + error_happened = true; + $("[id^=button_bulk_]").fadeIn("slow", function() { + $("#description_done").html(" Error encountered, try again"); + }); + } + }); + // if there were no errors, continue the iteration + if (!error_happened) { + // prepare for new iteration and then recall this function + application_index++; + if (application_index < total_index) { + setTimeout(arguments.callee, 0); + } + else { + // all ok, tell the user we are done + $("#applications_progress_bar").fadeOut("slow", + function() { + $("#applications_progress_bar").progressBar(0); + $("[id^=button_bulk_]").fadeIn("slow"); + } + ); + $("#description_progressbar").html(""); + $("#description_done").html("Done!"); + } + } + },0); +} diff -r c7e05dafaede -r 42b8e294792e app/soc/content/js/bulk-review.js --- a/app/soc/content/js/bulk-review.js Wed Mar 04 19:00:44 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,99 +0,0 @@ -$(document).ready(function() { - $("#applications_progress_bar").progressBar({showText: false}); -}); - -function bulkReviewInit(bulk_review_link,button) { - // get the JSON object with details of every application for bulk acceptance - $.getJSON(bulk_review_link+"?_="+(new Date().getTime()), - function(data){ - // If there are applications to review... - if (data.nr_applications != 0) { - //...then fade out the button, show the progress bar and call the function for review - $("[id^=button_bulk_]").fadeOut("slow", - function() { - $("#applications_progress_bar").progressBar(0); - $("#description_done").html(""); - $("#applications_progress_bar").fadeIn("slow", bulkReview(data)); - } - ); - }else { - var no_organization_text="No organizations to "; - if ($(button).attr("id").indexOf("reject")!=-1) { - no_organization_text+="reject"; - } - else { - no_organization_text+="accept"; - } - $("#description_done").html(""+no_organization_text+""); - } - } - ); -} - -function bulkReview(data) { - // some global constants - var GLOBAL_LINK = data.link; - var TOTAL_APPLICATIONS = data.nr_applications; - - // some global variables set needed for internal iteration - var application_index = 0; - // number of iteration is not taken from data.nr_applications - // to ensure avoidance of array out of bounds errors - var total_index = data.applications.length; - - - // call immediately the function for review - // real iteration is inside - setTimeout(function(){ - var error_happened = false; - - var application = data.applications[application_index]; - var current_application = application_index + 1; - // regular expression to find a valid scope path inside matching parenthesis - var re = /\((\w*)\)/; - var scope_path = GLOBAL_LINK.match(re)[1]; - // the URL is obtained by using the scope path found in the matching parenthesis - var url_to_call = GLOBAL_LINK.replace(re, eval("application." + scope_path)); - // now we can call the URL found - $.ajax({ - async: false, - cache: false, - url: url_to_call, - timeout: 10000, - success: function(data) { - if (data) { - // update progress bar percentage and description - var percentage = Math.floor(100 * (current_application) / (TOTAL_APPLICATIONS)); - $("#description_progressbar").html(" Processed application " + application.name + " (" + (current_application) + "/" + TOTAL_APPLICATIONS + ")"); - $("#applications_progress_bar").progressBar(percentage); - } - }, - error: function(XMLHttpRequest, textStatus, errorThrown) { - // if there is an error return the button and leave a try again message - error_happened = true; - $("[id^=button_bulk_]").fadeIn("slow", function() { - $("#description_done").html(" Error encountered, try again"); - }); - } - }); - // if there were no errors, continue the iteration - if (!error_happened) { - // prepare for new iteration and then recall this function - application_index++; - if (application_index < total_index) { - setTimeout(arguments.callee, 0); - } - else { - // all ok, tell the user we are done - $("#applications_progress_bar").fadeOut("slow", - function() { - $("#applications_progress_bar").progressBar(0); - $("[id^=button_bulk_]").fadeIn("slow"); - } - ); - $("#description_progressbar").html(""); - $("#description_done").html("Done!"); - } - } - },0); -} diff -r c7e05dafaede -r 42b8e294792e app/soc/content/js/datetime-loader-090304.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/js/datetime-loader-090304.js Wed Mar 04 19:31:21 2009 +0000 @@ -0,0 +1,5 @@ +$(function() +{ +$('.datetime-pick').datetimepicker(); +}); + diff -r c7e05dafaede -r 42b8e294792e app/soc/content/js/datetime-loader.js --- a/app/soc/content/js/datetime-loader.js Wed Mar 04 19:00:44 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -$(function() -{ -$('.datetime-pick').datetimepicker(); -}); - diff -r c7e05dafaede -r 42b8e294792e app/soc/content/js/datetimepicker-090304.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/app/soc/content/js/datetimepicker-090304.js Wed Mar 04 19:31:21 2009 +0000 @@ -0,0 +1,9 @@ +$(function() { + $('.datetime-pick').datetimepicker(); + $('.date-pick').datetimepicker({ + 'pickDateOnly' : true, + 'timeFormat' : '', + 'yearRange' : '1900:2008', + }); + }); + diff -r c7e05dafaede -r 42b8e294792e app/soc/content/js/datetimepicker.js --- a/app/soc/content/js/datetimepicker.js Wed Mar 04 19:00:44 2009 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -$(function() { - $('.datetime-pick').datetimepicker(); - $('.date-pick').datetimepicker({ - 'pickDateOnly' : true, - 'timeFormat' : '', - 'yearRange' : '1900:2008', - }); - }); - diff -r c7e05dafaede -r 42b8e294792e app/soc/templates/soc/base.html --- a/app/soc/templates/soc/base.html Wed Mar 04 19:00:44 2009 +0000 +++ b/app/soc/templates/soc/base.html Wed Mar 04 19:31:21 2009 +0000 @@ -18,13 +18,13 @@ {% block stylesheet %} {% if uses_jq_autocomplete %} - + {% endif %} {% if uses_jq_thickbox %} - + {% endif %} {% if uses_jq_datetimepicker %} - + {% endif %} {% endblock %} @@ -69,15 +69,15 @@ <script type="text/javascript" src="/jquery/jquery-progressbar.js"></script> {% endif %} {% if uses_bulk_review %} - <script type="text/javascript" src="/soc/content/js/bulk-review.js"></script> + <script type="text/javascript" src="/soc/content/js/bulk-review-090304.js"></script> {% endif %} {% if uses_jq_ui_core %} <script type="text/javascript" src="/jquery/jquery-ui.core.js"></script> {% endif %} {% if uses_jq_datetimepicker %} <script type="text/javascript" src="/jquery/jquery-ui.datetimepicker.js"></script> - <script type="text/javascript" src="/soc/content/js/datetime-loader.js"></script> - <script type="text/javascript" src="/soc/content/js/datetimepicker.js"></script> + <script type="text/javascript" src="/soc/content/js/datetime-loader-090304.js"></script> + <script type="text/javascript" src="/soc/content/js/datetimepicker-090304.js"></script> {% endif %} </head> {% endblock %}