SamanthaNguyen has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/334910 )
Change subject: [WIP] Move inline styles to stylesheet in QuizGame
......................................................................
[WIP] Move inline styles to stylesheet in QuizGame
Bug: T147258
Change-Id: I6b8400364f1e3ea145d102503148c3b11ec66223
---
M QuestionGameHome.body.php
M questiongame.css
2 files changed, 46 insertions(+), 15 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/QuizGame
refs/changes/10/334910/1
diff --git a/QuestionGameHome.body.php b/QuestionGameHome.body.php
index d5f78c0..5a11668 100644
--- a/QuestionGameHome.body.php
+++ b/QuestionGameHome.body.php
@@ -430,7 +430,7 @@
$output = '<div class="quizgame-admin" id="quizgame-admin">
- <div class="ajax-messages" id="ajax-messages"
style="margin:0px 0px 15px 0px;"></div>
+ <div class="ajax-messages"
id="ajax-messages"></div>
<div class="quizgame-admin-top-links">
<a href="' . htmlspecialchars(
$this->getPageTitle()->getFullURL( 'questionGameAction=launchGame' ) ) . '">' .
@@ -623,7 +623,7 @@
$pictag = '<div id="quizgame-picture"
class="quizgame-picture">' . $thumbtag . '</div>
<p id="quizgame-editpicture-link"><!--
jQuery injects a link here --></p>
- <div id="quizgame-upload"
class="quizgame-upload" style="display:none">
+ <div id="quizgame-upload"
class="quizgame-upload">
<iframe id="imageUpload-frame"
class="imageUpload-frame" width="650" scrolling="no" frameborder="0" src="' .
htmlspecialchars(
$uploadPage->getFullURL( wfArrayToCGI( array(
'wpThumbWidth'
=> '80',
@@ -1076,7 +1076,7 @@
$answers .= "<div id=\"{$x}\"
class=\"answer-choice\">{$choice['text']}" .
$incorrectMsg . $correctMsg .
'</div>';
- $answers .= "<div id=\"one-answer-bar\"
style=\"margin-bottom:10px;\" class=\"answer-" . $barColor . "\">
+ $answers .= "<div id=\"one-answer-bar\"
class=\"answer-" . $barColor . "\">
<img border=\"0\"
style=\"width:{$bar_width}px; height: 9px;\" id=\"one-answer-width\"
src=\"{$wgExtensionAssetsPath}/SocialProfile/images/vote-bar-" .
$barColorNumber . ".gif\"/>
<span
class=\"answer-percent\">{$choice['percent']}%</span>
</div>";
@@ -1115,7 +1115,7 @@
{$imageTag}
<div id=\"loading-answers\">" .
$this->msg( 'quizgame-js-loading' )->text() . "</div>
- <div id=\"quizgame-answers\"
style=\"display:none;\" class=\"quizgame-answers\">
+ <div id=\"quizgame-answers\"
class=\"quizgame-answers\">
{$answers}
</div>
@@ -1184,7 +1184,7 @@
$answerColor = 'red';
$answerColorNumber = '2';
}
- $output .= "<div class=\"answer-bar\"
id=\"answer-bar-one\" style=\"display:block\">
+ $output .= "<div class=\"answer-bar\"
id=\"answer-bar-one\">
<div id=\"one-answer\"
class=\"small-answer-" . $answerClass . "\">{$choice['text']}</div>
<span id=\"one-answer-bar\"
class=\"answer-" . $answerColor . "\">
<img border=\"0\"
style=\"width:{$bar_width}px; height: 11px;\" id=\"one-answer-width\"
src=\"{$wgExtensionAssetsPath}/SocialProfile/images/vote-bar-" .
$answerColorNumber . ".gif\"/>
@@ -1268,7 +1268,7 @@
</div>
<div class=\"visualClear\"></div>
- <div class=\"hiddendiv\" style=\"display:none\">
+ <div class=\"hiddendiv\">
<img
src=\"{$wgExtensionAssetsPath}/SocialProfile/images/overlay.png\" alt=\"\" />
</div>";
@@ -1418,8 +1418,8 @@
<h1>' . $this->msg(
'quizgame-create-write-question' )->text() . '</h1>
<input name="quizgame-question"
id="quizgame-question" type="text" value="" size="64" />
<h1 class="write-answer">' . $this->msg(
'quizgame-create-write-answers' )->text() . '</h1>
- <span style="margin-top:10px;">' . $this->msg(
'quizgame-create-check-correct' )->text() . '</span>
- <span style="display:none;"
id="this-is-the-welcome-page"></span>';
+ <span class="quizgame-create-check-correct">' .
$this->msg( 'quizgame-create-check-correct' )->text() . '</span>
+ <span id="this-is-the-welcome-page"></span>';
// the span#this-is-the-welcome-page element is an epic hack
for JS
// because I can't think of a better way to detect where we are
and JS
// needs to know if it's on the welcome page or not because
there is a
@@ -1428,7 +1428,7 @@
for( $x = 1; $x <= $max_answers; $x++ ) {
$output .= "<div id=\"quizgame-answer-container-{$x}\"
class=\"quizgame-answer\"" .
- ( ( $x > 2 ) ? ' style="display:none;"' : '' )
. ">
+ ( ( $x > 2 ) ? '' : '' ) . ">
<span
class=\"quizgame-answer-number\">{$x}.</span>
<input name=\"quizgame-answer-{$x}\"
id=\"quizgame-answer-{$x}\" type=\"text\" value=\"\" size=\"32\" />
<input type=\"checkbox\"
id=\"quizgame-isright-{$x}\" name=\"quizgame-isright-{$x}\">
@@ -1441,7 +1441,7 @@
</form>
- <h1 style="margin-top:20px">' .
+ <h1 class="quizgame-create-add-picture">' .
$this->msg( 'quizgame-create-add-picture'
)->text() . '</h1>
<div id="quizgame-picture-upload">
@@ -1453,8 +1453,7 @@
</div>
<div id="quizgame-picture-preview"
class="quizgame-picture-preview"></div>
<!-- jQuery injects the link element into the next
node, the p element -->
- <p id="quizgame-picture-reupload" style="display:none">
- </p>
+ <p id="quizgame-picture-reupload"></p>
</div>
<div id="startButton" class="startButton">
diff --git a/questiongame.css b/questiongame.css
index 47f2294..6822d5a 100644
--- a/questiongame.css
+++ b/questiongame.css
@@ -239,6 +239,7 @@
.quizgame-answers {
font-size: 16px;
font-weight: bold;
+ display: none;
}
.quizgame-answers ul {
@@ -365,6 +366,10 @@
margin-top: 5px;
}
+.hiddendiv {
+ display: none;
+}
+
.edit-menu-quiz-game {
float: right;
margin: -3px 0px 0px 10px;
@@ -434,10 +439,18 @@
margin: 20px 0px 15px 0px !important;
}
-h1.write-answer {
+.write-answer {
color: #333333;
font-size: 16px;
margin: 20px 0px 10px 0px !important;
+}
+
+.quizgame-create-check-correct {
+ margin: 10px 0 0 0;
+}
+
+#this-is-the-welcome-page {
+ display: none;
}
.quizgame-answer-number {
@@ -449,6 +462,7 @@
.quizgame-answer {
margin: 10px 0px 10px 0px;
+ display:none;
}
.answer-message-correct {
@@ -481,7 +495,20 @@
font-size: 18px;
color: green;
font-weight: 800;
- margin-bottom: 15px;
+ margin: 0 0 15px 0;
+}
+
+.answer-bar {
+ margin: 0 0 10px 0;
+ display: block;
+}
+
+.quizgame-create-add-picture {
+ margin: 20px 0 0 0;
+}
+
+.quizgame-picture-reupload {
+ display: none;
}
/* View Quizzes */
@@ -681,7 +708,7 @@
color: red;
font-size: 16px;
font-weight: bold;
- margin: 0px 0px 10px 0px;
+ margin: 0 0 15px 0;
}
.the-bar {
@@ -812,3 +839,8 @@
text-decoration: none;
font-weight: bold;
}
+
+/* quizgame upload */
+.quizgame-upload {
+ display: none;
+}
--
To view, visit https://gerrit.wikimedia.org/r/334910
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6b8400364f1e3ea145d102503148c3b11ec66223
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/QuizGame
Gerrit-Branch: master
Gerrit-Owner: SamanthaNguyen <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits