Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master'
- Loading branch information
Showing
10 changed files
with
316 additions
and
17 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
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/** | ||
* | ||
*/ | ||
|
||
//###########################################################################################// | ||
//Definition of a new jQuery Method that is an extended version of the $.get | ||
$.getADS = function(url_ads, data_ads, success_ads, error_ads, dataType_ads) | ||
{ | ||
$.ajax({ | ||
type: "GET", | ||
url: url_ads, | ||
data: data_ads, | ||
success: success_ads, | ||
error: error_ads, | ||
dataType: dataType_ads, | ||
timeout: 600000, | ||
}); | ||
}; | ||
|
||
$.postADS = function(url_ads, data_ads, success_ads, error_ads, dataType_ads) | ||
{ | ||
$.ajax({ | ||
type: "POST", | ||
url: url_ads, | ||
data: data_ads, | ||
success: success_ads, | ||
error: error_ads, | ||
dataType: dataType_ads, | ||
timeout: 600000, | ||
}); | ||
}; | ||
|
||
//definition of a new jQuery method to set the cursor at a certain point of the textfield | ||
/**** thanks to Mark from StackOverflow ****/ | ||
$.fn.selectRange = function(start, end) { | ||
return this.each(function() { | ||
if (this.setSelectionRange) { | ||
this.focus(); | ||
this.setSelectionRange(start, end); | ||
} else if (this.createTextRange) { | ||
var range = this.createTextRange(); | ||
range.collapse(true); | ||
range.moveEnd('character', end); | ||
range.moveStart('character', start); | ||
range.select(); | ||
} | ||
}); | ||
}; | ||
|
||
//definition of an escaping method | ||
RegExp.escape = function(text) { | ||
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); | ||
} | ||
|
||
//###########################################################################################// | ||
|
||
var Misc = new Object(); | ||
|
||
Misc.wrapText = function(elementID, openTag, closeTag) | ||
/* function to wrap text inside other tags */ | ||
/****thanks to richleland from StackOverflow****/ | ||
{ | ||
var textArea = $('#' + elementID); | ||
var len = textArea.val().length; | ||
var start = textArea[0].selectionStart; | ||
var end = textArea[0].selectionEnd; | ||
//if start and end are the same number I take the end of the string | ||
if (start == end) | ||
{ | ||
start = textArea.val().length; | ||
end = textArea.val().length; | ||
} | ||
var selectedText = textArea.val().substring(start, end); | ||
var replacement = openTag + selectedText + closeTag; | ||
textArea.val(textArea.val().substring(0, start) + replacement + textArea.val().substring(end, len)); | ||
|
||
//then I | ||
endrepl = start + replacement.length - closeTag.length; | ||
textArea.selectRange(endrepl, endrepl); | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** | ||
* | ||
*/ | ||
function search_form_drawer_manager(obj_drower, obj_drawer_handler) | ||
/*function to open and close the drawer*/ | ||
{ | ||
//I open the drawer | ||
$(obj_drower).slideToggle('fast', function(){ | ||
//I check if the drawer is visible or not | ||
if ($(obj_drower).is(":visible")) | ||
$(obj_drawer_handler).html('less options'); | ||
else | ||
$(obj_drawer_handler).html('more options'); | ||
}); | ||
}; | ||
|
||
//Remove all the disabled input | ||
$(':input').removeAttr("disabled"); | ||
|
||
//I add a function on the forms | ||
$("form").submit(function() | ||
{ | ||
$(this).find(':input[value=""]').attr("disabled", "disabled"); | ||
return true; // ensure form still submits | ||
}); | ||
|
||
//if there are input in the advanced options that are filled in, I show the advanced options | ||
var advanced_params_text = $("#advanced_options :input[type=text]"); | ||
var advanced_params_check = $("#advanced_options :input[type=checkbox]"); | ||
for (var x=0; x<advanced_params_text.length; x++) | ||
{ | ||
if ($(advanced_params_text[x]).val() != '') | ||
{ | ||
search_form_drawer_manager($("#advanced_options"), $("#drawer_handler")); | ||
break; | ||
} | ||
} | ||
for (var x=0; x<advanced_params_check.length; x++) | ||
{ | ||
if ($(advanced_params_check[x]).attr('checked') == 'checked') | ||
{ | ||
search_form_drawer_manager($("#advanced_options"), $("#drawer_handler")); | ||
break; | ||
} | ||
} | ||
|
||
|
||
//function search_form_second_order(sort_menu, obj_drower, obj_drawer_handler) | ||
///*function that checks if in the drop down menu of the sorting the option */ | ||
//{ | ||
// //If I have a second order operator | ||
// if($(sort_menu).val() == 'second_order_operator') | ||
// { | ||
// //I preselect the first radio | ||
// $("input:radio[name=second_order_type]:first").attr('checked', 'checked'); | ||
// //I open the advanced options if they are not already open | ||
// if ($(obj_drower).is(":hidden")) | ||
// { | ||
// $(obj_drower).slideToggle('fast', function(){ | ||
// $(obj_drawer_handler).html('less options'); | ||
// }); | ||
// } | ||
// } | ||
// //otherwise I need to uncheck all the radios | ||
// else | ||
// { | ||
// $("input:radio[name=second_order_type]").removeAttr('checked'); | ||
// } | ||
//}; | ||
// | ||
//function radio_second_order_type(sort_menu) | ||
///*Function that set the sort dropdown menu if a radio button of the second order operators is selected*/ | ||
//{ | ||
// if ($(sort_menu).val() != 'second_order_operator') | ||
// $(sort_menu).val('second_order_operator'); | ||
//}; | ||
|
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
Oops, something went wrong.