File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
2012/02/crossref-formatted-citations Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -73,18 +73,24 @@ <h2 class="loaded">Formatted citation</h2>
73
73
$ . getJSON ( "http://api.crossref.org/locales" )
74
74
)
75
75
. done ( function ( stylesResponse , localesResponse ) {
76
+ var styles = stylesResponse . message . items ;
77
+ styles . sort ( ) ;
78
+
79
+ var locales = localesResponse . message . items ;
80
+ locales . sort ( ) ;
81
+
76
82
var form = $ ( "#input" ) ;
77
83
78
84
var select = $ ( "<select/>" , { name : "style" } ) ;
79
- $ . each ( stylesResponse . message . items . sort ( ) , function ( index , value ) {
80
- $ ( "<option/>" , { text : value } ) . appendTo ( select ) ;
85
+ $ . each ( styles , function ( ) {
86
+ $ ( "<option/>" , { text : this } ) . appendTo ( select ) ;
81
87
} ) ;
82
88
select . appendTo ( form . find ( "label[for=style]" ) ) ;
83
89
select . val ( "apa" ) ;
84
90
85
91
var select = $ ( "<select/>" , { name : "locale" } ) ;
86
- $ . each ( localesResponse . message . items . sort ( ) , function ( index , value ) {
87
- $ ( "<option/>" , { text : value } ) . appendTo ( select ) ;
92
+ $ . each ( locales , function ( ) {
93
+ $ ( "<option/>" , { text : this } ) . appendTo ( select ) ;
88
94
} ) ;
89
95
select . appendTo ( form . find ( "label[for=locale]" ) ) ;
90
96
select . val ( "en-US" ) ;
You can’t perform that action at this time.
0 commit comments