On 09/18/2015 08:12 PM, Christian Oyarzun wrote:
# HG changeset patch
# User Christian Oyarzun <[email protected] <mailto:[email protected]>>
# Date 1442599888 14400
#      Fri Sep 18 14:11:28 2015 -0400
# Node ID 3033e182787ede6bda4a6ad87e9795dbd2e82a2f
# Parent  889ff0f436c8b57f5962e204e699cbabc6d33aac
codemirror: fix model when using proxy prefix issue #160

diff --git a/kallithea/config/routing.py b/kallithea/config/routing.py
--- a/kallithea/config/routing.py
+++ b/kallithea/config/routing.py
@@ -99,6 +99,7 @@
 #==========================================================================
     #MAIN PAGE
+    rmap.connect('static_files', '/', _static=True)

Why does _static mean here? Why is it needed for this but not for others?

     rmap.connect('home', '/', controller='home', action='index')
     rmap.connect('about', '/about', controller='home', action='about')
     rmap.connect('repo_switcher_data', '/_repos', controller='home',
diff --git a/kallithea/public/js/base.js b/kallithea/public/js/base.js
--- a/kallithea/public/js/base.js
+++ b/kallithea/public/js/base.js
@@ -903,7 +903,7 @@
             indentUnit: 4,
             autofocus: true
         });
-    CodeMirror.modeURL = "/codemirror/mode/%N/%N.js";
+ CodeMirror.modeURL = pyroutes.url('static_files') + "codemirror/mode/%N/%N.js";
     $('#reset').click(function(e){
             window.location=resetUrl;
diff --git a/kallithea/templates/admin/gists/edit.html b/kallithea/templates/admin/gists/edit.html
--- a/kallithea/templates/admin/gists/edit.html
+++ b/kallithea/templates/admin/gists/edit.html
@@ -81,6 +81,7 @@
                 ## dynamic edit box.
                 <script type="text/javascript">
+ pyroutes.register('static_files', "${h.url('static_files')}", []);

Why not put it in root.html with (most) other pyroutes registrations?

/Mads

_______________________________________________
kallithea-general mailing list
[email protected]
http://lists.sfconservancy.org/mailman/listinfo/kallithea-general

Reply via email to