Prisoner's Dilemma request

Post your requests for addons here, and discuss any addons in development here, as well.
Once an addon has completed development, it will be released in the "Addon Release" forum.

Moderator: Spunkmeyer

Prisoner's Dilemma request

Postby msbzdragn » Mon Jan 17, 2005 10:53 pm

Hi all

I'm looking for a few updates to Prisoner's Dilemma that would make it a LOT more useful to me (and I would guess, to others as well). I believe plushpuffin made her addons open source, but would still contact her before we redistributed any changed version of the addon.

If you're not familiar with Prisoner's Dilemma, here's what it does. Normally if you submit the following in Coranto:

Code: Select all
This is some news article text.

<table>
   <tr>
      <td>
      This is a table<br>
      </td>
   </tr>
</table>


Coranto will turn it into the following mess of invalid HTML in your output:

Code: Select all
This is some news article text.<br><br><table><br>   <tr><br>      <td><br>      This is a table<br><br>      </td><br>   </tr><br></table>


This invalid HTML will cause incorrect rendering of the table in many browsers, because you shouldn't have <br> tags outside of table cells. Prisoner's Dilemma stops the <br> tags from being recognized by the browser by replacing them with a made-up tag, <ebr />. Hence using Prisoner's Dilemma, you'd get the following output that renders properly:

Code: Select all
This is some news article text.<ebr /><ebr /><table><ebr />   <tr><ebr />      <td><ebr />      This is a table<br><ebr />      </td><ebr />   </tr><ebr /></table>


When you go to modify news though, Coranto turns the tags back to CR/LF pairs, including the <br> tag that you wanted in the table cell:

Code: Select all
This is some news article text.

<table>
   <tr>
      <td>
      This is a table

      </td>
   </tr>
</table>


And when you resubmit the item, the <br> tag you placed in the table cell is now also turned into an <ebr />:

Code: Select all
This is some news article text.<ebr /><ebr /><table><ebr />   <tr><ebr />      <td><ebr />      This is a table<ebr /><ebr />      </td><ebr />   </tr><ebr /></table>


Any chance somebody could fix it so the <br> tags you manually typed into the table aren't stripped on a resubmit?

I also have two other suggested changes. One is that the <ebr /> tags appear in your output. There's no reason for this to happen - they're not valid HTML. Hence it would be better if the addon stripped the <ebr /> tags before the HTML was built, so that they were only kept in Coranto's database and not visible in the output.

The other suggested change is that Prisoner's Dilemma only works on the News Text field, as far as I'm aware. I'd like to see a config screen added for Prisoner's Dilemma that would let you select which fields the addon would watch, and which it would ignore.

Any takers who want to have a go at making these changes, which would make the addon a LOT more useful to folks like me that regularly paste formatted HTML into Coranto?
Michael R. Tomkins
Administrator, 'Unofficial Coranto / NewsPro Forums'

Mitsubishi Diamante Forum

Do NOT send me instant messages asking for Coranto help without me telling you explicitly to do so. You WILL be placed on ignore if you do so; I don't have time to provide personal tech support to every person who IM's me. Sorry!
User avatar
msbzdragn
 
Posts: 2397
Joined: Mon Mar 11, 2002 4:51 pm
Location: Oak Ridge, TN

Postby Parahead » Wed Jan 19, 2005 5:52 pm

I do understand what you are saying about the Prisoner's Dilemma and I my first thought when reading your post was that "Why doesn´t he just set the 'Disable HTML' option to No"? But when testing that I realized that Coranto turns the text:
Code: Select all
This is some news article text.

<table>
   <tr>
      <td>
      This is a table<br>
      </td>
   </tr>
</table>
into the following when entering the Modify News page:
Code: Select all
This is some news article text. <table>    <tr>       <td>       This is a table<br>       </td>    </tr> </table>
Which really isn´t what you would expect when setting that option to No either?

