Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Intra-vanilla link preview
TomTester
New
When reading these forums I see references to other sites, discussions, etc.
I find myself opening these up in different tabs, but easily get lost in a see
of vanilla-leaves.
How hard would it be to make a little AJAXy "tip-tool-type" preview for those
intra-forum references?
Sample sites (perhaps useful):
http://www.websnapr.com/previewbubble/
http://en.wikipedia.org/wiki/Wikipedia:Tools/Navigation_popups
http://codylindley.com/Javascript/257/thickbox-one-box-to-rule-them-all
0
This discussion has been closed.
Comments
Now, if only someone would do that remotely analogous (I'll find any excuse) extension for which I beg; a user-option to display 'x' characters of the first post in discussions. This is functionally akin to what displays when a search result is returned - and for just the same reason, so a user can get a bit of guidance on whether they want to read the whole post/browse a discussion or not. Hovering over a [*] feature in discussion or category lists wouldn't be quite as good but I'd settle for it ;-).
l wish I could pay for such an extension but just can't. I am beginning to analyze Vanilla code but only have hobby-time for it, alas, so it will take my tired old brain a loooong time.
if (in_array($Context->SelfUrl, array("comments.php", "post.php"))) { // An implementation of the string filter interface for plain text strings class ExtendedTextFormatter extends StringFormatter { function Parse ($String, $Object, $FormatPurpose) { $sReturn = $String; // Only format plain text strings if they are being displayed (save in database as is) if ($FormatPurpose == FORMAT_STRING_FOR_DISPLAY) { $sReturn = $this->AutoLink($sReturn); $sReturn = preg_replace("/\/\bme\b/", $this->GetAccountLink($Object), $sReturn); } return $sReturn; } function AutoLink($String) { $String = str_replace(array(""","&"),array('"','&'),$String); $String = preg_replace( "/ (?<!<a href=\") (?<!\")(?<!\">) ((https?|ftp):\/\/) ([\@a-z0-9\x21\x23-\x27\x2a-\x2e\x3a\x3b\/;\x3f-\x7a\x7e\x3d]+) /msxi", "<a class=\"previewlink\" href=\"$0\" target=\"_blank\" rel=\"nofollow\">$0</a>", $String); return $String; } function GetAccountLink($Object) { if ($Object->AuthUserID != "" && $Object->AuthUsername != "") { return '<a href="'.GetUrl($Object->Context->Configuration, 'account.php', '', 'u', $Object->AuthUserID).'">'.$Object->AuthUsername.'</a>'; } else { return '/me'; } } } $ExtendedTextFormatter = $Context->ObjectFactory->NewObject($Context, "ExtendedTextFormatter"); $Context->StringManipulator->Formatters[$Configuration["DEFAULT_FORMAT_TYPE"]]->AddChildFormatter($ExtendedTextFormatter); $Head->AddScript('js/websnapr/previewbubble.js'); }
then u will need thickbox It will open the link in an iframe so u can read it and later close it
You just need to:
var bubbleImagePath = '/images/bg.png';
byvar bubbleImagePath = '/vanilla/js/websnapr/bg.png';
(of course put the correct path for your forum)."<a href=\"$0\" target=\"_blank\" rel=\"nofollow\">$0</a>",
by"<a class=\"previewlink\" href=\"$0\" target=\"_blank\" rel=\"nofollow\">$0</a>",
$Head->AddScript('js/websnapr/previewbubble.js');
The only problem with that is that many sites nowadays use javascript to remove all iframes and make it the focus of the screen
You can ask Mark to add it.
My knowledge in js are limitated so I used jquery for... Just for 3 lines of code lol
$(document).ready(function() { $("div.CommentBody a").addClass("previewlink"); });
http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=203