|
From: Robert H. <ha...@st...> - 2025-11-07 17:32:02
|
Thanks for that reminder. Every once in a while I have considered that and
worried that my hacks in that code won't be reproducible. But you are
right. We should do that. Can you help me with that? Take a local jsmol
unzipped directory and do the replacement, and see if the various JSME test
pages still work. The one I am thinking of is the page jsv_jme.htm with the
"enable editing" and blue selection dot.
[image: image.png]
If that works, or there is a way to make that functionality work, I'm all
for it.
But now I see that in build-1-just-unzip-to-site I have what was probably
that commented out:
<!--
<echo>......adding jsme event hooks</echo>
<replace dir="${site.jsmol.path}/jsme/jsme" includes="*.html"
token="var c=arguments,d;" value="var
c=arguments,d;if(!(d=(!c||!c[0]||!$wnd.Jmol?a:$wnd.Jmol._jmeHook(a,
c[0]))))return;"/>
-->
and I have commented all this out in JSmolJME.js:
// Jmol._jmeHook = function(a, e) {
// alert("hooked")
// // called from within function C(a) in JSME code
// // a is the function to send this event to using apply
// var d;
// return (!(d = e.target) || !(d._applet || (d = Jmol.$closest(d,
'div')[0])) || !d || !d._applet ? a : d._applet.__allowEvent(a, e));
// }
// proto.__allowEvent = function(a, e){
// alert("allowing event")
// var t;
// if(!e || !(t = e.target) || "DIV rect line text polygon ellipse
path".indexOf("" + t.tagName) < 0){
// // cancel only these specific tags
// return a;
// }
//
// var isKey = (e.type.indexOf("key") >= 0);
// if (!this._editEnabled && isKey) {
/// // cancel all keyboard events
// return 0;
// }
// if ("dblclick mousedown mouseup".indexOf(e.type) < 0) {
// // cancel only these specific events
// return a;
// }
// var x = 200;
// var y = 200;
// try {
// x = parseInt(t.getAttribute("x"));//(t.textContent ?
t.x.baseVal[0].value : t.points ? t.animatedPoints[0].x : isKey || !t.x &&
!t.x1 ? 200 : (t.x || t.x1).baseVal.value);
// y = parseInt(t.getAttribute("y"));//(t.textContent ?
t.y.baseVal[0].value : t.points ? t.animatedPoints[0].y : isKey || !t.x &&
!t.x1 ? 200 : (t.y || t.y1).baseVal.value);
// } catch(e) {
// }
// // when editing is disabled, only the star key and main-panel clicking
will be allowed
// var isStar = (x >= 100 && x < 124 && y < 24); // fifth icon from the
left on top row
// var isMain = (x > 25 && y > 50 || x == 0 && y == 0 &&
t.width.baseVal.value > 100 && t.height.baseVal.value > 100);
// if (isStar || this._editEnabled && !isMain)
// this._starPressed = isStar;
// var ok = (isStar || this._editEnabled || isMain && this._starPressed);
// return (ok ? a : 0);
// }
I am thinking that what I am remembering is some very early efforts to hack
that code, and I already have updated JME code in there that does this
correctly.
So it will probably work just fine when you try that.
Bob
On Fri, Nov 7, 2025 at 7:03 AM Angel Herráez <ang...@ua...> wrote:
> Bob, maybe you can now find time to update the version of JSME included in
> the distribution? (10 years old)
>
> In my pages I have been replacing it with newer versions without any
> troubles.
>
> ·
>
> El 05/11/2025 a las 18:13, Robert Hanson via Jmol-users escribió:
>
> Quite a variety of mostly specialized bugs here. A few changes for
> JSpecView in association with the IUPAC FAIRSpec project metadata extractor
> implementation.
>
> Thank you to all who have contributed bug reports. GO, OPEN SOURCE!
>
> Bob
>
> Jmol.___JmolVersion="16.3.35" // (legacy) also 16.3.36 (swingJS)
>
> bug fix (legacy only): JME interface not accepting MOL files with a blank
> first line
>
> _______________________________________________
> Jmol-users mailing list
> Jmo...@li...
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Professor of Chemistry, Emeritus
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
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
*We stand on the homelands of the Wahpekute Band of the Dakota Nation. We
honor with gratitude the people who have stewarded the land throughout the
generations and their ongoing contributions to this region. We acknowledge
the ongoing injustices that we have committed against the Dakota Nation,
and we wish to interrupt this legacy, beginning with acts of healing and
honest storytelling about this place.*
|