Ticket #9238: trac_9238_memory_IE.patch

File trac_9238_memory_IE.patch, 3.6 KB (added by gutow, 10 years ago)

reduce Jmol memory usage try to make advanced toggle work in IE

  • sagenb/data/sage/js/jmol_lib.js

    # HG changeset patch
    # User Jonathan H. Gutow <gutow@uwosh.edu
    # Date 1301372727 18000
    # Node ID b99b8a67742b1ec0139e1166005730eb25da4911
    # Parent  dc9aae4faac7a86d66058bb2f557d9e433b2614f
    trac 9238: lower jmol memory usage IE fix.
    
    diff -r dc9aae4faac7 -r b99b8a67742b sagenb/data/sage/js/jmol_lib.js
    a b  
    9494            jmolStatus.browser="chrome";
    9595        }
    9696    }
     97    if (_jmol.os =="win"){
     98        if (_jmol.browser=="msie"){
     99            alert("You are using Internet Explorer.  No advance 3-D viewing functions work.  FireFox or Chrome browswers are recommended.");
     100        }
    97101    }
     102}
    98103
    99104function jmol_pulldown(theform) {
    100105    /*
     
    274279    //str += '<div id="JmolDebug">Jmol Debugging goes here</div>';
    275280    //now we can start the new one
    276281    cell_writer.write(str);
    277     var scriptStr = 'script "'+url+'"; isosurface fullylit; pmesh o* fullylit; set antialiasdisplay on;';
     282    var scriptStr = 'script "'+url+'"; isosurface fullylit; pmesh o* fullylit; set antialiasdisplay off;';
    278283    scriptStr +='x=defaultdirectory; data "directory @x";';
    279284    scriptStr += 'set MessageCallback "jmolMessageHandler"; show defaultdirectory;';
    280285    jmolSetAppletColor("white");
     
    329334        if(queued>=0){//we found a queued applet and can start its launch.
    330335            //alert("About to launch applet #"+queued);
    331336            var scriptStr = 'script "'+jmolStatus.urls[queued]+'"; isosurface fullylit; pmesh o* fullylit;';
    332             scriptStr +='set antialiasdisplay on;x=defaultdirectory; data "directory @x";';
     337            scriptStr +='set antialiasdisplay off; set repaintWaitMs 1500;';
     338            scriptStr +='x=defaultdirectory; data "directory @x";';
    333339            scriptStr += 'set MessageCallback "jmolMessageHandler"; show defaultdirectory;';
    334340            //alert("About to look for the div to put it in");
    335341            if (get_element("Jmol"+ queued) ){//the div is ready
     
    356362    tableId = 'Jmol_Table_'+Id;
    357363    tableStr = '<table id="'+tableId+'" border="1"><tr><td id="'+tableId+'_cell_0_0">';
    358364        if (controlStr!='') {
    359             tableStr+='<div id=\'Adv_but_'+Id+'\'><button onClick="$(\'#'+tableId+'_cell_0_1\').toggle();">Toggle Advanced Controls</button></div>';
     365            tableStr+='<div id=\'Adv_but_'+Id+'\'><button onClick="javascript:void($(\'#'+tableId+'_cell_0_1\').toggle())">Toggle Advanced Controls</button></div>';
    360366            }   
    361367    tableStr +='<div id = '+Id+'>';
    362368    tableStr += 'Loading Jmol 3-D viewer...</div>'; 
     
    802808        height = jmolStatus.heights[n];
    803809        url = jmolStatus.urls[n];
    804810        jmolSetDocument(false);
    805 //      scriptStr = 'script "'+url+'"; isosurface fullylit; pmesh o* fullylit; set antialiasdisplay on;';
     811//      scriptStr = 'script "'+url+'"; isosurface fullylit; pmesh o* fullylit; set antialiasdisplay off;';
    806812        re_linebreak = /<br>/gi;
    807813//        scriptStr = get_element("jmolStateDiv"+n).innerHTML.replace(re_linebreak,'\n');
    808814        var scriptStr = jmolStatus.stateScripts[n];
     
    893899    win.document.title = "Sage 3d Viewer";
    894900    win.document.writeln("<h1 align=center>Sage 3d Viewer</h1>");
    895901    jmolSetDocument(win.document);
    896 //    scriptStr = 'script "'+url+'"; isosurface fullylit; pmesh o* fullylit; set antialiasdisplay on;';
     902//    scriptStr = 'script "'+url+'"; isosurface fullylit; pmesh o* fullylit; set antialiasdisplay off;';
    897903    re_linebreak = /<br>/gi;
    898904    var scriptStr = get_element("jmolStateDiv"+n).innerHTML;
    899905    scriptStr = scriptStr.replace(re_linebreak,'\n');