Skip to content

Commit

Permalink
relative paths & caching always on
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Apr 16, 2015
1 parent 5299a11 commit d219399
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 14 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ env:
- TAG=import
- TAG=export1
- TAG=export2
- TAG=import CACHE=yes
- TAG=export1 CACHE=yes
- TAG=export2 CACHE=yes
- TAG=bulkexport CACHE=yes
- TAG=bulkexport
script: bundle exec rake test[$TAG]
before_install:
- npm update
Expand Down
1 change: 0 additions & 1 deletion chrome/content/zotero-better-bibtex/preferences.xul
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<preference id="pref-better-bibtex-auto-abbrev" name="extensions.zotero.translators.better-bibtex.autoAbbrev" type="bool"/>
<preference id="pref-better-bibtex-pin-citekeys" name="extensions.zotero.translators.better-bibtex.pinCitekeys" type="string"/>
<preference id="pref-better-bibtex-raw-imports" name="extensions.zotero.translators.better-bibtex.rawImports" type="bool"/>
<preference id="pref-better-bibtex-caching" name="extensions.zotero.translators.better-bibtex.caching" type="bool"/>
<preference id="pref-better-bibtex-show-citekey" name="extensions.zotero.translators.better-bibtex.showCitekeys" type="bool"/>
<preference id="pref-better-bibtex-auto-export" name="extensions.zotero.translators.better-bibtex.autoExport" type="string"/>
<preference id="pref-better-bibtex-rescan-citekeys" name="extensions.zotero.translators.better-bibtex.scanCitekeys" type="bool"/>
Expand Down
2 changes: 0 additions & 2 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
machine:
ruby:
version: 2.1.5
environment:
CACHE: yes
dependencies:
cache_directories:
- "bin"
Expand Down
2 changes: 0 additions & 2 deletions defaults/preferences/defaults.coffee
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
pref('extensions.zotero.translators.better-bibtex.attachmentRelativePath', false)
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', 'disabled')
pref('extensions.zotero.translators.better-bibtex.caching', false)
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 Down
1 change: 0 additions & 1 deletion features/step_definitions/steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
profile['extensions.zotero.translators.better-bibtex.debug'] = true
end

profile['extensions.zotero.translators.better-bibtex.caching'] = true if ENV['CACHE'] == 'yes'
profile['extensions.zotero.translators.better-bibtex.attachmentRelativePath'] = true
profile['extensions.zotfile.useZoteroToRename'] = true

Expand Down
8 changes: 4 additions & 4 deletions resource/translators/translator.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ Translator.initialize = ->
return if @initialized
@initialized = true

@caching = Zotero.getHiddenPref('better-bibtex.caching') && @label.indexOf('Better ') == 0
@caching = {'f895aa0d-f28e-47fe-b247-2ea77c6ed583': 'Better BibLaTeX', 'ca65189f-8815-4afe-8c8b-8c7c15f0edca': 'Better BibTeX'}[Translator.translatorID]
@logging = Zotero.getHiddenPref('better-bibtex.logging')

for own attr, f of @fieldMap or {}
@BibLaTeXDataFieldMap[f.name] = f if f.name

@skipFields = (field.trim() for field in (Zotero.getHiddenPref('better-bibtex.skipFields') || '').split(','))
for pref in ['usePrefix', 'preserveCaps', 'fancyURLs', 'langID', 'attachmentRelativePath', 'rawImports', 'DOIandURL', 'attachmentsNoMetadata']
for pref in ['usePrefix', 'preserveCaps', 'fancyURLs', 'langID', 'rawImports', 'DOIandURL', 'attachmentsNoMetadata']
@[pref] = Zotero.getHiddenPref("better-bibtex.#{pref}")

for option in ['useJournalAbbreviation', 'exportPath', 'exportCharset', 'exportFileData', 'exportNotes']
Expand Down Expand Up @@ -291,8 +291,8 @@ Reference::esc_attachments = (f) ->
when Translator.testmode
Translator.attachmentCounter += 1
a.path = "files/#{Translator.attachmentCounter}/#{att.localPath.replace(/.*[\/\\]/, '')}"
when Translator.attachmentRelativePath
a.path = att.localPath.slice(Translator.exportPath.length) if Translator.exportPath && att.localPath.indexOf(Translator.exportPath) == 0
when Translator.exportPath && att.localPath.indexOf(Translator.exportPath) == 0
a.path = att.localPath.slice(Translator.exportPath.length)

attachments.push(a)

Expand Down

0 comments on commit d219399

Please sign in to comment.