1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- var eq2 = {
-
-
- };
- /* NAVIGATION HANDLING & EVENTS */
- $(document).on('click', '.eq-nav-link', function() {
- var m = $(this).data('module'),
- e = $(this),
- t = $(this).find('.nav-link-text').text();
- console.log(t);
- $(this).find('a').empty().append('<span class="inline animated fadeInLeft"><i class="fad fa-spinner-third fa-spin fast-spin"></i></span> <span class="nav-link-text">'+t+'</span>');
- $.post('autoload.php', {'set-navigation':m}, function(data) {
- location.reload();
- });
- });
- /* ITEM EDITOR FUNCTIONS & EVENTS */
- //Load Item Editor Pane
- $(document).on('click', '.quick-item-search-row', function() {
- var id = $(this).data('id'),
- l = $('#item-editor-header-label'),
- c = $('#item-editor-content');
-
- 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 ...');
- }
-
- 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>');
- $.post('autoload.php', {'get-edit-item':id}, function(data) {
- setTimeout(function() {
-
- c.empty().append(data);
- },700);
- });
- });
- //Quick Search Handler
- var quicksearchtimer,
- quicksearchdata;
- $(document).on('keyup', '#item-quick-search', function() {
- var s = $(this).val(),
- i = $('#quick-item-search-icon'),
- l = $('#quick-item-list');
- console.log('Keyup Detected');
- if(quicksearchtimer) { clearTimeout(quicksearchtimer) } //Clear timeout between keystrokes
- i.empty().append('<i class="fad fa-circle-notch text-success fa-spin fast-spin fs-xl"></i>');
- l.empty().append('<div class="panel-content text-center"><div class="spinner-grow spinner-grow-sm" role="status"><span class="sr-only"></span></div> <div class="spinner-grow spinner-grow-sm" role="status"><span class="sr-only"></span></div> <div class="spinner-grow spinner-grow-sm" role="status"><span class="sr-only"></span></div></div>');
- quicksearchtimer = setTimeout(function() {
- $.post('autoload.php', {'quick-item-search':s}, function(data) {
- quicksearchdata = data;
- build_quicksearch_list(data);
- },'json');
- }, 800);
- });
- function build_quicksearch_list(d) {
- var i = $('#quick-item-search-icon'),
- l = $('#quick-item-list');
- i.empty().append('<span class="animated zoomIn inline"><i class="fad fa-search fa-info fs-xl"></i></span>')
- console.log(d);
- if(d.rows.length > 0) {
- l.empty().append('<p class="text-center"><small><span class="text-success">'+d.found+'</span> item(s) found - results limited to <span class="text-danger">'+d.count+'</span>.</small></p>');
- $.each(quicksearchdata.rows, function(k,v) {
- l.append(''
- +'<div class="row quick-item-search-row" data-id="'+v.id+'">'
- +' <div class="col-hidden-xs col-sm-3 col-md-3 col-lg-2 text-center"><img class="quick-search-item-ico vm" src="img/eq2/items/'+v.icon+'.png"/></div>'
- +' <div class="col-xs-12 col-sm-9 col-md-7 col-lg-8 text-left">'
- +' <a href="#" class="text-primary">'+v.name+'</a> '
- +' <small class="text-muted"><br><span class="badge badge-primary"><strong>ID</strong>: '+v.id+'</span> '+v.item_type+'</small>'
- +' </div>'
- +' <div class="col-hidden-xs col-hidden-sm col-md-1 col-lg-2 text-right text-primary" style="font-size:15pt;"><span class="vm"><i class="fad fa-angle-right vm"></i></span></div>'
- +'</div>');
- });
- } else {
- l.empty().append(''
- +'<div class="col-xs-12">'
- +' <h4 style="padding-top:50px;padding-bottom:50px;" class="text-center">'
- +' <span class="animated bounceInDown inline"><i class="fad fa-minus-hexagon text-danger"></i></span>'
- +' No items were found matching your search.'
- +' </h4>'
- +'</div>');
- }
- }
|