So basically, fixing the "Disable HTML" option set to No would be what you want to achive, correct? Or are you using the "Convert Newlines" option?

msbzdragn wrote:The other suggested change is that Prisoner's Dilemma only works on the News Text field, as far as I'm aware. I'd like to see a config screen added for Prisoner's Dilemma that would let you select which fields the addon would watch, and which it would ignore.
It does work on all fields. To check which field to work on, it performs a test if "Convert Newlines" is set to Yes and that "Disable HTML" is set to No.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby Parahead » Wed Jan 19, 2005 6:16 pm

Parahead wrote:
msbzdragn wrote:The other suggested change is that Prisoner's Dilemma only works on the News Text field, as far as I'm aware. I'd like to see a config screen added for Prisoner's Dilemma that would let you select which fields the addon would watch, and which it would ignore.
It does work on all fields. To check which field to work on, it performs a test if "Convert Newlines" is set to Yes and that "Disable HTML" is set to No.
Hmmm... Coming to think of it, shouldn´t it just be possible to modify the testing lines (looking something like this):
Code: Select all
if ($fieldDB{$fn}->{'Newlines'} && $up > $fieldDB{$fn}->{'SubmitPerm'} && ! $fieldDB{$fn}->{'DisableHTML'}) {
to this instead:
Code: Select all
if ($up > $fieldDB{$fn}->{'SubmitPerm'} && ! $fieldDB{$fn}->{'DisableHTML'}) {

And leaving the Newlines option set to No? I have not tested this myself, but I think that could work...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby msbzdragn » Wed Jan 19, 2005 6:53 pm

Parahead wrote:I do understand what you are saying about the Prisoner's Dilemma and I my first thought when reading your post was that "Why doesn´t he just set the 'Disable HTML' option to No"? But when testing that I realized that Coranto turns the text:
Code: Select all
This is some news article text.

<table>
   <tr>
      <td>
      This is a table<br>
      </td>
   </tr>
</table>
into the following when entering the Modify News page:
Code: Select all
This is some news article text. <table>    <tr>       <td>       This is a table<br>       </td>    </tr> </table>
Which really isn´t what you would expect when setting that option to No either?

So basically, fixing the "Disable HTML" option set to No would be what you want to achive, correct? Or are you using the "Convert Newlines" option?

msbzdragn wrote:The other suggested change is that Prisoner's Dilemma only works on the News Text field, as far as I'm aware. I'd like to see a config screen added for Prisoner's Dilemma that would let you select which fields the addon would watch, and which it would ignore.
It does work on all fields. To check which field to work on, it performs a test if "Convert Newlines" is set to Yes and that "Disable HTML" is set to No.


Ah OK, didn't realise that it chose which fields that way. Guess that makes sense. :)

I already have convert newlines as yes, and disable HTML as no, however. I'm not sure I see exactly what you're saying above, but basically I need the combo of convert newlines set to yes, disable HTML to no, and using Prisoner's Dilemma to:

a) Let me put the <br> tag in my output wherever I want manually by typing it into the news item, inside or outside the <brescape> tag pair

b) Automatically replace CR/LF pairs with <br> in my output outside the <brescape> tags

c) Automatically ignore CR/LF pairs in my output between the <brescape> tags

d) Not lose my manually entered <br> tags from news items when I go to Modify News and then click Submit again for the item
Michael R. Tomkins
Administrator, 'Unofficial Coranto / NewsPro Forums'

Mitsubishi Diamante Forum

Do NOT send me instant messages asking for Coranto help without me telling you explicitly to do so. You WILL be placed on ignore if you do so; I don't have time to provide personal tech support to every person who IM's me. Sorry!
User avatar
msbzdragn
 
Posts: 2397
Joined: Mon Mar 11, 2002 4:51 pm
Location: Oak Ridge, TN

Postby Parahead » Wed Jan 19, 2005 7:39 pm

