mirror of https://github.com/perkeep/perkeep.git
Merge branch 'master' of https://camlistore.googlesource.com/camlistore
This commit is contained in:
commit
88f9db482b
|
@ -307,7 +307,7 @@ camlistore.BlobItemContainer.prototype.search = function(callerConstraint,
|
||||||
thumbnailSize: this.thumbnailSize_
|
thumbnailSize: this.thumbnailSize_
|
||||||
},
|
},
|
||||||
sort: 1, // LastModifiedDesc
|
sort: 1, // LastModifiedDesc
|
||||||
limit: 30,
|
limit: 50,
|
||||||
constraint : {
|
constraint : {
|
||||||
logical: {
|
logical: {
|
||||||
op: 'and',
|
op: 'and',
|
||||||
|
@ -323,28 +323,9 @@ camlistore.BlobItemContainer.prototype.search = function(callerConstraint,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var callback = goog.bind(this.searchDone_, this, callerConstraint,
|
this.connection_.search(JSON.stringify(query),
|
||||||
!isContinuation);
|
goog.bind(this.searchDone_, this, callerConstraint,
|
||||||
if (window.WebSocket) {
|
!isContinuation));
|
||||||
var uri = new goog.Uri(goog.uri.utils.appendPath(
|
|
||||||
this.connection_.config_.searchRoot, 'camli/search/ws'));
|
|
||||||
uri.setDomain(location.hostname);
|
|
||||||
uri.setPort(location.port);
|
|
||||||
uri.setScheme("ws");
|
|
||||||
var ws = new WebSocket(uri.toString());
|
|
||||||
ws.onopen = function() {
|
|
||||||
var message = {
|
|
||||||
tag: 'q1',
|
|
||||||
query: query
|
|
||||||
};
|
|
||||||
ws.send(JSON.stringify(message));
|
|
||||||
};
|
|
||||||
ws.onmessage = function(e) {
|
|
||||||
callback(JSON.parse(e.data).result);
|
|
||||||
}.bind(this);
|
|
||||||
} else {
|
|
||||||
this.connection_.search(JSON.stringify(query), callback);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint,
|
camlistore.BlobItemContainer.prototype.searchDone_ = function(constraint,
|
||||||
|
|
Loading…
Reference in New Issue