diff --git a/includes/rli_item.class.php b/includes/rli_item.class.php index 279802d..4c972fd 100644 --- a/includes/rli_item.class.php +++ b/includes/rli_item.class.php @@ -192,6 +192,12 @@ public function display($with_form=false) { 'DISPLAY' => 'style="display: none;"', 'S_IP_SAVE' => $this->config('itempool_save') )); + + $item_names = array_unique ($this->pdh->aget('item', 'name', 0, array($this->pdh->get('item', 'id_list')))); + $itemids = array_unique($this->pdh->aget('item', 'name', 0, array($this->pdh->get('game_itemid', 'id_list')))); + $strItemNames = $this->jquery->implode_wrapped('"','"', ",", $item_names); + $strItemIDs = $this->jquery->implode_wrapped('"','"', ",", $itemids); + $this->tpl->add_js( "var rli_key = ".($key+1)."; $('#items').on('click', '.del_item', function() { @@ -207,7 +213,24 @@ public function display($with_form=false) { item.removeAttr('style'); $('#item_999').before(item); rli_key++; -});", 'docready'); + bindAutocomplete(); +}); + + var jquiac_items = [".$strItemNames."]; + var jquiac_itemids = [".$strItemIDs."]; + + function bindAutocomplete(){ + $('.autocomplete_items').autocomplete({ + source: jquiac_items + }); + $('.autocomplete_itemids').autocomplete({ + source: jquiac_itemids + }); + } + + bindAutocomplete(); + +", 'docready'); } if($end && $end <= $p) { $next_button = ''; diff --git a/includes/rli_member.class.php b/includes/rli_member.class.php index e5460ae..c3e004f 100644 --- a/includes/rli_member.class.php +++ b/includes/rli_member.class.php @@ -311,6 +311,9 @@ public function display($with_form=false) { if(isset($detail_raid_list)) $this->detailed_times_list(999, array()); unset($this->members[999]); $this->jquery->qtip('#dt_help', $this->user->lang('rli_help_dt_member'), array('my' => 'center right', 'at' => 'left center')); + $members = $this->pdh->aget('member', 'name', 0, array($this->pdh->sort($this->pdh->get('member', 'id_list', array(false,true,false)), 'member', 'name', 'asc'))); + $js_array = $this->jquery->implode_wrapped('"','"', ",", $members); + $this->tpl->add_js( "var rli_key = ".(($key) ? $key : 1)."; $('.del_mem').click(function() { @@ -326,8 +329,26 @@ public function display($with_form=false) { mem.removeAttr('style'); mem.find('td:first').html((rli_key+1)+$.trim(mem.find('td:first').html())); $('#memberrow_999').before(mem); + bindAutocomplete(); rli_key++; - });", 'docready'); + }); + + var jquiac_members = [".$js_array."]; + + function bindAutocomplete(){ + $('.autocomplete_members').autocomplete({ + source: jquiac_members + }); + } + + bindAutocomplete(); + +", 'docready'); + + $this->returnJScache['autocomplete'][$id] = 'var jquiac_'.$id.' = ['.$js_array.']; + $("#'.$ids.'").autocomplete({ + source: jquiac_'.$id.' + });'; if($this->config('member_display') == 1){ $this->tpl->add_js(" diff --git a/templates/base_template/items.html b/templates/base_template/items.html index 4c5b122..79f5cea 100644 --- a/templates/base_template/items.html +++ b/templates/base_template/items.html @@ -32,8 +32,8 @@ -