Skip to content
Permalink
Browse files

menu more and tools

- items: allow 'upg' to be an array
- filter: fixed logic error in checks
- Markup: prevent handling of [menu], as PageTemplate is nyi
- Power: advanced features (hide reagents or sellprice; recoloring,
  renaming, iconizing of links)
- search: side-icon for titles
- smarty: added template-vars to cache (has to be fixed sooner or later)

- identify as HTML5 (fixed a strange bug with displaced list-pegs)
- removed several typos
  • Loading branch information...
Sarjuuk committed Mar 22, 2014
1 parent f236d7a commit 93cc42407c16a54016d36afcd293ac7551060f0f
Showing with 1,074 additions and 249 deletions.
  1. +19 −0 config/aowow.xml.in
  2. +5 −0 crossdomain.xml
  3. +1 −1 includes/types/basetype.class.php
  4. +15 −20 includes/types/item.class.php
  5. +16 −6 includes/utilities.php
  6. +9 −0 index.php
  7. +8 −2 localization/locale_dede.php
  8. +8 −2 localization/locale_enus.php
  9. +8 −2 localization/locale_eses.php
  10. +8 −2 localization/locale_frfr.php
  11. +8 −2 localization/locale_ruru.php
  12. +1 −2 pages/item.php
  13. +89 −0 pages/more.php
  14. +1 −1 pages/npc.php
  15. +0 −113 power/demo.html
  16. +4 −1 search.php
  17. +18 −0 setup/more-articles_ann-help.sql
  18. +38 −5 static/css/global.css
  19. +19 −0 static/download/searchplugins/aowow.xml
  20. BIN static/images/help/profiler/completion.jpg
  21. BIN static/images/help/profiler/completion2.jpg
  22. BIN static/images/help/profiler/exclusions.jpg
  23. BIN static/images/help/profiler/exclusions2.jpg
  24. BIN static/images/help/profiler/quests.jpg
  25. BIN static/images/help/profiler/quests2.jpg
  26. BIN static/images/help/screenshots/armor.jpg
  27. BIN static/images/help/screenshots/armor2.jpg
  28. BIN static/images/help/screenshots/hinterlands.jpg
  29. BIN static/images/help/screenshots/hinterlands2.jpg
  30. BIN static/images/help/screenshots/npc.jpg
  31. BIN static/images/help/screenshots/npc2.jpg
  32. BIN static/images/help/searchbox/preview-120x120.png
  33. BIN static/images/help/searchbox/preview-120x200.png
  34. BIN static/images/help/searchbox/preview-150x120.png
  35. BIN static/images/help/searchbox/preview-160x120.png
  36. BIN static/images/help/searchbox/preview-160x200.png
  37. BIN static/images/help/searchplugins/firefox.gif
  38. BIN static/images/help/searchplugins/ie.gif
  39. BIN static/images/help/searchplugins/opera.gif
  40. BIN static/images/help/searchplugins/ss-opera.png
  41. BIN static/images/help/searchplugins/ss-searchsuggestions.png
  42. BIN static/images/help/talent-calculator/glyphs.jpg
  43. BIN static/images/help/talent-calculator/glyphs2.jpg
  44. BIN static/images/help/talent-calculator/options.jpg
  45. BIN static/images/help/tooltips/ss-wowcom.png
  46. BIN static/images/logos/medium.gif
  47. +2 −2 static/js/Markup.js
  48. +2 −2 static/js/global.js
  49. +3 −2 static/js/locale_dede.js
  50. +4 −3 static/js/locale_enus.js
  51. +3 −2 static/js/locale_eses.js
  52. +2 −1 static/js/locale_frfr.js
  53. +2 −1 static/js/locale_ruru.js
  54. +235 −74 power/aowowPower.js → static/widgets/power.js
  55. +114 −0 static/widgets/power/demo.html
  56. +161 −0 static/widgets/power/power.css
  57. +3 −0 static/widgets/power/power_ie.css
  58. +11 −0 static/widgets/power/power_ie6.css
  59. +56 −0 static/widgets/searchbox.js
  60. +98 −0 static/widgets/searchbox/searchbox.css
  61. +24 −0 static/widgets/searchbox/searchbox.html
  62. +37 −0 static/widgets/searchbox/searchbox.js
  63. +1 −1 template/head.tpl
  64. +2 −2 template/header.tpl
  65. +39 −0 template/text-page-generic.tpl
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="iso-8859-1"?>

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>/*$shortName*/</ShortName>
<Description>/*$name*/</Description>
<Url
type="text/html"
method="get"
template="/*HOST_URL*//?search={searchTerms}" />

<Url
type="application/x-suggestions+json"
method="get"
template="/*HOST_URL*//?search={searchTerms}&amp;opensearch" />

<Image height="16" width="16" type="image/vnd.microsoft.icon">/*STATIC_URL*//images/logos/favicon.ico</Image>
<Image height="16" width="16" type="image/gif">/*STATIC_URL*//images/icons/favicon.gif</Image>

</OpenSearchDescription>
@@ -0,0 +1,5 @@
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*"/>
</cross-domain-policy>
@@ -672,7 +672,7 @@ public function urlize(array $override = [], array $addCr = [])
if (is_array($v) && !empty($v))
$_[$k] = $k.'='.implode(':', $v);
else if ($v === '')
else if ($v !== '')
$_[$k] = $k.'='.$v;
}
@@ -416,6 +416,7 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
$_flags = $this->curTpl['flags'];
$_class = $this->curTpl['class'];
$_subClass = $this->curTpl['subClass'];
$_slot = $this->curTpl['slot'];
$causesScaling = false;
if (!empty($enhance['rand']))
@@ -440,6 +441,9 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
}
}
if (isset($enhance['sock']) && !in_array($_slot, [INVTYPE_WRISTS, INVTYPE_WAIST, INVTYPE_HANDS]))
unset($enhance['sock']);
// IMPORTAT: DO NOT REMOVE THE HTML-COMMENTS! THEY ARE REQUIRED TO UPDATE THE TOOLTIP CLIENTSIDE
$x = '';
@@ -528,7 +532,7 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
$x .= '<table width="100%"><tr>';
// Class
$x .= '<td>'.Lang::$item['inventoryType'][$this->curTpl['slot']].'</td>';
$x .= '<td>'.Lang::$item['inventoryType'][$_slot].'</td>';
// Subclass
if ($_class == ITEM_CLASS_ARMOR && $_subClass > 0)
@@ -540,8 +544,8 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
$x .= '</tr></table>';
}
else if (($_ = $this->curTpl['slot']) && $_class != ITEM_CLASS_CONTAINER) // yes, slot can occur on random items and is then also displayed <_< .. excluding Bags >_>
$x .= '<br />'.Lang::$item['inventoryType'][$this->curTpl['slot']].'<br />';
else if ($_slot && $_class != ITEM_CLASS_CONTAINER) // yes, slot can occur on random items and is then also displayed <_< .. excluding Bags >_>
$x .= '<br />'.Lang::$item['inventoryType'][$_slot].'<br />';
else
$x .= '<br />';
@@ -930,7 +934,7 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
foreach ($reagents->iterate() as $__)
$reqReag[] = '<a href="?item='.$reagents->id.'">'.$reagents->getField('name', true).'</a> ('.$reagentItems[$reagents->id].')';
$xCraft .= '<br /><span class="q1">'.Lang::$game['requires2'].' '.implode(', ', $reqReag).'</span>';
$xCraft .= '<div class="q1 whtt-reagents"><br />'.Lang::$game['requires2'].' '.implode(', ', $reqReag).'</div>';
}
}
}
@@ -956,23 +960,23 @@ public function renderTooltip($enhance = [], $interactive = false, $subOf = 0)
if ($this->curTpl['spellCharges1'] > 1 || $this->curTpl['spellCharges1'] < -1)
$xMisc[] = '<span class="q1">'.abs($this->curTpl['spellCharges1']).' '.Lang::$item['charges'].'</span>';
if ($sp = $this->curTpl['sellPrice'])
$xMisc[] = '<span class="q1">'.Lang::$item['sellPrice'].Lang::$colon.Util::formatMoney($sp).'</span>';
// list required reagents
if (isset($xCraft))
$xMisc[] = $xCraft;
if ($xMisc)
$x .= implode('<br />', $xMisc);
if ($sp = $this->curTpl['sellPrice'])
$x .= '<div class="q1 whtt-sellprice">'.Lang::$item['sellPrice'].Lang::$colon.Util::formatMoney($sp).'</div>';
if (!$subOf)
$x .= '</td></tr></table>';
// tooltip scaling
if (!isset($xCraft))
{
$link = [$subOf ? $subOf : $this->id, 1]; // itemid, scaleMinLevel
$link = [$subOf ? $subOf : $this->id, 1]; // itemId, scaleMinLevel
if (isset($this->ssd[$this->id])) // is heirloom
{
array_push($link,
@@ -1885,26 +1889,17 @@ protected function createSQLForValues()
// upgrade for [form only]
if (isset($_v['upg']))
{
/* notice!
profiler can send $_GET['upg'] as an array
this should results in in N listviews-sets (weapons generate more more than one listview per slot) for N items
<div id="jkbfksdbl4"></div>
<div id="lkljbjkb574" class="listview"></div>
var tabsGroups = new Tabs({parent: $WH.ge('jkbfksdbl4')});
{template: 'item', id: 'ranged', name: 'Ranged', tabs: tabsGroups, parent: 'lkljbjkb574', hideCount: 1, note: $WH.sprintf(LANG.lvnote_viewmoreslot, '', 'sl=15;maxrl=80;si=1;ub=1;cr=161;crs=1;crv=0;upg=45498'), customFilter: fi_filterUpgradeListview, _upgradeIds: [45498], extraCols: fi_getExtraCols(fi_extraCols, 0, 0, 0), onAfterCreate: fi_addUpgradeIndicator, data:[]}
*/
// valid item?
if (!is_int($_v['upg']))
if (!is_int($_v['upg']) && !is_array($_v['upg']))
unset($_v['upg']);
else
{
$_ = DB::Aowow()->selectCell('SELECT slot FROM ?_items WHERE class IN (2, 3, 4) AND id = ?d', $_v['upg']);
$_ = DB::Aowow()->selectCol('SELECT id as ARRAY_KEY, slot FROM ?_items WHERE class IN (2, 3, 4) AND id IN (?a)', (array)$_v['upg']);
if ($_ === null)
unset($_v['upg']);
else
{
$this->formData['form']['upg'] = $_v['upg'];
$this->formData['form']['upg'] = $_;
if ($_)
$parts[] = ['slot', $_];
}
@@ -59,7 +59,7 @@ public function display($tpl)
$tv = &$this->_tpl_vars;
// fetch article & static infobox
if ($tv['type'] && $tv['typeId'])
if (isset($tv['type']) && isset($tv['typeId']))
{
$article = DB::Aowow()->selectRow(
'SELECT SQL_CALC_FOUND_ROWS article, quickInfo, locale FROM ?_articles WHERE type = ?d AND typeId = ?d AND locale = ?d UNION ALL '.
@@ -70,7 +70,13 @@ public function display($tpl)
if ($article)
{
$tv['article'] = ['text' => Util::jsEscape($article['article'])];
$replace = array(
'script' => 'scr"+"ipt',
'HOST_URL' => HOST_URL,
'STATIC_URL' => STATIC_URL
);
$tv['article'] = ['text' => strtr(Util::jsEscape($article['article']), $replace)];
if (empty($tv['infobox']) && !empty($article['quickInfo']))
$tv['infobox'] = $article['quickInfo'];
@@ -247,7 +253,8 @@ public function saveCache($key, $data, $filter = null)
$file = $this->cache_dir.'data/'.$key;
$cacheData = time()." ".AOWOW_REVISION."\n";
$cacheData = time()." ".AOWOW_REVISION."\n";
$cacheData .= serialize($this->_tpl_vars)."\n"; // todo(med): this should not be nessecary, rework caching
$cacheData .= serialize(str_replace(["\n", "\t"], ['\n', '\t'], $data));
if ($filter)
@@ -273,9 +280,12 @@ public function loadCache($key, &$data, &$filter = null)
if ($expireTime <= time() || $rev < AOWOW_REVISION)
return false;
$data = str_replace(['\n', '\t'], ["\n", "\t"], unserialize($cache[1]));
if (isset($cache[2]))
$filter = unserialize($cache[2]);
$this->_tpl_vars = unserialize($cache[1]);
$data = str_replace(['\n', '\t'], ["\n", "\t"], unserialize($cache[2]));
if (isset($cache[3]))
$filter = unserialize($cache[3]);
return true;
}
@@ -77,6 +77,15 @@
else
$smarty->error();
break;
case 'whats-new':
case 'searchplugins':
case 'searchbox':
case 'tooltips':
case 'help':
case 'faq':
case 'aboutus':
require 'pages/more.php';
break;
case 'petcalc': // tool: pet talent calculator
$petCalc = true;
case 'talent': // tool: talent calculator
@@ -17,7 +17,6 @@
'ab' => ["J.", "M.", "W.", "Tag", "Std.", "Min.", "Sek.", "Ms."],
),
'main' => array(
'help' => "Hilfe",
'name' => "Name",
'link' => "Link",
'signIn' => "Anmelden / Registrieren",
@@ -107,7 +106,14 @@
'talentCalc' => "Talentrechner",
'petCalc' => "Begleiterrechner",
'chooseClass' => "Wählt eine Klasse",
'chooseFamily' => "Wählt eine Tierart"
'chooseFamily' => "Wählt eine Tierart",
// help
'help' => "Hilfe",
'helpTopics' => array(
"Wie man Kommentare schreibt", "Modellviewer", "Screenshots: Tipps & Tricks", "Gewichtung von Werten",
"Talentrechner", "Gegenstandsvergleich", "Profiler"
)
),
'search' => array(
'search' => "Suche",
@@ -12,7 +12,6 @@
'ab' => ["yr", "mo", "wk", "day", "hr", "min", "sec", "ms"]
),
'main' => array(
'help' => "Help",
'name' => "name",
'link' => "Link",
'signIn' => "Log in / Register",
@@ -94,7 +93,14 @@
'talentCalc' => "Talent Calculator",
'petCalc' => "Hunter Pet Calculator",
'chooseClass' => "Choose a class",
'chooseFamily' => "Choose a pet family"
'chooseFamily' => "Choose a pet family",
// help
'help' => "Help",
'helpTopics' => array(
"Commenting and You", "Model Viewer", "Screenshots: Tips & Tricks", "Stat Weighting",
"Talent Calculator", "Item Comparison", "Profiler"
)
),
'search' => array(
'search' => "Search",
@@ -17,7 +17,6 @@
'ab' => ["año", "mes", "sem", "", "h", "min", "seg", "ms"],
),
'main' => array(
'help' => "Ayuda",
'name' => "nombre",
'link' => "Enlace",
'signIn' => "Iniciar sesión / Registrarse",
@@ -99,7 +98,14 @@
'talentCalc' => "Calculadora de talentos",
'petCalc' => "Calculadora de mascotas",
'chooseClass' => "Escoge una clase",
'chooseFamily' => "Escoge una familia de mascota"
'chooseFamily' => "Escoge una familia de mascota",
// help
'help' => "Ayuda",
'helpTopics' => array(
"Los comentarios y tú", "Visualizador de modelos", "Capturas de pantalla: Sugerencias y trucos", "Medición de atributos",
"Calculadora de talentos", "Comparación de objetos", "Perfiles"
)
),
'search' => array(
'search' => "Búsqueda",
@@ -17,7 +17,6 @@
'ab' => ["an", "mo", "sem", "jour", "h", "min", "s", "ms"]
),
'main' => array(
'help' => "Aide",
'name' => "nom",
'link' => "Lien",
'signIn' => "Se connecter / S'inscrire",
@@ -99,7 +98,14 @@
'talentCalc' => "Calculateur de Talents",
'petCalc' => "Calculateur de familiers",
'chooseClass' => "Choisissez une classe",
'chooseFamily' => "Choisissez un familier"
'chooseFamily' => "Choisissez un familier",
// help
'help' => "Aide",
'helpTopics' => array(
"Le guide du commentaire", "Visionneuse 3D", "Captures d'écran : Trucs et astuces", "Échelles de valeurs",
"Calculateur de talents", "Comparaison d'objets", "Profiler"
)
),
'search' => array(
'search' => "Recherche",
@@ -17,7 +17,6 @@
'ab' => ["г.", "мес.", "нед.", "дн", "ч.", "мин", "сек.", "мс"]
),
'main' => array(
'help' => "Справка",
'name' => "название",
'link' => "Ссылка",
'signIn' => "Вход / Регистрация",
@@ -99,7 +98,14 @@
'talentCalc' => "Расчёт талантов",
'petCalc' => "Расчёт умений питомцев",
'chooseClass' => "Выберите класс",
'chooseFamily' => "Выберите семейство питомцев"
'chooseFamily' => "Выберите семейство питомцев",
// help
'help' => "Справка",
'helpTopics' => array(
"Комментарии и Вы", "3D просмотр", "Скриншоты: Секреты мастерства", "Значимость характеристик",
"Расчёт талантов", "Сравнение предметов", "Профили персонажей"
)
),
'search' => array(
'search' => "Поиск",
@@ -73,7 +73,7 @@
}
// regular page
if (!$smarty->loadCache($cacheKeyPage, $item))
if (!$smarty->loadCache($cacheKeyPage, $pageData))
{
$item = new ItemList(array(['i.id', $_id]));
if ($item->error)
@@ -885,7 +885,6 @@
$smarty->saveCache($cacheKeyPage, $pageData);
}
$smarty->updatePageVars($pageData['page']);
$smarty->assign('community', CommunityContent::getAll(TYPE_ITEM, $_id)); // comments, screenshots, videos
$smarty->assign('lang', array_merge(Lang::$main, Lang::$game, Lang::$item, ['colon' => Lang::$colon]));

0 comments on commit 93cc424

Please sign in to comment.
You can’t perform that action at this time.