[sword-svn] r3285 - in branches/sword-1-7-x: . include src/modules/filters

greg.hellings at crosswire.org greg.hellings at crosswire.org
Tue Dec 2 23:14:51 MST 2014


Author: greg.hellings
Date: 2014-12-02 23:14:50 -0700 (Tue, 02 Dec 2014)
New Revision: 3285

Modified:
   branches/sword-1-7-x/
   branches/sword-1-7-x/include/osiswebif.h
   branches/sword-1-7-x/include/osisxhtml.h
   branches/sword-1-7-x/src/modules/filters/osiswebif.cpp
   branches/sword-1-7-x/src/modules/filters/osisxhtml.cpp
Log:
Merged 3257



Property changes on: branches/sword-1-7-x
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:2989-2991,2997,3001-3004,3006,3010-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3081,3085-3086,3091,3094,3097-3099,3102,3104,3106-3108,3110,3115,3118-3121,3126-3127,3131-3135,3140,3144,3151,3153-3155,3190-3192,3198-3199,3202-3203,3225,3230,3232-3234,3236,3238-3239,3242,3244,3256
   + /trunk:2989-2991,2997,3001-3004,3006,3010-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3081,3085-3086,3091,3094,3097-3099,3102,3104,3106-3108,3110,3115,3118-3121,3126-3127,3131-3135,3140,3144,3151,3153-3155,3190-3192,3198-3199,3202-3203,3225,3230,3232-3234,3236,3238-3239,3242,3244,3256-3257

Modified: branches/sword-1-7-x/include/osiswebif.h
===================================================================
--- branches/sword-1-7-x/include/osiswebif.h	2014-12-03 06:13:54 UTC (rev 3284)
+++ branches/sword-1-7-x/include/osiswebif.h	2014-12-03 06:14:50 UTC (rev 3285)
@@ -35,6 +35,7 @@
 	bool javascript;
 
 protected:
+	virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key);
 	virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
 public:
 	OSISWEBIF();

Modified: branches/sword-1-7-x/include/osisxhtml.h
===================================================================
--- branches/sword-1-7-x/include/osisxhtml.h	2014-12-03 06:13:54 UTC (rev 3284)
+++ branches/sword-1-7-x/include/osisxhtml.h	2014-12-03 06:14:50 UTC (rev 3285)
@@ -36,11 +36,11 @@
 protected:
 
 	class TagStack;
-	// used by derived classes so we have it in the header
 	virtual BasicFilterUserData *createUserData(const SWModule *module, const SWKey *key);
 	virtual bool handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData);
 
 
+	// used by derived classes so we have it in the header
 	class MyUserData : public BasicFilterUserData {
 	public:
 		bool osisQToTick;
@@ -49,6 +49,8 @@
 		int suspendLevel;
 		SWBuf wordsOfChristStart;
 		SWBuf wordsOfChristEnd;
+		SWBuf interModuleLinkStart;
+		SWBuf interModuleLinkEnd;
 		TagStack *quoteStack;
 		TagStack *hiStack;
 		TagStack *titleStack;

Modified: branches/sword-1-7-x/src/modules/filters/osiswebif.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/osiswebif.cpp	2014-12-03 06:13:54 UTC (rev 3284)
+++ branches/sword-1-7-x/src/modules/filters/osiswebif.cpp	2014-12-03 06:14:50 UTC (rev 3285)
@@ -37,6 +37,13 @@
 }
 
 
+BasicFilterUserData *OSISWEBIF::createUserData(const SWModule *module, const SWKey *key) {
+	MyUserData *u = (MyUserData *)OSISXHTML::createUserData(module, key);
+	u->interModuleLinkStart = "<a href=\"#\" onclick=\"return im('%s', '%s');\">";
+	u->interModuleLinkEnd = "</a>";
+	return u;
+}
+
 bool OSISWEBIF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
 	MyUserData *u = (MyUserData *)userData;
 	SWBuf scratch;

Modified: branches/sword-1-7-x/src/modules/filters/osisxhtml.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/osisxhtml.cpp	2014-12-03 06:13:54 UTC (rev 3284)
+++ branches/sword-1-7-x/src/modules/filters/osisxhtml.cpp	2014-12-03 06:14:50 UTC (rev 3285)
@@ -161,6 +161,8 @@
 	suspendLevel = 0;
 	wordsOfChristStart = "<span class=\"wordsOfJesus\"> ";
 	wordsOfChristEnd   = "</span> ";
+	interModuleLinkStart = "<a href=\"sword://%s/%s\">";
+	interModuleLinkEnd = "</a>";
 	if (module) {
 		osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false")));
 		version = module->getName();
@@ -379,14 +381,14 @@
 					else
 					{
 						// Dictionary link, or something
-						buf.appendFormatted("<a href=\"sword://%s/%s\">",
+						buf.appendFormatted(u->interModuleLinkStart, 
 							URL::encode(work.c_str()).c_str(),
 							URL::encode(ref.c_str()).c_str()
 							);
 					}
 				}
 				else {
-					outText("</a>", buf, u);
+					outText(u->interModuleLinkEnd, buf, u);
 				}
 			}
 		}




More information about the sword-cvs mailing list