Actually, now that I've created these diffs, I wonder if I actually have write 
access to SWORD SVN myself?

But rather than try (and so that I can get comments before applying the 
patches), I have attached some diffs for strongs, morphology, footnotes & xref 
stuff for the HTML filters.  I'm not sure who actually uses the HTML filters, 
but PocketSword and MacSword do.  The changes are simply to create some css 
classes for those 4 things so that the frontend can easily define CSS classes 
to customise the markup.  I may go back, if I have the time, and add more 
classes for other parts of the HTML code, too, depending on what other ppl 
think of this idea (and who is actually using this!).

The hope is that other ppl who do use the HTML filters won't be affected.  If 
ppl have written CSS stuff based on what is currently outputted from SWORD, 
there may be small display issues.  If not, they won't notice any changes at 
all  :)

[for those following along at home, rather boring patch.  Altho it does mean 
that strongs, morph, footnotes & cross-references are all almost in 
PocketSword!]

Thanks all, ybic
        nic...  :)

----
Nic Carter
PocketSword Developer - an iPhone Bible Study app
www: http://crosswire.org/pocketsword
iTunes: http://itunes.apple.com/app/Pocketsword/id341046078
Twitter: @PocketSword

Index: 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/gbfhtmlhref.cpp
===================================================================
--- 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/gbfhtmlhref.cpp
       (revision 8)
+++ 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/gbfhtmlhref.cpp
       (working copy)
@@ -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());
Index: 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/osishtmlhref.cpp
===================================================================
--- 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/osishtmlhref.cpp
      (revision 18)
+++ 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/osishtmlhref.cpp
      (working copy)
@@ -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);
                                                }
                                        }
Index: 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/teihtmlhref.cpp
===================================================================
--- 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/teihtmlhref.cpp
       (revision 8)
+++ 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/teihtmlhref.cpp
       (working copy)
@@ -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());
Index: 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/thmlhtmlhref.cpp
===================================================================
--- 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/thmlhtmlhref.cpp
      (revision 8)
+++ 
/Users/nicc/local/src/PocketSword/externals/sword/src/modules/filters/thmlhtmlhref.cpp
      (working copy)
@@ -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());
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page

Reply via email to