Browse Source

Merge pull request #271 from emanuele45/lab_release-2.1

Lab release 2.1
emanuele45 12 years ago
parent
commit
aab222d092

+ 1 - 0
Sources/Subs-BoardIndex.php

@@ -172,6 +172,7 @@ function getBoardIndex($boardIndexOptions)
 				'id' => $row_board['id_board'],
 				'name' => $row_board['board_name'],
 				'description' => $row_board['description'],
+				'short_description' => shorten_subject(strip_tags($row_board['description']), 128),
 				'new' => empty($row_board['is_read']) && $row_board['poster_name'] != '',
 				'topics' => $row_board['num_topics'],
 				'posts' => $row_board['num_posts'],

+ 56 - 53
Themes/default/BoardIndex.template.php

@@ -23,60 +23,63 @@ function template_main()
 	</div>';
 
 	// Show the news fader?  (assuming there are things to show...)
-	if ($settings['show_newsfader'] && !empty($context['news_lines']))
+	if (!empty($settings['show_newsfader']) && !empty($context['news_lines']))
 	{
 		echo '
-	<div id="newsfader">
-		<div class="cat_bar">
-			<h3 class="catbg">
-				<img id="newsupshrink" src="', $settings['images_url'], '/collapse.png" alt="*" title="', $txt['hide'], '" align="bottom" style="display: none;" />
-				', $txt['news'], '
-			</h3>
-		</div>
-		<ul class="reset" id="smfFadeScroller"', empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>
-			<li>
-				', implode('</li><li>', $context['news_lines']), '
-			</li>
-		</ul>
-	</div>
-	<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/fader.js"></script>
-	<script type="text/javascript"><!-- // --><![CDATA[
-
-		// Create a news fader object.
-		var oNewsFader = new smc_NewsFader({
-			sFaderControlId: \'smfFadeScroller\',
-			sItemTemplate: ', JavaScriptEscape('<strong>%1$s</strong>'), ',
-			iFadeDelay: ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], '
-		});
-
-		// Create the news fader toggle.
-		var smfNewsFadeToggle = new smc_Toggle({
-			bToggleEnabled: true,
-			bCurrentlyCollapsed: ', empty($options['collapse_news_fader']) ? 'false' : 'true', ',
-			aSwappableContainers: [
-				\'smfFadeScroller\'
-			],
-			aSwapImages: [
-				{
-					sId: \'newsupshrink\',
-					srcExpanded: smf_images_url + \'/collapse.png\',
-					altExpanded: ', JavaScriptEscape($txt['hide']), ',
-					srcCollapsed: smf_images_url + \'/expand.png\',
-					altCollapsed: ', JavaScriptEscape($txt['show']), '
-				}
-			],
-			oThemeOptions: {
-				bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
-				sOptionName: \'collapse_news_fader\',
-				sSessionVar: smf_session_var,
-				sSessionId: smf_session_id
-			},
-			oCookieOptions: {
-				bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
-				sCookieName: \'newsupshrink\'
-			}
-		});
-	// ]]></script>';
+			<div id="newsfader">
+				<div class="cat_bar">
+					<h3 class="catbg">
+						<img id="newsupshrink" src="', $settings['images_url'], '/collapse.png" alt="*" title="', $txt['hide'], '" align="bottom" style="display: none;" />
+						', $txt['news'], '
+					</h3>
+				</div>
+				<div class="roundframe rfix" id="smfFadeScrollerCont">
+					<ul class="reset" id="smfFadeScroller"', empty($options['collapse_news_fader']) ? '' : ' style="display: none;"', '>
+						<li>
+							', implode('</li><li>', $context['news_lines']), '
+						</li>
+					</ul>
+				</div>
+			</div>
+			<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/fader.js"></script>
+			<script type="text/javascript"><!-- // --><![CDATA[
+		
+				// Create a news fader object.
+				var oNewsFader = new smc_NewsFader({
+					sFaderControlId: \'smfFadeScroller\',
+					sItemTemplate: ', JavaScriptEscape('%1$s'), ',
+					iFadeDelay: ', empty($settings['newsfader_time']) ? 5000 : $settings['newsfader_time'], '
+				});
+		
+				// Create the news fader toggle.
+				var smfNewsFadeToggle = new smc_Toggle({
+					bToggleEnabled: true,
+					bCurrentlyCollapsed: ', empty($options['collapse_news_fader']) ? 'false' : 'true', ',
+					aSwappableContainers: [
+						\'smfFadeScrollerCont\'
+					],
+					aSwapImages: [
+						{
+							sId: \'newsupshrink\',
+							srcExpanded: smf_images_url + \'/collapse.png\',
+							altExpanded: ', JavaScriptEscape($txt['hide']), ',
+							srcCollapsed: smf_images_url + \'/expand.png\',
+							altCollapsed: ', JavaScriptEscape($txt['show']), '
+						}
+					],
+					oThemeOptions: {
+						bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
+						sOptionName: \'collapse_news_fader\',
+						sSessionVar: smf_session_var,
+						sSessionId: smf_session_id
+					},
+					oCookieOptions: {
+						bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
+						sCookieName: \'newsupshrink\'
+					}
+				});
+			// ]]></script>
+		';
 	}
 
 	echo '
