Forráskód Böngészése

Item editor, while missing interface for a large portion of item data now has save functionality. - Also cleaned up item picker & implemented additional params for item edit input build function to support table, field, table key identification & value requisite to perform the query independently from logic.

xonos 4 éve
szülő
commit
7136331475

+ 7 - 2
css/eq2emu.css

@@ -28,7 +28,8 @@
 
 /* Icon Picker Elements */
 .ico-picker-list {
-	
+	max-height:400px;
+	overflow-y:auto;
 }
 
 .ico-picker-cat-ctn {
@@ -86,6 +87,11 @@
 	border-color: rgb(96, 153, 81);
 	background-color: rgb(222, 255, 209);
 }
+.item-edit-changed-label-switch {
+	transition:all ease 700ms;
+	font-weight:bold;
+	color:rgb(96, 153, 81);
+}
 
 .ico-picker-i:hover {
 	transition:all ease 600ms;
@@ -270,4 +276,3 @@
 .flex-box {
 	display:inline-block;
 }
-

+ 90 - 26
inc/data.func.php

@@ -12,7 +12,11 @@
 		echo json_encode(quick_item_search($_POST['quick-item-search']));
 	}
 
-
+	// Get item data with quick search.
+	if(isset($_POST['edit-item'])) {
+		echo json_encode(edit_item($_POST['data']));
+	}
+	
 	// Get item to be edited.
 	if(isset($_POST['get-edit-item'])) {
 		$item = get_item_data($_POST['get-edit-item']);
@@ -37,12 +41,45 @@
 	
 	// Get item icons by selected category.
 	if(isset($_POST['get-item-icons'])) {
-		require('inc/json.item.icons.php');
+		require('inc/data.item.icons.php');
 		echo get_icon_picker($itemIcons, 'icons', $_POST['get-item-icons'], (isset($_POST['page']) ? $_POST['page']:1));
 	}
 	
 	/* GET FUNCTIONS */
 	
+	/* Edit Item Function */
+	function edit_item($data, $return = ['status'=>true, 'msg'=>'', 'rows'=>0]) {
+		global $world;
+		
+		foreach($data as $table => $o) {
+			$query = '
+			UPDATE `'.addslashes($table).'`
+			SET';
+			$pass = 0;
+			foreach($o['fields'] as $field => $value) {
+				$query .= ($pass > 0 ? ',':NULL).'
+				`'.addslashes($field).'` = "'.addslashes($value).'"';
+				$pass++;
+			}
+			$query .= '
+			WHERE `'.addslashes($o['key']).'` = '.addslashes($o['id']);
+			$return['query'] = $query;
+			try {
+				$stmt = $world->prepare($query);
+				$stmt->execute();
+				$return['rows'] = $stmt->rowCount();
+				$return['status'] = true;
+			} catch(PDOException $e) {
+				$return['status'] = false;
+				$return['msg'] = $e->getMessage();
+			}
+		}
+		return $return;
+	}
+	
+	
+	
+	
 	function get_icon_picker($icons, $type = 'icons', $category = 'Adornment', $page = 1, $limit = 133,  $return = NULL) {
 		$pass = 0;
 		if($type == 'categories') {
@@ -76,7 +113,7 @@
 			$pass = 0;
 			foreach($ico as $k => $i) {
 				if(($pass >= $from) && ($pass+1 <= $to)) {
-					$return .= '<div class="ico-picker-i ico-unloaded" data-icon-id="'.$i.'"><span class="ico-picker-loader"><i class="fad fa-circle-notch fa-spin fast-spin"></i></div>';
+					$return .= '<div class="ico-picker-i ico-unloaded" data-icon-id="'.$i.'"><span class="ico-picker-loader"><i class="fal fa-circle-notch color-info-400 fa-spin fast-spin opacity-50"></i></div>';
 				}
 				$pass++;
 			}
@@ -87,8 +124,9 @@
 	
 	//Generates pagination for icons.
 	function ico_pagination($category, $p, $limit, $count, $return = NULL) {
-		$return .= '<button class="btn btn-xs btn-default '.($p == 1 ? 'hidden':NULL).'" data-category="'.$category.'"><i class="fad fa-arrow-from-right"></i></button>';
+		$return .= '<button class="btn btn-xs btn-default '.($p == 1 ? 'hidden':NULL).'" data-category="'.$category.'"><strong class="color-info-400">1</strong> <i class="fad fa-arrow-from-right"></i></button>';
 		$page_count = ceil($count/$limit);
+		$showEndButton = false;
 		if($page_count > 1) {
 			if(($p-5) > 1) {
 				$return .= '<span class="ico-picker-ellipsis"><i class="fas fa-ellipsis-h-alt"></i></span>';
@@ -96,24 +134,27 @@
 			for ($k = 1 ; $k <= $page_count; $k++){
 				if(($k >= ($p-5)) && ($k <= ($p+5))) {
 					$return .= '
-					<button class="btn btn-xs ico-picker-page '.($p == $k ? 'btn-success':'btn-default').'" '.($p == $k ? 'disabled="disabled"':NULL).' data-page="'.$k.'" data-category="'.$category.'">
+					<button class="btn btn-xs ico-picker-page '.($p == $k ? 'btn-success animated jello':'btn-default').'" '.($p == $k ? 'disabled="disabled"':NULL).' data-page="'.$k.'" data-category="'.$category.'">
 					'.$k.'
 					</button>';
 				}
 			}
 			if(($p+5) < $page_count) {
 				$return .= '<span class="ico-picker-ellipsis"><i class="fas fa-ellipsis-h-alt"></i></span>';
-			}
+				$showEndButton = true;
+			} else { $showEndButton = false; }
 		} else {
 			$return .= '
 			<button class="btn btn-xs ico-picker-page btn-success" data-page="'.$p.'" data-category="'.$category.'" disabled="disabled">
 			'.$p.'
 			</button>';
 		}
-		$return .= '
-		<button class="btn btn-xs btn-default  ico-picker-page" data-category="'.$category.'" '.($p == $page_count ? 'disabled="disabled"':NULL).'>
-			<i class="fad fa-arrow-from-left"></i>
-		</button>';
+		if($showEndButton && $p != $page_count) {
+			$return .= '
+			<button class="btn btn-xs btn-default  ico-picker-page" data-page="'.$page_count.'" data-category="'.$category.'">
+				<i class="fad fa-arrow-from-left"></i> <strong class="color-info-400">'.$page_count.'</strong>
+			</button>';
+		}
 		return $return;
 	}
 	
@@ -121,6 +162,7 @@
 	//Global function to build editable inputs. (WIP)
 	function build_edit_input($e, $return = NULL) {
 		if(!isset($e['type'])) { $e['type'] = 'text'; }
+		if(!isset($e['table'])) { $table = 'data-table=""'; } else { $table = 'data-table="'.$e['table'].'"'; }
 		if(!isset($e['field_type'])) {
 			$return = '
 			<div class="form-group mb-2">
@@ -129,8 +171,8 @@
 					<div class="input-group-prepend">
 						<span class="input-group-text strong">'.($e['icon'] ? '<i class="'.$e['icon'].'"></i>':NULL).'&nbsp;'.$e['title'].'</span>
 					</div>
-					<input type="'.$e['type'].'" class="form-control '.$e['class'].'" data-field="'.$e['field'].'" value="'.$e['value'].'" placeholder="'.($e['placeholder'] ? $e['placeholder']:NULL).'" aria-label="'.($e['aria'] ? $e['aria']:NULL).'" aria-describedby="'.$e['field'].'"/>
-				</div>
+					<input type="'.$e['type'].'" class="form-control '.$e['class'].'" '.$table.' data-key="'.$e['key'].'" data-id="'.$e['id'].'" data-field="'.$e['field'].'" value="'.$e['value'].'" placeholder="'.($e['placeholder'] ? $e['placeholder']:NULL).'" aria-label="'.($e['aria'] ? $e['aria']:NULL).'" aria-describedby="'.$e['field'].'"/>
+				</div>'.($e['desc'] ? '<span class="help-block">'.$e['desc'].'</span>':NULL).'
 			</div>';
 		} else {
 			if($e['field_type'] == 'textarea') {
@@ -141,11 +183,10 @@
 						<div class="input-group-prepend">
 							<span class="input-group-text strong">'.($e['icon'] ? '<i class="'.$e['icon'].'"></i>':NULL).'&nbsp;'.$e['title'].'</span>
 						</div>
-						<textarea class="form-control '.$e['class'].'" data-field="'.$e['field'].'" placeholder="'.($e['placeholder'] ? $e['placeholder']:NULL).'" aria-label="'.($e['aria'] ? $e['aria']:NULL).'" aria-describedby="'.$e['field'].'">'
+						<textarea class="form-control '.$e['class'].'" '.$table.' data-key="'.$e['key'].'" data-id="'.$e['id'].'" data-field="'.$e['field'].'" placeholder="'.($e['placeholder'] ? $e['placeholder']:NULL).'" aria-label="'.($e['aria'] ? $e['aria']:NULL).'" aria-describedby="'.$e['field'].'">'
 						.$e['value'].
 						'</textarea>
-					</div>
-					<span class="help-block">'.($e['desc'] ? $e['desc']:NULL).'</span>
+					</div>'.($e['desc'] ? '<span class="help-block">'.$e['desc'].'</span>':NULL).'
 				</div>';
 			} else if($e['field_type'] == 'select') {
 				$return = '
@@ -155,16 +196,15 @@
 							<div class="input-group-prepend">
 								<span class="input-group-text strong">'.($e['icon'] ? '<i class="'.$e['icon'].'"></i>':NULL).'&nbsp;'.$e['title'].'</span>
 							</div>
-							<select class="custom-select form-control'.$e['class'].'" data-field="'.$e['field'].'">
-								<option selected="selected" value="'.$e['value'].'">'.$e['value'].'</option>
+							<select class="custom-select form-control '.$e['class'].'" '.$table.' data-key="'.$e['key'].'" data-id="'.$e['id'].'" data-field="'.$e['field'].'">
 								'.(array_to_options($e['options'], $e['value'])).'
 							</select>
-						<span class="help-block">'.($e['desc'] ? $e['desc']:NULL).'</span>
+						</div>'.($e['desc'] ? '<span class="help-block">'.$e['desc'].'</span>':NULL).'
 					</div>';
 			} else if($e['field_type'] == 'switch') {
 				$return = '
 				<div class="custom-control custom-switch">
-					<input type="checkbox" class="custom-control-input  '.$e['class'].'" '.($e['value'] == 1 ? 'checked="checked"':NULL).' id="ies_'.$e['field'].'" name="ie_'.$e['field'].'_'.$e['id'].'" data-field="'.$e['field'].'">
+					<input type="checkbox" class="custom-control-input  '.$e['class'].'" '.($e['value'] == 1 ? 'checked="checked"':NULL).' id="ies_'.$e['field'].'" name="ie_'.$e['field'].'_'.$e['id'].'" '.$table.' data-key="'.$e['key'].'" data-id="'.$e['id'].'" data-field="'.$e['field'].'">
 					<label class="custom-control-label '.($e['show-label'] ? NULL:'hidden').'" for="ies_'.$e['field'].'">'.(strlen($e['icon']) > 0 ? '<i class="'.$e['icon'].'"></i> ':NULL).$e['title'].'</label>
 				</div>'.($e['desc'] ? '<span class="help-block">'.$e['desc'].'</span>':NULL); 
 			}
@@ -182,9 +222,14 @@
 	//Convert array to select option values with option to exclude a pre-selected value.
 	function array_to_options($a, $preselected = NULL, $return = NULL) {
 		foreach($a as $k => $v) {
-			if($preselected != $v) {
+			if(isset($v['id'])) {
+				//Template Array: ['id'=>$row['id'], 'short'=>$row['short_name'], 'name'=>$row['name'], 'desc'=>$row['description']];
 				$return .= '
-				<option value="'.$v.'">'.$v.'</option>';
+				<option value="'.$v['id'].'" data-desc="'.$v['desc'].'" '.($preselected == $v['id'] ? 'selected="selected"':NULL).'>'.$v['name'].' ('.$v['id'].')</option>';
+				
+			} else { //For 2d arrays
+				$return .= '
+				<option value="'.$v.'" '.($preselected == $v ? 'selected="selected"':NULL).'>'.$v.'</option>';
 			}
 		}
 		return $return;
@@ -192,17 +237,36 @@
 	
 	
 	// Builds list of item skills in option format
-	function get_skills($skill_ids = [], $return = NULL) {
+	function get_skills($skill_ids = [], $get_array = false, $return = NULL) {
 		global $world;
 		$query = '
 		SELECT
-			s.*
+			s.`id`,
+			s.`short_name`,
+			s.`name`,
+			s.`description`,
+			s.`skill_type`,
+			s.`display`
 		FROM skills AS s
-		WHERE s.`id` IN(1743366740,1756482397,3587918036,3539032716,1386343008,1039865549,4032608519,3330500131,2072844078,1408356869,2650425026,2639209773)';
+		'.(count($skill_ids) > 0 ? 'WHERE s.`id` IN('.implode(', ',$skill_ids).')':NULL).'
+		ORDER BY s.`skill_type`, s.`name`';
 		//The listed ID's appeared in no original items that were listed as skill requirements.
+		$stmt = $world->prepare($query);
+		$stmt->execute();
 		
-		
-		
+		if($get_array) {
+			$return = [['id'=>0, 'short'=>'none', 'name'=>'None', 'desc'=>NULL]];
+		} else {
+			$return .= '<option value="0" data-shortname="none" data-desc="">None</option>';
+		}
+		while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
+			if($get_array) {
+				$return[] = ['id'=>$row['id'], 'short'=>$row['short_name'], 'name'=>$row['name'], 'desc'=>$row['description']];
+			} else {
+				$return .= '<option value="'.$row['id'].'" data-shortname="'.$row['short_name'].'" data-desc="'.$row['description'].'">'.$row['name'].'('.$row['id'].')</option>';
+			}
+		}
+		return $return;
 	}
 	
 	// Builds item edit form inputs & form. - Deprecated! Only for debugging.

+ 0 - 0
inc/json.item.icons.php → inc/data.item.icons.php


+ 11 - 0
inc/data.item.skills.php

@@ -0,0 +1,11 @@
+<?php
+	/* This file contains item skill id lists used in the item editor. See: Field assembly for skill_id_req & skill_id_req2 in form.edit.item.php */
+	$_itemSkills = [
+		'req' => [
+			931275816,3145299162,3282420779,1400160844,2711101135,2476073427,296246391,1519965519,1223501307,1433335062,1743366740,4037812502,2042842194,887279616,90523872,2741805322,340921594,2662430630,287643040,3820670534,3809066846,3467160477,2954459351,2380184628,2292577688,2898101972,241174330,2463145248,1829443087,2608320658,2120065377,2246237129,1311635100,1624274802,1040683335,193411854,3067436248,3694382619,2950599749,1209716810,641561514,1921433074,2581053277,3173504370,2894715199,1514256692,2533124061,1616998748,3167106577,2663054519,1696217328,545043066,1124719197,3343700951,3341842907,1038997614,570458645,3191839982,3421494576,3177806075,2638198038,3048574950,418532101,2897193374,3539032716,1386343008,2591116872,1478114179,3881305672,3076004370,1039865549,3108933728,4032608519,2082133324,3330500131,2557647574,773137566,2072844078,3856706740,1408356869,2011726342,1653482350,554333641,770311065,3180399725,2650425026,2817699641,574366497,2949308177,2639209773,935416212,2812765109,1151456682,2710531826,2463992638,1703539708,3395302654,2530063117,1677747280
+		],
+		'req2' => [
+			931275816,2711101135,1223501307,1743366740,4037812502,887279616,3820670534,241174330,2463145248,2608320658,2246237129,3067436248,3694382619,1209716810,1921433074,3173504370,545043066,1038997614,570458645,3191839982,723762198,3421494576,2638198038,3048574950,1756482397,418532101,613995491,366253016,3587918036,882983852,2897193374,3539032716,1386343008,2591116872,1478114179,3881305672,3076004370,1039865549,3108933728,4032608519,2082133324,3330500131,2557647574,773137566,2072844078,3856706740,1408356869,2011726342,2817699641,574366497,2949308177,2639209773,935416212,2812765109,1151456682,2710531826,2463992638,1703539708,3395302654,2530063117,1677747280
+		]
+	];
+?>

+ 194 - 83
inc/forms/form.edit.item.php

@@ -1,6 +1,7 @@
 <?php
 	$ic = 'item-edit-input'; //input class.
-	require('inc/json.item.icons.php');
+	require('inc/data.item.icons.php'); //icon data constants
+	require('inc/data.item.skills.php'); //item skill requirement constants
 	$exclude_debug_fieldlist = [
 		'icon','id','name','item_type','description',
 		'lore' ,'lore_equip' ,'stacklore' ,'temporary' ,
@@ -8,58 +9,61 @@
 		'crafted','attuneable','heirloom','nozone','norepair',
 		'good_only','evil_only','novalue','ornate','etheral',
 		'appearance_only','reforged','refined','usable',
-		'collectable','tier','count','weight','slots'
-
+		'collectable','tier','count','weight','slots',
+		'skill_id_req2','display_charges','harvest','unlocked',
+		'max_charges','skill_min','flags_16384','flags_32768',
+		'flags2_256', 'set_name','soe_item_id','soe_item_crc',
+		'recommended_level','adventure_default_level','stack_count',
+		'sell_price', 'sell_status_amount','adornment_slot1',
+		'adornment_slot2','adornment_slot3','adornment_slot4',
+		'adornment_slot5','adornment_slot6','offers_quest_id',
+		'soe_autoquest_id','part_of_quest_id','lua_script',
+		'quest_unknown','adornment_description','skill_id_req',
+		'tradeskill_default_level','adventure_classes',
+		'tradeskill_classes'
 	];
 	
 ?>
-<div class="row">
-	<!-- Item Editor Controls -->
-	<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12 mb-2 text-right">
-		<button class="btn btn-md btn-default mr-2 item-save">
-			<i class="fas fa-save text-success"></i> Save Changes <small>(CTRL+S)</small>
-		</button>
-		<button class="btn btn-md btn-warning mr-2 item-dupe">
-			<i class="fad fa-copy"></i> Duplicate Item <small>(CTRL+D)</small>
-		</button>
-		<button class="btn btn-md btn-default item-del">
-			<i class="fad fa-trash-alt text-danger"></i> Delete Item <small>(DEL)</small>
-		</button>
-	</div>
-	<!-- Item Editor Controls -->
-	
-	<!-- Item Icon Edit -->
-	<div class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-2 text-center">
-		<div class="edit-item-ico-ctn">
-			<img class="edit-item-ico vm" src="img/eq2/items/<?php echo $item['icon']; ?>.png"/>
-			<br/>
-			<small><strong>Icon ID</strong>: <?php echo $item['icon']; ?></small>
-		</div>
-		<button class="btn btn-xs btn-default ico-picker-btn">Icon Picker</button>
-	</div>
-	<!-- Item Icon Edit -->
-	
-	<!-- Item Basic Details -->
-	<div class="col-xs-8 col-sm-9 col-md-9 col-lg-9 col-xl-10">
-		<div class="row">
-			<div class="col-sm-12 col-xl-12">
-				<?php echo build_edit_input(['field'=>'name','value'=>$item['name'],'id'=>$item['id'],'title'=>'Name','icon'=>'fad fa-tag','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter item name ...']); ?>
-			</div>
-			<div class="col-sm-6 col-xl-6">
-				<?php echo build_edit_input(['field'=>'icon','value'=>$item['icon'],'id'=>$item['id'],'title'=>'Icon ID','icon'=>'fad fa-images','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter icon id ...', 'type'=>'number']); ?>
+<div class="col-xl-12">
+	<div class="row">
+		<!-- Item Icon Edit -->
+		<div class="col-xs-4 col-sm-3 col-md-3 col-lg-3 col-xl-2 text-center">
+			<div class="edit-item-ico-ctn">
+				<img class="edit-item-ico vm" src="img/eq2/items/<?php echo $item['icon']; ?>.png"/>
+				<br/>
+				<small><strong>Icon ID</strong>: <?php echo $item['icon']; ?></small>
 			</div>
-			<div class="col-sm-6 col-xl-6">
-				<?php echo build_edit_input(['field'=>'item_type','value'=>$item['item_type'],'id'=>$item['id'],'title'=>'Item Type','icon'=>'fad fa-disease','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'select', 'options'=>$itemCategories]); ?>
+			<button class="btn btn-xs btn-default btn-block ico-picker-btn">
+				<i class="fad fa-eye-dropper color-info-500"></i> Icon Picker
+			</button>
+		</div>
+		<!-- End: Item Icon Edit -->
+		
+		<!-- Item Basic Details -->
+		<div class="col-xs-8 col-sm-9 col-md-9 col-lg-9 col-xl-10">
+			<div class="row">
+				<div class="col-sm-12 col-xl-7">
+					<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'name','value'=>$item['name'],'id'=>$item['id'],'title'=>'Name','icon'=>'fad fa-tag','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter item name ...']); ?>
+				</div>
+				<div class="col-sm-12 col-xl-5">
+					<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'set_name','value'=>$item['set_name'],'id'=>$item['id'],'title'=>'Set Name','icon'=>'fad fa-tags','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter a set name...']); ?>
+				</div>
+				<div class="col-sm-6 col-xl-6">
+					<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'icon','value'=>$item['icon'],'id'=>$item['id'],'title'=>'Icon ID','icon'=>'fad fa-images','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter icon id ...', 'type'=>'number']); ?>
+				</div>
+				<div class="col-sm-6 col-xl-6">
+					<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'item_type','value'=>$item['item_type'],'id'=>$item['id'],'title'=>'Item Type','icon'=>'fad fa-disease','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'select', 'options'=>$itemCategories]); ?>
+				</div>
 			</div>
 		</div>
+		<!-- End: Item Basic Details -->
 	</div>
-	<!-- Item Basic Details -->
 </div>
 <!-- Description Row -->
 <div class="col-xl-12">
-	<?php echo build_edit_input(['field'=>'description','value'=>$item['description'],'id'=>$item['id'],'title'=>'Description','icon'=>'fad fa-file-signature','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter an item description ...', 'field_type'=>'textarea']); ?>
+	<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'description','value'=>$item['description'],'id'=>$item['id'],'title'=>'Description','icon'=>'fad fa-file-signature','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter an item description ...', 'field_type'=>'textarea']); ?>
 </div>
-<!-- Description Row -->
+<!-- End: Description Row -->
 
 
 
@@ -67,55 +71,110 @@
 	<div class="row">
 		<!-- Stats & Reqs Panel -->
 		<div class="col-xs-7 col-sm-7 col-md-7 col-lg-7 col-xl-7">
-			<!-- Requirements -->
-			<div id="itemeditor-props" class="panel">
-				<div class="panel-hdr text-primary">
-					<h2>
-						<span class="icon-stack fs-xxl mr-2">
-							<i class="base base-7 icon-stack-2x opacity-100 color-info-500"></i>
-							<i class="fas fa-vial icon-stack-1x opacity-100 color-white"></i>
-						</span>
-						Requirements
-					</h2>
-				</div>
+			<!-- Requisites -->
+			<div id="itemeditor-reqs" class="panel">
+				<div class="panel-hdr">
+					<h4 class="mb-0 color-secondary"><i class="fas fa-badge-check color-warning-900"></i>&nbsp;Requisites</h4>
+				</div> 
 				<div class="panel-container show" style="">
 					<div class="panel-content">
 						<div class="row">
-							Use get_skills function to populate skill requirements.
+							<div class="col-xs-12 col-sm-12 col-md-12 col-lg-8 col-xl-8">
+								<?php
+									$_skillsReq = get_skills($_itemSkills['req'],true);
+									echo build_edit_input(['key'=>'id','table'=>'items','field'=>'skill_id_req','value'=>$item['skill_id_req'],'id'=>$item['id'],'title'=>'Skill Req.','icon'=>'fas fa-shield-cross color-success-700','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Primary skill requirement.','placeholder'=>NULL, 'field_type'=>'select', 'options'=>$_skillsReq]);
+									$_skillsReq = NULL; // Clear memory usage.
+								?>
+							</div>
+							<div class="col-xs-12 col-sm-12 col-md-12 col-lg-4 col-xl-4">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'skill_min','value'=>$item['skill_min'],'id'=>$item['id'],'title'=>'Min. Skill','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'The minimum skill required.','placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
+								<?php
+									$_skillsReq2 = get_skills($_itemSkills['req2'],true);
+									echo build_edit_input(['key'=>'id','table'=>'items','field'=>'skill_id_req2','value'=>$item['skill_id_req2'],'id'=>$item['id'],'title'=>'Skill Req.','icon'=>'fas fa-bow-arrow color-info-700','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Secondary skill requirement for this item.','placeholder'=>NULL, 'field_type'=>'select', 'options'=>$_skillsReq2]);
+									$_skillsReq2 = NULL; // Clear memory usage.
+								?>
+							</div>
+							
+							<div class="col-xl-12"><h1><hr></hr></h1></div>
+
+							<div class="col-xs-12 col-sm-12 col-md-7 col-lg-7 col-xl-6">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adventure_default_level','value'=>$item['adventure_default_level'],'id'=>$item['id'],'title'=>'Adventure Level','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Default Adventure Level.','placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xs-12 col-sm-12 col-md-5 col-lg-5 col-xl-6">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'recommended_level','value'=>$item['recommended_level'],'id'=>$item['id'],'title'=>'Rec. Level','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Recommended player level.','placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xs-12 col-sm-12 col-md-5 col-lg-5 col-xl-6">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'tradeskill_default_level','value'=>$item['tradeskill_default_level'],'id'=>$item['id'],'title'=>'Tradeskill Level','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Default Tradeskill Level','placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							
+							
+							
 						</div>
 					</div>
 				</div>
 			</div>
+			<!-- End: Requisites -->
 		
 			<!-- Stats -->
 			<div id="itemeditor-props" class="panel">
-				<div class="panel-hdr text-primary">
-					<h2>
-						<span class="icon-stack fs-xxl mr-2">
-							<i class="base base-7 icon-stack-2x opacity-100 color-info-500"></i>
-							<i class="fas fa-vial icon-stack-1x opacity-100 color-white"></i>
-						</span>
-						Stats
-					</h2>
+				<div class="panel-hdr">
+					<h4 class="mb-0 color-secondary"><i class="fas fa-book-spells color-primary-500"></i>&nbsp;Stats</h4>
 				</div>
 				<div class="panel-container show" style="">
 					<div class="panel-content">
 						<div class="row">
-							<div class="col-xl-12"><h1><small>Add item stats here</small><hr></hr></h1></div>
+							<p>Item Stats</p>
+							<div class="col-xl-12"><h1><hr></hr></h1></div>
+							
+							<div class="col-xl-5">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'sell_price','value'=>$item['sell_price'],'id'=>$item['id'],'title'=>'Sell Price','icon'=>'fas fa-toilet-paper color-success-700','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Merchant sell price.','placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							
+							<div class="col-xl-7">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'sell_status_amount','value'=>$item['sell_status_amount'],'id'=>$item['id'],'title'=>'Sell Status Amt.','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>'Sell status amount. Whatever that means...','placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							
+							<div class="col-xl-12"><h1><hr></hr></h1></div>
 							<div class="col-xl-6">
-								<?php echo build_edit_input(['field'=>'tier','value'=>$item['tier'],'id'=>$item['id'],'title'=>'Tier','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Count - whatever that means...','type'=>'number']); ?>
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'tier','value'=>$item['tier'],'id'=>$item['id'],'title'=>'Tier','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'0','type'=>'number']); ?>
 							</div>
 							<div class="col-xl-6">
-								<?php echo build_edit_input(['field'=>'count','value'=>$item['count'],'id'=>$item['id'],'title'=>'Count','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Count - whatever that means...','type'=>'number']); ?>
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'count','value'=>$item['count'],'id'=>$item['id'],'title'=>'Count','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Count - whatever that means...','type'=>'number']); ?>
 							</div>
 							<div class="col-xl-6">
