fixed more indentation in find.js
This commit is contained in:
parent
e670861f3e
commit
28170035b0
1 changed files with 294 additions and 300 deletions
|
@ -182,325 +182,319 @@ function clearFoundData() {
|
||||||
Mconsole.plot();
|
Mconsole.plot();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define all the dynamic interactions for the FIND/FILTER using Jquery
|
* Define all the dynamic interactions for the FIND/FILTER using Jquery
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// this sets up the initial opening of the find box
|
// this sets up the initial opening of the find box
|
||||||
$('#sideOptionFind').bind('click',function(){
|
$('#sideOptionFind').bind('click',function(){
|
||||||
if (!findOpen) openFind();
|
if (!findOpen) openFind();
|
||||||
});
|
});
|
||||||
|
|
||||||
// this sets up the closing of the find box, and the toggling between open and closed.
|
// this sets up the closing of the find box, and the toggling between open and closed.
|
||||||
$('#closeFind').bind('click',function(){
|
$('#closeFind').bind('click',function(){
|
||||||
if (findOpen) closeFind();
|
if (findOpen) closeFind();
|
||||||
});
|
});
|
||||||
|
|
||||||
// this is where interactions within the find box begin
|
// this is where interactions within the find box begin
|
||||||
//
|
//on keyup, start the countdown
|
||||||
|
$('#topic_by_name_input').typing({
|
||||||
//on keyup, start the countdown
|
start: function (event, $elem) {
|
||||||
$('#topic_by_name_input').typing({
|
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
|
||||||
start: function (event, $elem) {
|
firstVal = $("#onCanvas").attr('checked');
|
||||||
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
|
secondVal = $("#inCommons").attr('checked');
|
||||||
firstVal = $("#onCanvas").attr('checked');
|
clearFoundData();
|
||||||
secondVal = $("#inCommons").attr('checked');
|
|
||||||
clearFoundData();
|
|
||||||
|
|
||||||
// only have the autocomplete enabled if they are searching in the commons
|
// only have the autocomplete enabled if they are searching in the commons
|
||||||
if (firstVal == "checked" && secondVal == "checked"){
|
if (firstVal == "checked" && secondVal == "checked"){
|
||||||
//$('#topic_by_name_input').autocomplete( "option", "disabled", false );
|
//$('#topic_by_name_input').autocomplete( "option", "disabled", false );
|
||||||
$('#topic_by_name_input').autocomplete( "option", "disabled", true );
|
$('#topic_by_name_input').autocomplete( "option", "disabled", true );
|
||||||
}
|
|
||||||
else if (firstVal == "checked"){
|
|
||||||
setTimeout(function(){showAll();},0);
|
|
||||||
$('#topic_by_name_input').autocomplete( "option", "disabled", true );
|
|
||||||
}
|
|
||||||
else if (secondVal == "checked"){
|
|
||||||
//setTimeout(function(){hideAll();},0);
|
|
||||||
//$('#topic_by_name_input').autocomplete( "option", "disabled", false );
|
|
||||||
$('#topic_by_name_input').autocomplete( "option", "disabled", true );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
alert('You either need to have searching On Your Canvas or In the Commons enabled');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
stop: function (event, $elem) {
|
|
||||||
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
|
|
||||||
firstVal = $("#onCanvas").attr('checked');
|
|
||||||
secondVal = $("#inCommons").attr('checked');
|
|
||||||
|
|
||||||
var topicName = $('#topic_by_name_input').val();
|
|
||||||
// run a search on the canvas or in the commons or both
|
|
||||||
if (firstVal == "checked" && secondVal == "checked"){
|
|
||||||
setTimeout(function(){onCanvasSearch(topicName,null,null);},0);
|
|
||||||
$('#topicsByName').val(topicName);
|
|
||||||
$('#topicsByUser').val("");
|
|
||||||
$('#topicsByMap').val("");
|
|
||||||
$('#get_topics_form').submit();
|
|
||||||
}
|
|
||||||
else if (firstVal == "checked"){
|
|
||||||
setTimeout(function(){onCanvasSearch(topicName,null,null);},0);
|
|
||||||
}
|
|
||||||
else if (secondVal == "checked"){
|
|
||||||
$('#topicsByName').val(topicName);
|
|
||||||
$('#topicsByUser').val("");
|
|
||||||
$('#topicsByMap').val("");
|
|
||||||
$('#get_topics_form').submit();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
//do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
if (topicName == "") { clearFoundData(); }
|
|
||||||
},
|
|
||||||
delay: 2000
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#sideOptionFind .select_content').change(function() {
|
|
||||||
firstVal = $(this).children("option[value='topics']").attr('selected');
|
|
||||||
secondVal = $(this).children("option[value='maps']").attr('selected');
|
|
||||||
thirdVal = $(this).children("option[value='mappers']").attr('selected');
|
|
||||||
if ( firstVal == 'selected') {
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='metacode']").removeAttr('disabled');
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='map (by name)']").removeAttr('disabled');
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='mapper (by name)']").removeAttr('disabled');
|
|
||||||
$('.find').css('display','none');
|
|
||||||
$('.find_topic_by_name').css('display','block');
|
|
||||||
$('#topic_by_name_input').focus();
|
|
||||||
|
|
||||||
}
|
|
||||||
else if ( secondVal == 'selected' ) {
|
|
||||||
if ( $("#sideOptionFind .select_type").val() != "name") {
|
|
||||||
$("#sideOptionFind .select_type").val('name');
|
|
||||||
$('#sideOptionFind').animate({
|
|
||||||
width: '305px',
|
|
||||||
height: '76px'
|
|
||||||
}, 300, function() {
|
|
||||||
// Animation complete.
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='metacode']").attr('disabled','disabled');
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='map (by name)']").attr('disabled','disabled');
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='mapper (by name)']").attr('disabled','disabled');
|
|
||||||
$('.find').css('display','none');
|
|
||||||
$('.find_map_by_name').css('display','block');
|
|
||||||
$('#map_by_name_input').focus();
|
|
||||||
}
|
|
||||||
else if ( thirdVal == 'selected' ) {
|
|
||||||
$("#sideOptionFind .select_type").val('name');
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='metacode']").attr('disabled','disabled');
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='map (by name)']").attr('disabled','disabled');
|
|
||||||
$('#sideOptionFind .select_type').children("option[value='mapper (by name)']").attr('disabled','disabled');
|
|
||||||
$('.find').css('display','none');
|
|
||||||
$('.find_mapper_by_name').css('display','block');
|
|
||||||
$('#mapper_by_name_input').focus();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#sideOptionFind .select_type').change(function() {
|
|
||||||
firstVal = $(this).children("option[value='name']").attr('selected');
|
|
||||||
secondVal = $(this).children("option[value='metacode']").attr('selected');
|
|
||||||
thirdVal = $(this).children("option[value='map (by name)']").attr('selected');
|
|
||||||
fourthVal = $(this).children("option[value='mapper (by name)']").attr('selected');
|
|
||||||
if ( firstVal === 'selected') {
|
|
||||||
$('.find').fadeOut('fast', function() {
|
|
||||||
showAll();
|
|
||||||
$('.find_topic_by_metacode ul li').not('#hideAll, #showAll').removeClass('toggledOff');
|
|
||||||
for (var catVis in categoryVisible) {
|
|
||||||
categoryVisible[catVis] = true;
|
|
||||||
}
|
|
||||||
$('#sideOptionFind').animate({
|
|
||||||
width: '305px',
|
|
||||||
height: '76px'
|
|
||||||
}, 300, function() {
|
|
||||||
$('.find_topic_by_name').css('display','block');
|
|
||||||
$('#topic_by_name_input').focus();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if ( secondVal === 'selected' ) {
|
|
||||||
$('.find').fadeOut('fast', function() {
|
|
||||||
$('#sideOptionFind').animate({
|
|
||||||
width: '380px',
|
|
||||||
height: '463px'
|
|
||||||
}, 300, function() {
|
|
||||||
$('.find_topic_by_metacode').fadeIn('fast');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if ( thirdVal === 'selected' ) {
|
|
||||||
$('.find').fadeOut('fast', function() {
|
|
||||||
$('#sideOptionFind').animate({
|
|
||||||
width: '305px',
|
|
||||||
height: '76px'
|
|
||||||
}, 300, function() {
|
|
||||||
$('.find_map_by_name').css('display','block');
|
|
||||||
$('#map_by_name_input').focus();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else if ( fourthVal === 'selected' ) {
|
|
||||||
$('.find').fadeOut('fast', function() {
|
|
||||||
$('#sideOptionFind').animate({
|
|
||||||
width: '305px',
|
|
||||||
height: '76px'
|
|
||||||
}, 300, function() {
|
|
||||||
$('.find_mapper_by_name').css('display','block');
|
|
||||||
$('#mapper_by_name_input').focus();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.find_topic_by_name #topic_by_name_input').bind('railsAutocomplete.select', function(event, data){
|
|
||||||
/* Do something here */
|
|
||||||
if (data.item.id != undefined) {
|
|
||||||
window.open("/topics/" + data.item.id)
|
|
||||||
}
|
}
|
||||||
$('.find_topic_by_name #topic_by_name_input').val('');
|
else if (firstVal == "checked"){
|
||||||
});
|
setTimeout(function(){showAll();},0);
|
||||||
|
$('#topic_by_name_input').autocomplete( "option", "disabled", true );
|
||||||
$('.find_topic_by_name').bind('submit', function(event, data){
|
}
|
||||||
event.preventDefault();
|
else if (secondVal == "checked"){
|
||||||
});
|
//setTimeout(function(){hideAll();},0);
|
||||||
|
//$('#topic_by_name_input').autocomplete( "option", "disabled", false );
|
||||||
$('.find_map_by_name #map_by_name_input').bind('railsAutocomplete.select', function(event, data){
|
$('#topic_by_name_input').autocomplete( "option", "disabled", true );
|
||||||
firstVal = $('#sideOptionFind .select_content').children("option[value='topics']").attr('selected');
|
}
|
||||||
secondVal = $('#sideOptionFind .select_content').children("option[value='maps']").attr('selected');
|
else {
|
||||||
thirdVal = $('#sideOptionFind .select_content').children("option[value='mappers']").attr('selected');
|
alert('You either need to have searching On Your Canvas or In the Commons enabled');
|
||||||
if ( firstVal == 'selected') {
|
}
|
||||||
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
|
},
|
||||||
firstNewVal = $("#onCanvas").attr('checked');
|
stop: function (event, $elem) {
|
||||||
secondNewVal = $("#inCommons").attr('checked');
|
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
|
||||||
|
firstVal = $("#onCanvas").attr('checked');
|
||||||
// only have the autocomplete enabled if they are searching in the commons
|
secondVal = $("#inCommons").attr('checked');
|
||||||
|
|
||||||
if (firstNewVal == "checked" && secondNewVal == "checked"){
|
var topicName = $('#topic_by_name_input').val();
|
||||||
setTimeout(function(){onCanvasSearch(null,data.item.id,null);},0);
|
// run a search on the canvas or in the commons or both
|
||||||
$('#topicsByMap').val(data.item.id);
|
if (firstVal == "checked" && secondVal == "checked") {
|
||||||
$('#topicsByUser').val("");
|
setTimeout(function(){onCanvasSearch(topicName,null,null);},0);
|
||||||
$('#topicsByName').val("");
|
$('#topicsByName').val(topicName);
|
||||||
$('#get_topics_form').submit();
|
$('#topicsByUser').val("");
|
||||||
}
|
$('#topicsByMap').val("");
|
||||||
else if (firstNewVal == "checked"){
|
$('#get_topics_form').submit();
|
||||||
setTimeout(function(){onCanvasSearch(null,data.item.id,null);},0);
|
}
|
||||||
}
|
else if (firstVal == "checked") {
|
||||||
else if (secondNewVal == "checked"){
|
setTimeout(function(){onCanvasSearch(topicName,null,null);},0);
|
||||||
//hideAll();
|
}
|
||||||
$('#topicsByMap').val(data.item.id);
|
else if (secondVal == "checked") {
|
||||||
$('#topicsByUser').val("");
|
$('#topicsByName').val(topicName);
|
||||||
$('#topicsByName').val("");
|
$('#topicsByUser').val("");
|
||||||
$('#get_topics_form').submit();
|
$('#topicsByMap').val("");
|
||||||
}
|
$('#get_topics_form').submit();
|
||||||
else {
|
}
|
||||||
alert('You either need to have searching On Your Canvas or In the Commons enabled');
|
else {
|
||||||
}
|
//do nothing
|
||||||
}
|
}
|
||||||
else if ( secondVal == 'selected' ) {
|
|
||||||
if (data.item.id != undefined) {
|
if (topicName == "") {
|
||||||
window.open("/maps/" + data.item.id);
|
clearFoundData();
|
||||||
}
|
}
|
||||||
$('.find_map_by_name #map_by_name_input').val('');
|
},
|
||||||
}
|
delay: 2000
|
||||||
else if ( thirdVal == 'selected' ) {
|
});
|
||||||
|
|
||||||
}
|
$('#sideOptionFind .select_content').change(function() {
|
||||||
});
|
firstVal = $(this).children("option[value='topics']").attr('selected');
|
||||||
|
secondVal = $(this).children("option[value='maps']").attr('selected');
|
||||||
|
thirdVal = $(this).children("option[value='mappers']").attr('selected');
|
||||||
|
if (firstVal == 'selected') {
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='metacode']").removeAttr('disabled');
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='map (by name)']").removeAttr('disabled');
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='mapper (by name)']").removeAttr('disabled');
|
||||||
|
$('.find').css('display','none');
|
||||||
|
$('.find_topic_by_name').css('display','block');
|
||||||
|
$('#topic_by_name_input').focus();
|
||||||
|
}
|
||||||
|
else if ( secondVal == 'selected' ) {
|
||||||
|
if ( $("#sideOptionFind .select_type").val() != "name") {
|
||||||
|
$("#sideOptionFind .select_type").val('name');
|
||||||
|
$('#sideOptionFind').animate({
|
||||||
|
width: '305px',
|
||||||
|
height: '76px'
|
||||||
|
}, 300, function() {
|
||||||
|
// Animation complete.
|
||||||
|
});
|
||||||
|
}
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='metacode']").attr('disabled','disabled');
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='map (by name)']").attr('disabled','disabled');
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='mapper (by name)']").attr('disabled','disabled');
|
||||||
|
$('.find').css('display','none');
|
||||||
|
$('.find_map_by_name').css('display','block');
|
||||||
|
$('#map_by_name_input').focus();
|
||||||
|
}
|
||||||
|
else if ( thirdVal == 'selected' ) {
|
||||||
|
$("#sideOptionFind .select_type").val('name');
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='metacode']").attr('disabled','disabled');
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='map (by name)']").attr('disabled','disabled');
|
||||||
|
$('#sideOptionFind .select_type').children("option[value='mapper (by name)']").attr('disabled','disabled');
|
||||||
|
$('.find').css('display','none');
|
||||||
|
$('.find_mapper_by_name').css('display','block');
|
||||||
|
$('#mapper_by_name_input').focus();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#sideOptionFind .select_type').change(function() {
|
||||||
|
firstVal = $(this).children("option[value='name']").attr('selected');
|
||||||
|
secondVal = $(this).children("option[value='metacode']").attr('selected');
|
||||||
|
thirdVal = $(this).children("option[value='map (by name)']").attr('selected');
|
||||||
|
fourthVal = $(this).children("option[value='mapper (by name)']").attr('selected');
|
||||||
|
if (firstVal === 'selected') {
|
||||||
|
$('.find').fadeOut('fast', function() {
|
||||||
|
showAll();
|
||||||
|
$('.find_topic_by_metacode ul li').not('#hideAll, #showAll').removeClass('toggledOff');
|
||||||
|
for (var catVis in categoryVisible) {
|
||||||
|
categoryVisible[catVis] = true;
|
||||||
|
}
|
||||||
|
$('#sideOptionFind').animate({
|
||||||
|
width: '305px',
|
||||||
|
height: '76px'
|
||||||
|
}, 300, function() {
|
||||||
|
$('.find_topic_by_name').css('display','block');
|
||||||
|
$('#topic_by_name_input').focus();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if ( secondVal === 'selected' ) {
|
||||||
|
$('.find').fadeOut('fast', function() {
|
||||||
|
$('#sideOptionFind').animate({
|
||||||
|
width: '380px',
|
||||||
|
height: '463px'
|
||||||
|
}, 300, function() {
|
||||||
|
$('.find_topic_by_metacode').fadeIn('fast');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if ( thirdVal === 'selected' ) {
|
||||||
|
$('.find').fadeOut('fast', function() {
|
||||||
|
$('#sideOptionFind').animate({
|
||||||
|
width: '305px',
|
||||||
|
height: '76px'
|
||||||
|
}, 300, function() {
|
||||||
|
$('.find_map_by_name').css('display','block');
|
||||||
|
$('#map_by_name_input').focus();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else if ( fourthVal === 'selected' ) {
|
||||||
|
$('.find').fadeOut('fast', function() {
|
||||||
|
$('#sideOptionFind').animate({
|
||||||
|
width: '305px',
|
||||||
|
height: '76px'
|
||||||
|
}, 300, function() {
|
||||||
|
$('.find_mapper_by_name').css('display','block');
|
||||||
|
$('#mapper_by_name_input').focus();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.find_topic_by_name #topic_by_name_input').bind('railsAutocomplete.select', function(event, data) {
|
||||||
|
/* Do something here */
|
||||||
|
if (data.item.id != undefined) {
|
||||||
|
window.open("/topics/" + data.item.id)
|
||||||
|
}
|
||||||
|
$('.find_topic_by_name #topic_by_name_input').val('');
|
||||||
|
});
|
||||||
|
|
||||||
$('.find_map_by_name').bind('submit', function(event, data){
|
$('.find_topic_by_name').bind('submit', function(event, data) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.find_mapper_by_name #mapper_by_name_input').bind('railsAutocomplete.select', function(event, data){
|
$('.find_map_by_name #map_by_name_input').bind('railsAutocomplete.select', function(event, data) {
|
||||||
firstVal = $('#sideOptionFind .select_content').children("option[value='topics']").attr('selected');
|
firstVal = $('#sideOptionFind .select_content').children("option[value='topics']").attr('selected');
|
||||||
secondVal = $('#sideOptionFind .select_content').children("option[value='maps']").attr('selected');
|
secondVal = $('#sideOptionFind .select_content').children("option[value='maps']").attr('selected');
|
||||||
thirdVal = $('#sideOptionFind .select_content').children("option[value='mappers']").attr('selected');
|
thirdVal = $('#sideOptionFind .select_content').children("option[value='mappers']").attr('selected');
|
||||||
if ( firstVal == 'selected') {
|
if (firstVal == 'selected') {
|
||||||
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
|
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
|
||||||
firstNewVal = $("#onCanvas").attr('checked');
|
firstNewVal = $("#onCanvas").attr('checked');
|
||||||
secondNewVal = $("#inCommons").attr('checked');
|
secondNewVal = $("#inCommons").attr('checked');
|
||||||
|
|
||||||
// only have the autocomplete enabled if they are searching in the commons
|
// only have the autocomplete enabled if they are searching in the commons
|
||||||
|
if (firstNewVal == "checked" && secondNewVal == "checked") {
|
||||||
if (firstNewVal == "checked" && secondNewVal == "checked"){
|
setTimeout(function(){onCanvasSearch(null,data.item.id,null);},0);
|
||||||
|
$('#topicsByMap').val(data.item.id);
|
||||||
|
$('#topicsByUser').val("");
|
||||||
|
$('#topicsByName').val("");
|
||||||
|
$('#get_topics_form').submit();
|
||||||
|
}
|
||||||
|
else if (firstNewVal == "checked") {
|
||||||
|
setTimeout(function(){onCanvasSearch(null,data.item.id,null);},0);
|
||||||
|
}
|
||||||
|
else if (secondNewVal == "checked"){
|
||||||
|
//hideAll();
|
||||||
|
$('#topicsByMap').val(data.item.id);
|
||||||
|
$('#topicsByUser').val("");
|
||||||
|
$('#topicsByName').val("");
|
||||||
|
$('#get_topics_form').submit();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
alert('You either need to have searching On Your Canvas or In the Commons enabled');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( secondVal == 'selected' ) {
|
||||||
|
if (data.item.id != undefined) {
|
||||||
|
window.open("/maps/" + data.item.id);
|
||||||
|
}
|
||||||
|
$('.find_map_by_name #map_by_name_input').val('');
|
||||||
|
}
|
||||||
|
else if ( thirdVal == 'selected' ) {
|
||||||
|
//nothing
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.find_map_by_name').bind('submit', function(event, data){
|
||||||
|
event.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.find_mapper_by_name #mapper_by_name_input').bind('railsAutocomplete.select', function(event, data){
|
||||||
|
firstVal = $('#sideOptionFind .select_content').children("option[value='topics']").attr('selected');
|
||||||
|
secondVal = $('#sideOptionFind .select_content').children("option[value='maps']").attr('selected');
|
||||||
|
thirdVal = $('#sideOptionFind .select_content').children("option[value='mappers']").attr('selected');
|
||||||
|
if ( firstVal == 'selected') {
|
||||||
|
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
|
||||||
|
firstNewVal = $("#onCanvas").attr('checked');
|
||||||
|
secondNewVal = $("#inCommons").attr('checked');
|
||||||
|
|
||||||
|
// only have the autocomplete enabled if they are searching in the commons
|
||||||
|
if (firstNewVal == "checked" && secondNewVal == "checked"){
|
||||||
setTimeout(function(){onCanvasSearch(null,null,data.item.id.toString());},0);
|
setTimeout(function(){onCanvasSearch(null,null,data.item.id.toString());},0);
|
||||||
$('#topicsByUser').val(data.item.id);
|
$('#topicsByUser').val(data.item.id);
|
||||||
$('#topicsByMap').val("");
|
$('#topicsByMap').val("");
|
||||||
$('#topicsByName').val("");
|
$('#topicsByName').val("");
|
||||||
$('#get_topics_form').submit();
|
$('#get_topics_form').submit();
|
||||||
}
|
}
|
||||||
else if (firstNewVal == "checked"){
|
else if (firstNewVal == "checked"){
|
||||||
setTimeout(function(){onCanvasSearch(null,null,data.item.id.toString());},0);
|
setTimeout(function(){onCanvasSearch(null,null,data.item.id.toString());},0);
|
||||||
}
|
}
|
||||||
else if (secondNewVal == "checked"){
|
else if (secondNewVal == "checked"){
|
||||||
//hideAll();
|
//hideAll();
|
||||||
$('#topicsByUser').val(data.item.id);
|
$('#topicsByUser').val(data.item.id);
|
||||||
$('#topicsByMap').val("");
|
$('#topicsByMap').val("");
|
||||||
$('#topicsByName').val("");
|
$('#topicsByName').val("");
|
||||||
$('#get_topics_form').submit();
|
$('#get_topics_form').submit();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
alert('You either need to have searching On Your Canvas or In the Commons enabled');
|
alert('You either need to have searching On Your Canvas or In the Commons enabled');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( secondVal == 'selected' ) {
|
else if ( secondVal == 'selected' ) {
|
||||||
|
//nothing
|
||||||
}
|
}
|
||||||
else if ( thirdVal == 'selected' ) {
|
else if ( thirdVal == 'selected' ) {
|
||||||
if (data.item.id != undefined) {
|
if (data.item.id != undefined) {
|
||||||
window.open("/users/" + data.item.id);
|
window.open("/users/" + data.item.id);
|
||||||
}
|
}
|
||||||
$('.find_mapper_by_name #mapper_by_name_input').val('');
|
$('.find_mapper_by_name #mapper_by_name_input').val('');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.find_mapper_by_name').bind('submit', function(event, data){
|
$('.find_mapper_by_name').bind('submit', function(event, data){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
// toggle visibility of topics with metacodes based on status in the filters list
|
// toggle visibility of topics with metacodes based on status in the filters list
|
||||||
$('.find_topic_by_metacode ul li').click(function(event) {
|
$('.find_topic_by_metacode ul li').click(function(event) {
|
||||||
obj = document.getElementById('container');
|
obj = document.getElementById('container');
|
||||||
|
|
||||||
var switchAll = $(this).attr('id');
|
var switchAll = $(this).attr('id');
|
||||||
|
if ( switchAll === "showAll" || switchAll === "hideAll") {
|
||||||
if ( switchAll === "showAll" || switchAll === "hideAll") {
|
if (switchAll == "showAll") {
|
||||||
if (switchAll == "showAll") {
|
showAll();
|
||||||
showAll();
|
$('.find_topic_by_metacode ul li').not('#hideAll, #showAll').removeClass('toggledOff');
|
||||||
$('.find_topic_by_metacode ul li').not('#hideAll, #showAll').removeClass('toggledOff');
|
for (var catVis in categoryVisible) {
|
||||||
for (var catVis in categoryVisible) {
|
categoryVisible[catVis] = true;
|
||||||
categoryVisible[catVis] = true;
|
}
|
||||||
}
|
}
|
||||||
}
|
else if (switchAll == "hideAll") {
|
||||||
else if (switchAll == "hideAll") {
|
hideAll();
|
||||||
hideAll();
|
$('.find_topic_by_metacode ul li').not('#hideAll, #showAll').addClass('toggledOff');
|
||||||
$('.find_topic_by_metacode ul li').not('#hideAll, #showAll').addClass('toggledOff');
|
for (var catVis in categoryVisible) {
|
||||||
for (var catVis in categoryVisible) {
|
categoryVisible[catVis] = false;
|
||||||
categoryVisible[catVis] = false;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else {
|
||||||
else {
|
var category = $(this).children('img').attr('alt');
|
||||||
var category = $(this).children('img').attr('alt');
|
switchVisible(category);
|
||||||
switchVisible(category);
|
|
||||||
|
// toggle the image and the boolean array value
|
||||||
// toggle the image and the boolean array value
|
if (categoryVisible[category] == true) {
|
||||||
if (categoryVisible[category] == true) {
|
$(this).addClass('toggledOff');
|
||||||
$(this).addClass('toggledOff');
|
categoryVisible[category] = false;
|
||||||
categoryVisible[category] = false;
|
}
|
||||||
}
|
else if (categoryVisible[category] == false) {
|
||||||
else if (categoryVisible[category] == false) {
|
$(this).removeClass('toggledOff');
|
||||||
$(this).removeClass('toggledOff');
|
categoryVisible[category] = true;
|
||||||
categoryVisible[category] = true;
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function openFind() {
|
function openFind() {
|
||||||
findOpen = true;
|
findOpen = true;
|
||||||
if (analyzeOpen) closeAnalyze();
|
if (analyzeOpen) closeAnalyze();
|
||||||
|
|
Loading…
Reference in a new issue