[sword-cvs] sword/src/modules/filters gbfhtmlhref.cpp,1.28,1.29 osishtmlhref.cpp,1.22,1.23 thmlhtmlhref.cpp,1.49,1.50

sword@www.crosswire.org sword@www.crosswire.org
Sat, 27 Mar 2004 12:35:33 -0700


Update of /cvs/core/sword/src/modules/filters
In directory www:/tmp/cvs-serv1605/src/modules/filters

Modified Files:
	gbfhtmlhref.cpp osishtmlhref.cpp thmlhtmlhref.cpp 
Log Message:
mg: rolled back Terry's patch after Troy told me it breaks client apps.
Sorry about the trouble I caused. 

Suggestion: Let us have more clear communication
on sword-devel in future. Public requests should be answered publically.



Index: gbfhtmlhref.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/gbfhtmlhref.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- gbfhtmlhref.cpp	27 Mar 2004 10:55:59 -0000	1.28
+++ gbfhtmlhref.cpp	27 Mar 2004 19:35:30 -0000	1.29
@@ -24,12 +24,6 @@
 
 SWORD_NAMESPACE_START
 
-GBFHTMLHREF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
-	if (module) {
-		version = module->Name();
-	}	
-}
-
 GBFHTMLHREF::GBFHTMLHREF() {
 	setTokenStart("<");
 	setTokenEnd(">");
@@ -149,21 +143,9 @@
 			}
 		}
 		
-		else if (!strncmp(token, "WG", 2)) { // strong's numbers
-			buf += " <small><em>&lt;<a href=\"strongs://Greek/";
-			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>&gt;</em></small>";
-		}
-		
-		else if (!strncmp(token, "WH", 2)) { // strong's numbers
-			buf += " <small><em>&lt;<a href=\"strongs://Hebrew/";
-			for (tok = token+2; *tok; tok++)
+		else if (!strncmp(token, "WG", 2) || !strncmp(token, "WH", 2)) { // strong's numbers
+			buf += " <small><em>&lt;<a href=\"type=Strongs value=";
+			for (tok = token+1; *tok; tok++)
 				//if(token[i] != '\"')
 					buf += *tok;
 			buf += "\">";
@@ -173,23 +155,9 @@
 			buf += "</a>&gt;</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++)
+		else if (!strncmp(token, "WTG", 3) || !strncmp(token, "WTH", 3)) { // strong's numbers tense
+			buf += " <small><em>(<a href=\"type=Strongs value=";
+			for (tok = token + 2; *tok; tok++)
 				if(*tok != '\"')
 					buf += *tok;
 			buf += "\">";
@@ -200,7 +168,7 @@
 		}
 
 		else if (!strncmp(token, "WT", 2) && strncmp(token, "WTH", 3) && strncmp(token, "WTG", 3)) { // morph tags
-			buf += " <small><em>(<a href=\"morph:///";
+			buf += " <small><em>(<a href=\"type=morph class=none value=";
 			for (tok = token + 2; *tok; tok++)
 				if(*tok != '\"')
 					buf += *tok;
@@ -235,7 +203,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/%s/%c/%s\"><small><sup>*%c</sup></small></a> ", u->version.c_str(), vkey->getText(), 'n', footnoteNumber.c_str(), 'n');
+				buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", 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.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- osishtmlhref.cpp	27 Mar 2004 10:55:59 -0000	1.22
+++ osishtmlhref.cpp	27 Mar 2004 19:35:30 -0000	1.23
@@ -25,8 +25,6 @@
 
 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();
 }
 
 
@@ -97,17 +95,12 @@
 						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>&lt;<a href=\"strongs://%s/%s\">%s</a>&gt;</em></small> ", (gh.length()) ? gh.c_str() : "", val2, val2);
