@@ -37,7 +37,8 @@ define(function (require, exports, module) {
3737 Strings = require ( "strings" ) ,
3838 StringUtils = require ( "utils/StringUtils" ) ,
3939 Global = require ( "utils/Global" ) ,
40- UpdateDialogTemplate = require ( "text!htmlContent/update-dialog.html" ) ;
40+ UpdateDialogTemplate = require ( "text!htmlContent/update-dialog.html" ) ,
41+ UpdateListTemplate = require ( "text!htmlContent/update-list.html" ) ;
4142
4243 // Extract current build number from package.json version field 0.0.0-0
4344 var _buildNumber = Number ( / - ( [ 0 - 9 ] + ) / . exec ( brackets . metadata . version ) [ 1 ] ) ;
@@ -198,32 +199,9 @@ define(function (require, exports, module) {
198199 // Populate the update data
199200 var $dlg = $ ( ".update-dialog.instance" ) ;
200201 var $updateList = $dlg . find ( ".update-info" ) ;
202+ var templateVars = $ . extend ( updates , Strings ) ;
201203
202- // TODO: Use a template instead of hand-rolling HTML code
203- updates . forEach ( function ( item , index ) {
204- var $features = $ ( "<ul>" ) ;
205-
206- item . newFeatures . forEach ( function ( feature , index ) {
207- $features . append (
208- "<li><b>" +
209- StringUtils . htmlEscape ( feature . name ) +
210- "</b> - " +
211- StringUtils . htmlEscape ( feature . description ) +
212- "</li>"
213- ) ;
214- } ) ;
215-
216- var $item = $ ( "<div>" )
217- . append ( "<h3>" +
218- StringUtils . htmlEscape ( item . versionString ) +
219- " - " +
220- StringUtils . htmlEscape ( item . dateString ) +
221- " (<a href='#' data-url='" + item . releaseNotesURL + "'>" +
222- Strings . RELEASE_NOTES +
223- "</a>)</h3>" )
224- . append ( $features )
225- . appendTo ( $updateList ) ;
226- } ) ;
204+ $updateList . html ( Mustache . render ( UpdateListTemplate , templateVars ) ) ;
227205
228206 $dlg . on ( "click" , "a" , function ( e ) {
229207 var url = $ ( e . target ) . attr ( "data-url" ) ;
0 commit comments