Changeset 22304 for extensions/rv_autocomplete/suggestions.php
- Timestamp:
- Apr 20, 2013, 6:49:01 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_autocomplete/suggestions.php
r22246 r22304 5 5 6 6 if (!defined('RVAC_ID')) { 7 8 7 set_status_header(501); 8 exit; 9 9 } 10 10 … … 16 16 17 17 if (isset($_GET['txt'])) { 18 19 20 18 foreach($data['src'] as $item) 19 echo implode("\t", $item)."\n"; 20 exit; 21 21 } 22 22 23 23 24 24 $ds = str_replace( 25 26 27 25 array('\\/', '"q":', '"label":', '"value":', '"w":'), 26 array('/', 'q:', 'label:', 'value:', 'w:'), 27 json_encode($data['src'])); 28 28 $js = '$.extend(RVAC, { 29 dataSource:'.$ds.', 30 dataSourceAltLangIndex: '.$data['altLangIndex'].', 31 roots: '.json_encode($data['roots']).', 32 minForAltLang: 2, 33 stopLookingAfter: 100, 34 suggestions: 5, 35 maxSuggestions: 10 29 dataSource:'.$ds.', 30 dataSourceAltLangIndex: '.$data['altLangIndex'].', 31 roots: '.json_encode($data['roots']).', 32 minForAltLang: 2, 33 stopLookingAfter: 80, 34 suggestions: 4, 35 maxSuggestions: 8, 36 minWeightForContextTrigger: 25 36 37 }); 37 38 $.each(RVAC.dataSource, function(i,item) { 38 39 item.q = item.q || item.label.toLowerCase() 39 40 }); 40 41 RVAC.start && RVAC.start();'; 41 42 43 header("Content-Type: application/javascript; charset=".get_pwg_charset()); 42 44 echo $js; 43 45
Note: See TracChangeset
for help on using the changeset viewer.