- offer to remove Zotero integration pipe owned by root
- locale updates for this patch and r6207
This commit is contained in:
parent
1d08b9ec31
commit
f11986ce04
|
@ -73,15 +73,29 @@ Zotero.Integration = new function() {
|
|||
if(_fifoFile.exists()) {
|
||||
_fifoFile.remove(false);
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
Zotero.debug("Could not remove old integration pipe", 1);
|
||||
} catch (e) {
|
||||
Zotero.debug("Error removing old integration pipe", 1);
|
||||
Components.utils.reportError(
|
||||
"Zotero word processor integration initialization failed. "
|
||||
+ "See http://forums.zotero.org/discussion/12054/#Item_10 "
|
||||
+ "for instructions on correcting this problem."
|
||||
);
|
||||
return;
|
||||
if(Zotero.isMac) {
|
||||
try {
|
||||
// can attempt to delete on OS X
|
||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService);
|
||||
var deletePipe = promptService.confirm(null, Zotero.getString("integration.error.title"), Zotero.getString("integration.error.deletePipe"));
|
||||
if(!deletePipe) return;
|
||||
let escapedFifoFile = _fifoFile.path.replace("'", "'\\''");
|
||||
_executeAppleScript("do shell script \"rmdir '"+escapedFifoFile+"'; rm -f '"+escapedFifoFile+"'\" with administrator privileges", true);
|
||||
if(_fifoFile.exists()) return;
|
||||
} catch(e) {
|
||||
Zotero.debug(e);
|
||||
}
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// make a new pipe
|
||||
|
@ -263,26 +277,35 @@ Zotero.Integration = new function() {
|
|||
*/
|
||||
this.activate = function() {
|
||||
if(Zotero.isMac) {
|
||||
if(_osascriptFile === undefined) {
|
||||
_osascriptFile = Components.classes["@mozilla.org/file/local;1"].
|
||||
createInstance(Components.interfaces.nsILocalFile);
|
||||
_osascriptFile.initWithPath("/usr/bin/osascript");
|
||||
if(!_osascriptFile.exists()) _osascriptFile = false;
|
||||
}
|
||||
|
||||
if(_osascriptFile) {
|
||||
var proc = Components.classes["@mozilla.org/process/util;1"].
|
||||
createInstance(Components.interfaces.nsIProcess);
|
||||
proc.init(_osascriptFile);
|
||||
if(Zotero.oscpu == "PPC Mac OS X 10.4" || Zotero.oscpu == "Intel Mac OS X 10.4") {
|
||||
// 10.4 doesn't support "tell application id"
|
||||
proc.run(false, ['-e', 'tell application "Firefox" to activate'], 2);
|
||||
} else {
|
||||
proc.run(false, ['-e', 'tell application id "org.mozilla.firefox" to activate'], 2);
|
||||
}
|
||||
if(Zotero.oscpu == "PPC Mac OS X 10.4" || Zotero.oscpu == "Intel Mac OS X 10.4") {
|
||||
// 10.4 doesn't support "tell application id"
|
||||
_executeAppleScript('tell application "Firefox" to activate');
|
||||
} else {
|
||||
_executeAppleScript('tell application id "org.mozilla.firefox" to activate');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs an AppleScript on OS X
|
||||
*
|
||||
* @param script {String}
|
||||
* @param block {Boolean} Whether the script should block until the process is finished.
|
||||
*/
|
||||
function _executeAppleScript(script, block) {
|
||||
if(_osascriptFile === undefined) {
|
||||
_osascriptFile = Components.classes["@mozilla.org/file/local;1"].
|
||||
createInstance(Components.interfaces.nsILocalFile);
|
||||
_osascriptFile.initWithPath("/usr/bin/osascript");
|
||||
if(!_osascriptFile.exists()) _osascriptFile = false;
|
||||
}
|
||||
if(_osascriptFile) {
|
||||
var proc = Components.classes["@mozilla.org/process/util;1"].
|
||||
createInstance(Components.interfaces.nsIProcess);
|
||||
proc.init(_osascriptFile);
|
||||
proc.run(block, ['-e', script], 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -543,8 +543,6 @@ annotations.collapse.tooltip = Collapse Annotation
|
|||
annotations.expand.tooltip = Expand Annotation
|
||||
annotations.oneWindowWarning = Annotations for a snapshot may only be opened in one browser window simultaneously. This snapshot will be opened without annotations.
|
||||
|
||||
integration.error.incompatibleVersion = This version of the Zotero word processor plugin ($INTEGRATION_VERSION) is incompatible with the currently installed version of the Zotero Firefox extension (%1$S). Please ensure you are using the latest versions of both components.
|
||||
|
||||
integration.fields.label = Fields
|
||||
integration.referenceMarks.label = ReferenceMarks
|
||||
integration.fields.caption = Microsoft Word Fields are less likely to be accidentally modified, but cannot be shared with OpenOffice.
|
||||
|
@ -556,12 +554,19 @@ integration.regenerate.title = Do you want to regenerate the citation?
|
|||
integration.regenerate.body = The changes you have made in the citation editor will be lost.
|
||||
integration.regenerate.saveBehavior = Always follow this selection.
|
||||
|
||||
integration.deleteCitedItem.title = Are you sure you want to remove this reference?
|
||||
integration.deleteCitedItem.body = This reference is cited in the text of your document. Deleting it will remove all citations.
|
||||
integration.revertAll.title = Are you sure you want to revert all edits to your bibliography?
|
||||
integration.revertAll.body = If you choose to continue, all references cited in the text will appear in the bibliography with their original text, and any references manually added will be removed from the bibliography.
|
||||
integration.revertAll.button = Revert All
|
||||
integration.revert.title = Are you sure you want to revert this edit?
|
||||
integration.revert.body = If you choose to continue, the text of the bibliography entries corresponded to the selected item(s) will be replaced with the unmodified text specified by the selected style.
|
||||
integration.revert.button = Revert
|
||||
integration.removeBibEntry.title = The selected references is cited within your document.
|
||||
integration.removeBibEntry.body = Are you sure you want to omit it from your bibliography?
|
||||
|
||||
integration.emptyCitationWarning.title = Blank Citation
|
||||
integration.emptyCitationWarning.body = The citation you have specified would be empty in the currently selected style. Are you sure you want to add it?
|
||||
|
||||
integration.error.incompatibleVersion = This version of the Zotero word processor plugin ($INTEGRATION_VERSION) is incompatible with the currently installed version of the Zotero Firefox extension (%1$S). Please ensure you are using the latest versions of both components.
|
||||
integration.error.title = Zotero Integration Error
|
||||
integration.error.notInstalled = Firefox could not load the component required to communicate with your word processor. Please ensure that the appropriate Firefox extension is installed and try again.
|
||||
integration.error.generic = Zotero experienced an error updating your document.
|
||||
|
@ -570,6 +575,8 @@ integration.error.mustInsertBibliography = You must insert a bibliography before
|
|||
integration.error.cannotInsertHere = Zotero fields cannot be inserted here.
|
||||
integration.error.notInCitation = You must place the cursor in a Zotero citation to edit it.
|
||||
integration.error.noBibliography = The current bibliographic style does not define a bibliography. If you wish to add a bibliography, please choose another style.
|
||||
integration.error.deletePipe = The pipe that Zotero uses to communicate with the word processor could not be initialized. Would you like Zotero to attempt to correct this error? You will be prompted for your password.
|
||||
|
||||
integration.replace = Replace this Zotero field?
|
||||
integration.missingItem.single = This item no longer exists in your Zotero database. Do you want to select a substitute item?
|
||||
integration.missingItem.multiple = Item %1$S in this citation no longer exists in your Zotero database. Do you want to select a substitute item?
|
||||
|
@ -667,6 +674,11 @@ proxies.error.scheme.noHost = A multi-site proxy scheme must contain the host
|
|||
proxies.error.scheme.noPath = A valid proxy scheme must contain either the path variable (%p) or the directory and filename variables (%d and %f).
|
||||
proxies.error.host.proxyExists = You have already defined another proxy for the host %1$S.
|
||||
proxies.error.scheme.invalid = The entered proxy scheme is invalid; it would apply to all hosts.
|
||||
proxies.notification.recognized.label = Zotero detected that you are accessing this website through a proxy. Would you like to automatically redirect future requests to %1$S through %2$S?
|
||||
proxies.notification.associated.label = Zotero automatically associated this site with a previously defined proxy. Future requests to %1$S will be redirected to %2$S.
|
||||
proxies.notification.redirected.label = Zotero automatically redirected your request to %1$S through the proxy at %2$S.
|
||||
proxies.notification.enable.button = Enable...
|
||||
proxies.notification.settings.button = Proxy Settings...
|
||||
proxies.recognized.message = Adding this proxy will allow Zotero to recognize items from its pages and will automatically redirect future requests to %1$S through %2$S.
|
||||
proxies.recognized.add = Add Proxy
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user