Check-in [7fb59a67dc]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
SHA1 Hash:7fb59a67dc6ecf144d29b0d2e9ecff679bd6e034
Date: 2012-05-05 13:53:37
User: drh
Comment:Improvements to the javascript that enables hyperlinks for anonymous users.
Tags And Properties
Changes

Changes to src/style.c

120 120 121 /* 121 /* 122 ** Generate javascript that will set the href= attribute on all anchors. 122 ** Generate javascript that will set the href= attribute on all anchors. 123 */ 123 */ 124 void style_resolve_href(void){ 124 void style_resolve_href(void){ 125 int i; 125 int i; 126 if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return; 126 if( !g.perm.Hyperlink || !g.javascriptHyperlink || nHref==0 ) return; 127 @ <script> | 127 @ <script type="text/JavaScript"> > 128 @ /* <![CDATA[ */ > 129 @ function u(i,h){ document.getElementById(i).href=h; } 128 for(i=0; i<nHref; i++){ 130 for(i=0; i<nHref; i++){ 129 @ document.getElementById(%d(i+1)).href="%s(aHref[i])"; < > 131 @ u(%d(i+1),"%s(aHref[i])"); 130 } 132 } > 133 @ /* ]]> */ 131 @ </script> 134 @ </script> 132 } 135 } 133 136 134 /* 137 /* 135 ** Add a new element to the submenu 138 ** Add a new element to the submenu 136 */ 139 */ 137 void style_submenu_element( 140 void style_submenu_element( ................................................................................................................................................................................ 235 /* Put the footer at the bottom of the page. 238 /* Put the footer at the bottom of the page. 236 ** the additional clear/both is needed to extend the content 239 ** the additional clear/both is needed to extend the content 237 ** part to the end of an optional sidebox. 240 ** part to the end of an optional sidebox. 238 */ 241 */ 239 @ <div class="endContent"></div> 242 @ <div class="endContent"></div> 240 } 243 } 241 @ </div> 244 @ </div> > 245 > 246 /* Set the href= field on hyperlinks. Do this before the footer since > 247 ** the footer will be generating </html> */ > 248 style_resolve_href(); > 249 242 zFooter = db_get("footer", (char*)zDefaultFooter); 250 zFooter = db_get("footer", (char*)zDefaultFooter); 243 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1); 251 if( g.thTrace ) Th_Trace("BEGIN_FOOTER<br />\n", -1); 244 Th_Render(zFooter); 252 Th_Render(zFooter); 245 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1); 253 if( g.thTrace ) Th_Trace("END_FOOTER<br />\n", -1); 246 254 247 /* Render trace log if TH1 tracing is enabled. */ 255 /* Render trace log if TH1 tracing is enabled. */ 248 if( g.thTrace ){ 256 if( g.thTrace ){ 249 cgi_append_content("<span class=\"thTrace\"><hr />\n", -1); 257 cgi_append_content("<span class=\"thTrace\"><hr />\n", -1); 250 cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog)); 258 cgi_append_content(blob_str(&g.thLog), blob_size(&g.thLog)); 251 cgi_append_content("</span>\n", -1); 259 cgi_append_content("</span>\n", -1); 252 } 260 } 253 < 254 /* Set the href= field on hyperlinks */ < 255 style_resolve_href(); < 256 } 261 } 257 262 258 /* 263 /* 259 ** Begin a side-box on the right-hand side of a page. The title and 264 ** Begin a side-box on the right-hand side of a page. The title and 260 ** the width of the box are given as arguments. The width is usually 265 ** the width of the box are given as arguments. The width is usually 261 ** a percentage of total screen width. 266 ** a percentage of total screen width. 262 */ 267 */