|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Jun 30, 2010 5:35 am
[3.21 pro]Clickable URL package, child windows, and #PRINT |
Code: |
<trigger name="tChannels" priority="490" ansi="true" id="31">
<pattern>~{chan ch=(%w)~}(*)$</pattern>
<value><![CDATA[#local $name $text
#gagspace
//format the channel text
$text = %format("<color gray>[&10s]:</color>&s",%time("h:nn:ssampm"),%2)
//validate the channel name and update history
#switch (%ismember(%1,"question|answer")) {
$name = "qna"
Qna = %additem($text,@qna)
}
(%ismember(%1,"inform|commune|chant|telepathy|grapevine|cant|wardrums")) {
$name = "classchan"
Classchan = %additem($text,@ClassChan)
}
(1) {
$name = %1
#variable %1 %additem($text,@{%1})
}
//determine where to display it
#if ((@CurChan.name = $name) or (@CurChan.name = "all")) {#execwin Channels {#print $text}} {#print $text}]]></value>
</trigger> |
Somehow, #PRINT is allowing Clickable URLs triggers to operate on its text (thought #print wasn't supposed to allow such stuff?). The weird part is that apparently the A tag subbed into the text by the Clickable URLs trigger is getting stripped out afterwards, leaving the link a plain underlined piece of text instead of an unformatted piece of text or a clickable link. I have an event that prints channel chatter to the window in a different manner (#window Channels {%expandlist(stuff,%cr)) that allows the clickiness to happen. I can't use this method in the trigger without causing an infinite loop, because of how telopts are sent/handled (if anchored to the beginning of the line, the trigger won't match any of the channel chatter lines when the telopts codes are sent.)
Anywho, in 3.17 the printed links were clickable and now they are not. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Jun 30, 2010 4:19 pm |
I'll take a look at this. I also don't understand how #print is allowing the trigger to fire.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jul 02, 2010 1:09 am |
Can you give me some test lines to fire this trigger and show the problem please? Your XML is also missing the values of some variables used in the trigger. I need this converted into an example that I can easily test.
If you can, show both an example that causes the clickable url problem as well as a problem where the lines are not clickable anymore. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Fri Jul 02, 2010 3:58 am |
Code: |
<trigger priority="650" ansi="true" id="65">
<pattern>This is a test for the link (*)</pattern>
<value>$text = %concat("This is a test for the link ",%1)
#execwin Aardwolf {#print $text}</value>
</trigger> |
I didn't originally catch that the Clickable URLs trigger has a priority of 1, so this only happens when the following two conditions are true:
1)the user-created trigger has a priority greater than 1
2)the user-created trigger is an ANSI type trigger |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Jul 02, 2010 4:45 pm |
OK, I get the links that are not clickable, but I don't get any infinite loop or hang. But I can see that somehow the clickable url trigger is firing to cause the link to be underlined. Very odd. Added to bug list but won't be fixed for today's 3.22 release, sorry.
|
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Aug 20, 2010 8:43 pm |
Actually, this isn't a bug.
The Clickable URL trigger is *not* firing on the #PRINT text. Here is what is happening:
1) The MUD displays a line like "This is a test for the link www.zuggsoft.com"
2) The Clickable URL trigger fires on the line in the MAIN WINDOW and makes the link and underlines the link
3) The user trigger fires. Since it is an ANSI trigger, the (*) captures the color/style of the text. Thus, it captures the ANSI Underline codes being used to underline the link
4) The #PRINT command in the user trigger prints the text line in the Aardwolf window. Since the line contains the ANSI codes for underlining, the line in the Aardwolf window shows the underlined link. But it isn't a real link...it just has the underline attribute set.
So this is working as designed. |
|
|
|
|
|