Ticket #6568: sage-trac-6568.6.patch

File sage-trac-6568.6.patch, 56.4 KB (added by timdumol, 12 years ago)

Removed hack in twist.py for documentation page creation. Removed unused files.

  • sage/server/notebook/notebook.py

    # HG changeset patch
    # User Tim Dumol <tim@timdumol.com>
    # Date 1250242319 -28800
    # Node ID b0850a79275f82ae870f741864a646d34499991c
    # Parent  fda4a004365894c7d231df3aabf6af5d28ffcf5b
    * Removed hack in `twist.py` for documentation page creation.
    
    diff -r fda4a0043658 -r b0850a79275f sage/server/notebook/notebook.py
    a b  
    17971797            except KeyError:
    17981798                W = None
    17991799
    1800         return template("notebook/index.html", worksheet = W,
     1800        template_page = "notebook/index.html"
     1801        if W.docbrowser():
     1802            template_page = "notebook/doc_page.html"
     1803           
     1804        return template(template_page, worksheet = W,
    18011805                        worksheet_filename = W.filename(),
    18021806                        worksheet_html = W.html(),
    18031807                        notebook = self, username = username,
  • sage/server/notebook/templates/base.html

    diff -r fda4a0043658 -r b0850a79275f sage/server/notebook/templates/base.html
    a b  
    44    <head>
    55        <title>{% block title %}{% endblock %}</title>
    66        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     7        {% block pre_main_css %}{% endblock %}
    78        <link type="text/css" rel="stylesheet" href="/css/{% block css %}master{% endblock %}.css" media="screen" />
    89        {% block more_css %}{% endblock %}
    910        {% block javascript %}{% endblock %}
  • sage/server/notebook/twist.py

    diff -r fda4a0043658 -r b0850a79275f sage/server/notebook/twist.py
    a b  
    191191        s = notebook.html(worksheet_filename = W.filename(),
    192192                          username = self.username)
    193193
    194         # FIXME: Hack to add in the needed CSS to get it to display nicely
    195         css_tag = lambda path: r'<link type="text/css" rel="stylesheet" href="%s" media="screen" />'%path
    196         main_css = css_tag('/css/main.css')
    197         s = s.replace(main_css,css_tag('_static/default.css')+"\n"+main_css )
    198 
    199194        return HTMLResponse(stream=s)
    200195       
    201196    def childFactory(self, request, name):
  • sage/server/notebook/notebook.py

    # HG changeset patch
    # User Tim Dumol <tim@timdumol.com>
    # Date 1250243446 -28800
    # Node ID 77967c966845265c53b06deea611c1832462c82b
    # Parent  fda4a004365894c7d231df3aabf6af5d28ffcf5b
    * Removed hack in `twist.py` for documentation page creation.
    * Removed unused files.
    
    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/notebook.py
    a b  
    17971797            except KeyError:
    17981798                W = None
    17991799
    1800         return template("notebook/index.html", worksheet = W,
     1800        template_page = "notebook/index.html"
     1801        if W.docbrowser():
     1802            template_page = "notebook/doc_page.html"
     1803           
     1804        return template(template_page, worksheet = W,
    18011805                        worksheet_filename = W.filename(),
    18021806                        worksheet_html = W.html(),
    18031807                        notebook = self, username = username,
  • deleted file sage/server/notebook/templates/afterpublish_window.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/afterpublish_window.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - url - a string containing the url of the published page
    8 - time - a string representing the time of publication
    9 - JSMATH - a boolean stating whether to include jsMath
    10 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    11 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    12 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    13 -->
    14 
    15 {% set checked = 'checked="true"' if worksheet.is_auto_publis() else '' %}
    16 
    17 {% set title = 'Worksheet is publicly viewable at <a href="%s" style="color:#FFF" target="_blank">%s</a><br />Published on %s<br/><br /><input type="button" value="Re-publish worksheet" onClick="parent.location=\'?re\'"><input type="button" value="Stop publishing" style="margin-left:5px" onClick="parent.location=\'?stop\'"><br /><br /><input type="checkbox" name="auto"%s onchange="parent.location=\'?auto\'"/> Automatically re-publish when changes are made'|format(url, url, time, checked) %}
    18 {% set select = "publish" %}
    19 {% set backwards = true %}
    20  No newline at end of file
  • sage/server/notebook/templates/base.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/base.html
    a b  
    44    <head>
    55        <title>{% block title %}{% endblock %}</title>
    66        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     7        {% block pre_main_css %}{% endblock %}
    78        <link type="text/css" rel="stylesheet" href="/css/{% block css %}master{% endblock %}.css" media="screen" />
    89        {% block more_css %}{% endblock %}
    910        {% block javascript %}{% endblock %}
  • deleted file sage/server/notebook/templates/beforepublish_window.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/beforepublish_window.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - JSMATH - a boolean stating whether to include jsMath
    8 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    9 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    10 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    11 -->
    12 
    13 {% set title = '<p>You can publish your worksheet to the Internet, where anyone will be able to access and view it online.</p><p>Your worksheet will be assigned a unique address (URL) that you can send to your friends and colleagues.</p><p>Do you want to publish this worksheet?</p><form method="get" action="."><input type="hidden" name="yes" value="" /><input type="submit" value="Yes" style="margin-left:10px" /><input type="button" value="No" style="margin-left:5px" onClick="parent.location=\\\'../\'"><br/><br/><input type="checkbox" name="auto" style="margin-left:13px" /> Automatically re-publish when changes are made</form>' %}
    14 {% set select = "publish" %}
    15 {% set backwards = true %}
    16  No newline at end of file
  • deleted file sage/server/notebook/templates/debug_window.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/debug_window.html
    + -  
    1 <div class='debug_window'>
    2     <div class='debug_output'><pre id='debug_output'></pre></div>
    3     <textarea rows=5 id='debug_input' class='debug_input'
    4               onKeyPress='return debug_keypress(event);'
    5               onFocus='debug_focus();' onBlur='debug_blur();'></textarea>
    6 </div>
    7  No newline at end of file
  • deleted file sage/server/notebook/templates/doc.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/doc.html
    + -  
    1 {% extends "base.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - JSMATH - a boolean stating whether to include jsMath
    8 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    9 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    10 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    11 -->
    12 
    13 {% include "head.tmpl" %}
    14 
    15 {% block title %}
    16 {{ common_title(worksheet_filename, worksheet) }}
    17 {% endblock %}
    18    
    19 {% block css %}main{% endblock %}
    20 
    21 {% block javascript %}
    22 {{ common_javascript(worksheet, worksheet_filename, username, JSMATH, JSMATH_IMAGE_FONTS, JEDITABLE_TINYMCE, sage_jsmath_macros) }}
    23 {% endblock %}
    24 
    25 {% block body %}
    26 <br />
    27 <div class="docidx">
    28     <h1>Sage Documentation</h1>
    29     <br />
    30     <hr class="usercontrol" />
    31     <br /><br />
    32     <font size=+2>
    33         <a href="/doc/live/">Live Documentation</a><br /><br />
    34         <a href="/doc/static/">Static Documentation</a><br /><br />
    35         <a href="/help/">Sage Notebook Howto</a><br /><br />
    36         <br /><br />
    37         <br />
    38         <hr class="usercontrol" />
    39     </font>
    40 </div>
    41 {% endblock %}
    42  No newline at end of file
  • deleted file sage/server/notebook/templates/download_or_delete_datafile.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/download_or_delete_datafile.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - active_worksheets - a list of the Worksheet instances that are active for username
    8 - filename - the name of the file
    9 - path - the path to the file
    10 - file_is_image - a boolean stating whether the file is an image
    11 - file_is_text - a boolean stating whether the file is a text file
    12 - text_file_content - a string containing the content of a text file
    13 - JSMATH - a boolean stating whether to include jsMath
    14 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    15 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    16 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    17 -->
    18 {% set title = "Data file: %s"|format(filename) %}
    19 
    20 {% block body_addition %}
    21 <p>You may download <a href="{{ path }}">{{ filename }}</a> or create a linked copy to the worksheet <select onchange="go_option(this);" class="worksheet">
    22 <option selected>select worksheet</option>
    23 {% for worksheet in active_worksheets %}
    24     <option value='link_datafile("{{ worksheet.filename() }}","{{ filename }}")'>{{ worksheet.name() }}</option>
    25 {% endfor %}
    26 </select> or <a href="/home/{{ worksheet.filename() }}/datafile?name={{ filename }}&action=delete">delete {{ filename }}.</a></p>
    27 
    28 <p>Access {{ filename }} in this worksheet by typing <tt>DATA+'{{ filename }}'</tt>.  Here DATA is a special variable that gives the exact path to all data files uploaded to this worksheet.</p>
    29 
    30 <hr class="usercontrol" />
    31 
    32 {% if file_is_image %}
    33 <div align=center><img src="{{ path }}"></div>
    34 {% elif file_is_text %}
    35 <form method="post" action="savedatafile" enctype="multipart/form-data">
    36     <input type="submit" value="Save Changes" name="button_save" /> <input type="submit" value="Cancel" name="button_cancel" style="display:block" />
    37     <textarea class="edit" name="textfield" rows=17 cols=70 id="textfield">{{ text_file_content }}</textarea>
    38     <input type="hidden" name="filename" value="{{ filename }}" id="filename" />
    39 </form>
    40 {% endif %}
    41 {% endblock %}
    42 
    43 
    44 
    45 
  • deleted file sage/server/notebook/templates/edit_window.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/edit_window.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - text - a string containing the text of the worksheet
    8 - n_lines - number of lines of the text of the worksheet
    9 - JSMATH - a boolean stating whether to include jsMath
    10 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    11 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    12 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    13 -->
    14 
    15 {% set title = 'Edit plain text &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Save Changes" name="button_save" id="button_save"> <input type="submit" value="Cancel" name="button_cancel">' %}
    16 {% set select = "edit" %}
    17 
    18 {% block before_sharebar %}
    19 <form method="post" action="save" enctype="multipart/form-data">
    20 {% endblock %}
    21 {% block body_addition %}
    22 <script type="text/javascript">
    23     function save_worksheet() {
    24     }
    25     function save_worksheet_and_close() {
    26     }
    27 </script>
    28     <textarea class="plaintextedit" id="cell_intext" name="textfield" rows="{{ n_lines }}">{{ text }}</textarea>
    29 </form>
    30 {% endblock %}
  • deleted file sage/server/notebook/templates/guest_top_bar_and_worksheet.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/guest_top_bar_and_worksheet.html
    + -  
    1 <!--
    2 INPUT:
    3 - original_worksheet - an instance of Worksheet
    4 - worksheet - an instance of Worksheet
    5 - notebook - an instance of Notebook which contains worksheet
    6 - worksheet_html - a string containing the html for the worksheet
    7 - username - a string containing a username
    8 {% if original_worksheet.is_collaborator(username) or original_worksheet.is_owner(username) %}
    9     {% set edit_text = "Edit this." %}
    10     {% set url       = "edit_published_page" %}
    11 {% elif notebook.user_is_guest(username) %}
    12     {% set edit_text = "Log in to edit a copy." %}
    13     {% set url       = "/" %}
    14 {% else %}
    15     {% set edit_text = "Edit a copy." %}
    16     {% set url       = "edit_published_page" %}
    17 {% endif %}
    18 
    19 {% set download_name = os.path.split(worksheet.name())[-1] %}
    20 
    21 <a class="usercontrol" href="{{ url }}">{{ edit_text }}</a>
    22 &nbsp;&nbsp;<a class="usercontrol" href="download/{{ download_name }}.sws">Download.</a>
    23 &nbsp;&nbsp;<span class="ratingmsg">
    24     {% if worksheet.rating() != -1 %}
    25         <a class="usercontrol" href="rating_info">
    26             This page is rated {{ "%.1f"|format("worksheet.rating()") }}.
    27         </a>
    28     {% endif %}
    29     {% if not notebook.user_is_guest(username)
    30         and not worksheet.is_publisher(username) %}
    31         &nbsp;&nbsp;
    32         <span class="usercontrol">
    33             {{ "Rerate" if worksheet.is_rater(username) else "Rate" }}
    34         </span>
    35         {% for i in range(5) %}
    36             <a class="usercontrol"
    37                onClick="rate_worksheet({{ i }})">
    38                 &nbsp;{{ i }}&nbsp;
    39             </a>
    40         {% endfor %}
    41             &nbsp;&nbsp; <input name="rating_comment" id="rating_comment"></input>
    42     {% endif %}
    43 </span>
    44 <span class="pubmsg">
    45     <a href="/pub/">Other published documents...</a>
    46 </span>
    47 <hr class="usercontrol" />
    48 <h1 align="center">{{ original_worksheet.name() }}</h1>
    49 <h2 align="center">{{ worksheet.html_time_since_last_edited() }}</h2>
    50 {{ worksheet_html }}
    51 <hr class="usercontrol" />
    52 {% for i in range(10) %}
    53 &nbsp;
    54 {% endfor %}
    55 
  • deleted file sage/server/notebook/templates/head.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/head.html
    + -  
    1 <!--
    2 INPUT:
    3 - worksheet - an instance of Worksheet
    4 - worksheet_filename - a string containing a worksheet's filename
    5 - username - a string containing a user's name
    6 - JSMATH - a boolean stating whether to include jsMath
    7 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    8 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    9 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    10   -->
    11 <title>
    12     {% if worksheet_filename %}
    13         {{ worksheet.name() }} (Sage)
    14     {% else %}
    15         Sage Notebook | Welcome
    16     {% endif %}
    17 </title>
    18 
    19 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    20 <!-- Load the Sage javascript library. -->
    21 <script type="text/javascript" src="/javascript_local/jquery/jquery.js"></script>
    22 <script type="text/javascript" src="/javascript/main.js"></script>
    23 <link rel=stylesheet href="/css/main.css" type="text/css" />
    24  
    25 {% if JSMATH %}
    26     <!-- Turn off font warning. -->
    27     <style>
    28         #jsMath_Warning {display: none}
    29     </style>
    30     <script type="text/javascript">
    31         jsMath = {Controls: {cookie: {scale: 115}}}
    32     </script>
    33     {% if not JSMATH_IMAGE_FONTS %}
    34         <script type="text/javascript" src="/javascript_local/jsmath/plugins/noImageFonts.js"></script>
    35     {% endif %}
    36     <!-- Move the jsMath button 20 pixels from the right edge
    37          (apparently in some browsers, it covers up the scroll
    38          bar) -->
    39     <script type="text/javascript">
    40         jsMath.styles = {
    41             '#jsMath_button':
    42                 'position:fixed; bottom:1px; right:20px; background-color:white;'
    43                     + 'border: solid 1px #959595; margin:0px; padding: 0px 3px 1px 3px; '
    44                     + 'z-index:102; color:black; text-decoration:none; font-size:x-small; '
    45                     + 'width:auto; cursor:hand;',
    46         };
    47     </script>
    48     <script type="text/javascript" src="/javascript_local/jsmath/jsMath.js"></script>
    49     <script type="text/javascript">
    50         /* The extensions here do the following:
    51             - verb implements the \verb command:
    52               see http://www.math.union.edu/~dpvc/jsMath/authors/verb.html
    53             - moreArrows implements \xrightarrow, among other things:
    54               see http://www.math.union.edu/~dpvc/jsMath/authors//moreArrows.html
    55             - AMSmath implements a number of AMS math commands:
    56               see http://www.math.union.edu/~dpvc/jsMath/authors/AMSmath.html
    57         */
    58         jsMath.Extension.Require("verb");
    59         jsMath.Extension.Require("moreArrows");
    60         jsMath.Extension.Require("AMSmath");
    61         jsMath.Extension.Require("AMSsymbols");
    62     </script>
    63 {% endif %}
    64 <!-- Import LaTeX macros -->
    65 {% for m in sage_jsmath_macros %}
    66 <script> {{ m }} </script>
    67 {% endfor %}
    68 
    69 <!-- Load the jquery and ui-jquery javascript library.
    70      This is used for interact functionality in the notebook, and will be used
    71      to enable drag and drop, image zoom, etc. -->
    72 <script type="text/javascript" src="/javascript_local/jqueryui/jquery.ui.all.min.js"></script>
    73 <script type="text/javascript" src="/javascript_local/jquery/plugins/farbtastic/farbtastic.min.js"></script>
    74 <script type="text/javascript" src="/javascript_local/jquery/plugins/dimensions/jquery.dimensions.min.js"></script>
    75 <script type="text/javascript" src="/javascript_local/jquery/plugins/jquery.event.extendedclick.js"></script>
    76 
    77 <link rel="stylesheet" href="/javascript_local/jquery/plugins/farbtastic/farbtastic.css" type="text/css" /> 
    78 <link rel="stylesheet" href="/javascript_local/jqueryui/themes/flora/flora.all.css" />
    79 
    80 <!-- TODO: get the lazy loading plugin -->
    81 
    82 <!-- TODO: Load individual ui plugins, not the whole package:
    83      <script type="text/javascript" src="/javascript_local/jqueryui/ui.mouse.min.js"></script>
    84      <script type="text/javascript" src="/javascript_local/jqueryui/ui.slider.min.js"></script>
    85      <script type="text/javascript" src="/javascript_local/jqueryui/ui.draggable.min.js"></script>
    86      <script type="text/javascript" src="/javascript_local/jqueryui/ui.draggable.ext.min.js"></script>
    87      <script type="text/javascript" src="/javascript_local/jqueryui/ui.resizable.min.js"></script>
    88      <script type="text/javascript" src="/javascript_local/jqueryui/ui.dialog.min.js"></script>
    89 -->
    90 
    91 <!-- This was for syntax highlighting
    92      <script type="text/javascript" src="/javascript/highlight/prettify.js"></script>
    93      <link rel=stylesheet href="/css/highlight/prettify.css" type="text/css" />
    94 -->
    95 
    96 <script type="text/javascript" src="/javascript/sage3d.js"></script
    97 
    98 <!-- Jmol - embedded 3D graphics -->
    99 <script type="text/javascript" src="/java/jmol/appletweb/Jmol.js"></script>
    100 <script>jmolInitialize("/java/jmol");jmolSetCallback("menuFile","/java/jmol/appletweb/SageMenu.mnu");</script> <!-- This must stay in <head> -->
    101 
    102 <!-- TinyMCE and jEditable - in-place editing of text cells -->
    103 {% if JEDITABLE_TINYMCE %}
    104     <script type="text/javascript" src="/javascript_local/tiny_mce/tiny_mce.js"></script>
    105     <script src="/javascript_local/jquery/plugins/jquery.jeditable.mini.js" type="text/javascript" charset="utf-8"></script>
    106     <script type="text/javascript">
    107    
    108     function toggleEditor(id) {
    109             if (!tinyMCE.get(id))
    110                     tinyMCE.execCommand('mceAddControl', false, id);
    111             else
    112                     tinyMCE.execCommand('mceRemoveControl', false, id);
    113     }
    114    
    115     $.fn.tinymce = function(options){
    116        return this.each(function(){
    117           tinyMCE.execCommand("mceAddControl", true, this.id);
    118        });
    119     }
    120    
    121     function initMCE(){
    122        tinyMCE.init({mode : "none",
    123           plugins: "table,searchreplace,safari,paste,autosave",
    124           theme : "advanced",
    125           theme_advanced_toolbar_location : "top",
    126           theme_advanced_toolbar_align : "left",
    127           theme_advanced_statusbar_location : "bottom",
    128           theme_advanced_buttons1 : "\
    129     formatselect,fontselect,fontsizeselect,bold,italic,underline,strikethrough,forecolor,backcolor,|,\
    130     bullist,numlist,|,\
    131     undo,redo,search,pastetext,pasteword",
    132           theme_advanced_buttons2 : "\
    133     justifyleft,justifycenter,justifyright,justifyfull,outdent,indent,|,\
    134     charmap,|,\
    135     table,tablecontrols,|,\
    136     code,|,\
    137     link,image,unlink",
    138           theme_advanced_buttons3 : "",
    139           theme_advanced_resizing : true,
    140           setup : function(ed) {
    141           ed.onKeyDown.add(function(ed, e) {
    142               if(key_enter_shift(key_event(e))) {
    143                 $(ed.formElement).submit();
    144               }
    145           })}
    146        });
    147     };
    148    
    149     initMCE();
    150    
    151    
    152     $.editable.addInputType('mce', {
    153        element : function(settings, original) {
    154           var textarea = $('<textarea id="'+$(original).attr("id")+'_mce"/>');
    155           if (settings.rows) {
    156              textarea.attr('rows', settings.rows);
    157           } else {
    158              textarea.height(settings.height);
    159           }
    160           if (settings.cols) {
    161              textarea.attr('cols', settings.cols);
    162           } else {
    163              textarea.width(settings.width);
    164           }
    165           $(this).append(textarea);
    166              return(textarea);
    167           },
    168        plugin : function(settings, original) {
    169           tinyMCE.execCommand("mceAddControl", true, $(original).attr("id")+'_mce');
    170           },
    171        submit : function(settings, original) {
    172           tinyMCE.triggerSave();
    173           tinyMCE.execCommand("mceRemoveControl", true, $(original).attr("id")+'_mce');
    174           },
    175        reset : function(settings, original) {
    176           tinyMCE.execCommand("mceRemoveControl", true, $(original).attr("id")+'_mce');
    177           original.reset();
    178        }
    179     });
    180     </script>
    181 {% endif %}
    182 <script type="text/javascript">user_name= "{{ username }}";</script>
    183 {% if worksheet_filename %}
    184 <script  type="text/javascript">
    185     worksheet_filename="{{ worksheet_filename }}";
    186     worksheet_name="{{ worksheet.name() }}";
    187     server_ping_while_alive();
    188 </script>
    189 {% endif %}
    190 <!-- Uncomment this to force rename when the worksheet is opened (annoying!)
    191      if W and
    192         W.name() == "Untitled":
    193         <script  type="text/javascript">setTimeout("rename_worksheet()",1)</script> -->
    194 
    195 
    196 
    197 
    198 
  • deleted file sage/server/notebook/templates/head.tmpl

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/head.tmpl
    + -  
    1 <!--
    2 INPUT:
    3 - worksheet - an instance of Worksheet
    4 - worksheet_filename - a string containing a worksheet's filename
    5 - username - a string containing a user's name
    6 - JSMATH - a boolean stating whether to include jsMath
    7 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    8 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    9 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    10   -->
    11 {% macro common_title(worksheet_filename, worksheet) %}
    12     {% if worksheet_filename %}
    13         {{ worksheet.name() }} (Sage)
    14     {% else %}
    15         Sage Notebook | Welcome
    16     {% endif %}
    17 {% endmacro %}
    18 
    19 {% macro common_css %}
    20 <link rel=stylesheet href="/css/main.css" type="text/css" />
    21 {% endmacro %}
    22 
    23 {% macro common_javascript(worksheet, worksheet_filename, username, JSMATH, JSMATH_IMAGE_FONTS, JEDITABLE_TINYMCE, sage_jsmath_macros) %}
    24 <!-- Load the Sage javascript library. -->
    25 <script type="text/javascript" src="/javascript_local/jquery/jquery.js"></script>
    26 <script type="text/javascript" src="/javascript/main.js"></script>
    27  
    28 {% if JSMATH %}
    29     <!-- Turn off font warning. -->
    30     <style>
    31         #jsMath_Warning {display: none}
    32     </style>
    33     <script type="text/javascript">
    34         jsMath = {Controls: {cookie: {scale: 115}}}
    35     </script>
    36     {% if not JSMATH_IMAGE_FONTS %}
    37         <script type="text/javascript" src="/javascript_local/jsmath/plugins/noImageFonts.js"></script>
    38     {% endif %}
    39     <!-- Move the jsMath button 20 pixels from the right edge
    40          (apparently in some browsers, it covers up the scroll
    41          bar) -->
    42     <script type="text/javascript">
    43         jsMath.styles = {
    44             '#jsMath_button':
    45                 'position:fixed; bottom:1px; right:20px; background-color:white;'
    46                     + 'border: solid 1px #959595; margin:0px; padding: 0px 3px 1px 3px; '
    47                     + 'z-index:102; color:black; text-decoration:none; font-size:x-small; '
    48                     + 'width:auto; cursor:hand;',
    49         };
    50     </script>
    51     <script type="text/javascript" src="/javascript_local/jsmath/jsMath.js"></script>
    52     <script type="text/javascript">
    53         /* The extensions here do the following:
    54             - verb implements the \verb command:
    55               see http://www.math.union.edu/~dpvc/jsMath/authors/verb.html
    56             - moreArrows implements \xrightarrow, among other things:
    57               see http://www.math.union.edu/~dpvc/jsMath/authors//moreArrows.html
    58             - AMSmath implements a number of AMS math commands:
    59               see http://www.math.union.edu/~dpvc/jsMath/authors/AMSmath.html
    60         */
    61         jsMath.Extension.Require("verb");
    62         jsMath.Extension.Require("moreArrows");
    63         jsMath.Extension.Require("AMSmath");
    64         jsMath.Extension.Require("AMSsymbols");
    65     </script>
    66 {% endif %}
    67 <!-- Import LaTeX macros -->
    68 {% for m in sage_jsmath_macros %}
    69 <script> {{ m }} </script>
    70 {% endfor %}
    71 
    72 <!-- Load the jquery and ui-jquery javascript library.
    73      This is used for interact functionality in the notebook, and will be used
    74      to enable drag and drop, image zoom, etc. -->
    75 <script type="text/javascript" src="/javascript_local/jqueryui/jquery.ui.all.min.js"></script>
    76 <script type="text/javascript" src="/javascript_local/jquery/plugins/farbtastic/farbtastic.min.js"></script>
    77 <script type="text/javascript" src="/javascript_local/jquery/plugins/dimensions/jquery.dimensions.min.js"></script>
    78 <script type="text/javascript" src="/javascript_local/jquery/plugins/jquery.event.extendedclick.js"></script>
    79 
    80 <link rel="stylesheet" href="/javascript_local/jquery/plugins/farbtastic/farbtastic.css" type="text/css" /> 
    81 <link rel="stylesheet" href="/javascript_local/jqueryui/themes/flora/flora.all.css" />
    82 
    83 <!-- TODO: get the lazy loading plugin -->
    84 
    85 <!-- TODO: Load individual ui plugins, not the whole package:
    86      <script type="text/javascript" src="/javascript_local/jqueryui/ui.mouse.min.js"></script>
    87      <script type="text/javascript" src="/javascript_local/jqueryui/ui.slider.min.js"></script>
    88      <script type="text/javascript" src="/javascript_local/jqueryui/ui.draggable.min.js"></script>
    89      <script type="text/javascript" src="/javascript_local/jqueryui/ui.draggable.ext.min.js"></script>
    90      <script type="text/javascript" src="/javascript_local/jqueryui/ui.resizable.min.js"></script>
    91      <script type="text/javascript" src="/javascript_local/jqueryui/ui.dialog.min.js"></script>
    92 -->
    93 
    94 <!-- This was for syntax highlighting
    95      <script type="text/javascript" src="/javascript/highlight/prettify.js"></script>
    96      <link rel=stylesheet href="/css/highlight/prettify.css" type="text/css" />
    97 -->
    98 
    99 <script type="text/javascript" src="/javascript/sage3d.js"></script
    100 
    101 <!-- Jmol - embedded 3D graphics -->
    102 <script type="text/javascript" src="/java/jmol/appletweb/Jmol.js"></script>
    103 <script>jmolInitialize("/java/jmol");jmolSetCallback("menuFile","/java/jmol/appletweb/SageMenu.mnu");</script> <!-- This must stay in <head> -->
    104 
    105 <!-- TinyMCE and jEditable - in-place editing of text cells -->
    106 {% if JEDITABLE_TINYMCE %}
    107     <script type="text/javascript" src="/javascript_local/tiny_mce/tiny_mce.js"></script>
    108     <script src="/javascript_local/jquery/plugins/jquery.jeditable.mini.js" type="text/javascript" charset="utf-8"></script>
    109     <script type="text/javascript">
    110    
    111     function toggleEditor(id) {
    112             if (!tinyMCE.get(id))
    113                     tinyMCE.execCommand('mceAddControl', false, id);
    114             else
    115                     tinyMCE.execCommand('mceRemoveControl', false, id);
    116     }
    117    
    118     $.fn.tinymce = function(options){
    119        return this.each(function(){
    120           tinyMCE.execCommand("mceAddControl", true, this.id);
    121        });
    122     }
    123    
    124     function initMCE(){
    125        tinyMCE.init({mode : "none",
    126           plugins: "table,searchreplace,safari,paste,autosave",
    127           theme : "advanced",
    128           theme_advanced_toolbar_location : "top",
    129           theme_advanced_toolbar_align : "left",
    130           theme_advanced_statusbar_location : "bottom",
    131           theme_advanced_buttons1 : "\
    132     formatselect,fontselect,fontsizeselect,bold,italic,underline,strikethrough,forecolor,backcolor,|,\
    133     bullist,numlist,|,\
    134     undo,redo,search,pastetext,pasteword",
    135           theme_advanced_buttons2 : "\
    136     justifyleft,justifycenter,justifyright,justifyfull,outdent,indent,|,\
    137     charmap,|,\
    138     table,tablecontrols,|,\
    139     code,|,\
    140     link,image,unlink",
    141           theme_advanced_buttons3 : "",
    142           theme_advanced_resizing : true,
    143           setup : function(ed) {
    144           ed.onKeyDown.add(function(ed, e) {
    145               if(key_enter_shift(key_event(e))) {
    146                 $(ed.formElement).submit();
    147               }
    148           })}
    149        });
    150     };
    151    
    152     initMCE();
    153    
    154    
    155     $.editable.addInputType('mce', {
    156        element : function(settings, original) {
    157           var textarea = $('<textarea id="'+$(original).attr("id")+'_mce"/>');
    158           if (settings.rows) {
    159              textarea.attr('rows', settings.rows);
    160           } else {
    161              textarea.height(settings.height);
    162           }
    163           if (settings.cols) {
    164              textarea.attr('cols', settings.cols);
    165           } else {
    166              textarea.width(settings.width);
    167           }
    168           $(this).append(textarea);
    169              return(textarea);
    170           },
    171        plugin : function(settings, original) {
    172           tinyMCE.execCommand("mceAddControl", true, $(original).attr("id")+'_mce');
    173           },
    174        submit : function(settings, original) {
    175           tinyMCE.triggerSave();
    176           tinyMCE.execCommand("mceRemoveControl", true, $(original).attr("id")+'_mce');
    177           },
    178        reset : function(settings, original) {
    179           tinyMCE.execCommand("mceRemoveControl", true, $(original).attr("id")+'_mce');
    180           original.reset();
    181        }
    182     });
    183     </script>
    184 {% endif %}
    185 <script type="text/javascript">user_name= "{{ username }}";</script>
    186 {% if worksheet_filename %}
    187 <script  type="text/javascript">
    188     worksheet_filename="{{ worksheet_filename }}";
    189     worksheet_name="{{ worksheet.name() }}";
    190     server_ping_while_alive();
    191 </script>
    192 {% endif %}
    193 <!-- Uncomment this to force rename when the worksheet is opened (annoying!)
    194      if W and
    195         W.name() == "Untitled":
    196         <script  type="text/javascript">setTimeout("rename_worksheet()",1)</script> -->
    197 {% endmacro %}
    198  No newline at end of file
  • deleted file sage/server/notebook/templates/index.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/index.html
    + -  
    1 {% extends "base.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - worksheet_html - a string containing the html for the worksheet
    7 - notebook - an instance of Notebook which contains worksheet
    8 - username - a string containing a username
    9 - show_debug - a boolean stating whether to show debug information
    10 - JSMATH - a boolean stating whether to include jsMath
    11 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    12 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    13 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    14 -->
    15 
    16 {% if not select %}
    17     {% set select = none %}
    18 {% endif %}
    19 
    20 {% if not backwards %}
    21     {% set backwards = false %}
    22 {% endif %}
    23    
    24 {% include "head.tmpl" %}
    25 
    26 {% block title %}
    27 {{ common_title(worksheet_filename, worksheet) }}
    28 {% endblock %}
    29    
    30 {% block css %}main{% endblock %}
    31 
    32 {% block javascript %}
    33 {{ common_javascript(worksheet, worksheet_filename, username, JSMATH, JSMATH_IMAGE_FONTS, JEDITABLE_TINYMCE, sage_jsmath_macros) }}
    34 {% endblock %}
    35 
    36 {% block body_attrs %}
    37 class="worksheet-online" onLoad="initialize_the_notebook();"
    38 {% endblock %}
    39 
    40 {% block body %}
    41 {% if worksheet.is_published() or notebook.user_is_guest(username) %}
    42     {% set original_worksheet = worksheet.worksheet_that_was_published() %}
    43     {% include "guest_top_bar_and_worksheet.html" %}
    44 {% else %}
    45     {% include "top_bar_and_worksheet.html" %}
    46 {% endif %}
    47 {% if not worksheet %}
    48     </td></tr></table></span>
    49 {% endif %}
    50 {% if worksheet.user_is_only_viewer(username) %}
    51     <script type="text/javascript">worksheet_locked=true;</script>
    52 {% else %}
    53     <script type="text/javascript">worksheet_locked=false;</script>
    54 {% endif %}
    55    
    56 {% if worksheet.computing() %}
    57     <!-- Set the update checking back in motion. -->
    58     <script type="text/javascript">
    59         active_cell_list = {{ worksheet.queue_id_list() }};
    60         for(var i = 0; i < active_cell_list.length; i++) {
    61             cell_set_running(active_cell_list[i]);
    62         }
    63         start_update_check();
    64     </script>
    65 {% endif %}
    66 {% endblock %}
    67  No newline at end of file
  • new file sage/server/notebook/templates/notebook/doc_page.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/notebook/doc_page.html
    - +  
     1{% extends "notebook/index.html" %}
     2
     3{% block pre_main_css %}
     4<link type="text/css" rel="stylesheet" href="_static/default.css" media="screen" />
     5{% endblock %}
     6 No newline at end of file
  • deleted file sage/server/notebook/templates/plain_text_window.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/plain_text_window.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - plain_text - a string containing the plain text version
    8 - JSMATH - a boolean stating whether to include jsMath
    9 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    10 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    11 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    12 -->
    13 
    14 {% set title = "View plain text" %}
    15 {% set select = "text" %}
    16 
    17 {% block body_addition %}
    18 <pre class="plaintext" id="cell_intext" name="textfield">plain_text</pre>
    19 {% endblock %}
  • deleted file sage/server/notebook/templates/plain_text_worksheet.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/plain_text_worksheet.html
    + -  
    1 <!-- INPUT:
    2      - worksheet_name - a string containing a worksheet's name
    3      - worksheet_plain_text - a string containing the plain text version of a worksheet
    4 -->
    5 <head>
    6     <title>Sage Worksheet: {{ worksheet_name }}</title>
    7     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    8 </head>
    9 <body>
    10     <h1><a href=".">Sage Worksheet: %s</a></h1>
    11     <pre>{{ worksheet_plain_text }}</pre>
    12 </body>
    13  No newline at end of file
  • deleted file sage/server/notebook/templates/slide_controls.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/slide_controls.html
    + -  
    1 <div class="hidden" id="slide_controls">
    2     <div class="slideshow_control">
    3         <a class="slide_arrow" onClick="slide_next()">&gt;</a>
    4         <a class="slide_arrow" onClick="slide_last()">&gt;&gt;</a> <span class="vbar"></span>
    5         <a class="cell_mode" onClick="cell_mode()">Exit</a>
    6     </div>
    7     <div class="slideshow_progress" id="slideshow_progress" onClick="slide_next()">
    8         <div class="slideshow_progress_bar" id="slideshow_progress_bar">&nbsp;</div>
    9         <div class="slideshow_progress_text" id="slideshow_progress_text">&nbsp;</div>
    10     </div>
    11     <div class="slideshow_control">
    12         <a class="slide_arrow" onClick="slide_first()">&lt;&lt;</a>
    13         <a class="slide_arrow" onClick="slide_prev()">&lt;</a>
    14     </div>
    15 </div>
    16 
    17 
    18 
    19 
    20 
    21 
    22 
  • deleted file sage/server/notebook/templates/specific_revision.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/specific_revision.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - rev - this revision's key
    8 - prev_rev - the previous revision's key
    9 - next_rev - the next revision's key
    10 - time_ago - a string containing the time since revision
    11 - body_worksheet_html - the body html of the worksheet
    12 - JSMATH - a boolean stating whether to include jsMath
    13 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    14 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    15 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    16 -->
    17 
    18 {% set select = "revisions" %}
    19 {% set title = "Revision from %s ago&nbsp;&nbsp;&nbsp;&nbsp;<a href='revisions'>Revision List</a>"|format(time_ago) %}
    20    
    21 {% macro actions %}
    22 {% if prev_rev %}
    23     <a class="listcontrol" href="revisions?rev={{ prev_rev }}">Older</a>&nbsp;&nbsp;
    24 {% else %}
    25     Oldest
    26 {% endif %}
    27 
    28 {% if next_rev %}
    29     <a class="listcontrol" href="revisions?rev={{ next_rev }}">Newer</a>&nbsp;&nbsp;
    30 {% else %}
    31     Newest
    32 {% endif %}
    33 
    34 <a class="listcontrol" href="revisions?rev={{ rev }}&action=revert">Revert to this one</a> <span class="lastedit">(note that images are not recorded)</span>&nbsp;&nbsp;
    35 <a class="listcontrol" href="revisions?rev={{ rev }}&action=publish">Publish this one</a>&nbsp;&nbsp;
    36 {% endmacro %}
    37 
    38 {% block body_addition %}
    39 {{ actions() }}
    40 <hr class="usercontrol" />       
    41 <table width="100%%">
    42 {{ body_worksheet_html }}
    43 <hr class="usercontrol" />
    44 {{ actions() }}
    45 {% endblock %}
  • deleted file sage/server/notebook/templates/top_bar_and_worksheet.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/top_bar_and_worksheet.html
    + -  
    1 <!--
    2 INPUT:
    3 - username - a string containing a username
    4 - worksheet_filename - a string containing a worksheet's filename
    5 - worksheet_html - a string containing the html for a worksheet
    6 - show_debug - a boolean stating whether to show debug information
    7   -->
    8 {% include "user_controls.tmpl" %}
    9 {% include "worksheet_topbar.tmpl" %}
    10 {% set entries = [("$('#topbar').toggle()", 'Toggle', 'Toggle the top bar'),
    11                        ('/', 'Home', 'Back to your personal worksheet list'),
    12                        ('/pub', 'Published', 'Browse the published worksheets'),
    13                        ('history_window()', 'Log', 'View a log of recent computations'),
    14                        ('/settings', 'Settings', 'Account Settings'),
    15                        ('bugreport()', 'Report a Problem', 'Report a problem or submit a bug to improve Sage'),
    16                        ('help()', 'Help', 'Documentation'),
    17                        ('/logout', 'Sign out', 'Log out of the Sage notebook')] %}
    18 <table width="100%">
    19     <tr>
    20         <td>{% include "banner.html" %}</td>
    21         <td align="right">{{ user_controls(username, entries) }}</td>
    22     </tr>
    23 </table>
    24 {% if worksheet_filename %}
    25 {{ worksheet_topbar(worksheet, "use", username) }}
    26 {% endif %}
    27 {% if show_debug %}
    28 {% include "debug_window.html" %}
    29 {% endif %}
    30 
    31 <div class="worksheet" id="worksheet">
    32     {{ worksheet_html }}
    33 </div>
    34  No newline at end of file
  • deleted file sage/server/notebook/templates/upload_data_window.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/upload_data_window.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - JSMATH - a boolean stating whether to include jsMath
    8 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    9 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    10 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    11 -->
    12 
    13 {% set title = 'Upload or Create Data File' %}
    14 
    15 {% block body_addition %}
    16 <div class="upload_worksheet_menu" id="upload_worksheet_menu">
    17     <h1><font size=+1>Upload or create data file attached to the worksheet '%s'</font></h1>
    18     <hr />
    19     <form method="POST" action="do_upload_data"
    20           name="upload" enctype="multipart/form-data">
    21         <table>
    22             <tr>
    23                 <td>
    24                     Browse your computer to select a file to upload:<br />
    25                     <input class="upload_worksheet_menu" size="50" type="file" name="fileField" value="" id="upload_filename"></input><br /><br />
    26                     Or enter the url of a file on the web:<br />
    27                    
    28                     <input class="upload_worksheet_menu" size="50" type="text" name="urlField" value="" id="upload_url"></input><br />
    29                     <br /><br />
    30                     Or enter the name of a new file, which will be created:<br />
    31                     <input class="upload_worksheet_menu" size="50" type="text" name="newField" value="" id="upload_filename"></input><br /><br />
    32                    
    33                     What do you want to call it? (if different than the original name)<br />
    34                     <input class="upload_worksheet_menu" size="50" type="text" name="nameField" value="" id="upload_name"></input><br />
    35                 </td>
    36             </tr>
    37             <tr>
    38                 <td><br /><input type="button" class="upload_worksheet_menu" value="Upload File" onClick="form.submit();" /></td>
    39             </tr>
    40         </table>
    41     </form>
    42     <br />
    43 </div>
    44 {% endblock %}
    45        
    46  No newline at end of file
  • deleted file sage/server/notebook/templates/user_controls.tmpl

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/user_controls.tmpl
    + -  
    1 {% macro user_controls(user, entries) %}
    2     <span class="username">{{ user }}</span>
    3     {% for href, name, title in entries %}
    4         {% if '(' in href %}
    5             {% set action = 'onClick="' ~ href ~ '"' %}
    6         {% else %}
    7             {% set action = 'href="' ~ href ~ '"' %}
    8         {% endif %}
    9         <span class="vbar"></span>
    10         <a title="{{ title }}" class="usercontrol" {{ action }}>{{ name }}</a>
    11     {% endfor %}
    12 {% endmacro %}
  • deleted file sage/server/notebook/templates/worksheet.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/worksheet.html
    + -  
    1 <!-- INPUT:
    2      - worksheet_name - a string containing a worksheet's name
    3      - worksheet_html - a string containing the html for a worksheet
    4   -->
    5 {% extends "base.html" %}
    6 
    7 {% block title %}Sage Worksheet: {{ worksheet_name }}{% endblock %}
    8 
    9 {% block javascript %}
    10 <script type="text/javascript" src="/javascript_local/jquery/jquery.js"></script>
    11 <script type="text/javascript" src="/javascript/main.js"></script>
    12 {% if do_print %}
    13     <script type="text/javascript" src="/javascript_local/jsmath/jsMath.js"></script>
    14 {% endif %}   
    15 {% endblock %}
    16 
    17 {% block body_attrs %}
    18 {% if not do_print %}
    19     class="worksheet-online" onLoad="initialize_the_notebook();"
    20 {% endif %}
    21 {% endblock %}
    22 
    23 {% block body %}
    24 {% if do_print %}
    25     <div class="worksheet_print_title"> {{ worksheet_name }}</div>
    26 {% endif %}
    27 {{ worksheet_html }}
    28 {% if do_print %}
    29     <script type="text/javascript">jsMath.Process();</script>
    30 {% endif %}
    31 {% endblock %}
    32  No newline at end of file
  • deleted file sage/server/notebook/templates/worksheet_body.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/worksheet_body.html
    + -  
    1 <!--
    2 INPUT:
    3 - worksheet - an instance of Worksheet
    4 - notebook - an instance of Notebook which contains worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - worksheet_html - a string containing the html for the worksheet
    7 - username - a string containing a username
    8 - show_debug - a boolean stating whether to show debug information
    9 - top_only - a boolean stating whether to output the top bar only
    10   -->
    11 {% if worksheet.is_published() or notebook.user_is_guest(username) %}
    12     {% set original_worksheet = worksheet.worksheet_that_was_published() %}
    13     {% include "guest_top_bar_and_worksheet.html" %}
    14 {% else %}
    15     {% include "top_bar_and_worksheet.html" %}
    16 {% endif %}
    17 {% if not top_only %} 
    18 {% if not worksheet %}
    19     </td></tr></table></span>
    20 {% endif %}
    21 {% if worksheet.user_is_only_viewer(username) %}
    22     <script type="text/javascript">worksheet_locked=true;</script>
    23 {% else %}
    24     <script type="text/javascript">worksheet_locked=false;</script>
    25 {% endif %}
    26    
    27 {% if worksheet.computing() %}
    28     <!-- Set the update checking back in motion. -->
    29     <script type="text/javascript">
    30         active_cell_list = {{ worksheet.queue_id_list() }};
    31         for(var i = 0; i < active_cell_list.length; i++) {
    32             cell_set_running(active_cell_list[i]);
    33         }
    34         start_update_check();
    35     </script>
    36 {% endif %}
    37 {% endif %}
    38  No newline at end of file
  • deleted file sage/server/notebook/templates/worksheet_page_template.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/worksheet_page_template.html
    + -  
    1 {% extends "base.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - title - a string
    8 - select    - a string containing the control that is selected
    9 - backwards - a boolean
    10 - JSMATH - a boolean stating whether to include jsMath
    11 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    12 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    13 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    14 -->
    15 
    16 {% if not select %}
    17     {% set select = none %}
    18 {% endif %}
    19 
    20 {% if not backwards %}
    21     {% set backwards = false %}
    22 {% endif %}
    23    
    24 {% include "head.tmpl" %}
    25 {% include "worksheet_top.tmpl" %}
    26 {% include "worksheet_topbar.tmpl" %}
    27 
    28 {% block title %}
    29 {{ common_title(worksheet_filename, worksheet) }}
    30 {% endblock %}
    31    
    32 {% block css %}
    33 main
    34 {% endblock %}
    35 
    36 {% block javascript %}
    37 {{ common_javascript(worksheet, worksheet_filename, username, JSMATH, JSMATH_IMAGE_FONTS, JEDITABLE_TINYMCE, sage_jsmath_macros) }}
    38 {% endblock %}
    39 
    40 {% block body %}
    41 {{ worksheet_top(username) }}
    42 {{ worksheet_topbar(worksheet, select, username, backwards) }}
    43 <hr class="usercontrol" />
    44 {% block before_sharebar %}{% endblock %}
    45 <span class="sharebar">{{ title }}</span>
    46 <br /><br /><br />
    47 {% block body_addition %}{% endblock %}
    48 {% endblock %}
    49 
  • deleted file sage/server/notebook/templates/worksheet_revision_list.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/worksheet_revision_list.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - data - a list of pairs of the form ('how long ago', key)
    5 - worksheet - an instance of Worksheet
    6 - worksheet_filename - a string containing a worksheet's filename
    7 - username - a string containing a username
    8 - JSMATH - a boolean stating whether to include jsMath
    9 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    10 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    11 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    12   -->
    13 
    14 
    15 {% set title  = "Revision History" %}
    16 {% set select = "revisions" %}
    17 
    18 {% block body_addition %}
    19 <hr class="usercontrol">
    20 <table width="100%%">
    21     <tr>
    22         <td width="1%%"></td>
    23         <td width="20%%"><b>Revision</b></td>
    24         <td width="20%%"><b>Last Edited</b></td>
    25         <td width="30%%"></td>
    26     </tr>
    27 {% for desc, key in data|reverse %}
    28     <tr>
    29         <td></td>
    30         <td><a href="revisions?rev={{ key }}">Revision {{ loop.revindex0 }}</a></td>
    31         <td><span class="revs">{{ desc }}</span></td>
    32     </tr>
    33 {% endfor %}
    34 </table>
    35 {% endblock %}
    36  No newline at end of file
  • deleted file sage/server/notebook/templates/worksheet_settings.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/worksheet_settings.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3 INPUT:
    4 - worksheet - an instance of Worksheet
    5 - worksheet_filename - a string containing a worksheet's filename
    6 - username - a string containing a username
    7 - JSMATH - a boolean stating whether to include jsMath
    8 - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    9 - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    10 - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    11 -->
    12 
    13 {% set title = 'Worksheet Settings &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button name="button_save">Save Settings</button>  <input type="submit" value="Cancel" name="button_cancel"/>' %}
    14 
    15 {% block before_sharebar %}
    16 <form width=70%% method="post" action="input_settings"  enctype="multipart/form-data">
    17 {% endblock %}
    18 {% block body_addition %}
    19 </form>
    20 {% endblock %}
    21 
    22 
    23 
  • deleted file sage/server/notebook/templates/worksheet_share.html

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/worksheet_share.html
    + -  
    1 {% extends "worksheet_page_template.html" %}
    2 <!--
    3     INPUT:
    4     - worksheet - an instance of Worksheet
    5     - worksheet_filename - a string containing a worksheet's filename
    6     - username - a string containing a username
    7     - other_users - a list of strings containing other users names
    8     - user_is_admin - a boolean stating whether the user is an admin
    9     - JSMATH - a boolean stating whether to include jsMath
    10     - JSMATH_IMAGE_FONTS - a boolean stating whether to include jsMath iamage fonts
    11     - JEDITABLE_TINYMCE - a boolean stating whether to include jEditable and TinyMCE
    12     - sage_jsmath_macros - an array containing strings of Javascript of Sage macros for jsMath
    13 -->
    14 
    15 {% set title = "Share this document" %}
    16 {% set select = "share" %}
    17 
    18 {% block body_addition %}
    19 {% if not (user_is_admin or username == worksheet.owner()) %}
    20     Only the owner of a worksheet is allowed to share it. You can do whatever you want if you <a href="copy">make your own copy</a>.
    21 {% else %}
    22 <p>This Sage Worksheet is currently shared with the people listed in the box below.</p>
    23 <p style="margin-bottom:1em">You may add or remove collaborators (separate user names by commas).</p>
    24 
    25 <form width=70% method="post" action="invite_collab" style="margin-bottom:1em">
    26     <textarea name="collaborators" rows=5 cols=70 class="edit" id="collaborators" style="display:block; margin-bottom:1em;">{{ worksheet.collaborators()|join(', ') }}</textarea>
    27     <input type="submit" title="Give access to your worksheet to the above collaborators" value="Invite Collaborators" />
    28 </form>
    29 
    30 <hr class="usercontrol" />
    31 <span class="username">Sage Users:</span>
    32 <span class="users">
    33     {{ other_users|join(', ') }}
    34 </span>
    35 {% endif %}
    36 {% endblock %}
  • deleted file sage/server/notebook/templates/worksheet_top.tmpl

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/worksheet_top.tmpl
    + -  
    1 <!--
    2 INPUT:
    3 - username - a string containing a username
    4 -->
    5 
    6 {% macro worksheet_top(username) %}
    7 {% include "user_controls.tmpl" %}
    8 {% include "worksheet_topbar.tmpl" %}
    9 {% set entries = [("$('#topbar').toggle()", 'Toggle', 'Toggle the top bar'),
    10                        ('/', 'Home', 'Back to your personal worksheet list'),
    11                        ('/pub', 'Published', 'Browse the published worksheets'),
    12                        ('history_window()', 'Log', 'View a log of recent computations'),
    13                        ('/settings', 'Settings', 'Account Settings'),
    14                        ('bugreport()', 'Report a Problem', 'Report a problem or submit a bug to improve Sage'),
    15                        ('help()', 'Help', 'Documentation'),
    16                        ('/logout', 'Sign out', 'Log out of the Sage notebook')] %}
    17 <table width="100%">
    18     <tr>
    19         <td>{% include "banner.html" %}</td>
    20         <td align="right">{{ user_controls(username, entries) }}</td>
    21     </tr>
    22 </table>
    23 {% endmacro %}
  • deleted file sage/server/notebook/templates/worksheet_topbar.tmpl

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/templates/worksheet_topbar.tmpl
    + -  
    1 <!--
    2 INPUT:
    3 - worksheet - an instance of Worksheet
    4 - select    - a string containing the control that is selected
    5 - username  - a string containing a username
    6 - backwards - a boolean
    7   -->
    8 {% macro worksheet_topbar(worksheet, select=None, username='guest', backwards=false) %}
    9     <table width="100%%" id="topbar">
    10         <tr>
    11             <td align="left"> {{ worksheet.html_title(username) }} </td>
    12             <td align="right"> {{ worksheet.html_save_discard_buttons() }} </td>
    13         </tr>
    14         <tr>
    15             <td align="left"> {{ worksheet.html_menu() }} </td>
    16             <td align="right"> {{ worksheet.html_share_publish_buttons(select, backwards) }}</td>
    17         </tr>
    18     </table>
    19 {% endmacro %}
  • sage/server/notebook/twist.py

    diff -r fda4a0043658 -r 77967c966845 sage/server/notebook/twist.py
    a b  
    191191        s = notebook.html(worksheet_filename = W.filename(),
    192192                          username = self.username)
    193193
    194         # FIXME: Hack to add in the needed CSS to get it to display nicely
    195         css_tag = lambda path: r'<link type="text/css" rel="stylesheet" href="%s" media="screen" />'%path
    196         main_css = css_tag('/css/main.css')
    197         s = s.replace(main_css,css_tag('_static/default.css')+"\n"+main_css )
    198 
    199194        return HTMLResponse(stream=s)
    200195       
    201196    def childFactory(self, request, name):