Bsitu has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/87637


Change subject: Add style to new topic
......................................................................

Add style to new topic

Change-Id: I7c706546b1e4fb29d302dbdab19dc7565199dde5
---
M Flow.i18n.php
M modules/discussion/components/topic.less
A modules/discussion/images/createtopic_hover.svg
A modules/discussion/images/createtopic_normal.svg
M modules/discussion/ui.js
M templates/topiclist.html.php
6 files changed, 60 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/37/87637/1

diff --git a/Flow.i18n.php b/Flow.i18n.php
index de3be75..117d7f4 100644
--- a/Flow.i18n.php
+++ b/Flow.i18n.php
@@ -26,7 +26,7 @@
        'flow-newtopic-content-placeholder' => 'Message text. Be nice!',
        'flow-newtopic-header' => 'Add a new topic',
        'flow-newtopic-save' => 'Add topic',
-       'flow-newtopic-start-placeholder' => 'Click here to start a new 
discussion. Be nice!',
+       'flow-newtopic-start-placeholder' => 'Start a new topic',
 
        'flow-reply-placeholder' => 'Click to {{GENDER:$1|reply}} to $1. Be 
nice!',
        'flow-reply-submit' => 'Reply',
diff --git a/modules/discussion/components/topic.less 
b/modules/discussion/components/topic.less
index 3dda31a..654ef28 100644
--- a/modules/discussion/components/topic.less
+++ b/modules/discussion/components/topic.less
@@ -77,6 +77,26 @@
   color: #231F20;
 }
 
+a.flow-new-topic-link {
+  display: block;
+  width: 25px;
+  height: 25px;
+  text-indent: -9999px;
+  position: absolute;
+  right: 0;
+  top: 7px;
+  /* @embed */
+  background-image: url("../images/createtopic_normal.svg");
+  background-position: right;
+  background-size: 25px auto;
+  background-repeat: no-repeat;
+}
+
+a.flow-new-topic-link:hover {
+  /* @embed */
+  background-image: url("../images/createtopic_hover.svg");       
+}
+
 a.flow-edit-topic-link {
   display: block;
   width: 20px;
diff --git a/modules/discussion/images/createtopic_hover.svg 
b/modules/discussion/images/createtopic_hover.svg
new file mode 100644
index 0000000..2b5e247
--- /dev/null
+++ b/modules/discussion/images/createtopic_hover.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 
0 0 36 36" xml:space="preserve">
+<g>
+       <g>
+               <path fill="#999999" 
d="M30.467,4.698v20.664l5.299,5.939c-10.793,0-29.867,0-32.167,0c-3.205,0-3.356-3.188-3.365-3.346V4.698
+                       H30.467"/>
+       </g>
+       <g>
+               <path fill="#FFFFFF" 
d="M21.187,16.406v2.432h-4.525v4.524h-2.433v-4.524H9.704v-2.432h4.524v-4.524h2.433v4.524H21.187z"/>
+       </g>
+</g>
+</svg>
diff --git a/modules/discussion/images/createtopic_normal.svg 
b/modules/discussion/images/createtopic_normal.svg
new file mode 100644
index 0000000..389a582
--- /dev/null
+++ b/modules/discussion/images/createtopic_normal.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 
6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" 
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 
0 0 36 36" xml:space="preserve">
+<g>
+       <g>
+               <path fill="#D0D2D3" 
d="M30.467,4.698v20.664l5.299,5.939c-10.793,0-29.867,0-32.167,0c-3.205,0-3.356-3.188-3.365-3.346V4.698
+                       H30.467"/>
+       </g>
+       <g>
+               <path fill="#FFFFFF" 
d="M21.187,16.406v2.432h-4.525v4.524h-2.433v-4.524H9.704v-2.432h4.524v-4.524h2.433v4.524H21.187z"/>
+       </g>
+</g>
+</svg>
diff --git a/modules/discussion/ui.js b/modules/discussion/ui.js
index c332c68..66f3ff2 100644
--- a/modules/discussion/ui.js
+++ b/modules/discussion/ui.js
@@ -109,6 +109,11 @@
 
                                mw.flow.editor.load( $( 
'.flow-newtopic-content' ) );
                        } );
+               $container.find( '.flow-new-topic-link' ).click ( function( e ) 
{
+                       e.preventDefault();
+                       $container.find( '.flow-newtopic-title' ).trigger( 
'click' ).focus();
+                       $( this ).hide();
+               } );
 
                $( '<a />' )
                        .attr( 'href', '#' )
@@ -131,6 +136,7 @@
                                                $form.find( '.flow-error' )
                                                        .remove();
                                        } );
+                               $container.find( '.flow-new-topic-link' 
).show();
                        } )
                        .insertBefore( $container.find( '.flow-newtopic-form 
input[type=submit]' ) );
 
diff --git a/templates/topiclist.html.php b/templates/topiclist.html.php
index 903d094..03b3de8 100644
--- a/templates/topiclist.html.php
+++ b/templates/topiclist.html.php
@@ -17,6 +17,9 @@
        )
 );
 
+// @Todo - Update href to a real link for no-js support
+echo Html::element( 'a', array( 'class' => 'flow-new-topic-link', 'href' => 
'#' ), wfMessage( 'flow-newtopic-start-placeholder' )->text() );
+
 if ( $block->hasErrors( 'content' ) ) {
        echo '<p>' . $block->getError( 'content' )->escaped() . '</p>';
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/87637
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c706546b1e4fb29d302dbdab19dc7565199dde5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Bsitu <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to