Skip to content

Commit

Permalink
can't set ASCII charset, replace with override
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Apr 24, 2015
1 parent 5d00936 commit 5c0d2f4
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 19 deletions.
13 changes: 6 additions & 7 deletions chrome/content/zotero-better-bibtex/preferences.xul
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
<preference id="pref-better-bibtex-format" name="extensions.zotero.translators.better-bibtex.citekeyFormat" type="string"/>
<preference id="pref-better-bibtex-skipFields" name="extensions.zotero.translators.better-bibtex.skipFields" type="string"/>
<preference id="pref-better-bibtex-server" name="extensions.zotero.httpServer.enabled" type="bool"/>
<preference id="pref-better-bibtex-unicode" name="extensions.zotero.translators.better-bibtex.unicode" type="string"/>
<preference id="pref-better-bibtex-asciiBibTeX" name="extensions.zotero.translators.better-bibtex.asciiBibTeX" type="bool"/>
<preference id="pref-better-bibtex-asciiBibLaTeX" name="extensions.zotero.translators.better-bibtex.asciiBibLaTeX" type="bool"/>
<preference id="pref-better-bibtex-preserveCaps" name="extensions.zotero.translators.better-bibtex.preserveCaps" type="string"/>
<preference id="pref-better-bibtex-useprefix" name="extensions.zotero.translators.better-bibtex.useprefix" type="bool"/>
<preference id="pref-better-bibtex-langid" name="extensions.zotero.translators.better-bibtex.langid" type="string"/>
Expand Down Expand Up @@ -101,12 +102,10 @@
<textbox id="id-better-bibtex-preferences-skipFields" preference="pref-better-bibtex-skipFields" oninput="Zotero.BetterBibTeX.pref.update();" onkeypress="setTimeout(Zotero.BetterBibTeX.pref.update, 1);"/>
</row>
<row>
<label value="&zotero.better-bibtex.unicode;"/>
<radiogroup id="id-better-bibtex-preferences-unicode" orient="vertical" preference="pref-better-bibtex-unicode" oncommand="Zotero.BetterBibTeX.pref.update();">
<radio id="id-better-bibtex-preferences-unicode-default" label="&zotero.better-bibtex.unicode.default;" value=""/>
<radio id="id-better-bibtex-preferences-unicode-always" label="&zotero.better-bibtex.unicode.always;" value="always"/>
<radio id="id-better-bibtex-preferences-unicode-never" label="&zotero.better-bibtex.unicode.never;" value="never"/>
</radiogroup>
<checkbox label="&zotero.better-bibtex.ascii.BibTeX;" preference="pref-better-bibtex-asciiBibTeX"/>
</row>
<row>
<checkbox label="&zotero.better-bibtex.ascii.BibLaTeX;" preference="pref-better-bibtex-asciiBibLaTeX"/>
</row>
<row>
<label value="&zotero.better-bibtex.doi-and-url;"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ Zotero.BetterBibTeX.updateSchema = ->
when 'show-citekey' then @pref.set('showCitekeys', @pref.get(key))
when 'skipfields' then @pref.set('skipFields', @pref.get(key))
when 'useprefix' then @pref.set('usePrefix', @pref.get(key))
when 'unicode'
@pref.set('asciiBibTeX', (@pref.get(key) != 'always'))
@pref.set('asciiBibLaTeX', (@pref.get(key) == 'never'))
else continue
@pref.prefs.clearUserPref(key)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
<!ENTITY zotero.better-bibtex.server.address "Bibliography export at ">
<!ENTITY zotero.better-bibtex.server.warning "BibTeX http export uses the general Zotero HTTP facility; please note that disabling this will disable ALL http facilities in zotero -- including the non-Firefox plugins">
<!ENTITY zotero.better-bibtex.recursive.warning "Enabling recursive export also causes Zotero to display collection content recursively">
<!ENTITY zotero.better-bibtex.unicode "Export as Unicode">
<!ENTITY zotero.better-bibtex.unicode.default "Default (Unicode for BibLaTeX, ASCII for BibTeX)">
<!ENTITY zotero.better-bibtex.unicode.always "Always">
<!ENTITY zotero.better-bibtex.unicode.never "Never">
<!ENTITY zotero.better-bibtex.ascii.BibTeX "Export BibTeX as ASCII">
<!ENTITY zotero.better-bibtex.ascii.BibLaTeX "Export BibLaTeX as ASCII">
<!ENTITY zotero.better-bibtex.fancyURLs "Clickable URLs">
<!ENTITY zotero.better-bibtex.fancyURLs.warning "Wraps urls in a \href field -- not supported by all bibliography processors!">
<!ENTITY zotero.better-bibtex.format-unique-warning "Caution: the default guarantees that each attachment has a unique filename. If you change the default, make sure the resulting filenames remain unique!">
Expand Down
5 changes: 3 additions & 2 deletions defaults/preferences/defaults.coffee
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pref('extensions.zotero.translators.better-bibtex.attachmentsNoMetadata', false)
pref('extensions.zotero.translators.better-bibtex.autoAbbrevStyle', '')
pref('extensions.zotero.translators.better-bibtex.autoAbbrev', true)
pref('extensions.zotero.translators.better-bibtex.autoExport', 'off')
pref('extensions.zotero.translators.better-bibtex.autoExport', 'idle')
pref('extensions.zotero.translators.better-bibtex.citeCommand', 'cite')
pref('extensions.zotero.translators.better-bibtex.citekeyFormat', '[auth][year]')
pref('extensions.zotero.translators.better-bibtex.DOIandURL', 'both')
Expand All @@ -16,5 +16,6 @@ pref('extensions.zotero.translators.better-bibtex.scanCitekeys', true)
pref('extensions.zotero.translators.better-bibtex.showCitekeys', false)
pref('extensions.zotero.translators.better-bibtex.skipFields', '')
pref('extensions.zotero.translators.better-bibtex.testMode', false)
pref('extensions.zotero.translators.better-bibtex.unicode', '')
pref('extensions.zotero.translators.better-bibtex.asciiBibTeX', true)
pref('extensions.zotero.translators.better-bibtex.asciiBibLaTeX', false)
pref('extensions.zotero.translators.better-bibtex.usePrefix', false)
1 change: 0 additions & 1 deletion resource/translators/Better BibLaTeX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ inRepository: true
configOptions:
getCollections: true
displayOptions:
exportCharset: "UTF-8"
exportNotes: false
exportFileData: false
useJournalAbbreviation: false
Expand Down
1 change: 0 additions & 1 deletion resource/translators/Better BibTeX.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ priority: 199
configOptions:
getCollections: true
displayOptions:
exportCharset: "ASCII"
exportNotes: true
exportFileData: false
useJournalAbbreviation: false
Expand Down
8 changes: 4 additions & 4 deletions resource/translators/translator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ Translator.initialize = ->
@testmode = Zotero.getHiddenPref('better-bibtex.testMode')
@testmode_timestamp = Zotero.getHiddenPref('better-bibtex.testMode.timestamp') if @testmode

@unicode = switch Zotero.getHiddenPref('better-bibtex.unicode')
when 'always' then @unicode = true
when 'never' then @unicode = false
else @unicode = @unicode_default or (@exportCharset?.toLowerCase() == 'utf-8')
@unicode = switch Translator.translatorID
when 'f895aa0d-f28e-47fe-b247-2ea77c6ed583' then !Zotero.getHiddenPref('better-bibtex.asciiBibLaTeX')
when 'ca65189f-8815-4afe-8c8b-8c7c15f0edca' then !Zotero.getHiddenPref('better-bibtex.asciiBibTeX')
else true

if @typeMap
typeMap = @typeMap
Expand Down

0 comments on commit 5c0d2f4

Please sign in to comment.