@@ -191,7 +194,7 @@ function template_main()
 						if (!$child['is_redirect'])
 							$child['link'] = '<a href="' . $child['href'] . '" ' . ($child['new'] ? 'class="board_new_posts" ' : '') . 'title="' . ($child['new'] ? $txt['new_posts'] : $txt['old_posts']) . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')">' . $child['name'] . ($child['new'] ? '</a> <a href="' . $scripturl . '?action=unread;board=' . $child['id'] . '" title="' . $txt['new_posts'] . ' (' . $txt['board_topics'] . ': ' . comma_format($child['topics']) . ', ' . $txt['posts'] . ': ' . comma_format($child['posts']) . ')"><span class="new_posts">' . $txt['new'] . '</span>' : '') . '</a>';
 						else
-							$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . '">' . $child['name'] . '</a>';
+							$child['link'] = '<a href="' . $child['href'] . '" title="' . comma_format($child['posts']) . ' ' . $txt['redirects'] . ' - ' . $child['short_description'] . '">' . $child['name'] . '</a>';
 
 						// Has it posts awaiting approval?
 						if ($child['can_approve_posts'] && ($child['unapproved_posts'] || $child['unapproved_topics']))

+ 16 - 16
Themes/default/Who.template.php

@@ -26,7 +26,7 @@ function template_main()
 				<div class="pagesection">
 					<div class="pagelinks floatleft">', $context['page_index'], '</div>';
 		echo '
-					<div class="selectbox floatright">', $txt['who_show1'], '
+					<div class="selectbox floatright" id="upper_show">', $txt['who_show1'], '
 						<select name="show_top" onchange="document.forms.whoFilter.show.value = this.value; document.forms.whoFilter.submit();">';
 
 		foreach ($context['show_methods'] as $value => $label)
@@ -102,22 +102,22 @@ function template_main()
 	echo '
 					</tbody>
 				</table>
-			</div>
-			<div class="pagesection">
-				<div class="pagelinks floatleft">', $context['page_index'], '</div>';
-
-	echo '
-				<div class="selectbox floatright">', $txt['who_show1'], '
-					<select name="show" onchange="document.forms.whoFilter.submit();">';
-
-	foreach ($context['show_methods'] as $value => $label)
+				<div class="pagesection" id="lower_pagesection">
+					<div class="pagelinks floatleft" id="lower_pagelinks">', $context['page_index'], '</div>';
+	
 		echo '
-						<option value="', $value, '" ', $value == $context['show_by'] ? ' selected="selected"' : '', '>', $label, '</option>';
-	echo '
-					</select>
-					<noscript>
-						<input type="submit" value="', $txt['go'], '" class="button_submit" />
-					</noscript>
+					<div class="selectbox floatright">', $txt['who_show1'], '
+						<select name="show" onchange="document.forms.whoFilter.submit();">';
+	
+		foreach ($context['show_methods'] as $value => $label)
+			echo '
+							<option value="', $value, '" ', $value == $context['show_by'] ? ' selected="selected"' : '', '>', $label, '</option>';
+		echo '
+						</select>
+						<noscript>
+							<input type="submit" value="', $txt['go'], '" class="button_submit" />
+						</noscript>
+					</div>
 				</div>
 			</div>
 		</form>

+ 32 - 13
Themes/default/css/index.css

