Ver código fonte

Moving the calendar CSS to its own file

Signed-off-by: John Rayes <[email protected]>
John Rayes 11 anos atrás
pai
commit
c03d02bf0b
3 arquivos alterados com 204 adições e 204 exclusões
  1. 5 4
      Sources/Calendar.php
  2. 199 0
      Themes/default/css/calendar.css
  3. 0 200
      Themes/default/css/index.css

+ 5 - 4
Sources/Calendar.php

@@ -49,13 +49,14 @@ function CalendarMain()
 	if (isset($_GET['sa']) && isset($subActions[$_GET['sa']]) && !WIRELESS)
 		return $subActions[$_GET['sa']]();
 
-	// This is gonna be needed...
-	loadTemplate('Calendar');
-
 	// You can't do anything if the calendar is off.
 	if (empty($modSettings['cal_enabled']))
 		fatal_lang_error('calendar_off', false);
 
+	// This is gonna be needed...
+	loadTemplate('Calendar');
+	loadCSSFile('calendar.css', array('force_current' => false, 'validate' => true, 'rtl' => 'calendar.rtl.css'));
+
 	// Did the specify an individual event ID? If so, let's splice the year/month in to what we would otherwise be doing.
 	if (isset($_GET['event']))
 	{
@@ -160,7 +161,7 @@ function CalendarMain()
 
 	// Basic template stuff.
 	$context['allow_calendar_event'] = allowedTo('calendar_post');
-	
+
 	// If you don't allow events not linked to posts and you're not an admin, we have more work to do...
 	if ($context['allow_calendar_event'] && empty($modSettings['cal_allow_unlinked']) && !$user_info['is_admin'])
 	{

+ 199 - 0
Themes/default/css/calendar.css

@@ -0,0 +1,199 @@
+/* Styles for the calendar section.
+------------------------------------------------- */
+#calendar {
+	overflow: hidden;
+}
+/* Used to indicate the current day in the grid. */
+#main_grid .calendar_today span.day_text, #month_grid .calendar_today, .calendar_week tr.days_wrapper td.calendar_today:first-child {
+	font-weight: bold;
+}
+.calendar_today, td.days:hover {
+	background: #fff;
+}
+#month_grid {
+	width: 284px;
+	float: left;
+	text-align: center;
+	overflow: hidden;
+	margin-right: 1%;
+}
+#month_grid h3 a {
+	padding: 0 6px 0 6px;
+}
+#month_grid table {
+	width: 100%;
+	margin-bottom: 12px;
+	border-collapse: collapse;
+	background: #f0f4f7;
+	border: 1px solid #ccc;
+}
+#main_grid {
+	overflow: auto;
+}
+#main_grid table {
+	width: 99.9%;
+	border-collapse: collapse;
+	background: #f0f4f7;
+	margin: 1px 0 0 0;
+	border: 1px solid #ccc;
+	overflow: auto;
+	-moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-sizing: border-box;
+	margin-left: 1px;
+}
+#main_grid .cat_bar {
+	border-radius: 5px 5px 0 0;
+	margin: 0 0 0 1px;
+}
+#month_grid table th:first-child {
+	background: #e7eaef;
+}
+#month_grid table th.days {
+	background: #e7eaef;
+}
+#month_grid table th.days, #month_grid table td.weeks {
+	padding: 5px;
+	text-align: center;
+}
+#month_grid table td.weeks {
+	font-size: large;
+	background: #e7eaef;
+}
+#month_grid td.weeks a:hover {
+	text-decoration: underline;
+}
+#month_grid h3.catbg, #main_grid h3.catbg {
+	padding: 8px 6px 4px 6px;
+}
+#main_grid h3.catbg span {
+	display: block;
+	font-size: 1.5em;
+	margin: -3px 4px 0 4px;
+}
+#main_grid table th:first-child {
+	background: #e7eaef;
+}
+#main_grid table th.days {
+	width: 14%;
+	padding: 10px;
+	text-align: left;
+	background: #e7eaef;
+}
+#main_grid table td.weeks {
+	text-align: center;
+	font-weight: bold;
+	font-size: 1.8em;
+	background: #e7eaef;
+}
+#main_grid table td.weeks a:hover {
+	text-decoration: none;
+}
+/* Main Highlighting */
+#main_grid table td.disabled, #month_grid table td.disabled {
+	background: rgba(238, 238, 238, 1.0);
+}
+#main_grid table td.events, #month_grid table td.events {
+	background: rgba(30, 245, 20, 0.1);
+}
+#main_grid table td.holidays, #month_grid table td.holidays {
+	background: rgba(23, 110, 245, 0.1);
+}
+#main_grid table td.birthdays, #month_grid table td.birthdays {
+	background: rgba(102, 0, 255, 0.1);
+}
+/* Special Case Highlighting */
+#main_grid table td.events:hover, #month_grid table td.events:hover, #month_grid table td.calendar_today.events {
+	background: rgba(30, 245, 20, 0.2);
+}
+#main_grid table td.holidays:hover, #month_grid table td.holidays:hover, #month_grid table td.calendar_today.holidays {
+	background: rgba(23, 110, 245, 0.2);
+}
+#main_grid table td.birthdays:hover, #month_grid table td.birthdays:hover, #month_grid table td.calendar_today.birthdays {
+	background: rgba(153, 51, 255, 0.2);
+}
+#main_grid table td.days, #month_grid table td.days {
+	vertical-align: top;
+	text-align: left;
+	border-right: 1px solid #ccc;
+	border-bottom: 1px solid #ccc;
+}
+#main_grid table td.days {
+	padding: 10px;
+}
+#month_grid table td.days {
+	padding: 5px;
+	width: 14.28%;
+	text-align: center;
+}
+#main_grid table tbody tr:nth-child(2) td.days, #month_grid table tbody tr:nth-child(2) {
+	border-top: 1px solid #ccc;
+}
+#main_grid table tbody tr.days_wrapper > td:nth-child(2), #month_grid table tr.days_wrapper > td:nth-child(2) {
+	border-left: 1px solid #ccc;
+}
+#main_grid table tr.days_wrapper:nth-child(2) > td.weeks {
+	border-top: 1px solid #ccc;
+}
+#main_grid table:last-child td.weeks {
+	border-bottom: 1px solid #ccc;
+}
+#main_grid td#post_event {
+	background: #e7eaef;
+	text-align: center;
+	padding-top: 12px;
+	margin-right: 0;
+}
+#main_grid img.calendar_icon {
+	float: left;
+	width: 16px;
+	margin: 2px 2px;
+}
+#main_grid .act_day {
+	font-size: 12pt;
+}
+#main_grid .active_post_event > a {
+	color: #999;
+}
+div.week_month_title {
+	font-weight: bold;
+	font-size: xx-large;
+	margin: 10px 0 12px 2px;
+}
+div.week_month_title a {
+	color: #555;
+}
+td.week_post {
+	vertical-align: middle !important;
+}
+div.week_add_event {
+	text-align: center;
+}
+div.week_add_event > a {
+	font-size: x-large;
+	color: #999;
+}
+div.week_add_event > a:hover {
+	color: #555;
+}
+span.hidelink {
+	font-style: italic;
+}
+#view_button {
+	margin-top: -2px;
+}
+/* Cheat and match this to the submit button. */
+#main_grid .buttonlist {
+	margin: -4px 12px 0 0;
+}
+#month_grid .compact {
+	padding: 2px;
+}
+#month_grid .comfortable {
+	padding: 5px;
+}
+#main_grid .compact, .calendar_week .compact {
+	height: 45px;
+}
+#main_grid .comfortable, .calendar_week .comfortable {
+	height: 100px;
+	padding: 10px;
+}

+ 0 - 200
Themes/default/css/index.css

@@ -3603,206 +3603,6 @@ dl.addrules dt.floatleft {
 	margin-right:10px;
 }
 
-/* Styles for the calendar section.
-------------------------------------------------- */
-#calendar {
-	overflow: hidden;
-}
-/* Used to indicate the current day in the grid. */
-#main_grid .calendar_today span.day_text, #month_grid .calendar_today, .calendar_week tr.days_wrapper td.calendar_today:first-child {
-	font-weight: bold;
-}
-.calendar_today, td.days:hover {
-	background: #fff;
-}
-#month_grid {
-	width: 284px;
-	float: left;
-	text-align: center;
-	overflow: hidden;
-	margin-right: 1%;
-}
-#month_grid h3 a {
-	padding: 0 6px 0 6px;
-}
-#month_grid table {
-	width: 100%;
-	margin-bottom: 12px;
-	border-collapse: collapse;
-	background: #f0f4f7;
-	border: 1px solid #ccc;
-}
-#main_grid {
-	overflow: auto;
-}
-#main_grid table {
-	width: 99.9%;
-	border-collapse: collapse;
-	background: #f0f4f7;
-	margin: 1px 0 0 0;
-	border: 1px solid #ccc;
-	overflow: auto;
-	-moz-box-sizing: border-box; box-sizing: border-box; -webkit-box-sizing: border-box;
-	margin-left: 1px;
-}
-#main_grid .cat_bar {
-	border-radius: 5px 5px 0 0;
-	margin: 0 0 0 1px;
-}
-#month_grid table th:first-child {
-	background: #e7eaef;
-}
-#month_grid table th.days {
-	background: #e7eaef;
-}
-#month_grid table th.days, #month_grid table td.weeks {
-	padding: 5px;
-	text-align: center;
-}
-#month_grid table td.weeks {
-	font-size: large;
-	background: #e7eaef;
-}
-#month_grid td.weeks a:hover {
-	text-decoration: underline;
-}
-#month_grid h3.catbg, #main_grid h3.catbg {
-	padding: 8px 6px 4px 6px;
-}
-#main_grid h3.catbg span {
-	display: block;
-	font-size: 1.5em;
-	margin: -3px 4px 0 4px;
-}
-#main_grid table th:first-child {
-	background: #e7eaef;
-}
-#main_grid table th.days {
-	width: 14%;
-	padding: 10px;
-	text-align: left;
-	background: #e7eaef;
-}
-#main_grid table td.weeks {
-	text-align: center;
-	font-weight: bold;
-	font-size: 1.8em;
-	background: #e7eaef;
-}
-#main_grid table td.weeks a:hover {
-	text-decoration: none;
-}
-/* Main Highlighting */
-#main_grid table td.disabled, #month_grid table td.disabled {
-	background: rgba(238, 238, 238, 1.0);
-}
-#main_grid table td.events, #month_grid table td.events {
-	background: rgba(30, 245, 20, 0.1);
-}
-#main_grid table td.holidays, #month_grid table td.holidays {
-	background: rgba(23, 110, 245, 0.1);
-}
-#main_grid table td.birthdays, #month_grid table td.birthdays {
-	background: rgba(102, 0, 255, 0.1);
-}
-/* Special Case Highlighting */
-#main_grid table td.events:hover, #month_grid table td.events:hover, #month_grid table td.calendar_today.events {
-	background: rgba(30, 245, 20, 0.2);
-}
-#main_grid table td.holidays:hover, #month_grid table td.holidays:hover, #month_grid table td.calendar_today.holidays {
-	background: rgba(23, 110, 245, 0.2);
-}
-#main_grid table td.birthdays:hover, #month_grid table td.birthdays:hover, #month_grid table td.calendar_today.birthdays {
-	background: rgba(153, 51, 255, 0.2);
-}
-#main_grid table td.days, #month_grid table td.days {
-	vertical-align: top;
-	text-align: left;
-	border-right: 1px solid #ccc;
-	border-bottom: 1px solid #ccc;
-}
-#main_grid table td.days {
-	padding: 10px;
-}
-#month_grid table td.days {
-	padding: 5px;
-	width: 14.28%;
-	text-align: center;
-}
-#main_grid table tbody tr:nth-child(2) td.days, #month_grid table tbody tr:nth-child(2) {
-	border-top: 1px solid #ccc;
-}
-#main_grid table tbody tr.days_wrapper > td:nth-child(2), #month_grid table tr.days_wrapper > td:nth-child(2) {
-	border-left: 1px solid #ccc;
-}
-#main_grid table tr.days_wrapper:nth-child(2) > td.weeks {
-	border-top: 1px solid #ccc;
-}
-#main_grid table:last-child td.weeks {
-	border-bottom: 1px solid #ccc;
-}
-#main_grid td#post_event {
-	background: #e7eaef;
-	text-align: center;
-	padding-top: 12px;
-	margin-right: 0;
-}
-#main_grid img.calendar_icon {
-	float: left;
-	width: 16px;
-	margin: 2px 2px;
-}
-#main_grid .act_day {
-	font-size: 12pt;
-}
-#main_grid .active_post_event > a {
-	color: #999;
-}
-div.week_month_title {
-	font-weight: bold;
-	font-size: xx-large;
-	margin: 10px 0 12px 2px;
-}
-div.week_month_title a {
-	color: #555;
-}
-td.week_post {
-	vertical-align: middle !important;
-}
-div.week_add_event {
-	text-align: center;
-}
-div.week_add_event > a {
-	font-size: x-large;
-	color: #999;
-}
-div.week_add_event > a:hover {
-	color: #555;
-}
-span.hidelink {
-	font-style: italic;
-}
-#view_button {
-	margin-top: -2px;
-}
-/* Cheat and match this to the submit button. */
-#main_grid .buttonlist {
-	margin: -4px 12px 0 0;
-}
-#month_grid .compact {
-	padding: 2px;
-}
-#month_grid .comfortable {
-	padding: 5px;
-}
-#main_grid .compact, .calendar_week .compact {
-	height: 45px;
-}
-#main_grid .comfortable, .calendar_week .comfortable {
-	height: 100px;
-	padding: 10px;
-}
-
 /* Styles for the memberlist section.
 ------------------------------------------------- */
 #mlist_search {