Post subject: Submission text problem
BigBoct
He/Him
Editor, Former player
Joined: 8/9/2007
Posts: 1692
Location: Tiffin/Republic, OH
I'm trying to do a submission again, and the preview text for the submission is coming out rather badly formatted, even though I'm following all the text guidelines. As an example, this in the text panel...
Run Saber (SNES) beaten in 56087 frames, 15min 34.783sec Run Saber is a pretty blatant ripoff of Strider by Horisoft. It's a fun game, though, and rather more stylistic than Strider, I think. It has one of those dime-a-dozen plots, though; aliens are invading (or have conquered the planet already, the game's opening is not clear on this point,) and the two Run Sabers (genetically enhanced soldiers) are the world's only hope. This TAS uses the male Run Saber, Alow, and beats the game in 15min 34.783sec, delivering the final hit to the final boss at exactly frame 56067. In order of priority, my goals were: *Aims for fastest time **Contains speed/entertainment tradeoffs (boss fights) *Takes no damage *Plays at hardest level *Manipulates luck (enemy positions) Recorded with ZSNES 1.51, primarily at 20% and 25% speed, no special options enabled. All of the stages are the same concept (Get from point A to B, kill or dodge everything in your way,) so I don't see any need to discuss them. Possible future optimizations: *Two players? IMO, this would only help at the last few bosses because of the long invulnerability timer. *Use bombs? Not likely; they take a full five seconds to go off, and you can't do anything during the animation. *Go for pure speed on bosses instead of trying to be entertaining? *Jump from ledges instead of running/sliding off more often? Thanks to: *Dromiceius, for telling me about dashing. *Dyce, for his Run Saber FAQ on GameFAQs
...turns into this in the preview window.
Run Saber (SNES) beaten in 56087 frames, 15min 34.783sec Run Saber is a pretty blatant ripoff of Strider by Horisoft. It's a fun game, though, and rather more stylistic than Strider, I think. It has one of those dime-a-dozen plots, though; aliens are invading (or have conquered the planet already, the game's opening is not clear on this point,) and the two Run Sabers (genetically enhanced soldiers) are the world's only hope. This TAS uses the male Run Saber, Alow, and beats the game in 15min 34.783sec, delivering the final hit to the final boss at exactly frame 56067. In order of priority, my goals were:
  • Aims for fastest time**Contains speed/entertainment tradeoffs (boss fights)
  • Takes no damage *Plays at hardest level *Manipulates luck (enemy positions)
Recorded with ZSNES 1.51, primarily at 20% and 25% speed, no special options enabled. All of the stages are the same concept (Get from point A to B, kill or dodge everything in your way,) so I don't see any need to discuss them. Possible future optimizations:
  • Two players? IMO, this would only help at the last few bosses because of the long invulnerability timer.
  • Use bombs? Not likely; they take a full five seconds to go off, and you can't do anything during the animation.
  • Go for pure speed on bosses instead of trying to be entertaining?
  • Jump from ledges instead of running/sliding off more often?Thanks to:
  • Dromiceius, for telling me about dashing.
  • Dyce, for his Run Saber FAQ on GameFAQs
