Re: [Jmol-users] Jmol mediawiki extension

2008-12-11 Thread Robert Hanson
OK, there are two issues here.

mayscript and scripting. "maynotscript" is just my invention to remove
the "mayscript" tag. You could do otherwise. I don't think it is
browser-safe to use mayscript=false, because, as I recall, the
original specification was just for the word "mayscript" in the applet
tag, not any value associated with it. So some browsers might see
"mayscript=false" as the same as "mayscript"

JmolButtons. I really don't see how it is possible for any setting of
mayscript to affect whether a JmolButton shows up or not on the page.
Convince me.

Bob





I don't see how it is possible for "mayscript=false" to in any way
affect jmolButton.


On Thu, Dec 11, 2008 at 4:18 AM, Angel Herraez <[EMAIL PROTECTED]> wrote:
> El 10 Dec 2008 a las 18:34, Robert Hanson escribió:
>
>> Something's not right.
>>
>> mayscript = false in no way prevents jmolButton from being created,
>> and with mayscript=false, the jmolButton still works fine.
>>
>>  Something else is going on there.
>
> I though it weird, but that is tested on an independent page I made
> for the purpose (no wiki), and that's what I see in several browsers.
> And no javascript error raised.
>
> BTW, I think we are not making mayscript = false, we are removing the
> mayscript tag and adding a maynotscript tag (haven't actually checked
> this). So, the browser will behave as if no mayscript tag is defined.
> Under this condition, the page I mentioned says that Firefox 2 will
> do Javascript to Java and not Java to Javascript, while other
> browsers will do both. But in Ff3 I see that both work. My Ff2
> (portable version) works as they say.
>
>
> --
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-11 Thread Angel Herraez
El 10 Dec 2008 a las 18:34, Robert Hanson escribió:

> Something's not right.
> 
> mayscript = false in no way prevents jmolButton from being created,
> and with mayscript=false, the jmolButton still works fine.
> 
>  Something else is going on there.

I though it weird, but that is tested on an independent page I made 
for the purpose (no wiki), and that's what I see in several browsers. 
And no javascript error raised.

BTW, I think we are not making mayscript = false, we are removing the 
mayscript tag and adding a maynotscript tag (haven't actually checked 
this). So, the browser will behave as if no mayscript tag is defined.
Under this condition, the page I mentioned says that Firefox 2 will 
do Javascript to Java and not Java to Javascript, while other 
browsers will do both. But in Ff3 I see that both work. My Ff2 
(portable version) works as they say.


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-10 Thread Robert Hanson
Something's not right.

mayscript = false in no way prevents jmolButton from being created,
and with mayscript=false, the jmolButton still works fine.

 Something else is going on there.

Bob



On Wed, Dec 10, 2008 at 3:14 PM, Angel Herráez <[EMAIL PROTECTED]> wrote:
> On 10 Dec 2008 at 7:36, Robert Hanson wrote:
>> But, really, it's simpler than that if you want to disallow all
>> callbacks and every last bit of JavaScript capability of the applet --
>>
>> just don't have "mayscript" in the applet tag.
>
> Ah, interesting.
> But then jmolButton()  et al.  do nothing. I mean, the button is not written 
> to the page*.  A
> very safe mode indeed, but not what we need for the Wiki. So I will go with 
> the "
> _jmol.noEval" method.
>
> *) Rightly so, since they would not be able to send scripts to the applet.
> Oh, not exactly!  If I add a button using
> 
> it does send the script to the applet.
> So "mayscript" is unidirectional: its absence blocks Jmol from talking to 
> javascript, and
> blocks Jmol.js from generating UI controls, but does not block Jmol from 
> listening to
> javascript.  Intriguing...
> (tested in WinXP, Firefox, IE7 and Opera)
>
> This is the reference I recalled:
> http://www.javasonics.com/support/check_liveconnect.php
>
>
>
> --
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-10 Thread Angel Herráez
On 10 Dec 2008 at 7:36, Robert Hanson wrote:
> But, really, it's simpler than that if you want to disallow all
> callbacks and every last bit of JavaScript capability of the applet --
> 
> just don't have "mayscript" in the applet tag.

Ah, interesting.
But then jmolButton()  et al.  do nothing. I mean, the button is not written to 
the page*.  A 
very safe mode indeed, but not what we need for the Wiki. So I will go with the 
" 
_jmol.noEval" method.

*) Rightly so, since they would not be able to send scripts to the applet.
Oh, not exactly!  If I add a button using 

it does send the script to the applet.
So "mayscript" is unidirectional: its absence blocks Jmol from talking to 
javascript, and 
blocks Jmol.js from generating UI controls, but does not block Jmol from 
listening to 
javascript.  Intriguing...
(tested in WinXP, Firefox, IE7 and Opera)

This is the reference I recalled:
http://www.javasonics.com/support/check_liveconnect.php

 

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-10 Thread Bob Hanson

It is true for all browsers because Jmol checks the tag itself and  
explicitly denies itself access


On Dec 10, 2008, at 7:53 AM, "Angel Herraez" <[EMAIL PROTECTED]>  
wrote:

>> All -- I'm pretty sure that if you invoke _jmol.noEval = true in your
>> wiki code, you will completely shut down any JavaScript functionality
>> of Jmol except callbacks. This setting cannot be changed within Jmol
>> -- it is checked upon applet creation and cannot be changed within  
>> the
>> applet. So it does not matter what you do after that. The
>> functionalities that employ JavaScript in Jmol include:
>>
>> script "javascript:"
>> javascript ".."
>> x = javascript(".")
>> isosurface FUNCTIONXY 
>> callback methods
>
> Right, it seems to be working although I haven't tested all those
> possibilites yet.
>
>
>> But, really, it's simpler than that if you want to disallow all
>> callbacks and every last bit of JavaScript capability of the applet  
>> --
>>
>> just don't have "mayscript" in the applet tag.
>
>
> Oh, great! Will that be obeyed by all browsers? I think to recall
> reading that support of the "mayscript" parameters is uneven across
> browsers.
>
> I will test that too.
>
> Thanks, Bob. We are taking big setps towards safe integration in
> wikis.
>
>
>
> --- 
> --- 
> --- 
> -
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,  
> Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to  
> help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> ___
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-10 Thread Angel Herraez
> All -- I'm pretty sure that if you invoke _jmol.noEval = true in your
> wiki code, you will completely shut down any JavaScript functionality
> of Jmol except callbacks. This setting cannot be changed within Jmol
> -- it is checked upon applet creation and cannot be changed within the
> applet. So it does not matter what you do after that. The
> functionalities that employ JavaScript in Jmol include:
> 
> script "javascript:"
> javascript ".."
> x = javascript(".")
> isosurface FUNCTIONXY 
> callback methods

