mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Guides/Listview
* display class/spec in category if applicable * make class/spec searchable * unify class/spec display with tooltips
This commit is contained in:
@@ -103,6 +103,12 @@ class GuideList extends BaseType
|
|||||||
'date' => $this->getField('date'), // ok
|
'date' => $this->getField('date'), // ok
|
||||||
'when' => date(Util::$dateFormatInternal, $this->getField('date'))
|
'when' => date(Util::$dateFormatInternal, $this->getField('date'))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if ($this->getField('category') == 1)
|
||||||
|
{
|
||||||
|
$data[$this->id]['classs'] = $this->getField('classId');
|
||||||
|
$data[$this->id]['spec'] = $this->getField('specId');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
@@ -137,19 +143,20 @@ class GuideList extends BaseType
|
|||||||
|
|
||||||
if ($this->getField('classId') && $this->getField('category') == 1)
|
if ($this->getField('classId') && $this->getField('category') == 1)
|
||||||
{
|
{
|
||||||
$c = $this->getField('classId');
|
if ($c = $this->getField('classId'))
|
||||||
|
{
|
||||||
|
$n = Lang::game('cl', $c);
|
||||||
|
$specStr .= ' – <span class="icontiny c'.$c.'" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/class_'.Game::$classFileStrings[$c].'.gif)">%s</span>';
|
||||||
|
|
||||||
if (($s = $this->getField('specId')) > -1)
|
if (($s = $this->getField('specId')) > -1)
|
||||||
{
|
{
|
||||||
$i = Game::$specIconStrings[$c][$s];
|
$i = Game::$specIconStrings[$c][$s];
|
||||||
$n = Lang::game('classSpecs', $c, $s);
|
$n = '';
|
||||||
}
|
$specStr .= '<span class="icontiny c'.$c.'" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/'.$i.'.gif)">'.Lang::game('classSpecs', $c, $s).'</span>';
|
||||||
else
|
|
||||||
{
|
|
||||||
$i = 'class_'.Game::$classFileStrings[$c];
|
|
||||||
$n = Lang::game('cl', $c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$specStr = ' – <span class="icontiny c'.$c.'" style="background-image: url('.STATIC_URL.'/images/wow/icons/tiny/'.$i.'.gif)">'.$n.'</span>';
|
$specStr = sprintf($specStr, $n);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$tt = '<table><tr><td><div style="max-width: 320px"><b class="q">'.$this->getField('title').'</b><br>';
|
$tt = '<table><tr><td><div style="max-width: 320px"><b class="q">'.$this->getField('title').'</b><br>';
|
||||||
|
|||||||
@@ -10255,10 +10255,28 @@ Listview.templates = {
|
|||||||
compute: function(guide, td)
|
compute: function(guide, td)
|
||||||
{
|
{
|
||||||
$(td).append($('<a>').attr('href', '?guides=' + guide.category).text(l_guide_categories[guide.category]).css('color', 'white'));
|
$(td).append($('<a>').attr('href', '?guides=' + guide.category).text(l_guide_categories[guide.category]).css('color', 'white'));
|
||||||
|
|
||||||
|
if (guide.classs && g_chr_specs[guide.classs])
|
||||||
|
{
|
||||||
|
$(td).append(' ' + LANG.dash + ' ').append($(Icon.create('class_' + g_file_classes[guide.classs], 0, null, '?class=' + guide.classs, null, null, false, null, true)));
|
||||||
|
let txt = $('<span>').attr('class', 'c' + guide.classs).text(' ' + g_chr_classes[guide.classs]);
|
||||||
|
if (guide.spec >= 0 && g_chr_specs[guide.classs][guide.spec])
|
||||||
|
{
|
||||||
|
$(td).append($(Icon.create(g_file_specs[guide.classs][guide.spec], 0, null, 'javascript:;', null, null, false, null, true)));
|
||||||
|
txt = $('<span>').attr('class', 'c' + guide.classs).text(' ' + g_chr_specs[guide.classs][guide.spec]);
|
||||||
|
}
|
||||||
|
$(td).append(txt);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
getVisibleText: function(guide)
|
getVisibleText: function(guide)
|
||||||
{
|
{
|
||||||
return l_guide_categories[guide.category];
|
let b = l_guide_categories[guide.category];
|
||||||
|
if (guide.classs)
|
||||||
|
b += ' ' + g_chr_classes[guide.classs];
|
||||||
|
if (guide.spec >= 0)
|
||||||
|
b += ' ' + g_chr_specs[guide.classs][guide.spec];
|
||||||
|
|
||||||
|
return b;
|
||||||
},
|
},
|
||||||
sortFunc: function(a, b)
|
sortFunc: function(a, b)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user