-								<?php echo build_edit_input(['field'=>'weight','value'=>$item['weight'],'id'=>$item['id'],'title'=>'Weight','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Count - whatever that means...','type'=>'number']); ?>
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'weight','value'=>$item['weight'],'id'=>$item['id'],'title'=>'Weight','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'0','type'=>'number']); ?>
 							</div>
 							<div class="col-xl-6">
-								<?php echo build_edit_input(['field'=>'stack_count','value'=>$item['stack_count'],'id'=>$item['id'],'title'=>'Stack Count','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Stack count (int)','type'=>'number']); ?>
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'stack_count','value'=>$item['stack_count'],'id'=>$item['id'],'title'=>'Stack Count','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Stack count (int)','type'=>'number']); ?>
 							</div>
 							<div class="col-xl-6">
-								<?php echo build_edit_input(['field'=>'slots','value'=>$item['slots'],'id'=>$item['id'],'title'=>'Slots','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Slots (int)','type'=>'number']); ?>
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'slots','value'=>$item['slots'],'id'=>$item['id'],'title'=>'Slots','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Slots (int)','type'=>'number']); ?>
+							</div>
+
+							<div class="col-xl-12"><h4 class="mb-0">Adornment Slots<hr class="mb-2 mt-1"></hr></h4></div>
+							
+							<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot1','value'=>$item['adornment_slot1'],'id'=>$item['id'],'title'=>'Slot 1','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot2','value'=>$item['adornment_slot2'],'id'=>$item['id'],'title'=>'Slot 2','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot3','value'=>$item['adornment_slot3'],'id'=>$item['id'],'title'=>'Slot 3','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot4','value'=>$item['adornment_slot4'],'id'=>$item['id'],'title'=>'Slot 4','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot5','value'=>$item['adornment_slot5'],'id'=>$item['id'],'title'=>'Slot 5','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xs-12 col-sm-6 col-md-6 col-lg-4 col-xl-4">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_slot6','value'=>$item['adornment_slot6'],'id'=>$item['id'],'title'=>'Slot 6','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>NULL,'placeholder'=>'0','type'=>'number']); ?>
+							</div>
+							<div class="col-xl-12">
+								<?php echo build_edit_input(['key'=>'id','table'=>'items','field'=>'adornment_description','value'=>$item['adornment_description'],'id'=>$item['id'],'title'=>'Adornment Description','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter an adornment description ...', 'field_type'=>'textarea']); ?>
 							</div>
 						</div>
 					</div>	<!-- fas fa-toilet-paper, fas fa-book-spells -->
