if (typeof Fox == 'undefined')
{
Fox = {};
Fox.Strings =
{
add: function (object)
{
Object.merge(this, object);
return this;
}
};
Fox.Options =
{
// Fox.Options.add('key', {...});
add: function (key, data)
{
var o = {};
o[key] = data;
Object.merge(this, o);
return this;
},
// Return by copy: Fox.Options.get('key');
// Return by reference: Fox.Options['key'];
get: function (key)
{
return Object.merge({}, this[key]);
}
};
}
(function ()
{
Fox.Strings.add(
{
JCANCEL: "Annuler",
COM_FOXCONTACT_BROWSE_FILES: "Explorer les fichiers",
COM_FOXCONTACT_FAILED: "Échec",
COM_FOXCONTACT_SUCCESS: "Succès",
COM_FOXCONTACT_NO_RESULTS_MATCH: "Aucun résultat conforme",
COM_FOXCONTACT_REMOVE_ALT: "Supprimer",
COM_FOXCONTACT_REMOVE_TITLE: "Supprimer ce fichier"
}
);
Locale.define('dynamic', 'DatePicker', {
select_a_time: "Choisir l'heure",
use_mouse_wheel: "Utiliser la molette pour changer l'heure rapidement",
time_confirm_button: "OK"
});
Locale.define('dynamic', 'Date', {
months: ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"],
months_abbr: ["Jan", "Fév", "Mar", "Avr", "Mai", "Jui", "Juil", "Aoû", "Sep", "Oct", "Nov", "Déc"],
days: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"],
days_abbr: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"]
});
Locale.use('dynamic');
// Calendar default options
Fox.Options.add('calendar', {
timeWheelStep: 60,
// JSON.parse() converts string 'true' / 'false' into boolean value
rtl: JSON.parse("false")
});
Fox.Options.add('chosen', {
disable_search_threshold: 1,
allow_single_deselect: true,
no_results_text: Fox.Strings['COM_FOXCONTACT_NO_RESULTS_MATCH']
});
})();
// Emulate "placeholder" feature on outdated browsers
window.addEvent('domready', function ()
{
// Create a new input object, then test if the placeholder attribute is an option inside that object.
// It will be an option in browsers that support placeholder text, and absent in those that don’t.
if (!('placeholder' in document.createElement('input')))
{
Asset.javascript('' + '/media/com_foxcontact/js/placeholder.min.js');
}
});
// Called by the Reset button
function ResetFoxControls()
{
// Reset each dropdown to its first value
$$(".fox_select").each(
function (value, index)
{
// Search for the first option, select it and force a refresh
$(value).selectedIndex = 0;
// Equivalent code
//$(value)[0].set("selected", "selected");
$(value).fireEvent('liszt:updated');
});
}
/* Captcha begin */
function ReloadFCaptcha(id)
{
var image = document.getElementById(id);
// Generates a unique id with an 8 digits fixed length
var uniqueid = Math.floor(Math.random() * Math.pow(10, 8));
image.src = image.src.replace(/uniqueid=[0-9]{8}/, "uniqueid=" + uniqueid);
}
function BuildReloadButton(id)
{
document.getElementById(id).src = document.getElementById(id).src.replace("transparent.gif", "reload-16.png");
}
/* Captcha end */
/* Enable the following function if you want to enable autofocus to the first input of the first form in the page */
/*
window.addEvent('domready', function ()
{
$$('.fox_form')[0].getElement('input[type=text]').focus();
});
*/