0f65d587c9f0c85534dd664b41ba46f229e7205f kent Sat Mar 7 20:06:23 2015 -0800 Putting in but then ifdefing out some watermark code that looked nice, but left the word 'filter' printed all over the cart. Will try and fix soon. Wordsmithing one line of instructions a little. diff --git src/hg/lib/tablesTables.c src/hg/lib/tablesTables.c index fc3efbf..517e140 100644 --- src/hg/lib/tablesTables.c +++ src/hg/lib/tablesTables.c @@ -31,57 +31,69 @@ static void showTableFilterInstructionsEtc(struct fieldedTable *table, char *itemPlural, struct fieldedTableSegment *largerContext) /* Print instructional text, and basic summary info on who passes filter, and a submit * button just in case user needs it */ { /* Print info on matching */ int matchCount = slCount(table->rowList); if (largerContext != NULL) // Need to page? matchCount = largerContext->tableSize; printf(" %d %s found. ", matchCount, itemPlural); cgiMakeButton("submit", "update"); printf("
\n"); -printf("First row of table below, above labels, can be used to filter individual fields. "); -printf("Wildcard * and ? characters are allowed in text fields. "); +printf("First row of table below can filter. "); +printf("Wildcard * and ? characters are allowed in text filters. "); printf(">min or <max, is allowed in numerical fields.
\n"); } static void printSuggestScript(char *id, struct slName *suggestList) /* Print out a little javascript to wrap auto-suggester around control with given ID */ { printf("\n"); } +static void printWatermark(char *id, char *watermark) +/* Print light text filter prompt as watermark. */ +{ +#ifdef SOON +printf("\n"); +#endif /* SOON */ +} + static void showTableFilterControlRow(struct fieldedTable *table, struct cart *cart, char *varPrefix, int maxLenField, struct hash *suggestHash) /* Assuming we are in table already drow control row. * The suggestHash is keyed by field name. If something is there we'll assume * it's value is slName list of suggestion values */ { printf(""); int i; for (i=0; ifieldCount; ++i) { char *field = table->fields[i]; char varName[256]; safef(varName, sizeof(varName), "%s_f_%s", varPrefix, field); webPrintLinkCellStart(); @@ -107,30 +119,31 @@ /* Print input control getting previous value from cart. Set an id= * so auto-suggest can find this control. */ char *oldVal = cartUsualString(cart, varName, ""); printf("\n", varName, varName, size+1, oldVal); /* Write out javascript to initialize autosuggest on control */ if (suggestHash != NULL) { struct slName *suggestList = hashFindVal(suggestHash, field); if (suggestList != NULL) { printSuggestScript(varName, suggestList); } + printWatermark(varName, "filter"); } webPrintLinkCellEnd(); } printf(""); } static void showTableSortingLabelRow(struct fieldedTable *table, struct cart *cart, char *varPrefix, char *returnUrl) /* Put up the label row with sorting fields attached. ALso actually sort table. */ { /* Get order var */ char orderVar[256]; safef(orderVar, sizeof(orderVar), "%s_order", varPrefix);