Ticket #16004: 0001-Add-option-to-use-java-for-3D.patch

File 0001-Add-option-to-use-java-for-3D.patch, 3.0 KB (added by gutow, 7 years ago)

patch to allow user to choose Java instead of javascript for 3-D viewing

  • sagenb/data/sage/html/notebook/base.html

    From cdf455664ca64e6d3a6fe8b18e3e691ede7d8723 Mon Sep 17 00:00:00 2001
    Message-Id: <cdf455664ca64e6d3a6fe8b18e3e691ede7d8723.1413422335.git.gutow@uwosh.edu>
    From: gutow <gutow@uwosh.edu>
    Date: Wed, 15 Oct 2014 20:09:36 -0500
    Subject: [PATCH] Add option to use java for 3D
    
    Add a checkbox allowing the user to choose to use the java applet for
    3-.  Also added some gettext calls for translation.
    ---
     sagenb/data/sage/html/notebook/base.html | 22 ++++++++--------------
     sagenb/data/sage/js/jmol_lib.js          |  2 ++
     2 files changed, 10 insertions(+), 14 deletions(-)
    
    diff --git a/sagenb/data/sage/html/notebook/base.html b/sagenb/data/sage/html/notebook/base.html
    index 21681ff..4333acf 100644
    a b INPUT: 
    138138            </option>
    139139            {% endfor %}
    140140        </select>   
    141         <input type="checkbox"
    142                title="{{ gettext('Enable/disable pretty_printing') }}"
     141        <input type="checkbox" title="{{ gettext('Enable/disable pretty_printing') }}"
    143142               onchange="pretty_print_check(this.checked);"
    144                class="worksheet"
    145                value="pretty_print"
    146                {{ "checked" if worksheet.pretty_print() else "" }}
    147                />&nbsp;Typeset
    148         <input id="3D_check",
    149                type="checkbox"
     143               class="worksheet" value="pretty_print" {{ "checked" if worksheet.pretty_print() else "" }} />&nbsp;{{ gettext('Typeset') }}
     144        <input id="3D_check", type="checkbox" title="{{ gettext('Load 3-D Live. Not recommended for worksheets with > 2 3-D Plots.') }}"
    150145               onchange="live_3D_check(this.checked);"
    151                title="{{ gettext('Load 3-D Live. Not recommended for worksheets with > 2 3-D Plots.') }}"
    152                class="worksheet"
    153                value="live_3D"
    154                {{ "checked" if worksheet.live_3D() else "" }}
    155                />&nbsp;{{ gettext('Load 3-D Live') }}
    156         {% endif %}
     146               class="worksheet" value="live_3D" {{ "checked" if worksheet.live_3D() else "" }} /> {{ gettext('Load 3-D Live') }}
     147        <input id="3D_use_java", type="checkbox" title="{{ gettext('Use java for 3-D. Only applies to this running of worksheet.') }}"
     148               onchange="3D_use_java_check(this.checked);"
     149               class="worksheet" value="3D_use_java"/> {{ gettext('Use java for 3-D') }}
     150         {% endif %}
    157151    {% endif %}
    158152    </div>
    159153    <div id="share-publish-buttons">
  • sagenb/data/sage/js/jmol_lib.js

    diff --git a/sagenb/data/sage/js/jmol_lib.js b/sagenb/data/sage/js/jmol_lib.js
    index e5f62e2..34c913d 100644
    a b SageJmolManager.prototype.add_applet = 
    105105    var live_3d = jQuery('#3D_check').prop('checked');
    106106    info.deferUncover = !live_3d;
    107107    info.deferApplet = !live_3d;
     108    var use_java=$('#3D_use_java').prop('checked');
     109    if (use_java) {info.use='JAVA';}
    108110
    109111    // append container to dom
    110112    jQuery('#sage_jmol_' + cell_num).append(