state system working, toolbar for details workin

This commit is contained in:
Ulf Gebhardt 2014-06-23 22:01:37 +02:00
parent b9e7cb2cbf
commit 2681c877b7
14 changed files with 110 additions and 77 deletions

View File

@ -26,16 +26,16 @@ class default_page extends SYSTEM\PAGE\Page {
$vars = array();
$vars['js'] = $this->js();
$vars['css'] = $this->css();
$vars['default_page_welcome'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_welcome.tpl'), array());
$vars['default_page_serverinfo'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_serverinfo.tpl'), array());
$vars['default_page_login'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_login.tpl'), array());
$vars['default_page_toolbar'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_toolbar.tpl'), array());
//$vars['default_page_welcome'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_welcome.tpl'), array());
//$vars['default_page_serverinfo'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_serverinfo.tpl'), array());
//$vars['default_page_login'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_login.tpl'), array());
//$vars['default_page_toolbar'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_page/default_page_toolbar.tpl'), array());
$vars['PICPATH'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=default_page&id=';
$vars['copyright'] = '';
$vars['inprint'] = '';
$vars['realm_status'] = realm::status();
$vars['world_status'] = world::status();
$vars['player_online'] = database::player_online();
//$vars['realm_status'] = realm::status();
//$vars['world_status'] = world::status();
//$vars['player_online'] = database::player_online();
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE),
\SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_WOW_SERVERINFO),
\SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_BASIC));

View File

@ -17,49 +17,7 @@
</div>
<div class="threecol_row" style="">
<div id="frame_left_border" class="threecol_col" style="background: url(${PICPATH}border_left.png) repeat-y;"></div>
<div id="frame_content">
<div id="frame_content_left">${default_page_welcome}</div>
<div id="frame_content_center">
<div class="threecol_parent" style="width: 30%; height: 462px;">
<div class="threecol_row" style="height: 12px;">
<div class="threecol_col" style="background: url(${PICPATH}border_tops_l.png) no-repeat;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_tops_m.png) repeat-x;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_tops_r.png) no-repeat;"></div>
</div>
<div class="threecol_row">
<div class="threecol_col" style="background: url(${PICPATH}border_lefts.png) repeat-y; width: 12px;"></div>
<div class="threecol_col" style="background-color: darkslategrey; padding-left: 10px;">${default_page_login}</div>
<div class="threecol_col" style="background: url(${PICPATH}border_rights.png) repeat-y; width: 12px;"></div>
</div>
<div class="threecol_row" style="height: 12px;">
<div class="threecol_col" style="background: url(${PICPATH}border_bots_l.png) no-repeat;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_bots_m.png) repeat-x;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_bots_r.png) no-repeat;"></div>
</div>
</div>
</div>
<div id="frame_content_right">
<div class="threecol_parent" style="width: 30%; height: 462px;">
<div class="threecol_row" style="height: 12px;">
<div class="threecol_col" style="background: url(${PICPATH}border_tops_l.png) no-repeat;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_tops_m.png) repeat-x;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_tops_r.png) no-repeat;"></div>
</div>
<div class="threecol_row">
<div class="threecol_col" style="background: url(${PICPATH}border_lefts.png) repeat-y; width: 12px;"></div>
<div class="threecol_col" style="background-color: darkolivegreen; padding-left: 10px;">${default_page_serverinfo}</div>
<div class="threecol_col" style="background: url(${PICPATH}border_rights.png) repeat-y; width: 12px;"></div>
</div>
<div class="threecol_row" style="height: 12px;">
<div class="threecol_col" style="background: url(${PICPATH}border_bots_l.png) no-repeat;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_bots_m.png) repeat-x;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_bots_r.png) no-repeat;"></div>
</div>
</div>
</div>
<div class="clear"></div>
<div id="frame_content_toolbar">${default_page_toolbar}</div>
</div>
<div id="frame_content"></div>
<div id="frame_right_border" class="threecol_col" style="background: url(${PICPATH}border_right.png) repeat-y;"></div>
</div>
<div id="frame_footer" class="threecol_row">

View File

@ -40,7 +40,7 @@ function SYSTEM(endpoint, group){
}
SYSTEM.prototype.load_pagestates = function(){
result = false;
newps = null;
newps = this.pagestates;
if(!this.pagestates){
$.ajax({
async: false,
@ -57,7 +57,7 @@ SYSTEM.prototype.load_pagestates = function(){
result = false;}
}
});
}
} else { result = true;}
this.pagestates = newps;
return result;
};
@ -67,7 +67,6 @@ SYSTEM.prototype.load = function(id){
return false;}
var push = true;
this.pagestates.forEach(function(entry) {
console.log(entry);
if(entry['id'] === id){
if(push){
window.history.pushState(null, "", '#'+id);
@ -94,15 +93,29 @@ SYSTEM.prototype.cur_state = function() {
return pageName;
}
var sys = null;
$(document).ready(function() {
sys = new SYSTEM('./api.php',1);
sys.load('start');
});
function init_start(){
register_login();
$('#start a').click(function() {
load_wizard_details();});
load_visualisation('mojopulse');
sys = new SYSTEM('./api.php',1);
sys.load('default');
});
$('#start a').click(function() {
sys.load('wizard_details');});
}
function init_wizard_details(){
wizard_details();
sys.load('wizard_details_toolbar');}
function init_wizard_details_toolbar(){
$('#last').click(function(){sys.load($(this).attr('sysload'));});
$('#next').click(function(){sys.load($(this).attr('sysload'));});
}
function register_login(){
$("#login_form input").not("[type=submit]").jqBootstrapValidation({
@ -125,14 +138,3 @@ function register_login(){
}
});
}
function load_wizard_details(){
$('#frame_content').load('?action=wizard_details', function (){
wizard_details();
});
};
function load_toolbar(){
$('#frame_content_toolbar').load('?action=wizard_toolbar', function(){
});
}

View File

@ -0,0 +1,21 @@
<?php
class default_start extends SYSTEM\PAGE\Page {
public function html(){
$vars = array();
$vars['default_page_welcome'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/default_page_welcome.tpl'), array());
$vars['default_page_serverinfo'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/default_page_serverinfo.tpl'), array());
$vars['default_page_login'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/default_page_login.tpl'), array());
$vars['default_page_toolbar'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/default_page_toolbar.tpl'), array());
$vars['PICPATH'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=default_page&id=';
$vars['copyright'] = '';
$vars['inprint'] = '';
$vars['realm_status'] = realm::status();
$vars['world_status'] = world::status();
$vars['player_online'] = database::player_online();
$vars = array_merge($vars, \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_MAINPAGE),
\SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_WOW_SERVERINFO),
\SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_BASIC));
return \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/default_start.tpl'), $vars);
}
}

View File

@ -0,0 +1,41 @@
<div id="frame_content_left">${default_page_welcome}</div>
<div id="frame_content_center">
<div class="threecol_parent" style="width: 30%; height: 462px;">
<div class="threecol_row" style="height: 12px;">
<div class="threecol_col" style="background: url(${PICPATH}border_tops_l.png) no-repeat;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_tops_m.png) repeat-x;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_tops_r.png) no-repeat;"></div>
</div>
<div class="threecol_row">
<div class="threecol_col" style="background: url(${PICPATH}border_lefts.png) repeat-y; width: 12px;"></div>
<div class="threecol_col" style="background-color: darkslategrey; padding-left: 10px;">${default_page_login}</div>
<div class="threecol_col" style="background: url(${PICPATH}border_rights.png) repeat-y; width: 12px;"></div>
</div>
<div class="threecol_row" style="height: 12px;">
<div class="threecol_col" style="background: url(${PICPATH}border_bots_l.png) no-repeat;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_bots_m.png) repeat-x;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_bots_r.png) no-repeat;"></div>
</div>
</div>
</div>
<div id="frame_content_right">
<div class="threecol_parent" style="width: 30%; height: 462px;">
<div class="threecol_row" style="height: 12px;">
<div class="threecol_col" style="background: url(${PICPATH}border_tops_l.png) no-repeat;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_tops_m.png) repeat-x;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_tops_r.png) no-repeat;"></div>
</div>
<div class="threecol_row">
<div class="threecol_col" style="background: url(${PICPATH}border_lefts.png) repeat-y; width: 12px;"></div>
<div class="threecol_col" style="background-color: darkolivegreen; padding-left: 10px;">${default_page_serverinfo}</div>
<div class="threecol_col" style="background: url(${PICPATH}border_rights.png) repeat-y; width: 12px;"></div>
</div>
<div class="threecol_row" style="height: 12px;">
<div class="threecol_col" style="background: url(${PICPATH}border_bots_l.png) no-repeat;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_bots_m.png) repeat-x;"></div>
<div class="threecol_col" style="background: url(${PICPATH}border_bots_r.png) no-repeat;"></div>
</div>
</div>
</div>
<div class="clear"></div>
<div id="frame_content_toolbar">${default_page_toolbar}</div>

View File

@ -4,6 +4,9 @@ class page_mojotrollz extends \SYSTEM\API\api_default {
public static function default_page(){
return new default_page();}
public static function action_default_start(){
return new default_start();}
public static function action_wizard_details(){
return new wizard_details();}
@ -26,8 +29,8 @@ class page_mojotrollz extends \SYSTEM\API\api_default {
public static function action_wizard_reg(){
return new wizard_reg();}
public static function action_wizard_toolbar(){
return new wizard_toolbar();}
public static function action_wizard_toolbar($last,$next){
return new wizard_toolbar($last,$next);}
public static function action_user_news(){
return new user_news();}

View File

@ -1,6 +1,8 @@
<?php
\SYSTEM\autoload::registerFolder(dirname(__FILE__),'');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_page','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_info','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_start','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/wizard_details','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/wizard_visuals','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/wizard_friend','');
@ -10,5 +12,4 @@
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/wizard_reg','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_news','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/user_guild','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/wizard_toolbar','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/default_info','');
\SYSTEM\autoload::registerFolder(dirname(__FILE__).'/wizard_toolbar','');

View File

@ -62,8 +62,7 @@ function wizard_details (){
$('#content .male').click(function (){male();});
$('#content .female').click(function (){female ();});
$('#details_race .human, #details_race .ork, #details_race .dwarf, #details_race .undead, #details_race .nightelf, #details_race .tauren, #details_race .gnome, #details_race .troll').click(function (){wowrace($(this).attr('race'));});
load_toolbar();
$('#details_race .human, #details_race .ork, #details_race .dwarf, #details_race .undead, #details_race .nightelf, #details_race .tauren, #details_race .gnome, #details_race .troll').click(function (){wowrace($(this).attr('race'));});
}
function male (){

View File

@ -1,8 +1,16 @@
<?php
class wizard_toolbar extends SYSTEM\PAGE\Page {
public $last = null;
public $next = null;
public function __construct($last,$next) {
$this->last = $last;
$this->next = $next;
}
public function html(){
$vars = json_decode(charcreation::data(),true)['result'];
$vars['last'] = $this->last;
$vars['next'] = $this->next;
$vars['WOWICONS'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=wowicons&id=';
return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'wizard_toolbar/wizard_toolbar.tpl'), $vars);
}

View File

@ -1,4 +1,4 @@
<a class="back" href="#" style="padding-left: 10px;"><img src="${WOWICONS}arrow_left.png" /></a>
<a id="last" sysload="${last}" href="#${last}" style="padding-left: 10px;"><img src="${WOWICONS}arrow_left.png" /></a>
<a class="name" href="#" style="padding-left: 10px;">${char_name}</a>
<a class="gender race" href="#" style="padding-left: 10px;"><img src="${WOWICONS}${char_race}_${char_gender}.png" /></a>
<a class="class" href="#" style="padding-left: 10px;"><img src="${WOWICONS}${char_class}.png" /></a>
@ -7,4 +7,4 @@
<a class="skill" href="#" style="padding-left: 30px;"><img src="${WOWICONS}default.png" /></a>
<a class="skill" href="#" style="padding-left: 30px;"><img src="${WOWICONS}default.png" /></a>
<a class="spawn" href="#" style="padding-left: 30px;"><img src="${WOWICONS}default.png" /></a>
<a class="next" href="#" style="padding-left: 20px;"><img src="${WOWICONS}arrow_right.png" /></a>
<a id="next" sysload="${next}" href="#${next}" style="padding-left: 20px;"><img src="${WOWICONS}arrow_right.png" /></a>