Ignore:
Timestamp:
Apr 20, 2013, 6:49:01 AM (11 years ago)
Author:
rvelices
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_autocomplete/suggestions.php

    r22246 r22304  
    55
    66if (!defined('RVAC_ID')) {
    7   set_status_header(501);
    8   exit;
     7        set_status_header(501);
     8        exit;
    99}
    1010
     
    1616
    1717if (isset($_GET['txt'])) {
    18   foreach($data['src'] as $item)
    19     echo implode("\t", $item)."\n";
    20   exit;
     18        foreach($data['src'] as $item)
     19                echo implode("\t", $item)."\n";
     20        exit;
    2121}
    2222
    2323
    2424$ds = str_replace(
    25   array('\\/', '"q":', '"label":', '"value":', '"w":'),
    26   array('/', 'q:', 'label:', 'value:', 'w:'),
    27   json_encode($data['src']));
     25        array('\\/', '"q":', '"label":', '"value":', '"w":'),
     26        array('/', 'q:', 'label:', 'value:', 'w:'),
     27        json_encode($data['src']));
    2828$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
    3637});
    3738$.each(RVAC.dataSource, function(i,item) {
    38   item.q = item.q || item.label.toLowerCase()
     39        item.q = item.q || item.label.toLowerCase()
    3940});
    4041RVAC.start && RVAC.start();';
    4142
     43header("Content-Type: application/javascript; charset=".get_pwg_charset());
    4244echo $js;
    4345
Note: See TracChangeset for help on using the changeset viewer.