[sword-cvs] sword/src/modules/filters gbfhtmlhref.cpp,1.27,1.28 osishtmlhref.cpp,1.21,1.22 thmlhtmlhref.cpp,1.48,1.49
sword@www.crosswire.org
sword@www.crosswire.org
Sat, 27 Mar 2004 03:56:01 -0700
Update of /cvs/core/sword/src/modules/filters
In directory www:/tmp/cvs-serv23167
Modified Files:
gbfhtmlhref.cpp osishtmlhref.cpp thmlhtmlhref.cpp
Log Message:
mg: applied Terry's forgotten patches
Index: gbfhtmlhref.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/gbfhtmlhref.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- gbfhtmlhref.cpp 31 Jan 2004 00:09:31 -0000 1.27
+++ gbfhtmlhref.cpp 27 Mar 2004 10:55:59 -0000 1.28
@@ -24,6 +24,12 @@
SWORD_NAMESPACE_START
+GBFHTMLHREF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
+ if (module) {
+ version = module->Name();
+ }
+}
+
GBFHTMLHREF::GBFHTMLHREF() {
setTokenStart("<");
setTokenEnd(">");
@@ -143,9 +149,9 @@
}
}
- else if (!strncmp(token, "WG", 2) || !strncmp(token, "WH", 2)) { // strong's numbers
- buf += " <small><em><<a href=\"type=Strongs value=";
- for (tok = token+1; *tok; tok++)
+ else if (!strncmp(token, "WG", 2)) { // strong's numbers
+ buf += " <small><em><<a href=\"strongs://Greek/";
+ for (tok = token+2; *tok; tok++)
//if(token[i] != '\"')
buf += *tok;
buf += "\">";
@@ -154,10 +160,36 @@
buf += *tok;
buf += "</a>></em></small>";
}
-
- else if (!strncmp(token, "WTG", 3) || !strncmp(token, "WTH", 3)) { // strong's numbers tense
- buf += " <small><em>(<a href=\"type=Strongs value=";
+
+ else if (!strncmp(token, "WH", 2)) { // strong's numbers
+ buf += " <small><em><<a href=\"strongs://Hebrew/";
+ for (tok = token+2; *tok; tok++)
+ //if(token[i] != '\"')
+ buf += *tok;
+ buf += "\">";
for (tok = token + 2; *tok; tok++)
+ //if(token[i] != '\"')
+ buf += *tok;
+ buf += "</a>></em></small>";
+ }
+
+ else if (!strncmp(token, "WTG", 3)) { // strong's numbers tense
+
+ buf += " <small><em>(<a href=\"strongs://Greek/";
+ for (tok = token + 3; *tok; tok++)
+ if(*tok != '\"')
+ buf += *tok;
+ buf += "\">";
+ for (tok = token + 3; *tok; tok++)
+ if(*tok != '\"')
+ buf += *tok;
+ buf += "</a>)</em></small>";
+ }
+
+ else if (!strncmp(token, "WTH", 3)) { // strong's numbers tense
+
+ buf += " <small><em>(<a href=\"strongs://Hebrew/";
+ for (tok = token + 3; *tok; tok++)
if(*tok != '\"')
buf += *tok;
buf += "\">";
@@ -168,7 +200,7 @@
}
else if (!strncmp(token, "WT", 2) && strncmp(token, "WTH", 3) && strncmp(token, "WTG", 3)) { // morph tags
- buf += " <small><em>(<a href=\"type=morph class=none value=";
+ buf += " <small><em>(<a href=\"morph:///";
for (tok = token + 2; *tok; tok++)
if(*tok != '\"')
buf += *tok;
@@ -203,7 +235,7 @@
if (vkey) {
// leave this special osis type in for crossReference notes types? Might thml use this some day? Doesn't hurt.
//char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
- buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", vkey->getText(), 'n', footnoteNumber.c_str(), 'n');
+ buf.appendFormatted("<a href=\"noteID://%s/%s/%c/%s\"><small><sup>*%c</sup></small></a> ", u->version.c_str(), vkey->getText(), 'n', footnoteNumber.c_str(), 'n');
}
u->suspendTextPassThru = true;
}
Index: osishtmlhref.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/osishtmlhref.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- osishtmlhref.cpp 24 Jan 2004 18:42:40 -0000 1.21
+++ osishtmlhref.cpp 27 Mar 2004 10:55:59 -0000 1.22
@@ -25,6 +25,8 @@
OSISHTMLHREF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false")));
+ if (module)
+ version = module->Name();
}
@@ -95,12 +97,17 @@
if (i < 0) i = 0; // to handle our -1 condition
val = strchr(attrib, ':');
val = (val) ? (val + 1) : attrib;
+ SWBuf gh;
+ if(*val == 'G')
+ gh = "Greek";
+ if(*val == 'H')
+ gh = "Hebrew";
const char *val2 = val;
if ((strchr("GH", *val)) && (isdigit(val[1])))
val2++;
if ((!strcmp(val2, "3588")) && (lastText.length() < 1))
show = false;
- else buf.appendFormatted(" <small><em><<a href=\"type=Strongs value=%s\">%s</a>></em></small> ", val, val2);
+ else buf.appendFormatted(" <small><em><<a href=\"strongs://%s/%s\">%s</a>></em></small> ", (gh.length()) ? gh.c_str() : "", val2, val2);
} while (++i < count);
}
if ((attrib = tag.getAttribute("morph")) && (show)) {
@@ -118,7 +125,7 @@
const char *val2 = val;
if ((*val == 'T') && (strchr("GH", val[1])) && (isdigit(val[2])))
val2+=2;
- buf.appendFormatted(" <small><em>(<a href=\"type=morph class=%s value=%s\">%s</a>)</em></small> ", tag.getAttribute("morph"), val, val2);
+ buf.appendFormatted(" <small><em>(<a href=\"morph://%s/%s\">%s</a>)</em></small> ", tag.getAttribute("morph"), val, val2);
} while (++i < count);
}
}
@@ -149,7 +156,7 @@
SWCATCH ( ... ) { }
if (vkey) {
char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
- buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", vkey->getText(), ch, footnoteNumber.c_str(), ch);
+ buf.appendFormatted("<a href=\"noteID://%s/%s/%c/%s\"><small><sup>*%c</sup></small></a> ", u->version.c_str(), vkey->getText(), ch, footnoteNumber.c_str(), ch);
}
}
u->suspendTextPassThru = true;
Index: thmlhtmlhref.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/thmlhtmlhref.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- thmlhtmlhref.cpp 24 Jan 2004 18:42:40 -0000 1.48
+++ thmlhtmlhref.cpp 27 Mar 2004 10:55:59 -0000 1.49
@@ -53,27 +53,19 @@
if (tag.getName() && !strcmp(tag.getName(), "sync")) {
SWBuf value = tag.getAttribute("value");
if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "morph")) { //>
- buf += "<small><em>(<a href=\"";
- buf += "type=";
- buf += tag.getAttribute("type");
-
- //const char* value = tag.getAttribute("value");
- buf += " value=";
- buf += (value.length()) ? value.c_str() : "";
- buf += "\">";
+ buf.appendFormatted("<small><em>(<a href=\"morph://Greek/%s\">",(value.length()) ? value.c_str() : "");
buf += (value.length()) ? value.c_str() : "";
buf += "</a>) </em></small>";
}
else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "Strongs")) {
- buf += "<small><em><<a href=\"";
- buf += "type=";
- buf += tag.getAttribute("type");
-
- //const char* value = tag.getAttribute("value");
- buf += " value=";
- buf += (value.length()) ? value.c_str() : "";
- buf += "\">";
- value<<1;
+ if(*value == 'H') {
+ value<<1;
+ buf.appendFormatted("<small><em><<a href=\"strongs://Hebrew/%s\">",(value.length()) ? value.c_str() : "");
+ }
+ else if(*value == 'G') {
+ value<<1;
+ buf.appendFormatted("<small><em><<a href=\"strongs://Greek/%s\">",(value.length()) ? value.c_str() : "");
+ }
buf += (value.length()) ? value.c_str() : "";
buf += "</a>> </em></small>";
}
@@ -99,7 +91,7 @@
if (vkey) {
// leave this special osis type in for crossReference notes types? Might thml use this some day? Doesn't hurt.
char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
- buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", vkey->getText(), ch, footnoteNumber.c_str(), ch);
+ buf.appendFormatted("<a href=\"noteID://%s/%s/%c/%s\"><small><sup>*%c</sup></small></a> ", u->version.c_str(), vkey->getText(), ch, footnoteNumber.c_str(), ch);
}
u->suspendTextPassThru = true;
}
@@ -110,7 +102,7 @@
}
// <scripRef> tag
else if (!strcmp(tag.getName(), "scripRef")) {
- if (!tag.isEndTag()) {
+ if (!tag.isEndTag()) {
if (!tag.isEmpty()) {
u->suspendTextPassThru = true;
}
@@ -120,16 +112,8 @@
SWBuf refList = u->startTag.getAttribute("passage");
if (!refList.length())
refList = u->lastTextNode;
- SWBuf version = tag.getAttribute("version");
- buf += " <a href=\"";
- if (version.length()) {
- buf += "version=";
- buf += version;
- buf += " ";
- }
- buf += "passage=";
- buf += refList.c_str();
- buf += "\">";
+ SWBuf version = u->startTag.getAttribute("version");
+ buf.appendFormatted(" <a href=\"reference://%s/%s\">",(version.length()) ? version.c_str() : "",(refList.length()) ? refList.c_str() : "");
buf += u->lastTextNode.c_str();
buf += "</a> ";
}
@@ -143,7 +127,7 @@
SWCATCH ( ... ) {}
if (vkey) {
// leave this special osis type in for crossReference notes types? Might thml use this some day? Doesn't hurt.
- buf.appendFormatted("<a href=\"noteID=%s.x.%s\"><small><sup>*x</sup></small></a> ", vkey->getText(), footnoteNumber.c_str());
+ buf.appendFormatted("<a href=\"noteID://%s/%s/x/%s\"><small><sup>*x</sup></small></a> ",u->version.c_str(), vkey->getText(), footnoteNumber.c_str());
}
}