# HG changeset patch # User Dan # Date 1244254182 14400 # Node ID 5990ac411f34148b0ab7d347e64a98bf8c2839e8 # Parent 0867b9d38c38aee569f29500b83c9a99b78493e9 Fixed broken javascript magic on Admin:PageGroups diff -r 0867b9d38c38 -r 5990ac411f34 install/includes/cli-core.php --- a/install/includes/cli-core.php Tue Jun 02 13:27:05 2009 -0400 +++ b/install/includes/cli-core.php Fri Jun 05 22:09:42 2009 -0400 @@ -782,9 +782,16 @@ function parse_shellcolor_string($str) { + // only compute this once (saves some CPU time) + static $do_colors = null; + if ( $do_colors === null ) + { + $do_colors = ( isset($_SERVER['TERM']) && $_SERVER['TERM'] != 'dumb' ); + } + $expr = '/([\w\W]*?)<\/c>/'; while ( preg_match($expr, $str) ) - $str = preg_replace($expr, "\x1B[\\1m\\2\x1B[0m", $str); + $str = $do_colors ? preg_replace($expr, "\x1B[\\1m\\2\x1B[0m", $str) : preg_replace($expr, "\\2", $str); return $str; } diff -r 0867b9d38c38 -r 5990ac411f34 plugins/admin/PageGroups.php --- a/plugins/admin/PageGroups.php Tue Jun 02 13:27:05 2009 -0400 +++ b/plugins/admin/PageGroups.php Fri Jun 05 22:09:42 2009 -0400 @@ -384,11 +384,11 @@ echo '
-
-
-
-
-
+
+
+
+
+
@@ -780,11 +780,12 @@ var __ol_pg_edit_setup = function() { var input = document.getElementById('inptext_pg_add_member'); - input.onkeyup = function(e) { ajaxPageNameComplete(this); }; - + input.onkeypress = function(e) { + if ( e.keyCode == 13 ) + { + setTimeout('__pg_edit_ajaxadd(document.getElementById(\'' + this.id + '\'));', 500); + } + }; } addOnloadHook(__ol_pg_edit_setup); var __pg_edit_objcache = false; @@ -803,7 +804,7 @@ } // set width on parent, to prevent wrapping of ajax loading image - var w = $(obj).Width(); + var w = $dynano(obj).Width(); w = w + 24; obj.parentNode.style.width = w + 'px'; @@ -816,6 +817,7 @@ var url = makeUrlNS('Admin', 'PageGroups', 'src=ajax'); var page_add = escape(obj.value); var pg_id = document.forms.pg_edit_frm['action[edit]'].value; + ajaxPost(url, 'action[edit][add_page]=&pg_id=' + pg_id + '&new_page=' + page_add, function() { if ( ajax.readyState == 4 ) @@ -949,7 +951,7 @@ echo ''; // Add pages AJAX form echo '' . $lang->get('acppg_field_add_page') . '
' . $lang->get('acppg_field_add_page_hint') . ''; - echo ''; + echo ''; echo '
'; }