Index: trunk/extensions/ArticleAssessmentPilot/test.html |
— | — | @@ -23,7 +23,7 @@ |
24 | 24 | |
25 | 25 | <body> |
26 | 26 | <div class="article-assessment-wrapper"> |
27 | | - <div id="catLinks"> |
| 27 | + <div id="catlinks"> |
28 | 28 | |
29 | 29 | </div> |
30 | 30 | </div> |
Index: trunk/extensions/ArticleAssessmentPilot/ArticleAssessmentPilot.hooks.php |
— | — | @@ -15,8 +15,6 @@ |
16 | 16 | array( 'src' => 'js/ArticleAssessment.js', 'version' => 1 ), |
17 | 17 | array( 'src' => 'js/jquery.cookie.js', 'version' => 1 ), |
18 | 18 | array( 'src' => 'js/jquery.tipsy.js', 'version' => 1 ), |
19 | | - //array( 'src' => 'js/jquery.ui.stars.js', 'version' => 1 ), |
20 | | - array( 'src' => 'js/jquery.ui.stars.min.js', 'version' => 1 ), |
21 | 19 | ); |
22 | 20 | |
23 | 21 | /* Static Functions */ |
Index: trunk/extensions/ArticleAssessmentPilot/js/ArticleAssessment.js |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | $output.find( '.article-assessment-rating-fields' ) |
74 | 74 | .append( $( settings.fieldHTML |
75 | 75 | .replace( /\{LABEL\}/g, settings.fieldPrefix + settings.fieldMessages[field] ) |
76 | | - .replace( /\{NAME\}/g, settings.fieldMessages[field] ) |
| 76 | + .replace( /\{FIELD\}/g, settings.fieldMessages[field] ) |
77 | 77 | .replace( /\{HINT\}/g, settings.fieldPrefix + settings.fieldMessages[field] + settings.fieldHintSuffix ) ) ); |
78 | 78 | $output.find( '#article-assessment-ratings' ) |
79 | 79 | .append( $( settings.ratingHTML |
— | — | @@ -81,10 +81,12 @@ |
82 | 82 | .replace( /\{COUNT\}/g, 'field-count' ) ) |
83 | 83 | ); |
84 | 84 | } |
85 | | - $( '#catLinks' ).before( $output ); |
86 | 85 | |
| 86 | + $( '#catlinks' ).before( $output ); |
| 87 | + |
87 | 88 | // initialize the star plugin |
88 | 89 | $( '.rating-field' ).each( function() { |
| 90 | + console.log(this); |
89 | 91 | $( this ) |
90 | 92 | .wrapAll( '<div class="rating-field"></div>' ) |
91 | 93 | .parent() |
— | — | @@ -93,7 +95,7 @@ |
94 | 96 | callback: function( value, link ) { |
95 | 97 | // remove any stale classes |
96 | 98 | value.$stars.each( function() { |
97 | | - $(this).removeClass( 'ui-stars-star-stale' ); |
| 99 | + $( this ).removeClass( 'ui-stars-star-stale' ); |
98 | 100 | } ); |
99 | 101 | } |
100 | 102 | } ); |
— | — | @@ -138,6 +140,10 @@ |
139 | 141 | }; |
140 | 142 | // FIXME - this should be moved out of here |
141 | 143 | $( document ).ready( function () { |
142 | | - $.ArticleAssessment.fn.init( { 'endpoint': 'hello' } ); |
| 144 | + mw.usability.load( [ '$j.ui' ], function() { |
| 145 | + $.getScript( wgScriptPath + '/extensions/ArticleAssessmentPilot/js/jquery.ui.stars.js', function() { |
| 146 | + $.ArticleAssessment.fn.init( { 'endpoint': wgScriptPath + "/api.php" } ); |
| 147 | + } ); |
| 148 | + } ); |
143 | 149 | } ); //document ready |
144 | 150 | } )( jQuery ); |
\ No newline at end of file |