diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d8fe4fa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/.project diff --git a/jquery.weekcalendar.js b/jquery.weekcalendar.js index 681715b..19a6724 100644 --- a/jquery.weekcalendar.js +++ b/jquery.weekcalendar.js @@ -1,24 +1,24 @@ /* - * jQuery.weekCalendar v2.0-dev - * - * for support join us at the google group: - * - http://groups.google.com/group/jquery-week-calendar - * have a look to the wiki for documentation: - * - http://wiki.github.com/themouette/jquery-week-calendar/ - * something went bad ? report an issue: - * - http://github.com/themouette/jquery-week-calendar/issues - * get the last version on github: - * - http://github.com/themouette/jquery-week-calendar - * - * Copyright (c) 2009 Rob Monie - * Copyright (c) 2010 Julien MUETTON - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - * - * If you're after a monthly calendar plugin, check out this one : - * http://arshaw.com/fullcalendar/ - */ +* jQuery.weekCalendar v2.0-dev +* +* for support join us at the google group: +* - http://groups.google.com/group/jquery-week-calendar +* have a look to the wiki for documentation: +* - http://wiki.github.com/themouette/jquery-week-calendar/ +* something went bad ? report an issue: +* - http://github.com/themouette/jquery-week-calendar/issues +* get the last version on github: +* - http://github.com/themouette/jquery-week-calendar +* +* Copyright (c) 2009 Rob Monie +* Copyright (c) 2010 Julien MUETTON +* Dual licensed under the MIT and GPL licenses: +* http://www.opensource.org/licenses/mit-license.php +* http://www.gnu.org/licenses/gpl.html +* +* If you're after a monthly calendar plugin, check out this one : +* http://arshaw.com/fullcalendar/ +*/ (function($) { // check the jquery version @@ -29,6 +29,15 @@ var _currentAjaxCall; return { options: { +//** storeCalParamsInSessionFunction - default null or should be an external function to keep temporary cal params in session when user go back to calendar + storeCalParamsInSessionFunction: null, +//** jqueryUI Datepicker - default + datepicker: {}, +//** UsersCombo - default + showUsersCombo: false, + usersComboUser: null, + usersComboAllUsersEntry: 'All', +//** date: new Date(), timeFormat: null, dateFormat: 'M d, Y', @@ -63,7 +72,7 @@ }, switchDisplay: {}, scrollToHourMillis: 500, - allowEventDelete: false, + allowEventDelete: false, allowCalEventOverlap: false, overlapEventsSeparate: false, totalEventsWidthPercentInOneColumn : 100, @@ -78,7 +87,7 @@ resizable: function(calEvent, element) { return true; }, - eventClick: function(calEvent, element, dayFreeBusyManager, + eventClick: function(calEvent, element, dayFreeBusyManager, calendar, clickEvent) { }, eventRender: function(calEvent, element) { @@ -96,17 +105,17 @@ }, eventResize: function(calEvent, element) { }, - eventNew: function(calEvent, element, dayFreeBusyManager, + eventNew: function(calEvent, element, dayFreeBusyManager, calendar, mouseupEvent) { }, eventMouseover: function(calEvent, $event) { }, eventMouseout: function(calEvent, $event) { }, - eventDelete: function(calEvent, element, dayFreeBusyManager, + eventDelete: function(calEvent, element, dayFreeBusyManager, calendar, clickEvent) { calendar.weekCalendar('removeEvent',calEvent.id); - }, + }, calendarBeforeLoad: function(calendar) { }, calendarAfterLoad: function(calendar) { @@ -138,89 +147,89 @@ longDays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], /* multi-users options */ /** - * the available users for calendar. - * if you want to display users separately, enable the - * showAsSeparateUsers option. - * if you provide a list of user and do not enable showAsSeparateUsers - * option, then only the events that belongs to one or several of - * given users will be displayed - * @type {array} - */ + * the available users for calendar. + * if you want to display users separately, enable the + * showAsSeparateUsers option. + * if you provide a list of user and do not enable showAsSeparateUsers + * option, then only the events that belongs to one or several of + * given users will be displayed + * @type {array} + */ users: [], /** - * should the calendar be displayed with separate column for each - * users. - * note that this option does nothing if you do not provide at least - * one user. - * @type {boolean} - */ + * should the calendar be displayed with separate column for each + * users. + * note that this option does nothing if you do not provide at least + * one user. + * @type {boolean} + */ showAsSeparateUsers: true, /** - * callback used to read user id from a user object. - * @param {Object} user the user to retrieve the id from. - * @param {number} index the user index from user list. - * @param {jQuery} calendar the calendar object. - * @return {int|String} the user id. - */ + * callback used to read user id from a user object. + * @param {Object} user the user to retrieve the id from. + * @param {number} index the user index from user list. + * @param {jQuery} calendar the calendar object. + * @return {int|String} the user id. + */ getUserId: function(user, index, calendar) { return index; }, /** - * callback used to read user name from a user object. - * @param {Object} user the user to retrieve the name from. - * @param {number} index the user index from user list. - * @param {jQuery} calendar the calendar object. - * @return {String} the user name. - */ + * callback used to read user name from a user object. + * @param {Object} user the user to retrieve the name from. + * @param {number} index the user index from user list. + * @param {jQuery} calendar the calendar object. + * @return {String} the user name. + */ getUserName: function(user, index, calendar) { return user; }, /** - * reads the id(s) of user(s) for who the event should be displayed. - * @param {Object} calEvent the calEvent to read informations from. - * @param {jQuery} calendar the calendar object. - * @return {number|String|Array} the user id(s) to appened events for. - */ + * reads the id(s) of user(s) for who the event should be displayed. + * @param {Object} calEvent the calEvent to read informations from. + * @param {jQuery} calendar the calendar object. + * @return {number|String|Array} the user id(s) to appened events for. + */ getEventUserId: function(calEvent, calendar) { return calEvent.userId; }, /** - * sets user id(s) to the calEvent - * @param {Object} calEvent the calEvent to set informations to. - * @param {jQuery} calendar the calendar object. - * @return {Object} the calEvent with modified user id. - */ + * sets user id(s) to the calEvent + * @param {Object} calEvent the calEvent to set informations to. + * @param {jQuery} calendar the calendar object. + * @return {Object} the calEvent with modified user id. + */ setEventUserId: function(userId, calEvent, calendar) { calEvent.userId = userId; return calEvent; }, /* freeBusy options */ /** - * should the calendar display freebusys ? - * @type {boolean} - */ + * should the calendar display freebusys ? + * @type {boolean} + */ displayFreeBusys: false, /** - * read the id(s) for who the freebusy is available - * @param {Object} calEvent the calEvent to read informations from. - * @param {jQuery} calendar the calendar object. - * @return {number|String|Array} the user id(s) to appened events for. - */ + * read the id(s) for who the freebusy is available + * @param {Object} calEvent the calEvent to read informations from. + * @param {jQuery} calendar the calendar object. + * @return {number|String|Array} the user id(s) to appened events for. + */ getFreeBusyUserId: function(calFreeBusy, calendar) { return calFreeBusy.userId; }, /** - * the default freeBusy object, used to manage default state - * @type {Object} - */ + * the default freeBusy object, used to manage default state + * @type {Object} + */ defaultFreeBusy: {free: false}, /** - * function used to display the freeBusy element - * @type {Function} - * @param {Object} freeBusy the freeBusy timeslot to render. - * @param {jQuery} $freeBusy the freeBusy HTML element. - * @param {jQuery} calendar the calendar element. - */ + * function used to display the freeBusy element + * @type {Function} + * @param {Object} freeBusy the freeBusy timeslot to render. + * @param {jQuery} $freeBusy the freeBusy HTML element. + * @param {jQuery} calendar the calendar element. + */ freeBusyRender: function(freeBusy, $freeBusy, calendar) { if (!freeBusy.free) { $freeBusy.addClass('free-busy-busy'); @@ -232,160 +241,173 @@ }, /* other options */ /** - * true means start on first day of week, false means starts on - * startDate. - * @param {jQuery} calendar the calendar object. - * @type {Function|bool} - */ + * true means start on first day of week, false means starts on + * startDate. + * @param {jQuery} calendar the calendar object. + * @type {Function|bool} + */ startOnFirstDayOfWeek: function(calendar) { return $(calendar).weekCalendar('option', 'daysToShow') >= 5; }, /** - * should the columns be rendered alternatively using odd/even - * class - * @type {boolean} - */ + * should the columns be rendered alternatively using odd/even + * class + * @type {boolean} + */ displayOddEven: false, textSize: 13, /** - * the title attribute for the calendar. possible placeholders are: - * - * @type {Function|string} - * @param {number} option daysToShow. - * @return {String} the title attribute for the calendar. - */ + * the title attribute for the calendar. possible placeholders are: + * + * @type {Function|string} + * @param {number} option daysToShow. + * @return {String} the title attribute for the calendar. + */ title: '%start% - %end%', /** - * default options to pass to callback - * you can pass a function returning an object or a litteral object - * @type {object|function(#calendar)} - */ + * default options to pass to callback + * you can pass a function returning an object or a litteral object + * @type {object|function(#calendar)} + */ jsonOptions: {}, headerSeparator: '
', /** - * returns formatted header for day display - * @type {function(date,calendar)} - */ + * returns formatted header for day display + * @type {function(date,calendar)} + */ getHeaderDate: null, preventDragOnEventCreation: false, /** - * the event on which to bind calendar resize - * @type {string} - */ + * the event on which to bind calendar resize + * @type {string} + */ resizeEvent: 'resize.weekcalendar' }, /*********************** - * Initialise calendar * - ***********************/ + * Initialise calendar * + ***********************/ _create: function() { var self = this; +//** storeCalParamsInSessionFunction - initialize default values if function while calendar is initialized + if ($.isFunction(self.options.storeCalParamsInSessionFunction)) { + self.options.storeCalParamsInSessionFunction(0, null, self); + } +//** self._computeOptions(); self._setupEventDelegation(); - self._renderCalendar(); - self._loadCalEvents(); - self._resizeCalendar(); - self._scrollToHour(self.options.date.getHours(), true); - - if (this.options.resizeEvent) { - $(window).unbind(this.options.resizeEvent); - $(window).bind(this.options.resizeEvent, function() { - self._resizeCalendar(); - }); - } - +//** Rebuild calendar refactoring + self._rebuildCalendar(self.options.date.getHours(), true); //this function has been added and replaced a set of functions as reuse refactoring +//** }, /******************** - * public functions * - ********************/ + * public functions * + ********************/ /* - * Refresh the events for the currently displayed week. - */ + * Refresh the events for the currently displayed week. + */ refresh: function() { //reload with existing week this._loadCalEvents(this.element.data('startDate')); }, /* - * Clear all events currently loaded into the calendar - */ + * Clear all events currently loaded into the calendar + */ clear: function() { this._clearCalendar(); }, /* - * Go to this week - */ + * Go to this week + */ today: function() { this._clearCalendar(); this._loadCalEvents(new Date()); +//** jqueryUI Datepicker - fill input with correct date + this.element.find('#wc-datepicker-date').val(this._formatDate(this.options.date, "Y-m-d")); +//** }, /* - * Go to the previous week relative to the currently displayed week - */ + * Go to the previous week relative to the currently displayed week + */ prevWeek: function() { //minus more than 1 day to be sure we're in previous week - account for daylight savings or other anomolies var newDate = new Date(this.element.data('startDate').getTime() - (MILLIS_IN_WEEK / 6)); this._clearCalendar(); this._loadCalEvents(newDate); +//** jqueryUI Datepicker - fill input with correct date + this.element.find('#wc-datepicker-date').val(this._formatDate(this.options.date, "Y-m-d")); +//** }, /* - * Go to the next week relative to the currently displayed week - */ + * Go to the next week relative to the currently displayed week + */ nextWeek: function() { //add 8 days to be sure of being in prev week - allows for daylight savings or other anomolies var newDate = new Date(this.element.data('startDate').getTime() + MILLIS_IN_WEEK + MILLIS_IN_DAY); this._clearCalendar(); this._loadCalEvents(newDate); +//** jqueryUI Datepicker - fill input with correct date + this.element.find('#wc-datepicker-date').val(this._formatDate(this.options.date, "Y-m-d")); +//** }, /* - * Reload the calendar to whatever week the date passed in falls on. - */ + * Reload the calendar to whatever week the date passed in falls on. + */ gotoWeek: function(date) { this._clearCalendar(); this._loadCalEvents(date); +//** jqueryUI Datepicker - fill input with correct date + this.element.find('#wc-datepicker-date').val(this._formatDate(this.options.date, "Y-m-d")); +//** }, /* - * Reload the calendar to whatever week the date passed in falls on. - */ + * Reload the calendar to whatever week the date passed in falls on. + */ gotoDate: function(date) { this._clearCalendar(); this._loadCalEvents(date); +//** jqueryUI Datepicker - fill input with correct date + this.element.find('#wc-datepicker-date').val(this._formatDate(this.options.date, "Y-m-d")); +//** }, /** - * change the number of days to show - */ + * change the number of days to show + */ setDaysToShow: function(daysToShow) { var self = this; var hour = self._getCurrentScrollHour(); - self.options.daysToShow = daysToShow; +//** storeCalParamsInSessionFunction - call a function if present + var options = self.options; + if ($.isFunction(self.options.storeCalParamsInSessionFunction)) { + //if delegate is set, it calls defined function (the function should also set options.daysToShow param) + options.storeCalParamsInSessionFunction(daysToShow, self.options.usersComboUser, self); + } + else { + //if no delegate, we set new daysToShow + self.options.daysToShow = daysToShow; + } +//** $(self.element).html(''); - self._renderCalendar(); - self._loadCalEvents(); - self._resizeCalendar(); - self._scrollToHour(hour, false); - - if (this.options.resizeEvent) { - $(window).unbind(this.options.resizeEvent); - $(window).bind(this.options.resizeEvent, function() { - self._resizeCalendar(); - }); - } +//** Rebuild calendar refactoring + self._rebuildCalendar(hour, false); +//** }, /* - * Remove an event based on it's id - */ + * Remove an event based on it's id + */ removeEvent: function(eventId) { var self = this; @@ -404,9 +426,9 @@ }, /* - * Removes any events that have been added but not yet saved (have no id). - * This is useful to call after adding a freshly saved new event. - */ + * Removes any events that have been added but not yet saved (have no id). + * This is useful to call after adding a freshly saved new event. + */ removeUnsavedEvents: function() { var self = this; @@ -422,19 +444,19 @@ }, /* - * update an event in the calendar. If the event exists it refreshes - * it's rendering. If it's a new event that does not exist in the calendar - * it will be added. - */ + * update an event in the calendar. If the event exists it refreshes + * it's rendering. If it's a new event that does not exist in the calendar + * it will be added. + */ updateEvent: function(calEvent) { this._updateEventInCalendar(calEvent); }, /* - * Returns an array of timeslot start and end times based on - * the configured grid of the calendar. Returns in both date and - * formatted time based on the 'timeFormat' config option. - */ + * Returns an array of timeslot start and end times based on + * the configured grid of the calendar. Returns in both date and + * formatted time based on the 'timeFormat' config option. + */ getTimeslotTimes: function(date) { var options = this.options; var firstHourDisplayed = options.businessHours.limitDisplay ? options.businessHours.start : 0; @@ -494,6 +516,9 @@ this._clearCalendar(); this._loadCalEvents(newDate); +//** jqueryUI Datepicker - fill input with correct date + this.element.find('#wc-datepicker-date').val(this._formatDate(this.options.date, "Y-m-d")); +//** }, prev: function() { @@ -505,6 +530,9 @@ this._clearCalendar(); this._loadCalEvents(newDate); +//** jqueryUI Datepicker - fill input with correct date + this.element.find('#wc-datepicker-date').val(this._formatDate(this.options.date, "Y-m-d")); +//** }, getCurrentFirstDay: function() { return this._dateFirstDayOfWeek(this.options.date || new Date()); @@ -514,8 +542,24 @@ }, /********************* - * private functions * - *********************/ + * private functions * + *********************/ +//** Rebuild calendar - reuse refactoring + _rebuildCalendar: function(hours, scroll) { + var self = this; + self._renderCalendar(); + self._loadCalEvents(); + self._resizeCalendar(); + self._scrollToHour(hours, scroll); + + if (self.options.resizeEvent) { + $(window).unbind(self.options.resizeEvent); + $(window).bind(self.options.resizeEvent, function() { + self._resizeCalendar(); + }); + } + }, +//** _setOption: function(key, value) { var self = this; if (self.options[key] != value) { @@ -554,8 +598,8 @@ }, /* - * Resize the calendar scrollable height based on the provided function in options. - */ + * Resize the calendar scrollable height based on the provided function in options. + */ _resizeCalendar: function() { var options = this.options; if (options && $.isFunction(options.height)) { @@ -584,9 +628,9 @@ }, /* - * configure calendar interaction events that are able to use event - * delegation for greater efficiency - */ + * configure calendar interaction events that are able to use event + * delegation for greater efficiency + */ _setupEventDelegation: function() { var self = this; var options = this.options; @@ -599,11 +643,11 @@ var $calEvent = $target.hasClass('wc-cal-event') ? $target : $target.parents('.wc-cal-event'); if ($calEvent.length) { freeBusyManager = self.getFreeBusyManagerForEvent($calEvent.data('calEvent')); - if (options.allowEventDelete && $target.hasClass('wc-cal-event-delete')) { - options.eventDelete($calEvent.data('calEvent'), $calEvent, freeBusyManager, self.element, event); - }else{ - options.eventClick($calEvent.data('calEvent'), $calEvent, freeBusyManager, self.element, event); - } +if (options.allowEventDelete && $target.hasClass('wc-cal-event-delete')) { +options.eventDelete($calEvent.data('calEvent'), $calEvent, freeBusyManager, self.element, event); +}else{ +options.eventClick($calEvent.data('calEvent'), $calEvent, freeBusyManager, self.element, event); +} } }).mouseover(function(event) { var $target = $(event.target); @@ -628,15 +672,15 @@ }, /* - * check if a ui draggable or resizable is currently being dragged or resized - */ + * check if a ui draggable or resizable is currently being dragged or resized + */ _isDraggingOrResizing: function($target) { return $target.hasClass('ui-draggable-dragging') || $target.hasClass('ui-resizable-resizing'); }, /* - * Render the main calendar layout - */ + * Render the main calendar layout + */ _renderCalendar: function() { var $calendarContainer, $weekDayColumns; var self = this; @@ -664,8 +708,8 @@ }, /** - * render the nav buttons on top of the calendar - */ + * render the nav buttons on top of the calendar + */ _renderCalendarButtons: function($calendarContainer) { var self = this, options = this.options; if (options.buttons) { @@ -678,14 +722,23 @@ calendarNavHtml += ''; calendarNavHtml += ''; calendarNavHtml += ''; +//** jqueryUI Datepicker - input create + if(this.options.datepicker != null) { + calendarNavHtml += ''; + $.each(this.options.users, function(index, value) { + _input += ''; + }); + _input += ''; + _input += '  '; + $container.append(_input); + $usersCombo = $calendarContainer.find('#wc-user-combo'); + $usersCombo.change(function() { + self._switchCalViewForUser(); + }); + $usersCombo.val(this.options.usersComboUser); + } +//** + // now add buttons to switch display if (this.options.switchDisplay && $.isPlainObject(this.options.switchDisplay)) { var $container = $calendarContainer.find('.wc-display'); @@ -734,6 +807,19 @@ $calendarContainer.find('.wc-title') .height(_height) .css('line-height', _height + 'px'); +//** jqueryUI Datepicker - initialize widged and set isodate filter + if(this.options.datepicker != null) { + var isoDateRegExp = /^\d{4}\-\d{2}\-\d{2}$/; + $.datepicker.setDefaults(this.options.datepicker); + $calendarDatepicker = $calendarContainer.find('#wc-datepicker-date'); + $calendarDatepicker.datepicker(); + $calendarDatepicker.change(function() { + if(isoDateRegExp.test($(this).val())) { + self.gotoWeek($(this).val()); + } + }); + } +//** }else{ var calendarNavHtml = ''; calendarNavHtml += '
'; @@ -745,9 +831,17 @@ }, /** - * render the calendar header, including date and user header - */ + * render the calendar header, including date and user header + */ _renderCalendarHeader: function($calendarContainer) { +//** usersComboUser - show user in separate columns depeding on usersComboUser content + if(this.options.showUsersCombo && this.options.usersComboUser != 'null' && this.options.usersComboUser !== null) { + this.options.showAsSeparateUsers = false; + } + else { + this.options.showAsSeparateUsers = true; + } +//** var self = this, options = this.options, showAsSeparatedUser = options.showAsSeparateUsers && options.users && options.users.length, rowspan = '', colspan = '', calendarHeaderHtml; @@ -787,9 +881,9 @@ _headerClass = _headerClass.join(' '); } calendarHeaderHtml += ''; -// calendarHeaderHtml+= "
"; +// calendarHeaderHtml+= "
"; calendarHeaderHtml += self._getUserName(j); -// calendarHeaderHtml+= "
"; +// calendarHeaderHtml+= "
"; calendarHeaderHtml += ''; } } @@ -802,11 +896,11 @@ }, /** - * render the calendar body. - * Calendar body is composed of several distinct parts. - * Each part is displayed in a separated row to ease rendering. - * for further explanations, see each part rendering function. - */ + * render the calendar body. + * Calendar body is composed of several distinct parts. + * Each part is displayed in a separated row to ease rendering. + * for further explanations, see each part rendering function. + */ _renderCalendarBody: function($calendarContainer) { var self = this, options = this.options, showAsSeparatedUser = options.showAsSeparateUsers && options.users && options.users.length, @@ -834,8 +928,8 @@ $calendarContainer.find('.wc-time-slot').height(options.timeslotHeight - 1); //account for border //init the time row header height /** - TODO if total height for an hour is less than 11px, there is a display problem. - Find a way to handle it + TODO if total height for an hour is less than 11px, there is a display problem. + Find a way to handle it */ $calendarContainer.find('.wc-time-header-cell').css({ height: (options.timeslotHeight * options.timeslotsPerHour) - 11, @@ -853,8 +947,8 @@ }, /** - * render the timeslots separation - */ + * render the timeslots separation + */ _renderCalendarBodyTimeSlots: function($calendarTableTbody) { var options = this.options, renderRow, i, j, @@ -895,8 +989,8 @@ }, /** - * render the odd even columns - */ + * render the odd even columns + */ _renderCalendarBodyOddEven: function($calendarTableTbody) { if (this.options.displayOddEven) { var options = this.options, @@ -935,8 +1029,8 @@ }, /** - * render the freebusy placeholders - */ + * render the freebusy placeholders + */ _renderCalendarBodyFreeBusy: function($calendarTableTbody) { if (this.options.displayFreeBusys) { var self = this, options = this.options, @@ -976,8 +1070,8 @@ }, /** - * render the calendar body for event placeholders - */ + * render the calendar body for event placeholders + */ _renderCalendarBodyEvents: function($calendarTableTbody) { var self = this, options = this.options, renderRow, @@ -1039,8 +1133,8 @@ }, /* - * setup mouse events for capturing new events - */ + * setup mouse events for capturing new events + */ _setupEventCreationForWeekDay: function($weekDay) { var self = this; var options = this.options; @@ -1122,19 +1216,19 @@ 'createdFromSingleClick': createdFromSingleClick, 'calendar': self.element }); - if (proceed) { - options.eventNew(newCalEvent, $renderedCalEvent, freeBusyManager, self.element, event); - } - else { - $($renderedCalEvent).remove(); - } + if (proceed) { + options.eventNew(newCalEvent, $renderedCalEvent, freeBusyManager, self.element, event); + } + else { + $($renderedCalEvent).remove(); + } } }); }, /* - * load calendar events for the week based on the date provided - */ + * load calendar events for the week based on the date provided + */ _loadCalEvents: function(dateWithinWeek) { var date, weekStartDate, weekEndDate, $weekDayColumns; @@ -1225,13 +1319,11 @@ } self._disableTextSelect($weekDayColumns); - - }, /* - * update the display of each day column header based on the calendar week - */ + * update the display of each day column header based on the calendar week + */ _updateDayColumnHeader: function($weekDayColumns) { var self = this; var options = this.options; @@ -1311,8 +1403,8 @@ }, /* - * gets the calendar title options - */ + * gets the calendar title options + */ _getCalendarTitle: function() { if ($.isFunction(this.options.title)) { return this.options.title(this.options.daysToShow); @@ -1320,14 +1412,58 @@ return this.options.title; }, +//** UsersCombo - function called from selector's onchange + _switchCalViewForUser: function() { + var self = this; + var comboUserValue = self.element.find('#wc-user-combo').val(); + if (comboUserValue != 'null' && comboUserValue !== null) { + self.options.showAsSeparateUsers = false; + } + else { + self.options.showAsSeparateUsers = true; + } + self.options.usersComboUser = comboUserValue; + $(self.element).html(''); + self._rebuildCalendar(self._getCurrentScrollHour(), false); + }, +//** + /* - * Render the events into the calendar - */ + * Render the events into the calendar + */ _renderEvents: function(data, $weekDayColumns) { var self = this; var options = this.options; var eventsToRender; +//** UsersCombo - render events for user + var userValue = self.options.usersComboUser; + if (self.options.showUsersCombo && $.isArray(data)) { + //if event comes from UsersCombo + if (userValue != 'null' && userValue !== null) { + var arrayIndex = 0; + while(arrayIndex < data.length) { + if(data[arrayIndex].userId != userValue) { + data.splice(arrayIndex, 1); + } + else { + arrayIndex++; + } + } + //if function is defined to store calendar params in session + if ($.isFunction(self.options.storeCalParamsInSessionFunction)) { + self.options.storeCalParamsInSessionFunction(self.options.daysToShow, userValue, self); + } + } + //if event comes from refeshing calendar (and session parameter) + else { + if ($.isFunction(self.options.storeCalParamsInSessionFunction)) { + self.options.storeCalParamsInSessionFunction(self.options.daysToShow, userValue, self); + } + } + } +//** + if (data.options) { var updateLayout = false; //update options @@ -1417,9 +1553,9 @@ }, /* - * Render a specific event into the day provided. Assumes correct - * day for calEvent date - */ + * Render a specific event into the day provided. Assumes correct + * day for calEvent date + */ _renderEvent: function(calEvent, $weekDay) { var self = this; var options = this.options; @@ -1506,8 +1642,8 @@ /* - * Find groups of overlapping events - */ + * Find groups of overlapping events + */ _groupOverlappingEventElements: function($weekDay) { var $events = $weekDay.find('.wc-cal-event:visible'); var sortedEvents = $events.sort(function(a, b) { @@ -1558,8 +1694,8 @@ /* - * find the weekday in the current calendar that the calEvent falls within - */ + * find the weekday in the current calendar that the calEvent falls within + */ _findWeekDayForEvent: function(calEvent, $weekDayColumns) { var $weekDay, @@ -1589,8 +1725,8 @@ }, /* - * update the events rendering in the calendar. Add if does not yet exist. - */ + * update the events rendering in the calendar. Add if does not yet exist. + */ _updateEventInCalendar: function(calEvent) { var self = this; self._cleanEvent(calEvent); @@ -1599,7 +1735,7 @@ self.element.find('.wc-cal-event').each(function() { if ($(this).data('calEvent').id === calEvent.id || $(this).hasClass('wc-new-cal-event')) { $(this).remove(); - // return false; + // return false; } }); } @@ -1618,8 +1754,8 @@ }, /* - * Position the event element within the weekday based on it's start / end dates. - */ + * Position the event element within the weekday based on it's start / end dates. + */ _positionEvent: function($weekDay, $calEvent) { var options = this.options; var calEvent = $calEvent.data('calEvent'); @@ -1634,10 +1770,10 @@ }, /* - * Determine the actual start and end times of a calevent based on it's - * relative position within the weekday column and the starting hour of the - * displayed calendar. - */ + * Determine the actual start and end times of a calevent based on it's + * relative position within the weekday column and the starting hour of the + * displayed calendar. + */ _getEventDurationFromPositionedEventElement: function($weekDay, $calEvent, top) { var options = this.options; var startOffsetMillis = options.businessHours.limitDisplay ? options.businessHours.start * 3600000 : 0; @@ -1647,11 +1783,11 @@ }, /* - * If the calendar does not allow event overlap, adjust the start or end date if necessary to - * avoid overlapping of events. Typically, shortens the resized / dropped event to it's max possible - * duration based on the overlap. If no satisfactory adjustment can be made, the event is reverted to - * it's original location. - */ + * If the calendar does not allow event overlap, adjust the start or end date if necessary to + * avoid overlapping of events. Typically, shortens the resized / dropped event to it's max possible + * duration based on the overlap. If no satisfactory adjustment can be made, the event is reverted to + * it's original location. + */ _adjustForEventCollisions: function($weekDay, $calEvent, newCalEvent, oldCalEvent, maintainEventDuration) { var options = this.options; @@ -1711,8 +1847,8 @@ }, /* - * Add draggable capabilities to an event - */ + * Add draggable capabilities to an event + */ _addDraggableToCalEvent: function(calEvent, $calEvent) { var options = this.options; $calEvent.draggable({ @@ -1732,8 +1868,8 @@ }, /* - * Add droppable capabilites to weekdays to allow dropping of calEvents only - */ + * Add droppable capabilites to weekdays to allow dropping of calEvents only + */ _addDroppableToWeekDay: function($weekDay) { var self = this; var options = this.options; @@ -1749,9 +1885,9 @@ if (showAsSeparatedUser) { // we may have dragged the event on column with a new user. // nice way to handle that is: - // - get the newly dragged on user - // - check if user is part of the event - // - if yes, nothing changes, if not, find the old owner to remove it and add new one + // - get the newly dragged on user + // - check if user is part of the event + // - if yes, nothing changes, if not, find the old owner to remove it and add new one var newUserId = $weekDay.data('wcUserId'); var userIdList = self._getEventUserId(calEvent); var oldUserId = $(ui.draggable.parents('.wc-day-column-inner').get(0)).data('wcUserId'); @@ -1796,8 +1932,8 @@ }, /* - * Add resizable capabilities to a calEvent - */ + * Add resizable capabilities to a calEvent + */ _addResizableToCalEvent: function(calEvent, $calEvent, $weekDay) { var self = this; var options = this.options; @@ -1829,15 +1965,15 @@ }, /* - * Refresh the displayed details of a calEvent in the calendar - */ + * Refresh the displayed details of a calEvent in the calendar + */ _refreshEventDetails: function(calEvent, $calEvent) { - var suffix = ''; - if (!this.options.readonly && - this.options.allowEventDelete && - this.options.deletable(calEvent,$calEvent)) { - suffix = '
'; - } + var suffix = ''; + if (!this.options.readonly && + this.options.allowEventDelete && + this.options.deletable(calEvent,$calEvent)) { + suffix = '
'; + } $calEvent.find('.wc-time').html(this.options.eventHeader(calEvent, this.element) + suffix); $calEvent.find('.wc-title').html(this.options.eventBody(calEvent, this.element)); $calEvent.data('calEvent', calEvent); @@ -1845,16 +1981,16 @@ }, /* - * Clear all cal events from the calendar - */ + * Clear all cal events from the calendar + */ _clearCalendar: function() { this.element.find('.wc-day-column-inner div').remove(); this._clearFreeBusys(); }, /* - * Scroll the calendar to a specific hour - */ + * Scroll the calendar to a specific hour + */ _scrollToHour: function(hour, animate) { var self = this; var options = this.options; @@ -1885,8 +2021,8 @@ }, /* - * find the hour (12 hour day) for a given hour index - */ + * find the hour (12 hour day) for a given hour index + */ _hourForIndex: function(index) { if (index === 0) { //midnight return 12; @@ -1908,7 +2044,10 @@ }, _amOrPm: function(hourOfDay) { - return hourOfDay < 12 ? 'AM' : 'PM'; +//** changed upper case AM/PM to lower case +// return hourOfDay < 12 ? 'AM' : 'PM'; + return hourOfDay < 12 ? 'am' : 'pm'; +//** }, _isToday: function(date) { @@ -1920,8 +2059,8 @@ }, /* - * Clean events to ensure correct format - */ + * Clean events to ensure correct format + */ _cleanEvents: function(events) { var self = this; $.each(events, function(i, event) { @@ -1931,8 +2070,8 @@ }, /* - * Clean specific event - */ + * Clean specific event + */ _cleanEvent: function(event) { if (event.date) { event.start = event.date; @@ -1945,8 +2084,8 @@ }, /* - * Disable text selection of the elements in different browsers - */ + * Disable text selection of the elements in different browsers + */ _disableTextSelect: function($elements) { $elements.each(function() { if ($.browser.mozilla) {//Firefox @@ -1964,8 +2103,8 @@ }, /* - * returns the date on the first millisecond of the week - */ + * returns the date on the first millisecond of the week + */ _dateFirstDayOfWeek: function(date) { var self = this; var midnightCurrentDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); @@ -1976,8 +2115,8 @@ }, /* - * returns the date on the first millisecond of the last day of the week - */ + * returns the date on the first millisecond of the last day of the week + */ _dateLastDayOfWeek: function(date) { var self = this; var midnightCurrentDate = new Date(date.getFullYear(), date.getMonth(), date.getDate()); @@ -1989,9 +2128,9 @@ }, /** - * fix the date if it is not within given options - * minDate and maxDate - */ + * fix the date if it is not within given options + * minDate and maxDate + */ _fixMinMaxDate: function(date) { var minDate, maxDate; date = this._cleanDate(date); @@ -2029,8 +2168,8 @@ }, /* - * gets the index of the current day adjusted based on options - */ + * gets the index of the current day adjusted based on options + */ _getAdjustedDayIndex: function(date) { if (!this._startOnFirstDayOfWeek()) { return 0; @@ -2051,8 +2190,8 @@ }, /* - * returns the date on the last millisecond of the week - */ + * returns the date on the last millisecond of the week + */ _dateLastMilliOfWeek: function(date) { var lastDayOfWeek = this._dateLastDayOfWeek(date); lastDayOfWeek = this._cloneDate(lastDayOfWeek); @@ -2062,9 +2201,9 @@ }, /* - * Clear the time components of a date leaving the date - * of the first milli of day - */ + * Clear the time components of a date leaving the date + * of the first milli of day + */ _clearTime: function(d) { d.setHours(0); d.setMinutes(0); @@ -2074,8 +2213,8 @@ }, /* - * add specific number of days to date - */ + * add specific number of days to date + */ _addDays: function(d, n, keepTime) { d.setDate(d.getDate() + n); if (keepTime) { @@ -2085,8 +2224,8 @@ }, /* - * Rotate an array by specified number of places. - */ + * Rotate an array by specified number of places. + */ _rotate: function(a /*array*/, p /* integer, positive integer rotate to the right, negative to the left... */) { for (var l = a.length, p = (Math.abs(p) >= l && (p %= l), p < 0 && (p += l), p), i, x; p; p = (Math.ceil(l / p) - 1) * p - l + (l = p)) { for (i = l; i > p; x = a[--i], a[i] = a[i - p], a[i - p] = x) {} @@ -2099,8 +2238,8 @@ }, /* - * return a date for different representations - */ + * return a date for different representations + */ _cleanDate: function(d) { if (typeof d == 'string') { // if is numeric @@ -2117,9 +2256,9 @@ }, /* - * date formatting is adapted from - * http://jacwright.com/projects/javascript/date_format - */ + * date formatting is adapted from + * http://jacwright.com/projects/javascript/date_format + */ _formatDate: function(date, format) { var returnStr = ''; for (var i = 0; i < format.length; i++) { @@ -2155,7 +2294,7 @@ n: function(date) { return date.getMonth() + 1; }, t: function(date) { var d = date; return new Date(d.getFullYear(), d.getMonth() + 1, 0).getDate() }, // Fixed now, gets #days of date // Year - L: function(date) { var year = date.getFullYear(); return (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)); }, // Fixed now + L: function(date) { var year = date.getFullYear(); return (year % 400 == 0 || (year % 100 != 0 && year % 4 == 0)); }, // Fixed now o: function(date) { var d = new Date(date.valueOf()); d.setDate(d.getDate() - ((date.getDay() + 6) % 7) + 3); return d.getFullYear();}, //Fixed now Y: function(date) { return date.getFullYear(); }, y: function(date) { return ('' + date.getFullYear()).substr(2); }, @@ -2190,8 +2329,8 @@ }, /** - * return the user name for header - */ + * return the user name for header + */ _getUserName: function(index) { var self = this; var options = this.options; @@ -2204,8 +2343,8 @@ } }, /** - * return the user id for given index - */ + * return the user id for given index + */ _getUserIdFromIndex: function(index) { var self = this; var options = this.options; @@ -2215,8 +2354,8 @@ return index; }, /** - * returns the associated user index for given ID - */ + * returns the associated user index for given ID + */ _getUserIndexFromId: function(id) { var self = this; var options = this.options; @@ -2228,9 +2367,9 @@ return 0; }, /** - * return the user ids for given calEvent. - * default is calEvent.userId field. - */ + * return the user ids for given calEvent. + * default is calEvent.userId field. + */ _getEventUserId: function(calEvent) { var self = this; var options = this.options; @@ -2243,9 +2382,9 @@ return []; }, /** - * sets the event user id on given calEvent - * default is calEvent.userId field. - */ + * sets the event user id on given calEvent + * default is calEvent.userId field. + */ _setEventUserId: function(calEvent, userId) { var self = this; var options = this.options; @@ -2256,9 +2395,9 @@ return calEvent; }, /** - * return the user ids for given freeBusy. - * default is freeBusy.userId field. - */ + * return the user ids for given freeBusy. + * default is freeBusy.userId field. + */ _getFreeBusyUserId: function(freeBusy) { var self = this; var options = this.options; @@ -2271,8 +2410,8 @@ /* FREEBUSY MANAGEMENT */ /** - * ckean the free busy managers and remove all the freeBusy - */ + * ckean the free busy managers and remove all the freeBusy + */ _clearFreeBusys: function() { if (this.options.displayFreeBusys) { var self = this, @@ -2289,8 +2428,8 @@ } }, /** - * retrieve placeholders for given freebusy - */ + * retrieve placeholders for given freebusy + */ _findWeekDaysForFreeBusy: function(freeBusy, $weekDays) { var $returnWeekDays, options = this.options, @@ -2318,8 +2457,8 @@ }, /** - * used to render all freeBusys - */ + * used to render all freeBusys + */ _renderFreeBusys: function(freeBusys) { if (this.options.displayFreeBusys) { var self = this, @@ -2346,13 +2485,13 @@ } }); - //now display freebusys on place holders + //now display freebusys on place holders self._refreshFreeBusys($freeBusyPlaceholders); } }, /** - * refresh freebusys for given placeholders - */ + * refresh freebusys for given placeholders + */ _refreshFreeBusys: function($freeBusyPlaceholders) { if (this.options.displayFreeBusys && $freeBusyPlaceholders) { var self = this, @@ -2374,8 +2513,8 @@ } }, /** - * render a freebusy item on dedicated placeholders - */ + * render a freebusy item on dedicated placeholders + */ _renderFreeBusy: function(freeBusy, $freeBusyPlaceholder) { if (this.options.displayFreeBusys) { var self = this, @@ -2392,8 +2531,8 @@ } }, /* - * Position the freebusy element within the weekday based on it's start / end dates. - */ + * Position the freebusy element within the weekday based on it's start / end dates. + */ _positionFreeBusy: function($placeholder, $freeBusy) { var options = this.options; var freeBusy = $freeBusy.data('wcFreeBusy'); @@ -2406,8 +2545,8 @@ $freeBusy.css({top: pxTop, height: pxHeight}); }, /* - * Clean freebusys to ensure correct format - */ + * Clean freebusys to ensure correct format + */ _cleanFreeBusys: function(freebusys) { var self = this, freeBusyToReturn = []; @@ -2421,8 +2560,8 @@ }, /* - * Clean specific freebusy - */ + * Clean specific freebusy + */ _cleanFreeBusy: function(freebusy) { if (freebusy.date) { freebusy.start = freebusy.date; @@ -2433,8 +2572,8 @@ }, /** - * retrives the first freebusy manager matching demand. - */ + * retrives the first freebusy manager matching demand. + */ getFreeBusyManagersFor: function(date, users) { var calEvent = { start: date, @@ -2444,8 +2583,8 @@ return this.getFreeBusyManagerForEvent(calEvent); }, /** - * retrives the first freebusy manager for given event. - */ + * retrives the first freebusy manager for given event. + */ getFreeBusyManagerForEvent: function(newCalEvent) { var self = this, options = this.options, @@ -2473,9 +2612,9 @@ return freeBusyManager; }, /** - * appends the freebusys to replace the old ones. - * @param {array|object} freeBusys freebusy(s) to apply. - */ + * appends the freebusys to replace the old ones. + * @param {array|object} freeBusys freebusy(s) to apply. + */ updateFreeBusy: function(freeBusys) { var self = this, options = this.options; @@ -2504,15 +2643,15 @@ /* NEW OPTIONS MANAGEMENT */ /** - * checks wether or not the calendar should be displayed starting on first day of week - */ + * checks wether or not the calendar should be displayed starting on first day of week + */ _startOnFirstDayOfWeek: function() { return jQuery.isFunction(this.options.startOnFirstDayOfWeek) ? this.options.startOnFirstDayOfWeek(this.element) : this.options.startOnFirstDayOfWeek; }, /** - * finds out the current scroll to apply it when changing the view - */ + * finds out the current scroll to apply it when changing the view + */ _getCurrentScrollHour: function() { var self = this; var options = this.options; @@ -2545,8 +2684,8 @@ /** - * returns corrected date related to DST problem - */ + * returns corrected date related to DST problem + */ _getDSTdayShift: function(date, shift) { var start = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0); var offset1 = start.getTimezoneOffset(); @@ -2623,9 +2762,9 @@ }; /** - * @constructor - * single user freebusy manager. - */ + * @constructor + * single user freebusy manager. + */ var FreeBusy = function(options) { this.options = $.extend({}, options || {}); }; @@ -2643,14 +2782,14 @@ }; $.extend(FreeBusyManager.prototype, FreeBusyProto, { /** - * return matching freeBusys. - * if you do not pass any argument, returns all freebusys. - * if you only pass a start date, only matchinf freebusy will be returned. - * if you pass 2 arguments, then all freebusys available within the time period will be returned - * @param {Date} start [optionnal] if you do not pass end date, will return the freeBusy within which this date falls. - * @param {Date} end [optionnal] the date where to stop the search. - * @return {Array} an array of FreeBusy matching arguments. - */ + * return matching freeBusys. + * if you do not pass any argument, returns all freebusys. + * if you only pass a start date, only matchinf freebusy will be returned. + * if you pass 2 arguments, then all freebusys available within the time period will be returned + * @param {Date} start [optionnal] if you do not pass end date, will return the freeBusy within which this date falls. + * @param {Date} end [optionnal] the date where to stop the search. + * @return {Array} an array of FreeBusy matching arguments. + */ getFreeBusys: function() { switch (arguments.length) { case 0: @@ -2727,31 +2866,31 @@ var curFreeBusyItem = this; if (curFreeBusyItem.isWithin(start) && curFreeBusyItem.isWithin(end)) { /* - we are in case where inserted freebusy fits in curFreeBusyItem: - curFreeBusyItem: *-----------------------------* - freeBusy: *-------------* - obviously, start and end indexes are this item. + we are in case where inserted freebusy fits in curFreeBusyItem: + curFreeBusyItem: *-----------------------------* + freeBusy: *-------------* + obviously, start and end indexes are this item. */ startIndex = index; endIndex = index; if (start.getTime() == curFreeBusyItem.getStart().getTime() && end.getTime() == curFreeBusyItem.getEnd().getTime()) { /* - in this case, inserted freebusy is exactly curFreeBusyItem: - curFreeBusyItem: *-----------------------------* - freeBusy: *-----------------------------* - - just replace curFreeBusyItem with freeBusy. + in this case, inserted freebusy is exactly curFreeBusyItem: + curFreeBusyItem: *-----------------------------* + freeBusy: *-----------------------------* + + just replace curFreeBusyItem with freeBusy. */ var _f1 = new FreeBusy(freeBusy.getOption()); pushNewFreeBusy(_f1); } else if (start.getTime() == curFreeBusyItem.getStart().getTime()) { /* - in this case inserted freebusy starts with curFreeBusyItem: - curFreeBusyItem: *-----------------------------* - freeBusy: *--------------* - - just replace curFreeBusyItem with freeBusy AND the rest. + in this case inserted freebusy starts with curFreeBusyItem: + curFreeBusyItem: *-----------------------------* + freeBusy: *--------------* + + just replace curFreeBusyItem with freeBusy AND the rest. */ var _f1 = new FreeBusy(freeBusy.getOption()); var _f2 = new FreeBusy(curFreeBusyItem.getOption()); @@ -2761,11 +2900,11 @@ } else if (end.getTime() == curFreeBusyItem.getEnd().getTime()) { /* - in this case inserted freebusy ends with curFreeBusyItem: - curFreeBusyItem: *-----------------------------* - freeBusy: *--------------* - - just replace curFreeBusyItem with before part AND freeBusy. + in this case inserted freebusy ends with curFreeBusyItem: + curFreeBusyItem: *-----------------------------* + freeBusy: *--------------* + + just replace curFreeBusyItem with before part AND freeBusy. */ var _f1 = new FreeBusy(curFreeBusyItem.getOption()); _f1.setOption('end', start); @@ -2775,11 +2914,11 @@ } else { /* - in this case inserted freebusy is within curFreeBusyItem: - curFreeBusyItem: *-----------------------------* - freeBusy: *--------------* - - just replace curFreeBusyItem with before part AND freeBusy AND the rest. + in this case inserted freebusy is within curFreeBusyItem: + curFreeBusyItem: *-----------------------------* + freeBusy: *--------------* + + just replace curFreeBusyItem with before part AND freeBusy AND the rest. */ var _f1 = new FreeBusy(curFreeBusyItem.getOption()); var _f2 = new FreeBusy(freeBusy.getOption()); @@ -2791,18 +2930,18 @@ pushNewFreeBusy(_f3); } /* - as work is done, no need to go further. - return false + as work is done, no need to go further. + return false */ return false; } else if (curFreeBusyItem.isWithin(start) && curFreeBusyItem.getEnd().getTime() != start.getTime()) { /* - in this case, inserted freebusy starts within curFreeBusyItem: - curFreeBusyItem: *----------* - freeBusy: *-------------------* - - set start index AND insert before part, we'll insert freebusy later + in this case, inserted freebusy starts within curFreeBusyItem: + curFreeBusyItem: *----------* + freeBusy: *-------------------* + + set start index AND insert before part, we'll insert freebusy later */ if (curFreeBusyItem.getStart().getTime() != start.getTime()) { var _f1 = new FreeBusy(curFreeBusyItem.getOption()); @@ -2813,11 +2952,11 @@ } else if (curFreeBusyItem.isWithin(end) && curFreeBusyItem.getStart().getTime() != end.getTime()) { /* - in this case, inserted freebusy starts within curFreeBusyItem: - curFreeBusyItem: *----------* - freeBusy: *-------------------* - - set end index AND insert freebusy AND insert after part if needed + in this case, inserted freebusy starts within curFreeBusyItem: + curFreeBusyItem: *----------* + freeBusy: *-------------------* + + set end index AND insert freebusy AND insert after part if needed */ pushNewFreeBusy(new FreeBusy(freeBusy.getOption())); if (end.getTime() < curFreeBusyItem.getEnd().getTime()) { @@ -2840,25 +2979,25 @@ if (endIndex < tmpFB.length) { this.freeBusys = this.freeBusys.concat(tmpFB.slice(endIndex + 1)); } -/* if(start.getDate() == 1){ + /* if(start.getDate() == 1){ console.info('insert from '+freeBusy.getStart() +' to '+freeBusy.getEnd()); - console.log('index from '+ startIndex + ' to ' + endIndex); - var str = []; - $.each(tmpFB, function(i){str.push(i + ": " + this.getStart().getHours() + ' > ' + this.getEnd().getHours() + ' ' + (this.getOption('free') ? 'free' : 'busy'))}); - console.log(str.join('\n')); - - console.log('insert'); - var str = []; - $.each(newFreeBusys, function(i){str.push(this.getStart().getHours() + ' > ' + this.getEnd().getHours())}); - console.log(str.join(', ')); - - console.log('results'); - var str = []; - $.each(this.freeBusys, function(i){str.push(i + ": " + this.getStart().getHours() + ' > ' + this.getEnd().getHours() + ' ' + (this.getOption('free') ? 'free' :'busy'))}); - console.log(str.join('\n')); + console.log('index from '+ startIndex + ' to ' + endIndex); + var str = []; + $.each(tmpFB, function(i){str.push(i + ": " + this.getStart().getHours() + ' > ' + this.getEnd().getHours() + ' ' + (this.getOption('free') ? 'free' : 'busy'))}); + console.log(str.join('\n')); + + console.log('insert'); + var str = []; + $.each(newFreeBusys, function(i){str.push(this.getStart().getHours() + ' > ' + this.getEnd().getHours())}); + console.log(str.join(', ')); + + console.log('results'); + var str = []; + $.each(this.freeBusys, function(i){str.push(i + ": " + this.getStart().getHours() + ' > ' + this.getEnd().getHours() + ' ' + (this.getOption('free') ? 'free' :'busy'))}); + console.log(str.join('\n')); }*/ return this; } }); -})(jQuery); +})(jQuery); \ No newline at end of file diff --git a/kamileczek123_demo/demo.css b/kamileczek123_demo/demo.css new file mode 100755 index 0000000..506cbfa --- /dev/null +++ b/kamileczek123_demo/demo.css @@ -0,0 +1,344 @@ +.wc-container { + font-size: 14px; + font-family: arial, helvetica; + border: 1px solid #ccc; +} + +.wc-toolbar { + font-size: 12px; + padding: 2px 5px; + margin: 0; +} + +.wc-toolbar .wc-nav { + float:left; +} + +/* calendar navigaion button fix */ +.wc-nav .ui-button-icon-only .ui-icon { + left: 1em; +} + +.wc-toolbar .wc-display { + float: right; +} + +.wc-toolbar button { + margin-top: 0; + margin-bottom: 0; +} + +.wc-toolbar .ui-buttonset { + font-size: 0.8em; +} + +.wc-toolbar .wc-title { + text-align: center; + padding: 0; + margin: 0 0 0 100px; +} + +.wc-toolbar h1{ + font-size: 14px; + font-weight: bold; + display: inline; +} + +.wc-container table { + border-collapse: collapse; + border-spacing: 0; +} + +.wc-container table td { + margin: 0; + padding: 0; +} + +.wc-header{ + background: #eee; + border-width:1px 0; + border-style:solid; + font-size: 9px; +} + +.wc-header table{ + width: 100%; + table-layout:fixed; +} + +.wc-grid-timeslot-header, .wc-header .wc-time-column-header { + width: 45px; +} + +.wc-header .wc-scrollbar-shim { + width: 16px; +} + +.wc-header .wc-day-column-header { + text-align: center; + padding: 1px; +} + +.wc-header .wc-user-header{ + text-align: center; + padding: 1px 0; + overflow:hidden; +} + +.wc-grid-timeslot-header { + background: #eee; +} + +.wc-scrollable-grid { + overflow: auto; + overflow-x: hidden !important; + overflow-y: auto !important; + position: relative; + background-color: #fff; + width: 100%; +} + +table.wc-time-slots { + width: 100%; + table-layout: fixed; + cursor: default; + overflow:hidden; +} + +.wc-day-column { + width: 13.5%; + overflow: visible; + vertical-align: top; +} + +.wc-day-column-header{ + border-width: 0 0 1px 3px; + border-style: solid; + border-color:transparent; +} + +.wc-scrollable-grid .wc-day-column-last, .wc-scrollable-grid .wc-day-column-middle{ + border-width: 0 0 0 1px; + border-style: dashed; +} + +.wc-scrollable-grid .wc-day-column-first{ + border-width: 0 0 0 3px; + border-style: ridge; + border-color: #444; +} + +.wc-day-column-inner { + width: 100%; + position:relative; +} + +.wc-no-height-wrapper{ + position:relative; + overflow: visible; + height: 0px; +} + +.wc-time-slot-wrapper { + /* top: 3px;*/ +} +.wc-oddeven-wrapper .wc-full-height-column{ + /* top: 2px; */ + /* Modern Browsers */ opacity: 0.4; + /* IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; + /* IE 5-7 */ filter: alpha(opacity=40); + /* Netscape */ -moz-opacity: 0.4; + /* Safari 1 */ -khtml-opacity: 0.4; +} +.wc-freebusy-wrapper .wc-freebusy{ + /* top: 1px;*/ + /* Modern Browsers */ opacity: 0.4; + /* IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; + /* IE 5-7 */ filter: alpha(opacity=40); + /* Netscape */ -moz-opacity: 0.4; + /* Safari 1 */ -khtml-opacity: 0.4; +} + +.wc-time-slots { + position: absolute; + width: 100%; +} + +.wc-column-odd, .wc-column-even.ui-state-hover { + background-image: none; + border: none; +} + +.wc-column-even { + background-color: #ffff99; +} +.wc-header .wc-today.ui-state-active{ + background-image:none; + background-color: #ff9900; +} +.ui-state-active.wc-today { + background-color: #ff9900; +} + +.wc-header .wc-today.wc-day-column-header{ + border-width:0 1px; + border-style: solid; +} + +.wc-header .wc-user-header{ + border-width: 0; +} + +.wc-time-slots .wc-day-column.ui-state-default{ + background: transparent; +} + +.wc-time-slots .wc-today.ui-state-active{ + background-image: none; +} + +.wc-header .wc-today.ui-state-active.wc-day-column-middle{ + border-width: 0; +} + +.wc-header .wc-today.ui-state-active.wc-day-column-first{ + border-left-width: 1px; +} + +.wc-header .wc-today.ui-state-active.wc-day-column-last{ + border-right-width: 1px; +} + +.wc-full-height-column{ + display:block; + /* width:100%;*/ +} + +.wc-time-header-cell { + padding: 5px; + height: 80px; /* reference height */ + font-size: 11px; + font-weight: bold; +} + +.wc-time-slot { + border-bottom: 1px dotted #ddd; +} + +.wc-hour-header { + text-align: right; +} +.wc-hour-header.ui-state-active, .wc-hour-header.ui-state-default{ + border-width:0 0 1px 0; + background-image: none; +} + +.wc-hour-end, .wc-hour-header { + border-bottom: 1px solid #ccc; + color: #999; +} + +.wc-business-hours { + background-color: #E6EEF1; + border-bottom: 1px solid #ccc; + color: #333; + font-size: 12px; + font-weight: bold; +} + +.wc-day-header-cell { + text-align: center; + vertical-align: middle; + padding: 5px; +} + +.wc-time-slot-header .wc-header-cell { + text-align: right; + padding-right: 10px; +} + +.wc-cal-event { + background-color: #68a1e5; + /* Modern Browsers */ opacity: 0.8; + /* IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + /* IE 5-7 */ filter: alpha(opacity=80); + /* Netscape */ -moz-opacity: 0.8; + /* Safari 1 */ -khtml-opacity: 0.8; + position: absolute; + text-align: center; + overflow: hidden; + cursor: pointer; + color: #fff; + width: 100%; + display: none; +} + +.wc-cal-event.ui-resizable-resizing { + cursor: s-resize; +} + +.wc-cal-event .wc-time { + background-color: #2b72d0; + border: 1px solid #1b62c0; + color: #fff; + padding: 0; + font-weight: normal; + font-size: 8px; + line-height: 10px; + text-align: left; +} + +.wc-container .ui-draggable .wc-time { + cursor: move; +} + +.wc-cal-event .wc-title { + position: relative; + font-size: 8px; + padding: 0px; + margin: 0px; + line-height: 10px; + +} + +.wc-container .ui-resizable-s { + height: 10px; + line-height: 10px; + bottom: -2px; + font-size: .75em; +} + + +.wc-container .ui-draggable-dragging { + z-index: 1000; +} + +.wc-title hr { + border: 0; + width: 90%; + color: #0080FF; + background-color: #0080FF; + height: 1px; + margin-top: 1px; + margin-bottom: 1px; +} + +.free-busy-free{ +} + +.free-busy-busy{ + background:url("./libs/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png") repeat scroll 50% 50% #666666; +} + +/* IE6 hacks */ +* html .wc-no-height-wrapper{position:absolute;} +* html .wc-time-slot-wrapper{top:3px;} +* html .wc-grid-row-oddeven{top:2px;} +* html .wc-grid-row-freebusy{top:1px;} + +/* IE7 hacks */ +*:first-child+html .wc-no-height-wrapper{position:relative;} +*:first-child+html .wc-time-slot-wrapper{top:3px;} +*:first-child+html .wc-grid-row-oddeven{top:2px;} +*:first-child+html .wc-grid-row-freebusy{top:1px;} +*:first-child+html .wc-time-slots .wc-today{/* due to rendering issues, no background */background:none;} diff --git a/kamileczek123_demo/demo.html b/kamileczek123_demo/demo.html new file mode 100644 index 0000000..3a16e33 --- /dev/null +++ b/kamileczek123_demo/demo.html @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + +

