Re: Text_Wiki Xhtml external link force popups

From: Date: Wed, 27 Sep 2006 20:29:16 +0000
Subject: Re: Text_Wiki Xhtml external link force popups
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-44117@lists.php.net to get a copy of this message
I'm not familiar with recent versions of Text_Wiki, but I remember that there were problems getting links to open in new windows because the "target" attribute isn't supported in XHTML 1.1. Thus the only way to get a XHTML compliant code that also opens links in a new window is a JavaScript hack. Which really isn't all that bad. From an end-user usability perspective, opening new web windows can be a problem. I know that both my mother and mother-in-law have problems with the concept of having more than one browser window open at the same time. Another argument against is that opening the new window breaks the "Back" button. ~Seth On Sep 27, 2006, at 3:11 PM, Jay Taylor wrote:
Apparently the default behavior of Text_Wiki regarding the rendering of Xhtml external url links is to insert javascript which forces the links to open in a new window (popup links). Call me crazy, but this behavior seems like something that should should be decided by the user of the class rather than being hard coded. There is in fact a $conf variable in the Text_Wiki_Render_Xhtml_Url class, however I am unable to see any straightforward way of changing it's 'target' value. Relevant file: see lines 100-101 of PEAR/Text/Wiki/Render/Xhtml/Url.php I went ahead and created a fix. Diff: http://wi-fizzle.com/PEAR/Text/Wiki/Render/Xhtml/Url.php.diff source: http://wi-fizzle.com/PEAR/Text/Wiki/Render/Xhtml/Url.phps I made a public static variable for class Text_Wiki_Render_Xhtml_Url called $default_conf. People can now, if they wish, easily alter the default configuration for this class ahead of time if they want. Whenever a new Text_Wiki_Render_Xhtml_Url's constructor runs, the datamember $conf will be initialized based on the current values of the static array self::$default_conf. This is my first code submission to PEAR so I apologize if it violates your standards. This seemed like a better solution than passing in even more insane arrays, though. Hope you guys accept it. Best Regards, Jay Taylor --PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.dev (#44117) next »