<div dir="ltr"><div># HG changeset patch</div><div># User Christian Oyarzun <<a href="mailto:oyarzun@gmail.com">oyarzun@gmail.com</a>></div><div># Date 1442599888 14400</div><div>#      Fri Sep 18 14:11:28 2015 -0400</div><div># Node ID 3033e182787ede6bda4a6ad87e9795dbd2e82a2f</div><div># Parent  889ff0f436c8b57f5962e204e699cbabc6d33aac</div><div>codemirror: fix model when using proxy prefix issue #160</div><div><br></div><div>diff --git a/kallithea/config/routing.py b/kallithea/config/routing.py</div><div>--- a/kallithea/config/routing.py</div><div>+++ b/kallithea/config/routing.py</div><div>@@ -99,6 +99,7 @@</div><div>     #==========================================================================</div><div> </div><div>     #MAIN PAGE</div><div>+    rmap.connect('static_files', '/', _static=True)</div><div>     rmap.connect('home', '/', controller='home', action='index')</div><div>     rmap.connect('about', '/about', controller='home', action='about')</div><div>     rmap.connect('repo_switcher_data', '/_repos', controller='home',</div><div>diff --git a/kallithea/public/js/base.js b/kallithea/public/js/base.js</div><div>--- a/kallithea/public/js/base.js</div><div>+++ b/kallithea/public/js/base.js</div><div>@@ -903,7 +903,7 @@</div><div>             indentUnit: 4,</div><div>             autofocus: true</div><div>         });</div><div>-    CodeMirror.modeURL = "/codemirror/mode/%N/%N.js";</div><div>+    CodeMirror.modeURL = pyroutes.url('static_files') + "codemirror/mode/%N/%N.js";</div><div> </div><div>     $('#reset').click(function(e){</div><div>             window.location=resetUrl;</div><div>diff --git a/kallithea/templates/admin/gists/edit.html b/kallithea/templates/admin/gists/edit.html</div><div>--- a/kallithea/templates/admin/gists/edit.html</div><div>+++ b/kallithea/templates/admin/gists/edit.html</div><div>@@ -81,6 +81,7 @@</div><div> </div><div>                 ## dynamic edit box.</div><div>                 <script type="text/javascript"></div><div>+                pyroutes.register('static_files', "${h.url('static_files')}", []);</div><div>                 var myCodeMirror = initCodeMirror("editor_${h.FID('f',file.path)}", '');</div><div> </div><div>                 //inject new modes</div><div>diff --git a/kallithea/templates/admin/gists/new.html b/kallithea/templates/admin/gists/new.html</div><div>--- a/kallithea/templates/admin/gists/new.html</div><div>+++ b/kallithea/templates/admin/gists/new.html</div><div>@@ -59,6 +59,7 @@</div><div>             </div></div><div>           ${h.end_form()}</div><div>           <script type="text/javascript"></div><div>+            pyroutes.register('static_files', "${h.url('static_files')}", []);</div><div>             var myCodeMirror = initCodeMirror('editor', '');</div><div> </div><div>             //inject new modes</div><div>diff --git a/kallithea/templates/files/files_add.html b/kallithea/templates/files/files_add.html</div><div>--- a/kallithea/templates/files/files_add.html</div><div>+++ b/kallithea/templates/files/files_add.html</div><div>@@ -67,6 +67,7 @@</div><div>             ${h.end_form()}</div><div>             <script type="text/javascript"></div><div>             var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path)}";</div><div>+            pyroutes.register('static_files', "${h.url('static_files')}", []);</div><div>             var myCodeMirror = initCodeMirror('editor',reset_url);</div><div> </div><div>             //inject new modes, based on codeMirrors modeInfo object</div><div>diff --git a/kallithea/templates/files/files_edit.html b/kallithea/templates/files/files_edit.html</div><div>--- a/kallithea/templates/files/files_edit.html</div><div>+++ b/kallithea/templates/files/files_edit.html</div><div>@@ -75,6 +75,7 @@</div><div> <script type="text/javascript"></div><div> $(document).ready(function(){</div><div>     var reset_url = "${h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.file.path)}";</div><div>+    pyroutes.register('static_files', "${h.url('static_files')}", []);</div><div>     var myCodeMirror = initCodeMirror('editor',reset_url);</div><div> </div><div>    //inject new modes, based on codeMirrors modeInfo object</div><div><br></div></div>