yelp r3163 - in branches/webkit: src stylesheets



Author: dscorgie
Date: Tue Jul 29 19:40:07 2008
New Revision: 3163
URL: http://svn.gnome.org/viewvc/yelp?rev=3163&view=rev

Log:
Make linking within pages and across pages work again
Make loading of figures work


Modified:
   branches/webkit/src/yelp-html.c
   branches/webkit/src/yelp-info-parser.c
   branches/webkit/src/yelp-window.c
   branches/webkit/stylesheets/db2html.xsl.in

Modified: branches/webkit/src/yelp-html.c
==============================================================================
--- branches/webkit/src/yelp-html.c	(original)
+++ branches/webkit/src/yelp-html.c	Tue Jul 29 19:40:07 2008
@@ -77,22 +77,8 @@
     debug_print (DB_FUNCTION, "entering\n");
     debug_print (DB_ARG, "  uri = \"%s\"\n", uri);
 
+    real_uri = g_strdup (uri);
 
-
-    if (uri[0] == '#') {
-	gchar *hash = g_strrstr (html->priv->base_uri, "#");
-	if (hash) {
-	    gchar *tmp = g_strndup (html->priv->base_uri, 
-				    (hash - html->priv->base_uri));
-	    real_uri = g_strdup_printf ("%s%s", tmp, uri);
-
-	    g_free (tmp);
-	} else {
-	    real_uri = g_strdup_printf ("%s%s", html->priv->base_uri, uri);
-	}
-    } else {
-	real_uri = g_strdup (uri);
-    }
     
     if (!html->priv->frames_enabled) {
   	g_signal_emit (html, signals[URI_SELECTED], 0, real_uri, FALSE);
@@ -365,7 +351,7 @@
 				 html->priv->content,
 				 html->priv->mime,
 				 NULL,
-				 "foo");
+				 html->priv->base_uri);
     g_free (html->priv->content);
     html->priv->content = NULL;
     g_free (html->priv->mime);

Modified: branches/webkit/src/yelp-info-parser.c
==============================================================================
--- branches/webkit/src/yelp-info-parser.c	(original)
+++ branches/webkit/src/yelp-info-parser.c	Tue Jul 29 19:40:07 2008
@@ -915,7 +915,7 @@
 	ref1 = xmlNewTextChild (mholder, NULL, BAD_CAST "a",
 				BAD_CAST tmp);
 	g_free (tmp);
-	tmp = g_strconcat ("#", xref, NULL);
+	tmp = g_strconcat ("?", xref, NULL);
 	xmlNewProp (ref1, BAD_CAST "href", BAD_CAST tmp);
 	g_free (tmp);
       } else { /* Indexy type menu  - we gotta do a  little work to fix the
@@ -933,7 +933,7 @@
 	
 	ref1 = xmlNewTextChild (mholder, NULL, BAD_CAST "a",
 					BAD_CAST title);
-	tmp = g_strconcat ("#", xref, NULL);
+	tmp = g_strconcat ("?", xref, NULL);
 	xmlNewProp (ref1, BAD_CAST "href", BAD_CAST tmp);
 	g_free (tmp);
 	xmlNewTextChild (mholder, NULL, BAD_CAST "spacing",
@@ -942,7 +942,7 @@
 	ref1 = xmlNewTextChild (mholder, NULL, BAD_CAST "a",
 				BAD_CAST tmp);
 	g_free (tmp);
-	tmp = g_strconcat ("#", xref, NULL);
+	tmp = g_strconcat ("?", xref, NULL);
 	xmlNewProp (ref1, BAD_CAST "href", BAD_CAST tmp);
 
 	g_free (tmp);	
@@ -1103,7 +1103,7 @@
 	  link = g_strstrip (link);
 	  length = strlen (link) - 1;
 	  link[length] = '\0';	  
-	  href = g_strconcat ("#", link, NULL);
+	  href = g_strconcat ("?", link, NULL);
 	  link[length] = 'a';
 	  g_free (link);
 
@@ -1138,7 +1138,7 @@
 	  frag = g_strndup (url, tmp1 - url);
 	g_strstrip (frag);
 	gtk_tree_model_foreach (GTK_TREE_MODEL (tree), resolve_frag_id, &frag);
-	href = g_strconcat ("#", frag, NULL);
+	href = g_strconcat ("?", frag, NULL);
 	g_free (frag);
       }
       for (ulink = urls; *ulink != NULL; ulink++) {

Modified: branches/webkit/src/yelp-window.c
==============================================================================
--- branches/webkit/src/yelp-window.c	(original)
+++ branches/webkit/src/yelp-window.c	Tue Jul 29 19:40:07 2008
@@ -1817,7 +1817,7 @@
 	gtk_tree_model_get (model, &iter,
 			    YELP_DOCUMENT_COLUMN_ID, &id,
 			    -1);
-	uri = g_strdup_printf ("%s#%s", priv->base_uri, id);
+	uri = g_strdup_printf ("%s?%s", priv->base_uri, id);
 	yelp_window_load (window, uri);
 	g_free (uri);
     }
@@ -2727,7 +2727,7 @@
     
     /* Use a silly fake URI to stop gecko doing silly things */
     if (data->window->priv->current_frag)
-	uri = g_strdup_printf ("%s#%s", data->window->priv->base_uri, 
+	uri = g_strdup_printf ("%s?%s", data->window->priv->base_uri, 
 			       data->window->priv->current_frag);
     else
 	uri = g_strdup (data->window->priv->base_uri);

Modified: branches/webkit/stylesheets/db2html.xsl.in
==============================================================================
--- branches/webkit/stylesheets/db2html.xsl.in	(original)
+++ branches/webkit/stylesheets/db2html.xsl.in	Tue Jul 29 19:40:07 2008
@@ -68,7 +68,18 @@
 <!-- == db.xref.target == -->
 <xsl:template name="db.xref.target">
   <xsl:param name="linkend"/>
-  <xsl:value-of select="concat('#', $linkend)"/>
+  <xsl:param name="depth_in_chunk">
+    <xsl:call-template name="db.chunk.depth-in-chunk"/>
+  </xsl:param>
+
+  <xsl:choose>
+    <xsl:when test="$depth_in_chunk >= $db.chunk.max_depth">
+      <xsl:value-of select="concat('#', $linkend)"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="concat('?', $linkend)"/>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <!-- == db2html.css.custom == -->



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]