Revision: 1813
http://mrbs.svn.sourceforge.net/mrbs/?rev=1813&view=rev
Author: cimorrison
Date: 2011-04-12 13:38:38 +0000 (Tue, 12 Apr 2011)
Log Message:
-----------
Made the inputs for Match Area and Match Room on the Report page into
autocomplete fields, meaning that you can either choose from a list of areas or
rooms or else enter your own text. (As well as saving typing if you want a
particular area or room it also has the added advantage of letting you see in
advance what the results of a match would be). Not supported in IE6 and below
as the autocomplete box doesn't render properly.
Modified Paths:
--------------
mrbs/trunk/web/Themes/default/header.inc
mrbs/trunk/web/jquery/ui/css/sunny/images/ui-bg_diagonals-medium_20_d34d17_40x40.png
mrbs/trunk/web/jquery/ui/css/sunny/images/ui-bg_gloss-wave_70_ffdd57_500x100.png
mrbs/trunk/web/jquery/ui/css/sunny/images/ui-icons_d19405_256x240.png
mrbs/trunk/web/jquery/ui/css/sunny/images/ui-icons_eb990f_256x240.png
mrbs/trunk/web/jquery/ui/css/sunny/images/ui-icons_ffe180_256x240.png
mrbs/trunk/web/jquery/ui/css/sunny/jquery-ui-1.8.11.custom.css
mrbs/trunk/web/jquery/ui/jquery-ui-1.8.11.custom.min.js
mrbs/trunk/web/mrbs.css.php
mrbs/trunk/web/systemdefaults.inc.php
Modified: mrbs/trunk/web/Themes/default/header.inc
===================================================================
--- mrbs/trunk/web/Themes/default/header.inc 2011-04-11 13:32:09 UTC (rev
1812)
+++ mrbs/trunk/web/Themes/default/header.inc 2011-04-12 13:38:38 UTC (rev
1813)
@@ -2,6 +2,69 @@
// $Id$
+// Generates the JavaScript code to turn the input with id $id
+// into an autocomplete box. The options will be contained in the
+// first element of each row of the result from the SQL query $sql
+// (eg "SELECT area_name FROM $tbl_area ORDER BY area_name")
+function generate_autocomplete($id, $sql)
+{
+ global $autocomplete_length_breaks;
+
+ $js = '';
+
+ $res = sql_query($sql);
+ if ($res && (sql_count($res) > 0))
+ {
+ $names = array();
+ for ($i = 0; ($row = sql_row($res, $i)); $i++)
+ {
+ $names[] = escape_js($row[0]);
+ }
+ // Work out a suitable value for the autocomplete minLength
+ // option, ie the number of characters that must be typed before
+ // a list of options appears. We want to avoid presenting a huge
+ // list of options.
+ $n_names = count($names);
+ $min_length = 0;
+ if (isset($autocomplete_length_breaks) &&
is_array($autocomplete_length_breaks))
+ {
+ foreach ($autocomplete_length_breaks as $break)
+ {
+ if ($n_names < $break)
+ {
+ break;
+ }
+ $min_length++;
+ }
+ }
+ // Start forming the array literal
+ $names_string = "'" . implode("','", $names) . "'";
+ // Build the JavaScript. We don't support autocomplete in IE6 and below
+ // because the browser doesn't render the autocomplete box properly - it
+ // gets hidden behind other elements. Although there are fixes for this,
+ // it's not worth it ...
+ $js .= "if ($('#iegt6').length > 0)\n";
+ $js .= "{\n";
+ $js .= " $('#$id').autocomplete({\n";
+ $js .= " source: [$names_string],\n";
+ $js .= " minLength: $min_length\n";
+ $js .= " })";
+ // If the minLength is 0, then the autocomplete widget doesn't do
+ // quite what you might expect and you need to force it to display
+ // the available options when it receives focus
+ if ($min_length == 0)
+ {
+ $js .= ".focus(function() {\n";
+ $js .= " $(this).autocomplete('search', '');\n";
+ $js .= " })";
+ }
+ $js .= " ;\n";
+ $js .= "}\n";
+ }
+
+ return $js;
+}
+
// Print the page header
function print_theme_header($day, $month, $year, $area, $room)
{
@@ -714,6 +777,24 @@
} // pending
?>
+$(document).ready(function() {
+ <?php
+ if ($page == 'report')
+ {
+ // Make the area match input on the report page into an auto-complete input
+ $sql = "SELECT area_name FROM $tbl_area ORDER BY area_name";
+ echo generate_autocomplete('areamatch', $sql);
+
+ // Make the room match input on the report page into an auto-complete input
+ // (We need DISTINCT because it's possible to have two rooms of the same
name
+ // in different areas)
+ $sql = "SELECT DISTINCT room_name FROM $tbl_room ORDER BY room_name";
+ echo generate_autocomplete('roommatch', $sql);
+ }
+ ?>
+});
+
+
// actions to be taken on page load
function init()
{
@@ -874,7 +955,17 @@
// (Use a class rather than id to avoid specificity problems)
echo "<body class=\"".htmlspecialchars($page)."\" onLoad =\"init()\">\n";
?>
+
+
<div class="screenonly">
+
+ <?php
+ // Add in some markers so that the JavaScript can work out
+ // which browser we're using
+ ?>
+ <![if gt IE 6]>
+ <span id="iegt6"></span>
+ <![endif]>
<?php // show a warning if this is using a low version of php
if (substr(phpversion(), 0, 1) == 3)
Modified:
mrbs/trunk/web/jquery/ui/css/sunny/images/ui-bg_diagonals-medium_20_d34d17_40x40.png
===================================================================
(Binary files differ)
Modified:
mrbs/trunk/web/jquery/ui/css/sunny/images/ui-bg_gloss-wave_70_ffdd57_500x100.png
===================================================================
(Binary files differ)
Modified: mrbs/trunk/web/jquery/ui/css/sunny/images/ui-icons_d19405_256x240.png
===================================================================
(Binary files differ)
Modified: mrbs/trunk/web/jquery/ui/css/sunny/images/ui-icons_eb990f_256x240.png
===================================================================
(Binary files differ)
Modified: mrbs/trunk/web/jquery/ui/css/sunny/images/ui-icons_ffe180_256x240.png
===================================================================
(Binary files differ)
Modified: mrbs/trunk/web/jquery/ui/css/sunny/jquery-ui-1.8.11.custom.css
===================================================================
--- mrbs/trunk/web/jquery/ui/css/sunny/jquery-ui-1.8.11.custom.css
2011-04-11 13:32:09 UTC (rev 1812)
+++ mrbs/trunk/web/jquery/ui/css/sunny/jquery-ui-1.8.11.custom.css
2011-04-12 13:38:38 UTC (rev 1813)
@@ -293,6 +293,59 @@
/* Overlays */
.ui-widget-overlay { background: #5c5c5c
url(images/ui-bg_flat_50_5c5c5c_40x100.png) 50% 50% repeat-x; opacity:
.80;filter:Alpha(Opacity=80); }
.ui-widget-shadow { margin: -7px 0 0 -7px; padding: 7px; background: #cccccc
url(images/ui-bg_flat_30_cccccc_40x100.png) 50% 50% repeat-x; opacity:
.60;filter:Alpha(Opacity=60); -moz-border-radius: 8px; -webkit-border-radius:
8px; border-radius: 8px; }/*
+ * jQuery UI Autocomplete 1.8.11
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete#theming
+ */
+.ui-autocomplete { position: absolute; cursor: default; }
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to
100% in IE6 */
+
+/*
+ * jQuery UI Menu 1.8.11
+ *
+ * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Menu#theming
+ */
+.ui-menu {
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+ float: left;
+}
+.ui-menu .ui-menu {
+ margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
+}
+.ui-menu .ui-menu-item a {
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+ font-weight: normal;
+ margin: -1px;
+}
+/*
* jQuery UI Datepicker 1.8.11
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
Modified: mrbs/trunk/web/jquery/ui/jquery-ui-1.8.11.custom.min.js
===================================================================
--- mrbs/trunk/web/jquery/ui/jquery-ui-1.8.11.custom.min.js 2011-04-11
13:32:09 UTC (rev 1812)
+++ mrbs/trunk/web/jquery/ui/jquery-ui-1.8.11.custom.min.js 2011-04-12
13:38:38 UTC (rev 1813)
@@ -48,6 +48,22 @@
true}},_mouseMove:function(a){if(b.browser.msie&&!(document.documentMode>=9)&&!a.button)return
this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return
a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);
if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return
false},_mouseDistanceMet:function(a){return
Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return
this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return
true}})})(jQuery);
;/*
+ * jQuery UI Position 1.8.11
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Position
+ */
+(function(c){c.ui=c.ui||{};var
n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return
t.apply(this,arguments);b=c.extend({},b);var
a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split("
"):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else
if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else
if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY,
+left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var
f=(b[this]||"").split("
");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else
if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+=
+k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return
this.each(function(){var
f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else
if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else
if(b.my[1]==="center")i.top-=
+m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var
d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left=
+d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var
d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var
d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var
g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+=
+a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var
d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var
g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var
d=c(b),
+g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in
a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var
a=this[0];if(!a||!a.ownerDocument)return null;if(b)return
this.each(function(){c.offset.setOffset(this,b)});return
u.call(this)}}})(jQuery);
+;/*
* jQuery UI Draggable 1.8.11
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
@@ -98,6 +114,38 @@
{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=p||q||r||s||t}else{c.snapElements[h].snapping&&c.options.snap.release&&c.options.snap.release.call(c.element,a,d.extend(c._uiHash(),{snapItem:c.snapElements[h].item}));c.snapElements[h].snapping=false}}}});d.ui.plugin.add("draggable","stack",{start:function(){var
a=d(this).data("draggable").options;a=d.makeArray(d(a.stack)).sort(function(c,f){return(parseInt(d(c).css("zIndex"),10)||0)-(parseInt(d(f).css("zIndex"),10)||0)});if(a.length){var
b=
parseInt(a[0].style.zIndex)||0;d(a).each(function(c){this.style.zIndex=b+c});this[0].style.zIndex=b+a.length}}});d.ui.plugin.add("draggable","zIndex",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("zIndex"))b._zIndex=a.css("zIndex");a.css("zIndex",b.zIndex)},stop:function(a,b){a=d(this).data("draggable").options;a._zIndex&&d(b.helper).css("zIndex",a._zIndex)}})})(jQuery);
;/*
+ * jQuery UI Autocomplete 1.8.11
+ *
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Autocomplete
+ *
+ * Depends:
+ * jquery.ui.core.js
+ * jquery.ui.widget.js
+ * jquery.ui.position.js
+ */
+(function(d){var
e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left
top",at:"left
bottom",collision:"none"},source:null},pending:0,_create:function(){var
a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){g=
+false;var f=d.ui.keyCode;switch(c.keyCode){case
f.PAGE_UP:a._move("previousPage",c);break;case
f.PAGE_DOWN:a._move("nextPage",c);break;case
f.UP:a._move("previous",c);c.preventDefault();break;case
f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case
f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case
f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case
f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
+a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay);break}}}).bind("keypress.autocomplete",function(c){if(g){g=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return
a._response.apply(a,arguments)};
+this.menu=d("<ul></ul>").addClass("ui-autocomplete").appendTo(d(this.options.appendTo||"body",b)[0]).mousedown(function(c){var
f=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(h){h.target!==a.element[0]&&h.target!==f&&!d.ui.contains(f,h.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,f){f=f.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:f})&&/^key/.test(c.originalEvent.type)&&
+a.element.val(f.value)},selected:function(c,f){var
h=f.item.data("item.autocomplete"),i=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=i;setTimeout(function(){a.previous=i;a.selectedItem=h},1)}false!==a._trigger("select",c,{item:h})&&a.element.val(h.value);a.term=a.element.val();a.close(c);a.selectedItem=h},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");
+d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup");this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0]);a==="disabled"&&
+b&&this.xhr&&this.xhr.abort()},_initSource:function(){var
a=this,b,g;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,f){f(d.ui.autocomplete.filter(b,c.term))}}else
if(typeof
this.options.source==="string"){g=this.options.source;this.source=function(c,f){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:g,data:c,dataType:"json",autocompleteRequest:++e,success:function(h){this.autocompleteRequest===e&&f(h)},error:function(){this.autocompleteRequest===e&&f([])}})}}else
this.source=
+this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length<this.options.minLength)return
this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)!==false)return
this._search(a)},_search:function(a){this.pending++;this.element.addClass("ui-autocomplete-loading");this.source({term:a},this.response)},_response:function(a){if(!this.options.disabled&&a&&a.length){a=this._normalize(a);this._suggest(a);this._trigger("open")}else
this.close();
+this.pending--;this.pending||this.element.removeClass("ui-autocomplete-loading")},close:function(a){clearTimeout(this.closing);if(this.menu.element.is(":visible")){this.menu.element.hide();this.menu.deactivate();this._trigger("close",a)}},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(a){if(a.length&&a[0].label&&a[0].value)return
a;return d.map(a,function(b){if(typeof
b==="string")return{label:b,value:b};return d.extend({label:b.label||
+b.value,value:b.value||b.label},b)})},_suggest:function(a){var
b=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(b,a);this.menu.deactivate();this.menu.refresh();b.show();this._resizeMenu();b.position(d.extend({of:this.element},this.options.position));this.options.autoFocus&&this.menu.next(new
d.Event("mouseover"))},_resizeMenu:function(){var
a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth(),this.element.outerWidth()))},_renderMenu:function(a,b){var
g=this;
+d.each(b,function(c,f){g._renderItem(a,f)})},_renderItem:function(a,b){return
d("<li></li>").data("item.autocomplete",b).append(d("<a></a>").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else
this.menu[a](b);else this.search(null,b)},widget:function(){return
this.menu.element}});d.extend(d.ui.autocomplete,{escapeRegex:function(a){return
a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,
+"\\$&")},filter:function(a,b){var g=new
RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return
g.test(c.label||c.value||c)})}})})(jQuery);
+(function(d){d.widget("ui.menu",{_create:function(){var
e=this;this.element.addClass("ui-menu ui-widget ui-widget-content
ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(a){if(d(a.target).closest(".ui-menu-item
a").length){a.preventDefault();e.select(a)}});this.refresh()},refresh:function(){var
e=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex",
+-1).mouseenter(function(a){e.activate(a,d(this).parent())}).mouseleave(function(){e.deactivate()})},activate:function(e,a){this.deactivate();if(this.hasScroll()){var
b=a.offset().top-this.element.offset().top,g=this.element.attr("scrollTop"),c=this.element.height();if(b<0)this.element.attr("scrollTop",g+b);else
b>=c&&this.element.attr("scrollTop",g+b-c+a.height())}this.active=a.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",e,{item:a})},
+deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return
this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return
this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,a,b){if(this.active){e=this.active[e+"All"](".ui-menu-item").eq(0);
+e.length?this.activate(b,e):this.activate(b,this.element.children(a))}else
this.activate(b,this.element.children(a))},nextPage:function(e){if(this.hasScroll())if(!this.active||this.last())this.activate(e,this.element.children(".ui-menu-item:first"));else{var
a=this.active.offset().top,b=this.element.height(),g=this.element.children(".ui-menu-item").filter(function(){var
c=d(this).offset().top-a-b+d(this).height();return
c<10&&c>-10});g.length||(g=this.element.children(".ui-menu-item:last"));this.activate(e,
+g)}else
this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(e){if(this.hasScroll())if(!this.active||this.first())this.activate(e,this.element.children(".ui-menu-item:last"));else{var
a=this.active.offset().top,b=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var
g=d(this).offset().top-a+b-d(this).height();return
g<10&&g>-10});result.length||(result=this.element.children(".ui-menu-item:first"));
+this.activate(e,result)}else
this.activate(e,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return
this.element.height()<this.element.attr("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})})(jQuery);
+;/*
* jQuery UI Datepicker 1.8.11
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
Modified: mrbs/trunk/web/mrbs.css.php
===================================================================
--- mrbs/trunk/web/mrbs.css.php 2011-04-11 13:32:09 UTC (rev 1812)
+++ mrbs/trunk/web/mrbs.css.php 2011-04-12 13:38:38 UTC (rev 1813)
@@ -822,3 +822,15 @@
#approve_buttons td#note {padding-top: 0}
#approve_buttons td#note form {width: 100%}
#approve_buttons td#note textarea {width: 100%; height: 6em}
+
+/* ------------ jQuery UI additions -------------*/
+
+.ui-autocomplete {
+ max-height: 150px;
+ overflow-y: auto;
+ /* prevent horizontal scrollbar */
+ overflow-x: hidden;
+ /* add padding to account for vertical scrollbar */
+ padding-right: 20px;
+}
+
Modified: mrbs/trunk/web/systemdefaults.inc.php
===================================================================
--- mrbs/trunk/web/systemdefaults.inc.php 2011-04-11 13:32:09 UTC (rev
1812)
+++ mrbs/trunk/web/systemdefaults.inc.php 2011-04-12 13:38:38 UTC (rev
1813)
@@ -400,8 +400,19 @@
// The maximum length of a database field for which a text input can be used
on a form
// (eg when editing a user or room). If longer than this a text area will be
used.
$text_input_max = 70; // characters
-
+// For inputs that have autocomplete options, eg the area and room match
inputs on
+// the report page, we can define how many characters need to be input before
the
+// options are displayed. This enables us to prevent a huge long list of
options
+// being presented. We define the breakpoints in an array. For example if
we set
+// $autocomplete_length_breaks = array(25, 250, 2500); this means that if the
number of options
+// is less than 25 then they will be displayed when 0 characters are input, ie
the input
+// receives focus. If the number of options is less than 250 then they will
be displayed
+// when 1 character is input and so on. The array can be as long as you
like. If it
+// is empty then the options are displayed when 0 characters are input.
+$autocomplete_length_breaks = array(25, 250, 2500);
+
+
/************************
* Miscellaneous settings
************************/
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now! http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits