Merge branch '3.0'

This commit is contained in:
Simon Kornblith 2012-08-05 19:44:57 -04:00
commit ab4c2f247d
8 changed files with 18 additions and 7 deletions

View File

@ -158,7 +158,10 @@ Zotero.Translators = new function() {
var properHosts = [];
var proxyHosts = [];
if(m) {
var hostnames = m[2].split(".");
// First, drop the 0- if it exists (this is an III invention)
var host = m[2];
if(host.substr(0, 2) === "0-") host = substr(2);
var hostnames = host.split(".");
for(var i=1; i<hostnames.length-2; i++) {
if(TLDS[hostnames[i].toLowerCase()]) {
var properHost = hostnames.slice(0, i+1).join(".");

View File

@ -307,6 +307,7 @@ Zotero.ItemFields = new function() {
var autoCompleteFields = [
'journalAbbreviation',
'series',
'seriesTitle',
'seriesText',
'libraryCatalog',

View File

@ -379,7 +379,7 @@ Zotero.Schema = new function(){
var enumerator = wm.getEnumerator("navigator:browser");
while (enumerator.hasMoreElements()) {
var win = enumerator.getNext();
win.ZoteroPane.buildItemTypeMenus();
win.ZoteroPane.buildItemTypeSubMenu();
win.document.getElementById('zotero-editpane-item-box').buildItemTypeMenu();
}
}

View File

@ -220,7 +220,10 @@ Zotero.Translators = new function() {
// (i.e., www.nature.com.mutex.gmu.edu => www.nature.com)
var m = /^(https?:\/\/)([^\/]+)/i.exec(uri);
if(m) {
var hostnames = m[2].split(".");
// First, drop the 0- if it exists (this is an III invention)
var host = m[2];
if(host.substr(0, 2) === "0-") host = substr(2);
var hostnames = host.split(".");
for(var i=1; i<hostnames.length-2; i++) {
if(TLDS[hostnames[i].toLowerCase()]) {
var properHost = hostnames.slice(0, i+1).join(".");

View File

@ -1238,7 +1238,7 @@ Zotero.Utilities = {
} else if(field === "tags") {
// normalize tags
var n = val.length;
var newTags = newItem.tags = new Array(n);
var newTags = newItem.tags = [];
for(var j=0; j<n; j++) {
var tag = val[j];
if(typeof tag === "object") {
@ -1253,7 +1253,7 @@ Zotero.Utilities = {
} else if(tag === "") {
continue;
}
newTags[j] = {"tag":tag.toString(), "type":1};
newTags.push({"tag":tag.toString(), "type":1});
}
} else if(field === "notes") {
// normalize notes

View File

@ -332,7 +332,7 @@ Components.utils.import("resource://gre/modules/Services.jsm");
Zotero.getString('dataDir.previousDir') + ' '
+ Zotero.Prefs.get('lastDataDir'),
buttonFlags, null,
Zotero.getString('dataDir.useProfileDir'),
Zotero.getString('dataDir.useProfileDir', Zotero.appName),
Zotero.getString('general.locate'),
null, {});

View File

@ -249,6 +249,10 @@ var ZoteroPane = new function()
this.buildItemTypeSubMenu = function () {
var moreMenu = document.getElementById('zotero-tb-add-more');
while (moreMenu.hasChildNodes()) {
moreMenu.removeChild(moreMenu.firstChild);
}
// Sort by localized name
var t = Zotero.ItemTypes.getSecondaryTypes();
var itemTypes = [];

View File

@ -67,7 +67,7 @@ errorReport.actualResult = Actual result:
dataDir.notFound = The Zotero data directory could not be found.
dataDir.previousDir = Previous directory:
dataDir.useProfileDir = Use Firefox profile directory
dataDir.useProfileDir = Use %S profile directory
dataDir.selectDir = Select a Zotero data directory
dataDir.selectedDirNonEmpty.title = Directory Not Empty
dataDir.selectedDirNonEmpty.text = The directory you selected is not empty and does not appear to be a Zotero data directory.\n\nCreate Zotero files in this directory anyway?