mirror of
https://github.com/datahub-project/datahub.git
synced 2025-10-16 19:38:26 +00:00
Merge pull request #284 from theseyi/master
Reformats /javascripts/search.js source indentation to meet current code convention, and usage of quotes, removes duplicate function declaration
This commit is contained in:
commit
2477a80d54
@ -1,104 +1,84 @@
|
||||
(function (window, $) {
|
||||
$('#advsearchtabs a:first').tab("show");
|
||||
$('#datasetAdvSearchLink').addClass("active");
|
||||
String.prototype.replaceAll = function(target, replacement) {
|
||||
$('#advsearchtabs').find('a:first').tab('show');
|
||||
$('#datasetAdvSearchLink').addClass('active');
|
||||
String.prototype.replaceAll = function (target, replacement) {
|
||||
return this.split(target).join(replacement);
|
||||
};
|
||||
window.g_currentCategory = 'Datasets';
|
||||
function renderAdvSearchDatasetSources(parent, sources)
|
||||
{
|
||||
if ((!parent) || (!sources) || sources.length == 0)
|
||||
function renderAdvSearchDatasetSources(parent, sources) {
|
||||
let content = '';
|
||||
if ((!parent) || (!sources) || sources.length == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var content = '';
|
||||
for (var i = 0; i < sources.length; i++)
|
||||
{
|
||||
for (var i = 0; i < sources.length; i++) {
|
||||
content += '<label class="checkbox"><input type="checkbox" name="sourceCheckbox" value="';
|
||||
content += sources[i] + '"/>' + sources[i] + '</label>';
|
||||
}
|
||||
parent.append(content);
|
||||
}
|
||||
|
||||
$.ui.autocomplete.prototype._renderItem = function( ul, item){
|
||||
$.ui.autocomplete.prototype._renderItem = function (ul, item) {
|
||||
var term = this.term.split(' ').join('|');
|
||||
var re = new RegExp("(" + term + ")", "gi") ;
|
||||
var t = item.label.replace(re,"<b><font color='blue'>$1</font></b>");
|
||||
return $( "<li></li>" )
|
||||
.data( "item.autocomplete", item )
|
||||
.append( "<a>" + t + "</a>" )
|
||||
.appendTo( ul );
|
||||
var re = new RegExp('(' + term + ')', 'gi');
|
||||
var t = item.label.replace(re, "<b><font color='blue'>$1</font></b>");
|
||||
return $('<li></li>')
|
||||
.data('item.autocomplete', item)
|
||||
.append('<a>' + t + '</a>')
|
||||
.appendTo(ul);
|
||||
};
|
||||
|
||||
var maxReturnedResults = 20;
|
||||
function split( val ) {
|
||||
return val.split( /,\s*/ );
|
||||
|
||||
function split(val) {
|
||||
return val.split(/,\s*/);
|
||||
}
|
||||
|
||||
function extractLast( term ) {
|
||||
return split( term ).pop();
|
||||
function extractLast(term) {
|
||||
return split(term).pop();
|
||||
}
|
||||
|
||||
function sortAutocompleteResult(data, term)
|
||||
{
|
||||
function sortAutocompleteResult(data, term) {
|
||||
var source = $.ui.autocomplete.filter(data, term);
|
||||
var keyword = $.ui.autocomplete.escapeRegex(term);
|
||||
if (keyword && keyword.length < 4)
|
||||
{
|
||||
if (keyword && keyword.length < 4) {
|
||||
return source.slice(0, maxReturnedResults);
|
||||
}
|
||||
|
||||
var startsWithMatcher = new RegExp("^" + keyword, "i");
|
||||
var startsWith = $.grep(source, function(value) {
|
||||
var startsWithMatcher = new RegExp('^' + keyword, 'i');
|
||||
var startsWith = $.grep(source, function (value) {
|
||||
return startsWithMatcher.test(value.label || value.value || value);
|
||||
});
|
||||
var containsMatcher = new RegExp(keyword, "i")
|
||||
var containsMatcher = new RegExp(keyword, 'i');
|
||||
var contains = $.grep(source, function (value) {
|
||||
return containsMatcher.test(value.label || value.value || value);
|
||||
});
|
||||
var result = startsWith.concat(contains);
|
||||
var sorted = result.filter(function(elem, pos) {
|
||||
var sorted = result.filter(function (elem, pos) {
|
||||
return result.indexOf(elem) == pos;
|
||||
});
|
||||
return sorted.slice(0, maxReturnedResults);
|
||||
}
|
||||
|
||||
function renderAdvSearchDatasetSources(parent, sources)
|
||||
{
|
||||
if ((!parent) || (!sources) || sources.length == 0)
|
||||
return;
|
||||
|
||||
var content = '';
|
||||
for (var i = 0; i < sources.length; i++)
|
||||
{
|
||||
content += '<label class="checkbox"><input type="checkbox" name="sourceCheckbox" value="';
|
||||
content += sources[i] + '"/>' + sources[i] + '</label>';
|
||||
}
|
||||
parent.append(content);
|
||||
}
|
||||
|
||||
$(".searchCategory").click(function(e){
|
||||
var objs = $(".searchCategory");
|
||||
if (objs)
|
||||
{
|
||||
$.each(objs, function( index, value ) {
|
||||
$(objs[index]).parent().removeClass("active");
|
||||
$('.searchCategory').click(function (e) {
|
||||
var objs = $('.searchCategory');
|
||||
if (objs) {
|
||||
$.each(objs, function (index, value) {
|
||||
$(objs[index]).parent().removeClass('active');
|
||||
});
|
||||
}
|
||||
window.g_currentCategory = e.target.text;
|
||||
updateSearchCategories(e.target.text);
|
||||
//$(e.target).parent().addClass( "active" );
|
||||
//$(e.target).parent().addClass( 'active' );
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
var datasetSourcesUrl = '/api/v1/advsearch/sources';
|
||||
$.get(datasetSourcesUrl, function(data) {
|
||||
if (data && data.status == "ok")
|
||||
{
|
||||
var advSearchSourceObj = $("#advSearchSource");
|
||||
if (advSearchSourceObj)
|
||||
{
|
||||
if (data.sources)
|
||||
{
|
||||
$.get(datasetSourcesUrl, function (data) {
|
||||
if (data && data.status == 'ok') {
|
||||
var advSearchSourceObj = $('#advSearchSource');
|
||||
if (advSearchSourceObj) {
|
||||
if (data.sources) {
|
||||
renderAdvSearchDatasetSources(advSearchSourceObj, data.sources);
|
||||
}
|
||||
}
|
||||
@ -110,6 +90,7 @@
|
||||
$('#searchInput').autocomplete({
|
||||
source: function ({term}, res) {
|
||||
const matchResults = $.ui.autocomplete.filter(possibleMatches, extractLast(term));
|
||||
|
||||
/**
|
||||
* Sort the matches by giving precedence to matches that are closer in length to searchTerm and have
|
||||
* the searchTerm occurring closer to the start of the matching string.
|
||||
@ -169,285 +150,272 @@
|
||||
}).on('autocompleteselect', () => document.querySelector('#searchBtn').click());
|
||||
});
|
||||
|
||||
$.get('/api/v1/advsearch/scopes', function(data){
|
||||
$(".scopeInput").autocomplete({
|
||||
$.get('/api/v1/advsearch/scopes', function (data) {
|
||||
$('.scopeInput').autocomplete({
|
||||
minLength: 0,
|
||||
source: function( req, res ) {
|
||||
var results = $.ui.autocomplete.filter(data.scopes, extractLast( req.term ));
|
||||
res(results.slice(0,maxReturnedResults));
|
||||
source: function (req, res) {
|
||||
var results = $.ui.autocomplete.filter(data.scopes, extractLast(req.term));
|
||||
res(results.slice(0, maxReturnedResults));
|
||||
},
|
||||
focus: function() {
|
||||
focus: function () {
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
select: function (event, ui) {
|
||||
var terms = split(this.value);
|
||||
terms.pop();
|
||||
terms.push( ui.item.value );
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
terms.push(ui.item.value);
|
||||
terms.push('');
|
||||
this.value = terms.join(', ');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.get('/api/v1/advsearch/tables', function(data){
|
||||
$(".tableInput").autocomplete({
|
||||
$.get('/api/v1/advsearch/tables', function (data) {
|
||||
$('.tableInput').autocomplete({
|
||||
minLength: 0,
|
||||
source: function( req, res ) {
|
||||
var results = $.ui.autocomplete.filter(data.tables, extractLast( req.term ));
|
||||
res(results.slice(0,maxReturnedResults));
|
||||
source: function (req, res) {
|
||||
var results = $.ui.autocomplete.filter(data.tables, extractLast(req.term));
|
||||
res(results.slice(0, maxReturnedResults));
|
||||
},
|
||||
focus: function() {
|
||||
focus: function () {
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
select: function (event, ui) {
|
||||
var terms = split(this.value);
|
||||
terms.pop();
|
||||
terms.push( ui.item.value );
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
terms.push(ui.item.value);
|
||||
terms.push('');
|
||||
this.value = terms.join(', ');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.get('/api/v1/advsearch/fields', function(data){
|
||||
$(".fieldInput").autocomplete({
|
||||
$.get('/api/v1/advsearch/fields', function (data) {
|
||||
$('.fieldInput').autocomplete({
|
||||
minLength: 0,
|
||||
source: function( req, res ) {
|
||||
var results = $.ui.autocomplete.filter(data.fields, extractLast( req.term ));
|
||||
res(results.slice(0,maxReturnedResults));
|
||||
source: function (req, res) {
|
||||
var results = $.ui.autocomplete.filter(data.fields, extractLast(req.term));
|
||||
res(results.slice(0, maxReturnedResults));
|
||||
},
|
||||
focus: function() {
|
||||
focus: function () {
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
select: function (event, ui) {
|
||||
var terms = split(this.value);
|
||||
terms.pop();
|
||||
terms.push( ui.item.value );
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
terms.push(ui.item.value);
|
||||
terms.push('');
|
||||
this.value = terms.join(', ');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.get('/api/v1/advsearch/appcodes', function(data){
|
||||
$(".appcodeInput").autocomplete({
|
||||
$.get('/api/v1/advsearch/appcodes', function (data) {
|
||||
$('.appcodeInput').autocomplete({
|
||||
minLength: 0,
|
||||
source: function( req, res ) {
|
||||
var results = $.ui.autocomplete.filter(data.appcodes, extractLast( req.term ));
|
||||
res(results.slice(0,maxReturnedResults));
|
||||
source: function (req, res) {
|
||||
var results = $.ui.autocomplete.filter(data.appcodes, extractLast(req.term));
|
||||
res(results.slice(0, maxReturnedResults));
|
||||
},
|
||||
focus: function() {
|
||||
focus: function () {
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
select: function (event, ui) {
|
||||
var terms = split(this.value);
|
||||
terms.pop();
|
||||
terms.push( ui.item.value );
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
terms.push(ui.item.value);
|
||||
terms.push('');
|
||||
this.value = terms.join(', ');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.get('/api/v1/advsearch/flowNames', function(data){
|
||||
$(".flowInput").autocomplete({
|
||||
$.get('/api/v1/advsearch/flowNames', function (data) {
|
||||
$('.flowInput').autocomplete({
|
||||
minLength: 0,
|
||||
source: function( req, res ) {
|
||||
var results = $.ui.autocomplete.filter(data.flowNames, extractLast( req.term ));
|
||||
res(results.slice(0,maxReturnedResults));
|
||||
source: function (req, res) {
|
||||
var results = $.ui.autocomplete.filter(data.flowNames, extractLast(req.term));
|
||||
res(results.slice(0, maxReturnedResults));
|
||||
},
|
||||
focus: function() {
|
||||
focus: function () {
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
select: function (event, ui) {
|
||||
var terms = split(this.value);
|
||||
terms.pop();
|
||||
terms.push( ui.item.value );
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
terms.push(ui.item.value);
|
||||
terms.push('');
|
||||
this.value = terms.join(', ');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$.get('/api/v1/advsearch/jobNames', function(data){
|
||||
$(".jobInput").autocomplete({
|
||||
$.get('/api/v1/advsearch/jobNames', function (data) {
|
||||
$('.jobInput').autocomplete({
|
||||
minLength: 0,
|
||||
source: function( req, res ) {
|
||||
var results = $.ui.autocomplete.filter(data.jobNames, extractLast( req.term ));
|
||||
res(results.slice(0,maxReturnedResults));
|
||||
source: function (req, res) {
|
||||
var results = $.ui.autocomplete.filter(data.jobNames, extractLast(req.term));
|
||||
res(results.slice(0, maxReturnedResults));
|
||||
},
|
||||
focus: function() {
|
||||
focus: function () {
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
select: function (event, ui) {
|
||||
var terms = split(this.value);
|
||||
terms.pop();
|
||||
terms.push( ui.item.value );
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
terms.push(ui.item.value);
|
||||
terms.push('');
|
||||
this.value = terms.join(', ');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$( "#scopeInInput" ).blur(function() {
|
||||
$.get('/api/v1/advsearch/tables', {scopes: $( "#scopeInInput").val()}, function(data){
|
||||
$(".tableInput").autocomplete({
|
||||
$('#scopeInInput').blur(function () {
|
||||
$.get('/api/v1/advsearch/tables', {scopes: $('#scopeInInput').val()}, function (data) {
|
||||
$('.tableInput').autocomplete({
|
||||
minLength: 0,
|
||||
source: function( req, res ) {
|
||||
var results = $.ui.autocomplete.filter(data.tables, extractLast( req.term ));
|
||||
res(results.slice(0,maxReturnedResults));
|
||||
source: function (req, res) {
|
||||
var results = $.ui.autocomplete.filter(data.tables, extractLast(req.term));
|
||||
res(results.slice(0, maxReturnedResults));
|
||||
},
|
||||
focus: function() {
|
||||
focus: function () {
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
select: function (event, ui) {
|
||||
var terms = split(this.value);
|
||||
terms.pop();
|
||||
terms.push( ui.item.value );
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
terms.push(ui.item.value);
|
||||
terms.push('');
|
||||
this.value = terms.join(', ');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$( "#tableInInput" ).blur(function() {
|
||||
$.get('/api/v1/advsearch/fields', {tables: $( "#tableInInput").val()}, function(data){
|
||||
$(".fieldInput").autocomplete({
|
||||
$('#tableInInput').blur(function () {
|
||||
$.get('/api/v1/advsearch/fields', {tables: $('#tableInInput').val()}, function (data) {
|
||||
$('.fieldInput').autocomplete({
|
||||
minLength: 0,
|
||||
source: function( req, res ) {
|
||||
var results = $.ui.autocomplete.filter(data.fields, extractLast( req.term ));
|
||||
res(results.slice(0,maxReturnedResults));
|
||||
source: function (req, res) {
|
||||
var results = $.ui.autocomplete.filter(data.fields, extractLast(req.term));
|
||||
res(results.slice(0, maxReturnedResults));
|
||||
},
|
||||
focus: function() {
|
||||
focus: function () {
|
||||
return false;
|
||||
},
|
||||
select: function( event, ui ) {
|
||||
var terms = split( this.value );
|
||||
select: function (event, ui) {
|
||||
var terms = split(this.value);
|
||||
terms.pop();
|
||||
terms.push( ui.item.value );
|
||||
terms.push( "" );
|
||||
this.value = terms.join( ", " );
|
||||
terms.push(ui.item.value);
|
||||
terms.push('');
|
||||
this.value = terms.join(', ');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#searchBtn').click(function(){
|
||||
$('#searchBtn').click(function () {
|
||||
var inputObj = $('#searchInput');
|
||||
if (inputObj)
|
||||
{
|
||||
if (inputObj) {
|
||||
var keyword = inputObj.val();
|
||||
if (keyword)
|
||||
{
|
||||
if (keyword) {
|
||||
window.location = '/#/search?keywords=' + btoa(keyword) +
|
||||
'&category=' + window.g_currentCategory + '&source=default&page=1'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function advSearchForDataset()
|
||||
{
|
||||
// This is a stop gap implementation to solve the issue with handling the enter key on user search
|
||||
document.querySelector('#searchInput')
|
||||
.addEventListener('keypress', ({keyCode}) => {
|
||||
if (keyCode === 13) {
|
||||
document.querySelector('#searchBtn').click();
|
||||
}
|
||||
});
|
||||
|
||||
function advSearchForDataset() {
|
||||
var empty = true;
|
||||
var scopeInInputObj = $('#scopeInInput');
|
||||
var scopeIn = '';
|
||||
if (scopeInInputObj)
|
||||
{
|
||||
if (scopeInInputObj) {
|
||||
scopeIn = scopeInInputObj.val();
|
||||
if (scopeIn)
|
||||
{
|
||||
if (scopeIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var scopeNotInInputObj = $('#scopeNotInInput');
|
||||
var scopeNotIn = '';
|
||||
if (scopeNotInInputObj)
|
||||
{
|
||||
if (scopeNotInInputObj) {
|
||||
scopeNotIn = scopeNotInInputObj.val();
|
||||
if (scopeNotIn)
|
||||
{
|
||||
if (scopeNotIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var tableInInputObj = $('#tableInInput');
|
||||
var tableIn = '';
|
||||
if (tableInInputObj)
|
||||
{
|
||||
if (tableInInputObj) {
|
||||
tableIn = tableInInputObj.val();
|
||||
if (tableIn)
|
||||
{
|
||||
if (tableIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var tableNotInInputObj = $('#tableNotInInput');
|
||||
var tableNotIn = '';
|
||||
if (tableNotInInputObj)
|
||||
{
|
||||
if (tableNotInInputObj) {
|
||||
tableNotIn = tableNotInInputObj.val();
|
||||
if (tableNotIn)
|
||||
{
|
||||
if (tableNotIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var fieldAnyInputObj = $('#fieldAnyInput');
|
||||
var fieldAny = '';
|
||||
if (fieldAnyInputObj)
|
||||
{
|
||||
if (fieldAnyInputObj) {
|
||||
fieldAny = fieldAnyInputObj.val();
|
||||
if (fieldAny)
|
||||
{
|
||||
if (fieldAny) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var fieldAllInputObj = $('#fieldAllInput');
|
||||
var fieldAll = '';
|
||||
if (fieldAllInputObj)
|
||||
{
|
||||
if (fieldAllInputObj) {
|
||||
fieldAll = fieldAllInputObj.val();
|
||||
if (fieldAll)
|
||||
{
|
||||
if (fieldAll) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var fieldNotInInputObj = $('#fieldNotInInput');
|
||||
var fieldNotIn = '';
|
||||
if (fieldNotInInputObj)
|
||||
{
|
||||
if (fieldNotInInputObj) {
|
||||
fieldNotIn = fieldNotInInputObj.val();
|
||||
if (fieldNotIn)
|
||||
{
|
||||
if (fieldNotIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var commentsInputObj = $('#commentsInput');
|
||||
var comments = '';
|
||||
if (commentsInputObj)
|
||||
{
|
||||
if (commentsInputObj) {
|
||||
comments = commentsInputObj.val();
|
||||
if (comments)
|
||||
{
|
||||
if (comments) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var sources = '';
|
||||
$('input[name="sourceCheckbox"]:checked').each(function() {
|
||||
$('input[name=sourceCheckbox]:checked').each(function () {
|
||||
sources += this.value + ','
|
||||
});
|
||||
sources = sources.substring(0, sources.length-1);
|
||||
if (sources)
|
||||
{
|
||||
sources = sources.substring(0, sources.length - 1);
|
||||
if (sources) {
|
||||
empty = false;
|
||||
}
|
||||
if (empty)
|
||||
{
|
||||
if (empty) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -458,75 +426,61 @@
|
||||
advSearchOpts.fields = {'any': fieldAny, 'all': fieldAll, 'not': fieldNotIn};
|
||||
advSearchOpts.comments = comments;
|
||||
advSearchOpts.sources = sources;
|
||||
window.location = "/#/advsearch/?query=" + btoa(JSON.stringify(advSearchOpts)) + '&page=1';
|
||||
window.location = '/#/advsearch/?query=' + btoa(JSON.stringify(advSearchOpts)) + '&page=1';
|
||||
}
|
||||
|
||||
function advSearchForFlow()
|
||||
{
|
||||
function advSearchForFlow() {
|
||||
var empty = true;
|
||||
var appcodeInInputObj = $('#appcodeInInput');
|
||||
var appcodeIn = '';
|
||||
if (appcodeInInputObj)
|
||||
{
|
||||
if (appcodeInInputObj) {
|
||||
appcodeIn = appcodeInInputObj.val();
|
||||
if (appcodeIn)
|
||||
{
|
||||
if (appcodeIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var appcodeNotInInputObj = $('#appcodeNotInInput');
|
||||
var appcodeNotIn = '';
|
||||
if (appcodeNotInInputObj)
|
||||
{
|
||||
if (appcodeNotInInputObj) {
|
||||
appcodeNotIn = appcodeNotInInputObj.val();
|
||||
if (appcodeNotIn)
|
||||
{
|
||||
if (appcodeNotIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var flowInInputObj = $('#flowInInput');
|
||||
var flowIn = '';
|
||||
if (flowInInputObj)
|
||||
{
|
||||
if (flowInInputObj) {
|
||||
flowIn = flowInInputObj.val();
|
||||
if (flowIn)
|
||||
{
|
||||
if (flowIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var flowNotInInputObj = $('#flowNotInInput');
|
||||
var flowNotIn = '';
|
||||
if (flowNotInInputObj)
|
||||
{
|
||||
if (flowNotInInputObj) {
|
||||
flowNotIn = flowNotInInputObj.val();
|
||||
if (flowNotIn)
|
||||
{
|
||||
if (flowNotIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var jobInInputObj = $('#jobInInput');
|
||||
var jobIn = '';
|
||||
if (jobInInputObj)
|
||||
{
|
||||
if (jobInInputObj) {
|
||||
jobIn = jobInInputObj.val();
|
||||
if (jobIn)
|
||||
{
|
||||
if (jobIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
var jobNotInInputObj = $('#jobNotInInput');
|
||||
var jobNotIn = '';
|
||||
if (jobNotInInputObj)
|
||||
{
|
||||
if (jobNotInInputObj) {
|
||||
jobNotIn = jobNotInInputObj.val();
|
||||
if (jobNotIn)
|
||||
{
|
||||
if (jobNotIn) {
|
||||
empty = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty)
|
||||
{
|
||||
if (empty) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -535,99 +489,82 @@
|
||||
advSearchOpts.appcode = {'in': appcodeIn, 'not': appcodeNotIn};
|
||||
advSearchOpts.flow = {'in': flowIn, 'not': flowNotIn};
|
||||
advSearchOpts.job = {'in': jobIn, 'not': jobNotIn};
|
||||
window.location = "/#/advsearch/?query=" + btoa(JSON.stringify(advSearchOpts)) + '&page=1';
|
||||
window.location = '/#/advsearch/?query=' + btoa(JSON.stringify(advSearchOpts)) + '&page=1';
|
||||
}
|
||||
|
||||
$('#advSearchBtn').click(function(){
|
||||
var obj = $("#advsearchtabs").find(".active")
|
||||
if (obj)
|
||||
{
|
||||
$('#advSearchBtn').click(function () {
|
||||
var obj = $('#advsearchtabs').find('.active');
|
||||
if (obj) {
|
||||
var text = obj.text();
|
||||
if (text == 'Datasets')
|
||||
{
|
||||
if (text == 'Datasets') {
|
||||
advSearchForDataset();
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
advSearchForFlow();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#advSearchResetBtn').click(function(){
|
||||
$('#advSearchResetBtn').click(function () {
|
||||
var scopeInInputObj = $('#scopeInInput');
|
||||
if (scopeInInputObj)
|
||||
{
|
||||
if (scopeInInputObj) {
|
||||
scopeInInputObj.val('');
|
||||
}
|
||||
var scopeNotInInputObj = $('#scopeNotInInput');
|
||||
if (scopeNotInInputObj)
|
||||
{
|
||||
if (scopeNotInInputObj) {
|
||||
scopeNotInInputObj.val('');
|
||||
}
|
||||
var tableInInputObj = $('#tableInInput');
|
||||
if (tableInInputObj)
|
||||
{
|
||||
if (tableInInputObj) {
|
||||
tableInInputObj.val('');
|
||||
}
|
||||
var tableNotInInputObj = $('#tableNotInInput');
|
||||
if (tableNotInInputObj)
|
||||
{
|
||||
if (tableNotInInputObj) {
|
||||
tableNotInInputObj.val('');
|
||||
}
|
||||
var fieldAnyInputObj = $('#fieldAnyInput');
|
||||
if (fieldAnyInputObj)
|
||||
{
|
||||
if (fieldAnyInputObj) {
|
||||
fieldAnyInputObj.val('');
|
||||
}
|
||||
var fieldAllInputObj = $('#fieldAllInput');
|
||||
if (fieldAllInputObj)
|
||||
{
|
||||
if (fieldAllInputObj) {
|
||||
fieldAllInputObj.val('');
|
||||
}
|
||||
var fieldNotInInputObj = $('#fieldNotInInput');
|
||||
if (fieldNotInInputObj)
|
||||
{
|
||||
if (fieldNotInInputObj) {
|
||||
fieldNotInInputObj.val('');
|
||||
}
|
||||
var commentsInputObj = $('#commentsInput');
|
||||
if (commentsInputObj)
|
||||
{
|
||||
if (commentsInputObj) {
|
||||
commentsInputObj.val('');
|
||||
}
|
||||
$('input[name="sourceCheckbox"]:checked').each(function() {
|
||||
$('input[name=sourceCheckbox]:checked').each(function () {
|
||||
this.checked = false;
|
||||
});
|
||||
var appcodeInInputObj = $('#appcodeInInput');
|
||||
if (appcodeInInputObj)
|
||||
{
|
||||
if (appcodeInInputObj) {
|
||||
appcodeInInputObj.val('');
|
||||
}
|
||||
var appcodeNotInInputObj = $('#appcodeNotInInput');
|
||||
if (appcodeNotInInputObj)
|
||||
{
|
||||
if (appcodeNotInInputObj) {
|
||||
appcodeNotInInputObj.val('');
|
||||
}
|
||||
var flowInInputObj = $('#flowInInput');
|
||||
if (flowInInputObj)
|
||||
{
|
||||
if (flowInInputObj) {
|
||||
flowInInputObj.val('');
|
||||
}
|
||||
var flowNotInInputObj = $('#flowNotInInput');
|
||||
if (flowNotInInputObj)
|
||||
{
|
||||
if (flowNotInInputObj) {
|
||||
flowNotInInputObj.val('');
|
||||
}
|
||||
var jobInInputObj = $('#jobInInput');
|
||||
if (jobInInputObj)
|
||||
{
|
||||
if (jobInInputObj) {
|
||||
jobInInputObj.val('');
|
||||
}
|
||||
var jobNotInInputObj = $('#jobNotInInput');
|
||||
if (jobNotInInputObj)
|
||||
{
|
||||
if (jobNotInInputObj) {
|
||||
jobNotInInputObj.val('');
|
||||
}
|
||||
});
|
||||
|
||||
})(window, jQuery)
|
||||
})(window, jQuery);
|
||||
|
Loading…
x
Reference in New Issue
Block a user