@@ -1017,14 +1017,23 @@ lookup:
1017
1017
1018
1018
completion . charset = function ( context ) {
1019
1019
context . anchored = false ;
1020
- context . generate = function ( ) {
1021
- let names = util . Array (
1022
- "more1 more2 more3 more4 more5 static" . split ( " " ) . map ( function ( key )
1023
- options . getPref ( "intl.charsetmenu.browser." + key ) . split ( ', ' ) )
1024
- ) . flatten ( ) . uniq ( ) ;
1025
- let bundle = document . getElementById ( "liberator-charset-bundle" ) ;
1026
- return names . map ( function ( name ) [ name , bundle . getString ( name . toLowerCase ( ) + ".title" ) ] ) ;
1027
- } ;
1020
+ if ( services . get ( "vc" ) . compare ( Application . version , "32" ) < 0 ) {
1021
+ context . generate = function ( ) {
1022
+ let names = util . Array (
1023
+ "more1 more2 more3 more4 more5 static" . split ( " " ) . map ( function ( key )
1024
+ options . getPref ( "intl.charsetmenu.browser." + key ) . split ( ', ' ) )
1025
+ ) . flatten ( ) . uniq ( ) ;
1026
+ let bundle = document . getElementById ( "liberator-charset-bundle" ) ;
1027
+ return names . map ( function ( name ) [ name , bundle . getString ( name . toLowerCase ( ) + ".title" ) ] ) ;
1028
+ } ;
1029
+ }
1030
+ else {
1031
+ context . generate = function ( ) {
1032
+ let { CharsetMenu} = Cu . import ( "resource://gre/modules/CharsetMenu.jsm" , { } ) ;
1033
+ let data = CharsetMenu . getData ( ) ;
1034
+ return data . pinnedCharsets . concat ( data . otherCharsets ) . map ( function ( o ) [ o . value , o . label ] ) ;
1035
+ } ;
1036
+ }
1028
1037
} ;
1029
1038
1030
1039
completion . directory = function directory ( context , full ) {
0 commit comments