charname workin again, updated system reference
This commit is contained in:
parent
3da1e9d588
commit
2e950c95f3
@ -2,7 +2,7 @@
|
|||||||
class charcreation_validator {
|
class charcreation_validator {
|
||||||
public static function char_name($value){
|
public static function char_name($value){
|
||||||
$data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY);
|
$data = \SYSTEM\SECURITY\Security::load(charcreation::MOJO_CC_SESSIONKEY);
|
||||||
if( strlen($value) > 12 || strlen($value) < 2 ||
|
if( strlen($value) > 12 || //strlen($value) < 2 ||
|
||||||
preg_match('/[^A-Za-z]/',$value)){
|
preg_match('/[^A-Za-z]/',$value)){
|
||||||
$data['char_name'] = charcreation::DEFAULT_CHAR_NAME;
|
$data['char_name'] = charcreation::DEFAULT_CHAR_NAME;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class default_page extends SYSTEM\PAGE\Page {
|
|||||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PLIB(),'hashmask/jquery.md5.js').'"></script>'.
|
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PLIB(),'hashmask/jquery.md5.js').'"></script>'.
|
||||||
'<script src="https://www.google.com/jsapi" type="text/javascript"></script>'.
|
'<script src="https://www.google.com/jsapi" type="text/javascript"></script>'.
|
||||||
'<script type="text/javascript">google.load("visualization", "1", {packages:["corechart"]});</script>'.
|
'<script type="text/javascript">google.load("visualization", "1", {packages:["corechart"]});</script>'.
|
||||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/system.js').'"></script>'.
|
'<script type="text/javascript" language="JavaScript" src="./api.php?call=files&cat=sys_js&id=system.js"></script>'.
|
||||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/wizard.js').'"></script>'.
|
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/wizard.js').'"></script>'.
|
||||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/onlinegraphic.js').'"></script>'.
|
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'default_page/js/onlinegraphic.js').'"></script>'.
|
||||||
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'wizard_details/js/wizard_details.js').'"></script>'.
|
'<script type="text/javascript" language="JavaScript" src="'.SYSTEM\WEBPATH(new PPAGE(),'wizard_details/js/wizard_details.js').'"></script>'.
|
||||||
|
|||||||
@ -1,109 +0,0 @@
|
|||||||
/*
|
|
||||||
|
|
||||||
divs -> content wird geladen
|
|
||||||
eindeutige id
|
|
||||||
url -> formulardaten
|
|
||||||
function die danach ausgeführt wird
|
|
||||||
|
|
||||||
id : div -> url -> func
|
|
||||||
default : div -> url -> func //default load
|
|
||||||
|
|
||||||
hole array via json
|
|
||||||
lese id
|
|
||||||
stelle dar id mithilfe von json
|
|
||||||
|
|
||||||
// Define a class like this
|
|
||||||
function Person(name, gender){
|
|
||||||
|
|
||||||
// Add object properties like this
|
|
||||||
this.name = name;
|
|
||||||
this.gender = gender;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add methods like this. All Person objects will be able to invoke this
|
|
||||||
Person.prototype.speak = function(){
|
|
||||||
alert("Howdy, my name is" + this.name);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Instantiate new objects with 'new'
|
|
||||||
var person = new Person("Bob", "M");
|
|
||||||
|
|
||||||
// Invoke methods like this
|
|
||||||
person.speak(); // alerts "Howdy, my name is Bob"
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
//mother object
|
|
||||||
function SYSTEM(endpoint, group){
|
|
||||||
this.endpoint = endpoint;
|
|
||||||
this.group = group;
|
|
||||||
this.pagestates = null;
|
|
||||||
}
|
|
||||||
//internal function to handle pagestate result
|
|
||||||
SYSTEM.prototype.handle_call_pagestates = function (data) {
|
|
||||||
if(data['status']){
|
|
||||||
newps = data['result'];
|
|
||||||
console.log('SYSTEM: loaded Pagestates');
|
|
||||||
result = true;
|
|
||||||
} else {
|
|
||||||
console.log('SYSTEM: Problem with your Pagestates.');
|
|
||||||
result = false;}
|
|
||||||
}
|
|
||||||
//send a call to the endpoint
|
|
||||||
SYSTEM.prototype.call = function(call,success,data,data_type,async){
|
|
||||||
$.ajax({
|
|
||||||
async: async,
|
|
||||||
data: data,
|
|
||||||
dataType: data_type,
|
|
||||||
url: this.endpoint+'?'+call,
|
|
||||||
success: success,
|
|
||||||
error: function(XMLHttpRequest, textStatus, errorThrown){console.log(call);}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//get the pagestates and save em
|
|
||||||
SYSTEM.prototype.load_pagestates = function(){
|
|
||||||
result = false;
|
|
||||||
newps = this.pagestates;
|
|
||||||
if(!this.pagestates){
|
|
||||||
this.call('call=pagestates&group='+this.group,this.handle_call_pagestates,{},"json",false);
|
|
||||||
} else { result = true;}
|
|
||||||
this.pagestates = newps;
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
//load a pagestatewith given id
|
|
||||||
SYSTEM.prototype.load = function(id){
|
|
||||||
console.log('Load Pagestate: '+id);
|
|
||||||
if(!this.load_pagestates()){
|
|
||||||
return false;}
|
|
||||||
var push = true;
|
|
||||||
this.pagestates.forEach(function(entry) {
|
|
||||||
if(entry['id'] === id){
|
|
||||||
if(push){
|
|
||||||
window.history.pushState(null, "", '#'+id);
|
|
||||||
push = false;}
|
|
||||||
$.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.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);
|
|
||||||
}
|
|
||||||
@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class default_start extends SYSTEM\PAGE\Page {
|
class default_start extends SYSTEM\PAGE\Page {
|
||||||
|
public static function js(){}
|
||||||
|
public static function css(){}
|
||||||
|
|
||||||
public function html(){
|
public function html(){
|
||||||
$vars = array();
|
$vars = array();
|
||||||
$vars['default_page_welcome'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/default_page_welcome.tpl'), array());
|
$vars['default_page_welcome'] = \SYSTEM\PAGE\replace::replaceFile(SYSTEM\SERVERPATH(new PPAGE(),'default_start/default_page_welcome.tpl'), array());
|
||||||
|
|||||||
@ -5,45 +5,45 @@ class page_mojotrollz extends \SYSTEM\API\api_default {
|
|||||||
public static function default_page(){
|
public static function default_page(){
|
||||||
return new default_page();}
|
return new default_page();}
|
||||||
|
|
||||||
public static function action_default_start(){
|
public static function page_default_start(){
|
||||||
return new default_start();}
|
return new default_start();}
|
||||||
|
|
||||||
public static function action_wizard_details(){
|
public static function page_wizard_details(){
|
||||||
return new wizard_details();}
|
return new wizard_details();}
|
||||||
|
|
||||||
public static function action_wizard_visuals(){
|
public static function page_wizard_visuals(){
|
||||||
return new wizard_visuals();}
|
return new wizard_visuals();}
|
||||||
|
|
||||||
public static function action_wizard_friend(){
|
public static function page_wizard_friend(){
|
||||||
return new wizard_friend();}
|
return new wizard_friend();}
|
||||||
|
|
||||||
public static function action_wizard_skills(){
|
public static function page_wizard_skills(){
|
||||||
return new wizard_skills();}
|
return new wizard_skills();}
|
||||||
|
|
||||||
public static function action_wizard_spawn(){
|
public static function page_wizard_spawn(){
|
||||||
return new wizard_spawn();}
|
return new wizard_spawn();}
|
||||||
|
|
||||||
public static function action_wizard_summ(){
|
public static function page_wizard_summ(){
|
||||||
return new wizard_summ();}
|
return new wizard_summ();}
|
||||||
|
|
||||||
public static function action_wizard_reg(){
|
public static function page_wizard_reg(){
|
||||||
return new wizard_reg();}
|
return new wizard_reg();}
|
||||||
|
|
||||||
public static function action_wizard_toolbar($last,$next){
|
public static function page_wizard_toolbar($last,$next){
|
||||||
return new wizard_toolbar($last,$next);}
|
return new wizard_toolbar($last,$next);}
|
||||||
|
|
||||||
public static function action_user_news(){
|
public static function page_user_news(){
|
||||||
return new user_news();}
|
return new user_news();}
|
||||||
|
|
||||||
public static function action_user_guild(){
|
public static function page_user_guild(){
|
||||||
return new user_guild();}
|
return new user_guild();}
|
||||||
|
|
||||||
public static function action_user_bank(){
|
public static function page_user_bank(){
|
||||||
return new user_bank();}
|
return new user_bank();}
|
||||||
|
|
||||||
public static function action_user_logout(){
|
public static function page_user_logout(){
|
||||||
return new user_logout();}
|
return new user_logout();}
|
||||||
|
|
||||||
public static function action_default_info($id){
|
public static function page_default_info($id){
|
||||||
return new default_info($id);}
|
return new default_info($id);}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,12 +6,13 @@ function init_wizard_details_toolbar(){
|
|||||||
function init_wizard_details (){
|
function init_wizard_details (){
|
||||||
//sys.load('wizard_details_toolbar');
|
//sys.load('wizard_details_toolbar');
|
||||||
|
|
||||||
$('#charname').keyup(function(){
|
$('#charname').keyup(function(event){
|
||||||
sendInfo('{"char_name" : "'+$(this).val()+'"}','wizard_details');});
|
if(event.keyCode == 13){
|
||||||
|
sendInfo('{"char_name" : "'+$(this).val()+'"}','wizard_details');}
|
||||||
|
});
|
||||||
$('.info').mouseover(function(){
|
$('.info').mouseover(function(){
|
||||||
var info = $(this).attr('info');
|
var info = $(this).attr('info');
|
||||||
$('#info_content').load('./?action=default_info&id='+info);
|
$('#info_content').load('./?page=default_info&id='+info);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#details_gender a').click(function(){
|
$('#details_gender a').click(function(){
|
||||||
|
|||||||
2
system
2
system
@ -1 +1 @@
|
|||||||
Subproject commit b196e1cb7a403e4fabefc8ae686e6597b3f3eee5
|
Subproject commit b3bf40d17d3c707d7af17943b1f6ff147c0e71a6
|
||||||
Loading…
x
Reference in New Issue
Block a user