b39e1e2e3d42ae73fb915c47c8fd4d6f29cf2a7e tdreszer Wed Jul 20 12:45:25 2011 -0700 Just want to check in ifdefed code while working on 2 possible paths to take. diff --git src/hg/lib/hui.c src/hg/lib/hui.c index 1a680c9..f557343 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -4068,35 +4068,82 @@ } if (membersForAll->members[dimV] && -1 != (ix = stringArrayIx(membersForAll->members[dimV]->groupTag, membership->subgroups, membership->count))) dyStringPrintf(dyHtml, " %s",membership->membership[ix]); // Saved view for last // And finally the checkBox is made! char htmlIdentifier[SMALLBUF]; safef(htmlIdentifier, sizeof(htmlIdentifier), "%s_sel", subtrack->track); cgiMakeCheckBoxFourWay(htmlIdentifier,checkedCB,enabledCB,id,dyStringContents(dyHtml),"onclick='matSubCbClick(this);' style='cursor:pointer'"); if (useDragAndDrop) printf(" "); #ifdef SUBTRACK_CFG if (cType != cfgNone) // make a wrench { // TODO: make vis dd or vis text inp or vis img. Alternatively, make '*' to denote there are subtrack level differences. + //#define SUBTRACK_CFG_VIS_SEEN + #ifdef SUBTRACK_CFG_VIS_SEEN enum trackVisibility vis = tdbVisLimitedByAncestry(cart, subtrack, TRUE); #define SUBTRACK_CFG_WRENCH "<a href='#a_cfg' onclick='return scm.cfgToggle(\"%s\");' title='Configure this %s subtrack'><img src='../images/wrench.png'></a>\n" printf(SUBTRACK_CFG_WRENCH,subtrack->track,hStringFromTv(vis)); - //#define SUBTRACK_CFG_WRENCH "<a href='#a_cfg' onclick='return scm.cfgToggle(\"%s\");' title='Configure this subtrack'><img src='../images/wrench.png'></a>\n" - //printf(SUBTRACK_CFG_WRENCH,subtrack->track); + // TODO: all of this + #else///ifndef SUBTRACK_CFG_VIS_SEEN + #define SUBTRACK_CFG_STARRED + #ifdef SUBTRACK_CFG_STARRED + //lmCleanup(&lm); + //struct lm *lm = lmInit(0); // FIXME: If used, move lmInit to outside of subtrack loop. + //struct slPair *changeViewSettings = cartVarsWithPrefixLm(cart, subtrack->track, lm); + struct slPair *subSpecificSettings = cartVarsWithPrefix(cart, subtrack->track); + htmlIdentifier[0] = '\0'; + if (subSpecificSettings) + { + // Not interested in some: + struct slPair *subSpecificFiltered = NULL; + struct slPair *onePair; + while(subSpecificSettings) + { + onePair = slPopHead(&subSpecificSettings); + if (!endsWith(onePair->name,"_sel") + && !endsWith(onePair->name,".priority") + && !endsWith(onePair->name,"_imgOrd")) + slAddHead(&subSpecificFiltered,onePair); + //else + // slPairFreeValsAndList(&onePair) + } + subSpecificSettings = subSpecificFiltered; + if (subSpecificSettings) + safef(htmlIdentifier, sizeof(htmlIdentifier), " (has differences)"); + // DEBUGGING are there other differences to be filtered + //safef(htmlIdentifier, sizeof(htmlIdentifier), " (has %d differences", slCount(subSpecificSettings)); + //safef(htmlIdentifier, sizeof(htmlIdentifier), "<span class='diff' title='Subtrack specific differences %d'>*</span>", slCount(subSpecificSettings)); + //printf("<span id-'%s_differs'>*<sup>%d</sup></span>\n",subtrack->track,slCount(subSpecificSettings)); + //{ + //printf("<span id-'%s_differs'>*<sup>%d",subtrack->track,slCount(subSpecificSettings)); + //onePair = subSpecificSettings; + //for(;onePair != NULL;onePair = onePair->next) + // printf(", %s=%s",onePair->name,(char *)onePair->val); + //printf("</sup></span>\n"); + //} + } + #define SUBTRACK_CFG_WRENCH "<span class='clickable' onclick='return scm.cfgToggle(\"%s\");' title='Configure this subtrack%s'><img src='../images/wrench.png'>%s</span>\n" + printf(SUBTRACK_CFG_WRENCH,subtrack->track,htmlIdentifier,(subSpecificSettings?"<span class='diff'>*</span>":"")); + // TODO: js support for adding/removing star. Problem: how many differences will there be? + #else///ifndef SUBTRACK_CFG_STARRED + #define SUBTRACK_CFG_WRENCH "<a href='#a_cfg' onclick='return scm.cfgToggle(\"%s\");' title='Configure this subtrack'><img src='../images/wrench.png'></a>\n" + printf(SUBTRACK_CFG_WRENCH,subtrack->track); + #endif///ndef SUBTRACK_CFG_STARRED + #endif///ndef SUBTRACK_CFG_VIS_SEEN } #endif///def SUBTRACK_CFG // A hidden field to keep track of subtrack order if it could change if (sortOrder != NULL || useDragAndDrop) { safef(htmlIdentifier, sizeof(htmlIdentifier), "%s.priority", subtrack->track); float priority = (float)cartUsualDouble(cart, htmlIdentifier, subtrack->priority); printf("<INPUT TYPE=HIDDEN NAME='%s' class='trPos' VALUE=\"%.0f\">", htmlIdentifier, priority); // keeing track of priority } // A color patch which helps distinguish subtracks in some types of composites if (doColorPatch) { printf("<TD BGCOLOR='#%02X%02X%02X'> </TD>",