Sophivorus has uploaded a new change for review.

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

Change subject: Add reference numbers
......................................................................

Add reference numbers

In the list tab, prepend the reference number to each list item

Change-Id: I6652bb7d286e618bbf39aaecf2ed439dc651a88c
---
M proveit.css
M proveit.js
2 files changed, 12 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikipedia/gadgets/ProveIt 
refs/changes/57/315957/1

diff --git a/proveit.css b/proveit.css
index 9dc76dd..a04a98a 100755
--- a/proveit.css
+++ b/proveit.css
@@ -50,7 +50,6 @@
 }
 
 #proveit-reference-list {
-       list-style: none;
        margin: 0;
        padding: 0;
 }
@@ -74,6 +73,10 @@
        cursor: pointer;
 }
 
+#proveit-reference-list .proveit-reference-item .proveit-reference-number {
+       margin-right: 10px;
+}
+
 #proveit-reference-list .proveit-reference-item .proveit-reference-template {
        font-weight: bold;
 }
diff --git a/proveit.js b/proveit.js
index ad93917..fac1f5c 100755
--- a/proveit.js
+++ b/proveit.js
@@ -266,7 +266,7 @@
        scanForReferences: function () {
 
                // First define the list element
-               var referenceList = $( '<ul>' ).attr( 'id', 
'proveit-reference-list' );
+               var referenceList = $( '<ol>' ).attr( 'id', 
'proveit-reference-list' );
 
                // Second, look for all the citations in the wikitext and store 
them in an array for later
                var wikitext = proveit.getTextbox().val(),
@@ -299,6 +299,12 @@
 
                                // Finally, turn all the references into list 
items and insert them into the reference list
                                referenceItem = reference.toListItem();
+
+                               // Add the reference number
+                               // We don't use the <ol> numbers because of 
stying reasons
+                               referenceItem.prepend( $( '<span>' ).addClass( 
'proveit-reference-number' ).text( i + 1 ) );
+
+                               // Add the item to the list
                                referenceList.append( referenceItem );
                        }
 
@@ -803,6 +809,7 @@
 
                        // Add the main content
                        if ( this.template ) {
+
                                // First add the template name
                                var templateSpan = $( '<span>' ).addClass( 
'proveit-reference-template' ).text( this.template );
                                item.html( templateSpan );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6652bb7d286e618bbf39aaecf2ed439dc651a88c
Gerrit-PatchSet: 1
Gerrit-Project: wikipedia/gadgets/ProveIt
Gerrit-Branch: master
Gerrit-Owner: 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