Merge branch '3.0'
This commit is contained in:
commit
f1f4044018
13 changed files with 609 additions and 650 deletions
|
@ -10,231 +10,9 @@
|
|||
orient="vertical"
|
||||
buttons="accept"
|
||||
buttonlabelaccept="&zotero.about.close;"
|
||||
onload="onLoad(); moveToAlertPosition(); sizeToContent();"
|
||||
onload="moveToAlertPosition(); sizeToContent();"
|
||||
ondialogaccept="return true;">
|
||||
|
||||
<script>
|
||||
<![CDATA[
|
||||
function onLoad()
|
||||
{
|
||||
var translators = {
|
||||
"af-ZA": [
|
||||
"Samuel Murray"
|
||||
],
|
||||
|
||||
"ar": [
|
||||
"Khaled Fadhel",
|
||||
"Ahmed Rizk"
|
||||
],
|
||||
|
||||
"bg-BG": [
|
||||
"Peter Stoilov"
|
||||
],
|
||||
|
||||
"ca-AD": [
|
||||
"Joan Junyent"
|
||||
],
|
||||
|
||||
"cs-CZ": [
|
||||
"Milan Janíček",
|
||||
"ffvii",
|
||||
"strepon"
|
||||
],
|
||||
|
||||
"da-DK": [
|
||||
"madsjensen",
|
||||
"Banta"
|
||||
],
|
||||
|
||||
"de-AT": [
|
||||
"stw"
|
||||
],
|
||||
|
||||
"de-CH": [
|
||||
"stw"
|
||||
],
|
||||
|
||||
"de-DE": [
|
||||
"Harald Kliems",
|
||||
"Jason Verber",
|
||||
"Morris Vollmann"
|
||||
],
|
||||
|
||||
"el-GR": [
|
||||
"DeadAtHeaven",
|
||||
"modestos",
|
||||
"sarandos",
|
||||
"geraki"
|
||||
],
|
||||
|
||||
"es-ES": [
|
||||
"Alberto González Palomo"
|
||||
],
|
||||
|
||||
"et-EE": [
|
||||
"aethralis",
|
||||
"brainbulb",
|
||||
"lagle"
|
||||
],
|
||||
|
||||
"eu-ES": [
|
||||
"David Lindemann",
|
||||
"Goofy"
|
||||
],
|
||||
|
||||
"fa": [
|
||||
"CRCIS"
|
||||
],
|
||||
|
||||
"fi-FI": [
|
||||
"hirvela"
|
||||
],
|
||||
|
||||
"fr-FR": [
|
||||
"fiuzzy",
|
||||
"Grégoire Colly",
|
||||
"Jojaba",
|
||||
"La Luciole",
|
||||
"locale_locker",
|
||||
"Marie Léger-St-Jean",
|
||||
"Pascal Pichon"
|
||||
],
|
||||
|
||||
"gl-ES": [
|
||||
"Manuel Meixide"
|
||||
],
|
||||
|
||||
"he-IL": [
|
||||
"Doron Tilleman"
|
||||
],
|
||||
|
||||
"hr-HR": [
|
||||
"Vukovic"
|
||||
],
|
||||
|
||||
"hu-HU": [
|
||||
"Tamas Dombos"
|
||||
],
|
||||
|
||||
"it-IT": [
|
||||
"Andrea",
|
||||
"Elisabetta Manuele",
|
||||
"Giuliano Masseroni",
|
||||
"Luca Pedrazzi"
|
||||
],
|
||||
|
||||
"ja-JP": [
|
||||
"himura",
|
||||
"Andreas Bovens",
|
||||
"Michael Schiltz",
|
||||
"ehito"
|
||||
],
|
||||
|
||||
"ko-KR": [
|
||||
"Moonseok Kim",
|
||||
"wtspout"
|
||||
],
|
||||
|
||||
"mn-MN": [
|
||||
"L. Gantulga"
|
||||
],
|
||||
|
||||
"nb-NO": [
|
||||
"Finn Arne Jørgensen",
|
||||
"Bernt Øyvind Thorvaldsen"
|
||||
],
|
||||
|
||||
"nl-NL": [
|
||||
"Rintze Zelle",
|
||||
"Andreas Bovens",
|
||||
"Michael Schiltz"
|
||||
],
|
||||
|
||||
"pl-PL": [
|
||||
"novacellus",
|
||||
"Pawel Krzyworzeka",
|
||||
"Trevor Owens"
|
||||
],
|
||||
|
||||
"pt-BR": [
|
||||
"Fábio Baqueiro Figueiredo",
|
||||
"Humberto Sartini"
|
||||
],
|
||||
|
||||
"pt-PT": [
|
||||
"Manuel Menezes de Sequeira",
|
||||
"tmfs",
|
||||
"gandrenf"
|
||||
],
|
||||
|
||||
"ro-RO": [
|
||||
"Turcan"
|
||||
],
|
||||
|
||||
"ru-RU": [
|
||||
"Maxim Yurkin",
|
||||
"Yaroslav"
|
||||
],
|
||||
|
||||
"sk-SK": [
|
||||
"Milan Regec"
|
||||
],
|
||||
|
||||
"sl-SI": [
|
||||
"Martin Srebotnjak"
|
||||
],
|
||||
|
||||
"sr-RS": [
|
||||
"DakSrbija",
|
||||
"Igor Miletic"
|
||||
],
|
||||
|
||||
"sv-SE": [
|
||||
"Erik Stattin"
|
||||
],
|
||||
|
||||
"th-TH": [
|
||||
"chin"
|
||||
],
|
||||
|
||||
"tr-TR": [
|
||||
"Zeki Celikbas"
|
||||
],
|
||||
|
||||
"vi-VN": [
|
||||
"Đoàn Như Tùng"
|
||||
],
|
||||
|
||||
"zh-CN": [
|
||||
"santawort",
|
||||
"Wenping Guo",
|
||||
"liyan"
|
||||
],
|
||||
|
||||
"zh-TW": [
|
||||
"Chun-Chung Chen",
|
||||
"Alan Cheng"
|
||||
]
|
||||
};
|
||||
|
||||
var box = document.getElementById('zotero-translators-list');
|
||||
|
||||
for (var locale in translators) {
|
||||
var heading = document.createElement('label');
|
||||
heading.className = 'locale';
|
||||
heading.setAttribute('value', locale + ':');
|
||||
box.appendChild(heading);
|
||||
|
||||
for each(var person in translators[locale]) {
|
||||
var label = document.createElement('label');
|
||||
label.setAttribute('value', person);
|
||||
box.appendChild(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<script src="include.js"/>
|
||||
|
||||
<vbox id="aboutcontent">
|
||||
|
@ -264,10 +42,6 @@
|
|||
<label value="Simon Kornblith"/>
|
||||
<label value="Faolan Cheslack-Postava"/>
|
||||
</vbox>
|
||||
<label class="subhead" value="&zotero.about.localizations;"/>
|
||||
<vbox class="subcontent">
|
||||
<vbox id="zotero-translators-list"/>
|
||||
</vbox>
|
||||
<label class="zotero-text-link" href="http://www.zotero.org/support/credits_and_acknowledgments" value="&zotero.moreCreditsAndAcknowledgements;"/>
|
||||
</vbox>
|
||||
<vbox id="column2">
|
||||
|
|
|
@ -664,7 +664,7 @@ To add a new preference:
|
|||
</row>
|
||||
|
||||
<row>
|
||||
<label value="&zotero.preferences.keys.library;" control="textbox-library"/>
|
||||
<label value="&zotero.preferences.keys.focusLibrariesPane;" control="textbox-library"/>
|
||||
<label/>
|
||||
<textbox id="textbox-library" maxlength="1" size="1" preference="pref-keys-library"/>
|
||||
</row>
|
||||
|
|
|
@ -362,7 +362,7 @@ Zotero_TranslatorTester.prototype.fetchPageAndRunTest = function(test, testDoneC
|
|||
var hiddenBrowser = Zotero.HTTP.processDocuments(test.url,
|
||||
function(doc) {
|
||||
if(test.defer) {
|
||||
Zotero.setTimeout(function() { runTest(doc) }, 10000, true);
|
||||
Zotero.setTimeout(function() { runTest(doc) }, 30000, true);
|
||||
} else {
|
||||
runTest(doc);
|
||||
}
|
||||
|
|
|
@ -891,7 +891,7 @@ Zotero.Attachments = new function(){
|
|||
break;
|
||||
|
||||
default:
|
||||
var value = item.getField(field, false, true);
|
||||
var value = '' + item.getField(field, false, true);
|
||||
}
|
||||
|
||||
var re = new RegExp("\{?([^%\{\}]*)" + rpl + "(\{[0-9]+\})?" + "([^%\{\}]*)\}?");
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -653,19 +653,27 @@ Zotero.Integration = new function() {
|
|||
|
||||
if(!message && typeof(e) == "object") message = "\n\n"+e.toString();
|
||||
|
||||
if(message.indexOf("ExceptionAlreadyDisplayed") !== -1) {
|
||||
if(message.indexOf("ExceptionAlreadyDisplayed") === -1) {
|
||||
displayError = Zotero.getString("integration.error.generic")+message;
|
||||
}
|
||||
Zotero.debug(e);
|
||||
}
|
||||
|
||||
if(displayError) {
|
||||
var showErrorInFirefox = !document;
|
||||
|
||||
if(document) {
|
||||
document.activate();
|
||||
document.displayAlert(displayError,
|
||||
Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_STOP,
|
||||
Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK);
|
||||
} else {
|
||||
try {
|
||||
document.activate();
|
||||
document.displayAlert(displayError,
|
||||
Components.interfaces.zoteroIntegrationDocument.DIALOG_ICON_STOP,
|
||||
Components.interfaces.zoteroIntegrationDocument.DIALOG_BUTTONS_OK);
|
||||
} catch(e) {
|
||||
showErrorInFirefox = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(showErrorInFirefox) {
|
||||
Zotero.Integration.activate();
|
||||
Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||
.getService(Components.interfaces.nsIPromptService)
|
||||
|
@ -1234,7 +1242,6 @@ Zotero.Integration.Fields.prototype.get = function(callback) {
|
|||
callback(this._fields);
|
||||
}
|
||||
} catch(e) {
|
||||
Zotero.logError(e);
|
||||
Zotero.Integration.handleError(e, this._doc);
|
||||
}
|
||||
return;
|
||||
|
@ -1284,7 +1291,6 @@ Zotero.Integration.Fields.prototype._retrieveFields = function() {
|
|||
} else if(topic === "fields-progress" && me.progressCallback) {
|
||||
me.progressCallback((data ? parseInt(data, 10)*(3/4) : null));
|
||||
} else if(topic === "fields-error") {
|
||||
Zotero.logError(data);
|
||||
Zotero.Integration.handleError(data, me._doc);
|
||||
}
|
||||
}, QueryInterface:XPCOMUtils.generateQI([Components.interfaces.nsIObserver, Components.interfaces.nsISupports])});
|
||||
|
@ -1540,7 +1546,6 @@ Zotero.Integration.Fields.prototype.updateDocument = function(forceCitations, fo
|
|||
ignoreCitationChanges, deleteCitations, callback));
|
||||
}));
|
||||
} catch(e) {
|
||||
Zotero.logError(e);
|
||||
Zotero.Integration.handleError(e, this._doc);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -316,17 +316,20 @@ Zotero.Sync.Storage.WebDAV = (function () {
|
|||
|
||||
case 403:
|
||||
case 500:
|
||||
Zotero.debug(response);
|
||||
Zotero.Sync.Storage.EventManager.error(
|
||||
Zotero.getString('sync.storage.error.fileUploadFailed')
|
||||
+ " " + Zotero.getString('sync.storage.error.checkFileSyncSettings')
|
||||
);
|
||||
|
||||
case 507:
|
||||
Zotero.debug(response);
|
||||
Zotero.Sync.Storage.EventManager.error(
|
||||
Zotero.getString('sync.storage.error.webdav.insufficientSpace')
|
||||
);
|
||||
|
||||
default:
|
||||
Zotero.debug(response);
|
||||
Zotero.Sync.Storage.EventManager.error(
|
||||
"Unexpected file upload status " + status
|
||||
+ " in Zotero.Sync.Storage.WebDAV.onUploadComplete()"
|
||||
|
|
|
@ -1633,20 +1633,30 @@ Zotero.Translate.Web.prototype._translateServerComplete = function(statusCode, r
|
|||
}
|
||||
|
||||
// Extract items from ATOM/JSON response
|
||||
var items = [];
|
||||
var contents = response.getElementsByTagNameNS("http://www.w3.org/2005/Atom", "content");
|
||||
var items = [], contents;
|
||||
if("getElementsByTagNameNS" in response) {
|
||||
contents = response.getElementsByTagNameNS("http://www.w3.org/2005/Atom", "content");
|
||||
} else { // IE...
|
||||
contents = response.getElementsByTagName("content");
|
||||
}
|
||||
for(var i=0, n=contents.length; i<n; i++) {
|
||||
var content = contents[i];
|
||||
if(content.getAttributeNS("http://zotero.org/ns/api", "type") != "json") continue;
|
||||
if("getAttributeNS" in content) {
|
||||
if(content.getAttributeNS("http://zotero.org/ns/api", "type") != "json") continue;
|
||||
} else if(content.getAttribute("zapi:type") != "json") { // IE...
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
item = JSON.parse("textContent" in content ?
|
||||
content.textContent : content.innerText);
|
||||
var item = JSON.parse("textContent" in content ?
|
||||
content.textContent : content.text);
|
||||
} catch(e) {
|
||||
Zotero.logError(e);
|
||||
this.complete(false, "Invalid JSON response received from server");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!("attachments" in item)) item.attachments = [];
|
||||
this._runHandler("itemDone", null, item);
|
||||
items.push(item);
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ Zotero.Translate.ItemSaver.prototype = {
|
|||
if(type == "note") { // handle notes differently
|
||||
newItem = new Zotero.Item('note');
|
||||
newItem.libraryID = this._libraryID;
|
||||
newItem.setNote(item.note);
|
||||
if(item.note) newItem.setNote(item.note);
|
||||
var myID = newItem.save();
|
||||
newItem = Zotero.Items.get(myID);
|
||||
} else {
|
||||
|
@ -462,6 +462,7 @@ Zotero.Translate.ItemSaver.prototype = {
|
|||
"_saveNotes":function(item, parentID) {
|
||||
for(var i=0; i<item.notes.length; i++) {
|
||||
var note = item.notes[i];
|
||||
if(!note) continue;
|
||||
var myNote = new Zotero.Item('note');
|
||||
myNote.libraryID = this._libraryID;
|
||||
myNote.setNote(typeof note == "object" ? note.note : note);
|
||||
|
|
|
@ -339,33 +339,58 @@ Zotero.Utilities = {
|
|||
* Decodes HTML entities within a string, returning plain text
|
||||
* @type String
|
||||
*/
|
||||
"unescapeHTML":function(/**String*/ str) {
|
||||
// If no tags, no need to unescape
|
||||
if(str.indexOf("<") === -1 && str.indexOf("&") === -1) return str;
|
||||
"unescapeHTML":new function() {
|
||||
var nsIScriptableUnescapeHTML, node;
|
||||
|
||||
if(Zotero.isFx && !Zotero.isBookmarklet) {
|
||||
if(!Zotero.Utilities._nsISUHTML) {
|
||||
Zotero.Utilities._nsISUHTML = Components.classes["@mozilla.org/feed-unescapehtml;1"]
|
||||
.getService(Components.interfaces.nsIScriptableUnescapeHTML);
|
||||
}
|
||||
return Zotero.Utilities._nsISUHTML.unescape(str);
|
||||
} else if(Zotero.isNode) {
|
||||
/*var doc = require('jsdom').jsdom(str, null, {
|
||||
"features":{
|
||||
"FetchExternalResources":false,
|
||||
"ProcessExternalResources":false,
|
||||
"MutationEvents":false,
|
||||
"QuerySelector":false
|
||||
return function(/**String*/ str) {
|
||||
// If no tags, no need to unescape
|
||||
if(str.indexOf("<") === -1 && str.indexOf("&") === -1) return str;
|
||||
|
||||
if(Zotero.isFx && !Zotero.isBookmarklet) {
|
||||
// Create a node and use the textContent property to do unescaping where
|
||||
// possible, because this approach preserves <br/>
|
||||
if(node === undefined) {
|
||||
var platformVersion = Components.classes["@mozilla.org/xre/app-info;1"]
|
||||
.getService(Components.interfaces.nsIXULAppInfo).platformVersion;
|
||||
if(Components.classes["@mozilla.org/xpcom/version-comparator;1"]
|
||||
.getService(Components.interfaces.nsIVersionComparator)
|
||||
.compare(platformVersion, "12.0") >= 0) {
|
||||
var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
||||
.createInstance(Components.interfaces.nsIDOMParser);
|
||||
var domDocument = parser.parseFromString("<!DOCTYPE html><html></html>",
|
||||
"text/html");
|
||||
node = domDocument.createElement("div");
|
||||
} else {
|
||||
node = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(!doc.documentElement) return str;
|
||||
return doc.documentElement.textContent;*/
|
||||
return Zotero.Utilities.cleanTags(str);
|
||||
} else {
|
||||
var node = document.createElement("div");
|
||||
node.innerHTML = str;
|
||||
return node.textContent;
|
||||
}
|
||||
|
||||
if(node) {
|
||||
node.innerHTML = str;
|
||||
return node.textContent.replace(/ {2,}/g, " ");
|
||||
} else if(!nsIScriptableUnescapeHTML) {
|
||||
nsIScriptableUnescapeHTML = Components.classes["@mozilla.org/feed-unescapehtml;1"]
|
||||
.getService(Components.interfaces.nsIScriptableUnescapeHTML);
|
||||
}
|
||||
return nsIScriptableUnescapeHTML.unescape(str);
|
||||
} else if(Zotero.isNode) {
|
||||
/*var doc = require('jsdom').jsdom(str, null, {
|
||||
"features":{
|
||||
"FetchExternalResources":false,
|
||||
"ProcessExternalResources":false,
|
||||
"MutationEvents":false,
|
||||
"QuerySelector":false
|
||||
}
|
||||
});
|
||||
if(!doc.documentElement) return str;
|
||||
return doc.documentElement.textContent;*/
|
||||
return Zotero.Utilities.cleanTags(str);
|
||||
} else {
|
||||
if(!node) node = document.createElement("div");
|
||||
node.innerHTML = str;
|
||||
return ("textContent" in node ? node.textContent : node.innerText).replace(/ {2,}/g, " ");
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -547,7 +547,6 @@ var ZoteroPane = new function()
|
|||
break;
|
||||
case 'library':
|
||||
document.getElementById('zotero-collections-tree').focus();
|
||||
ZoteroPane_Local.collectionsView.selection.select(0);
|
||||
break;
|
||||
case 'quicksearch':
|
||||
document.getElementById('zotero-tb-search').select();
|
||||
|
|
|
@ -123,7 +123,7 @@
|
|||
|
||||
<!ENTITY zotero.preferences.keys.openZotero "Open/Close Zotero Pane">
|
||||
<!ENTITY zotero.preferences.keys.toggleFullscreen "Toggle Fullscreen Mode">
|
||||
<!ENTITY zotero.preferences.keys.library "Library">
|
||||
<!ENTITY zotero.preferences.keys.focusLibrariesPane "Focus Libraries Pane">
|
||||
<!ENTITY zotero.preferences.keys.quicksearch "Quick Search">
|
||||
<!ENTITY zotero.preferences.keys.newItem "Create a new item">
|
||||
<!ENTITY zotero.preferences.keys.newNote "Create a new note">
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 734 B After Width: | Height: | Size: 635 B |
Loading…
Reference in a new issue