func_replace -> raw_params
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Oct 2009 22:13:12 +0000 (16:13 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 30 Oct 2009 22:13:12 +0000 (16:13 -0600)
ansel/lib/Ajax/Imple/LocationAutoCompleter.php
imp/lib/Ajax/Imple/ContactAutoCompleter.php
kronolith/lib/Ajax/Imple/ContactAutoCompleter.php

index b69883f..0992cc3 100644 (file)
@@ -15,16 +15,14 @@ class Ansel_Ajax_Imple_LocationAutoCompleter extends Horde_Ajax_Imple_AutoComple
     protected function _attach($js_params)
     {
         $js_params['indicator'] = $this->_params['triggerId'] . '_loading_img';
-        $js_params['onSelect'] = 1;
-        $js_params['onShow'] = 1;
         $js_params['tokens'] = '';
 
         $ret = array(
-            'func_replace' => array(
-                '"onSelect":1' => '"onSelect":function (v) { ' . $this->_params['map'] . '.ll = Ansel.ajax.locationAutoCompleter.geocache[v]; }',
-                '"onShow":1' => '"onShow":function (e) { if (!e.size()) ' . $this->_params['map'] . '.ll = null; }'
-            ),
             'params' => $js_params,
+            'raw_params' => array(
+                'onSelect' => 'function (v) { ' . $this->_params['map'] . '.ll = Ansel.ajax.locationAutoCompleter.geocache[v]; }',
+                'onShow' => 'function (e) { if (!e.size()) ' . $this->_params['map'] . '.ll = null; }'
+            ),
             'var' => "Ansel.ajax['locationAutoCompleter']"
         );
 
index ef523cc..f5b7e01 100644 (file)
@@ -25,15 +25,13 @@ class IMP_Ajax_Imple_ContactAutoCompleter extends Horde_Ajax_Imple_AutoCompleter
     protected function _attach($js_params)
     {
         $js_params['indicator'] = $this->_params['triggerId'] . '_loading_img';
-        $js_params['onSelect'] = 1;
-        $js_params['onType'] = 1;
 
         $ret = array(
-            'func_replace' => array(
-                '"onSelect":1' => '"onSelect":function (v) { if (!v.endsWith(";")) { v += ","; } return v + " "; }',
-                '"onType":1' => '"onType":function (e) { return e.include("<") ? "" : e; }'
-            ),
-            'params' => $js_params
+            'params' => $js_params,
+            'raw_params' => array(
+                'onSelect' => 'function (v) { if (!v.endsWith(";")) { v += ","; } return v + " "; }',
+                'onType' => 'function (e) { return e.include("<") ? "" : e; }'
+            )
         );
 
         $ac_browser = empty($GLOBALS['conf']['compose']['ac_browser'])
index 3f99c6a..6a7656f 100644 (file)
@@ -25,11 +25,11 @@ class Kronolith_Ajax_Imple_ContactAutoCompleter extends Horde_Ajax_Imple_AutoCom
 
         return array(
             'ajax' => 'ContactAutoCompleter',
-            'func_replace' => array(
-                '"onSelect":1' => '"onSelect":function (v) { if (!v.endsWith(";")) { v += ","; } return v + " "; }',
-                '"onType":1' => '"onType":function (e) { return e.include("<") ? "" : e; }'
+            'params' => $js_params,
+            'raw_params' => array(
+                'onSelect' => 'function (v) { if (!v.endsWith(";")) { v += ","; } return v + " "; }',
+                'onType' => 'function (e) { return e.include("<") ? "" : e; }'
             ),
-            'params' => $js_params
         );
     }