+						else	buf.appendFormatted(" <small><em>&lt;<a href=\"type=Strongs value=%s\">%s</a>&gt;</em></small> ", val, val2);
 					} while (++i < count);
 				}
 				if ((attrib = tag.getAttribute("morph")) && (show)) {
@@ -125,7 +118,7 @@
 							const char *val2 = val;
 							if ((*val == 'T') && (strchr("GH", val[1])) && (isdigit(val[2])))
 								val2+=2;
-							buf.appendFormatted(" <small><em>(<a href=\"morph://%s/%s\">%s</a>)</em></small> ", tag.getAttribute("morph"), val, val2);
+							buf.appendFormatted(" <small><em>(<a href=\"type=morph class=%s value=%s\">%s</a>)</em></small> ", tag.getAttribute("morph"), val, val2);
 						} while (++i < count);
 					}
 				}
@@ -156,7 +149,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/%s/%c/%s\"><small><sup>*%c</sup></small></a> ", u->version.c_str(), vkey->getText(), ch, footnoteNumber.c_str(), ch);
+							buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", 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.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- thmlhtmlhref.cpp	27 Mar 2004 10:55:59 -0000	1.49
+++ thmlhtmlhref.cpp	27 Mar 2004 19:35:30 -0000	1.50
@@ -53,19 +53,27 @@
 		if (tag.getName() && !strcmp(tag.getName(), "sync")) {
 			SWBuf value = tag.getAttribute("value");
 			if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "morph")) { //&gt;
-				buf.appendFormatted("<small><em>(<a href=\"morph://Greek/%s\">",(value.length()) ? value.c_str() : "");
+				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 += (value.length()) ? value.c_str() : "";
 				buf += "</a>) </em></small>";
 			}
 			else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "Strongs")) {
-				if(*value == 'H') {
-					value<<1;
-					buf.appendFormatted("<small><em>&lt;<a href=\"strongs://Hebrew/%s\">",(value.length()) ? value.c_str() : "");
-				}
-				else if(*value == 'G') {
-					value<<1;
-					buf.appendFormatted("<small><em>&lt;<a href=\"strongs://Greek/%s\">",(value.length()) ? value.c_str() : "");
-				}
+				buf += "<small><em>&lt;<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;
 				buf += (value.length()) ? value.c_str() : "";
 				buf += "</a>&gt; </em></small>";
 			}
@@ -91,7 +99,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/%s/%c/%s\"><small><sup>*%c</sup></small></a> ", u->version.c_str(), vkey->getText(), ch, footnoteNumber.c_str(), ch);
+						buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", vkey->getText(), ch, footnoteNumber.c_str(), ch);
 					}
 					u->suspendTextPassThru = true;
 				}
@@ -102,7 +110,7 @@
 		}
 		// <scripRef> tag
 		else if (!strcmp(tag.getName(), "scripRef")) {
-			if (!tag.isEndTag()) {					
+			if (!tag.isEndTag()) {
 				if (!tag.isEmpty()) {
 					u->suspendTextPassThru = true;
 				}
@@ -112,8 +120,16 @@
 					SWBuf refList = u->startTag.getAttribute("passage");
 					if (!refList.length())
 						refList = u->lastTextNode;
-					SWBuf version = u->startTag.getAttribute("version");
-					buf.appendFormatted("&nbsp<a href=\"reference://%s/%s\">",(version.length()) ? version.c_str() : "",(refList.length()) ? refList.c_str() : "");
+					SWBuf version = tag.getAttribute("version");
+					buf += "&nbsp<a href=\"";
+					if (version.length()) {
+						buf += "version=";
+						buf += version;
+						buf += " ";
+					}
+					buf += "passage=";
+					buf += refList.c_str();
+					buf += "\">";
 					buf += u->lastTextNode.c_str();
 					buf += "</a>&nbsp";
 				}
@@ -127,7 +143,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/%s/x/%s\"><small><sup>*x</sup></small></a> ",u->version.c_str(), vkey->getText(), footnoteNumber.c_str());
+						buf.appendFormatted("<a href=\"noteID=%s.x.%s\"><small><sup>*x</sup></small></a> ", vkey->getText(), footnoteNumber.c_str());
 					}
 				}