Merge branch '3.0'

This commit is contained in:
Dan Stillman 2011-12-01 14:43:30 -05:00
commit 2ebb9ddaf1
3 changed files with 35 additions and 7 deletions

View file

@ -410,8 +410,9 @@ Zotero.Search.prototype.addCondition = function(condition, operator, value, requ
for each(var part in parts) {
this.addCondition('blockStart');
if (condition == 'quicksearch-titlesAndCreators') {
if (condition == 'quicksearch-titleCreatorYear') {
this.addCondition('title', operator, part.text, false);
this.addCondition('year', operator, part.text, false);
}
else {
this.addCondition('field', operator, part.text, false);
@ -437,7 +438,7 @@ Zotero.Search.prototype.addCondition = function(condition, operator, value, requ
this.addCondition('blockEnd');
}
if (condition == 'quicksearch-titlesAndCreators') {
if (condition == 'quicksearch-titleCreatorYear') {
this.addCondition('noChildren', 'true');
}
@ -1189,6 +1190,15 @@ Zotero.Search.prototype._buildQuery = function(){
openParens++;
break;
case 'year':
condSQL += 'fieldID IN (?) AND ';
condSQLParams.push(Zotero.ItemFields.getID('date'));
condSQL += "valueID IN (SELECT valueID FROM "
+ "itemDataValues WHERE ";
openParens++;
break;
case 'collection':
var col;
if (condition.value) {
@ -1872,7 +1882,7 @@ Zotero.SearchConditions = new function(){
},
{
name: 'quicksearch-titlesAndCreators',
name: 'quicksearch-titleCreatorYear',
operators: {
is: true,
isNot: true,
@ -2129,6 +2139,19 @@ Zotero.SearchConditions = new function(){
template: true // mark for special handling
},
{
name: 'year',
operators: {
is: true,
isNot: true,
contains: true,
doesNotContain: true
},
table: 'itemData',
field: 'STRFTIME("%Y", SUBSTR(value, 1, 10))',
special: true
},
{
name: 'numberfield',
operators: {

View file

@ -1754,12 +1754,12 @@ const ZOTERO_CONFIG = {
var prefixLen = prefix.length;
var modes = {
titlesAndCreators: {
label: "Titles & Creators"
titleCreatorYear: {
label: "Title, Creator, Year"
},
fields: {
label: "All Fields"
label: "All Fields & Tags"
},
everything: {
@ -1771,6 +1771,11 @@ const ZOTERO_CONFIG = {
Zotero.Prefs.set("search.quicksearch-mode", "fields");
mode = 'fields';
}
// TEMP -- pre-3.0b3
else if (modes[mode] == 'titlesAndCreators') {
Zotero.Prefs.set("search.quicksearch-mode", "titleCreatorYear");
mode = 'titleCreatorYear'
}
var hbox = document.getAnonymousNodes(searchBox)[0];
var input = hbox.getElementsByAttribute('class', 'textbox-input')[0];

View file

@ -426,7 +426,7 @@
#zotero-tb-search
{
font-size: 11px !important;
width: 150px;
width: 160px;
}
#zotero-tb-search-menu-button