[PATCH v2] codemirror: fix model when using proxy prefix issue #160

Mads Kiilerich mads at kiilerich.com
Fri Sep 18 20:07:28 UTC 2015


On 09/18/2015 08:12 PM, Christian Oyarzun wrote:
> # HG changeset patch
> # User Christian Oyarzun <oyarzun at gmail.com <mailto:oyarzun at gmail.com>>
> # 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20150918/060e94cc/attachment.html>


More information about the kallithea-general mailing list