@@ -347,8 +347,6 @@ em {
 	overflow: auto;
 	white-space: nowrap;
 	/* Show a scrollbar after about 6 lines. */
-	/* This is much better than the old max-height css. */
-	height: 10em;
 	resize: vertical;
 }
 
@@ -913,6 +911,9 @@ img.sort {
 /* Used for combining cat/title headers with a content frame */
 .rfix {
 	margin-top: -1px;
+	border-top: 0;
+	border-top-left-radius: 0;
+	border-top-right-radius: 0;
 }
 
 /* The main content area.
@@ -1384,7 +1385,7 @@ img.sort {
 }
 #search_form .button_submit {
 	padding: 1px 2px;
-	margin: 1px 5px;
+	margin: -1px 5px;
 	background: #fff url(../images/theme/lower_section.png) 0 45% repeat-x;
 	color: #333;
 }
@@ -1626,7 +1627,7 @@ ul li.greeting {
 ------------------------------------------------------- */
 .table_list {
 	width: 100%;
-	border-collapse: collapse;
+	border-spacing: 0;
 }
 .table_list .header td {
 	padding: 0;
@@ -1635,7 +1636,7 @@ ul li.greeting {
 	padding: 7px;
 }
 .table_list .header .cat_bar {
-	margin: 0 0 0 -1px;
+	margin: 0;
 }
 .table_list .icon, .table_list .info, .table_list .stats, .table_list.lastpost {
 	border-top: 2px solid #fff;
@@ -1674,8 +1675,8 @@ ul li.greeting {
 	width: 12%;
 }
 .table_list .stats p {
-	border-left: 1px solid #ccc;
-	border-right: 1px solid #ccc;
+	border-left: 1px solid #ddd;
+	border-right: 1px solid #ddd;
 	min-height: 3em;
 	margin: 3px 0 0 0;
 	padding: 0px 7px 0 7px;
@@ -1720,8 +1721,8 @@ ul li.greeting {
 
 /* the posting icons */
 #posting_icons {
-	padding: 0 12px 6px 12px;
-	margin: 0 0 12px 0;
+	padding: 0 12px 6px 0;
+	margin: -6px 0 16px -8px;
 	line-height: 12px;
 	float: left;
 }
@@ -1738,7 +1739,7 @@ ul li.greeting {
 }
 .mark_read {
 	margin: -5px 0 0 0;
-	padding: 0 6px;
+	padding: 0;
 	float: right;
 }
 .mark_read .buttonlist ul {
@@ -1747,7 +1748,7 @@ ul li.greeting {
 }
 /* the newsfader */
 #newsfader {
-	margin: 0;
+	margin: 0 0 8px 0;
 }
 #smfFadeScroller {
 	text-align: center;
@@ -1755,6 +1756,9 @@ ul li.greeting {
 	overflow: auto;
 	color: #444444; /* shouldn't be shorthand style due to a JS bug in IE! */
 }
+ul#smfFadeScroller li {
+	font-weight: bold;
+}
 
 /* Styles for the info center on the board index.
 ---------------------------------------------------- */
@@ -2280,7 +2284,7 @@ ul.quickbuttons li a.modify_button {
 	background: url(../images/theme/quickbuttons.png) no-repeat 3px -57px;
 }
 ul.quickbuttons li a.approve_button {
-	background: url(../images/theme/quickbuttons.png) no-repeat 0 -90px;
+	background: url(../images/theme/quickbuttons.png) no-repeat 4px -88px;
 }
 ul.quickbuttons li a.restore_button {
 	background: url(../images/theme/quickbuttons.png) no-repeat 0 -120px;
@@ -2298,7 +2302,7 @@ ul.quickbuttons li a.notify_button {
 	background: url(../images/theme/quickbuttons.png) no-repeat 0 -210px;
 }
 ul.quickbuttons li a.unapprove_button {
-	background: url(../images/theme/quickbuttons.png) no-repeat 4px -237px;
+	background: url(../images/theme/quickbuttons.png) no-repeat 4px -238px;
 }
 ul.quickbuttons li.inline_mod_check {
 	padding: 1px 1px 1px 1px;
@@ -4222,4 +4226,19 @@ div#manage_boards dl dd textarea[name=desc] {
 
 .bold_text {
 	font-weight: bold;
+}
+
+/* Styles for "Who" action.
+-------------------------------------------------- */	
+.action_who #upper_show {	
+	margin-top: 6px;
+}
+.action_who #lower_pagesection {
+	margin-top: 4px;
+}
+.action_who #lower_pagelinks {
+	margin-top: -4px;
+}
+.action_who select {
+	margin-top: -1px !important;
 }

+ 5 - 3
Themes/default/scripts/fader.js

@@ -35,7 +35,9 @@ function smc_NewsFader(oOptions)
 			aFaderItems.push($(this).html());
 		});
 
