This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Character] Rewrote character copier completely, dynamically iteratin…
…g through database fields to generate the copy routine successfully. Tested and working completely. http://i.imgur.com/lPEIMrV.png
- Loading branch information
Showing
8 changed files
with
345 additions
and
526 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,37 @@ | ||
<?php | ||
// Item Editor Dispatcher Page | ||
// Author: Akkadius | ||
|
||
echo '<div id="JSOP"></div>'; | ||
|
||
echo '<script type="text/javascript" src="modules/Character/ajax/ajax.js"></script>'; | ||
echo '<link rel="stylesheet" type="text/css" href="css/main.css">'; | ||
include('../../includes/constants2.php'); | ||
include('functions.php'); | ||
|
||
echo '<style> | ||
td{ font-size:15px; } | ||
td input{ } | ||
</style>'; | ||
|
||
PageTitle("Character Tools"); | ||
|
||
echo StartContent(); | ||
|
||
echo CBoxStart("Character Tools", "", "text-shadow: 1px 0 0 #000, 0 -1px 0 #000, 0 1px 0 #000, -1px 0 0 #000;"); | ||
|
||
echo ' | ||
<center><table width="90%" class="mainForm"><tr><td> | ||
<br> | ||
<table> | ||
<tr><td><h2> • Select Tool • </h2></td></tr> | ||
<tr><td></td></tr> | ||
<tr> | ||
<td> | ||
<select onchange="CharacterTool(this.value)"> | ||
<option value="0">-</option> | ||
<option value="1">Copy Character</option> | ||
<option value="2">Character Management (BETA)</option> | ||
</td> | ||
</tr> | ||
</table> | ||
<br> | ||
<div id="charactertool"></div> | ||
</td></tr></table></center>'; | ||
|
||
echo '<br>'; | ||
echo CBoxEnd(); | ||
|
||
echo EndContent(); | ||
require_once('includes/constants.php'); | ||
require_once('modules/Character/functions.php'); | ||
|
||
if(isset($_GET['character_copy'])) { | ||
PageTitle("Character Copier"); | ||
|
||
echo '<h3>Character Copier</h3><hr>'; | ||
|
||
echo ' | ||
<table class="table table-striped table-hover table-condensed flip-content table-bordered" style="width:300px"> | ||
<tr> | ||
<td> | ||
<select onchange="CharacterTool(this.value)" class="form-control"> | ||
<option value="0">--- Select ---</option> | ||
<option value="1">Copy Character</option> | ||
<!-- <option value="2">Character Management (BETA)</option> --> | ||
</select> | ||
</td> | ||
</tr> | ||
</table> | ||
<div id="character_copy_options"></div> | ||
<div id="character_copy_result"></div> | ||
<div id="character_search_result"></div> | ||
'; | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,126 +1,57 @@ | ||
function CharacterTool(Data) { | ||
var xmlhttp; | ||
document.getElementById("charactertool").innerHTML="<center><br><br><img src=\'images/loaders/loader8.gif\'></center><br><br>"; | ||
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } | ||
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } | ||
xmlhttp.onreadystatechange=function() { | ||
if (xmlhttp.readyState==4 && xmlhttp.status==200) { | ||
document.getElementById("charactertool").innerHTML=xmlhttp.responseText; | ||
} | ||
} | ||
xmlhttp.open("GET","ajax.php?Ajax=Character&CharTool=" + Data, true); | ||
xmlhttp.send(); | ||
} | ||
|
||
function CharSearch(Data) { | ||
var xmlhttp; | ||
document.getElementById("charactersearch").innerHTML="<center><br><br><img src=\'images/loaders/loader8.gif\'></center><br><br>"; | ||
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } | ||
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } | ||
xmlhttp.onreadystatechange=function() { | ||
if (xmlhttp.readyState==4 && xmlhttp.status==200) { | ||
document.getElementById("charactersearch").innerHTML=xmlhttp.responseText; | ||
} | ||
} | ||
xmlhttp.open("GET","ajax.php?Ajax=Character&CharSearch=" + Data, true); | ||
xmlhttp.send(); | ||
function CharacterTool(val) { | ||
u = "character_copy_options"; | ||
$("#" + u).html(global_loader); | ||
$.ajax({ | ||
url: "ajax.php?M=Character&character_copier", | ||
context: document.body | ||
}).done(function(e) { | ||
$("#" + u).html(e); | ||
}); | ||
} | ||
|
||
function CharSearchMGMT(Data) { | ||
var xmlhttp; | ||
document.getElementById("charactersearch").innerHTML="<center><br><br><img src=\'images/loaders/loader8.gif\'></center><br><br>"; | ||
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } | ||
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } | ||
xmlhttp.onreadystatechange=function() { | ||
if (xmlhttp.readyState==4 && xmlhttp.status==200) { | ||
document.getElementById("charactersearch").innerHTML=xmlhttp.responseText; | ||
} | ||
} | ||
xmlhttp.open("GET","ajax.php?Ajax=Character&CharSearchMGMT=" + Data, true); | ||
xmlhttp.send(); | ||
function CharacterSearch(val) { | ||
u = "character_search_result"; | ||
$("#" + u).html(global_loader); | ||
$.ajax({ | ||
url: "ajax.php?M=Character&character_search=" + val, | ||
context: document.body | ||
}).done(function(e) { | ||
$("#" + u).html(e); | ||
}); | ||
} | ||
|
||
function DoCharMGMT(Data) { | ||
var xmlhttp; | ||
document.getElementById("charactersearch").innerHTML="<center><br><br><img src=\'images/loaders/loader8.gif\'></center><br><br>"; | ||
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } | ||
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } | ||
xmlhttp.onreadystatechange=function() { | ||
if (xmlhttp.readyState==4 && xmlhttp.status==200) { | ||
document.getElementById("charactersearch").innerHTML=xmlhttp.responseText; | ||
} | ||
} | ||
xmlhttp.open("GET","ajax.php?Ajax=Character&DoCharMGMT=" + Data, true); | ||
xmlhttp.send(); | ||
function handle_source_character(val){ | ||
$('#origchar').val(val); | ||
} | ||
|
||
function DoCharTaskProgShow(Data, TaskID) { | ||
var xmlhttp; | ||
document.getElementById("charactersearch").innerHTML="<center><br><br><img src=\'images/loaders/loader8.gif\'></center><br><br>"; | ||
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } | ||
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } | ||
xmlhttp.onreadystatechange=function() { | ||
if (xmlhttp.readyState==4 && xmlhttp.status==200) { | ||
document.getElementById("charactersearch").innerHTML=xmlhttp.responseText; | ||
} | ||
} | ||
xmlhttp.open("GET","ajax.php?Ajax=Character&DoCharTaskProgShow=" + Data + "&TaskID=" + TaskID, true); | ||
xmlhttp.send(); | ||
function handle_destination_account(val){ | ||
$('#dest_account').val(val); | ||
} | ||
|
||
function DoGMCommand(Data, Action) { | ||
var xmlhttp; | ||
document.getElementById("GMCommand").innerHTML="<center><br><br><img src=\'images/loaders/loader8.gif\'></center><br><br>"; | ||
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } | ||
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } | ||
xmlhttp.onreadystatechange=function() { | ||
if (xmlhttp.readyState==4 && xmlhttp.status==200) { | ||
document.getElementById("GMCommand").innerHTML=xmlhttp.responseText; | ||
} | ||
} | ||
xmlhttp.open("GET","ajax.php?Ajax=Character&DoGMCommand=" + Data + "&Action=" + Action, true); | ||
xmlhttp.send(); | ||
} | ||
function CopyCharacter(){ | ||
u = "character_copy_result"; | ||
if($('#new_character_name').val() == "") { | ||
$("#" + u).html("You must specify a new character name"); | ||
return; | ||
} | ||
if($('#origchar').val() == "Origin Character"){ | ||
$("#" + u).html("There needs to be an Origin Character specified"); | ||
return; | ||
} | ||
if($('#dest_account').val() == "Destination Account"){ | ||
$("#" + u).html("There needs to be a Destination Account specified"); | ||
return; | ||
} | ||
|
||
function SendTaskUpdate(Data, TaskID, Activity, Count) { | ||
var xmlhttp; | ||
|
||
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } | ||
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } | ||
xmlhttp.onreadystatechange=function() { | ||
if (xmlhttp.readyState==4 && xmlhttp.status==200) { | ||
//document.getElementById("charactersearch").innerHTML=xmlhttp.responseText; | ||
document.getElementById("charactersearch").innerHTML="<center><br><br><img src=\'images/loaders/loader8.gif\'></center><br><br>"; | ||
setTimeout(function(){ DoCharTaskProgShow(Data, TaskID); }, 1000); | ||
} | ||
} | ||
if(document.getElementById("activity_" + Activity).value){ Count = document.getElementById("activity_" + Activity).value; } | ||
xmlhttp.open("GET","ajax.php?Ajax=Character&SendTaskUpdate=" + Data + "&TaskID=" + TaskID + "&ActivityID=" + Activity + "&Count=" + Count, true); | ||
xmlhttp.send(); | ||
|
||
} | ||
var character_copy = $('#origchar').val(); | ||
var destination_account = $('#dest_account').val(); | ||
|
||
$("#" + u).html(global_loader); | ||
$.ajax({ | ||
url: "ajax.php?M=Character&do_copy_character&source_character=" + character_copy + "&destination_account=" + destination_account + "&new_character_name=" + encodeURIComponent($('#new_character_name').val()), | ||
context: document.body | ||
}).done(function(e) { | ||
$("#" + u).html(e); | ||
}); | ||
|
||
function CopyCharacter(){ | ||
if(document.getElementById("origchar").value == "Origin Character"){ | ||
document.getElementById("copycharresults").innerHTML="There needs to be an Origin Character specified"; | ||
return; | ||
} | ||
if(document.getElementById("destaccount").value == "Destination Account"){ | ||
document.getElementById("copycharresults").innerHTML="There needs to be a Destination Account specified"; | ||
return; | ||
} | ||
var CharCopy = document.getElementById("origchar").value; | ||
var DestAcc = document.getElementById("destaccount").value; | ||
|
||
var xmlhttp; | ||
document.getElementById("copycharresults").innerHTML="<center><br><br><img src=\'images/loaders/loader8.gif\'></center><br><br>"; | ||
if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } | ||
else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } | ||
xmlhttp.onreadystatechange=function() { | ||
if (xmlhttp.readyState==4 && xmlhttp.status==200) { | ||
document.getElementById("copycharresults").innerHTML=xmlhttp.responseText; | ||
} | ||
} | ||
xmlhttp.open("GET","ajax.php?Ajax=Character&CopyChar=1&CharToCopy=" + CharCopy + "&DestAcc=" + DestAcc, true); | ||
xmlhttp.send(); | ||
} |
Oops, something went wrong.