     """
 
     codebar  = $(".salvus-editor-codeedit-buttonbar")
+
+    # -- modes (this isn't really code so weird to put here)
+    system_bar = make_bar("salvus-editor-codeedit-buttonbar-system")
+
+    mode_list = ["Modes", "Sage Worksheet Modes",
+        [
+            ["General"],
+            ["Auto execute cell on startup", "#mode_auto"],
+            ["Hide input (or double click output)", "#mode_hide"],
+            ["Set default mode", "#mode_default_mode"],
+            ["Typeset output", "#mode_typeset"],
+            ["Timing"],
+            ["Benchmark code repeatedly", "#mode_timeit"],
+            ["Time code once", "#mode_time"],
+            ["Language modes"],
+            ["Cython", "#mode_cython"],
+            ["Gap", "#mode_gap"],
+            ["PARI/GP", "#mode_gp"],
+            ["HTML", "#mode_html"],
+            ["Javascript", "#mode_javascript"],
+            ["Julia", "#mode_julia"],
+            ["Markdown", "#mode_md"],
+            ["Python", "#mode_python"],
+            ["R", "#mode_r"],
+        ]]
+    add_menu(system_bar, mode_list)
+
+    help_list = ["<i class='fa fa-question-circle'></i> Help", "Sage Worksheet Help",
+        [
+            ["General help", "#help"],
+            ["Magic mode commands", "#magics"]
+        ]]
+    add_menu(system_bar, help_list)
+    ## MAYBE ADD THESE in another menu:
+    #axiom
+    #capture
+    #coffeescript
+    #command
+    #file
+    #fork
+    #fortran
+    #fricas
+    #gap3
+    #giac
+    #go
+    #hideall
+    #javascript
+    #kash
+    #lie
+    #lisp
+    #load
+    #macaulay2
+    #maxima
+    #octave
+    #pandoc
+    #perl
+    #prun
+    #reset
+    #ruby
+    #runfile
+    #sage0
+    #script
+    #singular
+    #typeset_mode
+    #var
+    #wiki
+    #mode_list = ["More", "More Sage Worksheet Modes",
+    #    [
+    #      ["Axiom", "#mode_axiom"],
+    #      ["Scilab", "#mode_scilab"],
+    #      ["Shell script", "#mode_sh"],
+    #      []
+    #    ]]
+    #add_menu(system_bar, mode_list)
+    codebar.append(system_bar)
+
     # -- python specific --
     pybar    = make_bar("salvus-editor-codeedit-buttonbar-python")
     add_icon(pybar, "<i class='fa'>#</i>", "#comment", "Comment selected text")

    add_menu(sagebar, sage_graphs)
    add_menu(sagebar, sage_nt)
    add_menu(sagebar, sage_rings)
    add_icon(sagebar, "<i class='fa fa-question-circle'></i> Help", "#help", "Help")

    codebar.append(sagebar)


            ["Tuple", "#tuple"],
            ["Properties"],
            ["Length", "#len"]
           ]]
    add_menu(pybar, py_control)

    # structured dropdown menu data: button text, title info, list of ["button, "#id", "title help (optional)"]