@@ -125,18 +184,12 @@
 
 
 
-		<!-- Item Properties Panel -->
+		<!-- Right Slim Column -->
 		<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5 col-xl-5">
+			<!-- Flags Panel -->
 			<div id="itemeditor-props" class="panel">
-				<div class="panel-hdr text-primary">
-					<h2>
-						<span class="icon-stack fs-xxl mr-2">
-							<i class="base base-7 icon-stack-2x opacity-100 color-primary-500"></i>
-							<i class="fas fa-flag icon-stack-1x opacity-100 color-white"></i>
-						</span>
-						Flags
-						</span>
-					</h2>
+				<div class="panel-hdr">
+					<h4 class="mb-0 color-secondary"><i class="fas fa-flag color-danger-700"></i>&nbsp;Flags</h4>
 				</div>
 				<div class="panel-container show" style="">
 					<div class="panel-content">
@@ -165,13 +218,15 @@
 									'reforged'			=> ['title'=>'Reforged',		'ico'=>''],
 									'refined'			=> ['title'=>'Refined',			'ico'=>''],
 									'usable'			=> ['title'=>'Usable',			'ico'=>''],
-									'collectable'		=> ['title'=>'Collectable',		'ico'=>'']
+									'harvest'			=> ['title'=>'Harvest',			'ico'=>''],
+									'collectable'		=> ['title'=>'Collectable',		'ico'=>''],
+									'unlocked'			=> ['title'=>'Unlocked',		'ico'=>'']
 				
 								];
 								foreach($_switches as $k => $v) {
 									echo '
 									<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6 col-xl-6">
-										'.build_edit_input(['field'=>$k,'value'=>$item[$k],'icon'=>$v['ico'],'title'=>$v['title'],'id'=>$item['id'],'show-label'=>true,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'switch']).'
+										'.build_edit_input(['key'=>'id','table'=>'items','field'=>$k,'value'=>$item[$k],'icon'=>$v['ico'],'title'=>$v['title'],'id'=>$item['id'],'show-label'=>true,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'switch']).'
 									</div>';
 								}
 							?>
