r109834 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109833‎ | r109834 | r109835 >
Date:17:02, 23 January 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Redoing r108960 with history

If it was a 3rd party library, there probably wouldn't have been any use doing this
Modified paths:
  • /trunk/phase3/resources/Resources.php (modified) (history)
  • /trunk/phase3/resources/jquery/images/jquery.arrowSteps.divider-ltr.png (added) (history)
  • /trunk/phase3/resources/jquery/images/jquery.arrowSteps.divider-rtl.png (added) (history)
  • /trunk/phase3/resources/jquery/images/jquery.arrowSteps.head-ltr.png (added) (history)
  • /trunk/phase3/resources/jquery/images/jquery.arrowSteps.head-rtl.png (added) (history)
  • /trunk/phase3/resources/jquery/images/jquery.arrowSteps.tail-ltr.png (added) (history)
  • /trunk/phase3/resources/jquery/images/jquery.arrowSteps.tail-rtl.png (added) (history)
  • /trunk/phase3/resources/jquery/jquery.arrowSteps.css (added) (history)
  • /trunk/phase3/resources/jquery/jquery.arrowSteps.js (added) (history)

Diff [purge]

Index: trunk/phase3/resources/jquery/images/jquery.arrowSteps.tail-ltr.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/jquery/images/jquery.arrowSteps.tail-ltr.png
___________________________________________________________________
Added: svn:mime-type
11 + image/png
Index: trunk/phase3/resources/jquery/images/jquery.arrowSteps.tail-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/jquery/images/jquery.arrowSteps.tail-rtl.png
___________________________________________________________________
Added: svn:mime-type
22 + image/png
Index: trunk/phase3/resources/jquery/images/jquery.arrowSteps.head-ltr.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/jquery/images/jquery.arrowSteps.head-ltr.png
___________________________________________________________________
Added: svn:mime-type
33 + image/png
Index: trunk/phase3/resources/jquery/images/jquery.arrowSteps.head-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/jquery/images/jquery.arrowSteps.head-rtl.png
___________________________________________________________________
Added: svn:mime-type
44 + image/png
Index: trunk/phase3/resources/jquery/images/jquery.arrowSteps.divider-ltr.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/jquery/images/jquery.arrowSteps.divider-ltr.png
___________________________________________________________________
Added: svn:mime-type
55 + image/png
Index: trunk/phase3/resources/jquery/images/jquery.arrowSteps.divider-rtl.png
Cannot display: file marked as a binary type.
svn:mime-type = image/png
Property changes on: trunk/phase3/resources/jquery/images/jquery.arrowSteps.divider-rtl.png
___________________________________________________________________
Added: svn:mime-type
66 + image/png
Index: trunk/phase3/resources/jquery/jquery.arrowSteps.js
@@ -0,0 +1,81 @@
 2+/**
 3+ * jQuery arrowSteps plugin
 4+ * Copyright Neil Kandalgaonkar, 2010
 5+ *
 6+ * This work is licensed under the terms of the GNU General Public License,
 7+ * version 2 or later.
 8+ * (see http://www.fsf.org/licensing/licenses/gpl.html).
 9+ * Derivative works and later versions of the code must be free software
 10+ * licensed under the same or a compatible license.
 11+ *
 12+ *
 13+ * DESCRIPTION
 14+ *
 15+ * Show users their progress through a series of steps, via a row of items that fit
 16+ * together like arrows. One item can be highlighted at a time.
 17+ *
 18+ *
 19+ * SYNOPSIS
 20+ *
 21+ * <ul id="robin-hood-daffy">
 22+ * <li id="guard"><div>Guard!</div></li>
 23+ * <li id="turn"><div>Turn!</div></li>
 24+ * <li id="parry"><div>Parry!</div></li>
 25+ * <li id="dodge"><div>Dodge!</div></li>
 26+ * <li id="spin"><div>Spin!</div></li>
 27+ * <li id="ha"><div>Ha!</div></li>
 28+ * <li id="thrust"><div>Thrust!</div></li>
 29+ * </ul>
 30+ *
 31+ * <script language="javascript"><!--
 32+ * $( '#robin-hood-daffy' ).arrowSteps();
 33+ *
 34+ * $( '#robin-hood-daffy' ).arrowStepsHighlight( '#guard' );
 35+ * // 'Guard!' is highlighted.
 36+ *
 37+ * // ... user completes the 'guard' step ...
 38+ *
 39+ * $( '#robin-hood-daffy' ).arrowStepsHighlight( '#turn' );
 40+ * // 'Turn!' is highlighted.
 41+ *
 42+ * //-->
 43+ * </script>
 44+ *
 45+ */
 46+
 47+( function( $j ) {
 48+ $j.fn.arrowSteps = function() {
 49+ this.addClass( 'arrowSteps' );
 50+ var $steps = this.find( 'li' );
 51+
 52+ var width = parseInt( 100 / $steps.length, 10 );
 53+ $steps.css( 'width', width + '%' );
 54+
 55+ // every step except the last one has an arrow at the right hand side. Also add in the padding
 56+ // for the calculated arrow width.
 57+ var arrowWidth = parseInt( this.outerHeight(), 10 );
 58+ $steps.filter( ':not(:last-child)' ).addClass( 'arrow' )
 59+ .find( 'div' ).css( 'padding-right', arrowWidth.toString() + 'px' );
 60+
 61+ this.data( 'arrowSteps', $steps );
 62+ return this;
 63+ };
 64+
 65+ $j.fn.arrowStepsHighlight = function( selector ) {
 66+ var $steps = this.data( 'arrowSteps' );
 67+ var $previous;
 68+ $j.each( $steps, function( i, step ) {
 69+ var $step = $j( step );
 70+ if ( $step.is( selector ) ) {
 71+ if ($previous) {
 72+ $previous.addClass( 'tail' );
 73+ }
 74+ $step.addClass( 'head' );
 75+ } else {
 76+ $step.removeClass( 'head tail lasthead' );
 77+ }
 78+ $previous = $step;
 79+ } );
 80+ };
 81+
 82+} )( jQuery );
