[sagenb] 108/157: Tweaks to new cell creation

felix salfelder felix-guest at moszumanska.debian.org
Mon Dec 22 16:51:57 UTC 2014


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

felix-guest pushed a commit to branch master
in repository sagenb.

commit 23a90633b5db36d5a3ab6aa8de396282307aedf3
Author: gutow <gutow at uwosh.edu>
Date:   Sun Oct 19 15:47:57 2014 -0500

    Tweaks to new cell creation
    
    Reverted new cell div hover color to old color
    Added   before text of display control checkboxes
    Made add cell work before above rich text cells
    Removed commas that were messing up jquery binding to certain items
---
 sagenb/data/sage/css/main.css                 |  4 +--
 sagenb/data/sage/html/notebook/base.html      |  4 +--
 sagenb/data/sage/html/notebook/text_cell.html | 36 +++++++++++++++++++--------
 sagenb/data/sage/js/master.js                 |  4 +--
 sass/src/main.scss                            |  4 +--
 5 files changed, 34 insertions(+), 18 deletions(-)

diff --git a/sagenb/data/sage/css/main.css b/sagenb/data/sage/css/main.css
index d25c0da..192b8c4 100644
--- a/sagenb/data/sage/css/main.css
+++ b/sagenb/data/sage/css/main.css
@@ -483,9 +483,9 @@ a.file_link { text-decoration: underline; }
 
 /* line 968, ../../../../sass/src/main.scss */
 div.insert_new_cell { height: 16px; display: block; margin: 3px; }
-div.insert_new_cell:hover{background-color:cyan;}
+div.insert_new_cell:hover{background-color:#8888fe;}
 div.legacy_insert_new_cell {height:13px; display:inline-block; width:95%;}
-div.legacy_insert_new_cell:hover{background-color:cyan;}
+div.legacy_insert_new_cell:hover{background-color:#8888fe;}
 
 /* line 974 */
 div.wksht-icon_button {display:inline-block;}
diff --git a/sagenb/data/sage/html/notebook/base.html b/sagenb/data/sage/html/notebook/base.html
index 4333acf..5e4f693 100644
--- a/sagenb/data/sage/html/notebook/base.html
+++ b/sagenb/data/sage/html/notebook/base.html
@@ -143,10 +143,10 @@ INPUT:
                class="worksheet" value="pretty_print" {{ "checked" if worksheet.pretty_print() else "" }} /> {{ gettext('Typeset') }}
         <input id="3D_check", type="checkbox" title="{{ gettext('Load 3-D Live. Not recommended for worksheets with > 2 3-D Plots.') }}"
                onchange="live_3D_check(this.checked);"
-               class="worksheet" value="live_3D" {{ "checked" if worksheet.live_3D() else "" }} /> {{ gettext('Load 3-D Live') }}
+               class="worksheet" value="live_3D" {{ "checked" if worksheet.live_3D() else "" }} /> {{ gettext('Load 3-D Live') }}
         <input id="3D_use_java", type="checkbox" title="{{ gettext('Use java for 3-D. Only applies to this running of worksheet.') }}"
                onchange="3D_use_java_check(this.checked);"
-               class="worksheet" value="3D_use_java"/> {{ gettext('Use java for 3-D') }}
+               class="worksheet" value="3D_use_java"/> {{ gettext('Use java for 3-D') }}
          {% endif %}
     {% endif %} 
     </div>
diff --git a/sagenb/data/sage/html/notebook/text_cell.html b/sagenb/data/sage/html/notebook/text_cell.html
index dffc6bc..682bb63 100644
--- a/sagenb/data/sage/html/notebook/text_cell.html
+++ b/sagenb/data/sage/html/notebook/text_cell.html
@@ -13,16 +13,32 @@ INPUT:
 #}
 <span id="cell_outer_{{ cell.id() }}">
     {% if not do_print and not publish and not cell.worksheet().docbrowser() %}
-    <div class="insert_new_cell" id="insert_new_cell_before{{ cell.id() }}">
-    </div>
-    <script type="text/javascript">
-        $("#insert_new_cell_before{{ cell.id() }}").bind("plainclick",function (e) {
-            insert_new_cell_before({{ '%r'|format(cell.id()) }});
-        });
-        $("#insert_new_cell_before{{ cell.id() }}").bind("shiftclick",function (e) {
-            insert_new_text_cell_before({{ '%r'|format(cell.id()) }});
-        });
-    </script>
+            <div class="insert_new_cell" id="insert_new_cell_before{{ cell.id() }}">
+              <div class="ui-icon ui-icon-circle-plus wksht-icon_button" 
+                id="insert_new_compute_cell_before{{ cell.id() }}" 
+                title="{{ gettext('Click to insert new compute cell.') }}"></div>
+              <div class="ui-icon ui-icon-comment wksht-icon_button" 
+                id="insert_new_text_cell_before{{ cell.id() }}"
+                 title="{{ gettext('Click to insert new rich-text cell.') }}"></div>
+              <div class="legacy_insert_new_cell" id="legacy_new_cell_before{{ cell.id() }}"></div>
+            </div>
+            <script type="text/javascript">
+                {% if not cell.worksheet().docbrowser() %}
+                $("#insert_new_compute_cell_before{{ cell.id() }}").bind("click",function (e) {
+                    insert_new_cell_before({{ '%r'|format(cell.id()) }});
+                });
+                $("#insert_new_text_cell_before{{ cell.id() }}").bind("click",function (e) {
+                   insert_new_text_cell_before({{ '%r'|format(cell.id()) }});
+                });
+                $("#legacy_new_cell_before{{ cell.id() }}").bind("click",function (e) {
+                   if (e.shiftKey){
+                      insert_new_text_cell_before({{ '%r'|format(cell.id()) }});
+                   } else {
+                      insert_new_cell_before({{ '%r'|format(cell.id()) }});
+                   }
+                });
+                {% endif %}
+            </script>
     {% endif %}
     <div class="text_cell" id="cell_text_{{ cell.id() }}">
       {{ cell.plain_text() }}
diff --git a/sagenb/data/sage/js/master.js b/sagenb/data/sage/js/master.js
index 7235f76..b9f7f52 100644
--- a/sagenb/data/sage/js/master.js
+++ b/sagenb/data/sage/js/master.js
@@ -1,4 +1,4 @@
-/*global $, window */
+$/*global $, window */
 /*jslint white: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, strict: true, newcap: true, immed: true */
 //"use strict";
 
@@ -16,7 +16,7 @@ $(function () {
         initialize_the_notebook();
 //'#worksheet_cell_list' why was it function (e) below.
         $(document)
-            .on('click','.introspection, .docstring, .click-message, #worksheet_cell_list', function (e) {
+            .on('click','.introspection .docstring .click-message #worksheet_cell_list', function (e) {
                 var ds_elem = $(this).parent(), style;
 
                 var id = toint(ds_elem.parent().attr('id').slice(15));
diff --git a/sass/src/main.scss b/sass/src/main.scss
index a7380fa..4827d19 100644
--- a/sass/src/main.scss
+++ b/sass/src/main.scss
@@ -971,12 +971,12 @@ div {
     margin: 3px;
   &.wksht-icon_button {
     display:inline-block;}
-    &:hover {background-color:cyan;}
+    &:hover {background-color:#8888fe;}
   &.legacy_insert_new_cell{
     height: 13px;
     width: 95%;
     display: inline-block;
-    &:hover{background-color:cyan;}}
+    &:hover{background-color:#8888fe;}}
 
 a {
   &.worksheetname {

-- 
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