@@ -179,9 +234,65 @@
 					</div>	<!-- fas fa-toilet-paper, fas fa-book-spells -->
 				</div>
 			</div>
+			<!-- End: Flags Panel -->
+			
+			
+			<!-- Spell Effects Panel -->
+			<div id="itemeditor-fx" class="panel">
+				<div class="panel-hdr">
+					<h4 class="mb-0 color-secondary"><i class="fad fa-flask-potion color-info-700"></i>&nbsp;Effects</h4>
+				</div>
+				<div class="panel-container show" style="">
+					<div class="panel-content">
+						<div class="row">
+							<div class="col-xl-12">
+								<?php
+									echo build_edit_input(['key'=>'id','table'=>'items','field'=>'max_charges','value'=>$item['max_charges'],'id'=>$item['id'],'title'=>'Max Charges','icon'=>NULL,'show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Number of charges for the clickable item effect.','type'=>'number']);
+									
+									echo build_edit_input(['key'=>'id','table'=>'items','field'=>'display_charges','value'=>$item['display_charges'],'icon'=>NULL,'title'=>'Show Charges','id'=>$item['id'],'show-label'=>true,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>NULL, 'field_type'=>'switch']);
+								?>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+			<!-- End: Spell Effects Panel -->
 		</div>
-		<!-- Properties Panel -->
+		<!-- End: Right Slim Column -->
 		
