[sword-svn] r2512 - trunk/src/modules/filters

scribe at crosswire.org scribe at crosswire.org
Sun Apr 4 22:11:51 MST 2010


Author: scribe
Date: 2010-04-04 22:11:50 -0700 (Sun, 04 Apr 2010)
New Revision: 2512

Modified:
   trunk/src/modules/filters/gbfhtmlhref.cpp
   trunk/src/modules/filters/osishtmlhref.cpp
   trunk/src/modules/filters/teihtmlhref.cpp
   trunk/src/modules/filters/thmlhtmlhref.cpp
Log:
Committed Nic Carter's patches to add class attributes to strongs numbers


Modified: trunk/src/modules/filters/gbfhtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/gbfhtmlhref.cpp	2010-03-29 07:32:43 UTC (rev 2511)
+++ trunk/src/modules/filters/gbfhtmlhref.cpp	2010-04-05 05:11:50 UTC (rev 2512)
@@ -155,11 +155,11 @@
 		// else 
 		if (!strncmp(token, "WG", 2)) { // strong's numbers
 			//buf += " <small><em>&lt;<a href=\"type=Strongs value=";
-			buf += " <small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
+			buf += " <small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
 			for (tok = token+2; *tok; tok++)
 				//if(token[i] != '\"')
 					buf += *tok;
-			buf += "\">";
+			buf += "\" class=\"strongs\">";
 			for (tok = token + 2; *tok; tok++)
 				//if(token[i] != '\"')
 					buf += *tok;
@@ -167,11 +167,11 @@
 		}
 		else if (!strncmp(token, "WH", 2)) { // strong's numbers
 			//buf += " <small><em>&lt;<a href=\"type=Strongs value=";
-			buf += " <small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
+			buf += " <small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
 			for (tok = token+2; *tok; tok++)
 				//if(token[i] != '\"')
 					buf += *tok;
-			buf += "\">";
+			buf += "\" class=\"strongs\">";
 			for (tok = token + 2; *tok; tok++)
 				//if(token[i] != '\"')
 					buf += *tok;
@@ -179,11 +179,11 @@
 		}
 		else if (!strncmp(token, "WTG", 3)) { // strong's numbers tense
 			//buf += " <small><em>(<a href=\"type=Strongs value=";
-			buf += " <small><em>(<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
+			buf += " <small><em class=\"strongs\">(<a href=\"passagestudy.jsp?action=showStrongs&type=Greek&value=";
 			for (tok = token + 3; *tok; tok++)
 				if(*tok != '\"')
 					buf += *tok;
-			buf += "\">";
+			buf += "\" class=\"strongs\">";
 			for (tok = token + 3; *tok; tok++)
 				if(*tok != '\"')
 					buf += *tok;
@@ -191,11 +191,11 @@
 		}
 		else if (!strncmp(token, "WTH", 3)) { // strong's numbers tense
 			//buf += " <small><em>(<a href=\"type=Strongs value=";
-			buf += " <small><em>(<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
+			buf += " <small><em class=\"strongs\">(<a href=\"passagestudy.jsp?action=showStrongs&type=Hebrew&value=";
 			for (tok = token + 3; *tok; tok++)
 				if(*tok != '\"')
 					buf += *tok;
-			buf += "\">";
+			buf += "\" class=\"strongs\">";
 			for (tok = token + 3; *tok; tok++)
 				if(*tok != '\"')
 					buf += *tok;
@@ -204,12 +204,12 @@
 
 		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=\"passagestudy.jsp?action=showMorph&type=Greek&value=";
+			buf += " <small><em class=\"morph\">(<a href=\"passagestudy.jsp?action=showMorph&type=Greek&value=";
 			
 			for (tok = token + 2; *tok; tok++)
 				if(*tok != '\"')
 					buf += *tok;
-			buf += "\">";
+			buf += "\" class=\"morph\">";
 			for (tok = token + 2; *tok; tok++)				
 				if(*tok != '\"') 			
 					buf += *tok;		
@@ -240,7 +240,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=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup>*n</sup></small></a> ", 
+				buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup class=\"n\">*n</sup></small></a> ", 
 					URL::encode(footnoteNumber.c_str()).c_str(),
 					URL::encode(u->version.c_str()).c_str(), 
 					URL::encode(vkey->getText()).c_str());

