I have managed to set up a local wiki for testing.
Here's what I see :
- in edit mode: ok
- in normal mode: nok
- in purge mode (replace edit by purge in the edit mode URL): ok

I am going to try to find help on the Mediawiki irc channel

Nico

[EMAIL PROTECTED] wrote:

Okay, so the resulting diff on JmolExtension.php is as follows.  No change, aside from PHP complaining about not having a second argument to pass to onBeforePageDisplay().

Incidentally I do have $wgAllowUserCss = true and $wgAllowUserJs = true in MediaWiki's LocalSettings.php to encourage the wiki not to strip out any contributed _javascript_ or CSS, though I'd think the wiki would consider code coming from an extension as being non-user in origin.

--JRM


586a587,601
>
>   // Experimental callback called before display
>   function onBeforePageDisplay(&$parser, &$text, &$x) {
>     global $wgJmolExtensionPath,$wgOut;
>     if (true) {
>       $this->includeScript($wgOut, $wgJmolExtensionPath."/Jmol.js");
>       $this->includeScript($wgOut, $wgJmolExtensionPath."/JmolMediaWiki.js");
>       if ($this->mValSigned) {
>         $this->addScript($wgOut, "jmolInitialize('".$wgJmolExtensionPath."', true);");
>       } else {
>         $this->addScript($wgOut, "jmolInitialize('".$wgJmolExtensionPath."', false);");
>       }
>     }
>     $this->mJmolTagPresent = false;
>   }
606c621,622
<     $wgHooks['ParserAfterStrip'][]  = $wgJmolExtension;
---
>     // $wgHooks['ParserAfterStrip'][]  = $wgJmolExtension;
>     $wgHooks['BeforePageDisplay'][]  = $wgJmolExtension;




"Nicolas Vervelle" <[EMAIL PROTECTED]>

23-Mar-2007 16:34

       
To
jmol-users@lists.sourceforge.net
cc
[EMAIL PROTECTED]
Subject
Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page







If you can easily test modifications, I can try to help you with ideas to make the extension working.
I have some problems with understanding the internal workings of MediaWiki, and this part is really difficult (finding how to include the links to Jmol _javascript_ files only once per page, and only if the page is really using the Jmol extension).
To easily test on my side, I need to setup a wiki on my computer rather than using Jmol wiki, and it requires some time.

An other idea to make it work is to use the BeforePageDisplay hook.
Try the following :
- like the onParserAfterScript() function, create a onBeforePageDisplay() function with the same content, using the modified version of the "if".
- in the wfJmolExtension() function, comment out the "$wgHooks['ParserAfterStrip'][] = $wgJmolExtension;" line and add a new line "$wgHooks['BeforePageDisplay'][] = $wgJmolExtension;" line

Tell me if you have better result
It may require purging the page to have the modification taken into account (use the purge action: go into edit mode, and replace edit by purge in the URL).

Nico

[EMAIL PROTECTED] wrote:

Hi Nico.  Changed line 576 as you suggested, but no joy -- the behavior is the same.


--JRM


Hi,

Since several months, I have a lot of work and didn't get the courage of
working again on the Jmol extension.
I think a simple fix should be the following : in function
onParserAfterStrip(), try replacing the "if ($this->mJmolTagPresent ==
true) {" line by "if (true) {".

Tell me if it works ...

Nico

[EMAIL PROTECTED] wrote:
>
> Hi folks.  I support a small internal wiki for group use within my
> company.  Recently a chemist inquired about embedding Jmol within a
> wiki page, and I found the Jmol MediaWiki extension:
>
>
http://wiki.jmol.org:81/index.php/MediaWiki
>
> I installed the extension according to the instructions and found
> that, while I can get the Jmol applet to display properly in the
> wiki's "Show Preview" mode while editing the page, viewing the live
> page gets no applet at all.  It seems the Javacript lines to include
> Jmol.js and JmolMediaWiki.js and call JmolInitialize() are not being
> included in the live page.  This is with Jmol 11.0.1 and MediaWiki
> 1.7.1.  I think my problem is similar to Kevin Murphy's situation,
> posted here on 2007-01-23:
>
>
http://www.mail-archive.com/jmol-users@lists.sourceforge.net/msg07674.html
>
>
> I couldn't find a resolution in the list archive.  Is this a problem
> within the Jmol extension, or MediaWiki itself?  I'd appreciate any
> suggestions and am willing to test tweaks to the extension.  Thanks,
>
> --JRM

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to