jQuery Week Calendar (kamileczek123 demo)

+
+ + diff --git a/kamileczek123_demo/demo.js b/kamileczek123_demo/demo.js new file mode 100644 index 0000000..e13a445 --- /dev/null +++ b/kamileczek123_demo/demo.js @@ -0,0 +1,542 @@ +$(document).ready(function() { + + //example user objects array which would come from web container + var usersJsonArray = { + "jsonStaffArray":[ + {"staffId":3,"userId":0,"userShortName":"BobBoo"}, + {"staffId":6,"userId":1,"userShortName":"MarSmi"}, + {"staffId":2,"userId":2,"userShortName":"MelDoe"} + ]}.jsonStaffArray; + //prepare staff mapping object + $staffIdMappingHash = doStaffIdMapping(usersJsonArray); + //display google calendar like events headers + var googleCalendarLikeEventHeader = true; + var $calendar = $('#calendar'); + + $calendar.weekCalendar({ + eventNew : function(calEvent, $event) { + $('
') + .html( + "" + + "" + + "" + + "" + + "" + + "" + + "
" + + "
" + + "

New input form goes here. Check demo code.

" + + "
" + + "
" + ) + .dialog({ + autoOpen: false, + dialogClass: 'alert', + resizable: false, + modal: true, + width: 460, + open: function(event, ui){ + $('.ui-dialog .ui-dialog-content').css('overflow','hidden'); + $('.ui-widget-overlay').css('width','100%'); + + $('.alert').css('background', 'none'); + $('.alert').css('background-color', '#fff'); + }, + close: function(event, ui){ + $('.ui-dialog .ui-dialog-content').css('overflow','auto'); + $('#calendar').weekCalendar('removeUnsavedEvents'); + $(this).remove(); + }, + show: 'fade', + hide: 'fade' + }); + $('#newEventDialog').dialog('open'); + +//example of ajax call how to use calendar user mapping on objects existing at server side +/* + $.ajax({ + //url to your web server method which will handle calendar's event params and send eg. some event details in + //response - like list of possible tasks, etc. + url: "", + type: "POST", + dataType: "json", + contentType: "application/x-www-form-urlencoded;charset=utf-8", + data: { + //send some event data to server - especially user id mapped from calendar + isoDateStart: calEvent.start.toString('yyyy-MM-dd HH:mm'), + userId: function() { + var usersComboUser = $calendar.weekCalendar("option", "usersComboUser"); + var result = null; + if(usersComboUser != 'null' && usersComboUser !== null) { + result = $staffIdMappingHash.getItem(usersComboUser); + } + else { + result = $staffIdMappingHash.getItem(calEvent.userId); + } + return result; + } + }, + success: function(data) { + //data should return some parameters from server related to new event, it depends what you want to add + //to the event and what logic your event at server side has + $('
') + .html( + "" + + "" + + "" + + "" + + "" + + "" + + "
" + + "
" + + "" + + "
" + + "
" + ) + .dialog({ + autoOpen: false, + dialogClass: 'alert', + resizable: false, + modal: true, + width: 460, + open: function(event, ui){ + $('.ui-dialog .ui-dialog-content').css('overflow','hidden'); + $('.ui-widget-overlay').css('width','100%'); + + $('.alert').css('background', 'none'); + $('.alert').css('background-color', '#fff'); + }, + close: function(event, ui){ + $('.ui-dialog .ui-dialog-content').css('overflow','auto'); + $('#calendar').weekCalendar('removeUnsavedEvents'); + $(this).remove(); + }, + show: 'fade', + hide: 'fade' + }); + $('#newEventDialog').dialog('open'); + }, + error: function() { + alert("Server connection error: getParamsForCalendarEvent."); + }, + statusCode: httpStatusCodes + }) +*/ + }, + date: new Date(), + height: function($calendar){ + return (24 - 6) * 2 * 25 + (3 * 25); + }, + showAsSeparateUsers: true, + timeslotsPerHour: 2, + displayOddEven: true, + timeslotHeight: 25, + firstDayOfWeek: 1, + businessHours: {start: 6, end: 24, limitDisplay: true}, + startOnFirstDayOfWeek: false, + timeFormat: "h:i a", + dateFormat: "d F Y", + use24Hour: false, +//body of this function can store some param from calendar in your web application session object, thus if you +//refresh calendar or go back to it from other page its view will like previously when you left it + storeCalParamsInSessionFunction: function(daysToShow, calendarUser, calendar) { +/* +//example of callback function to store calendar params in web container session + var initDate = 0; + if(daysToShow == 0) { + initDate = calendar.options.date.getTime(); + } + $.ajax({ + async: false, + //url to your web server method which will handle calendar params and put it into session + url: "", + type: "POST", + dataType: "json", + contentType: "application/x-www-form-urlencoded;charset=utf-8", + data: { + calDaysToShowInSession: daysToShow, + calDateInSession: initDate, + calUserToShowInSession: calendar.options.usersComboUser + }, + success: function(data) { + calendar.options.daysToShow = data.calDaysToShowInSession; + calendar.options.date = new Date(data.calDateInSession); + calendar.options.usersComboUser = data.calUserToShowInSession; + }, + error: function() { + alert("Server connection error: setSessionCalendarParameters."); + }, + statusCode: httpStatusCodes + }); +*/ + }, + daysToShow: 7, + data: function(start, end, callback) { + callback(getWrappedEventsArray(getEventData(), usersJsonArray)); +/* +//example of function which retrieves data for event through ajax from web container + $.ajax({ + //block calendar while data for events is retrieved from web server + beforeSend: function() { + $.blockUI({ + css: { + border: 'none', + padding: '15px', + backgroundColor: '#000', + '-webkit-border-radius': '10px', + '-moz-border-radius': '10px', + opacity: .5, + color: '#fff' + }, + message: '

Please wait...

', + fadeIn: 200, + fadeOut: 200, + blockMsgClass: 'blockMsg ui-corner-all' + }); + }, + complete: function() { + $.unblockUI(); + }, + //url to your web server method which will send in response your calendar events based on requested dates + url: "", + type: "POST", + dataType: "json", + contentType: "application/x-www-form-urlencoded;charset=utf-8", + data: { + calStartTimestamp: start.getTime(), + calEndTimestamp: end.getTime() + }, + success: function(data) { + var eventsJsonArray = data.jsonEventsArray; + //remapping events and users from web server into calendar users index + callback(getWrappedEventsArray(eventsJsonArray, usersJsonArray)); + }, + error: function() { + alert("Server connection error: getCalendarEvents."); + }, + statusCode: httpStatusCodes + }); +*/ + }, + //example on how web servers users are remapped into calendar users + users: getWrappedUserNamesArray(usersJsonArray), + showUsersCombo: true, + //initial user in users combo for who the calendar is rendered (mostly taken from session, when calendar is reopen) + //it should replaced at server side on something like this: + //if(usersComboUser != null) {set usersComboUser} else {"null"} + usersComboUser: "null", + //starting element in users combo description + usersComboAllUsersEntry: 'All', + buttons: true, + buttonText: {today : 'today', lastWeek : '<', nextWeek : '>'}, + shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + longMonths: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], + shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + longDays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + headerSeparator: "
", + //definition of google calendar like event header + eventHeader: function(calEvent, calendar) { + var header; + if(googleCalendarLikeEventHeader) { + if($("#calendar").weekCalendar("option", "use24Hour")){ + if(new Date(calEvent.start.getTime()).toString('mm') == '00'){ + header = new Date(calEvent.start.getTime()).toString('H'); + } + else { + header = new Date(calEvent.start.getTime()).toString('H:mm'); + } + if(calEvent.start.getTime() != calEvent.end.getTime()) { + header += " - "; + if(new Date(calEvent.end.getTime()).toString('mm') == '00'){ + header += new Date(calEvent.end.getTime()).toString('H'); + } + else { + header += new Date(calEvent.end.getTime()).toString('H:mm'); + } + } + } + else { + header = new Date(calEvent.start.getTime()).toString('h'); + if(new Date(calEvent.start.getTime()).toString('mm') != '00'){ + header += ":" + new Date(calEvent.start.getTime()).toString('mm'); + } + if(new Date(calEvent.start.getTime()).toString('tt') == 'PM'){ + header += "p"; + } + if(calEvent.start.getTime() != calEvent.end.getTime()) { + header += " - "; + header += new Date(calEvent.end.getTime()).toString('h'); + if(new Date(calEvent.end.getTime()).toString('mm') != '00'){ + header += ":" + new Date(calEvent.end.getTime()).toString('mm'); + } + if(new Date(calEvent.end.getTime()).toString('tt') == 'PM'){ + header += "p"; + } + } + } + } + else { + header = calendar.weekCalendar('formatTime', calEvent.start) + " - " + calendar.weekCalendar('formatTime', calEvent.end); + } + return header; + }, + newEventText: "", + timeSeparator: " ", + allowCalEventOverlap: true, + overlapEventsSeparate: true, + useShortDayNames: false, + title: function(date, calendar) { + return "%date%"; + }, + //datepicker reginal translation + datepicker: $.datepicker.regional['en'], + resizable: function(calEvent, $event) { + return false; + }, + draggable: function(calEvent, $event) { + var d1 = new Date(calEvent.end).clearTime(); + var d2 = new Date().clearTime(); + if(d1 < d2) { + return false; + } + return true; + }, + eventRender: function(calEvent, $event) { + var d1 = new Date(calEvent.end).clearTime(); + var d2 = new Date().clearTime(); + if(d1 < d2) { + $event.find(".wc-time").css({"backgroundColor": "#FF5C55", "border":"1px solid #FF5C55"}); + } + }, + eventClick: function(calEvent, element, freeBusyManager, $calendar, DomEvent) { + $properties = { title: calEvent.title }; + var d1 = new Date(calEvent.end).clearTime(); + var d2 = new Date().clearTime(); + if(d1 < d2) { + $properties = "Non-editable"; + } + else { + $properties = "Editable"; + } + $('
') + .html( + "" + + "" + + "" + + "" + + "" + + "" + + "
" + + "
" + + "

" + $properties + " input form goes here. Check demo code.

" + + "
" + + "
" + ) + .dialog({ + autoOpen: false, + dialogClass: 'alert', + resizable: false, + modal: true, + width: 460, + open: function(event, ui){ + $('.ui-dialog .ui-dialog-content').css('overflow','hidden'); + $('.ui-widget-overlay').css('width','100%'); + + $('.alert').css('background', 'none'); + $('.alert').css('background-color', '#fff'); + }, + close: function(event, ui){ + $('.ui-dialog .ui-dialog-content').css('overflow','auto'); + $('#calendar').weekCalendar('removeUnsavedEvents'); + $(this).remove(); + }, + show: 'fade', + hide: 'fade' + }); + $('#editEventDialog').dialog('open'); + }, + eventDrop: function(calEvent, $event) { +//example how to save moved and dropped event through ajax +/* + $.ajax({ + async: false, + //url to your web server method which will store new calendar's event params + url: "", + type: "POST", + dataType: "json", + contentType: "application/x-www-form-urlencoded;charset=utf-8", + data: { + id: calEvent.id, + isoDateStart: calEvent.start.toString('yyyy-MM-dd HH:mm'), + userId: $staffIdMappingHash.getItem(calEvent.userId) + }, + success: function(data) { + //tweak for response content + data = "OK"; + if(data == 'OK') { + $('#calendar').weekCalendar('refresh'); + } + else { + $('#calendar').weekCalendar('removeUnsavedEvents'); + } + }, + error: function() { + alert("Server connection error: updateCalendarVisit."); + }, + statusCode: httpStatusCodes + }); +*/ + } + }); +}); + +//example events data +function getEventData() { + var year = new Date().getFullYear(); + var month = new Date().getMonth(); + var day = new Date().getDate(); + + return { + jsonEventArray : [ + { + "id":1, + "userId":6, + "start": new Date(year, month, day, 8), + "end": new Date(year, month, day, 10, 30), + "title":"Event 1
Name 1
Description 1" + }, + { + "id":2, + "userId":2, + "start": new Date(year, month, day, 14), + "end": new Date(year, month, day, 14, 45), + "title":"Event 2
Name 2
Description 2" + }, + { + "id":3, + "userId":2, + "start": new Date(year, month, day + 1, 10), + "end": new Date(year, month, day + 1, 11), + "title":"Event 3
Name 3
Description 3" + }, + { + "id":4, + "userId":3, + "start": new Date(year, month, day + 1, 14), + "end": new Date(year, month, day + 1, 14, 30), + "title":"Event 4
Name 4
Description 4" + }, + { + "id":5, + "userId":3, + "start": new Date(year, month, day + 2, 15), + "end": new Date(year, month, day + 2, 16), + "title":"Event 5
Name 5
Description 5" + }, + { + "id":6, + "userId":6, + "start": new Date(year, month, day + 2, 9), + "end": new Date(year, month, day + 2, 11), + "title":"Event 6
Name 6
Description 6" + } + ] + }.jsonEventArray; +} + +function getWrappedUserNamesArray(jsonUsers) { + var usersArray = new Array(); + for(var i=0; i < jsonUsers.length; i++) { + usersArray.push(jsonUsers[i].userShortName); + } + return usersArray; +} + +function getWrappedEventsArray(jsonEvents, jsonUsers) { + var staffIdMappingHash = doStaffIdMapping(jsonUsers); + for(var i=0; i < jsonEvents.length; i++) { + for(var j=0; j < staffIdMappingHash.size(); j++) { + if(staffIdMappingHash.getItem(j) == jsonEvents[i].userId) { + jsonEvents[i].userId = j; + break; + } + } + } + return jsonEvents; +} + +function doStaffIdMapping(jsonUsers) { + var mappedUsersHash = new Hash(); + for(i=0; i < jsonUsers.length; i++) { + mappedUsersHash.setItem(jsonUsers[i].userId, jsonUsers[i].staffId); + } + return mappedUsersHash; +} + +var httpStatusCodes = { + 505: function() { alert('Error 505: HTTP Version Not Supported'); }, + 504: function() { alert('Error 504: Gateway Timeout'); }, + 503: function() { alert('Error 503: Service Unavailable'); }, + 502: function() { alert('Error 502: Bad Gateway'); }, + 501: function() { alert('Error 501: Not Implemented'); }, + 500: function() { alert('Error 500: Internal Server Error'); }, + 408: function() { alert('Error 408: Request Timeout'); }, + 404: function() { alert('Error 404: Page Not Found'); }, + 403: function() { alert('Error 403: Forbidden'); }, + 401: function() { alert('Error 401: Unauthorized'); }, + 400: function() { alert('Error 400: Bad Request'); } + } + +function Hash() { + this.length = 0; + this.items = new Array(); + for (var i = 0; i < arguments.length; i += 2) { + if (typeof(arguments[i + 1]) != 'undefined') { + this.items[arguments[i]] = arguments[i + 1]; + this.length++; + } + } + + this.removeItem = function(in_key) { + var tmp_previous; + if (typeof(this.items[in_key]) != 'undefined') { + this.length--; + var tmp_previous = this.items[in_key]; + delete this.items[in_key]; + } + return tmp_previous; + } + + this.getItem = function(in_key) { + return this.items[in_key]; + } + + this.setItem = function(in_key, in_value) { + var tmp_previous; + if (typeof(in_value) != 'undefined') { + if (typeof(this.items[in_key]) == 'undefined') { + this.length++; + } + else { + tmp_previous = this.items[in_key]; + } + this.items[in_key] = in_value; + } + return tmp_previous; + } + + this.hasItem = function(in_key) { + return typeof(this.items[in_key]) != 'undefined'; + } + + this.clear = function() { + for (var i in this.items) { + delete this.items[i]; + } + this.length = 0; + } + + this.size = function() { + return this.items.length; + } +} \ No newline at end of file diff --git a/kamileczek123_demo/jquery-blockUI-2.39.js b/kamileczek123_demo/jquery-blockUI-2.39.js new file mode 100755 index 0000000..55b52a9 --- /dev/null +++ b/kamileczek123_demo/jquery-blockUI-2.39.js @@ -0,0 +1,499 @@ +/*! + * jQuery blockUI plugin + * Version 2.39 (23-MAY-2011) + * @requires jQuery v1.2.3 or later + * + * Examples at: http://malsup.com/jquery/block/ + * Copyright (c) 2007-2010 M. Alsup + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + * Thanks to Amir-Hossein Sobhi for some excellent contributions! + */ + +;(function($) { + +if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) { + alert('blockUI requires jQuery v1.2.3 or later! You are using v' + $.fn.jquery); + return; +} + +$.fn._fadeIn = $.fn.fadeIn; + +var noOp = function() {}; + +// this bit is to ensure we don't call setExpression when we shouldn't (with extra muscle to handle +// retarded userAgent strings on Vista) +var mode = document.documentMode || 0; +var setExpr = $.browser.msie && (($.browser.version < 8 && !mode) || mode < 8); +var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent) && !mode; + +// global $ methods for blocking/unblocking the entire page +$.blockUI = function(opts) { install(window, opts); }; +$.unblockUI = function(opts) { remove(window, opts); }; + +// convenience method for quick growl-like notifications (http://www.google.com/search?q=growl) +$.growlUI = function(title, message, timeout, onClose) { + var $m = $('
'); + if (title) $m.append('

'+title+'

'); + if (message) $m.append('

'+message+'

'); + if (timeout == undefined) timeout = 3000; + $.blockUI({ + message: $m, fadeIn: 700, fadeOut: 1000, centerY: false, + timeout: timeout, showOverlay: false, + onUnblock: onClose, + css: $.blockUI.defaults.growlCSS + }); +}; + +// plugin method for blocking element content +$.fn.block = function(opts) { + return this.unblock({ fadeOut: 0 }).each(function() { + if ($.css(this,'position') == 'static') + this.style.position = 'relative'; + if ($.browser.msie) + this.style.zoom = 1; // force 'hasLayout' + install(this, opts); + }); +}; + +// plugin method for unblocking element content +$.fn.unblock = function(opts) { + return this.each(function() { + remove(this, opts); + }); +}; + +$.blockUI.version = 2.39; // 2nd generation blocking at no extra cost! + +// override these in your code to change the default behavior and style +$.blockUI.defaults = { + // message displayed when blocking (use null for no message) + message: '

Please wait...

', + + title: null, // title string; only used when theme == true + draggable: true, // only used when theme == true (requires jquery-ui.js to be loaded) + + theme: false, // set to true to use with jQuery UI themes + + // styles for the message when blocking; if you wish to disable + // these and use an external stylesheet then do this in your code: + // $.blockUI.defaults.css = {}; + css: { + padding: 0, + margin: 0, + width: '30%', + top: '40%', + left: '35%', + textAlign: 'center', + color: '#000', + border: '3px solid #aaa', + backgroundColor:'#fff', + cursor: 'wait' + }, + + // minimal style set used when themes are used + themedCSS: { + width: '30%', + top: '40%', + left: '35%' + }, + + // styles for the overlay + overlayCSS: { + backgroundColor: '#000', + opacity: 0.6, + cursor: 'wait' + }, + + // styles applied when using $.growlUI + growlCSS: { + width: '350px', + top: '10px', + left: '', + right: '10px', + border: 'none', + padding: '5px', + opacity: 0.6, + cursor: 'default', + color: '#fff', + backgroundColor: '#000', + '-webkit-border-radius': '10px', + '-moz-border-radius': '10px', + 'border-radius': '10px' + }, + + // IE issues: 'about:blank' fails on HTTPS and javascript:false is s-l-o-w + // (hat tip to Jorge H. N. de Vasconcelos) + iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank', + + // force usage of iframe in non-IE browsers (handy for blocking applets) + forceIframe: false, + + // z-index for the blocking overlay + baseZ: 1000, + + // set these to true to have the message automatically centered + centerX: true, // <-- only effects element blocking (page block controlled via css above) + centerY: true, + + // allow body element to be stetched in ie6; this makes blocking look better + // on "short" pages. disable if you wish to prevent changes to the body height + allowBodyStretch: true, + + // enable if you want key and mouse events to be disabled for content that is blocked + bindEvents: true, + + // be default blockUI will supress tab navigation from leaving blocking content + // (if bindEvents is true) + constrainTabKey: true, + + // fadeIn time in millis; set to 0 to disable fadeIn on block + fadeIn: 200, + + // fadeOut time in millis; set to 0 to disable fadeOut on unblock + fadeOut: 400, + + // time in millis to wait before auto-unblocking; set to 0 to disable auto-unblock + timeout: 0, + + // disable if you don't want to show the overlay + showOverlay: true, + + // if true, focus will be placed in the first available input field when + // page blocking + focusInput: true, + + // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity) + applyPlatformOpacityRules: true, + + // callback method invoked when fadeIn has completed and blocking message is visible + onBlock: null, + + // callback method invoked when unblocking has completed; the callback is + // passed the element that has been unblocked (which is the window object for page + // blocks) and the options that were passed to the unblock call: + // onUnblock(element, options) + onUnblock: null, + + // don't ask; if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493 + quirksmodeOffsetHack: 4, + + // class name of the message block + blockMsgClass: 'blockMsg' +}; + +// private data and functions follow... + +var pageBlock = null; +var pageBlockEls = []; + +function install(el, opts) { + var full = (el == window); + var msg = opts && opts.message !== undefined ? opts.message : undefined; + opts = $.extend({}, $.blockUI.defaults, opts || {}); + opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {}); + var css = $.extend({}, $.blockUI.defaults.css, opts.css || {}); + var themedCSS = $.extend({}, $.blockUI.defaults.themedCSS, opts.themedCSS || {}); + msg = msg === undefined ? opts.message : msg; + + // remove the current block (if there is one) + if (full && pageBlock) + remove(window, {fadeOut:0}); + + // if an existing element is being used as the blocking content then we capture + // its current place in the DOM (and current display style) so we can restore + // it when we unblock + if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) { + var node = msg.jquery ? msg[0] : msg; + var data = {}; + $(el).data('blockUI.history', data); + data.el = node; + data.parent = node.parentNode; + data.display = node.style.display; + data.position = node.style.position; + if (data.parent) + data.parent.removeChild(node); + } + + $(el).data('blockUI.onUnblock', opts.onUnblock); + var z = opts.baseZ; + + // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform; + // layer1 is the iframe layer which is used to supress bleed through of underlying content + // layer2 is the overlay layer which has opacity and a wait cursor (by default) + // layer3 is the message content that is displayed while blocking + + var lyr1 = ($.browser.msie || opts.forceIframe) + ? $('') + : $(''); + + var lyr2 = opts.theme + ? $('') + : $(''); + + var lyr3, s; + if (opts.theme && full) { + s = ''; + } + else if (opts.theme) { + s = ''; + } + else if (full) { + s = ''; + } + else { + s = ''; + } + lyr3 = $(s); + + // if we have a message, style it + if (msg) { + if (opts.theme) { + lyr3.css(themedCSS); + lyr3.addClass('ui-widget-content'); + } + else + lyr3.css(css); + } + + // style the overlay + if (!opts.theme && (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform)))) + lyr2.css(opts.overlayCSS); + lyr2.css('position', full ? 'fixed' : 'absolute'); + + // make iframe layer transparent in IE + if ($.browser.msie || opts.forceIframe) + lyr1.css('opacity',0.0); + + //$([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el); + var layers = [lyr1,lyr2,lyr3], $par = full ? $('body') : $(el); + $.each(layers, function() { + this.appendTo($par); + }); + + if (opts.theme && opts.draggable && $.fn.draggable) { + lyr3.draggable({ + handle: '.ui-dialog-titlebar', + cancel: 'li' + }); + } + + // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling) + var expr = setExpr && (!$.boxModel || $('object,embed', full ? null : el).length > 0); + if (ie6 || expr) { + // give body 100% height + if (full && opts.allowBodyStretch && $.boxModel) + $('html,body').css('height','100%'); + + // fix ie6 issue when blocked element has a border width + if ((ie6 || !$.boxModel) && !full) { + var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth'); + var fixT = t ? '(0 - '+t+')' : 0; + var fixL = l ? '(0 - '+l+')' : 0; + } + + // simulate fixed position + $.each([lyr1,lyr2,lyr3], function(i,o) { + var s = o[0].style; + s.position = 'absolute'; + if (i < 2) { + full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"') + : s.setExpression('height','this.parentNode.offsetHeight + "px"'); + full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"') + : s.setExpression('width','this.parentNode.offsetWidth + "px"'); + if (fixL) s.setExpression('left', fixL); + if (fixT) s.setExpression('top', fixT); + } + else if (opts.centerY) { + if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'); + s.marginTop = 0; + } + else if (!opts.centerY && full) { + var top = (opts.css && opts.css.top) ? parseInt(opts.css.top) : 0; + var expression = '((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + '+top+') + "px"'; + s.setExpression('top',expression); + } + }); + } + + // show the message + if (msg) { + if (opts.theme) + lyr3.find('.ui-widget-content').append(msg); + else + lyr3.append(msg); + if (msg.jquery || msg.nodeType) + $(msg).show(); + } + + if (($.browser.msie || opts.forceIframe) && opts.showOverlay) + lyr1.show(); // opacity is zero + if (opts.fadeIn) { + var cb = opts.onBlock ? opts.onBlock : noOp; + var cb1 = (opts.showOverlay && !msg) ? cb : noOp; + var cb2 = msg ? cb : noOp; + if (opts.showOverlay) + lyr2._fadeIn(opts.fadeIn, cb1); + if (msg) + lyr3._fadeIn(opts.fadeIn, cb2); + } + else { + if (opts.showOverlay) + lyr2.show(); + if (msg) + lyr3.show(); + if (opts.onBlock) + opts.onBlock(); + } + + // bind key and mouse events + bind(1, el, opts); + + if (full) { + pageBlock = lyr3[0]; + pageBlockEls = $(':input:enabled:visible',pageBlock); + if (opts.focusInput) + setTimeout(focus, 20); + } + else + center(lyr3[0], opts.centerX, opts.centerY); + + if (opts.timeout) { + // auto-unblock + var to = setTimeout(function() { + full ? $.unblockUI(opts) : $(el).unblock(opts); + }, opts.timeout); + $(el).data('blockUI.timeout', to); + } +}; + +// remove the block +function remove(el, opts) { + var full = (el == window); + var $el = $(el); + var data = $el.data('blockUI.history'); + var to = $el.data('blockUI.timeout'); + if (to) { + clearTimeout(to); + $el.removeData('blockUI.timeout'); + } + opts = $.extend({}, $.blockUI.defaults, opts || {}); + bind(0, el, opts); // unbind events + + if (opts.onUnblock === null) { + opts.onUnblock = $el.data('blockUI.onUnblock'); + $el.removeData('blockUI.onUnblock'); + } + + var els; + if (full) // crazy selector to handle odd field errors in ie6/7 + els = $('body').children().filter('.blockUI').add('body > .blockUI'); + else + els = $('.blockUI', el); + + if (full) + pageBlock = pageBlockEls = null; + + if (opts.fadeOut) { + els.fadeOut(opts.fadeOut); + setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut); + } + else + reset(els, data, opts, el); +}; + +// move blocking element back into the DOM where it started +function reset(els,data,opts,el) { + els.each(function(i,o) { + // remove via DOM calls so we don't lose event handlers + if (this.parentNode) + this.parentNode.removeChild(this); + }); + + if (data && data.el) { + data.el.style.display = data.display; + data.el.style.position = data.position; + if (data.parent) + data.parent.appendChild(data.el); + $(el).removeData('blockUI.history'); + } + + if (typeof opts.onUnblock == 'function') + opts.onUnblock(el,opts); +}; + +// bind/unbind the handler +function bind(b, el, opts) { + var full = el == window, $el = $(el); + + // don't bother unbinding if there is nothing to unbind + if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) + return; + if (!full) + $el.data('blockUI.isBlocked', b); + + // don't bind events when overlay is not in use or if bindEvents is false + if (!opts.bindEvents || (b && !opts.showOverlay)) + return; + + // bind anchors and inputs for mouse and key events + var events = 'mousedown mouseup keydown keypress'; + b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler); + +// former impl... +// var $e = $('a,:input'); +// b ? $e.bind(events, opts, handler) : $e.unbind(events, handler); +}; + +// event handler to suppress keyboard/mouse events when blocking +function handler(e) { + // allow tab navigation (conditionally) + if (e.keyCode && e.keyCode == 9) { + if (pageBlock && e.data.constrainTabKey) { + var els = pageBlockEls; + var fwd = !e.shiftKey && e.target === els[els.length-1]; + var back = e.shiftKey && e.target === els[0]; + if (fwd || back) { + setTimeout(function(){focus(back)},10); + return false; + } + } + } + var opts = e.data; + // allow events within the message content + if ($(e.target).parents('div.' + opts.blockMsgClass).length > 0) + return true; + + // allow events for content that is not being blocked + return $(e.target).parents().children().filter('div.blockUI').length == 0; +}; + +function focus(back) { + if (!pageBlockEls) + return; + var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0]; + if (e) + e.focus(); +}; + +function center(el, x, y) { + var p = el.parentNode, s = el.style; + var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth'); + var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth'); + if (x) s.left = l > 0 ? (l+'px') : '0'; + if (y) s.top = t > 0 ? (t+'px') : '0'; +}; + +function sz(el, p) { + return parseInt($.css(el,p))||0; +}; + +})(jQuery); diff --git a/kamileczek123_demo/jquery-ui-1.8.10.custom.css b/kamileczek123_demo/jquery-ui-1.8.10.custom.css new file mode 100644 index 0000000..3d45a2d --- /dev/null +++ b/kamileczek123_demo/jquery-ui-1.8.10.custom.css @@ -0,0 +1,503 @@ +/* + * jQuery UI CSS Framework 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Helvetica,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=dddddd&bgTextureHeader=02_glass.png&bgImgOpacityHeader=35&borderColorHeader=bbbbbb&fcHeader=444444&iconColorHeader=999999&bgColorContent=c9c9c9&bgTextureContent=05_inset_soft.png&bgImgOpacityContent=50&borderColorContent=aaaaaa&fcContent=333333&iconColorContent=999999&bgColorDefault=eeeeee&bgTextureDefault=02_glass.png&bgImgOpacityDefault=60&borderColorDefault=cccccc&fcDefault=3383bb&iconColorDefault=70b2e1&bgColorHover=f8f8f8&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=bbbbbb&fcHover=599fcf&iconColorHover=3383bb&bgColorActive=999999&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=75&borderColorActive=999999&fcActive=ffffff&iconColorActive=454545&bgColorHighlight=eeeeee&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=ffffff&fcHighlight=444444&iconColorHighlight=3383bb&bgColorError=c0402a&bgTextureError=01_flat.png&bgImgOpacityError=55&borderColorError=c0402a&fcError=ffffff&iconColorError=fbc856&bgColorOverlay=eeeeee&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=80&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=60&thicknessShadow=4px&offsetTopShadow=-4px&offsetLeftShadow=-4px&cornerRadiusShadow=0pxdow=0px + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Trebuchet MS, Helvetica, Arial, sans-serif; font-size: 1.1em; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Helvetica, Arial, sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #c9c9c9 url(images/ui-bg_inset-soft_50_c9c9c9_1x100.png) 50% bottom repeat-x; color: #333333; } +.ui-widget-content a { color: #333333; } +.ui-widget-header { border: 1px solid #bbbbbb; background: #dddddd url(images/ui-bg_glass_35_dddddd_1x400.png) 50% 50% repeat-x; color: #444444; font-weight: bold; } +.ui-widget-header a { color: #444444; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #eeeeee url(images/ui-bg_glass_60_eeeeee_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #3383bb; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #3383bb; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #bbbbbb; background: #f8f8f8 url(images/ui-bg_glass_100_f8f8f8_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #599fcf; } +.ui-state-hover a, .ui-state-hover a:hover { color: #599fcf; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #999999; background: #999999 url(images/ui-bg_inset-hard_75_999999_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #ffffff; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #ffffff; background: #eeeeee url(images/ui-bg_flat_55_eeeeee_40x100.png) 50% 50% repeat-x; color: #444444; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #444444; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #c0402a; background: #c0402a url(images/ui-bg_flat_55_c0402a_40x100.png) 50% 50% repeat-x; color: #ffffff; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_999999_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_999999_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_70b2e1_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_3383bb_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_fbc856_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; } +.ui-corner-tr { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; } +.ui-corner-br { -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } +.ui-corner-top { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } +.ui-corner-right { -moz-border-radius-topright: 6px; -webkit-border-top-right-radius: 6px; border-top-right-radius: 6px; -moz-border-radius-bottomright: 6px; -webkit-border-bottom-right-radius: 6px; border-bottom-right-radius: 6px; } +.ui-corner-left { -moz-border-radius-topleft: 6px; -webkit-border-top-left-radius: 6px; border-top-left-radius: 6px; -moz-border-radius-bottomleft: 6px; -webkit-border-bottom-left-radius: 6px; border-bottom-left-radius: 6px; } +.ui-corner-all { -moz-border-radius: 6px; -webkit-border-radius: 6px; border-radius: 6px; } + +/* Overlays */ +.ui-widget-overlay { background: #eeeeee url(images/ui-bg_flat_0_eeeeee_40x100.png) 50% 50% repeat-x; opacity: .80;filter:Alpha(Opacity=80); } +.ui-widget-shadow { margin: -4px 0 0 -4px; padding: 4px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .60;filter:Alpha(Opacity=60); -moz-border-radius: 0pxdow=0px; -webkit-border-radius: 0pxdow=0px; border-radius: 0pxdow=0px; }/* + * jQuery UI Resizable 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Autocomplete 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.10 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Datepicker 1.8.10 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +} \ No newline at end of file diff --git a/kamileczek123_demo/jquery-ui-datepicker-lang.js b/kamileczek123_demo/jquery-ui-datepicker-lang.js new file mode 100644 index 0000000..915cfb4 --- /dev/null +++ b/kamileczek123_demo/jquery-ui-datepicker-lang.js @@ -0,0 +1,37 @@ +/* Polish initialisation for the jQuery UI date picker plugin. */ +/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */ +jQuery(function($){ + $.datepicker.regional['pl'] = { + closeText: 'Zamknij', + prevText: '<Poprzedni', + nextText: 'Następny>', + currentText: 'Dziś', + monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec', + 'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'], + monthNamesShort: ['Sty','Lut','Mar','Kwi','Maj','Cze', + 'Lip','Sie','Wrz','Paź','Lis','Gru'], + dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'], + dayNamesShort: ['Niedz','Pon','Wt','Śr','Czw','Pt','Sob'], + dayNamesMin: ['Ni','Pn','Wt','Śr','Cz','Pt','So'], + weekHeader: 'Tydz', + dateFormat: 'yy-mm-dd', + yearRange: 'c-85:c+0', + firstDay: 1}; + +$.datepicker.regional['en'] = { + closeText: 'Done', + prevText: 'Prev', + nextText: 'Next', + currentText: 'Today', + monthNames: ['January','February','March','April','May','June', + 'July','August','September','October','November','December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], + weekHeader: 'Wk', + dateFormat: 'yy-mm-dd', + yearRange: 'c-85:c+0', + firstDay: 1}; +}); diff --git a/kamileczek123_demo/jquery-ui-extensions.css b/kamileczek123_demo/jquery-ui-extensions.css new file mode 100644 index 0000000..305c805 --- /dev/null +++ b/kamileczek123_demo/jquery-ui-extensions.css @@ -0,0 +1,31 @@ +/* autocomplete */ + +.ui-autocomplete-loading { + background: white url('../img/autocomplete-anim-circle-16x16.gif') right center no-repeat; +} + +.ui-autocomplete-input { + border: 1px solid #f746b1; + font-family: "Lucida Sans Unicode", "Lucida Grande", "Trebuchet MS", "Arial", "Helvetica", sans-serif; + font-size: 12px; + margin-top: 1px; +} + +/* autocomplete menu item */ +.ui-autocomplete .ui-menu-item { + font-size: 12px; + font-family: "Lucida Sans Unicode", "Lucida Grande", "Trebuchet MS", Arial, Helvetica, sans-serif; + text-align: left; + margin-top: 1px; +} + +/* dialog +.ui-dialog-title { + color: #434343; + font-size: 12px; +} +.ui-button-text { + color: #434343; + font-size: 10px; +} +*/ \ No newline at end of file