FONT_SIZE_MAX = 21; FONT_SIZE_MIN = 15;
jQuery(document).ready(function($) {
// Add col in details page
//if(document.URL.indexOf("details.xhtml") != -1){
// $("#content > div.row").wrapInner('
');
//};
/* ELLIPSIS */
if($(".ellipsis").length > 0){ $(".ellipsis").dotdotdot({ellipsis:'...'}); };
/* repair button class inMedia */
$("#overLayerExport button").removeClass("btnReject close").addClass("btn");;
$("#overLayerEmail button").removeClass("btnReject close").addClass("btn");;
// Resize font buttons
$("#resize-font-button-bigger").click(function(){
var currentFontSize = parseInt($("body").css("font-size"), 10); currentFontSize += 2;
if(currentFontSize <= FONT_SIZE_MAX){ $("body").css("font-size", currentFontSize + "px"); };
});
$("#resize-font-button-smaller").click(function(){
var currentFontSize = parseInt($("body").css("font-size"), 10); currentFontSize -= 2;
if(currentFontSize >= FONT_SIZE_MIN){ $("body").css("font-size", currentFontSize + "px"); };
});
/* Menu de navigation (Niveau 3) */
$("#navbar .nav-lvl-2 li").hover(
function(){
$(this).find(".nav-lvl-3").slideDown(0);
}, function(){
$(this).find(".nav-lvl-3").slideUp(0);
}
);
/* EDIT MODE for Admin */
if(mondoInPageApi.userLoggedIn() == true && mondoInPageApi.currentUser == "admin"){
$("div.w_border").each(function(){$(this).attr("style","border:1px dashed #000;");});
$(".w_edit_widget, .w_edit_content").each(function(){$(this).show();});
$('.w_edit_widget, .w_edit_content').tooltip();
}else{
$(".w_edit_widget, .w_edit_content").each(function(){$(this).remove();});
};
/* autoCompletion */
function quickSearchAutoCompletion(element){
if("1" == "1"){
try {
$(element).autocomplete({
source: function( request, response ) {
var qq = request.term;
qq = qq.replace(/[\s]+/g," ").replace(/^\s+|\s+$/,"");
if (qq=="") return;
$.getJSON("/in/rest/searchSVC/suggestList", {q : qq}, function (data) {
if ( data == null) { response(null); return; };
var list = data["TagSuggestion"];
if ( list == null) { response(null); return;}
if (!list.length){list = [list];};
if(list.length > 10){ response(list.slice(0,10));}else{response(list);};
});
},
minLength: 1,
select: function( event, ui ) {
if ( ui.item ){ $(element).val(ui.item.value); }
}});
} catch(e){}
};
};
//quickSearchAutoCompletion( $("input#search-input") );
/*
*Bouton "recherche avancée" dans la page "résultat de recherche"
*/
if (document.URL.indexOf("browse") != -1 && document.URL.indexOf("query") != -1 || document.URL.indexOf("profile") != -1){
$("#content > div > div.col-md-12.searchStatement > div > div.querySearchStatement.col-xs-12.col-sm-9.col-md-9 > div > div:nth-child(2) > div > div > a:nth-child(2)").attr("href", "advancedSearch.xhtml").attr("title","Recherche avancée").html("Recherche avancée");
}
});