[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fossil-users
Subject:    Re: [fossil-users] Constructing Base URI With TH1 Variables
From:       "John L. Poole" <jlpoole56 () gmail ! com>
Date:       2016-07-19 13:32:50
Message-ID: 8ef96d62-0dfb-6649-09f4-11c83df2476a () gmail ! com
[Download RAW message or body]



On 7/17/2016 7:10 AM, John L. Poole wrote:
>
>
>
> On 7/17/2016 12:45 AM, Ron W wrote:
>> On Sun, Jul 17, 2016 at 2:08 AM, John L. Poole <jlpoole56@gmail.com 
>> <mailto:jlpoole56@gmail.com>> wrote:
>>
>>     On your suggestion, I inserted code on the setup_header page to this:
>>
>>     <th1>
>>     if {[hascap r]} {
>>     html "<base href=\"$baseurl/$current_page?name=$tkt_uuid\" />\n"
>>     }
>>     </th1>
>>     <base href="$baseurl/$current_page" />
>>
>>     And that worked: the baseURI variable in DOM was set to
>>     "http://themis:8080/tktview?name=149873cca9"
>>     <http://themis:8080/tktview?name=149873cca9>
>>
>>     However, each page now complains
>>     "ERROR: no such variable: tkt_uuid"
>>     and is missing styling and the heading matter.
>>
>>
>> Test $current_page for "tktview". If true:
>> html "<base href=\"$baseurl/$current_page?name=$tkt_uuid\" />\n"
>> else:
>> html "<base href=\"$baseurl/$current_page\" />\n"
>>
> Thank you, that worked.  Here's what I used:
>
>     <head>
>     <th1>
>     if {$current_page eq "tktview"} {
>       html "<base href=\"$baseurl/$current_page?name=$tkt_uuid\" />\n"
>     } else {
>       html "<base href=\"$baseurl/$current_page\" />"
>     }
>     </th1>
>
>     <title>...
>
> Caveat: changing the baseURI value to a specific ticket page 
> introduced a problem in that ticketview pages are not having their CSS 
> files loading correctly; the URIs for the CSS assume the baseURI to be 
> $baseurl/$current_page.  I'll have to go down the line and introduce 
> $baseurl/$current_page prefixes to URIs that assume that the baseURI 
> has been set to $baseurl/$current_page
>

Trying  to use the variable $tkt_uuid in the header results in the error 
message
"ERROR: no such variable: tkt_uuid" and setting TH_ERROR and that, in 
turn, causes the rest of
the header processing function style_header() [style.c]  to be abandoned.

By happenstance, not redefining the baseURI with the tag <base...> is 
the better approach, for now.
This is because the natural course of events will cause the DOM variable 
baseURI to be set to
the specific ticket page and then the SVG resolver properly can access 
the predeclared nodes within
the SVG.

This is what I ended up having in Edit Page Header section:

      <html>
<head>
<th1>
if {$current_page eq "tktview"} {
# do not change the baseURI so that embedded SVG markers properly resolve
} else {
   html "<base href=\"$baseurl/$current_page\" />"
}
</th1>
<title>$<project_name>: $<title></title>

And now the page displays the SVG properly and the CSS formatting 
works.  I wonder what
cost this will be as there must have been a reason for redefining the 
baseURI.

For propriety, here are my notes in analyzing this:
tkt.c 443 commences the generation of the page. Line 482 calls 
style_header("View Ticket")
located at style.c 387.
style_header() at 424 calls  Th_Render(zHeader) [th_main.c 2300]
Th_Render calls Th_GetVar(g.interp, (char*)zVar, nVar) [th.c 1234] and 
when Th_GetVar()
determines the variable is not defined set TH_ERROR which results in 
sendError() [th_main.c 333]
being called and 337-341 cause the error output to display on the page.

_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic