|
@@ -5,6 +5,7 @@
|
|
|
global $LABYRINTH_STAGES;
|
|
global $LABYRINTH_STAGES;
|
|
|
global $DIFFICULTY;
|
|
global $DIFFICULTY;
|
|
|
global $ELEMENTAL_RIFT_DUNGEON;
|
|
global $ELEMENTAL_RIFT_DUNGEON;
|
|
|
|
|
+ global $UID;
|
|
|
?>
|
|
?>
|
|
|
<!DOCTYPE html>
|
|
<!DOCTYPE html>
|
|
|
<html lang='en'>
|
|
<html lang='en'>
|
|
@@ -39,16 +40,226 @@
|
|
|
<meta name='twitter:url' content='<?=$page->canonical?>'/>
|
|
<meta name='twitter:url' content='<?=$page->canonical?>'/>
|
|
|
<meta name='robots' content='index follow'/>
|
|
<meta name='robots' content='index follow'/>
|
|
|
<script>
|
|
<script>
|
|
|
- function populateUnits(total){
|
|
|
|
|
- for (var i = 0; i < 6; i ++){
|
|
|
|
|
- if (i < total){
|
|
|
|
|
- document.getElementById('new_unit_' + i).style.display = 'inline-block';
|
|
|
|
|
|
|
+ units = [];
|
|
|
|
|
+ max_units = 0;
|
|
|
|
|
+ selected_units = 0;
|
|
|
|
|
+ selected_ids = [];
|
|
|
|
|
+<?php
|
|
|
|
|
+ foreach ($page->units as $unit){
|
|
|
|
|
+?>
|
|
|
|
|
+ units.push(
|
|
|
|
|
+ {
|
|
|
|
|
+ id: <?=$unit->id?>,
|
|
|
|
|
+ name: "<?=$unit->title?>",
|
|
|
|
|
+ stars: <?=$unit->stars?>,
|
|
|
|
|
+ level: <?=$unit->level?>,
|
|
|
|
|
+ image: '<?=$unit->unit->get_image()?>',
|
|
|
|
|
+ awakens_from: '<?=$unit->unit->awakens_from?>',
|
|
|
|
|
+ awakens_to: '<?=$unit->unit->awakens_to?>',
|
|
|
|
|
+ element: '<?=$unit->unit->element_name?>'
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+<?php
|
|
|
|
|
+ }
|
|
|
|
|
+?>
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Shows or hiddes the new team panel.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param show True to show, false to hide.
|
|
|
|
|
+ */
|
|
|
|
|
+ function showNewTeam(show){
|
|
|
|
|
+ if (show === true){
|
|
|
|
|
+ document.getElementById('new_team').style.display = 'block';
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ document.getElementById('new_team').style.display = 'none';
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ function saveTeam(){
|
|
|
|
|
+ if (selected_units > max_units){
|
|
|
|
|
+ alert('Too many units selected.');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ var name = document.getElementById('new_team_name').value;
|
|
|
|
|
+ var description = document.getElementById('new_team_description').value;
|
|
|
|
|
+ var area_type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
|
|
|
|
|
+ var area = null;
|
|
|
|
|
+ var difficulty = null;
|
|
|
|
|
+ var stage = null;
|
|
|
|
|
+ switch (area_type){
|
|
|
|
|
+ case '<?=$AREA_TYPE["SCENARIO"]?>':
|
|
|
|
|
+ area = document.getElementById('new_area_scenario').options[document.getElementById('new_area_scenario').selectedIndex].value;
|
|
|
|
|
+ difficulty = document.getElementById('new_area_difficulty').options[document.getElementById('new_area_difficulty').selectedIndex].value;
|
|
|
|
|
+ stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
|
|
|
|
|
+ area = document.getElementById('new_area_cairos_dungeon').options[document.getElementById('new_area_cairos_dungeon').selectedIndex].value;
|
|
|
|
|
+ stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
|
|
|
|
|
+ area = document.getElementById('new_area_rift_dungeon').options[document.getElementById('new_area_rift_dungeon').selectedIndex].value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["RIFT_RAID"]?>':
|
|
|
|
|
+ area = document.getElementById('new_area_rift_raid').options[document.getElementById('new_area_rift_raid').selectedIndex].value;
|
|
|
|
|
+ stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["ARENA"]?>':
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["GUILD_WAR"]?>':
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
|
|
|
|
|
+ difficulty = document.getElementById('new_area_difficulty').options[document.getElementById('new_area_difficulty').selectedIndex].value;
|
|
|
|
|
+ stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
|
|
|
|
|
+ difficulty = document.getElementById('new_area_difficulty').options[document.getElementById('new_area_difficulty').selectedIndex].value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
|
|
|
|
|
+ area = document.getElementById('new_area_dimensional_hole').options[document.getElementById('new_area_dimensional_hole').selectedIndex].value;
|
|
|
|
|
+ stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
|
|
|
|
|
+ difficulty = document.getElementById('new_area_difficulty').options[document.getElementById('new_area_difficulty').selectedIndex].value;
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ alert('Unknown Area');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Number.isInteger(parseInt(area))){
|
|
|
|
|
+ area = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Number.isInteger(parseInt(stage))){
|
|
|
|
|
+ stage = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!Number.isInteger(parseInt(difficulty))){
|
|
|
|
|
+ difficulty = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ var ids = selected_ids.join(',');
|
|
|
|
|
+ var xhttp = new XMLHttpRequest();
|
|
|
|
|
+ xhttp.onreadystatechange = function() {
|
|
|
|
|
+ if (this.readyState == 4 && this.status == 200) {
|
|
|
|
|
+ alert("200");
|
|
|
|
|
+ //location.reload();
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+ xhttp.open("POST", "/action/new_team/", true);
|
|
|
|
|
+ xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
|
|
|
|
+ console.log('uid=<?=$UID?>&ids=' + ids + '&area_type=' + area_type + '&area=' + area + '&difficulty=' + difficulty + '&stage=' + stage + '&name=' + encodeURI(name) + '&description=' + encodeURI(description));
|
|
|
|
|
+ xhttp.send('uid=<?=$UID?>&ids=' + ids + '&area_type=' + area_type + '&area=' + area + '&difficulty=' + difficulty + '&stage=' + stage + '&name=' + encodeURI(name) + '&description=' + encodeURI(description));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Searches a unit with the pattern entered in the 'new_unit_id'
|
|
|
|
|
+ * field. Shows a clickable list of matching units.
|
|
|
|
|
+ */
|
|
|
|
|
+ function searchUnit(){
|
|
|
|
|
+ key = document.getElementById('new_unit_id').value;
|
|
|
|
|
+ var autocomplete = document.getElementById('new_unit_autocomplete');
|
|
|
|
|
+ while (autocomplete.firstChild) {
|
|
|
|
|
+ autocomplete.removeChild(autocomplete.firstChild);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (key.length == 0){
|
|
|
|
|
+ autocomplete.style.display = 'none';
|
|
|
|
|
+ }
|
|
|
|
|
+ for (var i = 0; i < units.length; i++) {
|
|
|
|
|
+ if (units[i].name.toUpperCase().includes(key.toUpperCase())){
|
|
|
|
|
+ autocomplete.style.display = 'block';
|
|
|
|
|
+ var line = document.createElement('div');
|
|
|
|
|
+ var img = document.createElement('img');
|
|
|
|
|
+ img.setAttribute('src', units[i].image);
|
|
|
|
|
+ var nam = document.createElement('span');
|
|
|
|
|
+ var tex = document.createTextNode(units[i].name + '(' + units[i].stars + '*, Lv. ' + units[i].level + ')');
|
|
|
|
|
+ nam.appendChild(tex);
|
|
|
|
|
+ line.appendChild(img);
|
|
|
|
|
+ line.appendChild(nam);
|
|
|
|
|
+ sid = units[i].id;
|
|
|
|
|
+ line.setAttribute('onclick', 'selectUnit(' + sid + ');');
|
|
|
|
|
+ autocomplete.appendChild(line);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Selects a unit from the list and adds it to the new team.
|
|
|
|
|
+ * The search list is hidden afterwards.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id Unit id.
|
|
|
|
|
+ */
|
|
|
|
|
+ function selectUnit(id){
|
|
|
|
|
+ var name = null;
|
|
|
|
|
+ var stars = null;
|
|
|
|
|
+ var level = null;
|
|
|
|
|
+ var image = null;
|
|
|
|
|
+ var element = null;
|
|
|
|
|
+ for (var i = 0; i < units.length; i ++) {
|
|
|
|
|
+ if (units[i].id == id){
|
|
|
|
|
+ name = units[i].name;
|
|
|
|
|
+ stars = units[i].stars;
|
|
|
|
|
+ level = units[i].level;
|
|
|
|
|
+ image = units[i].image;
|
|
|
|
|
+ element = units[i].element;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if (name != null){
|
|
|
|
|
+ var monsterPanel = document.createElement('div');
|
|
|
|
|
+ monsterPanel.setAttribute('class', 'monster_panel');
|
|
|
|
|
+ var monsterStars = document.createElement('span');
|
|
|
|
|
+ monsterStars.setAttribute('class', 'stars');
|
|
|
|
|
+ for (var i = 0; i < stars; i ++){
|
|
|
|
|
+ var star = document.createElement('img');
|
|
|
|
|
+ // TODO: Handle star color.
|
|
|
|
|
+ star.setAttribute('class', 'star star_purple');
|
|
|
|
|
+ star.setAttribute('src', '<?=$path["img"]["icon"]?>star.png');
|
|
|
|
|
+ monsterStars.appendChild(star);
|
|
|
|
|
+ }
|
|
|
|
|
+ var monsterImage = document.createElement('img');
|
|
|
|
|
+ monsterImage.setAttribute('class', 'monster border_' + element);
|
|
|
|
|
+ monsterImage.setAttribute('src', image);
|
|
|
|
|
+ var monsterLevel = document.createElement('span');
|
|
|
|
|
+ monsterLevel.setAttribute('class', 'level');
|
|
|
|
|
+ monsterLevel.appendChild(document.createTextNode(level));
|
|
|
|
|
+ monsterPanel.appendChild(monsterStars);
|
|
|
|
|
+ monsterPanel.appendChild(monsterImage);
|
|
|
|
|
+ monsterPanel.appendChild(monsterLevel);
|
|
|
|
|
+ var teamPanel = document.getElementById('new_team_units');
|
|
|
|
|
+ teamPanel.appendChild(monsterPanel);
|
|
|
|
|
+ // Hide the selector
|
|
|
|
|
+ var autocomplete = document.getElementById('new_unit_autocomplete');
|
|
|
|
|
+ while (autocomplete.firstChild) {
|
|
|
|
|
+ autocomplete.removeChild(autocomplete.firstChild);
|
|
|
|
|
+ }
|
|
|
|
|
+ autocomplete.style.display = 'none';
|
|
|
|
|
+ document.getElementById('new_unit_id').value = '';
|
|
|
|
|
+ selected_units ++;
|
|
|
|
|
+ if (selected_units >= max_units){
|
|
|
|
|
+ document.getElementById('new_unit').style.display = 'none';
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- document.getElementById('new_unit_' + i).style.display = 'none';
|
|
|
|
|
|
|
+ document.getElementById('new_unit').style.display = 'block';
|
|
|
}
|
|
}
|
|
|
|
|
+ selected_ids.push(id);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Deletes a unit from the new team form.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param id Unit id.
|
|
|
|
|
+ */
|
|
|
|
|
+ function deleteUnit(id){
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Shows the stage selector in the new team panel.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param total The number of stages to show.
|
|
|
|
|
+ */
|
|
|
function populateStage(total){
|
|
function populateStage(total){
|
|
|
var sel = document.getElementById('new_area_stage');
|
|
var sel = document.getElementById('new_area_stage');
|
|
|
while (sel.firstChild) {
|
|
while (sel.firstChild) {
|
|
@@ -56,9 +267,14 @@
|
|
|
}
|
|
}
|
|
|
var opt;
|
|
var opt;
|
|
|
var att;
|
|
var att;
|
|
|
|
|
+ // Empty
|
|
|
|
|
+ opt = document.createElement('option');
|
|
|
|
|
+ tex = document.createTextNode('');
|
|
|
|
|
+ opt.appendChild(tex);
|
|
|
|
|
+ sel.appendChild(opt);
|
|
|
for (var i = 1; i <= total; i ++){
|
|
for (var i = 1; i <= total; i ++){
|
|
|
opt = document.createElement('option');
|
|
opt = document.createElement('option');
|
|
|
- tex = document.createTextNode(i);
|
|
|
|
|
|
|
+ tex = document.createTextNode('Stage ' + i);
|
|
|
att = document.createAttribute('value');
|
|
att = document.createAttribute('value');
|
|
|
att.value = i;
|
|
att.value = i;
|
|
|
opt.setAttributeNode(att);
|
|
opt.setAttributeNode(att);
|
|
@@ -66,6 +282,15 @@
|
|
|
sel.appendChild(opt);
|
|
sel.appendChild(opt);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Shows the difficulty selector in the new team panel.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param labyrinth Indicates if the area type is the Tartarus
|
|
|
|
|
+ * labyrinth. If so, it includes 'Easy'.
|
|
|
|
|
+ * @param toa Indicates if the area type is the Tower of
|
|
|
|
|
+ * Ascension. If so, it excludes 'Hell'.
|
|
|
|
|
+ */
|
|
|
function populateDifficulty(labyrinth = false, toa = false){
|
|
function populateDifficulty(labyrinth = false, toa = false){
|
|
|
var sel = document.getElementById('new_area_difficulty');
|
|
var sel = document.getElementById('new_area_difficulty');
|
|
|
while (sel.firstChild) {
|
|
while (sel.firstChild) {
|
|
@@ -82,7 +307,7 @@
|
|
|
// Easy (Labyrinth only)
|
|
// Easy (Labyrinth only)
|
|
|
if (labyrinth){
|
|
if (labyrinth){
|
|
|
opt = document.createElement('option');
|
|
opt = document.createElement('option');
|
|
|
- tex = document.createTextNode('Normal');
|
|
|
|
|
|
|
+ tex = document.createTextNode('Easy difficulty');
|
|
|
att = document.createAttribute('value');
|
|
att = document.createAttribute('value');
|
|
|
att.value = '<?=$DIFFICULTY["EASY"]?>';
|
|
att.value = '<?=$DIFFICULTY["EASY"]?>';
|
|
|
opt.setAttributeNode(att);
|
|
opt.setAttributeNode(att);
|
|
@@ -91,7 +316,7 @@
|
|
|
}
|
|
}
|
|
|
// Normal
|
|
// Normal
|
|
|
opt = document.createElement('option');
|
|
opt = document.createElement('option');
|
|
|
- tex = document.createTextNode('Normal');
|
|
|
|
|
|
|
+ tex = document.createTextNode('Normal difficulty');
|
|
|
att = document.createAttribute('value');
|
|
att = document.createAttribute('value');
|
|
|
att.value = '<?=$DIFFICULTY["NORMAL"]?>';
|
|
att.value = '<?=$DIFFICULTY["NORMAL"]?>';
|
|
|
opt.setAttributeNode(att);
|
|
opt.setAttributeNode(att);
|
|
@@ -99,7 +324,7 @@
|
|
|
sel.appendChild(opt);
|
|
sel.appendChild(opt);
|
|
|
// Hard
|
|
// Hard
|
|
|
opt = document.createElement('option');
|
|
opt = document.createElement('option');
|
|
|
- tex = document.createTextNode('Hard');
|
|
|
|
|
|
|
+ tex = document.createTextNode('Hard difficulty');
|
|
|
att = document.createAttribute('value');
|
|
att = document.createAttribute('value');
|
|
|
att.value = '<?=$DIFFICULTY["HARD"]?>';
|
|
att.value = '<?=$DIFFICULTY["HARD"]?>';
|
|
|
opt.setAttributeNode(att);
|
|
opt.setAttributeNode(att);
|
|
@@ -108,7 +333,7 @@
|
|
|
// Hell
|
|
// Hell
|
|
|
if (!toa){
|
|
if (!toa){
|
|
|
opt = document.createElement('option');
|
|
opt = document.createElement('option');
|
|
|
- tex = document.createTextNode('Hell');
|
|
|
|
|
|
|
+ tex = document.createTextNode('Hell difficulty');
|
|
|
att = document.createAttribute('value');
|
|
att = document.createAttribute('value');
|
|
|
att.value = '<?=$DIFFICULTY["HELL"]?>';
|
|
att.value = '<?=$DIFFICULTY["HELL"]?>';
|
|
|
opt.setAttributeNode(att);
|
|
opt.setAttributeNode(att);
|
|
@@ -116,6 +341,11 @@
|
|
|
sel.appendChild(opt);
|
|
sel.appendChild(opt);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Shows the appropiate area selector when the area type is
|
|
|
|
|
+ * selected in the new team panel.
|
|
|
|
|
+ */
|
|
|
function selectNewAreaType(){
|
|
function selectNewAreaType(){
|
|
|
var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
|
|
var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
|
|
|
document.getElementById('new_area_scenario').style.display = 'none';
|
|
document.getElementById('new_area_scenario').style.display = 'none';
|
|
@@ -124,14 +354,10 @@
|
|
|
document.getElementById('new_area_cairos_dungeon').selectedIndex = 0;
|
|
document.getElementById('new_area_cairos_dungeon').selectedIndex = 0;
|
|
|
document.getElementById('new_area_rift_dungeon').style.display = 'none';
|
|
document.getElementById('new_area_rift_dungeon').style.display = 'none';
|
|
|
document.getElementById('new_area_rift_dungeon').selectedIndex = 0;
|
|
document.getElementById('new_area_rift_dungeon').selectedIndex = 0;
|
|
|
- //document.getElementById('new_area_arena').style.display = 'none';
|
|
|
|
|
document.getElementById('new_area_tartarus_labyrinth').style.display = 'none';
|
|
document.getElementById('new_area_tartarus_labyrinth').style.display = 'none';
|
|
|
document.getElementById('new_area_tartarus_labyrinth').selectedIndex = 0;
|
|
document.getElementById('new_area_tartarus_labyrinth').selectedIndex = 0;
|
|
|
- //document.getElementById('new_area_trial_of_ascension').style.display = 'none';
|
|
|
|
|
- //document.getElementById('new_area_world_boss').style.display = 'none';
|
|
|
|
|
document.getElementById('new_area_dimensional_hole').style.display = 'none';
|
|
document.getElementById('new_area_dimensional_hole').style.display = 'none';
|
|
|
document.getElementById('new_area_dimensional_hole').selectedIndex = 0;
|
|
document.getElementById('new_area_dimensional_hole').selectedIndex = 0;
|
|
|
- //document.getElementById('new_area_dimensional_rift').style.display = 'none';
|
|
|
|
|
document.getElementById('new_area_difficulty').style.display = 'none';
|
|
document.getElementById('new_area_difficulty').style.display = 'none';
|
|
|
document.getElementById('new_area_difficulty').selectedIndex = 0;
|
|
document.getElementById('new_area_difficulty').selectedIndex = 0;
|
|
|
document.getElementById('new_area_stage').style.display = 'none';
|
|
document.getElementById('new_area_stage').style.display = 'none';
|
|
@@ -139,58 +365,82 @@
|
|
|
switch (type){
|
|
switch (type){
|
|
|
case '<?=$AREA_TYPE["SCENARIO"]?>':
|
|
case '<?=$AREA_TYPE["SCENARIO"]?>':
|
|
|
document.getElementById('new_area_scenario').style.display = 'inline';
|
|
document.getElementById('new_area_scenario').style.display = 'inline';
|
|
|
|
|
+ max_units = 4;
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
|
|
case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
|
|
|
document.getElementById('new_area_cairos_dungeon').style.display = 'inline';
|
|
document.getElementById('new_area_cairos_dungeon').style.display = 'inline';
|
|
|
|
|
+ max_units = 5;
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
|
|
case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
|
|
|
document.getElementById('new_area_rift_dungeon').style.display = 'inline';
|
|
document.getElementById('new_area_rift_dungeon').style.display = 'inline';
|
|
|
|
|
+ max_units = 6;
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["RIFT_RAID"]?>':
|
|
case '<?=$AREA_TYPE["RIFT_RAID"]?>':
|
|
|
document.getElementById('new_area_rift_raid').style.display = 'inline';
|
|
document.getElementById('new_area_rift_raid').style.display = 'inline';
|
|
|
|
|
+ max_units = 6
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["ARENA"]?>':
|
|
case '<?=$AREA_TYPE["ARENA"]?>':
|
|
|
|
|
+ max_units = 4;
|
|
|
//document.getElementById('new_area_arena').style.display = 'inline';
|
|
//document.getElementById('new_area_arena').style.display = 'inline';
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["GUILD_WAR"]?>':
|
|
case '<?=$AREA_TYPE["GUILD_WAR"]?>':
|
|
|
|
|
+ max_units = 3;
|
|
|
document.getElementById('new_area_guild_war').style.display = 'inline';
|
|
document.getElementById('new_area_guild_war').style.display = 'inline';
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
|
|
case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
|
|
|
|
|
+ max_units = 3;
|
|
|
document.getElementById('new_area_guild_siege').style.display = 'inline';
|
|
document.getElementById('new_area_guild_siege').style.display = 'inline';
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
|
|
case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
|
|
|
|
|
+ max_units = 5;
|
|
|
document.getElementById('new_area_tartarus_labyrinth').style.display = 'inline';
|
|
document.getElementById('new_area_tartarus_labyrinth').style.display = 'inline';
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
|
|
case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
|
|
|
|
|
+ max_units = 5;
|
|
|
//document.getElementById('new_area_trial_of_ascension').style.display = 'inline';
|
|
//document.getElementById('new_area_trial_of_ascension').style.display = 'inline';
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
|
|
case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
|
|
|
|
|
+ //max_units = 5;
|
|
|
//document.getElementById('new_area_world_boss').style.display = 'inline';
|
|
//document.getElementById('new_area_world_boss').style.display = 'inline';
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
|
|
case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
|
|
|
|
|
+ max_units = 4;
|
|
|
document.getElementById('new_area_dimensional_hole').style.display = 'inline';
|
|
document.getElementById('new_area_dimensional_hole').style.display = 'inline';
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
|
|
case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
|
|
|
|
|
+ max_units = 5;
|
|
|
//document.getElementById('new_area_dimensional_rift').style.display = 'inline';
|
|
//document.getElementById('new_area_dimensional_rift').style.display = 'inline';
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (selected_units >= max_units || type == ''){
|
|
|
|
|
+ document.getElementById('new_unit').style.display = 'none';
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ document.getElementById('new_unit').style.display = 'block';
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Populates the difficulty and stage selectors when an area is
|
|
|
|
|
+ * selected in the new team panel.
|
|
|
|
|
+ */
|
|
|
function selectNewArea(){
|
|
function selectNewArea(){
|
|
|
var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
|
|
var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
|
|
|
document.getElementById('new_area_stage').selectedIndex = 0;
|
|
document.getElementById('new_area_stage').selectedIndex = 0;
|
|
|
document.getElementById('new_area_difficulty').selectedIndex = 0;
|
|
document.getElementById('new_area_difficulty').selectedIndex = 0;
|
|
|
|
|
+ document.getElementById('new_area_stage').style.display = 'none';
|
|
|
|
|
+ document.getElementById('new_area_difficulty').style.display = 'none';
|
|
|
switch (type){
|
|
switch (type){
|
|
|
case '<?=$AREA_TYPE["SCENARIO"]?>':
|
|
case '<?=$AREA_TYPE["SCENARIO"]?>':
|
|
|
document.getElementById('new_area_stage').style.display = 'inline';
|
|
document.getElementById('new_area_stage').style.display = 'inline';
|
|
|
document.getElementById('new_area_difficulty').style.display = 'inline';
|
|
document.getElementById('new_area_difficulty').style.display = 'inline';
|
|
|
populateStage(7);
|
|
populateStage(7);
|
|
|
- pupulateDifficulty();
|
|
|
|
|
|
|
+ populateDifficulty();
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
|
|
case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
|
|
|
document.getElementById('new_area_stage').style.display = 'inline';
|
|
document.getElementById('new_area_stage').style.display = 'inline';
|
|
|
- document.getElementById('new_area_difficulty').style.display = 'inline';
|
|
|
|
|
populateStage(10);
|
|
populateStage(10);
|
|
|
- pupulateDifficulty();
|
|
|
|
|
|
|
+ populateDifficulty();
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
|
|
case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
|
|
|
break;
|
|
break;
|
|
@@ -206,11 +456,11 @@
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
|
|
case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
|
|
|
document.getElementById('new_area_difficulty').style.display = 'inline';
|
|
document.getElementById('new_area_difficulty').style.display = 'inline';
|
|
|
- pupulateDifficulty(true, false);
|
|
|
|
|
|
|
+ populateDifficulty(true, false);
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
|
|
case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
|
|
|
document.getElementById('new_area_difficulty').style.display = 'inline';
|
|
document.getElementById('new_area_difficulty').style.display = 'inline';
|
|
|
- pupulateDifficulty(false, true);
|
|
|
|
|
|
|
+ populateDifficulty(false, true);
|
|
|
break;
|
|
break;
|
|
|
case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
|
|
case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
|
|
|
break;
|
|
break;
|
|
@@ -242,12 +492,24 @@
|
|
|
Teams
|
|
Teams
|
|
|
</h2>
|
|
</h2>
|
|
|
<article>
|
|
<article>
|
|
|
- <table>
|
|
|
|
|
|
|
+ <table id='teams'>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>
|
|
|
|
|
+ Team
|
|
|
|
|
+ </th>
|
|
|
|
|
+ <th>
|
|
|
|
|
+ Description
|
|
|
|
|
+ </th>
|
|
|
|
|
+ <th>
|
|
|
|
|
+ Units
|
|
|
|
|
+ </th>
|
|
|
|
|
+ </tr>
|
|
|
<?php
|
|
<?php
|
|
|
|
|
+ $odd = "odd";
|
|
|
foreach ($page->teams as $team){
|
|
foreach ($page->teams as $team){
|
|
|
?>
|
|
?>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td class='team <?=$odd?>'>
|
|
|
<h4>
|
|
<h4>
|
|
|
<?=$team->name?>
|
|
<?=$team->name?>
|
|
|
</h4>
|
|
</h4>
|
|
@@ -261,12 +523,12 @@
|
|
|
<?=$area?>
|
|
<?=$area?>
|
|
|
</h5>
|
|
</h5>
|
|
|
</td>
|
|
</td>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td class='description <?=$odd?>'>
|
|
|
<?=$team->description?>
|
|
<?=$team->description?>
|
|
|
</td>
|
|
</td>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td class='units <?=$odd?>'>
|
|
|
<?php
|
|
<?php
|
|
|
- foreach ($team->units as $unit){
|
|
|
|
|
|
|
+ foreach ($team->unit as $unit){
|
|
|
?>
|
|
?>
|
|
|
<a href='/<?=$UID?>/monsters/<?=$unit->id?>'>
|
|
<a href='/<?=$UID?>/monsters/<?=$unit->id?>'>
|
|
|
<div class='monster_panel'>
|
|
<div class='monster_panel'>
|
|
@@ -279,9 +541,16 @@
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<?php
|
|
<?php
|
|
|
|
|
+ if ($odd == ""){
|
|
|
|
|
+ $odd = "odd";
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ $odd = "";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
?>
|
|
?>
|
|
|
</table>
|
|
</table>
|
|
|
|
|
+ <input type='button' onClick='showNewTeam(true);' value='New Team'/>
|
|
|
</article>
|
|
</article>
|
|
|
</section> <!-- .list -->
|
|
</section> <!-- .list -->
|
|
|
|
|
|
|
@@ -295,10 +564,10 @@
|
|
|
<article>
|
|
<article>
|
|
|
<table>
|
|
<table>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td class='new_title'>
|
|
|
Area
|
|
Area
|
|
|
</td>
|
|
</td>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td class='new_values'>
|
|
|
<select id='new_area_type' name='new_area_type' onChange='selectNewAreaType();'>
|
|
<select id='new_area_type' name='new_area_type' onChange='selectNewAreaType();'>
|
|
|
<option value=''> </option>
|
|
<option value=''> </option>
|
|
|
<option value='<?=$AREA_TYPE["SCENARIO"]?>'>Scenario</option>
|
|
<option value='<?=$AREA_TYPE["SCENARIO"]?>'>Scenario</option>
|
|
@@ -311,7 +580,7 @@
|
|
|
<option value='<?=$AREA_TYPE["GUILD_SIEGE"]?>'>Guild Siege</option>
|
|
<option value='<?=$AREA_TYPE["GUILD_SIEGE"]?>'>Guild Siege</option>
|
|
|
<option value='<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>'>Tartarus Labyrinth</option>
|
|
<option value='<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>'>Tartarus Labyrinth</option>
|
|
|
<option value='<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>'>Trial of Ascension</option>
|
|
<option value='<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>'>Trial of Ascension</option>
|
|
|
- <option value='<?=$AREA_TYPE["WORLD_BOSS"]?>'>World Boss</option>
|
|
|
|
|
|
|
+ <!--<option value='<?=$AREA_TYPE["WORLD_BOSS"]?>'>World Boss</option>-->
|
|
|
<option value='<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>'>Dimensinal Rift</option>
|
|
<option value='<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>'>Dimensinal Rift</option>
|
|
|
</select>
|
|
</select>
|
|
|
<select id='new_area_scenario' class='new_area' onChange='selectNewArea();'>
|
|
<select id='new_area_scenario' class='new_area' onChange='selectNewArea();'>
|
|
@@ -381,43 +650,37 @@
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td class='new_title'>
|
|
|
Name
|
|
Name
|
|
|
</td>
|
|
</td>
|
|
|
- <td>
|
|
|
|
|
- <input type='text' id='name' name='name'/>
|
|
|
|
|
|
|
+ <td class='new_values'>
|
|
|
|
|
+ <input type='text' id='new_team_name' name='name'/>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <td>
|
|
|
|
|
|
|
+ <td class='new_title'>
|
|
|
Description
|
|
Description
|
|
|
</td>
|
|
</td>
|
|
|
- <td>
|
|
|
|
|
- <textarea name='description'></textarea>
|
|
|
|
|
|
|
+ <td class='new_values'>
|
|
|
|
|
+ <textarea id='new_team_description' name='description'></textarea>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td class='new_title'>
|
|
|
|
|
+ Units:
|
|
|
|
|
+ <div class='new_unit' id='new_unit'>
|
|
|
|
|
+ <input id='new_unit_id' onInput='searchUnit();'/>
|
|
|
|
|
+ <div id='new_unit_autocomplete' class='new_unit_autocomplete'>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class='new_values'>
|
|
|
|
|
+ <div id='new_team_units'>
|
|
|
|
|
+ </div>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
<tr>
|
|
<tr>
|
|
|
<td colspan='2'>
|
|
<td colspan='2'>
|
|
|
-<?php
|
|
|
|
|
- for ($i = 0; $i < 6; $i ++){
|
|
|
|
|
-?>
|
|
|
|
|
- <div class='new_unit' id='new_unit_<?=$i?>'>
|
|
|
|
|
- <div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <input id='new_unit_<?=$i?>_id' list='new_unit_<?=$i?>_list'/>
|
|
|
|
|
- <datalist id='new_unit_<?=$i?>_list'>
|
|
|
|
|
-<?php
|
|
|
|
|
- foreach ($page->units as $unit){
|
|
|
|
|
-?>
|
|
|
|
|
-
|
|
|
|
|
-<?php
|
|
|
|
|
- }
|
|
|
|
|
-?>
|
|
|
|
|
- </datalist>
|
|
|
|
|
- </div>
|
|
|
|
|
-<?php
|
|
|
|
|
- }
|
|
|
|
|
-?>
|
|
|
|
|
|
|
+ <input type='button' value='Save' onClick='saveTeam();'/>
|
|
|
</td>
|
|
</td>
|
|
|
</tr>
|
|
</tr>
|
|
|
</article>
|
|
</article>
|