Thiemo Kreuz (WMDE) has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/400684 )
Change subject: Properly load collapsible sitelinks CSS exactly when needed
......................................................................
Properly load collapsible sitelinks CSS exactly when needed
This patch fixes a series of issues:
* The first is the placement of this CSS. It didn't really belong to
"toolbaritem". Note that the relevant "coppalsible" class is set on the
"sitelinkgroupview" template.
* This CSS is only needed on JS clients. But it's needed before the
collapsible feature kicks in. Otherwise a brief flash of an unstyled
"[Collapse]" button would be visible. This is achieved by making it it's
own module, and loading it as a dependency.
* The "toolbaritem" is not loaded on diff pages. That's why diff showed
an unstyled "[Collapse]". This is fixed now.
Bug: T182767
Change-Id: I6713bdf4c4994475d80c3a7a55cf6550d17b1968
---
M view/resources/jquery/wikibase/resources.php
R view/resources/jquery/wikibase/themes/default/images/collapse.png
R view/resources/jquery/wikibase/themes/default/images/collapse.svg
R view/resources/jquery/wikibase/themes/default/images/expand.png
R view/resources/jquery/wikibase/themes/default/images/expand.svg
A
view/resources/jquery/wikibase/themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css
M
view/resources/jquery/wikibase/toolbar/themes/default/jquery.wikibase.toolbaritem.css
7 files changed, 37 insertions(+), 29 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/84/400684/1
diff --git a/view/resources/jquery/wikibase/resources.php
b/view/resources/jquery/wikibase/resources.php
index cbb7caf..2854688 100644
--- a/view/resources/jquery/wikibase/resources.php
+++ b/view/resources/jquery/wikibase/resources.php
@@ -323,10 +323,10 @@
'themes/default/jquery.wikibase.sitelinkgroupview.css',
],
'dependencies' => [
- 'jquery.makeCollapsible',
'jquery.sticknode',
'jquery.ui.EditableTemplatedWidget',
'jquery.util.EventSingletonManager',
+
'jquery.wikibase.sitelinkgroupview.mw-collapsible.styles',
'mediawiki.jqueryMsg', // for {{plural}} and
{{gender}} support in messages
'wikibase.buildErrorOutput',
'wikibase.sites',
@@ -336,6 +336,12 @@
],
],
+ 'jquery.wikibase.sitelinkgroupview.mw-collapsible.styles' =>
$moduleTemplate + [
+ 'styles' => [
+
'themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css',
+ ],
+ ],
+
'jquery.wikibase.sitelinklistview' => $moduleTemplate + [
'scripts' => [
'jquery.wikibase.sitelinklistview.js',
diff --git
a/view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/collapse.png
b/view/resources/jquery/wikibase/themes/default/images/collapse.png
similarity index 100%
rename from
view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/collapse.png
rename to view/resources/jquery/wikibase/themes/default/images/collapse.png
Binary files differ
diff --git
a/view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/collapse.svg
b/view/resources/jquery/wikibase/themes/default/images/collapse.svg
similarity index 100%
rename from
view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/collapse.svg
rename to view/resources/jquery/wikibase/themes/default/images/collapse.svg
diff --git
a/view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/expand.png
b/view/resources/jquery/wikibase/themes/default/images/expand.png
similarity index 100%
rename from
view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/expand.png
rename to view/resources/jquery/wikibase/themes/default/images/expand.png
Binary files differ
diff --git
a/view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/expand.svg
b/view/resources/jquery/wikibase/themes/default/images/expand.svg
similarity index 100%
rename from
view/resources/jquery/wikibase/toolbar/themes/default/images/icons/oojs-ui/expand.svg
rename to view/resources/jquery/wikibase/themes/default/images/expand.svg
diff --git
a/view/resources/jquery/wikibase/themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css
b/view/resources/jquery/wikibase/themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css
new file mode 100644
index 0000000..0165e1a
--- /dev/null
+++
b/view/resources/jquery/wikibase/themes/default/jquery.wikibase.sitelinkgroupview.mw-collapsible.css
@@ -0,0 +1,30 @@
+/**
+ * @license GNU GPL v2+
+ */
+.wikibase-sitelinkgroupview > .mw-collapsible-toggle {
+ background-position: right;
+ background-repeat: no-repeat;
+ height: 24px;
+ overflow: hidden;
+ text-indent: 24px;
+ width: 24px;
+}
+
+.wikibase-sitelinkgroupview > .mw-collapsible-toggle,
+.wikibase-sitelinkgroupview > .mw-collapsible-toggle-expanded {
+ /* 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/collapse.png );
+ /* @embed */
+ background-image: linear-gradient( transparent, transparent ), url(
images/collapse.svg );
+}
+
+.wikibase-sitelinkgroupview > .mw-collapsible-toggle-collapsed {
+ /* 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/expand.png );
+ /* @embed */
+ background-image: linear-gradient( transparent, transparent ), url(
images/expand.svg );
+}
diff --git
a/view/resources/jquery/wikibase/toolbar/themes/default/jquery.wikibase.toolbaritem.css
b/view/resources/jquery/wikibase/toolbar/themes/default/jquery.wikibase.toolbaritem.css
index 3796d14..82ae747 100644
---
a/view/resources/jquery/wikibase/toolbar/themes/default/jquery.wikibase.toolbaritem.css
+++
b/view/resources/jquery/wikibase/toolbar/themes/default/jquery.wikibase.toolbaritem.css
@@ -6,31 +6,3 @@
.wikibase-toolbarlabel.ui-state-disabled {
color: #72777d;
}
-
-.wikibase-toolbar-item .mw-collapsible-toggle {
- background-position: right;
- background-repeat: no-repeat;
- height: 24px;
- overflow: hidden;
- text-indent: 24px;
- width: 24px;
-}
-
-.wikibase-toolbar-item .mw-collapsible-toggle,
-.wikibase-toolbar-item .mw-collapsible-toggle-expanded {
- /* 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/icons/oojs-ui/collapse.png );
- /* @embed */
- background-image: linear-gradient( transparent, transparent ), url(
images/icons/oojs-ui/collapse.svg );
-}
-
-.wikibase-toolbar-item .mw-collapsible-toggle-collapsed {
- /* 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/icons/oojs-ui/expand.png );
- /* @embed */
- background-image: linear-gradient( transparent, transparent ), url(
images/icons/oojs-ui/expand.svg );
-}
--
To view, visit https://gerrit.wikimedia.org/r/400684
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6713bdf4c4994475d80c3a7a55cf6550d17b1968
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Kreuz (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits