mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
HTML/Scripts
* append a filemtime timestamp to js/css files to work around browser caching after update * shuffle script handling around a bit * also user pages cant have community content * also fix breadcrumbs on items page
This commit is contained in:
@@ -35,10 +35,15 @@ define('CACHE_TYPE_XML', 4); // only used by item
|
||||
define('CACHE_MODE_FILECACHE', 0x1);
|
||||
define('CACHE_MODE_MEMCACHED', 0x2);
|
||||
|
||||
define ('CSS_FILE', 1);
|
||||
define ('CSS_STRING', 2);
|
||||
define ('JS_FILE', 3);
|
||||
define ('JS_STRING', 4);
|
||||
define ('SC_CSS_FILE', 1);
|
||||
define ('SC_CSS_STRING', 2);
|
||||
define ('SC_JS_FILE', 3);
|
||||
define ('SC_JS_STRING', 4);
|
||||
define ('SC_FLAG_PREFIX', 0x01);
|
||||
define ('SC_FLAG_NO_TIMESTAMP', 0x02);
|
||||
define ('SC_FLAG_APPEND_LOCALE', 0x04);
|
||||
define ('SC_FLAG_LOCALIZED', 0x08);
|
||||
|
||||
|
||||
define('SEARCH_TYPE_REGULAR', 0x10000000);
|
||||
define('SEARCH_TYPE_OPEN', 0x20000000);
|
||||
|
||||
@@ -9,6 +9,7 @@ class UserList extends BaseType
|
||||
public static $type = Type::USER;
|
||||
public static $brickFile = 'user';
|
||||
public static $dataTable = ''; // doesn't have community content
|
||||
public static $contribute = CONTRIBUTE_NONE;
|
||||
|
||||
public $sources = [];
|
||||
|
||||
@@ -49,7 +50,7 @@ class UserList extends BaseType
|
||||
|
||||
// more optional data
|
||||
// sig: markdown formated string (only used in forum?)
|
||||
// border: seen as null|1|3 .. changes the border around the avatar (i suspect its meaning changed and got decupled from premium-status with the introduction of patron-status)
|
||||
// border: seen as null|1|3 .. changes the border around the avatar (i suspect its meaning changed and got decupled from premium-status with the introduction of patreon-status)
|
||||
}
|
||||
|
||||
return [Type::USER => $data];
|
||||
|
||||
@@ -8,8 +8,11 @@ if (!defined('AOWOW_REVISION'))
|
||||
class AccountPage extends GenericPage
|
||||
{
|
||||
protected $tpl = 'acc-dashboard';
|
||||
protected $js = [[JS_FILE, 'user.js'], [JS_FILE, 'profile.js']];
|
||||
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/user.js'],
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_CSS_FILE, 'css/Profiler.css']
|
||||
);
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $category = null;
|
||||
protected $validCats = array(
|
||||
|
||||
@@ -173,7 +173,7 @@ class AchievementPage extends GenericPage
|
||||
);
|
||||
|
||||
if ($reqBook)
|
||||
$this->addScript([CSS_FILE, 'Book.css']);
|
||||
$this->addScript([SC_CSS_FILE, 'css/Book.css']);
|
||||
|
||||
// create rewards
|
||||
if ($foo = $this->subject->getField('rewards'))
|
||||
|
||||
@@ -15,7 +15,7 @@ class AchievementsPage extends GenericPage
|
||||
protected $path = [0, 9];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
|
||||
@@ -98,13 +98,13 @@ class AdminPage extends GenericPage
|
||||
private function handleConfig() : void
|
||||
{
|
||||
$this->addScript(
|
||||
[CSS_STRING, '.grid input[type=\'text\'], .grid input[type=\'number\'] { width:250px; text-align:left; }'],
|
||||
[CSS_STRING, '.grid input[type=\'button\'] { width:65px; padding:2px; }'],
|
||||
[CSS_STRING, '.grid a.tip { margin:0px 5px; opacity:0.8; }'],
|
||||
[CSS_STRING, '.grid a.tip:hover { opacity:1; }'],
|
||||
[CSS_STRING, '.grid tr { height:30px; }'],
|
||||
[CSS_STRING, '.grid .disabled { opacity:0.4 !important; }'],
|
||||
[CSS_STRING, '.grid .status { position:absolute; right:5px; }']
|
||||
[SC_CSS_STRING, '.grid input[type=\'text\'], .grid input[type=\'number\'] { width:250px; text-align:left; }'],
|
||||
[SC_CSS_STRING, '.grid input[type=\'button\'] { width:65px; padding:2px; }'],
|
||||
[SC_CSS_STRING, '.grid a.tip { margin:0px 5px; opacity:0.8; }'],
|
||||
[SC_CSS_STRING, '.grid a.tip:hover { opacity:1; }'],
|
||||
[SC_CSS_STRING, '.grid tr { height:30px; }'],
|
||||
[SC_CSS_STRING, '.grid .disabled { opacity:0.4 !important; }'],
|
||||
[SC_CSS_STRING, '.grid .status { position:absolute; right:5px; }']
|
||||
);
|
||||
|
||||
$head = '<table class="grid"><tr><th><b>Key</b></th><th><b>Value</b></th><th style="width:150px;"><b>Options</b></th></tr>';
|
||||
@@ -148,7 +148,7 @@ class AdminPage extends GenericPage
|
||||
private function handlePhpInfo() : void
|
||||
{
|
||||
$this->addScript([
|
||||
CSS_STRING, "\npre {margin: 0px; font-family: monospace;}\n" .
|
||||
SC_CSS_STRING, "\npre {margin: 0px; font-family: monospace;}\n" .
|
||||
"td, th { border: 1px solid #000000; vertical-align: baseline;}\n" .
|
||||
".p {text-align: left;}\n" .
|
||||
".e {background-color: #ccccff; font-weight: bold; color: #000000;}\n" .
|
||||
@@ -212,9 +212,9 @@ class AdminPage extends GenericPage
|
||||
private function handleScreenshots() : void
|
||||
{
|
||||
$this->addScript(
|
||||
[JS_FILE, 'screenshot.js'],
|
||||
[CSS_STRING, '.layout {margin: 0px 25px; max-width: inherit; min-width: 1200px; }'],
|
||||
[CSS_STRING, '#highlightedRow { background-color: #322C1C; }']
|
||||
[SC_JS_FILE, 'js/screenshot.js'],
|
||||
[SC_CSS_STRING, '.layout {margin: 0px 25px; max-width: inherit; min-width: 1200px; }'],
|
||||
[SC_CSS_STRING, '#highlightedRow { background-color: #322C1C; }']
|
||||
);
|
||||
|
||||
$ssGetAll = $this->_get['all'];
|
||||
@@ -250,8 +250,8 @@ class AdminPage extends GenericPage
|
||||
private function handleWeightPresets() : void
|
||||
{
|
||||
$this->addScript(
|
||||
[JS_FILE, 'filters.js'],
|
||||
[CSS_STRING, '.wt-edit {display:inline-block; vertical-align:top; width:350px;}']
|
||||
[SC_JS_FILE, 'js/filters.js'],
|
||||
[SC_CSS_STRING, '.wt-edit {display:inline-block; vertical-align:top; width:350px;}']
|
||||
);
|
||||
|
||||
$head = $body = '';
|
||||
|
||||
@@ -45,7 +45,7 @@ class AreaTriggerPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$_type = $this->subject->getField('type');
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class AreaTriggersPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $validCats = [0, 1, 2, 3, 4, 5];
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
protected $reqUGroup = U_GROUP_STAFF;
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
@@ -17,8 +17,11 @@ class ArenaTeamPage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 5, 3];
|
||||
protected $tpl = 'roster';
|
||||
protected $js = [[JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/profile_all.js'],
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_CSS_FILE, 'css/Profiler.css']
|
||||
);
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
@@ -97,7 +100,7 @@ class ArenaTeamPage extends GenericPage
|
||||
if ($this->doResync)
|
||||
return;
|
||||
|
||||
$this->addScript([JS_FILE, '?data=realms.weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=realms.weight-presets']);
|
||||
|
||||
$this->redButtons[BUTTON_RESYNC] = [$this->subjectGUID, 'arena-team'];
|
||||
|
||||
|
||||
@@ -15,7 +15,11 @@ class ArenaTeamsPage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 5, 3];
|
||||
protected $tpl = 'arena-teams';
|
||||
protected $js = [[JS_FILE, 'filters.js'], [JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/filters.js'],
|
||||
[SC_JS_FILE, 'js/profile_all.js'],
|
||||
[SC_JS_FILE, 'js/profile.js']
|
||||
);
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
@@ -57,7 +61,7 @@ class ArenaTeamsPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=realms']);
|
||||
|
||||
$conditions = [];
|
||||
if (!User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
|
||||
@@ -16,7 +16,7 @@ class ClassPage extends GenericPage
|
||||
protected $path = [0, 12];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
public function __construct($pageCall, $id)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ class ClassPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$infobox = Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'));
|
||||
$_mask = 1 << ($this->typeId - 1);
|
||||
|
||||
@@ -11,14 +11,14 @@ class ComparePage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 3];
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $js = array(
|
||||
[JS_FILE, 'profile.js'],
|
||||
[JS_FILE, 'Draggable.js'],
|
||||
[JS_FILE, 'filters.js'],
|
||||
[JS_FILE, 'Summary.js'],
|
||||
[JS_FILE, 'swfobject.js'],
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_JS_FILE, 'js/Draggable.js'],
|
||||
[SC_JS_FILE, 'js/filters.js'],
|
||||
[SC_JS_FILE, 'js/Summary.js'],
|
||||
[SC_JS_FILE, 'js/swfobject.js'],
|
||||
[SC_CSS_FILE, 'css/Summary.css']
|
||||
);
|
||||
protected $css = [[CSS_FILE, 'Summary.css']];
|
||||
|
||||
protected $summary = [];
|
||||
protected $cmpItems = [];
|
||||
@@ -44,7 +44,7 @@ class ComparePage extends GenericPage
|
||||
protected function generateContent()
|
||||
{
|
||||
// add conditional js
|
||||
$this->addScript([JS_FILE, '?data=weight-presets.gems.enchants.itemsets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=weight-presets.gems.enchants.itemsets']);
|
||||
|
||||
$this->summary = array(
|
||||
'template' => 'compare',
|
||||
|
||||
@@ -50,7 +50,7 @@ class CurrencyPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$_itemId = $this->subject->getField('itemId');
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class EnchantmentsPage extends GenericPage
|
||||
protected $path = [0, 101];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ class EventPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
/***********/
|
||||
/* Infobox */
|
||||
|
||||
@@ -48,7 +48,7 @@ class FactionPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
/***********/
|
||||
/* Infobox */
|
||||
|
||||
@@ -181,8 +181,19 @@ class GenericPage
|
||||
protected $name = ''; // for h1-Element
|
||||
protected $tabId = null;
|
||||
protected $gDataKey = false; // adds the dataKey to the user vars
|
||||
protected $js = [];
|
||||
protected $css = [];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/jquery-1.12.4.min.js', SC_FLAG_NO_TIMESTAMP],
|
||||
[SC_JS_FILE, 'js/basic.js' ],
|
||||
[SC_JS_FILE, 'widgets/power.js', SC_FLAG_NO_TIMESTAMP],
|
||||
[SC_JS_FILE, 'js/locale_%s.js', SC_FLAG_LOCALIZED ],
|
||||
[SC_JS_FILE, 'js/global.js' ],
|
||||
[SC_JS_FILE, 'js/locale.js' ],
|
||||
[SC_JS_FILE, 'js/Markup.js' ],
|
||||
[SC_CSS_FILE, 'css/basic.css' ],
|
||||
[SC_CSS_FILE, 'css/global.css' ],
|
||||
[SC_CSS_FILE, 'css/aowow.css' ],
|
||||
[SC_CSS_FILE, 'css/locale_%s.css', SC_FLAG_LOCALIZED ]
|
||||
);
|
||||
|
||||
// private vars don't get cached
|
||||
private $time = 0;
|
||||
@@ -198,6 +209,8 @@ class GenericPage
|
||||
private $memcached = null;
|
||||
private $mysql = ['time' => 0, 'count' => 0];
|
||||
|
||||
private $js = [];
|
||||
private $css = [];
|
||||
private $headerLogo = '';
|
||||
private $fullParams = '';
|
||||
|
||||
@@ -301,6 +314,16 @@ class GenericPage
|
||||
else if (CFG_MAINTENANCE && User::isInGroup(U_GROUP_EMPLOYEE))
|
||||
Util::addNote(U_GROUP_EMPLOYEE, 'Maintenance mode enabled!');
|
||||
|
||||
// prep js+css includes
|
||||
$parentVars = get_class_vars(__CLASS__);
|
||||
if ($parentVars['scripts'] != $this->scripts) // additions set in child class
|
||||
$this->scripts = array_merge($parentVars['scripts'], $this->scripts);
|
||||
|
||||
$this->addScript(...$this->scripts);
|
||||
|
||||
if (User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT | U_GROUP_VIDEO))
|
||||
$this->addScript([SC_CSS_FILE, 'css/staff.css'], [SC_JS_FILE, 'js/staff.js']);
|
||||
|
||||
// get errors from previous page from session and apply to template
|
||||
if (method_exists($this, 'applyCCErrors'))
|
||||
$this->applyCCErrors();
|
||||
@@ -437,33 +460,59 @@ class GenericPage
|
||||
|
||||
public function addScript(array ...$structs) : void
|
||||
{
|
||||
foreach ($structs as $s) // iType, sContent, bFront, sIeCnd
|
||||
array_walk($structs, function(&$x) { $x = array_pad($x, 3, 0); });
|
||||
|
||||
foreach ($structs as [$type, $str, $flags])
|
||||
{
|
||||
if (empty($s[1]))
|
||||
if (empty($str))
|
||||
{
|
||||
trigger_error('GenericPage::addScript - content empty', E_USER_WARNING);
|
||||
continue;
|
||||
}
|
||||
|
||||
$s = array_pad($s, 4, '');
|
||||
switch ($s[0])
|
||||
$dynData = strpos($str, '?data=') === 0;
|
||||
$app = [];
|
||||
|
||||
// insert locale string
|
||||
if ($flags & SC_FLAG_LOCALIZED)
|
||||
$str = sprintf($str, User::$localeString);
|
||||
|
||||
if ($dynData)
|
||||
{
|
||||
case JS_FILE:
|
||||
case JS_STRING:
|
||||
if (empty($s[2]))
|
||||
$this->js[] = $s;
|
||||
$app[] = 'locale='.User::$localeId;
|
||||
$app[] = 't='.$_SESSION['dataKey'];
|
||||
}
|
||||
else if (($flags & SC_FLAG_APPEND_LOCALE) && User::$localeId)
|
||||
$app[] = 'lang='.Util::$subDomains[User::$localeId];
|
||||
|
||||
// append anti-cache timestamp
|
||||
if (!($flags & SC_FLAG_NO_TIMESTAMP) && !$dynData)
|
||||
if ($type == SC_JS_FILE || $type == SC_CSS_FILE)
|
||||
$app[] = filemtime('static/'.$str) ?: 0;
|
||||
|
||||
if ($app)
|
||||
$str .= ($dynData ? '&' : '?').implode('&', $app);
|
||||
|
||||
switch ($type)
|
||||
{
|
||||
case SC_JS_FILE:
|
||||
$str = ($dynData ? HOST_URL : STATIC_URL).'/'.$str;
|
||||
case SC_JS_STRING:
|
||||
if ($flags & SC_FLAG_PREFIX)
|
||||
array_unshift($this->js, [$type, $str]);
|
||||
else
|
||||
array_unshift($this->js, $s);
|
||||
$this->js[] = [$type, $str];
|
||||
break;
|
||||
case CSS_FILE:
|
||||
case CSS_STRING:
|
||||
if (empty($s[2]))
|
||||
$this->css[] = $s;
|
||||
case SC_CSS_FILE:
|
||||
$str = STATIC_URL.'/'.$str;
|
||||
case SC_CSS_STRING:
|
||||
if ($flags & SC_FLAG_PREFIX)
|
||||
array_unshift($this->css, [$type, $str]);
|
||||
else
|
||||
array_unshift($this->css, $s);
|
||||
$this->css[] = [$type, $str];
|
||||
break;
|
||||
default:
|
||||
trigger_error('GenericPage::addScript - unknown script type #'.$s[0], E_USER_WARNING);
|
||||
trigger_error('GenericPage::addScript - unknown script type #'.$type, E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ class GuidePage extends GenericPage
|
||||
|
||||
// main container should be tagged: <div class="text guide-changelog">
|
||||
// why is this here: is there a mediawiki like diff function for staff?
|
||||
$this->addScript([CSS_STRING, 'li input[type="radio"] {margin:0}']);
|
||||
$this->addScript([SC_CSS_STRING, 'li input[type="radio"] {margin:0}']);
|
||||
|
||||
$this->typeId = $this->_get['id']; // just to display sensible not-found msg
|
||||
if ($id = DB::Aowow()->selectCell('SELECT `id` FROM ?_guides WHERE `id` = ?d', $this->typeId))
|
||||
@@ -308,7 +308,7 @@ class GuidePage extends GenericPage
|
||||
|
||||
if ($this->subject->getField('status') == GUIDE_STATUS_REVIEW && User::isInGroup(U_GROUP_STAFF) && $this->_get['rev'])
|
||||
{
|
||||
$this->addScript([JS_STRING, '
|
||||
$this->addScript([SC_JS_STRING, '
|
||||
DomContentLoaded.addEvent(function() {
|
||||
let send = function (status)
|
||||
{
|
||||
@@ -364,7 +364,7 @@ class GuidePage extends GenericPage
|
||||
|
||||
private function displayChangelog() : void
|
||||
{
|
||||
$this->addScript([JS_STRING, '
|
||||
$this->addScript([SC_JS_STRING, '
|
||||
$(document).ready(function() {
|
||||
var radios = $("input[type=radio]");
|
||||
function limit(col, val) {
|
||||
@@ -419,21 +419,21 @@ class GuidePage extends GenericPage
|
||||
private function initNew() : void
|
||||
{
|
||||
$this->addScript(
|
||||
[JS_FILE, 'article-description.js'],
|
||||
[JS_FILE, 'article-editing.js'],
|
||||
[JS_FILE, 'guide-editing.js'],
|
||||
[JS_FILE, 'fileuploader.js'],
|
||||
[JS_FILE, 'toolbar.js'],
|
||||
[JS_FILE, 'AdjacentPreview.js'],
|
||||
[CSS_FILE, 'article-editing.css'],
|
||||
[CSS_FILE, 'fileuploader.css'],
|
||||
[CSS_FILE, 'guide-edit.css'],
|
||||
[CSS_FILE, 'AdjacentPreview.css'],
|
||||
[SC_JS_FILE, 'js/article-description.js'],
|
||||
[SC_JS_FILE, 'js/article-editing.js'],
|
||||
[SC_JS_FILE, 'js/guide-editing.js'],
|
||||
[SC_JS_FILE, 'js/fileuploader.js'],
|
||||
[SC_JS_FILE, 'js/toolbar.js'],
|
||||
[SC_JS_FILE, 'js/AdjacentPreview.js'],
|
||||
[SC_CSS_FILE, 'css/article-editing.css'],
|
||||
[SC_CSS_FILE, 'css/fileuploader.css'],
|
||||
[SC_CSS_FILE, 'css/guide-edit.css'],
|
||||
[SC_CSS_FILE, 'css/AdjacentPreview.css'],
|
||||
|
||||
[CSS_STRING, '#upload-result input[type=text] { padding: 0px 2px; font-size: 12px; }'],
|
||||
[CSS_STRING, '#upload-result > span { display:block; height: 22px; }'],
|
||||
[CSS_STRING, '#upload-result { display: inline-block; text-align:right; }'],
|
||||
[CSS_STRING, '#upload-progress { display: inline-block; margin-right:8px; }']
|
||||
[SC_CSS_STRING, '#upload-result input[type=text] { padding: 0px 2px; font-size: 12px; }'],
|
||||
[SC_CSS_STRING, '#upload-result > span { display:block; height: 22px; }'],
|
||||
[SC_CSS_STRING, '#upload-result { display: inline-block; text-align:right; }'],
|
||||
[SC_CSS_STRING, '#upload-progress { display: inline-block; margin-right:8px; }']
|
||||
);
|
||||
|
||||
$this->articleUrl = 'new';
|
||||
@@ -448,21 +448,21 @@ class GuidePage extends GenericPage
|
||||
private function initEdit() : bool
|
||||
{
|
||||
$this->addScript(
|
||||
[JS_FILE, 'article-description.js'],
|
||||
[JS_FILE, 'article-editing.js'],
|
||||
[JS_FILE, 'guide-editing.js'],
|
||||
[JS_FILE, 'fileuploader.js'],
|
||||
[JS_FILE, 'toolbar.js'],
|
||||
[JS_FILE, 'AdjacentPreview.js'],
|
||||
[CSS_FILE, 'article-editing.css'],
|
||||
[CSS_FILE, 'fileuploader.css'],
|
||||
[CSS_FILE, 'guide-edit.css'],
|
||||
[CSS_FILE, 'AdjacentPreview.css'],
|
||||
[SC_JS_FILE, 'js/article-description.js'],
|
||||
[SC_JS_FILE, 'js/article-editing.js'],
|
||||
[SC_JS_FILE, 'js/guide-editing.js'],
|
||||
[SC_JS_FILE, 'js/fileuploader.js'],
|
||||
[SC_JS_FILE, 'js/toolbar.js'],
|
||||
[SC_JS_FILE, 'js/AdjacentPreview.js'],
|
||||
[SC_CSS_FILE, 'css/article-editing.css'],
|
||||
[SC_CSS_FILE, 'css/fileuploader.css'],
|
||||
[SC_CSS_FILE, 'css/guide-edit.css'],
|
||||
[SC_CSS_FILE, 'css/AdjacentPreview.css'],
|
||||
|
||||
[CSS_STRING, '#upload-result input[type=text] { padding: 0px 2px; font-size: 12px; }'],
|
||||
[CSS_STRING, '#upload-result > span { display:block; height: 22px; }'],
|
||||
[CSS_STRING, '#upload-result { display: inline-block; text-align:right; }'],
|
||||
[CSS_STRING, '#upload-progress { display: inline-block; margin-right:8px; }']
|
||||
[SC_CSS_STRING, '#upload-result input[type=text] { padding: 0px 2px; font-size: 12px; }'],
|
||||
[SC_CSS_STRING, '#upload-result > span { display:block; height: 22px; }'],
|
||||
[SC_CSS_STRING, '#upload-result { display: inline-block; text-align:right; }'],
|
||||
[SC_CSS_STRING, '#upload-progress { display: inline-block; margin-right:8px; }']
|
||||
);
|
||||
|
||||
$this->articleUrl = 'edit';
|
||||
|
||||
@@ -17,8 +17,11 @@ class GuildPage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 5, 2];
|
||||
protected $tpl = 'roster';
|
||||
protected $js = [[JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/profile_all.js'],
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_CSS_FILE, 'css/Profiler.css']
|
||||
);
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
@@ -97,7 +100,7 @@ class GuildPage extends GenericPage
|
||||
if ($this->doResync)
|
||||
return;
|
||||
|
||||
$this->addScript([JS_FILE, '?data=realms.weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=realms.weight-presets']);
|
||||
|
||||
$this->redButtons[BUTTON_RESYNC] = [$this->subjectGUID, 'guild'];
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class GuildsPage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 5, 2];
|
||||
protected $tpl = 'guilds';
|
||||
protected $js = [[JS_FILE, 'filters.js'], [JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js'], [SC_JS_FILE, 'js/profile_all.js'], [SC_JS_FILE, 'js/profile.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
@@ -57,7 +57,7 @@ class GuildsPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=realms']);
|
||||
|
||||
$conditions = array(
|
||||
['c.deleteInfos_Account', null],
|
||||
|
||||
@@ -7,8 +7,11 @@ if (!defined('AOWOW_REVISION'))
|
||||
class HomePage extends GenericPage
|
||||
{
|
||||
protected $tpl = 'home';
|
||||
protected $js = [[JS_FILE, 'home.js']];
|
||||
protected $css = [[CSS_FILE, 'home.css']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/home.js'],
|
||||
[SC_CSS_FILE, 'css/home.css'],
|
||||
[SC_CSS_STRING, '.announcement { margin: auto; max-width: 1200px; padding: 0px 15px 15px 15px }']
|
||||
);
|
||||
|
||||
protected $featuredBox = [];
|
||||
protected $oneliner = '';
|
||||
@@ -21,8 +24,6 @@ class HomePage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([CSS_STRING, '.announcement { margin: auto; max-width: 1200px; padding: 0px 15px 15px 15px }']);
|
||||
|
||||
// load oneliner
|
||||
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_home_oneliner WHERE active = 1 LIMIT 1'))
|
||||
$this->oneliner = Util::jsEscape(Util::localizedString($_, 'text'));
|
||||
|
||||
@@ -15,7 +15,7 @@ class IconsPage extends GenericPage
|
||||
protected $path = [0, 31];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
|
||||
@@ -17,10 +17,10 @@ class ItemPage extends genericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $enhancedTT = [];
|
||||
protected $js = array(
|
||||
[JS_FILE, 'swfobject.js'], // view in 3d, ok
|
||||
[JS_FILE, 'profile.js'], // item upgrade search, also ok
|
||||
[JS_FILE, 'filters.js'] // lolwut?
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/swfobject.js'],
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_JS_FILE, 'js/filters.js']
|
||||
);
|
||||
|
||||
protected $_get = array(
|
||||
@@ -121,7 +121,7 @@ class ItemPage extends genericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=weight-presets.zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=weight-presets.zones']);
|
||||
|
||||
$_flags = $this->subject->getField('flags');
|
||||
$_slot = $this->subject->getField('slot');
|
||||
@@ -348,12 +348,10 @@ class ItemPage extends genericPage
|
||||
// pageText
|
||||
$pageText = [];
|
||||
if ($this->pageText = Game::getPageText($this->subject->getField('pageTextId')))
|
||||
{
|
||||
$this->addScript(
|
||||
[JS_FILE, 'Book.js'],
|
||||
[CSS_FILE, 'Book.css']
|
||||
[SC_JS_FILE, 'js/Book.js'],
|
||||
[SC_CSS_FILE, 'css/Book.css']
|
||||
);
|
||||
}
|
||||
|
||||
$this->headIcons = [$this->subject->getField('iconString', true, true), $this->subject->getField('stackable')];
|
||||
$this->infobox = $infobox ? '[ul][li]'.implode('[/li][li]', $infobox).'[/li][/ul]' : null;
|
||||
|
||||
@@ -15,7 +15,7 @@ class ItemsPage extends GenericPage
|
||||
protected $path = [0, 0];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'filters.js'], [JS_FILE, 'swfobject.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js'], [SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
@@ -96,7 +96,7 @@ class ItemsPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=weight-presets']);
|
||||
|
||||
$conditions = [];
|
||||
|
||||
@@ -466,10 +466,10 @@ class ItemsPage extends GenericPage
|
||||
|
||||
// if slot-dropdown is available && Armor && $path points to Armor-Class
|
||||
$form = $this->filterObj->getForm();
|
||||
if (count($this->path) == 4 && $this->category[0] == 4 && isset($form['sl']) && !is_array($form['sl']))
|
||||
$this->path[] = $form['sl'];
|
||||
else if (!empty($this->category[0]) && $this->category[0] == 0 && isset($form['ty']) && !is_array($form['ty']))
|
||||
$this->path[] = $form['ty'];
|
||||
if (count($this->path) == 4 && $this->category[0] == 4 && isset($form['sl']) && count($form['sl']) == 1)
|
||||
$this->path[] = $form['sl'][0];
|
||||
else if (isset($this->category[0]) && $this->category[0] == 0 && isset($form['ty']) && count($form['ty']) == 1)
|
||||
$this->path[] = $form['ty'][0];
|
||||
}
|
||||
|
||||
// fetch best possible gems for chosen weights
|
||||
|
||||
@@ -16,7 +16,7 @@ class ItemsetPage extends GenericPage
|
||||
protected $path = [0, 2];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js'], [JS_FILE, 'Summary.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js'], [SC_JS_FILE, 'js/Summary.js']];
|
||||
|
||||
protected $summary = [];
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class ItemsetsPage extends GenericPage
|
||||
protected $path = [0, 2];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
@@ -31,7 +31,7 @@ class ItemsetsPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=weight-presets']);
|
||||
|
||||
$conditions = [];
|
||||
|
||||
|
||||
@@ -11,8 +11,10 @@ class MapsPage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 1];
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $js = [[JS_FILE, 'maps.js']];
|
||||
protected $css = [[CSS_STRING, 'zone-picker { margin-left: 4px }']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/maps.js'],
|
||||
[SC_CSS_STRING, 'zone-picker { margin-left: 4px }']
|
||||
);
|
||||
|
||||
public function __construct($pageCall, $__)
|
||||
{
|
||||
@@ -24,7 +26,7 @@ class MapsPage extends GenericPage
|
||||
protected function generateContent()
|
||||
{
|
||||
// add conditional js
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
}
|
||||
|
||||
protected function generateTitle()
|
||||
|
||||
@@ -14,7 +14,7 @@ class MorePage extends GenericPage
|
||||
protected $path = [];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
private $page = [];
|
||||
private $req2priv = array(
|
||||
|
||||
@@ -16,8 +16,7 @@ class NpcPage extends GenericPage
|
||||
protected $path = [0, 4];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js'], [SC_CSS_FILE, 'css/Profiler.css']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||
|
||||
@@ -57,7 +56,7 @@ class NpcPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$_typeFlags = $this->subject->getField('typeFlags');
|
||||
$_altIds = [];
|
||||
|
||||
@@ -16,7 +16,7 @@ class NpcsPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $validCats = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
@@ -33,7 +33,7 @@ class NpcsPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$conditions = [];
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class ObjectPage extends GenericPage
|
||||
protected $path = [0, 5];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||
|
||||
@@ -51,7 +51,7 @@ class ObjectPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
/***********/
|
||||
/* Infobox */
|
||||
@@ -214,12 +214,10 @@ class ObjectPage extends GenericPage
|
||||
|
||||
// pageText
|
||||
if ($this->pageText = Game::getPageText($next = $this->subject->getField('pageTextId')))
|
||||
{
|
||||
$this->addScript(
|
||||
[JS_FILE, 'Book.js'],
|
||||
[CSS_FILE, 'Book.css']
|
||||
[SC_JS_FILE, 'js/Book.js'],
|
||||
[SC_CSS_FILE, 'css/Book.css']
|
||||
);
|
||||
}
|
||||
|
||||
// get spawns and path
|
||||
$map = null;
|
||||
|
||||
@@ -16,7 +16,7 @@ class ObjectsPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $validCats = [-2, -3, -4, -5, -6, 0, 3, 9, 25];
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
@@ -33,7 +33,7 @@ class ObjectsPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$conditions = [];
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class PetPage extends GenericPage
|
||||
protected $path = [0, 8];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
public function __construct($pageCall, $id)
|
||||
{
|
||||
@@ -43,7 +43,7 @@ class PetPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
/***********/
|
||||
/* Infobox */
|
||||
|
||||
@@ -18,17 +18,15 @@ class ProfilePage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 5, 1];
|
||||
protected $tpl = 'profile';
|
||||
protected $js = array(
|
||||
[JS_FILE, 'filters.js'],
|
||||
[JS_FILE, 'TalentCalc.js'],
|
||||
[JS_FILE, 'swfobject.js'],
|
||||
[JS_FILE, 'profile_all.js'],
|
||||
[JS_FILE, 'profile.js'],
|
||||
[JS_FILE, 'Profiler.js']
|
||||
);
|
||||
protected $css = array(
|
||||
[CSS_FILE, 'talentcalc.css'],
|
||||
[CSS_FILE, 'Profiler.css']
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/filters.js'],
|
||||
[SC_JS_FILE, 'js/TalentCalc.js'],
|
||||
[SC_JS_FILE, 'js/swfobject.js'],
|
||||
[SC_JS_FILE, 'js/profile_all.js'],
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_JS_FILE, 'js/Profiler.js'],
|
||||
[SC_CSS_FILE, 'css/talentcalc.css'],
|
||||
[SC_CSS_FILE, 'css/Profiler.css']
|
||||
);
|
||||
|
||||
protected $_get = array(
|
||||
@@ -150,7 +148,7 @@ class ProfilePage extends GenericPage
|
||||
return;
|
||||
|
||||
// + .titles ?
|
||||
$this->addScript([JS_FILE, '?data=enchants.gems.glyphs.itemsets.pets.pet-talents.quick-excludes.realms.statistics.weight-presets.achievements&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=enchants.gems.glyphs.itemsets.pets.pet-talents.quick-excludes.realms.statistics.weight-presets.achievements']);
|
||||
|
||||
// as demanded by the raid activity tracker
|
||||
$bossIds = array(
|
||||
|
||||
@@ -10,8 +10,11 @@ class ProfilerPage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $tpl = 'profiler';
|
||||
protected $gDataKey = true;
|
||||
protected $js = [[JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/profile_all.js'],
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_CSS_FILE, 'css/Profiler.css']
|
||||
);
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
@@ -23,7 +26,7 @@ class ProfilerPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=realms']);
|
||||
}
|
||||
|
||||
protected function generatePath() { }
|
||||
|
||||
@@ -17,8 +17,12 @@ class ProfilesPage extends GenericPage
|
||||
protected $tabId = 1;
|
||||
protected $path = [1, 5, 0];
|
||||
protected $tpl = 'profiles';
|
||||
protected $js = [[JS_FILE, 'filters.js'], [JS_FILE, 'profile_all.js'], [JS_FILE, 'profile.js']];
|
||||
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/filters.js'],
|
||||
[SC_JS_FILE, 'js/profile_all.js'],
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_CSS_FILE, 'css/Profiler.css']
|
||||
);
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
@@ -62,7 +66,7 @@ class ProfilesPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=weight-presets.realms&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=weight-presets.realms']);
|
||||
|
||||
$conditions = [];
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ class QuestPage extends GenericPage
|
||||
protected $path = [0, 3];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'ShowOnMap.js']];
|
||||
protected $css = [[CSS_FILE, 'Book.css']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/ShowOnMap.js'], [SC_CSS_FILE, 'css/Book.css']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||
|
||||
@@ -570,7 +569,7 @@ class QuestPage extends GenericPage
|
||||
/* Mapper */
|
||||
/**********/
|
||||
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
// gather points of interest
|
||||
$mapNPCs = $mapGOs = []; // [typeId, start|end|objective, startItemId]
|
||||
|
||||
@@ -15,7 +15,7 @@ class QuestsPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $validCats = [];
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class RacePage extends GenericPage
|
||||
protected $path = [0, 13];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
public function __construct($pageCall, $id)
|
||||
{
|
||||
|
||||
@@ -12,8 +12,7 @@ class ScreenshotPage extends GenericPage
|
||||
const MAX_H = 325;
|
||||
|
||||
protected $tpl = 'screenshot';
|
||||
protected $js = [[JS_FILE, 'Cropper.js']];
|
||||
protected $css = [[CSS_FILE, 'Cropper.css']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/Cropper.js'], [SC_CSS_FILE, 'css/Cropper.css']];
|
||||
protected $reqAuth = true;
|
||||
protected $tabId = 0;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class SearchPage extends GenericPage
|
||||
protected $tpl = 'search';
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_SEARCH;
|
||||
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
protected $lvTabs = []; // [file, data, extraInclude, osInfo] // osInfo:[type, appendix, nMatches, param1, param2]
|
||||
protected $forceTabs = true;
|
||||
protected $search = ''; // output
|
||||
@@ -208,7 +208,7 @@ class SearchPage extends GenericPage
|
||||
if ($this->mode == CACHE_TYPE_NONE) // search is invalid
|
||||
return;
|
||||
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$this->performSearch();
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ class SkillPage extends GenericPage
|
||||
$list = $spellIds ? DB::World()->selectCol('SELECT cdt.CreatureId FROM creature_default_trainer cdt JOIN trainer_spell ts ON ts.TrainerId = cdt.TrainerId WHERE ts.SpellID IN (?a)', $spellIds) : [];
|
||||
if ($list)
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$trainer = new CreatureList(array(CFG_SQL_LIMIT_NONE, ['ct.id', $list], ['s.guid', NULL, '!'], ['ct.npcflag', 0x10, '&']));
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class SoundPage extends GenericPage
|
||||
/* Main Content */
|
||||
/****************/
|
||||
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
// get spawns
|
||||
$map = null;
|
||||
@@ -331,7 +331,7 @@ class SoundPage extends GenericPage
|
||||
$npcs = new CreatureList($cnds);
|
||||
if (!$npcs->error)
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$this->extendGlobalData($npcs->getJSGlobals(GLOBALINFO_SELF));
|
||||
$this->lvTabs[] = ['creature', ['data' => array_values($npcs->getListviewData())]];
|
||||
|
||||
@@ -16,7 +16,7 @@ class SoundsPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $validCats = [1, 2, 3, 4, 6, 9, 10, 12, 13, 14, 16, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 50, 52, 53];
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class SpellPage extends GenericPage
|
||||
protected $path = [0, 1];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'swfobject.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/swfobject.js']];
|
||||
|
||||
protected $_get = ['domain' => ['filter' => FILTER_CALLBACK, 'options' => 'GenericPage::checkDomain']];
|
||||
|
||||
@@ -130,7 +130,7 @@ class SpellPage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
$_cat = $this->subject->getField('typeCat');
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ class SpellsPage extends GenericPage
|
||||
protected $path = [0, 1];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $js = [[JS_FILE, 'filters.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/filters.js']];
|
||||
|
||||
protected $_get = ['filter' => ['filter' => FILTER_UNSAFE_RAW]];
|
||||
|
||||
|
||||
@@ -12,10 +12,10 @@ class TalentPage extends GenericPage
|
||||
protected $path = [1];
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $gDataKey = true;
|
||||
protected $js = [[JS_FILE, 'TalentCalc.js']];
|
||||
protected $css = array(
|
||||
[CSS_FILE, 'talentcalc.css'],
|
||||
[CSS_FILE, 'talent.css']
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/TalentCalc.js'],
|
||||
[SC_CSS_FILE, 'css/talentcalc.css'],
|
||||
[SC_CSS_FILE, 'css/talent.css']
|
||||
);
|
||||
|
||||
private $isPetCalc = false;
|
||||
@@ -31,15 +31,17 @@ class TalentPage extends GenericPage
|
||||
protected function generateContent()
|
||||
{
|
||||
// add conditional js & css
|
||||
$this->addScript(
|
||||
[JS_FILE, ($this->isPetCalc ? '?data=pet-talents.pets' : '?data=glyphs').'&locale='.User::$localeId.'&t='.$_SESSION['dataKey']],
|
||||
[JS_FILE, $this->isPetCalc ? 'petcalc.js' : 'talent.js']
|
||||
);
|
||||
|
||||
if ($this->isPetCalc)
|
||||
$this->addScript(
|
||||
[JS_FILE, 'swfobject.js'],
|
||||
[CSS_FILE, 'petcalc.css']
|
||||
[SC_JS_FILE, '?data=pet-talents.pets'],
|
||||
[SC_JS_FILE, 'js/petcalc.js'],
|
||||
[SC_JS_FILE, 'js/swfobject.js'],
|
||||
[SC_CSS_FILE, 'css/petcalc.css']
|
||||
);
|
||||
else
|
||||
$this->addScript(
|
||||
[SC_JS_FILE, '?data=glyphs'],
|
||||
[SC_JS_FILE, 'js/talent.js']
|
||||
);
|
||||
|
||||
$this->tcType = $this->isPetCalc ? 'pc' : 'tc';
|
||||
|
||||
@@ -7,8 +7,11 @@ if (!defined('AOWOW_REVISION'))
|
||||
class UserPage extends GenericPage
|
||||
{
|
||||
protected $tpl = 'user';
|
||||
protected $js = [[JS_FILE, 'user.js'], [JS_FILE, 'profile.js']];
|
||||
protected $css = [[CSS_FILE, 'Profiler.css']];
|
||||
protected $scripts = array(
|
||||
[SC_JS_FILE, 'js/user.js'],
|
||||
[SC_JS_FILE, 'js/profile.js'],
|
||||
[SC_CSS_FILE, 'css/Profiler.css']
|
||||
);
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
|
||||
protected $typeId = 0;
|
||||
@@ -237,7 +240,7 @@ class UserPage extends GenericPage
|
||||
$profiles = new LocalProfileList($conditions);
|
||||
if (!$profiles->error)
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=weight-presets&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=weight-presets']);
|
||||
|
||||
// Characters
|
||||
if ($chars = $profiles->getListviewData(PROFILEINFO_CHARACTER | PROFILEINFO_USER))
|
||||
|
||||
@@ -14,7 +14,7 @@ class ZonePage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $type = Type::ZONE;
|
||||
protected $tpl = 'detail-page-generic';
|
||||
protected $js = [[JS_FILE, 'ShowOnMap.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/ShowOnMap.js']];
|
||||
|
||||
protected $zoneMusic = [];
|
||||
|
||||
@@ -33,7 +33,7 @@ class ZonePage extends GenericPage
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
$this->addScript([JS_FILE, '?data=zones&locale='.User::$localeId.'&t='.$_SESSION['dataKey']]);
|
||||
$this->addScript([SC_JS_FILE, '?data=zones']);
|
||||
|
||||
/***********/
|
||||
/* Infobox */
|
||||
|
||||
@@ -16,7 +16,7 @@ class ZonesPage extends GenericPage
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_PAGE;
|
||||
protected $validCats = [true, true, [0, 1, 2], [0, 1, 2], false, false, true, false, true, true, true];
|
||||
protected $js = [[JS_FILE, 'ShowOnMap.js']];
|
||||
protected $scripts = [[SC_JS_FILE, 'js/ShowOnMap.js']];
|
||||
|
||||
public function __construct($pageCall, $pageParam)
|
||||
{
|
||||
|
||||
@@ -3,19 +3,11 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<link rel="SHORTCUT ICON" href="<?=STATIC_URL; ?>/images/logos/favicon.ico" />
|
||||
<link rel="search" type="application/opensearchdescription+xml" href="<?=STATIC_URL; ?>/download/searchplugins/aowow.xml" title="Aowow" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=STATIC_URL.'/css/basic.css?'.AOWOW_REVISION; ?>" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=STATIC_URL.'/css/global.css?'.AOWOW_REVISION; ?>" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=STATIC_URL.'/css/aowow.css?'.AOWOW_REVISION; ?>" />
|
||||
<link rel="stylesheet" type="text/css" href="<?=STATIC_URL.'/css/locale_'.User::$localeString.'.css?'.AOWOW_REVISION; ?>" />
|
||||
<?php
|
||||
if (User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT | U_GROUP_VIDEO)):
|
||||
echo ' <link rel="stylesheet" type="text/css" href="'.STATIC_URL.'/css/staff.css?'.AOWOW_REVISION."\" />\n";
|
||||
endif;
|
||||
|
||||
foreach ($this->css as [$type, $css]):
|
||||
if ($type == CSS_FILE):
|
||||
echo ' <link rel="stylesheet" type="text/css" href="'.STATIC_URL.'/css/'.$css.'?'.AOWOW_REVISION."\" />\n";
|
||||
elseif ($type == CSS_STRING):
|
||||
if ($type == SC_CSS_FILE):
|
||||
echo ' <link rel="stylesheet" type="text/css" href="'.$css."\" />\n";
|
||||
elseif ($type == SC_CSS_STRING):
|
||||
echo ' <style type="text/css">'.$css."</style>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
@@ -30,22 +22,11 @@ if ($this->gDataKey):
|
||||
endif;
|
||||
?>
|
||||
</script>
|
||||
<script src="<?=STATIC_URL.'/js/jquery-1.12.4.min.js'; ?>" type="text/javascript"></script>
|
||||
<script src="<?=STATIC_URL.'/js/basic.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
|
||||
<script src="<?=STATIC_URL.'/widgets/power.js?lang='.substr(User::$localeString, 2); ?>" type="text/javascript"></script>
|
||||
<script src="<?=STATIC_URL.'/js/locale_'.User::$localeString.'.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
|
||||
<script src="<?=STATIC_URL.'/js/global.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
|
||||
<script src="<?=STATIC_URL.'/js/locale.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
|
||||
<script src="<?=STATIC_URL.'/js/Markup.js?'.AOWOW_REVISION; ?>" type="text/javascript"></script>
|
||||
<?php
|
||||
if (User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT | U_GROUP_VIDEO)):
|
||||
echo ' <script src="'.STATIC_URL.'/js/staff.js?'.AOWOW_REVISION."\" type=\"text/javascript\"></script>\n";
|
||||
endif;
|
||||
|
||||
foreach ($this->js as [$type, $js]):
|
||||
if ($type == JS_FILE):
|
||||
echo ' <script type="text/javascript" src="'.($js[0] == '?' ? $js.'&' : STATIC_URL.'/js/'.$js.'?').AOWOW_REVISION."\"></script>\n";
|
||||
elseif ($type == JS_STRING):
|
||||
if ($type == SC_JS_FILE):
|
||||
echo ' <script type="text/javascript" src="'.$js."\"></script>\n";
|
||||
elseif ($type == SC_JS_STRING):
|
||||
echo ' <script type="text/javascript">'.$js."</script>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
Reference in New Issue
Block a user