-	</div>
-</div>
+		
+		<?php
+		$_unknownFields = [
+			'flags_16384','flags_32768','flags2_256','soe_item_id','soe_item_crc',
+			'offers_quest_id','soe_autoquest_id','part_of_quest_id','quest_unknown',
+			'tradeskill_classes','adventure_classes'
+		];
+		?>
+		<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
+			<!-- Unknown Columns Panel -->
+			<div id="itemeditor-unknown" class="panel">
+				<div class="panel-hdr">
+					<h4 class="mb-0 color-secondary"><i class="fad fa-map-marker-question color-primary-700"></i>&nbsp;Unknown Fields</h4>
+				</div>
+				<div class="panel-container show" style="">
+					<div class="panel-content">
+						<div class="row">
+							<?php
+								foreach($_unknownFields as $f) {
+									echo '<div class="col-xl-4">
+									'.build_edit_input(['key'=>'id','table'=>'items','field'=>$f,'value'=>$item[$f],'id'=>$item['id'],'title'=>$f,'icon'=>'fad fa-tag','show-label'=>false,'class'=>$ic,'aria'=>false,'desc'=>false,'placeholder'=>'Enter item name ...']).'
+									</div>';
+								}
+							?>
+						</div>
+					</div>
+				</div>
+			</div>
+			<!-- End: Unknown Columns Panel -->
+		</div>
+		
+		
+		
+	</div> <!-- Row -->
+</div> <!-- Col -->
 	

