Commit 09ff6235 by Julian Arni

Updated version of JSME.

parent d186e5d1
......@@ -23,7 +23,7 @@
// to find the URL path in which the script lives. If the name
// of the file is changed, GWT won't load correctly
var jsmolcalc_src = '/sta' + 'tic/js/capa/jsmolcalc/jsmolcalc.nocache.js';
var jsme_src = '/sta' + 'tic/js/capa/jsme/jsme_export.nocache.js';
var jsme_src = '/sta' + 'tic/js/capa/jsme/jsme.nocache.js';
// Make sure we don't request the scripts twice
......@@ -43,16 +43,17 @@
// script loader. To fix this, wait for the scripts to load,
// initialize them manually and wait until they are ready
console.log("Waiting for gwt...");
if (typeof(jsmolcalc) != 'undefined' && jsmolcalc)
{
jsmolcalc.onInjectionDone('jsmolcalc');
}
if (typeof(jsme_export) != 'undefined' && jsme_export)
if (typeof(jsme) != 'undefined' && jsme)
{
// dummy function called by jsme_export
// dummy function called by jsme
window.jsmeOnLoad = function() {};
jsme_export.onInjectionDone('jsme_export');
jsme.onInjectionDone('jsme');
}
// jsmol is defined my jsmolcalc and JavaScriptApplet is defined by jsme
......@@ -67,6 +68,7 @@
function initializeApplets() {
var applets = $('.editamoleculeinput div.applet');
console.log(applets);
applets.each(function(i, element) {
if (!$(element).hasClass('loaded')) {
var applet = new JavaScriptApplet.JSME(
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
function jsme(){var P='',xb='" for "gwt:onLoadErrorFn"',vb='" for "gwt:onPropertyErrorFn"',ib='"><\/script>',Z='#',ec='.cache.html',_='/',lb='//',Tb='07F2F052178EB8ACC679F41AB589BB42',Ub='08DE1A45E2ED1FE31E10B481F379463B',Vb='22351D2E57E6D516BDAA63C8D92AF37E',Wb='2EB7CEFA089AFE9532D26E6ED5265D36',Xb='5C122AB17CD2018C049114A7F6B474A9',Yb='71C3CF16262A8C60182173C9451037E5',Zb='9347E46F84EA436EF22DCE900B9102C6',$b='9AFE4FAB17128C1405E8842B30CF63FB',dc=':',pb='::',nc='<script defer="defer">jsme.onInjectionDone(\'jsme\')<\/script>',hb='<script id="',sb='=',$='?',_b='A6FD788C50529ED45CB7C2AB2F64541F',ac='ABA5251AA57980BE29B5B1956A00CD62',Eb='BackCompat',ub='Bad handler "',bc='CF83F215ABEBF1D672DBF6BADC3B04A8',Db='CSS1Compat',mc='DOMContentLoaded',cc='F4FD0E34AFA9D7A91283D78040E0A050',jb='SCRIPT',gb='__gwt_marker_jsme',kb='base',cb='baseUrl',T='begin',S='bootstrap',bb='clear.cache.gif',Cb='compat.mode',rb='content',Y='end',Nb='gecko',Ob='gecko1_8',U='gwt.codesvr=',V='gwt.hosted=',W='gwt.hybrid',fc='gwt/chrome/chrome.css',lc='gwt/chrome/mosaic.css',wb='gwt:onLoadErrorFn',tb='gwt:onPropertyErrorFn',qb='gwt:property',kc='head',Rb='hosted.html?jsme',jc='href',Mb='ie6',Lb='ie8',Kb='ie9',yb='iframe',ab='img',zb="javascript:''",Q='jsme',eb='jsme.nocache.js',ob='jsme::',gc='link',Qb='loadExternalRefs',mb='meta',Bb='moduleRequested',X='moduleStartup',Jb='msie',nb='name',Gb='opera',Ab='position:absolute;width:0;height:0;border:none',hc='rel',Ib='safari',db='script',Sb='selectingPermutation',R='startup',ic='stylesheet',fb='undefined',Pb='unknown',Fb='user.agent',Hb='webkit';var m=window,n=document,o=m.__gwtStatsEvent?function(a){return m.__gwtStatsEvent(a)}:null,p=m.__gwtStatsSessionId?m.__gwtStatsSessionId:null,q,r,s,t=P,u={},v=[],w=[],x=[],y=0,z,A;o&&o({moduleName:Q,sessionId:p,subSystem:R,evtGroup:S,millis:(new Date).getTime(),type:T});if(!m.__gwt_stylesLoaded){m.__gwt_stylesLoaded={}}if(!m.__gwt_scriptsLoaded){m.__gwt_scriptsLoaded={}}function B(){var b=false;try{var c=m.location.search;return (c.indexOf(U)!=-1||(c.indexOf(V)!=-1||m.external&&m.external.gwtOnLoad))&&c.indexOf(W)==-1}catch(a){}B=function(){return b};return b}
function C(){if(q&&r){var b=n.getElementById(Q);var c=b.contentWindow;if(B()){c.__gwt_getProperty=function(a){return H(a)}}jsme=null;c.gwtOnLoad(z,Q,t,y);o&&o({moduleName:Q,sessionId:p,subSystem:R,evtGroup:X,millis:(new Date).getTime(),type:Y})}}
function D(){function e(a){var b=a.lastIndexOf(Z);if(b==-1){b=a.length}var c=a.indexOf($);if(c==-1){c=a.length}var d=a.lastIndexOf(_,Math.min(c,b));return d>=0?a.substring(0,d+1):P}
function f(a){if(a.match(/^\w+:\/\//)){}else{var b=n.createElement(ab);b.src=a+bb;a=e(b.src)}return a}
function g(){var a=F(cb);if(a!=null){return a}return P}
function h(){var a=n.getElementsByTagName(db);for(var b=0;b<a.length;++b){if(a[b].src.indexOf(eb)!=-1){return e(a[b].src)}}return P}
function i(){var a;if(typeof isBodyLoaded==fb||!isBodyLoaded()){var b=gb;var c;n.write(hb+b+ib);c=n.getElementById(b);a=c&&c.previousSibling;while(a&&a.tagName!=jb){a=a.previousSibling}if(c){c.parentNode.removeChild(c)}if(a&&a.src){return e(a.src)}}return P}
function j(){var a=n.getElementsByTagName(kb);if(a.length>0){return a[a.length-1].href}return P}
function k(){var a=n.location;return a.href==a.protocol+lb+a.host+a.pathname+a.search+a.hash}
var l=g();if(l==P){l=h()}if(l==P){l=i()}if(l==P){l=j()}if(l==P&&k()){l=e(n.location.href)}l=f(l);t=l;return l}
function E(){var b=document.getElementsByTagName(mb);for(var c=0,d=b.length;c<d;++c){var e=b[c],f=e.getAttribute(nb),g;if(f){f=f.replace(ob,P);if(f.indexOf(pb)>=0){continue}if(f==qb){g=e.getAttribute(rb);if(g){var h,i=g.indexOf(sb);if(i>=0){f=g.substring(0,i);h=g.substring(i+1)}else{f=g;h=P}u[f]=h}}else if(f==tb){g=e.getAttribute(rb);if(g){try{A=eval(g)}catch(a){alert(ub+g+vb)}}}else if(f==wb){g=e.getAttribute(rb);if(g){try{z=eval(g)}catch(a){alert(ub+g+xb)}}}}}}
function F(a){var b=u[a];return b==null?null:b}
function G(a,b){var c=x;for(var d=0,e=a.length-1;d<e;++d){c=c[a[d]]||(c[a[d]]=[])}c[a[e]]=b}
function H(a){var b=w[a](),c=v[a];if(b in c){return b}var d=[];for(var e in c){d[c[e]]=e}if(A){A(a,d,b)}throw null}
var I;function J(){if(!I){I=true;var a=n.createElement(yb);a.src=zb;a.id=Q;a.style.cssText=Ab;a.tabIndex=-1;n.body.appendChild(a);o&&o({moduleName:Q,sessionId:p,subSystem:R,evtGroup:X,millis:(new Date).getTime(),type:Bb});a.contentWindow.location.replace(t+L)}}
w[Cb]=function(){return document.compatMode==Db?Db:Eb};v[Cb]={BackCompat:0,CSS1Compat:1};w[Fb]=function(){var b=navigator.userAgent.toLowerCase();var c=function(a){return parseInt(a[1])*1000+parseInt(a[2])};if(function(){return b.indexOf(Gb)!=-1}())return Gb;if(function(){return b.indexOf(Hb)!=-1}())return Ib;if(function(){return b.indexOf(Jb)!=-1&&n.documentMode>=9}())return Kb;if(function(){return b.indexOf(Jb)!=-1&&n.documentMode>=8}())return Lb;if(function(){var a=/msie ([0-9]+)\.([0-9]+)/.exec(b);if(a&&a.length==3)return c(a)>=6000}())return Mb;if(function(){return b.indexOf(Nb)!=-1}())return Ob;return Pb};v[Fb]={gecko1_8:0,ie6:1,ie8:2,ie9:3,opera:4,safari:5};jsme.onScriptLoad=function(){if(I){r=true;C()}};jsme.onInjectionDone=function(){q=true;o&&o({moduleName:Q,sessionId:p,subSystem:R,evtGroup:Qb,millis:(new Date).getTime(),type:Y});C()};E();D();var K;var L;if(B()){if(m.external&&(m.external.initModule&&m.external.initModule(Q))){m.location.reload();return}L=Rb;K=P}o&&o({moduleName:Q,sessionId:p,subSystem:R,evtGroup:S,millis:(new Date).getTime(),type:Sb});if(!B()){try{G([Db,Gb],Tb);G([Eb,Lb],Ub);G([Eb,Kb],Vb);G([Db,Ib],Wb);G([Db,Mb],Xb);G([Eb,Ob],Yb);G([Eb,Gb],Zb);G([Db,Lb],$b);G([Db,Kb],_b);G([Db,Ob],ac);G([Eb,Mb],bc);G([Eb,Ib],cc);K=x[H(Cb)][H(Fb)];var M=K.indexOf(dc);if(M!=-1){y=Number(K.substring(M+1));K=K.substring(0,M)}L=K+ec}catch(a){return}}var N;function O(){if(!s){s=true;if(!__gwt_stylesLoaded[fc]){var a=n.createElement(gc);__gwt_stylesLoaded[fc]=a;a.setAttribute(hc,ic);a.setAttribute(jc,t+fc);n.getElementsByTagName(kc)[0].appendChild(a)}if(!__gwt_stylesLoaded[lc]){var a=n.createElement(gc);__gwt_stylesLoaded[lc]=a;a.setAttribute(hc,ic);a.setAttribute(jc,t+lc);n.getElementsByTagName(kc)[0].appendChild(a)}C();if(n.removeEventListener){n.removeEventListener(mc,O,false)}if(N){clearInterval(N)}}}
if(n.addEventListener){n.addEventListener(mc,function(){J();O()},false)}var N=setInterval(function(){if(/loaded|complete/.test(n.readyState)){J();O()}},50);o&&o({moduleName:Q,sessionId:p,subSystem:R,evtGroup:S,millis:(new Date).getTime(),type:Y});o&&o({moduleName:Q,sessionId:p,subSystem:R,evtGroup:Qb,millis:(new Date).getTime(),type:T});n.write(nc)}
jsme();
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment