Show file path instead of "(null)" when installing style via file open
And fix deprecation warning from passing an nsIFile (Also updates the Zotero.Styles.install() documentation to note that the first parameter's `file` property can be a string path.)
This commit is contained in:
parent
045f1fbb7e
commit
9a43b53ebe
|
@ -269,8 +269,9 @@ Zotero.Styles = new function() {
|
||||||
/**
|
/**
|
||||||
* Installs a style file, getting the contents of an nsIFile and showing appropriate
|
* Installs a style file, getting the contents of an nsIFile and showing appropriate
|
||||||
* error messages
|
* error messages
|
||||||
* @param {Object} style An object with one of the following properties
|
* @param {Object} style - An object with one of the following properties
|
||||||
* - file: An nsIFile representing a style on disk
|
* - file: An nsIFile or string path representing a style on disk
|
||||||
|
* - path: A string path
|
||||||
* - url: A url of the location of the style (local or remote)
|
* - url: A url of the location of the style (local or remote)
|
||||||
* - string: A string containing the style data
|
* - string: A string containing the style data
|
||||||
* @param {String} origin The origin of the style, either a filename or URL, to be
|
* @param {String} origin The origin of the style, either a filename or URL, to be
|
||||||
|
|
|
@ -623,7 +623,7 @@ ZoteroCommandLineHandler.prototype = {
|
||||||
if(file.leafName.substr(-4).toLowerCase() === ".csl"
|
if(file.leafName.substr(-4).toLowerCase() === ".csl"
|
||||||
|| file.leafName.substr(-8).toLowerCase() === ".csl.txt") {
|
|| file.leafName.substr(-8).toLowerCase() === ".csl.txt") {
|
||||||
// Install CSL file
|
// Install CSL file
|
||||||
Zotero.Styles.install(file);
|
Zotero.Styles.install({ file: file.path }, file.path);
|
||||||
} else {
|
} else {
|
||||||
// Ask before importing
|
// Ask before importing
|
||||||
var checkState = {
|
var checkState = {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user