-	$(sControlId).html('<li>' + sItemTemplate.replace('%1$s', aFaderItems[0]) + '</li>').show();
-
-	fadeOut();
+	if (aFaderItems.length > 1)
+	{
+		$(sControlId).html('<li>' + sItemTemplate.replace('%1$s', aFaderItems[0]) + '</li>').show();
+		fadeOut();
+	}
 }

+ 1 - 1
Themes/default/scripts/script.js

@@ -1079,7 +1079,7 @@ JumpTo.prototype.showSelect = function ()
 	var sChildLevelPrefix = '';
 	for (var i = this.opt.iCurBoardChildLevel; i > 0; i--)
 		sChildLevelPrefix += this.opt.sBoardChildLevelIndicator;
-	setInnerHTML(document.getElementById(this.opt.sContainerId), this.opt.sJumpToTemplate.replace(/%select_id%/, this.opt.sContainerId + '_select').replace(/%dropdown_list%/, '<select ' + (this.opt.bDisabled == true ? 'disabled="disabled" ' : 0) + (this.opt.sClassName != undefined ? 'class="' + this.opt.sClassName + '" ' : '') + 'name="' + (this.opt.sCustomName != undefined ? this.opt.sCustomName : this.opt.sContainerId + '_select') + '" id="' + this.opt.sContainerId + '_select" ' + ('implementation' in document ? '' : 'onmouseover="grabJumpToContent(this);" ') + ('onbeforeactivate' in document ? 'onbeforeactivate' : 'onfocus') + '="grabJumpToContent(this);"><option value="' + (this.opt.bNoRedirect != undefined && this.opt.bNoRedirect == true ? this.opt.iCurBoardId : '?board=' + this.opt.iCurBoardId + '.0') + '">' + sChildLevelPrefix + this.opt.sBoardPrefix + this.opt.sCurBoardName.removeEntities() + '</option></select>&nbsp;' + (this.opt.sGoButtonLabel != undefined ? '<input type="button" class="button_submit" value="' + this.opt.sGoButtonLabel + '" onclick="window.location.href = \'' + smf_prepareScriptUrl(smf_scripturl) + 'board=' + this.opt.iCurBoardId + '.0\';" />' : '')));
+	setInnerHTML(document.getElementById(this.opt.sContainerId), this.opt.sJumpToTemplate.replace(/%select_id%/, this.opt.sContainerId + '_select').replace(/%dropdown_list%/, '<select ' + (this.opt.bDisabled == true ? 'disabled="disabled" ' : '') + (this.opt.sClassName != undefined ? 'class="' + this.opt.sClassName + '" ' : '') + 'name="' + (this.opt.sCustomName != undefined ? this.opt.sCustomName : this.opt.sContainerId + '_select') + '" id="' + this.opt.sContainerId + '_select" ' + ('implementation' in document ? '' : 'onmouseover="grabJumpToContent(this);" ') + ('onbeforeactivate' in document ? 'onbeforeactivate' : 'onfocus') + '="grabJumpToContent(this);"><option value="' + (this.opt.bNoRedirect != undefined && this.opt.bNoRedirect == true ? this.opt.iCurBoardId : '?board=' + this.opt.iCurBoardId + '.0') + '">' + sChildLevelPrefix + this.opt.sBoardPrefix + this.opt.sCurBoardName.removeEntities() + '</option></select>&nbsp;' + (this.opt.sGoButtonLabel != undefined ? '<input type="button" class="button_submit" value="' + this.opt.sGoButtonLabel + '" onclick="window.location.href = \'' + smf_prepareScriptUrl(smf_scripturl) + 'board=' + this.opt.iCurBoardId + '.0\';" />' : '')));
 	this.dropdownList = document.getElementById(this.opt.sContainerId + '_select');
 }