Property changes on: trunk/phase3/resources/jquery/jquery.arrowSteps.js
___________________________________________________________________
Added: svn:eol-style
183 + native
Index: trunk/phase3/resources/jquery/jquery.arrowSteps.css
@@ -0,0 +1,45 @@
 2+.arrowSteps {
 3+ list-style-type: none;
 4+ list-style-image: none;
 5+ border: 1px solid #666666;
 6+ position: relative;
 7+}
 8+
 9+.arrowSteps li {
 10+ float: left;
 11+ padding: 0px;
 12+ margin: 0px;
 13+ border: 0 none;
 14+}
 15+
 16+.arrowSteps li div {
 17+ padding: 0.5em;
 18+ text-align: center;
 19+ white-space: nowrap;
 20+ overflow: hidden;
 21+}
 22+
 23+.arrowSteps li.arrow div {
 24+ /* @embed */
 25+ background: url(images/jquery.arrowSteps.divider-ltr.png) no-repeat right center;
 26+}
 27+
 28+/* applied to the element preceding the highlighted step */
 29+.arrowSteps li.arrow.tail div {
 30+ /* @embed */
 31+ background: url(images/jquery.arrowSteps.tail-ltr.png) no-repeat right center;
 32+}
 33+
 34+/* this applies to all highlighted, including the last */
 35+.arrowSteps li.head div {
 36+ /* @embed */
 37+ background: url(images/jquery.arrowSteps.head-ltr.png) no-repeat left center;
 38+ font-weight: bold;
 39+}
 40+
 41+/* this applies to all highlighted arrows except the last */
 42+.arrowSteps li.arrow.head div {
 43+ /* TODO: eliminate duplication of jquery.arrowSteps.head.png embedding */
 44+ /* @embed */
 45+ background: url(images/jquery.arrowSteps.head-ltr.png) no-repeat right center;
 46+}
\ No newline at end of file
Property changes on: trunk/phase3/resources/jquery/jquery.arrowSteps.css
___________________________________________________________________
Added: svn:eol-style
147 + native
Index: trunk/phase3/resources/Resources.php
@@ -82,6 +82,10 @@
8383 'jquery.appear' => array(
8484 'scripts' => 'resources/jquery/jquery.appear.js',
8585 ),
 86+ 'jquery.arrowSteps' => array(
 87+ 'scripts' => 'resources/jquery/jquery.arrowSteps.js',
 88+ 'styles' => 'resources/jquery/jquery.arrowSteps.css',
 89+ ),
8690 'jquery.async' => array(
8791 'scripts' => 'resources/jquery/jquery.async.js',
8892 ),

Sign-offs

UserFlagDate
Hasharinspected09:14, 24 January 2012
Hashartested09:14, 24 January 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108960Adding jquery.arrowSteps to core, from UploadWizardjohnduhart06:07, 15 January 2012

Comments

#Comment by Hashar (talk | contribs)   09:14, 24 January 2012

Thanks Sam.

Status & tagging log