Is the preview window broken and there's no note of it, or am I doing something wrong?
Previous Name: boct1584
Skilled player (1826)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
You can force line breaks by writing %%%. For example, the beginning of your submission text would look like "Run Saber (SNES) beaten in 56087 frames, 15min 34.783sec %%%Run Saber is a pretty blatant ripoff of Strider by Horisoft. " I don't know why this line break issue happens... You'll have to ask someone who knows how posting in PHP works more into detail, I think.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Ignore Randil. You should almost never use %%%. If the preview is misbehaving, ignore it and just submit it. Edit it later. The preview is known to not work properly on some browsers.
Editor, Expert player (2072)
Joined: 6/15/2005
Posts: 3282
Bisqwit wrote:
You should almost never use %%%.
Many users use a lot of %%%; me included. It's the only way to line break without starting a new paragraph.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
FractalFusion wrote:
It's the only way to line break without starting a new paragraph.
In properly formatted text there's rarely need to do an explicit line break. A new paragraph suffices for most purposes, and when you want to create a list (each item on a new line), there is specific markup for that purpose as well (put an asterisk at the beginning of each line). For headers, similarly (exclamation marks in the beginning of line). What Randil was trying to suggest was to put %%% at the end of each line to force the preview to show properly, even for new paragraphs, list items and the such. Check out Wikipedia. How often can you find a "<br>" in the source code of the articles (I mean the text that you edit, not the HTML source)? For example, take http://en.wikipedia.org/wiki/California_Condor , today's featured article. I count zero. Every time a new line is "forced", it is because it's a list item, a header or a table cell.
Skilled player (1826)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
Sorry about the %%% thing, I guess it's an ugly solution. :P It should be noted that I've never had any problems with line breaks when it comes to lists or code-text. Sometimes the text is misbehaving becuase you copied it from notpad, in that case you want to turn off wordwrap before copying it.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
No, it was clearly a server-not-recognizing newlines problem that seems to recur with some browsers. I tested now, and it occurs with IE7. With Firefox, it does not occur. When I look at the server logs, the differences are: When Firefox does the SOAP call, the server receives the following request:
doRenderWtxt("MTE5Njc2MDQ3NzrlFyGvtKrpygR6yrullZKmVQ+7kA==", "Run Saber (SNES) beaten in 56087 frames, 15min 34.783sec

Run Saber is a pretty blatant ripoff of Strider by Horisoft. It\'s a fun game, though, and rather more stylistic than Strider, I think. It has one of those dime-a-dozen plots, though; aliens are invading (or have conquered the planet already, the game\'s opening is not clear on this point,) and the two Run Sabers (genetically enhanced soldiers) are the world\'s only hope.

This TAS uses the male Run Saber, Alow, and beats the game in 15min 34.783sec, delivering the final hit to the final boss at exactly frame 56067. In order of priority, my goals were:

*Aims for fastest time
**Contains speed/entertainment tradeoffs (boss fights)
*Takes no damage
*Plays at hardest level
*Manipulates luck (enemy positions)

Recorded with ZSNES 1.51, primarily at 20% and 25% speed, no special options enabled.

All of the stages are the same concept (Get from point A to B, kill or dodge everything in your way,) so I don\'t see any need to discuss them.

Possible future optimizations:

*Two players? IMO, this would only help at the last few bosses because of the long invulnerability timer.
*Use bombs? Not likely; they take a full five seconds to go off, and you can\'t do anything during the animation.
*Go for pure speed on bosses instead of trying to be entertaining?
*Jump from ledges instead of running/sliding off more often?

Thanks to:
*Dromiceius, for telling me about dashing.
*Dyce, for his Run Saber FAQ on GameFAQs", "", "")
When IE does the SOAP call, the server receives the following request:
doRenderWtxt("MTE5Njc2MDUxMTqQdHkp4EBvPAViVdi3TkhBK152PQ==", "Run Saber (SNES) beaten in 56087 frames, 15min 34.783sec
Run Saber is a pretty blatant ripoff of Strider by Horisoft. It\'s a fun game, though, and rather more stylistic than Strider, I think. It has one of those dime-a-dozen plots, though; aliens are invading (or have conquered the planet already, the game\'s opening is not clear on this point,) and the two Run Sabers (genetically enhanced soldiers) are the world\'s only hope.
This TAS uses the male Run Saber, Alow, and beats the game in 15min 34.783sec, delivering the final hit to the final boss at exactly frame 56067. In order of priority, my goals were:
*Aims for fastest time**Contains speed/entertainment tradeoffs (boss fights)
*Takes no damage*Plays at hardest level*Manipulates luck (enemy positions)
Recorded with ZSNES 1.51, primarily at 20% and 25% speed, no special options enabled.
All of the stages are the same concept (Get from point A to B, kill or dodge everything in your way,) so I don\'t see any need to discuss them.
Possible future optimizations:
*Two players? IMO, this would only help at the last few bosses because of the long invulnerability timer.
*Use bombs? Not likely; they take a full five seconds to go off, and you can\'t do anything during the animation.
*Go for pure speed on bosses instead of trying to be entertaining?
*Jump from ledges instead of running/sliding off more often?Thanks to:
*Dromiceius, for telling me about dashing.
*Dyce, for his Run Saber FAQ on GameFAQs", "", "")
So IE7 borks the submission text even before the server can receive it. What happens in the source code? The following happens:
function gel(id)       { return document.getElementById(id) }
function tx(id)    { return gel(id).value }
function subpreview_init()      
{      
  with(gel('previewpane').style)      
  {      
    visibility='visible';      
    display='block';      
  }      
  gel('subsavebutton').style.visibility='visible';      
}      
wtxt={
  preview:function(input,cbok,fnok)
  {
    var params = new cloneObject(soap_defs);
    params.wtxt = input;
    SOAP.q_async_json(
       soap_api_url, 'urn:TasvideosQuery', 'doRenderWtxt',
       params, function(data)
       {
         /*alert(displayObject(data));*/
         cbok(data.html)
       }, fnok)
  },
  preview_div:function(divname,input)
  {
    var e = function(h) { gel(divname).innerHTML=h }
    e('');
    wtxt.preview(input, e, function(h) { alert('Preview not available') } )
  }
}
And
<input type="button" value="Preview comments"
onclick="subpreview_init();wtxt.preview_div('subpreviewwin',tx('subtext'))">
So what happens is that the SOAP call gets the value of the textarea as a parameter, and somehow, it gets fried in the process by MSIE, but not on Firefox. This function encodes the query parameters into XML for the SOAP call:
function sq_(a)
{
  if(typeof a != 'object') return xe(a);
  var p,res='';
  for(p in a) res += '<' + p + '>' + sq_(a[p]) + '</' + p + '>';
  return res
}
function xe(s)
{
  /* This technique comes from prototype.js */
  return dom_tag_text('div', s).innerHTML
}
Likely, it is the function xe() that makes IE7 bork the input somehow. For the reference, here's how prototype.js implements it:
  function escapeHTML() {
    var self = arguments.callee;
    self.text.data = this;
    return self.div.innerHTML;
  }
Has someone the energy to look into this problem? Because I'm just "ditch IE and use a sane browser".
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Bisqwit wrote:
Likely, it is the function xe() that makes IE7 bork the input somehow. For the reference, here's how prototype.js implements it:
  function escapeHTML() {
    var self = arguments.callee;
    self.text.data = this;
    return self.div.innerHTML;
  }
Okay, after a more careful inspection, prototype.js appears to have special code for MSIE. (Think "people with special needs".)
if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
  escapeHTML: function() {
    return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
  }
});
Resolution: After adopting this change to the site code, the preview seems to now work with MSIE, too. You will need to reload. Only confirms what we already knew about IE:
Skilled player (1826)
Joined: 4/20/2005
Posts: 2161
Location: Norrköping, Sweden
If it's a bug in Explorer that causes the text to screw up, there's (hopefully) hope that it will get fixed sometime in the future... I guess the morale of all this is to use Firefox when submitting movies, not Explorer. Does Oprah have this submitting issue too?
Former player
Joined: 5/4/2005
Posts: 502
Location: Onett, Eagleland
Randil wrote:
If it's a bug in Explorer that causes the text to screw up, there's (hopefully) hope that it will get fixed sometime in the future... I guess the morale of all this is to use Firefox when submitting movies, not Explorer. Does Oprah have this submitting issue too?
Oprah? lol Not sure actually as far as Opera goes, don't like it.
I think.....therefore I am not Barry Burton
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Opera had and has no problems. (Thanks Pasky13. I didn't actually realize Randil talked about Opera. I wondered why he would talk about Oprah… does she feature program bugs? O_o)
Joined: 4/25/2004
Posts: 498
Bisqwit wrote:
I wondered why he would talk about Oprah… does she feature program bugs? O_o)
Maybe if you count that tapeworm Dr. Oz brought onto her show not too long ago... :p
BigBoct
He/Him
Editor, Former player
Joined: 8/9/2007
Posts: 1692
Location: Tiffin/Republic, OH
It's working now, Bisqwit. Thanks. Unfortunately, the issue I raised in this thread is still occurring.
Previous Name: boct1584