Bob,
In JSmolCore I find the code at the end of this note.
I made the following change:
Jmol.$appEvent(me, "appletdiv", "drop", function(e) {
var ev = e.originalEvent;
ev.stopPropagation();
ev.preventDefault();
This did not fix the problem. Again, I'm trying to double check cache
issues when I test this.
I should note that *after* the above did not work, I tried modifying the
first function also:
var ev = e.originalEvent;
ev.stopPropagation();
ev.preventDefault();
ev.dataTransfer.dropEffect = 'copy';
No luck. Am I missing something in your suggestion?
Otis
Original code:
Jmol.Cache.setDragDrop = function(me) {
Jmol.$appEvent(me, "appletdiv", "dragover", function(e) {
e = e.originalEvent;
e.stopPropagation();
e.preventDefault();
e.dataTransfer.dropEffect = 'copy';
});
Jmol.$appEvent(me, "appletdiv", "drop", function(e) {
var e = e.originalEvent;
e.stopPropagation();
e.preventDefault();
var file = ev.dataTransfer.files[0];
if (file == null) {
// FF and Chrome will drop an image here
// but it will be only a URL, not an actual file.
try {
file = "" + ev.dataTransfer.getData("text");
if (file.indexOf("file:/") == 0 || file.indexOf("http:/") == 0) {
me._script("load \"" + file + "\"");
return;
}
} catch(e) {
return;
}
// some other format
return;
}
On Thu, Jul 3, 2014 at 1:34 AM, Robert Hanson <[email protected]> wrote:
> Yes, HTML5 applet only. If you want to fix it, look for something like
> this in JSmol.min.js or JSmolCore.js:
>
> Jmol.$appEvent(me, "appletdiv", "drop", function(e) {
> var e = e.originalEvent;
> e.stopPropagation();
> e.preventDefault();
>
>
> That should read:
>
> Jmol.$appEvent(me, "appletdiv", "drop", function(e) {
> var ev = e.originalEvent;
> ev.stopPropagation();
> ev.preventDefault();
>
>
>
> On Wed, Jul 2, 2014 at 11:39 AM, Otis Rothenberger <[email protected]>
> wrote:
>
>> Bob,
>>
>> I don't think this one is a cache issue:
>>
>> On the latest version of JSmol, I can no longer drag/drop/load a model
>> from a molfile.
>>
>> Otis
>>
>> --
>> Otis Rothenberger
>> [email protected]
>>
>>
>> ------------------------------------------------------------------------------
>> Open source business process management suite built on Java and Eclipse
>> Turn processes into business applications with Bonita BPM Community
>> Edition
>> Quickly connect people, data, and systems into organized workflows
>> Winner of BOSSIE, CODIE, OW2 and Gartner awards
>> http://p.sf.net/sfu/Bonitasoft
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> Chair, Department of Chemistry
> 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
>
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
Otis Rothenberger
[email protected]
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users