Unified · Split
| @@ -272,6 +272,12 @@ $.escapeRegexp = (string) -> · 271 unmodified lines | ||
| 272 | 272 | $.urlDecode = (string) -> |
| 273 | 273 | decodeURIComponent string.replace(/\+/g, '%20') |
| 274 | 274 | |
| 275 | +$.classify = (string) -> | |
| 276 | + string = string.split('_') | |
| 277 | + for substr, i in string | |
| 278 | + string[i] = substr[0].toUpperCase() + substr[1..] | |
| 279 | + string.join('') | |
| 280 | + | |
| 275 | 281 | # |
| 276 | 282 | # Miscellaneous |
| 277 | 283 | # |
| @@ -71,8 +71,7 @@ class app.views.EntryPage extends app.View · 70 unmodified lines | ||
| 71 | 71 | return |
| 72 | 72 | |
| 73 | 73 | subViewClass: -> |
| 74 | − docType = @entry.doc.type | |
| 75 | − app.views["#{docType[0].toUpperCase()}#{docType[1..]}Page"] or app.views.BasePage | |
| 74 | + app.views["#{$.classify(@entry.doc.type)}Page"] or app.views.BasePage | |
| 76 | 75 | |
| 77 | 76 | getTitle: -> |
| 78 | 77 | @entry.doc.fullName + if @entry.isIndex() then ' documentation' else " / #{@entry.name}" |