+ 11 - 4
inc/modules/module.editor.items.php

@@ -1,9 +1,12 @@
 <?php
-	require('inc/json.item.icons.php');
+	require('inc/data.item.icons.php');
 	
 ?>
+<script>
+	
+</script>
 
-<div class="row icon-picker-ctn hidden">
+<div class="row icon-picker-ctn" style="display:none;">
 	<div class="col-sm-12">
 		<div id="panel-0" class="panel">
 			<div class="panel-hdr">
@@ -17,13 +20,13 @@
 			<div class="panel-container show">
 				<div class="panel-content px-0 py-0">
 					<div class="row">
-						<div class="col-3">
+						<div class="col-xs-12 col-sm-4 col-md-3 col-lg-3 col-xl-3">
 							<div class="ico-picker-cat pl-3 pr-3">
 								<h3 class="text-center pt-3"><i class="fad fa-icons-alt"></i> Icon Categories</h3>
 								<?php echo get_icon_picker($itemIcons, 'categories'); ?>
 							</div>
 						</div>
-						<div class="col-8 ico-picker-list"></div>
+						<div class="col-xs-12 col-sm-8 col-md-9 col-lg-9 col-xl-9 ico-picker-list"></div>
 					</div>
 				</div>
 			</div>
@@ -90,6 +93,10 @@
 					<i class="fad fa-helmet-battle text-primary"></i>&nbsp;Item <span class="fw-300">Editor</span>
 					<span id="item-editor-header-label" class="btn btn-md btn-info hidden"></span>
 				</h2>
