Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove compressed MantisBT JavaScript
The two versions (development and 'production') are out of sync with each other. As stated before, it is better for us to bundle compressed 'production' versions of the MantisBT JavaScript files when we're preparing the release packages. This will avoid the issue of JavaScript files becoming out of sync in the repository (not a good situation).
- Loading branch information
1 parent
8ea1b7a
commit f86a9be
Showing
5 changed files
with
102 additions
and
412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,100 @@ | ||
var begin_form='';var form_fields=new Array();var serialized_form_fields=new Array();$(document).ready(function(){var i=0;$('[name=filters_open]').find('input').each(function(){var formname=$(this).parent('form').attr('name');if(formname!='list_queries_open'&&formname!='open_queries'&&formname!='save_query'){if($.inArray($(this).attr('name'),form_fields)==-1){form_fields[i]=$(this).attr('name');i++}}});$.each(form_fields,function(index,value){serialized_form_fields[value]=$('[name=filters_open]').find('[name='+value+']').serialize()});begin_form=$('[name=filters_open]').serialize();$('[:input').live("change",function(){filter_highlight_changes($(this))});$(':checkbox').live("click",function(){filter_highlight_changes($(this))})});function filter_toggle_field_changed(field){var field_type=field.attr('type');var starting_value=serialized_form_fields[field.attr('name')];var current_value=field.serialize();if(field_type=='checkbox'&¤t_value==''){current_value=undefined}if(current_value!=starting_value){filter_field_dirty(field)}else{filter_field_clean(field)}}function filter_highlight_changes(item){filter_toggle_field_changed(item);var changed_form=$('[name=filters_open]').serialize();if(begin_form==changed_form){filter_clean_all()}}function filter_named_filter_clean(){var selected_text=$('[name=source_query_id] option:selected').html();if(selected_text.charAt(0)=='*'){$('[name=source_query_id]').removeClass('tainted');var reset_text=selected_text.substring(2,selected_text.length);$('[name=source_query_id] option:selected').html(reset_text)}}function filter_named_filter_dirty(){var stored_query_id=$('[name=source_query_id]').val();if(stored_query_id==-1){return}var selected_text=$('[name=source_query_id] option:selected').html();if(selected_text.charAt(0)!='*'){$('[name=source_query_id] option:selected').prepend('* ');$('[name=source_query_id]').addClass('tainted')}}function filter_field_clean(item){item.parent().removeClass('tainted')}function filter_field_dirty(item){if(!item.parent().hasClass('tainted')){filter_named_filter_dirty();item.parent().addClass('tainted')}}function filter_clean_all(){filter_named_filter_clean();$('.tainted').each(function(){$(this).removeClass('tainted')})} | ||
var begin_form = ''; | ||
var form_fields = new Array(); | ||
var serialized_form_fields = new Array(); | ||
$(document).ready(function(){ | ||
var i = 0; | ||
$('[name=filters_open]').find('input').each(function() { | ||
var formname = $(this).parent('form').attr('name'); | ||
if( formname != 'list_queries_open' && formname != 'open_queries' && formname != 'save_query' ) { | ||
// serialize the field and add it to an array | ||
|
||
if( $.inArray($(this).attr('name'),form_fields) == -1 ) { | ||
form_fields[i] = $(this).attr('name'); | ||
i++; | ||
} | ||
} | ||
}); | ||
$.each( form_fields, function (index, value) { | ||
serialized_form_fields[value] = $('[name=filters_open]').find('[name=' + value.replace(/[]/g, '\\$1') + ']').serialize(); | ||
}); | ||
|
||
/* Set up events to modify the form css to show when a stored query has been modified */ | ||
begin_form = $('[name=filters_open]').serialize(); | ||
|
||
$('[:input').live("change", function() { | ||
filter_highlight_changes($(this)); | ||
}); | ||
$(':checkbox').live("click", function() { | ||
filter_highlight_changes($(this)); | ||
}); | ||
}); | ||
|
||
function filter_toggle_field_changed(field) { | ||
var field_type = field.attr('type'); | ||
var starting_value = serialized_form_fields[field.attr('name')]; | ||
var current_value = field.serialize(); | ||
|
||
// unchecked boxes start as undefined but if checked and then unchecked it | ||
// is no longer undefined so the comparison breaks. Reset it to undefined. | ||
if( field_type=='checkbox' && current_value == '') { | ||
current_value = undefined; | ||
} | ||
if( current_value != starting_value ) { | ||
// field is changed | ||
filter_field_dirty(field); | ||
} else { | ||
// field is not changed | ||
filter_field_clean(field); | ||
} | ||
} | ||
|
||
function filter_highlight_changes(item) { | ||
filter_toggle_field_changed( item ); | ||
|
||
/* Check if form is different that started with */ | ||
var changed_form = $('[name=filters_open]').serialize(); | ||
if( begin_form == changed_form ) { | ||
filter_clean_all(); | ||
} | ||
} | ||
|
||
function filter_named_filter_clean() { | ||
/* be sure it's clean whether it's stored filter or not */ | ||
var selected_text = $('[name=source_query_id] option:selected').html(); | ||
if( selected_text.charAt(0) == '*' ) { | ||
$('[name=source_query_id]').removeClass('tainted'); | ||
var reset_text = selected_text.substring(2,selected_text.length); | ||
$('[name=source_query_id] option:selected').html(reset_text); | ||
} | ||
} | ||
|
||
function filter_named_filter_dirty() { | ||
var stored_query_id = $('[name=source_query_id]').val(); | ||
if( stored_query_id == -1 ) { | ||
/* Only make it dirty if it's a stored filter */ | ||
return; | ||
} | ||
/* stored query in filter is tainted */ | ||
var selected_text = $('[name=source_query_id] option:selected').html(); | ||
if( selected_text.charAt(0) != '*' ) { | ||
$('[name=source_query_id] option:selected').prepend('* '); | ||
$('[name=source_query_id]').addClass('tainted'); | ||
} | ||
} | ||
|
||
function filter_field_clean( item ) { | ||
item.parent().removeClass('tainted'); | ||
} | ||
function filter_field_dirty( item ) { | ||
if( !item.parent().hasClass('tainted') ) { | ||
filter_named_filter_dirty(); | ||
item.parent().addClass('tainted'); | ||
} | ||
} | ||
|
||
function filter_clean_all() { | ||
filter_named_filter_clean(); | ||
$('.tainted').each(function() { | ||
$(this).removeClass('tainted'); | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.