Right, it seems to be working although I haven't tested all those 
possibilites yet.


> But, really, it's simpler than that if you want to disallow all
> callbacks and every last bit of JavaScript capability of the applet --
> 
> just don't have "mayscript" in the applet tag.


Oh, great! Will that be obeyed by all browsers? I think to recall 
reading that support of the "mayscript" parameters is uneven across 
browsers.

I will test that too.

Thanks, Bob. We are taking big setps towards safe integration in 
wikis.



--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-10 Thread Robert Hanson
All -- I'm pretty sure that if you invoke _jmol.noEval = true in your
wiki code, you will completely shut down any JavaScript functionality
of Jmol except callbacks. This setting cannot be changed within Jmol
-- it is checked upon applet creation and cannot be changed within the
applet. So it does not matter what you do after that. The
functionalities that employ JavaScript in Jmol include:

script "javascript:"
javascript ".."
x = javascript(".")
isosurface FUNCTIONXY 
callback methods


But, really, it's simpler than that if you want to disallow all
callbacks and every last bit of JavaScript capability of the applet --

just don't have "mayscript" in the applet tag.

For example:

  jmolSetDocument(0)
  var s = jmolApplet([width,height], script)
  s=s.replace(/mayscript/,"maynotscript")
  document.wrte(s)

produces a Jmol applet with no JavaScript access whatsoever.

Bob


-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Rzepa, Henry
>>
>
> I suspect this would be easier for users and could likely be made more
> secure. However, I have no idea how this would be implemented. The
> mediawiki language seems to aim to remove as much direct html use as
> possible.
>>>

Our students use Jmol Mediawiki extensively. We have come up against  
the lack of a proper XML validator in mediawiki, which means that the  
more "XML" one asks the students to insert, the greater the chance of   
XML errors.  I am increasingly having to cope with  the student's work  
disappearing,  to be replaced by a bald  XMR error message instead.   
Gaining access to the history file to revert is also not entirely  
trivial. One can imagine what would happen if Wikipedia pages started  
to vanish in a similar manner (and of course, it could be done  
maliciously as well as accidentally).  Does Wikipedia have a bot that  
can automatically undo these sorts of errors (the XML corruption is  
often such that repair is out of the question)?

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Paul Pillot
You can also embed these javascript calls into the pdb file itself,  
if it has an embedded Jmol script into it.
Paul

Le 9 déc. 08 à 14:41, Angel Herraez a écrit :

> El 9 Dec 2008 a las 14:03, Nicolas Vervelle escribió:
>> For example, I think you can stillrun Javascriptwithscripts
>> calling other scripts:
>> *   Create a wiki page with contents corresponding to a Jmol  
>> script with
>> Javascript in it.
>> *   Add a  tag in a page with a script calling the other script
>
> Aha, that's the sort of idea I wanted to hear (but had not imagined).
> Then maybe we should block the use of the "script" command too.
> After all, we shouldn't need too much Jmol scripting flexibility
> inside a Wiki; just basic display options that can be pasted in the
> page, not in independent files.
> I will test it this evening.

