Skip to content

Commit

Permalink
slicker default styling for buttons.
Browse files Browse the repository at this point in the history
refactored css & html structure for all views (simpler & will work better with jqui themes).
jQuery UI 1.8.9
  • Loading branch information
arshaw committed Jan 24, 2011
1 parent 3079c2f commit bef6f92
Show file tree
Hide file tree
Showing 84 changed files with 1,148 additions and 964 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
93 changes: 37 additions & 56 deletions tests/themes/start/theme.css → demos/cupertino/theme.css

Large diffs are not rendered by default.

Binary file removed demos/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png
Binary file not shown.
Binary file removed demos/redmond/images/ui-bg_flat_55_fbec88_40x100.png
Binary file not shown.
Binary file removed demos/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png
Binary file not shown.
Binary file removed demos/redmond/images/ui-bg_glass_85_dfeffc_1x400.png
Binary file not shown.
Binary file removed demos/redmond/images/ui-bg_glass_95_fef1ec_1x400.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed demos/redmond/images/ui-icons_cd0a0a_256x240.png
Binary file not shown.
Binary file removed demos/redmond/images/ui-icons_f9bd01_256x240.png
Binary file not shown.
2 changes: 1 addition & 1 deletion demos/theme.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<link rel='stylesheet' type='text/css' href='redmond/theme.css' />
<link rel='stylesheet' type='text/css' href='cupertino/theme.css' />
<script type='text/javascript' src='../src/_loader.js'></script>
<!--[[
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
Expand Down

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function Calendar(element, options, eventSources) {
if (options.theme) {
element.addClass('ui-widget');
}
content = $("<div class='fc-content " + tm + "-widget-content' style='position:relative'/>")
content = $("<div class='fc-content' style='position:relative'/>")
.prependTo(element);
header = new Header(t, options);
headerElement = header.render();
Expand Down Expand Up @@ -132,6 +132,7 @@ function Calendar(element, options, eventSources) {
/* View Rendering
-----------------------------------------------------------------------------*/

// TODO: improve view switching (still weird transition in IE, and FF has whiteout problem)

function changeView(newViewName) {
if (!currentView || newViewName != currentView.name) {
Expand Down Expand Up @@ -262,7 +263,7 @@ function Calendar(element, options, eventSources) {
suggestedViewHeight = options.contentHeight;
}
else if (options.height) {
suggestedViewHeight = options.height - (headerElement ? headerElement.height() : 0) - vsides(content[0]);
suggestedViewHeight = options.height - (headerElement ? headerElement.height() : 0) - vsides(content);
}
else {
suggestedViewHeight = Math.round(content.width() / Math.max(options.aspectRatio, .5));
Expand Down
69 changes: 35 additions & 34 deletions src/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@ function Header(calendar, options) {
tm = options.theme ? 'ui' : 'fc';
var sections = options.header;
if (sections) {
element = $("<table class='fc-header'/>")
.append($("<tr/>")
.append($("<td class='fc-header-left'/>")
.append(renderSection(sections.left)))
.append($("<td class='fc-header-center'/>")
.append(renderSection(sections.center)))
.append($("<td class='fc-header-right'/>")
.append(renderSection(sections.right))));
element = $("<table class='fc-header' style='width:100%'/>")
.append(
$("<tr/>")
.append(renderSection('left'))
.append(renderSection('center'))
.append(renderSection('right'))
);
return element;
}
}
Expand All @@ -41,17 +40,18 @@ function Header(calendar, options) {
}


function renderSection(buttonStr) {
function renderSection(position) {
var e = $("<td class='fc-header-" + position + "'/>");
var buttonStr = options.header[position];
if (buttonStr) {
var tr = $("<tr/>");
$.each(buttonStr.split(' '), function(i) {
if (i > 0) {
tr.append("<td><span class='fc-header-space'/></td>");
e.append("<span class='fc-header-space'/>");
}
var prevButton;
$.each(this.split(','), function(j, buttonName) {
if (buttonName == 'title') {
tr.append("<td><h2 class='fc-header-title'>&nbsp;</h2></td>");
e.append("<span class='fc-header-title'><h2>&nbsp;</h2></span>");
if (prevButton) {
prevButton.addClass(tm + '-corner-right');
}
Expand All @@ -68,20 +68,23 @@ function Header(calendar, options) {
};
}
if (buttonClick) {
if (prevButton) {
prevButton.addClass(tm + '-no-right');
}
var button;
var icon = options.theme ? smartProperty(options.buttonIcons, buttonName) : null;
var text = smartProperty(options.buttonText, buttonName);
if (icon) {
button = $("<div class='fc-button-" + buttonName + " ui-state-default'>" +
"<a><span class='ui-icon ui-icon-" + icon + "'/></a></div>");
}
else if (text) {
button = $("<div class='fc-button-" + buttonName + " " + tm + "-state-default'>" +
"<a><span>" + text + "</span></a></div>");
}
var button = $(
"<span class='fc-button fc-button-" + buttonName + " " + tm + "-state-default'>" +
"<span class='fc-inner'>" +
"<span class='fc-button-content'>" +
(icon ?
"<span class='fc-icon-wrap'>" +
"<span class='ui-icon ui-icon-" + icon + "'/>" +
"</span>" :
text
) +
"</span>" +
"<span class='fc-button-effect'><span></span></span>" +
"</span>" +
"</span>"
);
if (button) {
button
.click(function() {
Expand Down Expand Up @@ -111,10 +114,8 @@ function Header(calendar, options) {
.removeClass(tm + '-state-down');
}
)
.appendTo($("<td/>").appendTo(tr));
if (prevButton) {
prevButton.addClass(tm + '-no-right');
}else{
.appendTo(e);
if (!prevButton) {
button.addClass(tm + '-corner-left');
}
prevButton = button;
Expand All @@ -126,37 +127,37 @@ function Header(calendar, options) {
prevButton.addClass(tm + '-corner-right');
}
});
return $("<table/>").append(tr);
}
return e;
}


function updateTitle(html) {
element.find('h2.fc-header-title')
element.find('h2')
.html(html);
}


function activateButton(buttonName) {
element.find('div.fc-button-' + buttonName)
element.find('span.fc-button-' + buttonName)
.addClass(tm + '-state-active');
}


function deactivateButton(buttonName) {
element.find('div.fc-button-' + buttonName)
element.find('span.fc-button-' + buttonName)
.removeClass(tm + '-state-active');
}


function disableButton(buttonName) {
element.find('div.fc-button-' + buttonName)
element.find('span.fc-button-' + buttonName)
.addClass(tm + '-state-disabled');
}


function enableButton(buttonName) {
element.find('div.fc-button-' + buttonName)
element.find('span.fc-button-' + buttonName)
.removeClass(tm + '-state-disabled');
}

Expand Down
6 changes: 3 additions & 3 deletions src/_loader.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(function() {

var JQUERY = 'jquery-1.4.4.min.js';
var JQUERY_UI = 'jquery-ui-1.8.6.custom.min.js';
var JQUERY_UI = 'jquery-ui-1.8.9.custom.min.js';
var JQUERY_LEGACY = 'jquery-1.3.2.min.js';
var JQUERY_UI_LEGACY = 'jquery-ui-1.7.3.custom.min.js';

Expand Down Expand Up @@ -41,6 +41,8 @@ js('main.js');
js('Calendar.js');
js('Header.js');
js('EventManager.js');
js('date_util.js');
js('util.js');

js('basic/MonthView.js');
js('basic/BasicWeekView.js');
Expand All @@ -60,8 +62,6 @@ js('common/OverlayManager.js');
js('common/CoordinateGrid.js');
js('common/HoverListener.js');
js('common/HorizontalPositionCache.js');
js('common/date.js');
js('common/util.js');

endload();

Expand Down
7 changes: 4 additions & 3 deletions src/agenda/AgendaEventRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,9 @@ function AgendaEventRenderer() {
seg = segs[i];
if (eventElement = seg.element) {
val = vsideCache[key = seg.key = cssKey(eventElement[0])];
seg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement[0], true)) : val;
seg.vsides = val === undefined ? (vsideCache[key] = vsides(eventElement, true)) : val;
val = hsideCache[key];
seg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement[0], true)) : val;
seg.hsides = val === undefined ? (hsideCache[key] = hsides(eventElement, true)) : val;
titleSpan = eventElement.find('span.fc-event-title');
if (titleSpan.length) {
seg.titleTop = titleSpan[0].offsetTop;
Expand Down Expand Up @@ -356,8 +356,9 @@ function AgendaEventRenderer() {
// mouse is over bottom slots
if (isStart && allDay) {
// convert event to temporary slot-event
eventElement.width(colWidth - 10); // don't use entire width
setOuterHeight(
eventElement.width(colWidth - 10), // don't use entire width
eventElement,
slotHeight * Math.round(
(event.end ? ((event.end - event.start) / MINUTE_MS) : opt('defaultEventMinutes'))
/ opt('slotMinutes')
Expand Down
Loading

0 comments on commit bef6f92

Please sign in to comment.