From d2193998a9da39023f6dbe126eb3928afb9ea703 Mon Sep 17 00:00:00 2001 From: AllThatIsTheCase Date: Thu, 16 Apr 2015 13:19:10 +0200 Subject: [PATCH] relative paths & caching always on --- .travis.yml | 5 +---- chrome/content/zotero-better-bibtex/preferences.xul | 1 - circle.yml | 2 -- defaults/preferences/defaults.coffee | 2 -- features/step_definitions/steps.rb | 1 - resource/translators/translator.coffee | 8 ++++---- 6 files changed, 5 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index b9feb06c85..d89bd22c7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/chrome/content/zotero-better-bibtex/preferences.xul b/chrome/content/zotero-better-bibtex/preferences.xul index c5ef9eff13..c21b5e163b 100644 --- a/chrome/content/zotero-better-bibtex/preferences.xul +++ b/chrome/content/zotero-better-bibtex/preferences.xul @@ -27,7 +27,6 @@ - diff --git a/circle.yml b/circle.yml index 7f1dba4993..b7cc1a0038 100644 --- a/circle.yml +++ b/circle.yml @@ -1,8 +1,6 @@ machine: ruby: version: 2.1.5 - environment: - CACHE: yes dependencies: cache_directories: - "bin" diff --git a/defaults/preferences/defaults.coffee b/defaults/preferences/defaults.coffee index ad46f41a6a..a101471c9b 100644 --- a/defaults/preferences/defaults.coffee +++ b/defaults/preferences/defaults.coffee @@ -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') diff --git a/features/step_definitions/steps.rb b/features/step_definitions/steps.rb index f92a5ea112..cb41708ae3 100644 --- a/features/step_definitions/steps.rb +++ b/features/step_definitions/steps.rb @@ -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 diff --git a/resource/translators/translator.coffee b/resource/translators/translator.coffee index 1a4d9af9b8..98e5608c7a 100755 --- a/resource/translators/translator.coffee +++ b/resource/translators/translator.coffee @@ -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'] @@ -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)