From c91e6160feda360c17797d11124a1ae555605ee3 Mon Sep 17 00:00:00 2001 From: ilvalle Date: Thu, 17 Oct 2013 15:25:12 +0200 Subject: [PATCH] initial editor cleanup and html fix --- applications/admin/models/0.py | 20 ----- .../admin/views/default.mobile/edit.html | 11 +-- .../admin/views/default/amy_ajax.html | 77 ------------------- applications/admin/views/default/edit_js.html | 8 +- .../admin/views/default/editor_settings.html | 27 ++++--- 5 files changed, 21 insertions(+), 122 deletions(-) delete mode 100644 applications/admin/views/default/amy_ajax.html diff --git a/applications/admin/models/0.py b/applications/admin/models/0.py index e91ea5cd..a6cc1940 100644 --- a/applications/admin/models/0.py +++ b/applications/admin/models/0.py @@ -8,26 +8,6 @@ WEB2PY_VERSION_URL = WEB2PY_URL + '/examples/default/version' # the user-interface feature that allows you to edit files in your web # browser. -## Default editor (to change editor you need web2py.admin.editors.zip) -## old editors like 'ace' or 'edit_area' or 'amy' are no longer supported -TEXT_EDITOR = 'codemirror' - -## Editor Color scheme (only for ace) -TEXT_EDITOR_THEME = ( - "chrome", "clouds", "clouds_midnight", "cobalt", "crimson_editor", "dawn", - "dreamweaver", "eclipse", "idle_fingers", "kr_theme", "merbivore", - "merbivore_soft", "monokai", "mono_industrial", "pastel_on_dark", - "solarized_dark", "solarized_light", "textmate", "tomorrow", - "tomorrow_night", "tomorrow_night_blue", "tomorrow_night_bright", - "tomorrow_night_eighties", "twilight", "vibrant_ink")[0] - -## Editor Keyboard bindings (only for ace and codemirror) -TEXT_EDITOR_KEYBINDING = '' # 'emacs' or 'vi' - -### edit_area only -# The default font size, measured in 'points'. The value must be an integer > 0 -FONT_SIZE = 10 - # Displays the editor in full screen mode. The value must be 'true' or 'false' FULL_SCREEN = 'false' diff --git a/applications/admin/views/default.mobile/edit.html b/applications/admin/views/default.mobile/edit.html index c31bb0f9..58e5eeb0 100644 --- a/applications/admin/views/default.mobile/edit.html +++ b/applications/admin/views/default.mobile/edit.html @@ -5,11 +5,8 @@ return XML('
  • %s %s
  • ' % (combo, description)) }} -{{if TEXT_EDITOR == 'amy':}} -{{include 'default/amy_ajax.html'}} -{{else:}} -{{pass}} + {{block sectionclass}}edit {{filename}}{{end}} @@ -41,11 +38,7 @@ jQuery(document).ready(function(){ {{=T('Saved file hash:')}} {{=T('Last saved on:')}} - {{if TEXT_EDITOR=='amy':}} - - {{else:}} - {{pass}}
    diff --git a/applications/admin/views/default/amy_ajax.html b/applications/admin/views/default/amy_ajax.html deleted file mode 100644 index 718d27ed..00000000 --- a/applications/admin/views/default/amy_ajax.html +++ /dev/null @@ -1,77 +0,0 @@ - - - -{{if request.args[1]=="views":}} - -{{else:}} - -{{pass}} - - - - diff --git a/applications/admin/views/default/edit_js.html b/applications/admin/views/default/edit_js.html index 3239d930..7562d108 100644 --- a/applications/admin/views/default/edit_js.html +++ b/applications/admin/views/default/edit_js.html @@ -137,7 +137,7 @@
    - {{if TEXT_EDITOR == 'codemirror' and filetype=='html':}} + {{if filetype=='html':}}

    {{=T('Key bindings for ZenCoding Plugin')}}

      {{=shortcut('Ctrl+S', T('Save via Ajax'))}} @@ -150,15 +150,15 @@ {{=shortcut('Shift-Ctrl-R / Shift-Cmd-Option-F', T('Replace All'))}} {{=shortcut('Tab', T('Expand Abbreviation'))}}
    - {{elif TEXT_EDITOR == 'codemirror':}} + {{else:}}

    {{=T("Key bindings")}}

      {{=shortcut('Ctrl+S', T('Save via Ajax'))}} {{=shortcut('Ctrl+F11', T('Toggle Fullscreen'))}} {{=shortcut('Shift+Esc', T('Exit Fullscreen'))}} {{if filetype=='python':}} - {{=shortcut('Ctrl-Space', T('Autocomplete Python Code'))}} - {{pass}} + {{=shortcut('Ctrl-Space', T('Autocomplete Python Code'))}} + {{pass}} {{=shortcut('Ctrl-F / Cmd-F', T('Start searching'))}} {{=shortcut('Ctrl-G / Cmd-G', T('Find Next'))}} {{=shortcut('Shift-Ctrl-G / Shift-Cmd-G', T('Find Previous'))}} diff --git a/applications/admin/views/default/editor_settings.html b/applications/admin/views/default/editor_settings.html index 3dda4bbe..7f35fd87 100644 --- a/applications/admin/views/default/editor_settings.html +++ b/applications/admin/views/default/editor_settings.html @@ -9,18 +9,21 @@ {{editors = ['default', 'vim', 'emacs']}} {{closetag = ['true', 'false']}}
      -
      - -
      {{=SELECT(themes, value=editor_settings['theme'], _name="theme" )}}
      - -
      {{=SELECT(editors, value=editor_settings['editor'], _name="editor" )}}
      - -
      {{=SELECT(closetag, value=editor_settings['closetag'], _name="closetag" )}}
      -
      -
      -
      -
      - +
      + +
      {{=SELECT(themes, value=editor_settings['theme'], _name="theme" )}}
      +
      +
      + +
      {{=SELECT(editors, value=editor_settings['editor'], _name="editor" )}}
      +
      +
      + +
      {{=SELECT(closetag, value=editor_settings['closetag'], _name="closetag" )}}
      +
      +
      +
      +