Sophivorus has submitted this change and it was merged.

Change subject: Add reference count
......................................................................


Add reference count

Also an exception for the way quotes are displayed

Change-Id: I5230ef9846035b4ff73a0eeffb148124d7b57ac8
---
M proveit.css
M proveit.js
2 files changed, 16 insertions(+), 13 deletions(-)

Approvals:
  Sophivorus: Verified; Looks good to me, approved



diff --git a/proveit.css b/proveit.css
index e809606..8d006bf 100755
--- a/proveit.css
+++ b/proveit.css
@@ -60,10 +60,6 @@
        padding: 10px;
 }
 
-#proveit-reference-list .proveit-reference-item:nth-child(odd) {
-       background: #f4f4f4;
-}
-
 #proveit-reference-list .proveit-reference-item:nth-child(even) {
        background: #fff;
 }
@@ -117,7 +113,7 @@
        display: table-cell;
        padding: 5px;
        vertical-align: top;
-       width: 200px;
+       width: 180px;
 }
 
 #proveit-reference-form .proveit-required label {
diff --git a/proveit.js b/proveit.js
index 7392b14..b3bedbb 100755
--- a/proveit.js
+++ b/proveit.js
@@ -25,7 +25,7 @@
         */
        messages: {
                'en': {
-                       'proveit-list-tab': 'List',
+                       'proveit-list-tab': 'List ($1)',
                        'proveit-add-tab': 'Add',
                        'proveit-reference-name-label': 'Reference name',
                        'proveit-reference-content-label': 'Reference content',
@@ -40,7 +40,7 @@
                        'proveit-no-references': 'No references found'
                },
                'es': {
-                       'proveit-list-tab': 'Lista',
+                       'proveit-list-tab': 'Lista ($1)',
                        'proveit-add-tab': 'Agregar',
                        'proveit-reference-name-label': 'Nombre de la 
referencia',
                        'proveit-reference-content-label': 'Contenido de la 
referencia',
@@ -55,7 +55,7 @@
                        'proveit-no-references': 'No se han encontrado 
referencias'
                },
                'fr': {
-                       'proveit-list-tab': 'Lister',
+                       'proveit-list-tab': 'Lister ($1)',
                        'proveit-add-tab': 'Ajouter',
                        'proveit-reference-name-label': 'Nom de la référence',
                        'proveit-reference-content-label': 'Contenu de la 
référence',
@@ -70,7 +70,7 @@
                        'proveit-no-references': 'Aucune référence trouvée'
                },
                'ru': {
-                       'proveit-list-tab': 'Список',
+                       'proveit-list-tab': 'Список ($1)',
                        'proveit-add-tab': 'Добавить',
                        'proveit-reference-name-label': 'Имя сноски',
                        'proveit-reference-content-label': 'Содержание сноски',
@@ -121,10 +121,11 @@
         * Convenience method to get a ProveIt message
         *
         * @param {string} message key without the "proveit-" prefix
+        * @param {int} number of references
         * @return {string} message value
         */
-       getMessage: function ( key ) {
-               return mw.message( 'proveit-' + key ).text();
+       getMessage: function ( key, param ) {
+               return mw.message( 'proveit-' + key, param );
        },
 
        /**
@@ -212,7 +213,7 @@
                        logo = $( '<span>' ).attr( 'id', 'proveit-logo' ).text( 
'ProveIt' ),
                        leftBracket = $( '<span>' ).attr( 'id', 
'proveit-left-bracket' ).text( '[' ),
                        rightBracket = $( '<span>' ).attr( 'id', 
'proveit-right-bracket' ).text( ']' ),
-                       listTab = $( '<span>' ).attr( 'id', 'proveit-list-tab' 
).addClass( 'active' ).text( proveit.getMessage( 'list-tab' ) ),
+                       listTab = $( '<span>' ).attr( 'id', 'proveit-list-tab' 
).addClass( 'active' ).text( proveit.getMessage( 'list-tab', 0 ) ),
                        addTab = $( '<span>' ).attr( 'id', 'proveit-add-tab' 
).text( proveit.getMessage( 'add-tab' ) ),
                        content = $( '<div>' ).attr( 'id', 'proveit-content' );
 
@@ -335,9 +336,10 @@
                                // Add the item to the list
                                referenceList.append( referenceItem );
                        }
-
+                       $( '#proveit-list-tab' ).text( proveit.getMessage( 
'list-tab', i ) );
                        $( '#proveit-content' ).html( referenceList );
                } else {
+                       $( '#proveit-list-tab' ).text( proveit.getMessage( 
'list-tab', 0 ) );
                        $( '#proveit-content' ).html( $( '<div>' ).attr( 'id', 
'proveit-no-references-message' ).text( proveit.getMessage( 'no-references' ) ) 
);
                }
        },
@@ -996,6 +998,11 @@
                                paramNameInput = $( '<input>' ).attr( 'type', 
'hidden' ).addClass( 'proveit-param-name' ).val( paramName );
                                paramValueInput = $( '<input>' ).attr( 
'placeholder', paramPlaceholder ).addClass( 'proveit-param-value' ).val( 
paramValue );
 
+                               // Exception
+                               if ( paramName === 'quote' || paramName === 
'cita' ) {
+                                       paramValueInput = $( '<textarea>' 
).attr( 'placeholder', paramPlaceholder ).addClass( 'proveit-param-value' 
).val( paramValue );
+                               }
+
                                // Mark the required parameters
                                if ( paramName in requiredParams ) {
                                        row.addClass( 'proveit-required' );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5230ef9846035b4ff73a0eeffb148124d7b57ac8
Gerrit-PatchSet: 1
Gerrit-Project: wikipedia/gadgets/ProveIt
Gerrit-Branch: master
Gerrit-Owner: Sophivorus <scheno...@gmail.com>
Gerrit-Reviewer: Sophivorus <scheno...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to