Mercurial > kallithea
changeset 5513:cf21a36ac3bb stable
codemirror: fix modeURL when using proxy prefix (Issue #160)
Modified by Mads to use request.script_name instead of h.url().
author | Christian Oyarzun <oyarzun@gmail.com> |
---|---|
date | Thu, 17 Sep 2015 16:46:36 -0400 |
parents | 8ee17ef21796 |
children | 1eeb3510917e |
files | kallithea/public/js/base.js kallithea/templates/admin/gists/edit.html kallithea/templates/admin/gists/new.html kallithea/templates/files/files_add.html kallithea/templates/files/files_edit.html |
diffstat | 5 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/public/js/base.js Fri Sep 18 13:57:49 2015 +0200 +++ b/kallithea/public/js/base.js Thu Sep 17 16:46:36 2015 -0400 @@ -896,14 +896,14 @@ }; -var initCodeMirror = function(textarea_id, resetUrl){ +var initCodeMirror = function(textarea_id, baseUrl, resetUrl){ var myCodeMirror = CodeMirror.fromTextArea($('#' + textarea_id)[0], { mode: "null", lineNumbers: true, indentUnit: 4, autofocus: true }); - CodeMirror.modeURL = "/codemirror/mode/%N/%N.js"; + CodeMirror.modeURL = baseUrl + "/codemirror/mode/%N/%N.js"; $('#reset').click(function(e){ window.location=resetUrl;
--- a/kallithea/templates/admin/gists/edit.html Fri Sep 18 13:57:49 2015 +0200 +++ b/kallithea/templates/admin/gists/edit.html Thu Sep 17 16:46:36 2015 -0400 @@ -81,7 +81,7 @@ ## dynamic edit box. <script type="text/javascript"> - var myCodeMirror = initCodeMirror("editor_${h.FID('f',file.path)}", ''); + var myCodeMirror = initCodeMirror("editor_${h.FID('f',file.path)}", "${request.script_name}", ''); //inject new modes var $modes_select = $('#mimetype_${h.FID('f',file.path)}');
--- a/kallithea/templates/admin/gists/new.html Fri Sep 18 13:57:49 2015 +0200 +++ b/kallithea/templates/admin/gists/new.html Thu Sep 17 16:46:36 2015 -0400 @@ -59,7 +59,7 @@ </div> ${h.end_form()} <script type="text/javascript"> - var myCodeMirror = initCodeMirror('editor', ''); + var myCodeMirror = initCodeMirror('editor', "${request.script_name}", ''); //inject new modes var $modes_select = $('#mimetype');
--- a/kallithea/templates/files/files_add.html Fri Sep 18 13:57:49 2015 +0200 +++ b/kallithea/templates/files/files_add.html Thu Sep 17 16:46:36 2015 -0400 @@ -67,7 +67,7 @@ ${h.end_form()} <script type="text/javascript"> var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path)}"; - var myCodeMirror = initCodeMirror('editor',reset_url); + var myCodeMirror = initCodeMirror('editor', "${request.script_name}", reset_url); //inject new modes, based on codeMirrors modeInfo object $('#set_mode').each(function(){
--- a/kallithea/templates/files/files_edit.html Fri Sep 18 13:57:49 2015 +0200 +++ b/kallithea/templates/files/files_edit.html Thu Sep 17 16:46:36 2015 -0400 @@ -75,7 +75,7 @@ <script type="text/javascript"> $(document).ready(function(){ var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.file.path)}"; - var myCodeMirror = initCodeMirror('editor',reset_url); + var myCodeMirror = initCodeMirror('editor', "${request.script_name}", reset_url); //inject new modes, based on codeMirrors modeInfo object $('#set_mode').each(function(){