<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 1442522796 14400</div><div>#      Thu Sep 17 16:46:36 2015 -0400</div><div># Node ID b10f6c0a01fce20452947caf45d661a4ed101ce5</div><div># Parent  889ff0f436c8b57f5962e204e699cbabc6d33aac</div><div>codemirror: fix model when using proxy prefix issue #160</div><div><br></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>@@ -896,14 +896,14 @@</div><div> };</div><div> </div><div> </div><div>-var initCodeMirror = function(textarea_id, resetUrl){</div><div>+var initCodeMirror = function(textarea_id, baseUrl, resetUrl){</div><div>     var myCodeMirror = CodeMirror.fromTextArea($('#' + textarea_id)[0], {</div><div>             mode: "null",</div><div>             lineNumbers: true,</div><div>             indentUnit: 4,</div><div>             autofocus: true</div><div>         });</div><div>-    CodeMirror.modeURL = "/codemirror/mode/%N/%N.js";</div><div>+    CodeMirror.modeURL = baseUrl + "/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,7 +81,7 @@</div><div> </div><div>                 ## dynamic edit box.</div><div>                 <script type="text/javascript"></div><div>-                var myCodeMirror = initCodeMirror("editor_${h.FID('f',file.path)}", '');</div><div>+                var myCodeMirror = initCodeMirror("editor_${h.FID('f',file.path)}","${h.url('')}",'');</div><div> </div><div>                 //inject new modes</div><div>                 var $modes_select = $('#mimetype_${h.FID('f',file.path)}');</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,7 +59,7 @@</div><div>             </div></div><div>           ${h.end_form()}</div><div>           <script type="text/javascript"></div><div>-            var myCodeMirror = initCodeMirror('editor', '');</div><div>+            var myCodeMirror = initCodeMirror('editor',"${h.url('')}",'');</div><div> </div><div>             //inject new modes</div><div>             var $modes_select = $('#mimetype');</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,7 +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>-            var myCodeMirror = initCodeMirror('editor',reset_url);</div><div>+            var myCodeMirror = initCodeMirror('editor',"${h.url('')}",reset_url);</div><div> </div><div>             //inject new modes, based on codeMirrors modeInfo object</div><div>             $('#set_mode').each(function(){</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,7 +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>-    var myCodeMirror = initCodeMirror('editor',reset_url);</div><div>+    var myCodeMirror = initCodeMirror('editor',"${h.url('')}",reset_url);</div><div> </div><div>    //inject new modes, based on codeMirrors modeInfo object</div><div>     $('#set_mode').each(function(){</div><div><br></div></div>