--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Brian Salter-Duke
On Tue, Dec 09, 2008 at 02:03:17PM +0100, Nicolas Vervelle wrote:
> Hi,
> 
> 
> On Tue, Dec 9, 2008 at 1:21 PM, Angel Herraez <[EMAIL PROTECTED]> wrote:
> 
> > I'd like to keep this discussion going, so here is a little bit more,
> > picking up on the possibilities to have Jmol supported in Wikipedia
> > and other Wikis:
> >
> >
> > On 30 Nov 2008 22:53, Nicolas Vervelle wrote:
> > >
> > > On the matter of security issues, there are at least 2 things to do :
> > > *   Being able to entirely deactivate the possibility to let arbitrary
> > > Javascript being called by Jmol. I don't know if there's a way in
> > > Jmol to disable this. There's a need to completely disable the
> > > 'javascript' command in Jmol scripts. The problem is demonstrated by
> > >
> > http://wiki.jmol.org:81/index.php/User:Ilmari_Karonen/JS_injection_dem
> > > o
> >
> > Do we still need this? (see below)
> >
> >
> > > *   Ensuring that the extension doesn't allow for true Javascript
> > > injection (whatever text is entered by someone in the tags,
> > > this only creates Jmol applet and Jmol scripts, nothing else). I
> > > think this means ensuring that in the generated page, the text is
> > > always correctly escaped to prevent Javascript injection.
> >
> > This is implemented in the last update.
> >
> > > The second problem nees to be treated in the extension. My knowledge
> > > on PHP and the security issues is limited (and I don't have much time
> > > avaiable), so some help from someone knowing how to deal with the
> > > script injection would be very useful.
> >
> > The way I've implemented it, any script passed to the Extension
> > (inside the extension's 

Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Brian Salter-Duke
On Tue, Dec 09, 2008 at 01:21:01PM +0100, Angel Herraez wrote:
> I'd like to keep this discussion going, so here is a little bit more, 
> picking up on the possibilities to have Jmol supported in Wikipedia 
> and other Wikis:

[Nico's message snipped]
 
> And on 1 Dec 2008 9:49, Brian Salter-Duke wrote:
> > I am just thinking aloud here. I think there could be a solution to add
> > a chaneg to medciawiki itself to have some specific Jmol tags, something
> > like:
> > 
> >  ... 
> 
> We already have the  tag added by the extension. Is there any 
> difference intended?
> 
> > avoiding all calls to Jmol itself. 
> 
> I don't quite understand. There is no call to Jmol until the 
> extension inserts the Jmol code. And by using 
> or   one avoids Jmol to be loaded until the visitor 
> requests it.

This is an example of an image inserted on wikipedia:-

[[Image:Meissner effect zoom.jpg|thumb|200px|right|A [[magnet]]
levitating above a [[high-temperature superconductor]] demonstrates the
[[Meissner effect]].]]

Everything is together. I presume the bits are handled by mediawiki.

In contrast, a simple Jmol call is full of html/javascript like stuff.

set spin X 10; spin on
ethane_s1palegreen250
ethane_s.pdb

spin onethane_s1Start
spinning
spin offethane_s1Stop
spinning


What if it was like this:-

[[Jmolimage:ethane_s.pdb|color=palegreen|script=spin X 10|script=spin
on|size=250|button=(spin on,Start spinning)|button=(spin off,Stop
spining)]]

Jmolimage:ethane_s.pdb starts it all off and includes:-
ethane_s.pdb

color=palegreen includes palegreen

size=250 includes palegreen

script=spin X 10| script=spin on would generate:-
set spin X 10; spin on

button=(spin on,Start spinning) is interpreted as:-
spin onethane_s1Start
spinning

button=(spin off,Stop spining) is interpreted as:-
spin offethane_s1Stop
spinning

I suspect this would be easier for users and could likely be made more
secure. However, I have no idea how this would be implemented. The
mediawiki language seems to aim to remove as much direct html use as
possible.
 
> > The parameters for jmolimage would
> > give everything that was needed, method, file names, etc. Mediawiki
> > itself would then be doing any chaecks that were needed. It would also
> > be easier for wikipedia editors and I suspect the wikipedia techs would
> > prefer this solution. Is this worth following up? I do nopt>set spin
> > X 10; spin ont know
> > mediawiki and could be just talking nonsense.
> 
> I think it is the JmolMediaWiki Extension that must do all this 
> anyway, not the generic MediaWiki software. And it is doing so 
> already, by using the different sub-tags of the  tag. Do you 
> envisage any differences, Brian? Please ellaborate on that.
> 
> The configuration in the server (LocalSettings.php) may block the use 
> of external URLs for models, or of uploaded files,  may block or 
> impose the use of signed applet. The rest of the task in inside the 
> Extension.
> 
> 
> > Another advantage of this approach is that wikipedia could limit the
> > mehtods available and perhaps limit them to file upload only. 
> 
> Already possible (see above).

I understand this. When the extension was first written, it was
understandable that a number of different approaches were tried. Maybe
it is time to limit these choices and make it simpler. Particularly on
wikipedia, which has a large number of editors who are likely to be less
familiar with Jmol than users on say the Jmol wiki, I think we have to
decide. The choice is I think really between an uploaded file (on either
wikipedia or Commons) and inline data. The latter will be seen as
clumsy, but it makes it all self contained and does not mean that the
whole upload business has to be altered - see below. The former would be
better, but changes would be needed. 

> > The
> > mediawiki code would need changing anyway to allow use of Jmol files on
> > Commons as well as wikipedia. 
> 
> This needs further work, but is related to the above config. 
> settings.

Whether Commons or the home wiki (say wikipedia or wikiversity) many
changes would be needed. First, upload is restricted to files with
certain extensions. We would have to decide which file types we wanted
and allow those extensions to the upload. Second, we need to think about
copyright issues on uploaded files and how these are going to be added.
If you click on an image, it brings up the image page that displays both
the image and all the upload, copyright, etc. details. How would this
work for say a pdb file. So, third, we have a different image page.
Adding an new prefix "Jmolimage" may facilitate this. Finally, we have
to disguise the "Look on Commons first for the Jmol file; then look on
the local wiki; then fail".

I'm still thinking aloud here and the above is a bit different to what
Angel is responding to.

Brian.

-- 
A child of five could understand this!  Fetch me a child of five. 
   -- Marx (guess which one)
Brian Salt

Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Angel Herráez
On 9 Dec 2008 at 17:14, Nicolas Vervelle wrote:

> I am rather thinking as Rolf does, that to convince Wikipedia people it would 
> be better to really 
> deactivate Javascript in Jmol itself (would it be possible to pass an option 
> to Jmol applet 
> whenstarting it ?), rather than trying to block several things. 

As usual, Bob had the rabbit ready in his hat. There is an option to avoid 
evaluation of 
javascript from inside Jmol.
This prevents javascript injection in the wiki both from 

Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Nicolas Vervelle
On Tue, Dec 9, 2008 at 2:41 PM, Angel Herraez <[EMAIL PROTECTED]> wrote:

> El 9 Dec 2008 a las 14:03, Nicolas Vervelle escribió:
> > For example, I think you can stillrun Javascriptwithscripts
> > calling other scripts:
> > *   Create a wiki page with contents corresponding to a Jmol script with
> > Javascript in it.
> > *   Add a  tag in a page with a script calling the other script
>
> Aha, that's the sort of idea I wanted to hear (but had not imagined).
> Then maybe we should block the use of the "script" command too.
> After all, we shouldn't need too much Jmol scripting flexibility
> inside a Wiki; just basic display options that can be pasted in the
> page, not in independent files.
> I will test it this evening.
>

I am rather thinking as Rolf does, that to convince Wikipedia people it
would be better to really deactivate Javascript in Jmol itself (would it be
possible to pass an option to Jmol applet when starting it ?), rather than
trying to block several things.

I don't know if scripts would be used much, but using independent files can
help apply similar display options to a lot of a pages.
I haven't tested if inserting templates inside  tags works : that
could be an other way of running the same script on a lot of pages.

Nico
--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Rolf Huehne
Angel Herraez wrote:
> El 9 Dec 2008 a las 14:03, Nicolas Vervelle escribió:
>> For example, I think you can stillrun Javascriptwithscripts 
>> calling other scripts: 
>> *   Create a wiki page with contents corresponding to a Jmol script with 
>> Javascript in it. 
>> *   Add a  tag in a page with a script calling the other script 
> 
> Aha, that's the sort of idea I wanted to hear (but had not imagined). 
> Then maybe we should block the use of the "script" command too.
> After all, we shouldn't need too much Jmol scripting flexibility 
> inside a Wiki; just basic display options that can be pasted in the 
> page, not in independent files.
> I will test it this evening.
> 
I think the only way to guarantee that no Javascript can be injected by
Jmol would be to add a non-reversible switch to Jmol itself.

I would expect only this kind of solution might convince the Wikipedia
people that Jmol is save enough.

Regards,
Rolf


--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Angel Herraez
El 9 Dec 2008 a las 14:03, Nicolas Vervelle escribió:
> For example, I think you can stillrun Javascriptwithscripts 
> calling other scripts: 
> *   Create a wiki page with contents corresponding to a Jmol script with 
> Javascript in it. 
> *   Add a  tag in a page with a script calling the other script 

Aha, that's the sort of idea I wanted to hear (but had not imagined). 
Then maybe we should block the use of the "script" command too.
After all, we shouldn't need too much Jmol scripting flexibility 
inside a Wiki; just basic display options that can be pasted in the 
page, not in independent files.
I will test it this evening.



--
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Nicolas Vervelle
Hi,


On Tue, Dec 9, 2008 at 1:21 PM, Angel Herraez <[EMAIL PROTECTED]> wrote:

> I'd like to keep this discussion going, so here is a little bit more,
> picking up on the possibilities to have Jmol supported in Wikipedia
> and other Wikis:
>
>
> On 30 Nov 2008 22:53, Nicolas Vervelle wrote:
> >
> > On the matter of security issues, there are at least 2 things to do :
> > *   Being able to entirely deactivate the possibility to let arbitrary
> > Javascript being called by Jmol. I don't know if there's a way in
> > Jmol to disable this. There's a need to completely disable the
> > 'javascript' command in Jmol scripts. The problem is demonstrated by
> >
> http://wiki.jmol.org:81/index.php/User:Ilmari_Karonen/JS_injection_dem
> > o
>
> Do we still need this? (see below)
>
>
> > *   Ensuring that the extension doesn't allow for true Javascript
> > injection (whatever text is entered by someone in the tags,
> > this only creates Jmol applet and Jmol scripts, nothing else). I
> > think this means ensuring that in the generated page, the text is
> > always correctly escaped to prevent Javascript injection.
>
> This is implemented in the last update.
>
> > The second problem nees to be treated in the extension. My knowledge
> > on PHP and the security issues is limited (and I don't have much time
> > avaiable), so some help from someone knowing how to deal with the
> > script injection would be very useful.
>
> The way I've implemented it, any script passed to the Extension
> (inside the extension's 

Re: [Jmol-users] Jmol mediawiki extension

2008-12-09 Thread Angel Herraez
I'd like to keep this discussion going, so here is a little bit more, 
picking up on the possibilities to have Jmol supported in Wikipedia 
and other Wikis:


On 30 Nov 2008 22:53, Nicolas Vervelle wrote:
> 
> On the matter of security issues, there are at least 2 things to do :
> *   Being able to entirely deactivate the possibility to let arbitrary 
> Javascript being called by Jmol. I don't know if there's a way in 
> Jmol to disable this. There's a need to completely disable the 
> 'javascript' command in Jmol scripts. The problem is demonstrated by 
> http://wiki.jmol.org:81/index.php/User:Ilmari_Karonen/JS_injection_dem
> o

Do we still need this? (see below)


> *   Ensuring that the extension doesn't allow for true Javascript 
> injection (whatever text is entered by someone in the tags, 
> this only creates Jmol applet and Jmol scripts, nothing else). I 
> think this means ensuring that in the generated page, the text is 
> always correctly escaped to prevent Javascript injection.

This is implemented in the last update.

> The second problem nees to be treated in the extension. My knowledge 
> on PHP and the security issues is limited (and I don't have much time 
> avaiable), so some help from someone knowing how to deal with the 
> script injection would be very useful.

The way I've implemented it, any script passed to the Extension 
(inside the extension's 

Re: [Jmol-users] Jmol mediawiki extension

2008-12-01 Thread Brian Salter-Duke
Take a look at this blog:-

http://ultimategerardm.blogspot.com/2008/12/jmol.html

More publicity to get Jmol properly working on wikis.

Brian.
-- 
"First they ignore you, then they laugh at you, then they fight you,
then you win." 
  -- Gandhi, being prophetic about Linux.
Brian Salter-Duke (Brian Duke) Email: b_duke(AT)bigpond(DOT)net(DOT)au


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-12-01 Thread Angel Herraez
Hi Gerard 

Thanks for the suggestions.
Jmol is already fully internationalized and localized, over 10 
languages:
http://wiki.jmol.org:81/index.php/Internationalisation/Current_Status
 I'm not sure if the MediaWiki extension would need any further 
localization.


Does the  testing environment  that you mention need a web Wiki 
setup, or can it be tested locally? I would be interested on it, but 
haven't got a Wiki to implement it --nor the time to involvemyself 
into such a task--.



El 1 Dec 2008 a las 11:24, Brian Salter-Duke escribió:

> Hi folks,
> 
> Gerard Meijssen <[EMAIL PROTECTED]> has asked me to pass this on
> to the Jmol list. I responded to this discussion on the Commons-l list:-
> 
> [Commons-l] Support for Chemical Markup Language - followup
> 
> --
> Hoi,
> 
> If you want to get the JMOL software internationalised and localised,
> you may want to consider talking to the Betawiki people. We do the
> localisation of MediaWiki and we do the localisation of many of its
> extensions. We would be interested in working on JMOL as it is a lively
> and relevant software / community.
> 
> I am also involved in a testing envirionment for MediaWiki extensions,
> if you are interested in using this environment, let me know.. I take it
> that you will convey my message to the JMOL mailing list ?  Thanks,
> Gerard


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-30 Thread Brian Salter-Duke
Hi folks,

Gerard Meijssen <[EMAIL PROTECTED]> has asked me to pass this on
to the Jmol list. I responded to this discussion on the Commons-l list:-

[Commons-l] Support for Chemical Markup Language - followup

--
Hoi,

If you want to get the JMOL software internationalised and localised,
you may want to consider talking to the Betawiki people. We do the
localisation of MediaWiki and we do the localisation of many of its
extensions. We would be interested in working on JMOL as it is a lively
and relevant software / community.

I am also involved in a testing envirionment for MediaWiki extensions,
if you are interested in using this environment, let me know.. I take it
that you will convey my message to the JMOL mailing list ?  Thanks,
Gerard

--

This does seem to be a useful idea. I'll have a look at betawiki but
I'm very busy this week and early next week.

Cheers, Brian.

-- 
Brian Salter-Duke (Brian Duke)   
  626 Melbourne Rd, Spotswood, VIC, 3015, Australia. 
  Email: [EMAIL PROTECTED]Phone: 03-93992847
Web: http://www.salter-duke.bigpondhosting.com/brian/index.htm 


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-30 Thread Brian Salter-Duke
On Sun, Nov 30, 2008 at 10:53:29PM +0100, Nicolas Vervelle wrote:
> Hi everyone,
> 
> I have been quite busy for several months on other matters than Jmol, so I
> haven't worked at all on the extension.
> I am happy to see people interested in making it work, and bringing it to
> Wikipedia.
> 
> On the matter of security issues, there are at least 2 things to do :
> 
>- Being able to entirely deactivate the possibility to let arbitrary
>Javascript being called by Jmol. I don't know if there's a way in Jmol to
>disable this. There's a need to completely disable the 'javascript' command
>in Jmol scripts. The problem is demonstrated by
>http://wiki.jmol.org:81/index.php/User:Ilmari_Karonen/JS_injection_demo
>- Ensuring that the extension doesn't allow for true Javascript injection
>(whatever text is entered by someone in the  tags, this only creates
>Jmol applet and Jmol scripts, nothing else). I think this means ensuring
>that in the generated page, the text is always correctly escaped to prevent
>Javascript injection.
> 
> Both things clearly need to be done in order to hope to see Jmol on
> Wikipedia : having every editor being able to add arbitrary Javascript that
> will be run by everyone viewing a page is a security issue.
> 
> The first problem needs first to be answered in the Jmol applet itself. Is
> there a way to add an option in the applet construction to remove the
> 'javascript' command in Jmol scripts ? Bob ?
> 
> The second problem nees to be treated in the extension. My knowledge on PHP
> and the security issues is limited (and I don't have much time avaiable), so
> some help from someone knowing how to deal with the script injection would
> be very useful.
> 
> Nico

I am just thinking aloud here. I think there could be a solution to add
a chaneg to medciawiki itself to have some specific Jmol tags, something
like:

 ... 

avoiding all calls to Jmol itself. The parameters for jmolimage would
give everything that was needed, method, file names, etc. Mediawiki
itself would then be doing any chaecks that were needed. It would also
be easier for wikipedia editors and I suspect the wikipedia techs would
prefer this solution. Is this worth following up? I do not know
mediawiki and could be just talking nonsense.

Another advantage of this approach is that wikipedia could limit the
mehtods available and perhaps limit them to file upload only. The
mediawiki code would need changing anyway to allow use of Jmol files on
Commons as well as wikipedia. Some mediawiki changes are going to be
needed anyway.

Brian.

-- 
Real Programmers can write FORTRAN in any language.
-- unknown
Brian Salter-Duke (Brian Duke) Email: b_duke(AT)bigpond(DOT)net(DOT)au


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-30 Thread Nicolas Vervelle
Hi everyone,

I have been quite busy for several months on other matters than Jmol, so I
haven't worked at all on the extension.
I am happy to see people interested in making it work, and bringing it to
Wikipedia.

On the matter of security issues, there are at least 2 things to do :

   - Being able to entirely deactivate the possibility to let arbitrary
   Javascript being called by Jmol. I don't know if there's a way in Jmol to
   disable this. There's a need to completely disable the 'javascript' command
   in Jmol scripts. The problem is demonstrated by
   http://wiki.jmol.org:81/index.php/User:Ilmari_Karonen/JS_injection_demo
   - Ensuring that the extension doesn't allow for true Javascript injection
   (whatever text is entered by someone in the  tags, this only creates
   Jmol applet and Jmol scripts, nothing else). I think this means ensuring
   that in the generated page, the text is always correctly escaped to prevent
   Javascript injection.

Both things clearly need to be done in order to hope to see Jmol on
Wikipedia : having every editor being able to add arbitrary Javascript that
will be run by everyone viewing a page is a security issue.

The first problem needs first to be answered in the Jmol applet itself. Is
there a way to add an option in the applet construction to remove the
'javascript' command in Jmol scripts ? Bob ?

The second problem nees to be treated in the extension. My knowledge on PHP
and the security issues is limited (and I don't have much time avaiable), so
some help from someone knowing how to deal with the script injection would
be very useful.

Nico
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Brian Salter-Duke
On Sun, Nov 30, 2008 at 01:16:21AM +0100, Angel Herráez wrote:
> On 30 Nov 2008 at 9:48, Brian Salter-Duke wrote:
> > That is great news. Thanks, Henry. My page on the Jmol wiki is now
> > working and I have something I can point the wikipedia tech folks to so
> > that they can look at Jmol. 
 
> Brian, I'm quite surprised that your page has started to work NOW.
> Unless Nico has updated the Wiki without saying a word, what I
> updated earlier this evening was the php file in the Jmol SVN pages. I
> would not expect that to affect the Wiki automatically.
> 
> > The question of security still remains. Has
> > this been addresed by anyone?  Does anyone on this list think it is an
> > issue? 

> A recent addition to the Wiki questions security on the basis that any
> javascript can be run from Jmol script. I'm not sure, though, what
> security issues that raises.

> See
> http://wiki.jmol.org:81/index.php/User:Ilmari_Karonen/JS_injection_demo
> 
> The latest post in the Talk page
> http://wiki.jmol.org:81/index.php/User_talk:Ilmari_Karonen/JS_injection_demo
> sounds very threatening, but I don't understand it fully. It may,
> however, be a big obstacle for Wikipedia adoption.

Discussion has been going on at both:-

Wikimedia Commons Discussion List <[EMAIL PROTECTED]>

and

Wikimedia developers <[EMAIL PROTECTED]>

This discussion may illustrate the problem:-

[Post to commons list]
See https://bugzilla.wikimedia.org/show_bug.cgi?id=16491
That users can embed javascript is not acceptable to run it on
Wikipedia.
Other parameters, like urlContents or signed wouldn't be used but at
least they can be disabled.

[Me]
I am afraid this is all beyond my expertise. Are you saying that there
is no way Jmol can ever be used on WMF projects?

[Reply from someone else]
There is, as soon as the Javascript embedding possibility gets
disabled and the extension gets a proper review (TM).

This link:-

https://bugzilla.wikimedia.org/show_bug.cgi?id=16491

mentioned there is interesting but the question of the CML extension is
getting confused with the Jmol extension as both were mentioned in the
original post on the Commons list.

While Jmol on wikipedia would be great, I would really like it on
wikiversity to illustrate some teeaching materials I have started to put
there.

Brian. 

-- 
"If people are good only because they fear punishment, and hope for
reward, then we are a sorry lot indeed."
   -- Albert Einstein   
Brian Salter-Duke (Brian Duke) Email: b_duke(AT)bigpond(DOT)net(DOT)au


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Angel Herráez
On 30 Nov 2008 at 9:48, Brian Salter-Duke wrote:
> That is great news. Thanks, Henry. My page on the Jmol wiki is now
> working and I have something I can point the wikipedia tech folks to so
> that they can look at Jmol. 

Brian, I'm quite surprised that your page has started to work NOW. Unless Nico 
has updated 
the Wiki without saying a word, what I updated earlier this evening was the php 
file in the 
Jmol SVN pages. I would not expect that to affect the Wiki automatically.


> The question of security still remains. Has
> this been addresed by anyone?  Does anyone on this list think it is an
> issue? 

A recent addition to the Wiki questions security on the basis that any 
javascript can be run 
from Jmol script. I'm not sure, though, what security issues that raises.
See
http://wiki.jmol.org:81/index.php/User:Ilmari_Karonen/JS_injection_demo

The latest post in the Talk page
http://wiki.jmol.org:81/index.php/User_talk:Ilmari_Karonen/JS_injection_demo
sounds very threatening, but I don't understand it fully. It may, however, be a 
big obstacle 
for Wikipedia adoption.



-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Brian Salter-Duke
On Sat, Nov 29, 2008 at 02:53:18PM +, Rzepa, Henry wrote:
>
> On 29 Nov 2008, at 01:41, Brian Salter-Duke wrote:
>
>> The question of having Jmol used on wikipedia has again been raised on
>> the commons email list. On contributor to the discussion says that the
>> jmol mediawiki extension now only works with an older version of
>> mediawiki. Certainly my examples at:-
>>
>> http://wiki.jmol.org:81/index.php/User:Bduke
>
>
> I have gotten things to work myself (Thanks Angel for the remark that  
> gave the clue).
>
> In the distribution 
> http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/
>
> edit the file Jmol.php  to make the change from
>
> $wgJmolExtensionPath = "/extensions/Jmol";
>
> to
>
> $wgJmolExtensionPath = $wgScriptPath."/extensions/Jmol";

That is great news. Thanks, Henry. My page on the Jmol wiki is now
working and I have something I can point the wikipedia tech folks to so
that they can look at Jmol. The question of security still remains. Has
this been addresed by anyone?  Does anyone on this list think it is an
issue? It is quite clear that Kmol will never be added to wikipedia
until the tech folks are totally convinced that there are no security
issues. I just do not know much about security and I do not speak php.

Regards, Brian.
-- 
On two occasions I have been asked [by members of Parliament], "Pray, Mr. 
Babbage, if you put into the machine wrong figures, will the right answers 
come out?". I am not able rightly to comprehend the kind of confusion of 
ideas that could provoke such a question.
   -- Charles Babbage
Brian Salter-Duke (Brian Duke) Email: b_duke(AT)bigpond(DOT)net(DOT)au


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Rzepa, Henry

On 29 Nov 2008, at 18:43, Angel Herráez wrote:

> Henry, I'm glad that you found the cure for your problem, and to  
> have been a catalyst in that
> cure :)
>
> On 29 Nov 2008 at 14:53, Rzepa, Henry wrote:
>> In the distribution 
>> http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/
>>
>> edit the file Jmol.php  to make the change from
>>
>> $wgJmolExtensionPath = "/extensions/Jmol";
>>
>> to
>>
>> $wgJmolExtensionPath = $wgScriptPath."/extensions/Jmol";
>>
>
> I have commited this change to SVN.
>

Thanks for the above!
-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Angel Herráez
Henry, I'm glad that you found the cure for your problem, and to have been a 
catalyst in that 
cure :)

On 29 Nov 2008 at 14:53, Rzepa, Henry wrote:
> In the distribution 
> http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/
> 
> edit the file Jmol.php  to make the change from
> 
> $wgJmolExtensionPath = "/extensions/Jmol";
> 
> to
> 
> $wgJmolExtensionPath = $wgScriptPath."/extensions/Jmol";
> 

I have commited this change to SVN.

The discussion has also prompted me to update several pages in Jmol Wiki 
related to wiki 
extensions.


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Rzepa, Henry
I have gotten the  Jmol Mediawiki to display a variety of more  
interesting  modes:

https://www.ch.ic.ac.uk/wiki2/index.php/Mod:jmol

(although I dont think it can do everything a conventionally invoked  
applet can).

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Rzepa, Henry

On 29 Nov 2008, at 01:41, Brian Salter-Duke wrote:

> The question of having Jmol used on wikipedia has again been raised on
> the commons email list. On contributor to the discussion says that the
> jmol mediawiki extension now only works with an older version of
> mediawiki. Certainly my examples at:-
>
> http://wiki.jmol.org:81/index.php/User:Bduke


I have gotten things to work myself (Thanks Angel for the remark that  
gave the clue).

In the distribution 
http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol-extensions/wiki/MediaWiki/

edit the file Jmol.php  to make the change from

$wgJmolExtensionPath = "/extensions/Jmol";

to

$wgJmolExtensionPath = $wgScriptPath."/extensions/Jmol";

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Angel Herráez
On 29 Nov 2008 at 8:12, Rzepa, Henry wrote:
> http://www.ch.ic.ac.uk/wiki2/index.php/Mod:jmol
> 
> I currently have it down to a  "silly mistake" somewhere, probably a  
> variable in LocalSettings.php. The correct source code is being  
> generated, including the  Jmolinitialize script etc, but it just does  
> not start (if someone CAN spot a mistake in the source for the page  
> above,  I would be very grateful!) 


Henry, I'm probably been naïve, but your page source code says


and when I try the url
http://www.ch.ic.ac.uk/extensions/Jmol/Jmol.js 
I get an error:
The requested URL /extensions/Jmol/Jmol.js was not found on this server.

So where am I confused?
That explains the js console errors I get:

Error: jmolInitialize is not defined
Archivo de origen: http://www.ch.ic.ac.uk/wiki2/index.php/Mod:jmol
Línea: 58

Error: jmolCheckBrowser is not defined
Archivo de origen: http://www.ch.ic.ac.uk/wiki2/index.php/Mod:jmol
Línea: 75


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol mediawiki extension

2008-11-29 Thread Rzepa, Henry

Brian,

We are currently running courses with no issue using the  "old"  
implementation

http://www.ch.ic.ac.uk/wiki/

(which has proved  VERY robust. We often have classes of  50 students  
all hammering pages with  10 or more embedded Jmols, with no issues).

but have also been struggling to implement the new version

http://www.ch.ic.ac.uk/wiki2/index.php/Mod:jmol

I currently have it down to a  "silly mistake" somewhere, probably a  
variable in LocalSettings.php. The correct source code is being  
generated, including the  Jmolinitialize script etc, but it just does  
not start (if someone CAN spot a mistake in the source for the page  
above,  I would be very grateful!) The current environment is as usual  
at http://www.ch.ic.ac.uk/wiki2/index.php/Special:Version Perhaps its  
an issue with the combinationin of  Jmol and  StubManager?

Although I love Mediawiki (and its use HAS revolutionalized how we  
grade student "molecular modelling"),  it remains a very fragile  
environment.  Thus a single misbehaving  extension and  mediawiki has  
a propensity for displaying  NOTHING.

I am very keen to extend our course so that the wiki can start to  
display eg  MO surfaces, vibrations, etc, but all this is predicated  
on being able to update the Jmol.

Oh, and I need to get all this working, since  I hope to present on  
this topic at the  ACS next spring!

One final question.  Students are asked to paste a boiler plate 3  
lines to include their own  molecules.  Inevitably, they sometimes  
truncate this, missing out either the start or the end of the syntax.  
MediaWiki contrives to accept this without issue, but then complains  
inevitably that the  XML is broken and will refuse to allow the broken  
page to be edited.  One then has to access the history list manually,  
and revert to a working version.  Its messy.  But why cannot the php  
parser validate the  XML in the first place, and refused to deposit it  
into the MySQL if it does not validate?

On 29 Nov 2008, at 01:41, Brian Salter-Duke wrote:

> The question of having Jmol used on wikipedia has again been raised on
> the commons email list. On contributor to the discussion says that the
> jmol mediawiki extension now only works with an older version of
> mediawiki. Certainly my examples at:-
>
> http://wiki.jmol.org:81/index.php/User:Bduke
>
> are not working. I still very much want to get jmol working on  
> wikipedia
> and would like to also get it on wikiversity for some teaching  
> materials
> I have started to add there. However, I have been very much out of  
> touch
> recently. Could someone please update me on what the situation is with
> the jmol mediawiki extension and point me to an example of it working,
> so I can point the wikipedia technical folks to have a look at the
> examples?
>
> Also, last time I tried to get jmol on wikipedia I was told there were
> security issues with the extension. Have these been addressed?
>

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


[Jmol-users] Jmol mediawiki extension

2008-11-28 Thread Brian Salter-Duke
The question of having Jmol used on wikipedia has again been raised on
the commons email list. On contributor to the discussion says that the
jmol mediawiki extension now only works with an older version of
mediawiki. Certainly my examples at:-

http://wiki.jmol.org:81/index.php/User:Bduke

are not working. I still very much want to get jmol working on wikipedia
and would like to also get it on wikiversity for some teaching materials
I have started to add there. However, I have been very much out of touch
recently. Could someone please update me on what the situation is with
the jmol mediawiki extension and point me to an example of it working,
so I can point the wikipedia technical folks to have a look at the
examples? 

Also, last time I tried to get jmol on wikipedia I was told there were
security issues with the extension. Have these been addressed?

Regards, Brian.

-- 
  Brian Salter-Duke (Brian Duke)   [EMAIL PROTECTED] 
  Honorary Researcher Fellow 
 Department of Medicinal Chemistry, Parkville Campus, 
Monash University, VIC 3052, Australia


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users


Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-26 Thread joseph . r . moran
Hi folks.  It works now!  Details follow.

My group's wiki is behind a corporate proxy so it's unreachable from your 
ends.  Thanks Nico for providing the new JmolExtension.php on 
wiki.jmol.org and for your LocalSettings.php excerpts.  No significant 
differences between our LocalSettings.php files.  Regarding the 
JmolExtension.php diffs, they were as follows:

-bash-3.00$ diff JmolExtension.php.old JmolExtension.php
611a612
> $wgParser->disableCache();
637a639
> $wgParser->disableCache();

...one disableCache() call in wfJmolRender() as discussed on Friday, and 
another in wfJmolDevRender() which is new but may or may not be relevant 
for nondevelopment use.  That said, I did have to save the wiki page one 
more time after updating JmolExtension.php before it would work, perhaps 
to remove some cache data within the wiki that disableCache() couldn't 
reach.  I'm really not sure, and it's possible if I had done this on 
Friday it would have worked then.  At any rate, live/normal page views do 
work consistently now.

Thanks Nico and everyone for your help!

--JRM





"Nicolas Vervelle" <[EMAIL PROTECTED]> 
24-Mar-2007 06:22
 
To
jmol-users@lists.sourceforge.net
cc
[EMAIL PROTECTED]
Subject
Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on 
live page






Hi Joseph,

Can you give an URL to your wiki so that I can check myself ?

I have uploaded the latest version of JmolExtension.php on the Jmol Wiki:
http://wiki.jmol.org:81/index.php/MediaWiki/JmolExtension.php

At the end of the mail, I have put a stripped version of my 
LocalSettings.php file.
You can compare it with your own (for example, do you use MemCached ?)

If I have new ideas before monday, I will try to implement them.
Have a nice weekend

Nico

[EMAIL PROTECTED] wrote: 

Regarding updating the argument list for onBeforePageDisplay() to be just 
&$out -- PHP was satisfied but otherwise no change. 

Regarding your tests -- sorry I didn't include mention of purge tests from 
my end.  But yes, our results matched: edit/preview ok, normal/live nok, 
purge ok. 

Now regarding your latest suggestion regarding disableCache() in 
wfJmolRender(), it's no dice on my end.  I tried it together with our 
earlier edits up to and including above, and then I tried inserting the 
$wgParser->disableCache(); statement into a stock JmolExtension.php -- the 
results were the same (live nok). 

That includes Firefox 2.0.0.3 and IE7 with empty local caches, and after 
using the purge mode to clear MediaWiki's cache.  Touching or otherwise 
updating MediaWiki's LocalSettings.php also forces MediaWiki to clear its 
cache, and I did so -- still nok on the live page.  I was beginning to 
think this was a cache issue within MediaWiki and we could work around it 
with suitable tweaks to LocalSettings.php, now I don't know. 

All the test pages on wiki.jmol.org do work for me -- I think before today 
only the uploaded XYZ example worked properly, now all three upload 
examples work, as does the "Inlined CML File" example. 

FYI, I'm heading home for the day and won't be able to revisit this until 
Monday.  Thanks for your attention and suggestions today, 

--JRM 

LocalSettings.php:
http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
## If using PHP as a CGI module, the ?title= style usually must be used.
$wgArticlePath  = "$wgScript/$1";
# $wgArticlePath  = "$wgScript?title=$1";

$wgStylePath= "$wgScriptPath/skins";
$wgStyleDirectory   = "$IP/skins";
#$wgLogo = "$wgStylePath/common/images/wiki.png";
$wgLogo = "$wgScriptPath/Jmol_smallLogo.gif";

$wgUploadPath   = "$wgScriptPath/images";
$wgUploadDirectory  = "$IP/images";

$wgEnableEmail  = true;
$wgEnableUserEmail  = true;

## For a detailed description of the following switches see
## http://meta.wikimedia.org/Enotif and http://meta.wikimedia.org/Eauthent
## There are many more options for fine tuning available see
## /includes/DefaultSettings.php
## UPO means: this is also a user preference option
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;

# Experimental charset support for MySQL 4.1/5.0.
$wgDBmysql5 = false;

## Shared memory settings
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads   = true;
$wgUseImageResize  = true;
# $wgUseImageMagick = true;
# $wgImageMagickConvertCommand = "/usr/bin/convert";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
$wgHashedUploadD

Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-24 Thread Nicolas Vervelle




Hi Joseph,

Can you give an URL to your wiki so that I can check myself ?

I have uploaded the latest version of JmolExtension.php on the Jmol
Wiki:
http://wiki.jmol.org:81/index.php/MediaWiki/JmolExtension.php

At the end of the mail, I have put a stripped version of my
LocalSettings.php file.
You can compare it with your own (for example, do you use MemCached ?)

If I have new ideas before monday, I will try to implement them.
Have a nice weekend

Nico

[EMAIL PROTECTED] wrote:

  Regarding updating the argument list for
onBeforePageDisplay() to be just &$out -- PHP was satisfied but
otherwise
no change.
  
  
  Regarding your tests -- sorry I didn't
include
mention of purge tests from my end.  But yes, our results matched:
edit/preview ok, normal/live nok, purge ok.
  
  
  Now regarding your latest suggestion
regarding
disableCache() in wfJmolRender(), it's no dice on my end.  I tried
it together with our earlier edits up to and including above, and then
I tried inserting the $wgParser->disableCache(); statement into a
stock
JmolExtension.php -- the results were the same (live nok).
  
  
  That includes Firefox 2.0.0.3 and IE7
with
empty local caches, and after using the purge mode to clear MediaWiki's
cache.  Touching or otherwise updating MediaWiki's LocalSettings.php
also forces MediaWiki to clear its cache, and I did so -- still nok on
the live page.  I was beginning to think this was a cache issue within
MediaWiki and we could work around it with suitable tweaks to
LocalSettings.php,
now I don't know.
  
  
  All the test pages on wiki.jmol.org do
work
for me -- I think before today only the uploaded XYZ example worked
properly,
now all three upload examples work, as does the "Inlined CML File"
example.
  
  
  FYI, I'm heading home for the day and
won't
be able to revisit this until Monday.  Thanks for your attention and
suggestions today,
  
  
  --JRM
  
  

LocalSettings.php:


# This file was automatically generated by the MediaWiki installer.
# If you make manual changes, please keep track in case you need to
# recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.

# If you customize your file layout, set $IP to the directory that
contains
# the other MediaWiki files. It will be used as a base to locate files.
if( defined( 'MW_INSTALL_PATH' ) ) {
    $IP = MW_INSTALL_PATH;
} else {
    $IP = dirname( __FILE__ );
}

$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR .
get_include_path() );

require_once( "includes/DefaultSettings.php" );

# If PHP's memory limit is very low, some operations may fail.
# ini_set( 'memory_limit', '20M' );

if ( $wgCommandLineMode ) {
    if ( isset( $_SERVER ) && array_key_exists(
'REQUEST_METHOD', $_SERVER ) ) {
        die( "This script must be run from the command line\n" );
    }
} elseif ( empty( $wgNoOutputBuffer ) ) {
    ## Compress output if the browser supports it
    if( !ini_get( 'zlib.output_compression' ) ) @ob_start(
'ob_gzhandler' );
}

$wgSitename = "Jmol";

$wgScriptPath   = "";
$wgScript   = "$wgScriptPath/index.php";
$wgRedirectScript   = "$wgScriptPath/redirect.php";

## For more information on customizing the URLs please see:
## http://meta.wikimedia.org/wiki/Eliminating_index.php_from_the_url
## If using PHP as a CGI module, the ?title= style usually must be used.
$wgArticlePath  = "$wgScript/$1";
# $wgArticlePath  = "$wgScript?title=$1";

$wgStylePath    = "$wgScriptPath/skins";
$wgStyleDirectory   = "$IP/skins";
#$wgLogo = "$wgStylePath/common/images/wiki.png";
$wgLogo = "$wgScriptPath/Jmol_smallLogo.gif";

$wgUploadPath   = "$wgScriptPath/images";
$wgUploadDirectory  = "$IP/images";

$wgEnableEmail  = true;
$wgEnableUserEmail  = true;

## For a detailed description of the following switches see
## http://meta.wikimedia.org/Enotif and
http://meta.wikimedia.org/Eauthent
## There are many more options for fine tuning available see
## /includes/DefaultSettings.php
## UPO means: this is also a user preference option
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = true; # UPO
$wgEmailAuthentication = true;

# Experimental charset support for MySQL 4.1/5.0.
$wgDBmysql5 = false;

## Shared memory settings
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = array();

## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads   = true;
$wgUseImageResize  = true;
# $wgUseImageMagick = true;
# $wgImageMagickConvertCommand = "/usr/bin/convert";

## If you want to use image uploads under safe mode,
## create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment
## this, if it's not already uncommented:
$wgHashedUploadDirectory = false;

## If you have the appropriate

Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-23 Thread joseph . r . moran
Regarding updating the argument list for onBeforePageDisplay() to be just 
&$out -- PHP was satisfied but otherwise no change.

Regarding your tests -- sorry I didn't include mention of purge tests from 
my end.  But yes, our results matched: edit/preview ok, normal/live nok, 
purge ok.

Now regarding your latest suggestion regarding disableCache() in 
wfJmolRender(), it's no dice on my end.  I tried it together with our 
earlier edits up to and including above, and then I tried inserting the 
$wgParser->disableCache(); statement into a stock JmolExtension.php -- the 
results were the same (live nok).

That includes Firefox 2.0.0.3 and IE7 with empty local caches, and after 
using the purge mode to clear MediaWiki's cache.  Touching or otherwise 
updating MediaWiki's LocalSettings.php also forces MediaWiki to clear its 
cache, and I did so -- still nok on the live page.  I was beginning to 
think this was a cache issue within MediaWiki and we could work around it 
with suitable tweaks to LocalSettings.php, now I don't know.

All the test pages on wiki.jmol.org do work for me -- I think before today 
only the uploaded XYZ example worked properly, now all three upload 
examples work, as does the "Inlined CML File" example.

FYI, I'm heading home for the day and won't be able to revisit this until 
Monday.  Thanks for your attention and suggestions today,

--JRM





"Nicolas Vervelle" <[EMAIL PROTECTED]> 
23-Mar-2007 19:06
 
To
jmol-users@lists.sourceforge.net
cc
[EMAIL PROTECTED], [EMAIL PROTECTED]
Subject
Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on 
live page






Bob Hanson wrote: 
Nicolas Vervelle wrote:

 
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).
 


Nico -- note that now with the automatic initialization, in the 
MediaWiki business you would not do the initialization at all, and that 
at least takes care of the problem that you might have 0 or multiple 
initializations.
 
Ok, that could help but I am also trying to include Jmol.js only once by 
putting the 

Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-23 Thread Bob Hanson
Nicolas Vervelle wrote:

> 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).


Nico -- note that now with the automatic initialization, in the 
MediaWiki business you would not do the initialization at all, and that 
at least takes care of the problem that you might have 0 or multiple 
initializations.

> 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
>> >  
>>
>>
>>
>>
>>
>>-
>>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
>>  
>>
>
>
>
>-
>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
>
>-

Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-23 Thread Nicolas Vervelle




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

Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-23 Thread joseph . r . moran
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&

Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-23 Thread Nicolas Vervelle




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
>   
  
  
  
  
  

-
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
  





-
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


Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-23 Thread joseph . r . moran
Hi Nico.  Changed line 576 as you suggested, but no joy -- the behavior is 
the same.

--JRM





"Nicolas Vervelle" <[EMAIL PROTECTED]> 
23-Mar-2007 15:33
 
To
jmol-users@lists.sourceforge.net
cc
[EMAIL PROTECTED]
Subject
Re: [Jmol-users] Jmol MediaWiki extension, works in preview but not on 
live page






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
> 



-
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


[Jmol-users] Jmol MediaWiki extension, works in preview but not on live page

2007-03-23 Thread joseph . r . moran
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