if (typeof Fox == 'undefined') { Fox = {}; Fox.Strings = { add: function (object) { jQuery.extend(this, object); return this; } }; Fox.Options = { // Fox.Options.add('key', {...}); add: function (key, data) { var o = {}; o[key] = data; jQuery.extend(this, o); return this; }, // Return by copy: Fox.Options.get('key'); // Return by reference: Fox.Options['key']; get: function (key) { return jQuery.extend({}, this[key]); } }; } (function () { Fox.Strings.add( { JCANCEL: 'Скасувати', COM_FOXCONTACT_BROWSE_FILES: 'Огляд', COM_FOXCONTACT_FAILED: 'Помилка', COM_FOXCONTACT_SUCCESS: 'Успішно', COM_FOXCONTACT_NO_RESULTS_MATCH: 'No results match', COM_FOXCONTACT_REMOVE_ALT: 'Видалити', COM_FOXCONTACT_REMOVE_TITLE: 'Видалити файл' } ); Date.monthNames = ['січня', 'лютого', 'березня', 'квітня', 'травня', 'червня', 'липня', 'серпня', 'вересня', 'жовтня', 'листопада', 'грудня']; Date.dayNames = ['Неділя', 'Понеділок', 'Вівторок', 'Середа', 'Четвер', 'П'ятниця', 'Субота']; Date.monthNumbers = { 'січня': 0, 'лютого': 1, 'березня': 2, 'квітня': 3, 'травня': 4, 'червня': 5, 'липня': 6, 'серпня': 7, 'вересня': 8, 'жовтня': 9, 'листопада': 10, 'грудня': 11 }; // Calendar default options Fox.Options.add('calendar', { dayOfWeekStart: 1, lang: 'dynamic', step: 60, i18n: { dynamic: { months: Date.monthNames, dayOfWeek: ['Нд.', 'Пн.', 'Вт.', 'Ср.', 'Чт.', 'Пт.', 'Сб.'] } } }); Fox.Options.add('chosen', { disable_search_threshold: 10, allow_single_deselect: true, no_results_text: Fox.Strings['COM_FOXCONTACT_NO_RESULTS_MATCH'] }); })(); // Emulate "placeholder" feature on outdated browsers jQuery(document).ready(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'))) { $.getScript('' + '/media/com_foxcontact/js/placeholder.min.js'); } }); // Called by the Reset button function ResetFoxControls() { // Reset each dropdown to its first value jQuery('select.fox_select').each( function (index, value) { // Search for the first option, select it and force a refresh jQuery(value).find('option:first-child').prop('selected', true).end().trigger('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 */ /* jQuery(document).ready(function ($) { jQuery('.fox_form').find('input[type=text]').filter(':visible:first').focus(); }); */