msbzdragn wrote:I already have convert newlines as yes, and disable HTML as no, however. I'm not sure I see exactly what you're saying above
I am not really sure what I am saying above either... ;-) I just know that after my brief tests I don´t really like the way Coranto handles the BR tags and CR/LF pairs even without the Prisoner's Dilemma addon enabled. I will take a look at what needs to be done in PD to do what you want and then also see if Coranto can be changed to behave as one would expect with the BR tags and CR/LF pairs as well...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby msbzdragn » Wed Jan 19, 2005 7:43 pm

Okeydoke, much appreciated. :)
Michael R. Tomkins
Administrator, 'Unofficial Coranto / NewsPro Forums'

Mitsubishi Diamante Forum

Do NOT send me instant messages asking for Coranto help without me telling you explicitly to do so. You WILL be placed on ignore if you do so; I don't have time to provide personal tech support to every person who IM's me. Sorry!
User avatar
msbzdragn
 
Posts: 2397
Joined: Mon Mar 11, 2002 4:51 pm
Location: Oak Ridge, TN

Postby SomeGuyNamedJim » Thu Jan 20, 2005 3:13 am

Isn't that what the "NoBR" addon does?
SomeGuyNamedJim
 
Posts: 73
Joined: Thu Jan 20, 2005 3:12 am

Postby msbzdragn » Thu Jan 20, 2005 3:20 am

SomeGuyNamedJim wrote:Isn't that what the "NoBR" addon does?


The NOBR addon has almost exactly the same bugs as Prisoner's Dilemma. We have somebody who's working on fixing the PD bugs though, and is making good progress. :) We'll want to contact plushpuffin before releasing though, to ensure everything's fine for us to release the fix.

(Well, when I say "us", I have no involvement beyond testing it worked. And I'm carefully not saying who's working on it so they don't get flooded with emails asking for a copy. Suffice to say it works, though).
Michael R. Tomkins
Administrator, 'Unofficial Coranto / NewsPro Forums'

Mitsubishi Diamante Forum

Do NOT send me instant messages asking for Coranto help without me telling you explicitly to do so. You WILL be placed on ignore if you do so; I don't have time to provide personal tech support to every person who IM's me. Sorry!
User avatar
msbzdragn
 
Posts: 2397
Joined: Mon Mar 11, 2002 4:51 pm
Location: Oak Ridge, TN

Postby plushpuffin » Fri Jan 21, 2005 6:58 am

I don't care what you do with it. All my addons are GPL, even though they don't actually have the GPL license included in any of them.
I LIKE PIE
User avatar
plushpuffin
 
Posts: 411
Joined: Tue Mar 12, 2002 1:28 pm
Location: Buffalo, NY

Postby msbzdragn » Fri Jan 21, 2005 7:16 am

Much appreciated, plushpuffin - we'll get the updated addon released shortly then. Changes are:

* Modify News now correctly reloads the page, and doesn't lose <br> tags you manually entered between <brescape> and </brescape> tags

* <ebr />, <brescape> and </brescape> tags are now stripped from Coranto's output

Watch this space for the final release soon...
Michael R. Tomkins
Administrator, 'Unofficial Coranto / NewsPro Forums'

Mitsubishi Diamante Forum

Do NOT send me instant messages asking for Coranto help without me telling you explicitly to do so. You WILL be placed on ignore if you do so; I don't have time to provide personal tech support to every person who IM's me. Sorry!
User avatar
msbzdragn
 
Posts: 2397
Joined: Mon Mar 11, 2002 4:51 pm
Location: Oak Ridge, TN

Postby Parahead » Fri Jan 21, 2005 12:16 pm

http://coranto.org/forum/viewtopic.php?t=7719

I hope that the addon contains all the author and license stuff you want plushpuffin. I tried to use the same approach as you wanted me to use when we discussed Maginot earlier.
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden


Return to Addon Development and Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron