Move HTMLForm-specific styles out of mediawiki.legacy.shared
authorBartosz Dziewoński <matma.rex@gmail.com>
Sun, 16 Aug 2015 14:37:31 +0000 (16:37 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 19 Aug 2015 20:20:21 +0000 (22:20 +0200)
Bug: T89981
Change-Id: Idcd20b4a776fe6741462b09885e05d1e08f67334

includes/htmlform/HTMLForm.php
resources/Resources.php
resources/src/mediawiki.legacy/images/question.png [deleted file]
resources/src/mediawiki.legacy/images/question.svg [deleted file]
resources/src/mediawiki.legacy/shared.css
resources/src/mediawiki/images/question.png [new file with mode: 0644]
resources/src/mediawiki/images/question.svg [new file with mode: 0644]
resources/src/mediawiki/mediawiki.htmlform.css [new file with mode: 0644]

index da58f20..ad650d4 100644 (file)
@@ -868,6 +868,7 @@ class HTMLForm extends ContextSource {
                # For good measure (it is the default)
                $this->getOutput()->preventClickjacking();
                $this->getOutput()->addModules( 'mediawiki.htmlform' );
+               $this->getOutput()->addModuleStyles( 'mediawiki.htmlform.styles' );
 
                $html = ''
                        . $this->getErrors( $submitResult )
index d575c8d..ddf69ed 100644 (file)
@@ -1011,6 +1011,10 @@ return array(
                        'colon-separator',
                ),
        ),
+       'mediawiki.htmlform.styles' => array(
+               'styles' => 'resources/src/mediawiki/mediawiki.htmlform.css',
+               'position' => 'top',
+       ),
        'mediawiki.htmlform.ooui.styles' => array(
                'styles' => 'resources/src/mediawiki/mediawiki.htmlform.ooui.css',
                'position' => 'top',
diff --git a/resources/src/mediawiki.legacy/images/question.png b/resources/src/mediawiki.legacy/images/question.png
deleted file mode 100644 (file)
index f7405d2..0000000
Binary files a/resources/src/mediawiki.legacy/images/question.png and /dev/null differ
diff --git a/resources/src/mediawiki.legacy/images/question.svg b/resources/src/mediawiki.legacy/images/question.svg
deleted file mode 100644 (file)
index 98fbe8d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="21.059" height="21.06"><path fill="#575757" d="M10.529 0c-5.814 0-10.529 4.714-10.529 10.529s4.715 10.53 10.529 10.53c5.816 0 10.529-4.715 10.529-10.53s-4.712-10.529-10.529-10.529zm-.002 16.767c-.861 0-1.498-.688-1.498-1.516 0-.862.637-1.534 1.498-1.534.828 0 1.5.672 1.5 1.534 0 .827-.672 1.516-1.5 1.516zm2.137-6.512c-.723.568-1 .931-1 1.739v.5h-2.205v-.603c0-1.517.449-2.136 1.154-2.688.707-.552 1.139-.845 1.139-1.637 0-.672-.414-1.051-1.24-1.051-.707 0-1.328.189-1.982.638l-1.051-1.807c.861-.604 1.93-1.034 3.342-1.034 1.912 0 3.516 1.051 3.516 3.066-.001 1.43-.794 2.188-1.673 2.877z"/></svg>
\ No newline at end of file
index 7e171cf..4fb6ac7 100644 (file)
@@ -265,56 +265,10 @@ td.mw-label {
        width: auto;
 }
 
-.mw-icon-question {
-       /* SVG support using a transparent gradient to guarantee cross-browser
-        * compatibility (browsers able to understand gradient syntax support also SVG).
-        * http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique */
-       background-image: url(images/question.png);
-       background-image: -webkit-linear-gradient(transparent, transparent), url(images/question.svg);
-       background-image: linear-gradient(transparent, transparent), url(images/question.svg);
-       background-repeat: no-repeat;
-       background-size: 13px 13px;
-       display: inline-block;
-       height: 13px;
-       width: 13px;
-       margin-left: 4px;
-}
-
-.mw-icon-question:lang(ar),
-.mw-icon-question:lang(fa),
-.mw-icon-question:lang(ur) {
-       -webkit-transform: scaleX(-1);
-       -ms-transform: scaleX(-1);
-       transform: scaleX(-1);
-}
-
 td.mw-submit {
        white-space: nowrap;
 }
 
-table.mw-htmlform-nolabel td.mw-label {
-       width: 1px;
-}
-
-tr.mw-htmlform-vertical-label td.mw-label {
-       text-align: left !important;
-}
-
-.mw-htmlform-invalid-input td.mw-input input {
-       border-color: red;
-}
-
-.mw-htmlform-flatlist div.mw-htmlform-flatlist-item {
-       display: inline;
-       margin-right: 1em;
-       white-space: nowrap;
-}
-
-.mw-htmlform-matrix td {
-       padding-left: 0.5em;
-       padding-right: 0.5em;
-}
-
 input#wpSummary {
        width: 80%;
        margin-bottom: 1em;
diff --git a/resources/src/mediawiki/images/question.png b/resources/src/mediawiki/images/question.png
new file mode 100644 (file)
index 0000000..f7405d2
Binary files /dev/null and b/resources/src/mediawiki/images/question.png differ
diff --git a/resources/src/mediawiki/images/question.svg b/resources/src/mediawiki/images/question.svg
new file mode 100644 (file)
index 0000000..98fbe8d
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="21.059" height="21.06"><path fill="#575757" d="M10.529 0c-5.814 0-10.529 4.714-10.529 10.529s4.715 10.53 10.529 10.53c5.816 0 10.529-4.715 10.529-10.53s-4.712-10.529-10.529-10.529zm-.002 16.767c-.861 0-1.498-.688-1.498-1.516 0-.862.637-1.534 1.498-1.534.828 0 1.5.672 1.5 1.534 0 .827-.672 1.516-1.5 1.516zm2.137-6.512c-.723.568-1 .931-1 1.739v.5h-2.205v-.603c0-1.517.449-2.136 1.154-2.688.707-.552 1.139-.845 1.139-1.637 0-.672-.414-1.051-1.24-1.051-.707 0-1.328.189-1.982.638l-1.051-1.807c.861-.604 1.93-1.034 3.342-1.034 1.912 0 3.516 1.051 3.516 3.066-.001 1.43-.794 2.188-1.673 2.877z"/></svg>
\ No newline at end of file
diff --git a/resources/src/mediawiki/mediawiki.htmlform.css b/resources/src/mediawiki/mediawiki.htmlform.css
new file mode 100644 (file)
index 0000000..e41248c
--- /dev/null
@@ -0,0 +1,51 @@
+/* HTMLForm styles */
+
+table.mw-htmlform-nolabel td.mw-label {
+       width: 1px;
+}
+
+.mw-htmlform-invalid-input td.mw-input input {
+       border-color: red;
+}
+
+.mw-htmlform-flatlist div.mw-htmlform-flatlist-item {
+       display: inline;
+       margin-right: 1em;
+       white-space: nowrap;
+}
+
+/* HTMLCheckMatrix */
+
+.mw-htmlform-matrix td {
+       padding-left: 0.5em;
+       padding-right: 0.5em;
+}
+
+tr.mw-htmlform-vertical-label td.mw-label {
+       text-align: left !important;
+}
+
+.mw-icon-question {
+       /* SVG support using a transparent gradient to guarantee cross-browser
+        * compatibility (browsers able to understand gradient syntax support also SVG).
+        * http://pauginer.tumblr.com/post/36614680636/invisible-gradient-technique */
+       background-image: url(images/question.png);
+       /* @embed */
+       background-image: -webkit-linear-gradient(transparent, transparent), url(images/question.svg);
+       /* @embed */
+       background-image: linear-gradient(transparent, transparent), url(images/question.svg);
+       background-repeat: no-repeat;
+       background-size: 13px 13px;
+       display: inline-block;
+       height: 13px;
+       width: 13px;
+       margin-left: 4px;
+}
+
+.mw-icon-question:lang(ar),
+.mw-icon-question:lang(fa),
+.mw-icon-question:lang(ur) {
+       -webkit-transform: scaleX(-1);
+       -ms-transform: scaleX(-1);
+       transform: scaleX(-1);
+}