kill Zotero.arrayToHash, which looks like it was never used, and Zotero.hasValues

This commit is contained in:
Simon Kornblith 2010-10-24 23:49:00 +00:00
parent 8bf5a5fb17
commit 85b703aa33
3 changed files with 3 additions and 30 deletions

View file

@ -105,7 +105,7 @@
<parameter name="skipRefresh"/>
<body>
<![CDATA[
if (Zotero.hasValues(val)) {
if (!Zotero.Utilities.prototype.isEmpty(val)) {
this._hasFilter = true;
this._filter = val;
}
@ -126,7 +126,7 @@
<property name="scope" onget="return this._scope">
<setter>
<![CDATA[
if (Zotero.hasValues(val)) {
if (!Zotero.Utilities.prototype.isEmpty(val)) {
this._hasScope = true;
this._scope = val;
}

View file

@ -971,7 +971,7 @@ var ZoteroPane = new function()
function clearTagSelection() {
if (Zotero.hasValues(this.getTagSelection())) {
if (!Zotero.Utilities.prototype.isEmpty(this.getTagSelection())) {
var tagSelector = document.getElementById('zotero-tag-selector');
tagSelector.clearAll();
}

View file

@ -67,8 +67,6 @@ var Zotero = new function(){
this.flattenArguments = flattenArguments;
this.getAncestorByTagName = getAncestorByTagName;
this.join = join;
this.arrayToHash = arrayToHash;
this.hasValues = hasValues;
this.randomString = randomString;
this.moveToUnique = moveToUnique;
@ -1178,31 +1176,6 @@ var Zotero = new function(){
}
function arrayToHash(array){
var hash = {};
for each(var val in array){
hash[val] = true;
}
return hash;
}
/*
* Returns true if an object (or associative array) has at least one value
*/
function hasValues(obj) {
Zotero.debug("WARNING: Zotero.isEmpty() is deprecated! Use Zotero.Utilities.isEmpty(obj)", 2);
for (var i in obj) {
return true;
}
return false;
}
/**
* Generate a random string of length 'len' (defaults to 8)
**/