<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>