[sagenb] 03/14: Tidy up a few more loose ends

Ximin Luo infinity0 at debian.org
Fri Dec 2 22:52:47 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagenb.

commit bf0d88142cf47a07b66f93df79ae4b61be72b55f
Author: Ximin Luo <infinity0 at pwned.gg>
Date:   Fri Dec 2 19:48:53 2016 +0100

    Tidy up a few more loose ends
---
 debian/copyright                      |   5 +-
 debian/patches/disable-bgiframe.patch | 296 ++++++++++++++++++++++++++++++++++
 debian/patches/series                 |   1 +
 debian/patches/use-system-jquery.js   |  20 +++
 4 files changed, 321 insertions(+), 1 deletion(-)

diff --git a/debian/copyright b/debian/copyright
index 5622490..259e0a5 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -11,12 +11,15 @@ Files-Excluded:
  sagenb/data/jquery/plugins/jquery.bgiframe.min.js
  sagenb/data/jqueryui/*
  sagenb/data/json/*
+ sagenb/data/openid-realselector/demo.html
  sagenb/data/tiny_mce/*
  sagenb/data/sage/css/main.css
  sagenb/data/sage/css/test_report.css
  sagenb/data/sage3d/lib/sage3d.jar
 Comment:
- bgiframe is a IE6-specific work-around, and upstream omits its source anyway
+ - bgiframe is a IE6-specific work-around, and upstream omits its source anyway
+ - openid-realselector/demo.html loads a remote jQuery, just rm it, it's unused
+ - everything else is supplied by Debian system packages
 
 Files: *
 Copyright: 2009-2016 SageNB contributors <sage-notebook at googlegroups.com>
diff --git a/debian/patches/disable-bgiframe.patch b/debian/patches/disable-bgiframe.patch
new file mode 100644
index 0000000..53fa03f
--- /dev/null
+++ b/debian/patches/disable-bgiframe.patch
@@ -0,0 +1,296 @@
+--- a/sagenb/data/sage/html/notebook/base.html
++++ b/sagenb/data/sage/html/notebook/base.html
+@@ -25,7 +25,6 @@
+ <script type="text/javascript" src="/javascript/jquery/plugins/farbtastic/farbtastic.min.js"></script>
+ <script type="text/javascript" src="/javascript/jquery/plugins/extendedclick/jquery.event.extendedclick.min.js"></script>
+ <script type="text/javascript" src="/javascript/jquery/plugins/form/jquery.form.min.js"></script>
+-<script type="text/javascript" src="/javascript/jquery/plugins/jquery.bgiframe.min.js"></script>
+ <link rel="stylesheet" href="/javascript/jquery/plugins/jpicker/css/jPicker-1.1.6.min.css" type="text/css" />
+ <script type="text/javascript" src="/javascript/jquery/plugins/jpicker/jpicker-1.1.6.min.js"></script>
+ <link rel="stylesheet" media="screen" type="text/css" href="/javascript/jquery/plugins/colorpicker/css/colorpicker.css" />
+@@ -110,7 +109,7 @@
+             <option title="{{ gettext('Select a worksheet function') }}" value="" selected>{{ gettext('Action...') }}</option>
+             <option title="{{ gettext('Interrupt currently running calculations, if possible') }}" value="interrupt();">{{ gettext('Interrupt') }}</option>
+             <option title="{{ gettext('Restart the worksheet process') }}" value="restart_sage();">{{ gettext('Restart worksheet') }}</option>
+-            <option title="{{ gettext('Quit the worksheet process') }}" value="save_worksheet_and_close();">{{ gettext('Save and quit worksheet') }}</option> 
++            <option title="{{ gettext('Quit the worksheet process') }}" value="save_worksheet_and_close();">{{ gettext('Save and quit worksheet') }}</option>
+             <option value="">---------------------------</option>
+             <option title="{{ gettext('Evaluate all input cells in the worksheet') }}" value="evaluate_all();">{{ gettext('Evaluate All') }}</option>
+             <option title="{{ gettext('Hide all output') }}" value="hide_all();">{{ gettext('Hide All Output') }}</option>
+@@ -118,7 +117,7 @@
+             <option title="{{ gettext('Delete all output') }}" value="delete_all_output();">{{ gettext('Delete All Output') }}</option>
+             <option value="">---------------------------</option>
+             <option title="{{ gettext('Switch to single-cell mode') }}" value="slide_mode();">{{ gettext('One Cell Mode') }}</option>
+-            <option title="{{ gettext('Switch to multi-cell mode') }}" value="cell_mode();">{{ gettext('Multi Cell Mode') }}</option> 
++            <option title="{{ gettext('Switch to multi-cell mode') }}" value="cell_mode();">{{ gettext('Multi Cell Mode') }}</option>
+         </select>
+         <select class="worksheet" onchange="handle_data_menu(this);" id="data-menu">
+             <option title="{{ gettext('Select an attached file') }}" value="" selected>{{ gettext('Data...') }}</option>
+@@ -137,7 +136,7 @@
+                 {{ system_name }}
+             </option>
+             {% endfor %}
+-        </select>    
++        </select>
+         <input type="checkbox" title="{{ gettext('Enable/disable pretty_printing') }}"
+                onchange="pretty_print_check(this.checked);"
+                class="worksheet" value="pretty_print" {{ "checked" if worksheet.pretty_print() else "" }} /> {{ gettext('Typeset') }}
+@@ -148,7 +147,7 @@
+                onchange="3D_use_java_check(this.checked);"
+                class="worksheet" value="3D_use_java"/> {{ gettext('Use java for 3-D') }}
+          {% endif %}
+-    {% endif %} 
++    {% endif %}
+     </div>
+     <div id="share-publish-buttons">
+         {% if not worksheet.docbrowser() and not worksheet.is_published() %}
+@@ -156,7 +155,7 @@
+         {{ "control-select" if x == select else "control" }}
+         {% endmacro %}
+         <a title="{{ gettext('Print this worksheet') }}" class="control" onClick="print_worksheet()">{{ gettext('Print') }}</a>
+-        <a class="{{ cls('use') }}" title="{{ gettext('Interactively use this worksheet') }}" href="./">{{ gettext('Worksheet') }}</a>        
++        <a class="{{ cls('use') }}" title="{{ gettext('Interactively use this worksheet') }}" href="./">{{ gettext('Worksheet') }}</a>
+         <a class="{{ cls('edit') }}" title="{{ gettext('Edit text version of this worksheet') }}" href="edit">{{ gettext('Edit') }}</a>
+         <a class="{{ cls('text') }}" title="{{ gettext('View plain text version of this worksheet') }}" href="text">{{ gettext('Text') }}</a>
+         <a class="{{ cls('revisions') }}" title="{{ gettext('View changes to this worksheet over time') }}" href="revisions">{{ gettext('Revisions') }}</a>
+--- a/sagenb/data/sage/html/worksheet_listing.html
++++ b/sagenb/data/sage/html/worksheet_listing.html
+@@ -14,7 +14,7 @@
+ {% set worksheet_heading=gettext('Active Worksheets') %}
+ {% else %}
+ {% set worksheet_heading=gettext('Archived Worksheets') %}
+-{% endif %}  
++{% endif %}
+ 
+ {% block title %}
+ {{ worksheet_heading }}
+@@ -28,9 +28,8 @@
+ <link rel="stylesheet" href="/javascript/jqueryui/css/sage/jquery-ui-1.10.4.custom.css" />
+ <script type="text/javascript" src="/javascript/jqueryui/js/jquery-ui.min.js"></script>
+ <script type="text/javascript" src="/javascript/jquery/plugins/form/jquery.form.min.js"></script>
+-<script type="text/javascript" src="/javascript/jquery/plugins/jquery.bgiframe.min.js"></script>
+ <script type="text/javascript">
+-    var worksheet_filenames = {{ worksheet_filenames|tojson| safe }}; 
++    var worksheet_filenames = {{ worksheet_filenames|tojson| safe }};
+ </script>
+ <script type="text/javascript" src="/javascript/sage/js/notebook_lib.js"></script>
+ <script type="text/javascript" src="/javascript/dynamic/notebook_dynamic.js"></script>
+@@ -58,7 +57,7 @@
+             <button class="add_new_worksheet_menu" id="search-worksheets-button" type="submit">{{ gettext('Search Worksheets') }}</button>
+         </form>
+     </div>
+-</div>       
++</div>
+ <div id="worksheet-list-controls" class="controls">
+     {% if not pub %}
+     <div class="action-buttons">
+@@ -108,7 +107,7 @@
+                     {{ worksheet_heading }}
+                 </a>
+             </td>
+-            
++
+             <td>
+                 <a class="listcontrol" href=".?typ={{ typ }}&sort=owner{{ '' if sort != 'owner' or reverse else '&reverse=True' }}">
+                     {{ gettext('Owner') }} {{ '' if pub else ' / '+gettext('Collaborators') }}
+@@ -144,7 +143,7 @@
+         <tr>
+             <td class="entry">
+                 {% if pub %}
+-                
++
+                 <a class="worksheet_edit" href="/home/{{ name }}/rating_info">
+                     {% if worksheet.rating() < 0 %}
+                     ----
+@@ -152,24 +151,24 @@
+                     {{ worksheet.rating() }}
+                     {% endif %}
+                 </a>
+-                
++
+                 {% else %}
+-                
++
+                 <input type="checkbox" unchecked id="{{ name|css_escape }}" />
+-                {# I'm removing this select since it is a massive performance killer and these 
++                {# I'm removing this select since it is a massive performance killer and these
+                 serve no real purpose at all.  Plus google docs got rid of the analogous menu.
+                 <select onchange="go_option(this);" class="worksheet_edit">
+                     <option value="" title="File options" selected>File</option>
+                     <option value="list_rename_worksheet('{{ name }}','{{ worksheet.name() }}');" title="Change the name of this worksheet.">
+                         Rename...
+-                    </option>            
++                    </option>
+                     <option value="list_edit_worksheet('{{ name }}');" title="Open this worksheet and edit it">Edit</option>
+                     <option value="list_copy_worksheet('{{ name }}');" title="Copy this worksheet">Copy Worksheet</option>
+                     <option value="list_share_worksheet('{{ name }}');" title="Share this worksheet with others">Collaborate</option>
+                     <option value="list_publish_worksheet('{{ name }}');" title="Publish this worksheet on the internet">Publish</option>
+                     <option value="list_revisions_of_worksheet('{{ name }}');" title="See all revisions of this worksheet">Revisions</option>
+                 </select>
+-                #}      
++                #}
+                 {% endif %}
+             </td>
+ 
+@@ -178,7 +177,7 @@
+                     {% if worksheet.compute_process_has_been_started() %}({{ gettext('running') }}){% endif %}
+                     {{ worksheet.truncated_name(50) }}
+                 </a>
+-                
++
+                 {% if not pub and worksheet.is_published() %}(Published){% endif %}
+             </td>
+             <td class="owner_collab">
+@@ -188,7 +187,7 @@
+                 {% else %}
+                 {{worksheet.worksheet_that_was_published().owner()}}
+                 {% endif %}
+-                
++
+                 {% if not pub and typ != 'trash' %}
+ 
+                 {% set shared = False %}
+@@ -206,7 +205,7 @@
+                 {% if (worksheet.owner() != username) or username == 'admin' %}
+                 {% set shared = False %}
+                 {% endif %}
+-                
++
+                 {% if shared %}
+                 <a class="share" href="/home/{{ worksheet.filename() }}/share">{{ gettext('Add or Delete') }}</a>
+                 {% else %}
+@@ -218,7 +217,7 @@
+                     ({{ gettext('published') }})
+                 </a>
+                 {% endif %}
+-                
++
+                 {% endif %}
+             </td>
+             <td>
+--- a/sagenb/data/sage/js/notebook_lib.js
++++ b/sagenb/data/sage/js/notebook_lib.js
+@@ -671,7 +671,7 @@
+             marginLeft: '-' + (width + 1000) + 'px'
+         })
+         me.after(
+-            $('<table><tbody><tr><td align="center" valign="middle">' + 
++            $('<table><tbody><tr><td align="center" valign="middle">' +
+               translations["Java Applet Hidden"] + '</td></tr></tbody></table>').css({
+                 marginTop: '-' + height.toString() + 'px',
+                 width: width.toString() + 'px',
+@@ -742,8 +742,6 @@
+            - autoOpen: true -- automatically opens the dialog. If set
+              to false, open the dialog with <prompt>.dialog('open').
+            - modal: true -- makes the dialog modal, i.e., UI blocking.
+-           - bgiframe: true -- a fix for an IE issue regarding
+-             <select> elements. Not recommended for disabling.
+            - width: "20em" -- width of the dialog box.
+ 
+     OUTPUT:
+@@ -760,7 +758,7 @@
+     css = options.css || {};
+ 
+     overlay_close = options.overlay_close;
+-    if (typeof(options.overlay_close) === 'undefined') { 
++    if (typeof(options.overlay_close) === 'undefined') {
+         overlay_close = true;
+     }
+ 
+@@ -776,10 +774,9 @@
+         }
+         show_java_applets();
+     };
+-    
++
+     modal_options = $.extend({
+         autoOpen: true,
+-        bgiframe: true,
+         modal: true,
+         width: '20em',
+         close: close_dialog
+@@ -1289,7 +1286,7 @@
+     if (introspect_div.length == 0) {
+         return;
+     }
+-    
++
+     if (intr.loaded) {
+         introspect_div.html(text);
+         try {
+@@ -1472,7 +1469,7 @@
+ 
+ 
+ ///////////////////////////////////////////////////////////////////
+-// WORKSHEET functions -- for switching between and managing 
++// WORKSHEET functions -- for switching between and managing
+ // worksheets
+ ///////////////////////////////////////////////////////////////////
+ function new_worksheet() {
+@@ -1888,7 +1885,7 @@
+     */
+     var action = form.options[form.selectedIndex].value;
+     // not safe, but more straigth forward than parsing
+-    // what is basically an eval string and running the 
++    // what is basically an eval string and running the
+     // corresponding function and arguments
+     eval(action);
+     form.options[0].selected = 1;
+@@ -2194,7 +2191,7 @@
+     text_cell = get_element('cell_outer_' + X.id);
+     setTimeout(new_html[1], 50);
+ 
+-    try { MathJax.Hub.Queue(["Typeset",MathJax.Hub,text_cell]); 
++    try { MathJax.Hub.Queue(["Typeset",MathJax.Hub,text_cell]);
+ 	} catch (e) { text_cell.innerHTML = 'Error typesetting mathematics' + text_cell.innerHTML; }
+ }
+ 
+@@ -3024,8 +3021,8 @@
+     OUTPUT:
+         a string
+     */
+-    if (cmd === 'eval' 
+-	|| cmd === 'new_cell_before' 
++    if (cmd === 'eval'
++	|| cmd === 'new_cell_before'
+ 	|| cmd === 'new_cell_after'
+ 	|| cmd === 'new_text_cell_before'
+ 	|| cmd === 'new_text_cell_after') {
+@@ -3423,8 +3420,8 @@
+     cell_id = queue_id_list[0];
+ 
+     async_request(worksheet_command('cell_update'),
+-                  check_for_cell_update_callback, { 
+-                      id: cell_id 
++                  check_for_cell_update_callback, {
++                      id: cell_id
+                   });
+ 
+     // Spin the little title spinner in the title bar.
+@@ -3457,7 +3454,7 @@
+             new_input -- string; updated input (e.g., from tab
+                          completion)
+             interrupted -- string; 'restart', 'false', or 'true',
+-                           whether/how the cell's computation was 
++                           whether/how the cell's computation was
+                            interrupted
+             introspect_html -- string; updated introspection text
+     */
+@@ -3472,7 +3469,7 @@
+             halt_queued_cells();
+             elapsed_time = update_error_count * update_error_delta / 1000;
+             msg = translations['Error updating cell output after '] + " " + elapsed_time + translations['s (canceling further update checks).'];
+-            
++
+             /* alert(msg); */
+             return;
+         }
+@@ -3835,7 +3832,7 @@
+     See http://stackoverflow.com/questions/610995/jquery-cant-append-script-element
+     */
+     var i, j, k, left_tag, right_tag, s, script, new_text, script_end, left_match;
+-    
++
+     left_tag = new RegExp(/<(\s)*script([^>]*)?>/i);
+     right_tag = new RegExp(/<(\s*)\/(\s*)script(\s)*>/i);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 0153ac4..bb06ebb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fix-sass-syntax.patch
 use-system-jquery.js
 update-flask-0.11.patch
 update-codemirror-version.patch
+disable-bgiframe.patch
diff --git a/debian/patches/use-system-jquery.js b/debian/patches/use-system-jquery.js
index 0a4b72a..4eda616 100644
--- a/debian/patches/use-system-jquery.js
+++ b/debian/patches/use-system-jquery.js
@@ -49,3 +49,23 @@
  <script type="text/javascript" src="/javascript/jquery/plugins/form/jquery.form.min.js"></script>
  <script type="text/javascript" src="/javascript/jquery/plugins/jquery.bgiframe.min.js"></script>
  <script type="text/javascript">
+--- a/sagenb/testing/HTMLTestRunner.py
++++ b/sagenb/testing/HTMLTestRunner.py
+@@ -462,7 +462,7 @@
+         template_dict['stylesheet'] += IE_STYLE_FIX.render()
+ 
+         jquery = open(os.path.join(DATA,
+-                                   'jquery/jquery-1.3.2.min.js'), 'r').read()
++                                   'jquery/jquery.min.js'), 'r').read()
+         template_dict['javascript'] = '<script type="text/javascript">\n' + jquery + '\n</script>'
+         return template(os.path.join('html', 'test_report.html'),
+                         **template_dict)
+@@ -495,7 +495,7 @@
+         elif status == _TestResult.FAIL:
+             status = 'fail'
+         else:
+-            status = 'error'            
++            status = 'error'
+ 
+         test_class += 'test_' + status
+         rows.append(REPORT_TEST_TMPL.render(locals()))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list