commit ab4c2f247d4acdc070123a327a45269ed9f0c407 parent cd6d528519b888d96ee1da322321098d7271a347 Author: Simon Kornblith <simon@simonster.com> Date: Sun, 5 Aug 2012 19:44:57 -0400 Merge branch '3.0' Diffstat:
8 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/chrome/content/zotero/xpcom/connector/translator.js b/chrome/content/zotero/xpcom/connector/translator.js @@ -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("."); diff --git a/chrome/content/zotero/xpcom/data/itemFields.js b/chrome/content/zotero/xpcom/data/itemFields.js @@ -307,6 +307,7 @@ Zotero.ItemFields = new function() { var autoCompleteFields = [ 'journalAbbreviation', + 'series', 'seriesTitle', 'seriesText', 'libraryCatalog', diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js @@ -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(); } } diff --git a/chrome/content/zotero/xpcom/translation/translator.js b/chrome/content/zotero/xpcom/translation/translator.js @@ -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("."); diff --git a/chrome/content/zotero/xpcom/utilities.js b/chrome/content/zotero/xpcom/utilities.js @@ -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 diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -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, {}); diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -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 = []; diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties @@ -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?