From e56995b9f8ebbac6de8f858f8996b254f8b2d59d Mon Sep 17 00:00:00 2001
From: mcramer <m.cramer@pixcept.de>
Date: Fri, 19 Oct 2012 04:21:46 -0400
Subject: [PATCH] Fixed: redirect_paths can contain colons like http://www.mydomain.com/cms/article:::35.html

---
 interface/web/js/jquery.tipsy.js |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/interface/web/js/jquery.tipsy.js b/interface/web/js/jquery.tipsy.js
index f4baf77..27fa06d 100644
--- a/interface/web/js/jquery.tipsy.js
+++ b/interface/web/js/jquery.tipsy.js
@@ -260,7 +260,7 @@
                 .appendTo( wrapper )
                 .val( value )
                 .addClass( "ui-state-default ui-combobox-input" )
-                .css( { "width": elwidth - 15, "height": elheight })
+                .css( { "width": (elwidth > 15 ? elwidth - 15 : 1), "height": elheight })
                 .autocomplete({
                     delay: 0,
                     minLength: 0,
@@ -287,6 +287,11 @@
                         self._trigger( "selected", event, {
                             item: ui.item.option
                         });
+                        if((select.onchange || false) && typeof select.onchange == 'function') {
+                            select.onchange( { target: select } );
+                        } else if($(select).attr('onchange')) {
+                            eval($(select).attr('onchange'));
+                        }
                         if (jQuery(".panel #Filter").length > 0) {
                             jQuery(".panel #Filter").trigger('click');
                         }
@@ -340,6 +345,22 @@
                     .append( "<a>" + item.label + "</a>" )
                     .appendTo( ul );
             };
+            select.change(function(e) {
+                var matcher = new RegExp( "" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "", "i" ),
+                    matchtext = $(this).val();
+                    valid = false,
+                    selected = false;
+                select.children( "option" ).each(function() {
+                    if( ($(this).val() == "" && matchtext == "") || $( this ).text().match( matcher ) ) {
+                        valid = true;
+                        selected = $(this);
+                        return false;
+                    }
+                });
+                if(!valid) return false;
+                
+                input.val($(this).val()).autocomplete('option','select').call(input, (e ? e : {target: select}), { item: { option: selected.get(0) } });
+            });
 
             $( "<a>" )
                 .attr( "tabIndex", -1 )

--
Gitblit v1.9.1