web/lib/search.js
function submitSearch() {
    var searchInput = getSearchInput();
    // FIXME: SUI validation for select2 field
      if (!searchInput.valid) {
      alert('Please select team members');
      return;
    }
    console.log('publishing', searchInput);
    $('.search.message').html('Search results:');
    $('.search.message').removeClass('hidden');
    context.pubsub.status('queued', function(res) {
      console.log(res);
      var message = '';
      if (res.err) {
        message = res.err;
      } else {
        message = 'found <a target="_searchresult" href="' + res.status.uri + '">' + res.status.uri + '</a> from ' + res.status.source;
      }

      $('.search.message').append('<div>' + message + '</div>');
    });

    context.pubsub.search.queue(searchInput);
    context.queryLib.setAnnotationTags($('#searchCategories').val().split(','));
    context.queryLib.submitQuery();
  }
function submitSearch() {
    var searchInput = getSearchInput();
    // FIXME: SUI validation for select2 field
      if (!searchInput.valid) {
      alert('Please select team members');
      return;
    }
    console.log('publishing', searchInput);
    $('.search.message').html('Search results:');
    $('.search.message').removeClass('hidden');
    context.pubsub.status('queued', function(res) {
      console.log(res);
      var message = '';
      if (res.err) {
        message = res.err;
      } else {
        message = 'found <a target="_searchresult" href="' + res.status.uri + '">' + res.status.uri + '</a> from ' + res.status.source;
      }

      $('.search.message').append('<div>' + message + '</div>');
    });

    context.pubsub.search.queue(searchInput);
    context.queryLib.setAnnotationTags($('#searchCategories').val().split(','));
    context.queryLib.submitQuery();
  }
function submitSearch ( ) { var searchInput = getSearchInput ( ) ; // FIXME: SUI validation for select2 field if ( ! searchInput . valid ) { alert ( 'Please select team members' ) ; return ; } console . log ( 'publishing' , searchInput ) ; $ ( '.search.message' ) . html ( 'Search results:' ) ; $ ( '.search.message' ) . removeClass ( 'hidden' ) ; context . pubsub . status ( 'queued' , function ( res ) { console . log ( res ) ; var message = '' ; if ( res . err ) { message = res . err ; } else { message = 'found <a target="_searchresult" href="' + res . status . uri + '">' + res . status . uri + '</a> from ' + res . status . source ; } $ ( '.search.message' ) . append ( '<div>' + message + '</div>' ) ; } ) ; context . pubsub . search . queue ( searchInput ) ; context . queryLib . setAnnotationTags ( $ ( '#searchCategories' ) . val ( ) . split ( ',' ) ) ; context . queryLib . submitQuery ( ) ; }
submit a new search
submit a new search