+				<div class="panel-toolbar item-edit-toolbar hidden">
+					<button class="btn btn-xs btn-default inline item-edit-save"><i class="fas fa-save color-info-400"></i> Save</button>&nbsp;
+					<button class="btn btn-xs btn-default inline item-edit-cancel"><i class="fas fa-times-square text-danger"></i> Cancel</button>
+				</div>
 			</div>
 			<div class="panel-container">
 				<div id="item-editor-content" class="panel-content">

+ 95 - 8
js/eq2emu.js

@@ -10,24 +10,42 @@ var eq2 = {
 
 /* ICOPICKER HANDLING & EVENTS */
 
+//Manually change item icon
+$(document).on('change', '.item-edit-input[data-field="icon"]', function() {
+	var i = $(this).val(),
+		ctn = $('.edit-item-ico-ctn'),
+		ico = 'img/eq2/items/'+i+'.png';
+	ctn.empty().append(''
+	+'<img class="edit-item-ico vm animated tada" src="img/eq2/items/'+i+'.png">'
+	+'<br>'
+	+'<small><strong class="color-success-700">Icon ID</strong>: '+i+'</small>');
+	
+});
+
 //Select icon.
 $(document).on('click', '.ico-picker-i', function() {
 	var view = $('.edit-item-ico-ctn'),
 		e = $('.item-edit-input[data-field="icon"]'),
 		i = $(this).data('icon-id');
-		
-	$('.icon-picker-ctn').toggleClass('hidden');
+	e.trigger('change');
+	$('.icon-picker-ctn').slideUp('slow');
 	view.empty().append(''
-	+'<img class="edit-item-ico vm" src="img/eq2/items/'+i+'.png"/>'
+	+'<img class="edit-item-ico vm animated tada" src="img/eq2/items/'+i+'.png"/>'
 	+'<br>'
-	+'<small><strong>Icon ID</strong>: '+i+'</small>');
+	+'<small><strong class="color-success-700">Icon ID</strong>: '+i+'</small>');
 	e.val(i);
 });
 
 
 //Toggle icon picker tools
-$(document).on('click', '.ico-picker-btn', function() {
-	$('.icon-picker-ctn').toggleClass('hidden');
+$(document).on('click', '.ico-picker-btn, .cancel-icon-picker', function() {
+	var c = $('.icon-picker-ctn'),
+		visible = c.is(":visible");
+	if(visible) {
+		c.slideUp('slow');
+	} else {
+		c.slideDown('fast');
+	}
 });
 
 
@@ -86,6 +104,69 @@ $(document).on('click', '.eq-nav-link', function() {
 
 /* ITEM EDITOR FUNCTIONS & EVENTS */
 
+//Save Changes to Item
+var confrmChanges;
+$(document).on('click', '.item-edit-save', function() {
+	var f = $('.item-edit-changed'),
+		b = $(this),
+		confrm = b.hasClass('are-you-sure'),
+		saving = b.hasClass('saving-item-changes');
+	
+	if(f.length > 0) {
+		if(!confrm && !saving) {
+			b.switchClass('btn-default', 'btn-warning');
+			b.addClass('are-you-sure');
+			b.empty().append('Are you sure?');
+			confrmChanges = setTimeout(function() {
+				b.switchClass('btn-warning','btn-default');
+				b.removeClass('are-you-sure');
+				b.empty().append('<i class="fas fa-save color-info-400"></i> Save');
+			},3000);
+		} else {
+			clearTimeout(confrmChanges);
+			b.switchClass('btn-warning', 'btn-info');
+			b.removeClass('are-you-sure');
+			b.addClass('saving-item-changes');
+			b.empty().append('<i class="fas fa-draw-circle fa-spin"></i> Saving ...');
+			var itemData = {};
+			
+			$.each(f, function() {
+				var e = $(this),
+					id = e.data('id'),
+					key = e.data('key'),
+					t = e.data('table'),
+					f = e.data('field'),
+					v = e.val();
+				if(e.hasClass('custom-control-input')) {
+					v = (e.is(":checked") ? 1:0);
+				}
+				if(e.is("select")) {
+					v = $(e, 'option:selected').val();
+				}
+				if(!itemData[t]) { itemData[t] = {'fields':{},'key':key,'id':id}; }
+				itemData[t]['fields'][f] = v;
+			});
+			
+			$.post('autoload.php', { 'edit-item':true, 'data':itemData }, function(data) {
+				b.switchClass('btn-info', 'btn-default');
+				b.removeClass('saving-item-changes');
+				setTimeout(function() {
+					b.empty().append('<i class="fas fa-save color-info-400"></i> Save');
+				},1000);
+				$('.item-edit-changed').removeClass('item-edit-changed');
+				$('.item-edit-changed-label').removeClass('item-edit-changed-label');
+				$('.item-edit-changed-label-switch').removeClass('item-edit-changed-label-switch');
+				console.log(data);
+			}, 'json');
+		}
+	
+	} else {
+		b.removeClass('animated shake').addClass('animated shake');
+		
+	}
+});
+
+
 //Tier Range Slider Value Changes
 $(document).on('change', '.tier-range', function() {
 	$('.tier-range-label').empty().append('Tier <strong class="text-success">'+$(this).val()+'</strong>');
@@ -95,7 +176,11 @@ $(document).on('change', '.tier-range', function() {
 $(document).on('change', '.item-edit-input', function() {
 	if(!$(this).hasClass('item-edit-changed')) {
 		$(this).addClass('item-edit-changed');
-		$(this).parent().find('.input-group-text').addClass('item-edit-changed-label');
+		if($(this).hasClass('custom-control-input')) {
+			$(this).parent().find('.custom-control-label').addClass('item-edit-changed-label-switch');
+		} else {
+			$(this).parent().find('.input-group-text').addClass('item-edit-changed-label');
+		}
 	}
 });
 
@@ -104,12 +189,14 @@ $(document).on('change', '.item-edit-input', function() {
 $(document).on('click', '.quick-item-search-row', function() {
 	var id = $(this).data('id'),
 		l = $('#item-editor-header-label'),
-		c = $('#item-editor-content');
+		c = $('#item-editor-content'),
+		tb = $('.item-edit-toolbar');
 	
 	if(l.hasClass('hidden')) {
 		l.removeClass('hidden').removeClass('animated').removeClass('fadeInRight');
 		l.addClass('animated fadeInRight');
 		l.empty().append('<i class="fad fa-caret-right"></i> Loading ...');
+		tb.removeClass('hidden animated fadeInLeft').addClass('animated fadeInLeft');
 	}
 	
 	c.empty().append('<p class="text-center"><div class="spinner-grow spinner-grow-lg text-primary" role="status"><span class="sr-only">Loading...</span></div></p>');