Modified: trunk/src/modules/filters/osishtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/osishtmlhref.cpp	2010-03-29 07:32:43 UTC (rev 2511)
+++ trunk/src/modules/filters/osishtmlhref.cpp	2010-04-05 05:11:50 UTC (rev 2512)
@@ -117,7 +117,7 @@
 			//	show = false;
 			//else {
 				if (!suspendTextPassThru) {
-					buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\">%s</a>&gt;</em></small>",
+					buf.appendFormatted("<small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\" class=\"strongs\">%s</a>&gt;</em></small>",
 							(gh.length()) ? gh.c_str() : "", 
 							URL::encode(val2).c_str(),
 							val2);
@@ -147,7 +147,7 @@
 				if ((*val == 'T') && (strchr("GH", val[1])) && (isdigit(val[2])))
 					val2+=2;
 				if (!suspendTextPassThru) {
-					buf.appendFormatted("<small><em>(<a href=\"passagestudy.jsp?action=showMorph&type=%s&value=%s\">%s</a>)</em></small>",
+					buf.appendFormatted("<small><em class=\"morph\">(<a href=\"passagestudy.jsp?action=showMorph&type=%s&value=%s\" class=\"morph\">%s</a>)</em></small>",
 							URL::encode(tag.getAttribute("morph")).c_str(),
 							URL::encode(val).c_str(), 
 							val2);
@@ -252,19 +252,21 @@
 						SWCATCH ( ... ) {	}
 						if (vkey) {
 							//printf("URL = %s\n",URL::encode(vkey->getText()).c_str());
-							buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a>",
+							buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c</sup></small></a>",
 								ch, 
 								URL::encode(footnoteNumber.c_str()).c_str(), 
 								URL::encode(u->version.c_str()).c_str(), 
 								URL::encode(vkey->getText()).c_str(), 
+								ch,
 								ch);
 						}
 						else {
-							buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a>",
+							buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c</sup></small></a>",
 								ch, 
 								URL::encode(footnoteNumber.c_str()).c_str(), 
 								URL::encode(u->version.c_str()).c_str(), 
 								URL::encode(u->key->getText()).c_str(),  
+								ch,
 								ch);
 						}
 					}

Modified: trunk/src/modules/filters/teihtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/teihtmlhref.cpp	2010-03-29 07:32:43 UTC (rev 2511)
+++ trunk/src/modules/filters/teihtmlhref.cpp	2010-04-05 05:11:50 UTC (rev 2512)
@@ -251,7 +251,7 @@
 			if (tag.isEndTag()) {
 				SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
 				
-				buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup>*n</sup></small></a>",
+				buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=n&value=%s&module=%s&passage=%s\"><small><sup class=\"n\">*n</sup></small></a>",
 					URL::encode(footnoteNumber.c_str()).c_str(), 
 					URL::encode(u->version.c_str()).c_str(),
 					URL::encode(u->key->getText()).c_str());

Modified: trunk/src/modules/filters/thmlhtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/thmlhtmlhref.cpp	2010-03-29 07:32:43 UTC (rev 2511)
+++ trunk/src/modules/filters/thmlhtmlhref.cpp	2010-04-05 05:11:50 UTC (rev 2512)
@@ -175,21 +175,21 @@
 			SWBuf value = tag.getAttribute("value");
 			if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "morph")) { //&gt;
 				if(value.length())
-					buf.appendFormatted("<small><em>(<a href=\"passagestudy.jsp?action=showMorph&type=Greek&value=%s\">%s</a>)</em></small>", 
+					buf.appendFormatted("<small><em class=\"morph\">(<a href=\"passagestudy.jsp?action=showMorph&type=Greek&value=%s\" class=\"morph\">%s</a>)</em></small>", 
 						URL::encode(value.c_str()).c_str(),
 						value.c_str());
 			}
 			else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "lemma")) { //&gt;
 				if(value.length())
 					// empty "type=" is deliberate.
-					buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=&value=%s\">%s</a>&gt;</em></small>", 
+					buf.appendFormatted("<small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=&value=%s\" class=\"strongs\">%s</a>&gt;</em></small>", 
 						URL::encode(value.c_str()).c_str(),
 						value.c_str());
 			}
 			else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "Strongs")) {
 				char ch = *value;
 				value<<1;
-				buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\">",
+				buf.appendFormatted("<small><em class=\"strongs\">&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=%s&value=%s\" class=\"strongs\">",
 						    ((ch == 'H') ? "Hebrew" : "Greek"),
 						    URL::encode(value.c_str()).c_str());
 				buf += (value.length()) ? value.c_str() : "";
@@ -215,20 +215,22 @@
 					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=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a>", 
+						buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c</sup></small></a>", 
 							ch, 
 							URL::encode(footnoteNumber.c_str()).c_str(), 
 							URL::encode(u->version.c_str()).c_str(), 
 							URL::encode(vkey->getText()).c_str(), 
+							ch,
 							ch);
 					}
 					else {
 						char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
-						buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup>*%c</sup></small></a>", 
+						buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c</sup></small></a>", 
 							ch, 
 							URL::encode(footnoteNumber.c_str()).c_str(), 
 							URL::encode(u->version.c_str()).c_str(), 
 							URL::encode(u->key->getText()).c_str(),  
+							ch,
 							ch);
 					}
 					u->suspendTextPassThru = true;
@@ -272,7 +274,7 @@
 					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=\"passagestudy.jsp?action=showNote&type=x&value=%s&module=%s&passage=%s\"><small><sup>*x</sup></small></a>",
+						buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=x&value=%s&module=%s&passage=%s\"><small><sup class=\"x\">*x</sup></small></a>",
 							URL::encode(footnoteNumber.c_str()).c_str(), 
 							URL::encode(u->version.c_str()).c_str(),
 							URL::encode(vkey->getText()).c_str());




More information about the sword-cvs mailing list