Ticket #5447: trac_5447-jquery_upgrade_v2.patch

File trac_5447-jquery_upgrade_v2.patch, 8.2 KB (added by mpatel, 11 years ago)

For p1 spkgs. Depends on #6568, #6840.

  • sage/server/notebook/interact.py

    # HG changeset patch
    # User Mitesh Patel <qed777@gmail.com>
    # Date 1251790978 25200
    # Node ID 9f524746925d19b7be7f542315e3530d5d0f4668
    # Parent  522100b8fa7d15f2f4de1d807d68571a2c9e8c10
    #5447, jQuery and jQuery UI upgrade
    
    diff --git a/sage/server/notebook/interact.py b/sage/server/notebook/interact.py
    a b def html_slider(id, values, callback, st 
    253253        <html>...</html>
    254254    """
    255255    s = """<table><tr><td>
    256         <div id='%s' class='ui-slider ui-slider-3' style='margin:%spx;'><span class='ui-slider-handle'></span></div>
     256        <div id='%s' style='margin:%spx; margin-left: 1.0em; margin-right: 1.0em; width: 15.0em;'></div>
    257257        </td>"""%(id,int(margin))
    258258    if values != "null":
    259259        s += "<td><font color='black' id='%s-lbl'></font></td>"%id
    def html_slider(id, values, callback, st 
    264264    # below which gets passed an anonymous function.
    265265    s += """<script>(function(){ var values = %(values)s; setTimeout(function() {
    266266    $('#%(id)s').slider({
    267         stepping: 1, min: 0, max: %(maxvalue)s, startValue: %(startvalue)s,
     267        step: 1, min: 0, max: %(maxvalue)s, value: %(startvalue)s,
    268268        change: function (e,ui) { var position = ui.value; if(values!=null) $('#%(id)s-lbl').text(values[position]); %(callback)s; },
    269269        slide: function(e,ui) { if(values!=null) $('#%(id)s-lbl').text(values[ui.value]); }
    270270    });
    def html_rangeslider(id, values, callbac 
    316316        sage: html(html_rangeslider('slider-007', 'null', 'alert(pos[0]+", "+pos[1])', steps=5, default_l=2, default_r=3, margin=5))
    317317        <html>...</html>
    318318    """
    319     s = """<table>
    320     <tr><td><div id='%s' class='ui-slider ui-slider-3' style='margin:%spx;'>
    321     <span class='ui-slider-handle'></span><span class='ui-slider-handle'></span>
    322     </div></td></tr>"""%(id,int(margin))
     319    s = """<table><tr><td>
     320        <div id='%s' style='margin:%spx; margin-left: 1.0em; margin-right: 1.0em; width: 20.0em;'></div>
     321        </td></tr>"""%(id,int(margin))
    323322    if values != "null":
    324323        s += "<tr><td><font color='black' id='%s-lbl'></font></td></tr>"%id
    325324    s += "</table>"
    def html_rangeslider(id, values, callbac 
    334333        var sel = '#%s';
    335334        var updatePos = function()
    336335        {
    337             pos[0]=$(sel).slider('value', 0);
    338             pos[1]=$(sel).slider('value', 1);
     336            pos[0]=$(sel).slider('values', 0);
     337            pos[1]=$(sel).slider('values', 1);
    339338            if(values!=null) $(sel+'-lbl').text("("+values[pos[0]]+", "+values[pos[1]]+")");
    340339        };
    341340        setTimeout(function()
    def html_rangeslider(id, values, callbac 
    343342            $(sel).slider(
    344343            {
    345344                range: true,
    346                 stepping: 1,                   
     345                step: 1,
    347346                min: 0,
    348347                max: %s,
    349                 handles: [{start: %s},{start:%s}],
     348                values: [%s, %s],
    350349                change: function(e,ui){ updatePos(); %s; },
    351350                slide: updatePos
    352351            });
  • sage/server/notebook/templates/notebook/head.tmpl

    diff --git a/sage/server/notebook/templates/notebook/head.tmpl b/sage/server/notebook/templates/notebook/head.tmpl
    a b INPUT: 
    1818{% endmacro %}
    1919
    2020{% macro common_css %}
     21<!-- Sage notebook stylesheet -->
    2122<link rel=stylesheet href="/css/main.css" type="text/css" />
    2223{% endmacro %}
    2324
    2425{% macro common_javascript(worksheet, worksheet_filename, username, JSMATH, JSMATH_IMAGE_FONTS, JEDITABLE_TINYMCE, sage_jsmath_macros) %}
    25 <!-- Load the Sage javascript library. -->
    26 <script type="text/javascript" src="/javascript_local/jquery/jquery.js"></script>
     26<!-- jQuery - general-purpose functions -->
     27<script type="text/javascript" src="/javascript_local/jquery/jquery-1.3.2.min.js"></script>
     28<!-- Sage notebook library -->
    2729<script type="text/javascript" src="/javascript/main.js"></script>
    2830 
    2931{% if JSMATH %}
    INPUT: 
    7072<script> {{ m }} </script>
    7173{% endfor %}
    7274
    73 <!-- Load the jquery and ui-jquery javascript library.
    74      This is used for interact functionality in the notebook, and will be used
    75      to enable drag and drop, image zoom, etc. -->
    76 <script type="text/javascript" src="/javascript_local/jqueryui/jquery.ui.all.min.js"></script>
    77 <script type="text/javascript" src="/javascript_local/jquery/plugins/farbtastic/farbtastic.min.js"></script>
    78 <script type="text/javascript" src="/javascript_local/jquery/plugins/dimensions/jquery.dimensions.min.js"></script>
     75<!-- jQuery UI - interacts, widgets, drag-drop, etc. -->
     76<link rel="stylesheet" href="/javascript_local/jqueryui/themes/sage/jquery-ui-1.7.2.custom.css" />
     77<script type="text/javascript" src="/javascript_local/jqueryui/jquery-ui-1.7.2.custom.min.js"></script>
     78
     79<!-- jQuery plugins - color picker, shift-click -->
     80<link rel="stylesheet" href="/javascript_local/jquery/plugins/farbtastic/farbtastic.css" type="text/css" />
     81<script type="text/javascript" src="/javascript_local/jquery/plugins/farbtastic/farbtastic.js"></script>
    7982<script type="text/javascript" src="/javascript_local/jquery/plugins/jquery.event.extendedclick.js"></script>
    8083
    81 <link rel="stylesheet" href="/javascript_local/jquery/plugins/farbtastic/farbtastic.css" type="text/css" /> 
    82 <link rel="stylesheet" href="/javascript_local/jqueryui/themes/flora/flora.all.css" />
    83 
    84 <!-- TODO: get the lazy loading plugin -->
    85 
    86 <!-- TODO: Load individual ui plugins, not the whole package:
    87      <script type="text/javascript" src="/javascript_local/jqueryui/ui.mouse.min.js"></script>
    88      <script type="text/javascript" src="/javascript_local/jqueryui/ui.slider.min.js"></script>
    89      <script type="text/javascript" src="/javascript_local/jqueryui/ui.draggable.min.js"></script>
    90      <script type="text/javascript" src="/javascript_local/jqueryui/ui.draggable.ext.min.js"></script>
    91      <script type="text/javascript" src="/javascript_local/jqueryui/ui.resizable.min.js"></script>
    92      <script type="text/javascript" src="/javascript_local/jqueryui/ui.dialog.min.js"></script>
    93 -->
    94 
    95 <!-- This was for syntax highlighting
    96      <script type="text/javascript" src="/javascript/highlight/prettify.js"></script>
    97      <link rel=stylesheet href="/css/highlight/prettify.css" type="text/css" />
    98 -->
    99 
    10084<script type="text/javascript" src="/javascript/sage3d.js"></script
    101 
    10285<!-- Jmol - embedded 3D graphics -->
    10386<script type="text/javascript" src="/java/jmol/appletweb/Jmol.js"></script>
    104 <script>jmolInitialize("/java/jmol");jmolSetCallback("menuFile","/java/jmol/appletweb/SageMenu.mnu");</script> <!-- This must stay in <head> -->
     87<!-- This must stay in <head>: -->
     88<script>jmolInitialize("/java/jmol");jmolSetCallback("menuFile","/java/jmol/appletweb/SageMenu.mnu");</script>
    10589
    10690<!-- TinyMCE and jEditable - in-place editing of text cells -->
    10791{% if JEDITABLE_TINYMCE %}
    10892    <script type="text/javascript" src="/javascript_local/tiny_mce/tiny_mce.js"></script>
    109     <script src="/javascript_local/jquery/plugins/jquery.jeditable.mini.js" type="text/javascript" charset="utf-8"></script>
     93    <script src="/javascript_local/jquery/plugins/jeditable/jquery.jeditable.mini.js" type="text/javascript" charset="utf-8"></script>
    11094    <script type="text/javascript">
    11195   
    11296    function toggleEditor(id) {
    INPUT: 
    195179     if W and
    196180        W.name() == "Untitled":
    197181        <script  type="text/javascript">setTimeout("rename_worksheet()",1)</script> -->
    198 {% endmacro %}
    199  No newline at end of file
     182{% endmacro %}
  • sage/server/notebook/templates/worksheet_listing.html

    diff --git a/sage/server/notebook/templates/worksheet_listing.html b/sage/server/notebook/templates/worksheet_listing.html
    a b  
    2424    <script type="text/javascript">
    2525    var worksheet_filenames = {{ worksheet_filenames }};
    2626    </script>
    27     <script type="text/javascript" src="/javascript_local/jquery/jquery.js"></script>
     27    <script type="text/javascript" src="/javascript_local/jquery/jquery-1.3.2.min.js"></script>
    2828    <script type="text/javascript" src="/javascript/gears/gears_init.js"></script>
    2929    <script type="text/javascript" src="/javascript/gears/shortcut.js"></script>
    3030  {% endif %}