Hi Eric,
вторник, 9 сентября 2014 г., 7:08:43 UTC+4 пользователь Eric Shulman
написал:
>
> On Monday, September 8, 2014 1:18:40 PM UTC-7, Yakov wrote:
>>
>> So,
>>>
>>> In TW 2.9.0 (and old TiddlySaver), I get (!)
>>>> HTMLCollection [<applet style="position:absolute;left:-1px"
>>>> name="TiddlySaver" code="TiddlySaver.class" archive="TiddlySaver.jar"
>>>> width="1" height="1"/>, <applet style="position:absolute;left:-1px"
>>>> name="TiddlySaver" code="TiddlySaver.class" archive="TiddlySaver.jar"
>>>> width="1" height="1"/>]
>>>>
>>>
>>> Uh oh.. that's not right. The value of document.applets['TiddlySaver']
>>> returns
>>> an HTMLCollection with two applets, rather than just one. It looks like
>>> there are TWO "TiddlySaver" applets loaded at the same time, which would be
>>> a likely side-effect of the potential problem with recreateOriginal() that
>>> I described above.
>>>
>>> By the way, with the old TiddlySaver, this bad-semantics fixer plugin
>> enables saving:
>>
>> javaSaveFile = function(filePath,content)
>> {
>> var applet = document.applets['TiddlySaver'];* if(applet instanceof
>> HTMLCollection) // YL tweak
>> applet = applet.item(0);*
>> try {
>>
>>
> That makes sense... though it really doesn't address the root cause of the
> problem, which is that TWO copies of the applet are being loaded (or
> attempted), which Opera apparently doesn't like.
>
>
>> 2) in Opera, examine the value of document.documentElement.outerHTML, and
>>> see what <applet>...</applet> block(s) it contains.
>>>
>> There's 2 applet blocks. After the definition of the
>> TW21Saver.prototype.externalizeTiddler method, there's this part:
>> ...
>>
> then some deprecated code and some other goes (which is not repeated), and
>> in the end of the text:
>>
> ...
>>
> $.twStylesheet.remove = function(options) {
>> ...
>>
> })(jQuery);
>> //]]>
>> </script>
>>
>>
>>
>>
>>
>> *<script type="text/javascript">//<![CDATA[if(useJavaSaver)
>> document.write("<applet style='position:absolute;left:-1px'
>> name='TiddlySaver' code='TiddlySaver.class' archive='TiddlySaver.jar'
>> width='1' height='1'></applet>");//]]></script><applet
>> style="position:absolute;left:-1px" name="TiddlySaver"
>> code="TiddlySaver.class" archive="TiddlySaver.jar" width="1"
>> height="1"></applet>*
>>
>
> Well.. that's not right! Way back in TW2.4.0 and earlier, the
> "if(useJavaSaver)" code occurred after the "externalizeTiddlers" function
> definition... However, in TW2.4.3(?) the deprecated code portion was added.
> Looking around the archives (http://classic.tiddlywiki.com/archives), I
> don't see a revision that had BOTH instances of 'if(useJavaSaver)', and the
> current revision only has the one at the end (as intended).
>
> HOWEVER... I *vaguely* remember something a long time ago about a .recipe
> that might have included the if(useJavaSaver) portion twice. Exactly what
> version of TW is the document with the doubled code?
>
> The document I've tested is the new beta of 2.9.0 (major: 2, minor: 9,
revision: 0, beta: 1), but..
First, I have to complain that the version archive is not updated and the
latest version available [1] is 2.6.5. Fortunately, I've found a copy of
2.8.1 that I saved some time ago.
Second, all my TWs are now 2.7.1, so between that and 2.9.0, there's only
2.8.0 and 2.8.1. I took the saved 2.8.1 (no beta) and tested it as well.
With the old TiddlySaver, it does save, and there's only one applet. So,
this duplicating problem seems to be introduced precisely in 2.9.0.
[1] http://classic.tiddlywiki.com/archive/
> I suspect that if you simply remove the first occurrence of the
> if(userJavaSaver) code from that document, the problem would go away.
>
> Aha. The source of 2.9.0 beta 1 contains two of these blocks:
<script type="text/javascript">
//<![CDATA[
if(useJavaSaver)
document.write("<applet style='position:absolute;left:-1px'
name='TiddlySaver' code='TiddlySaver.class' archive='TiddlySaver.jar'
width='1' height='1'></applet>");
//]]>
</script>
And yes, removing the first one from the source code fixes the issue (for
the old saver, I have to test the new saver separately, as on my PC the old
Java version is installed). Moreover, my "redefine the applet variable" fix
doesn't work with SaveAsPlugin, while this does.
> Of course, even if this does fix it, it doesn't explain how two instances
> of that code got in the file in the first place. The problem MIGHT be
> 'historical', in that the problem was only with a specific revision, and it
> won't re-occur as long as you are no longer using that version (or hand
> edit the file as suggested above). Still, it would be useful to figure out
> exactly how and when the problem was first introduced, so it can be
> documented for others who may encounter it.
>
Well, I have almost no idea how TWc is cooked, so I would hardly help here
unless given some introduction.
Best regards,
Yakov
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.