Owen Leonard
0c08501e9d
This patch adds a configuration include file for the datepicker. This file makes redundant the datepicker initialization in js/script.js, so that section is removed. This change should enable two things: the CalendarFirstDayOfWeek preference should now work in the OPAC, and the calendar should now use the current selected language. To test, try the calendar widget when placing a hold in the OPAC. The CalendarFirstDayOfWeek preference should be respected for Monday and Sunday. Switch languages. The calendar interface labels should reflect the current chosen language. Revision adds the configuration include to opac-user as well (required by the suspend holds feature). Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> the datepicker plugin works for opac-reserve and opac-user Signed-off-by: Paul Poulain <paul.poulain@biblibre.com> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
85 lines
2.6 KiB
JavaScript
85 lines
2.6 KiB
JavaScript
function _(s) { return s } // dummy function for gettext
|
|
function confirmDelete(message) {
|
|
return (confirm(message) ? true : false);
|
|
}
|
|
|
|
function Dopop(link) {
|
|
newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes,resizeable=yes');
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
$(".close").click(function(){
|
|
window.close();
|
|
});
|
|
$(".focus").focus();
|
|
|
|
// clear the basket when user logs out
|
|
$("#logout").click(function(){
|
|
var nameCookie = "bib_list";
|
|
var valCookie = readCookie(nameCookie);
|
|
if (valCookie) { // basket has contents
|
|
updateBasket(0,null);
|
|
delCookie(nameCookie);
|
|
return true;
|
|
} else {
|
|
return true;
|
|
}
|
|
});
|
|
});
|
|
|
|
// build Change Language menus
|
|
YAHOO.util.Event.onContentReady("changelanguage", function () {
|
|
$(".sublangs").each(function(){
|
|
var menuid = $(this).attr("id");
|
|
var menuid = menuid.replace("show","");
|
|
|
|
var oMenu = new YAHOO.widget.Menu("sub"+menuid, { zindex: 2 });
|
|
function positionoMenu() {
|
|
oMenu.align("bl", "tl");
|
|
}
|
|
oMenu.subscribe("beforeShow", function () {
|
|
if (this.getRoot() == this) {
|
|
positionoMenu();
|
|
}
|
|
});
|
|
oMenu.render();
|
|
oMenu.cfg.setProperty("context", ["show"+menuid, "bl", "tl"]);
|
|
function onYahooClick(p_oEvent) {
|
|
// Position and display the menu
|
|
positionoMenu();
|
|
oMenu.show();
|
|
// Stop propagation and prevent the default "click" behavior
|
|
YAHOO.util.Event.stopEvent(p_oEvent);
|
|
}
|
|
YAHOO.util.Event.addListener("show"+menuid, "click", onYahooClick);
|
|
YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
|
|
|
|
});
|
|
});
|
|
|
|
// Build lists menu
|
|
YAHOO.util.Event.onContentReady("listsmenu", function () {
|
|
YAHOO.widget.Menu.prototype.onRender = function () { };
|
|
$("#listsmenu").css("display","block").css("visibility","hidden");
|
|
$("#listsmenulink").attr("href","#");
|
|
var listMenu = new YAHOO.widget.Menu("listsmenu");
|
|
listMenu.render();
|
|
listMenu.cfg.setProperty("context", ["listsmenulink", "tr", "br"]);
|
|
listMenu.cfg.setProperty("effect",{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.05});
|
|
listMenu.subscribe("beforeShow",positionlistMenu);
|
|
listMenu.subscribe("show", listMenu.focus);
|
|
function positionlistMenu() {
|
|
listMenu.align("tr", "br");
|
|
}
|
|
YAHOO.util.Event.addListener("listsmenulink", "click", listMenu.show, null, listMenu);
|
|
YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionlistMenu);
|
|
});
|
|
|
|
jQuery.fn.preventDoubleFormSubmit = function() {
|
|
jQuery(this).submit(function() {
|
|
if (this.beenSubmitted)
|
|
return false;
|
|
else
|
|
this.beenSubmitted = true;
|
|
});
|
|
};
|