diff --git a/mojotrollz/page/default_page/default_page.php b/mojotrollz/page/default_page/default_page.php
index d9ff38c..afef6c5 100644
--- a/mojotrollz/page/default_page/default_page.php
+++ b/mojotrollz/page/default_page/default_page.php
@@ -15,6 +15,7 @@ class default_page extends SYSTEM\PAGE\Page {
''.
''.
''.
+ ''.
'';
}
diff --git a/mojotrollz/page/default_page/js/system.js b/mojotrollz/page/default_page/js/system.js
index d630cc1..1f9197e 100644
--- a/mojotrollz/page/default_page/js/system.js
+++ b/mojotrollz/page/default_page/js/system.js
@@ -57,7 +57,7 @@ SYSTEM.prototype.call = function(call,success,data,data_type,async){
dataType: data_type,
url: this.endpoint+'?'+call,
success: success,
- //error: function{console.log(call)}
+ error: function(XMLHttpRequest, textStatus, errorThrown){console.log(call);}
});
}
//get the pagestates and save em
@@ -72,8 +72,8 @@ SYSTEM.prototype.load_pagestates = function(){
};
//load a pagestatewith given id
SYSTEM.prototype.load = function(id){
+ console.log('Load Pagestate: '+id);
if(!this.load_pagestates()){
- console.log(id+'2');
return false;}
var push = true;
this.pagestates.forEach(function(entry) {
@@ -81,24 +81,29 @@ SYSTEM.prototype.load = function(id){
if(push){
window.history.pushState(null, "", '#'+id);
push = false;}
- var fn = window[entry['func']];
- if(typeof fn !== 'function') {
- fn = null;}
- $(entry['div']).load(entry['url'],fn);
+ $.ajax({
+ async: false,
+ data: {},
+ dataType: 'html',
+ url: entry['url'],
+ success: function(data){$(entry['div']).html(data); var fn = window[entry['func']]; if(typeof fn === 'function'){fn()};},
+ error: function(XMLHttpRequest, textStatus, errorThrown){console.log(errorThrown);}
+ });
+ //$(entry['div']).load(entry['url'],fn);
+
}
});
return push ? false : true;
};
//what?
SYSTEM.prototype.cur_state = function() {
- var pathName = window.location.pathname,
- pageName = "";
-
- if (pathName.indexOf("/") != -1) {
- pageName = pathName.split("/").pop();
- } else {
- pageName = pathName;
- }
-
- return pageName;
+ var pathName = window.location.href;
+ if (pathName.indexOf('#') != -1) {
+ return pathName.split('#').pop();}
+ return '';
+}
+
+SYSTEM.prototype.go_state = function(default_state){
+ pageName = this.cur_state();
+ this.load(pageName ? pageName : default_state);
}
\ No newline at end of file
diff --git a/mojotrollz/page/default_page/js/wizard.js b/mojotrollz/page/default_page/js/wizard.js
index b0f5a53..7e757de 100644
--- a/mojotrollz/page/default_page/js/wizard.js
+++ b/mojotrollz/page/default_page/js/wizard.js
@@ -2,7 +2,8 @@ var sys = null;
$(document).ready(function() {
sys = new SYSTEM('./api.php',1);
- sys.load('start');
+ sys.go_state('start');
+ //sys.load();
});
function sendInfo(json,toolbar){
@@ -25,11 +26,6 @@ function register_login(){
$.get('./api.php?call=account&action=login&username='+$('#bt_login_user').val()+'&password_sha='+$.sha1($('#bt_login_password').val())+'&password_md5='+$.md5($('#bt_login_password').val()), function (data) {
if(data == 1){
$('.help-block').html("Login successfull.");
- $('#nav').load('?action=default_navbar', function (){
- $('#nav').scrollLeft(2000);
- load_wizard_page ('user_news');
- register_menu ();
- });
} else {
$('.help-block').html("Login not successfull. User & Password combination wrong.")
}
diff --git a/mojotrollz/page/default_start/default_page_welcome.tpl b/mojotrollz/page/default_start/default_page_welcome.tpl
index c2dbfce..820db93 100644
--- a/mojotrollz/page/default_start/default_page_welcome.tpl
+++ b/mojotrollz/page/default_start/default_page_welcome.tpl
@@ -7,5 +7,5 @@

-

+
\ No newline at end of file
diff --git a/mojotrollz/page/wizard_details/js/wizard_details.js b/mojotrollz/page/wizard_details/js/wizard_details.js
index 796ee9a..3f679fc 100644
--- a/mojotrollz/page/wizard_details/js/wizard_details.js
+++ b/mojotrollz/page/wizard_details/js/wizard_details.js
@@ -4,10 +4,10 @@ function init_wizard_details_toolbar(){
}
function init_wizard_details (){
- sys.load('wizard_details_toolbar');
+ //sys.load('wizard_details_toolbar');
$('#charname').keyup(function(){
- sendInfo('{"char_name" : "'+$(this).val()+'"}','wizard_details_toolbar');});
+ sendInfo('{"char_name" : "'+$(this).val()+'"}','wizard_details');});
$('.info').mouseover(function(){
var info = $(this).attr('info');
@@ -21,7 +21,7 @@ function init_wizard_details (){
$('#details_race a').addClass('fadeout');
$('#details_race .'+$(this).attr('gender')).addClass('fadein');
$(this).addClass('selected');
- sendInfo('{"char_gender" : "'+$(this).attr('gender')+'"}','wizard_details_toolbar');
+ sendInfo('{"char_gender" : "'+$(this).attr('gender')+'"}','wizard_details');
});
$('#details_race a').click(function(){
@@ -29,7 +29,7 @@ function init_wizard_details (){
$('#details_gender a').removeClass('selected');
$('#details_gender .'+$(this).attr('gender')).addClass('selected');
$(this).addClass('selected');
- sendInfo('{"char_race" : "'+$(this).attr('race')+'", "char_gender" : "'+$(this).attr('gender')+'"}','wizard_details_toolbar');
+ sendInfo('{"char_race" : "'+$(this).attr('race')+'", "char_gender" : "'+$(this).attr('gender')+'"}','wizard_details');
});
$('#details_class a').click(function(){
@@ -58,7 +58,7 @@ function init_wizard_details (){
if(!$('#details_race .selected').hasClass('fadein')){
$('#details_race .selected').removeClass('selected');
}
- sendInfo('{"char_class" : "'+$(this).attr('cclass')+'"}','wizard_details_toolbar');
+ sendInfo('{"char_class" : "'+$(this).attr('cclass')+'"}','wizard_details');
});
$('#content .male').click(function (){male();});
diff --git a/mojotrollz/page/wizard_skills/js/wizard_skills.js b/mojotrollz/page/wizard_skills/js/wizard_skills.js
new file mode 100644
index 0000000..65fbcaa
--- /dev/null
+++ b/mojotrollz/page/wizard_skills/js/wizard_skills.js
@@ -0,0 +1,4 @@
+function init_wizard_skills_toolbar(){
+ $('#last').click(function(){sys.load($(this).attr('sysload'));});
+ $('#next').click(function(){sys.load($(this).attr('sysload'));});
+}
\ No newline at end of file
diff --git a/mojotrollz/page/wizard_skills/wizard_skills.php b/mojotrollz/page/wizard_skills/wizard_skills.php
index 853309f..c380234 100644
--- a/mojotrollz/page/wizard_skills/wizard_skills.php
+++ b/mojotrollz/page/wizard_skills/wizard_skills.php
@@ -14,6 +14,6 @@ class wizard_skills extends SYSTEM\PAGE\Page {
$vars = array();
$vars['js'] = $this->js();
$vars['css'] = $this->css();
- return 'not implemented';
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'wizard_skills/wizard_skills.tpl'), $vars);
}
}
\ No newline at end of file
diff --git a/mojotrollz/page/wizard_skills/wizard_skills.tpl b/mojotrollz/page/wizard_skills/wizard_skills.tpl
new file mode 100644
index 0000000..eaee5f7
--- /dev/null
+++ b/mojotrollz/page/wizard_skills/wizard_skills.tpl
@@ -0,0 +1,2 @@
+not implemented
+
\ No newline at end of file
diff --git a/mojotrollz/page/wizard_visuals/js/wizard_visuals.js b/mojotrollz/page/wizard_visuals/js/wizard_visuals.js
index 2f624de..b301efd 100644
--- a/mojotrollz/page/wizard_visuals/js/wizard_visuals.js
+++ b/mojotrollz/page/wizard_visuals/js/wizard_visuals.js
@@ -4,22 +4,16 @@ function init_wizard_visuals_toolbar(){
}
function init_wizard_visuals (){
- sys.load('wizard_visuals_toolbar');
$('#sel_skin_color').change(function(){
- sendInfo('{"char_skin_color" : "'+$(this).val()+'"}','wizard_visuals_toolbar');
- sys.load('wizard_visuals');});
+ sendInfo('{"char_skin_color" : "'+$(this).val()+'"}','wizard_visuals');});
$('#sel_hair').change(function(){
- sendInfo('{"char_hair" : "'+$(this).val()+'"}','wizard_visuals_toolbar');
- sys.load('wizard_visuals');});
+ sendInfo('{"char_hair" : "'+$(this).val()+'"}','wizard_visuals');});
$('#sel_hair_color').change(function(){
- sendInfo('{"char_hair_color" : "'+$(this).val()+'"}','wizard_visuals_toolbar');
- sys.load('wizard_visuals');});
+ sendInfo('{"char_hair_color" : "'+$(this).val()+'"}','wizard_visuals');});
$('#sel_face').change(function(){
- sendInfo('{"char_face" : "'+$(this).val()+'"}','wizard_visuals_toolbar');
- sys.load('wizard_visuals');});
+ sendInfo('{"char_face" : "'+$(this).val()+'"}','wizard_visuals');});
$('#sel_facial_hair').change(function(){
- sendInfo('{"char_facial_hair" : "'+$(this).val()+'"}','wizard_visuals_toolbar');
- sys.load('wizard_visuals');});
+ sendInfo('{"char_facial_hair" : "'+$(this).val()+'"}','wizard_visuals');});
//$('.item').draggable();
}
\ No newline at end of file
diff --git a/mojotrollz/page/wizard_visuals/wizard_visuals.php b/mojotrollz/page/wizard_visuals/wizard_visuals.php
index 2730850..56ca53f 100644
--- a/mojotrollz/page/wizard_visuals/wizard_visuals.php
+++ b/mojotrollz/page/wizard_visuals/wizard_visuals.php
@@ -19,6 +19,6 @@ class wizard_visuals extends SYSTEM\PAGE\Page {
$vars['css'] = $this->css();
$vars['WOWICONS'] = \SYSTEM\CONFIG\config::get(\SYSTEM\CONFIG\config_ids::SYS_CONFIG_PATH_BASEURL).'api.php?call=files&cat=wowicons&id=';
$vars['infotext_default'] = \SYSTEM\locale::getStrings(DBD\locale_string::VALUE_CATEGORY_WOW_INFOTEXT)['default'];
- return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'wizard_visuals/wizard_visuals.tpl'), $vars);
+ return SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'wizard_visuals/wizard_visuals.tpl'), $vars);
}
}
\ No newline at end of file
diff --git a/mojotrollz/page/wizard_visuals/wizard_visuals.tpl b/mojotrollz/page/wizard_visuals/wizard_visuals.tpl
index 54f4fdd..ae7d610 100644
--- a/mojotrollz/page/wizard_visuals/wizard_visuals.tpl
+++ b/mojotrollz/page/wizard_visuals/wizard_visuals.tpl
@@ -123,4 +123,4 @@
-${wizard_visuals_toolbar}
\ No newline at end of file
+
\ No newline at end of file