Changeset - b4d77d1c710c
[Not reviewed]
default
! ! !
Mads Kiilerich - 11 years ago 2014-09-24 14:24:40
madski@unity3d.com
codemirror: move everything to separate codemirror folder - splitting it up in css and js serves no purpose

- but it should perhaps not show up directly in /codemirror ...
173 files changed with 23 insertions and 22 deletions:
0 comments (0 inline, 0 general)
LICENSE.md
Show inline comments
 
Kallithea License
 
=================
 

	
 
Kallithea as a whole is copyrighted by various authors and is licensed under
 
the terms of the GNU General Public License, version 3 (GPLv3), which is a
 
license published by the Free Software Foundation,
 
Inc. [A copy of GPLv3](/COPYING) is included herein.
 

	
 
Some individual files have copyright notices and those who offer changes to
 
those files should update the copyright notices in those specific files if
 
they so chose.
 

	
 
However, the definitive list of copyright holders for this project is kept in
 
[the about page template](kallithea/templates/about.html) so that it is
 
displayed appropriately when Kallithea is installed.  This is the most
 
important place to update copyright notices. 
 

	
 
Third-Party Code Incorporated in Kallithea
 
==========================================
 

	
 
Various third-party code under GPLv3-compatible licenses is included as part
 
of Kallithea.
 

	
 

	
 

	
 
Bootstrap
 
---------
 

	
 
Kallithea incorporates parts of the Javascript system called
 
[Bootstrap](http://getbootstrap.com/), which is:
 

	
 
Copyright © 2012 Twitter, Inc.
 

	
 
and licensed under
 
[the Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
 

	
 
A copy of the Apache License 2.0 is also included in this distribution in its
 
entirety in the file Apache-License-2.0.txt
 

	
 

	
 

	
 
Codemirror
 
----------
 

	
 
Kallithea incorporates parts of the Javascript system called
 
[Codemirror](http://codemirror.net/), which is primarily:
 

	
 
Copyright &copy; 2013 by Marijn Haverbeke <marijnh@gmail.com>
 

	
 
and licensed under the MIT-permissive license, which is
 
[included in this distribution](MIT-Permissive-License.txt).
 

	
 
Additional files from upstream Codemirror are copyrighted by various authors
 
and licensed under other permissive licenses.  The sub-directories under
 
[.../public/js/mode/](kallithea/public/js/mode) include the copyright and
 
[.../public/codemirror](kallithea/public/codemirror) include the copyright and
 
license notice and information as they appeared in Codemirror's upstream
 
release.
 

	
 

	
 

	
 
jQuery
 
------
 

	
 
Kallithea incorporates the Javascript system called
 
[jQuery](http://jquery.org/),
 
[herein](kallithea/public/js/jquery-1.10.2.min.js), and the Corresponding
 
Source can be found in https://github.com/jquery/jquery at tag 1.10.2
 
(mirrored at https://kallithea-scm.org/repos/mirror/jquery/files/1.10.2/ ).
 

	
 
It is Copyright 2013 jQuery Foundation and other contributors http://jquery.com/ and is under an
 
[MIT-permissive license](MIT-Permissive-License.txt).
 

	
 

	
 

	
 
Mousetrap
 
---------
 

	
 
Kallithea incorporates parts of the Javascript system called
 
[Mousetrap](http://craig.is/killing/mice/), which is:
 

	
 
   Copyright 2013 Craig Campbell
 

	
 
and licensed under
 
[the Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).
 

	
 
A [copy of the Apache License 2.0](Apache-License-2.0.txt) is also included
 
in this distribution.
 

	
 

	
 

	
 
Mergely
 
-------
 

	
 
Kallithea incorporates some code from the Javascript system called
 
[Mergely](http://http://www.mergely.com/).
 
[Mergely's license](http://www.mergely.com/license.php), a
 
[copy of which is included in this repository](LICENSE-MERGELY.html),
 
is (GPL|LGPL|MPL).  Kallithea as GPLv3'd project chooses the GPL arm of that
 
tri-license.
 

	
 

	
 

	
 
Select2
 
-------
 

	
 
Kallithea incorporates parts of the Javascript system called
 
[Select2](http://ivaynberg.github.io/select2/), which is:
 

	
 
Copyright 2012 Igor Vaynberg (and probably others)
 

	
 
and is licensed [under the following license](https://github.com/ivaynberg/select2/blob/master/LICENSE):
 

	
 
> This software is licensed under the Apache License, Version 2.0 (the
 
> "Apache License") or the GNU General Public License version 2 (the "GPL
 
> License"). You may choose either license to govern your use of this
 
> software only upon the condition that you accept all of the terms of either
 
> the Apache License or the GPL License.
 

	
 
A [copy of the Apache License 2.0](Apache-License-2.0.txt) is also included
 
in this distribution.
 

	
 
Kallithea will take the Apache license fork of the dual license, since
 
Kallithea is GPLv3'd.
 

	
 

	
 

	
 
Select2-Bootstrap-CSS
 
---------------------
 

	
 
Kallithea incorporates some CSS from a system called
 
[Select2-bootstrap-css](https://github.com/t0m/select2-bootstrap-css), which
 
is:
 

	
 
Copyright &copy; 2013 Tom Terrace (and likely others)
 

	
 
and licensed under the MIT-permissive license, which is
 
[included in this distribution](MIT-Permissive-License.txt).
 

	
 

	
 

	
 
History.js
 
----------
 

	
 
Kallithea incorporates some CSS from a system called History.js, which is
 

	
 
Copyright 2010-2011 Benjamin Arthur Lupton <contact@balupton.com>
 

	
 
Redistribution and use in source and binary forms, with or without
 
modification, are permitted provided that the following conditions are met:
 

	
 
1. Redistributions of source code must retain the above copyright notice,
kallithea/public/codemirror/lib/codemirror.css
Show inline comments
 
file renamed from kallithea/public/css/codemirror.css to kallithea/public/codemirror/lib/codemirror.css
kallithea/public/codemirror/lib/codemirror.js
Show inline comments
 
file renamed from kallithea/public/js/codemirror.js to kallithea/public/codemirror/lib/codemirror.js
kallithea/public/codemirror/mode/apl/apl.js
Show inline comments
 
file renamed from kallithea/public/js/mode/apl/apl.js to kallithea/public/codemirror/mode/apl/apl.js
kallithea/public/codemirror/mode/apl/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/apl/index.html to kallithea/public/codemirror/mode/apl/index.html
kallithea/public/codemirror/mode/asterisk/asterisk.js
Show inline comments
 
file renamed from kallithea/public/js/mode/asterisk/asterisk.js to kallithea/public/codemirror/mode/asterisk/asterisk.js
kallithea/public/codemirror/mode/asterisk/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/asterisk/index.html to kallithea/public/codemirror/mode/asterisk/index.html
kallithea/public/codemirror/mode/clike/clike.js
Show inline comments
 
file renamed from kallithea/public/js/mode/clike/clike.js to kallithea/public/codemirror/mode/clike/clike.js
kallithea/public/codemirror/mode/clike/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/clike/index.html to kallithea/public/codemirror/mode/clike/index.html
kallithea/public/codemirror/mode/clike/scala.html
Show inline comments
 
file renamed from kallithea/public/js/mode/clike/scala.html to kallithea/public/codemirror/mode/clike/scala.html
kallithea/public/codemirror/mode/clojure/clojure.js
Show inline comments
 
file renamed from kallithea/public/js/mode/clojure/clojure.js to kallithea/public/codemirror/mode/clojure/clojure.js
kallithea/public/codemirror/mode/clojure/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/clojure/index.html to kallithea/public/codemirror/mode/clojure/index.html
kallithea/public/codemirror/mode/cobol/cobol.js
Show inline comments
 
file renamed from kallithea/public/js/mode/cobol/cobol.js to kallithea/public/codemirror/mode/cobol/cobol.js
kallithea/public/codemirror/mode/cobol/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/cobol/index.html to kallithea/public/codemirror/mode/cobol/index.html
kallithea/public/codemirror/mode/coffeescript/LICENSE
Show inline comments
 
file renamed from kallithea/public/js/mode/coffeescript/LICENSE to kallithea/public/codemirror/mode/coffeescript/LICENSE
kallithea/public/codemirror/mode/coffeescript/coffeescript.js
Show inline comments
 
file renamed from kallithea/public/js/mode/coffeescript/coffeescript.js to kallithea/public/codemirror/mode/coffeescript/coffeescript.js
kallithea/public/codemirror/mode/coffeescript/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/coffeescript/index.html to kallithea/public/codemirror/mode/coffeescript/index.html
kallithea/public/codemirror/mode/commonlisp/commonlisp.js
Show inline comments
 
file renamed from kallithea/public/js/mode/commonlisp/commonlisp.js to kallithea/public/codemirror/mode/commonlisp/commonlisp.js
kallithea/public/codemirror/mode/commonlisp/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/commonlisp/index.html to kallithea/public/codemirror/mode/commonlisp/index.html
kallithea/public/codemirror/mode/css/css.js
Show inline comments
 
file renamed from kallithea/public/js/mode/css/css.js to kallithea/public/codemirror/mode/css/css.js
kallithea/public/codemirror/mode/css/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/css/index.html to kallithea/public/codemirror/mode/css/index.html
kallithea/public/codemirror/mode/css/scss.html
Show inline comments
 
file renamed from kallithea/public/js/mode/css/scss.html to kallithea/public/codemirror/mode/css/scss.html
kallithea/public/codemirror/mode/css/scss_test.js
Show inline comments
 
file renamed from kallithea/public/js/mode/css/scss_test.js to kallithea/public/codemirror/mode/css/scss_test.js
kallithea/public/codemirror/mode/css/test.js
Show inline comments
 
file renamed from kallithea/public/js/mode/css/test.js to kallithea/public/codemirror/mode/css/test.js
kallithea/public/codemirror/mode/d/d.js
Show inline comments
 
file renamed from kallithea/public/js/mode/d/d.js to kallithea/public/codemirror/mode/d/d.js
kallithea/public/codemirror/mode/d/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/d/index.html to kallithea/public/codemirror/mode/d/index.html
kallithea/public/codemirror/mode/diff/diff.js
Show inline comments
 
file renamed from kallithea/public/js/mode/diff/diff.js to kallithea/public/codemirror/mode/diff/diff.js
kallithea/public/codemirror/mode/diff/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/diff/index.html to kallithea/public/codemirror/mode/diff/index.html
kallithea/public/codemirror/mode/ecl/ecl.js
Show inline comments
 
file renamed from kallithea/public/js/mode/ecl/ecl.js to kallithea/public/codemirror/mode/ecl/ecl.js
kallithea/public/codemirror/mode/ecl/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/ecl/index.html to kallithea/public/codemirror/mode/ecl/index.html
kallithea/public/codemirror/mode/erlang/erlang.js
Show inline comments
 
file renamed from kallithea/public/js/mode/erlang/erlang.js to kallithea/public/codemirror/mode/erlang/erlang.js
kallithea/public/codemirror/mode/erlang/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/erlang/index.html to kallithea/public/codemirror/mode/erlang/index.html
kallithea/public/codemirror/mode/gas/gas.js
Show inline comments
 
file renamed from kallithea/public/js/mode/gas/gas.js to kallithea/public/codemirror/mode/gas/gas.js
kallithea/public/codemirror/mode/gas/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/gas/index.html to kallithea/public/codemirror/mode/gas/index.html
kallithea/public/codemirror/mode/gfm/gfm.js
Show inline comments
 
file renamed from kallithea/public/js/mode/gfm/gfm.js to kallithea/public/codemirror/mode/gfm/gfm.js
kallithea/public/codemirror/mode/gfm/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/gfm/index.html to kallithea/public/codemirror/mode/gfm/index.html
kallithea/public/codemirror/mode/gfm/test.js
Show inline comments
 
file renamed from kallithea/public/js/mode/gfm/test.js to kallithea/public/codemirror/mode/gfm/test.js
kallithea/public/codemirror/mode/go/go.js
Show inline comments
 
file renamed from kallithea/public/js/mode/go/go.js to kallithea/public/codemirror/mode/go/go.js
kallithea/public/codemirror/mode/go/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/go/index.html to kallithea/public/codemirror/mode/go/index.html
kallithea/public/codemirror/mode/groovy/groovy.js
Show inline comments
 
file renamed from kallithea/public/js/mode/groovy/groovy.js to kallithea/public/codemirror/mode/groovy/groovy.js
kallithea/public/codemirror/mode/groovy/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/groovy/index.html to kallithea/public/codemirror/mode/groovy/index.html
kallithea/public/codemirror/mode/haml/haml.js
Show inline comments
 
file renamed from kallithea/public/js/mode/haml/haml.js to kallithea/public/codemirror/mode/haml/haml.js
kallithea/public/codemirror/mode/haml/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/haml/index.html to kallithea/public/codemirror/mode/haml/index.html
kallithea/public/codemirror/mode/haml/test.js
Show inline comments
 
file renamed from kallithea/public/js/mode/haml/test.js to kallithea/public/codemirror/mode/haml/test.js
kallithea/public/codemirror/mode/haskell/haskell.js
Show inline comments
 
file renamed from kallithea/public/js/mode/haskell/haskell.js to kallithea/public/codemirror/mode/haskell/haskell.js
kallithea/public/codemirror/mode/haskell/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/haskell/index.html to kallithea/public/codemirror/mode/haskell/index.html
kallithea/public/codemirror/mode/haxe/haxe.js
Show inline comments
 
file renamed from kallithea/public/js/mode/haxe/haxe.js to kallithea/public/codemirror/mode/haxe/haxe.js
kallithea/public/codemirror/mode/haxe/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/haxe/index.html to kallithea/public/codemirror/mode/haxe/index.html
kallithea/public/codemirror/mode/htmlembedded/htmlembedded.js
Show inline comments
 
file renamed from kallithea/public/js/mode/htmlembedded/htmlembedded.js to kallithea/public/codemirror/mode/htmlembedded/htmlembedded.js
kallithea/public/codemirror/mode/htmlembedded/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/htmlembedded/index.html to kallithea/public/codemirror/mode/htmlembedded/index.html
kallithea/public/codemirror/mode/htmlmixed/htmlmixed.js
Show inline comments
 
file renamed from kallithea/public/js/mode/htmlmixed/htmlmixed.js to kallithea/public/codemirror/mode/htmlmixed/htmlmixed.js
kallithea/public/codemirror/mode/htmlmixed/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/htmlmixed/index.html to kallithea/public/codemirror/mode/htmlmixed/index.html
kallithea/public/codemirror/mode/http/http.js
Show inline comments
 
file renamed from kallithea/public/js/mode/http/http.js to kallithea/public/codemirror/mode/http/http.js
kallithea/public/codemirror/mode/http/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/http/index.html to kallithea/public/codemirror/mode/http/index.html
kallithea/public/codemirror/mode/jade/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/jade/index.html to kallithea/public/codemirror/mode/jade/index.html
kallithea/public/codemirror/mode/jade/jade.js
Show inline comments
 
file renamed from kallithea/public/js/mode/jade/jade.js to kallithea/public/codemirror/mode/jade/jade.js
kallithea/public/codemirror/mode/javascript/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/javascript/index.html to kallithea/public/codemirror/mode/javascript/index.html
kallithea/public/codemirror/mode/javascript/javascript.js
Show inline comments
 
file renamed from kallithea/public/js/mode/javascript/javascript.js to kallithea/public/codemirror/mode/javascript/javascript.js
kallithea/public/codemirror/mode/javascript/test.js
Show inline comments
 
file renamed from kallithea/public/js/mode/javascript/test.js to kallithea/public/codemirror/mode/javascript/test.js
kallithea/public/codemirror/mode/javascript/typescript.html
Show inline comments
 
file renamed from kallithea/public/js/mode/javascript/typescript.html to kallithea/public/codemirror/mode/javascript/typescript.html
kallithea/public/codemirror/mode/jinja2/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/jinja2/index.html to kallithea/public/codemirror/mode/jinja2/index.html
kallithea/public/codemirror/mode/jinja2/jinja2.js
Show inline comments
 
file renamed from kallithea/public/js/mode/jinja2/jinja2.js to kallithea/public/codemirror/mode/jinja2/jinja2.js
kallithea/public/codemirror/mode/less/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/less/index.html to kallithea/public/codemirror/mode/less/index.html
kallithea/public/codemirror/mode/less/less.js
Show inline comments
 
file renamed from kallithea/public/js/mode/less/less.js to kallithea/public/codemirror/mode/less/less.js
kallithea/public/codemirror/mode/livescript/LICENSE
Show inline comments
 
file renamed from kallithea/public/js/mode/livescript/LICENSE to kallithea/public/codemirror/mode/livescript/LICENSE
kallithea/public/codemirror/mode/livescript/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/livescript/index.html to kallithea/public/codemirror/mode/livescript/index.html
kallithea/public/codemirror/mode/livescript/livescript.js
Show inline comments
 
file renamed from kallithea/public/js/mode/livescript/livescript.js to kallithea/public/codemirror/mode/livescript/livescript.js
kallithea/public/codemirror/mode/livescript/livescript.ls
Show inline comments
 
file renamed from kallithea/public/js/mode/livescript/livescript.ls to kallithea/public/codemirror/mode/livescript/livescript.ls
kallithea/public/codemirror/mode/lua/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/lua/index.html to kallithea/public/codemirror/mode/lua/index.html
kallithea/public/codemirror/mode/lua/lua.js
Show inline comments
 
file renamed from kallithea/public/js/mode/lua/lua.js to kallithea/public/codemirror/mode/lua/lua.js
kallithea/public/codemirror/mode/markdown/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/markdown/index.html to kallithea/public/codemirror/mode/markdown/index.html
kallithea/public/codemirror/mode/markdown/markdown.js
Show inline comments
 
file renamed from kallithea/public/js/mode/markdown/markdown.js to kallithea/public/codemirror/mode/markdown/markdown.js
kallithea/public/codemirror/mode/markdown/test.js
Show inline comments
 
file renamed from kallithea/public/js/mode/markdown/test.js to kallithea/public/codemirror/mode/markdown/test.js
kallithea/public/codemirror/mode/meta.js
Show inline comments
 
file renamed from kallithea/public/js/mode/meta.js to kallithea/public/codemirror/mode/meta.js
kallithea/public/codemirror/mode/mirc/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/mirc/index.html to kallithea/public/codemirror/mode/mirc/index.html
kallithea/public/codemirror/mode/mirc/mirc.js
Show inline comments
 
file renamed from kallithea/public/js/mode/mirc/mirc.js to kallithea/public/codemirror/mode/mirc/mirc.js
kallithea/public/codemirror/mode/nginx/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/nginx/index.html to kallithea/public/codemirror/mode/nginx/index.html
kallithea/public/codemirror/mode/nginx/nginx.js
Show inline comments
 
file renamed from kallithea/public/js/mode/nginx/nginx.js to kallithea/public/codemirror/mode/nginx/nginx.js
kallithea/public/codemirror/mode/ntriples/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/ntriples/index.html to kallithea/public/codemirror/mode/ntriples/index.html
kallithea/public/codemirror/mode/ntriples/ntriples.js
Show inline comments
 
file renamed from kallithea/public/js/mode/ntriples/ntriples.js to kallithea/public/codemirror/mode/ntriples/ntriples.js
kallithea/public/codemirror/mode/ocaml/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/ocaml/index.html to kallithea/public/codemirror/mode/ocaml/index.html
kallithea/public/codemirror/mode/ocaml/ocaml.js
Show inline comments
 
file renamed from kallithea/public/js/mode/ocaml/ocaml.js to kallithea/public/codemirror/mode/ocaml/ocaml.js
kallithea/public/codemirror/mode/pascal/LICENSE
Show inline comments
 
file renamed from kallithea/public/js/mode/pascal/LICENSE to kallithea/public/codemirror/mode/pascal/LICENSE
kallithea/public/codemirror/mode/pascal/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/pascal/index.html to kallithea/public/codemirror/mode/pascal/index.html
kallithea/public/codemirror/mode/pascal/pascal.js
Show inline comments
 
file renamed from kallithea/public/js/mode/pascal/pascal.js to kallithea/public/codemirror/mode/pascal/pascal.js
kallithea/public/codemirror/mode/perl/LICENSE
Show inline comments
 
file renamed from kallithea/public/js/mode/perl/LICENSE to kallithea/public/codemirror/mode/perl/LICENSE
kallithea/public/codemirror/mode/perl/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/perl/index.html to kallithea/public/codemirror/mode/perl/index.html
kallithea/public/codemirror/mode/perl/perl.js
Show inline comments
 
file renamed from kallithea/public/js/mode/perl/perl.js to kallithea/public/codemirror/mode/perl/perl.js
kallithea/public/codemirror/mode/php/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/php/index.html to kallithea/public/codemirror/mode/php/index.html
kallithea/public/codemirror/mode/php/php.js
Show inline comments
 
file renamed from kallithea/public/js/mode/php/php.js to kallithea/public/codemirror/mode/php/php.js
kallithea/public/codemirror/mode/pig/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/pig/index.html to kallithea/public/codemirror/mode/pig/index.html
kallithea/public/codemirror/mode/pig/pig.js
Show inline comments
 
file renamed from kallithea/public/js/mode/pig/pig.js to kallithea/public/codemirror/mode/pig/pig.js
kallithea/public/codemirror/mode/properties/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/properties/index.html to kallithea/public/codemirror/mode/properties/index.html
kallithea/public/codemirror/mode/properties/properties.js
Show inline comments
 
file renamed from kallithea/public/js/mode/properties/properties.js to kallithea/public/codemirror/mode/properties/properties.js
kallithea/public/codemirror/mode/python/LICENSE.txt
Show inline comments
 
file renamed from kallithea/public/js/mode/python/LICENSE.txt to kallithea/public/codemirror/mode/python/LICENSE.txt
kallithea/public/codemirror/mode/python/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/python/index.html to kallithea/public/codemirror/mode/python/index.html
kallithea/public/codemirror/mode/python/python.js
Show inline comments
 
file renamed from kallithea/public/js/mode/python/python.js to kallithea/public/codemirror/mode/python/python.js
kallithea/public/codemirror/mode/q/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/q/index.html to kallithea/public/codemirror/mode/q/index.html
kallithea/public/codemirror/mode/q/q.js
Show inline comments
 
file renamed from kallithea/public/js/mode/q/q.js to kallithea/public/codemirror/mode/q/q.js
kallithea/public/codemirror/mode/r/LICENSE
Show inline comments
 
file renamed from kallithea/public/js/mode/r/LICENSE to kallithea/public/codemirror/mode/r/LICENSE
kallithea/public/codemirror/mode/r/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/r/index.html to kallithea/public/codemirror/mode/r/index.html
kallithea/public/codemirror/mode/r/r.js
Show inline comments
 
file renamed from kallithea/public/js/mode/r/r.js to kallithea/public/codemirror/mode/r/r.js
kallithea/public/codemirror/mode/rpm/changes/changes.js
Show inline comments
 
file renamed from kallithea/public/js/mode/rpm/changes/changes.js to kallithea/public/codemirror/mode/rpm/changes/changes.js
kallithea/public/codemirror/mode/rpm/changes/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/rpm/changes/index.html to kallithea/public/codemirror/mode/rpm/changes/index.html
kallithea/public/codemirror/mode/rpm/spec/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/rpm/spec/index.html to kallithea/public/codemirror/mode/rpm/spec/index.html
kallithea/public/codemirror/mode/rpm/spec/spec.css
Show inline comments
 
file renamed from kallithea/public/js/mode/rpm/spec/spec.css to kallithea/public/codemirror/mode/rpm/spec/spec.css
kallithea/public/codemirror/mode/rpm/spec/spec.js
Show inline comments
 
file renamed from kallithea/public/js/mode/rpm/spec/spec.js to kallithea/public/codemirror/mode/rpm/spec/spec.js
kallithea/public/codemirror/mode/rst/LICENSE.txt
Show inline comments
 
file renamed from kallithea/public/js/mode/rst/LICENSE.txt to kallithea/public/codemirror/mode/rst/LICENSE.txt
kallithea/public/codemirror/mode/rst/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/rst/index.html to kallithea/public/codemirror/mode/rst/index.html
kallithea/public/codemirror/mode/rst/rst.js
Show inline comments
 
file renamed from kallithea/public/js/mode/rst/rst.js to kallithea/public/codemirror/mode/rst/rst.js
kallithea/public/codemirror/mode/ruby/LICENSE
Show inline comments
 
file renamed from kallithea/public/js/mode/ruby/LICENSE to kallithea/public/codemirror/mode/ruby/LICENSE
kallithea/public/codemirror/mode/ruby/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/ruby/index.html to kallithea/public/codemirror/mode/ruby/index.html
kallithea/public/codemirror/mode/ruby/ruby.js
Show inline comments
 
file renamed from kallithea/public/js/mode/ruby/ruby.js to kallithea/public/codemirror/mode/ruby/ruby.js
kallithea/public/codemirror/mode/rust/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/rust/index.html to kallithea/public/codemirror/mode/rust/index.html
kallithea/public/codemirror/mode/rust/rust.js
Show inline comments
 
file renamed from kallithea/public/js/mode/rust/rust.js to kallithea/public/codemirror/mode/rust/rust.js
kallithea/public/codemirror/mode/sass/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/sass/index.html to kallithea/public/codemirror/mode/sass/index.html
kallithea/public/codemirror/mode/sass/sass.js
Show inline comments
 
file renamed from kallithea/public/js/mode/sass/sass.js to kallithea/public/codemirror/mode/sass/sass.js
kallithea/public/codemirror/mode/scheme/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/scheme/index.html to kallithea/public/codemirror/mode/scheme/index.html
kallithea/public/codemirror/mode/scheme/scheme.js
Show inline comments
 
file renamed from kallithea/public/js/mode/scheme/scheme.js to kallithea/public/codemirror/mode/scheme/scheme.js
kallithea/public/codemirror/mode/shell/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/shell/index.html to kallithea/public/codemirror/mode/shell/index.html
kallithea/public/codemirror/mode/shell/shell.js
Show inline comments
 
file renamed from kallithea/public/js/mode/shell/shell.js to kallithea/public/codemirror/mode/shell/shell.js
kallithea/public/codemirror/mode/sieve/LICENSE
Show inline comments
 
file renamed from kallithea/public/js/mode/sieve/LICENSE to kallithea/public/codemirror/mode/sieve/LICENSE
kallithea/public/codemirror/mode/sieve/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/sieve/index.html to kallithea/public/codemirror/mode/sieve/index.html
kallithea/public/codemirror/mode/sieve/sieve.js
Show inline comments
 
file renamed from kallithea/public/js/mode/sieve/sieve.js to kallithea/public/codemirror/mode/sieve/sieve.js
kallithea/public/codemirror/mode/smalltalk/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/smalltalk/index.html to kallithea/public/codemirror/mode/smalltalk/index.html
kallithea/public/codemirror/mode/smalltalk/smalltalk.js
Show inline comments
 
file renamed from kallithea/public/js/mode/smalltalk/smalltalk.js to kallithea/public/codemirror/mode/smalltalk/smalltalk.js
kallithea/public/codemirror/mode/smarty/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/smarty/index.html to kallithea/public/codemirror/mode/smarty/index.html
kallithea/public/codemirror/mode/smarty/smarty.js
Show inline comments
 
file renamed from kallithea/public/js/mode/smarty/smarty.js to kallithea/public/codemirror/mode/smarty/smarty.js
kallithea/public/codemirror/mode/smartymixed/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/smartymixed/index.html to kallithea/public/codemirror/mode/smartymixed/index.html
kallithea/public/codemirror/mode/smartymixed/smartymixed.js
Show inline comments
 
file renamed from kallithea/public/js/mode/smartymixed/smartymixed.js to kallithea/public/codemirror/mode/smartymixed/smartymixed.js
kallithea/public/codemirror/mode/sparql/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/sparql/index.html to kallithea/public/codemirror/mode/sparql/index.html
kallithea/public/codemirror/mode/sparql/sparql.js
Show inline comments
 
file renamed from kallithea/public/js/mode/sparql/sparql.js to kallithea/public/codemirror/mode/sparql/sparql.js
kallithea/public/codemirror/mode/sql/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/sql/index.html to kallithea/public/codemirror/mode/sql/index.html
kallithea/public/codemirror/mode/sql/sql.js
Show inline comments
 
file renamed from kallithea/public/js/mode/sql/sql.js to kallithea/public/codemirror/mode/sql/sql.js
kallithea/public/codemirror/mode/stex/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/stex/index.html to kallithea/public/codemirror/mode/stex/index.html
kallithea/public/codemirror/mode/stex/stex.js
Show inline comments
 
file renamed from kallithea/public/js/mode/stex/stex.js to kallithea/public/codemirror/mode/stex/stex.js
kallithea/public/codemirror/mode/stex/test.js
Show inline comments
 
file renamed from kallithea/public/js/mode/stex/test.js to kallithea/public/codemirror/mode/stex/test.js
kallithea/public/codemirror/mode/tcl/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/tcl/index.html to kallithea/public/codemirror/mode/tcl/index.html
kallithea/public/codemirror/mode/tcl/tcl.js
Show inline comments
 
file renamed from kallithea/public/js/mode/tcl/tcl.js to kallithea/public/codemirror/mode/tcl/tcl.js
kallithea/public/codemirror/mode/tiddlywiki/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/tiddlywiki/index.html to kallithea/public/codemirror/mode/tiddlywiki/index.html
kallithea/public/codemirror/mode/tiddlywiki/tiddlywiki.css
Show inline comments
 
file renamed from kallithea/public/js/mode/tiddlywiki/tiddlywiki.css to kallithea/public/codemirror/mode/tiddlywiki/tiddlywiki.css
kallithea/public/codemirror/mode/tiddlywiki/tiddlywiki.js
Show inline comments
 
file renamed from kallithea/public/js/mode/tiddlywiki/tiddlywiki.js to kallithea/public/codemirror/mode/tiddlywiki/tiddlywiki.js
kallithea/public/codemirror/mode/tiki/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/tiki/index.html to kallithea/public/codemirror/mode/tiki/index.html
kallithea/public/codemirror/mode/tiki/tiki.css
Show inline comments
 
file renamed from kallithea/public/js/mode/tiki/tiki.css to kallithea/public/codemirror/mode/tiki/tiki.css
kallithea/public/codemirror/mode/tiki/tiki.js
Show inline comments
 
file renamed from kallithea/public/js/mode/tiki/tiki.js to kallithea/public/codemirror/mode/tiki/tiki.js
kallithea/public/codemirror/mode/turtle/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/turtle/index.html to kallithea/public/codemirror/mode/turtle/index.html
kallithea/public/codemirror/mode/turtle/turtle.js
Show inline comments
 
file renamed from kallithea/public/js/mode/turtle/turtle.js to kallithea/public/codemirror/mode/turtle/turtle.js
kallithea/public/codemirror/mode/vb/LICENSE.txt
Show inline comments
 
file renamed from kallithea/public/js/mode/vb/LICENSE.txt to kallithea/public/codemirror/mode/vb/LICENSE.txt
kallithea/public/codemirror/mode/vb/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/vb/index.html to kallithea/public/codemirror/mode/vb/index.html
kallithea/public/codemirror/mode/vb/vb.js
Show inline comments
 
file renamed from kallithea/public/js/mode/vb/vb.js to kallithea/public/codemirror/mode/vb/vb.js
kallithea/public/codemirror/mode/vbscript/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/vbscript/index.html to kallithea/public/codemirror/mode/vbscript/index.html
kallithea/public/codemirror/mode/vbscript/vbscript.js
Show inline comments
 
file renamed from kallithea/public/js/mode/vbscript/vbscript.js to kallithea/public/codemirror/mode/vbscript/vbscript.js
kallithea/public/codemirror/mode/velocity/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/velocity/index.html to kallithea/public/codemirror/mode/velocity/index.html
kallithea/public/codemirror/mode/velocity/velocity.js
Show inline comments
 
file renamed from kallithea/public/js/mode/velocity/velocity.js to kallithea/public/codemirror/mode/velocity/velocity.js
kallithea/public/codemirror/mode/verilog/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/verilog/index.html to kallithea/public/codemirror/mode/verilog/index.html
kallithea/public/codemirror/mode/verilog/verilog.js
Show inline comments
 
file renamed from kallithea/public/js/mode/verilog/verilog.js to kallithea/public/codemirror/mode/verilog/verilog.js
kallithea/public/codemirror/mode/xml/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/xml/index.html to kallithea/public/codemirror/mode/xml/index.html
kallithea/public/codemirror/mode/xml/xml.js
Show inline comments
 
file renamed from kallithea/public/js/mode/xml/xml.js to kallithea/public/codemirror/mode/xml/xml.js
kallithea/public/codemirror/mode/xquery/LICENSE
Show inline comments
 
file renamed from kallithea/public/js/mode/xquery/LICENSE to kallithea/public/codemirror/mode/xquery/LICENSE
kallithea/public/codemirror/mode/xquery/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/xquery/index.html to kallithea/public/codemirror/mode/xquery/index.html
kallithea/public/codemirror/mode/xquery/test.js
Show inline comments
 
file renamed from kallithea/public/js/mode/xquery/test.js to kallithea/public/codemirror/mode/xquery/test.js
kallithea/public/codemirror/mode/xquery/xquery.js
Show inline comments
 
file renamed from kallithea/public/js/mode/xquery/xquery.js to kallithea/public/codemirror/mode/xquery/xquery.js
kallithea/public/codemirror/mode/yaml/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/yaml/index.html to kallithea/public/codemirror/mode/yaml/index.html
kallithea/public/codemirror/mode/yaml/yaml.js
Show inline comments
 
file renamed from kallithea/public/js/mode/yaml/yaml.js to kallithea/public/codemirror/mode/yaml/yaml.js
kallithea/public/codemirror/mode/z80/index.html
Show inline comments
 
file renamed from kallithea/public/js/mode/z80/index.html to kallithea/public/codemirror/mode/z80/index.html
kallithea/public/codemirror/mode/z80/z80.js
Show inline comments
 
file renamed from kallithea/public/js/mode/z80/z80.js to kallithea/public/codemirror/mode/z80/z80.js
kallithea/public/js/codemirror_loadmode.js
Show inline comments
 
(function() {
 
  // FIXME: if this default value ever is used, it will probably be wrong
 
  if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js";
 

	
 
  var loading = {};
 
  function splitCallback(cont, n) {
 
    var countDown = n;
 
    return function() { if (--countDown == 0) cont(); };
 
  }
 
  function ensureDeps(mode, cont) {
 
    var deps = CodeMirror.modes[mode].dependencies;
 
    if (!deps) return cont();
 
    var missing = [];
 
    for (var i = 0; i < deps.length; ++i) {
 
      if (!CodeMirror.modes.hasOwnProperty(deps[i]))
 
        missing.push(deps[i]);
 
    }
 
    if (!missing.length) return cont();
 
    var split = splitCallback(cont, missing.length);
 
    for (var i = 0; i < missing.length; ++i)
 
      CodeMirror.requireMode(missing[i], split);
 
  }
 

	
 
  CodeMirror.requireMode = function(mode, cont) {
 
    if (typeof mode != "string") mode = mode.name;
 
    if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont);
 
    if (loading.hasOwnProperty(mode)) return loading[mode].push(cont);
 

	
 
    var script = document.createElement("script");
 
    script.src = CodeMirror.modeURL.replace(/%N/g, mode);
 
    var others = document.getElementsByTagName("script")[0];
 
    others.parentNode.insertBefore(script, others);
 
    var list = loading[mode] = [cont];
 
    var count = 0, poll = setInterval(function() {
 
      if (++count > 100) return clearInterval(poll);
 
      if (CodeMirror.modes.hasOwnProperty(mode)) {
 
        clearInterval(poll);
 
        loading[mode] = null;
 
        ensureDeps(mode, function() {
 
          for (var i = 0; i < list.length; ++i) list[i]();
 
        });
 
      }
 
    }, 200);
 
  };
 

	
 
  CodeMirror.autoLoadMode = function(instance, mode) {
 
    if (!CodeMirror.modes.hasOwnProperty(mode))
 
      CodeMirror.requireMode(mode, function() {
 
        instance.setOption("mode", instance.getOption("mode"));
 
      });
 
  };
 
}());
 

	
 

	
 
//overlay plugin
 

	
 
// Utility function that allows modes to be combined. The mode given
 
// as the base argument takes care of most of the normal mode
 
// functionality, but a second (typically simple) mode is used, which
 
// can override the style of text. Both modes get to parse all of the
 
// text, but when both assign a non-null style to a piece of code, the
 
// overlay wins, unless the combine argument was true, in which case
 
// the styles are combined.
 

	
 
// overlayParser is the old, deprecated name
 
CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) {
 
  return {
 
    startState: function() {
 
      return {
 
        base: CodeMirror.startState(base),
 
        overlay: CodeMirror.startState(overlay),
 
        basePos: 0, baseCur: null,
 
        overlayPos: 0, overlayCur: null
 
      };
 
    },
 
    copyState: function(state) {
 
      return {
 
        base: CodeMirror.copyState(base, state.base),
 
        overlay: CodeMirror.copyState(overlay, state.overlay),
 
        basePos: state.basePos, baseCur: null,
 
        overlayPos: state.overlayPos, overlayCur: null
 
      };
 
    },
 

	
 
    token: function(stream, state) {
 
      if (stream.start == state.basePos) {
 
        state.baseCur = base.token(stream, state.base);
 
        state.basePos = stream.pos;
 
      }
 
      if (stream.start == state.overlayPos) {
 
        stream.pos = stream.start;
 
        state.overlayCur = overlay.token(stream, state.overlay);
 
        state.overlayPos = stream.pos;
 
      }
 
      stream.pos = Math.min(state.basePos, state.overlayPos);
 
      if (stream.eol()) state.basePos = state.overlayPos = 0;
 

	
 
      if (state.overlayCur == null) return state.baseCur;
kallithea/templates/admin/gists/edit.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('Edit Gist')} &middot; ${c.gist.gist_access_id}
 
    %if c.site_name:
 
        &middot; ${c.site_name}
 
    %endif
 
</%def>
 

	
 
<%def name="js_extra()">
 
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/meta_ext.js')}"></script>
 
</%def>
 
<%def name="css_extra()">
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
 
<link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/>
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${_('Edit Gist')} &middot; ${c.gist.gist_access_id}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('gists')}
 
</%def>
 

	
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 

	
 
    <div class="table">
 
        <div id="edit_error" style="display: none" class="flash_msg">
 
            <div class="alert alert-dismissable alert-warning">
 
              <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
 
              ${h.literal(_('Gist was update since you started editing. Copy your changes and click %(here)s to reload new version.')
 
                             % {'here': h.link_to('here',h.url('edit_gist', gist_id=c.gist.gist_access_id))})}
 
            </div>
 
            <script>
 
            if (typeof jQuery != 'undefined') {
 
                $(".alert").alert();
 
            }
 
            </script>
 
        </div>
 

	
 
        <div id="files_data">
 
          ${h.form(h.url('edit_gist', gist_id=c.gist.gist_access_id), method='post', id='eform')}
 
            <div>
 
                <div class="gravatar">
 
                   <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(c.authuser.full_contact),32)}"/>
 
                </div>
 
                <input type="hidden" value="${c.file_changeset.raw_id}" name="parent_hash">
 
                <textarea style="resize:vertical; width:400px;border: 1px solid #ccc;border-radius: 3px;"
 
                          id="description" name="description"
 
                          placeholder="${_('Gist description ...')}">${c.gist.gist_description}</textarea>
 
                <div style="padding:0px 0px 0px 42px">
 
                    <label for='lifetime'>${_('Gist lifetime')}</label>
 
                    ${h.select('lifetime', '0', c.lifetime_options)}
 
                    <span class="" style="color: #AAA">
 
                     %if c.gist.gist_expires == -1:
 
                      ${_('Expires')}: ${_('never')}
 
                     %else:
 
                      ${_('Expires')}: ${h.age(h.time_to_datetime(c.gist.gist_expires))}
 
                     %endif
 
                   </span>
 
                </div>
 
            </div>
 

	
 
            % for cnt, file in enumerate(c.files):
 
                <div id="body" class="codeblock" style="margin-bottom: 4px">
 
                    <div style="padding: 10px 10px 10px 26px;color:#666666">
 
                        <input type="hidden" value="${file.path}" name="org_files">
 
                        <input id="filename_${h.FID('f',file.path)}" name="files" size="30" type="text" value="${file.path}">
 

	
 
                        <select id="mimetype_${h.FID('f',file.path)}" name="mimetypes">
 
                            <option selected="selected" value="plain">${_('plain')}</option>
 
                        </select>
 
                    </div>
 
                    <div class="editor_container">
 
                        <pre id="editor_pre"></pre>
 
                        <textarea id="editor_${h.FID('f',file.path)}" name="contents" style="display:none">${file.content}</textarea>
 
                    </div>
 
                </div>
 

	
 
                ## dynamic edit box.
 
                <script type="text/javascript">
 
                var myCodeMirror = initCodeMirror("editor_${h.FID('f',file.path)}", '');
 
                CodeMirror.modeURL = "${h.url('/js/mode/%N/%N.js')}";
 
                CodeMirror.modeURL = "${h.url('/codemirror/mode/%N/%N.js')}";
 

	
 
                //inject new modes
 
                var $modes_select = $('#mimetype_${h.FID('f',file.path)}');
 
                $modes_select.each(function(){
 
                    var modes_select = this;
 
                    for(var i=0;i<CodeMirror.modeInfo.length;i++) {
 
                        var m = CodeMirror.modeInfo[i];
 
                        var opt = new Option(m.name, m.mime);
 
                        $(opt).attr('mode', m.mode);
 
                        modes_select.options[i+1] = opt;
 
                    }
 
                });
 

	
 
                var $filename = $('#filename_${h.FID('f',file.path)}');
 
                // on select change set new mode
 
                $modes_select.change(function(e){
 
                    var selected = e.currentTarget;
 
                    var node = selected.options[selected.selectedIndex];
 
                    var mimetype = node.value;
 
                    var new_mode = $(node).attr('mode');
 
                    setCodeMirrorMode(myCodeMirror, new_mode);
 

	
 
                    var proposed_ext = getExtFromMimeType(mimetype);
 
                    var file_data = getFilenameAndExt($filename.val());
 
                    var filename = file_data['filename'] || 'filename1';
 
                    $(filename_selector).val(filename + proposed_ext);
 
                })
 

	
 
                // on type the new filename set mode
 
                $filename.keyup(function(e){
 
                    var file_data = getFilenameAndExt(this.value);
 
                    if(file_data['ext'] != null){
 

	
 
                        var mimetype = getMimeTypeFromExt(file_data['ext']);
 
                        var detected_mode = detectCodeMirrorMode(this.value, mimetype);
 

	
 
                        if (detected_mode){
 
                            setCodeMirrorMode(myCodeMirror, detected_mode);
 
                            $modes_select.val(mimetype)
 
                        }
 
                    }
 
                })
 

	
 
                // set mode on page load
 
                var mimetype = getMimeTypeFromExt("${file.extension}");
 
                var detected_mode = detectCodeMirrorMode("${file.path}", mimetype);
 

	
 
                if (detected_mode){
 
                    setCodeMirrorMode(myCodeMirror, detected_mode);
 
                    modes_select.val(mimetype)
 
                }
 

	
 
                </script>
 

	
 
            %endfor
 

	
 
            <div style="padding-top: 5px">
 
            ${h.submit('update',_('Update Gist'),class_="btn btn-mini btn-success")}
 
            <a class="btn btn-mini" href="${h.url('gist', gist_id=c.gist.gist_access_id)}">${_('Cancel')}</a>
 
            </div>
 
          ${h.end_form()}
 
          <script>
 
              $('#update').on('click', function(e){
 
                  e.preventDefault();
 

	
 
                  // check for newer version.
 
                  $.ajax({
 
                    url: "${h.url('edit_gist_check_revision', gist_id=c.gist.gist_access_id)}",
 
                    data: {'revision': '${c.file_changeset.raw_id}'},
 
                    dataType: 'json',
 
                    type: 'POST',
 
                    success: function(data) {
 
                      if(data.success == false){
 
                          $('#edit_error').show();
 
                      }
 
                      else{
 
                        $('#eform').submit();
 
                      }
 
                    }
 
                  })
 
              })
 
          </script>
 
        </div>
 
    </div>
 

	
 
</div>
 
</%def>
kallithea/templates/admin/gists/new.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('New Gist')}
 
    %if c.site_name:
 
        &middot; ${c.site_name}
 
    %endif
 
</%def>
 

	
 
<%def name="js_extra()">
 
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/meta_ext.js')}"></script>
 
</%def>
 
<%def name="css_extra()">
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
 
<link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/>
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${_('New Gist')}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('gists')}
 
</%def>
 

	
 
<%def name="main()">
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 

	
 
    <div class="table">
 
        <div id="files_data">
 
          ${h.form(h.url('gists'), method='post',id='eform')}
 
            <div>
 
                <div class="gravatar">
 
                   <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(c.authuser.full_contact),32)}"/>
 
                </div>
 
                <textarea style="resize:vertical; width:400px;border: 1px solid #ccc;border-radius: 3px;" id="description" name="description" placeholder="${_('Gist description ...')}"></textarea>
 
                <div style="padding:0px 0px 0px 42px">
 
                <label for='lifetime'>${_('Gist lifetime')}</label>
 
                ${h.select('lifetime', '', c.lifetime_options)}
 
                </div>
 
            </div>
 
            <div id="body" class="codeblock">
 
                <div style="padding: 10px 10px 10px 26px;color:#666666">
 
                    ${h.text('filename', size=30, placeholder=_('name this file...'))}
 
                    ${h.select('mimetype','plain',[('plain',_('plain'))])}
 
                </div>
 
                <div id="editor_container">
 
                    <pre id="editor_pre"></pre>
 
                    <textarea id="editor" name="content" style="display:none"></textarea>
 
                </div>
 
            </div>
 
            <div style="padding-top: 5px">
 
            ${h.submit('private',_('Create Private Gist'),class_="btn btn-mini btn-success")}
 
            ${h.submit('public',_('Create Public Gist'),class_="btn btn-mini")}
 
            ${h.reset('reset',_('Reset'),class_="btn btn-mini")}
 
            </div>
 
            ${h.end_form()}
 
            <script type="text/javascript">
 
            var myCodeMirror = initCodeMirror('editor', '');
 
            CodeMirror.modeURL = "${h.url('/js/mode/%N/%N.js')}";
 
            CodeMirror.modeURL = "${h.url('/codemirror/mode/%N/%N.js')}";
 

	
 
            //inject new modes
 
            var $modes_select = $('#mimetype');
 
            $modes_select.each(function(){
 
                var modes_select = this;
 
                for(var i=0;i<CodeMirror.modeInfo.length;i++) {
 
                    var m = CodeMirror.modeInfo[i];
 
                    var opt = new Option(m.name, m.mime);
 
                    $(opt).attr('mode', m.mode);
 
                    modes_select.options[i+1] = opt;
 
                }
 
            });
 

	
 
            var $filename = $('#filename');
 
            // on select change set new mode
 
            $modes_select.change(function(e){
 
                var selected = e.currentTarget;
 
                var node = selected.options[selected.selectedIndex];
 
                var mimetype = node.value;
 
                var new_mode = $(node).attr('mode');
 
                setCodeMirrorMode(myCodeMirror, new_mode);
 

	
 
                var proposed_ext = getExtFromMimeType(mimetype);
 
                var file_data = getFilenameAndExt($filename.val());
 
                var filename = file_data['filename'] || 'filename1';
 
                $filename.val(filename + proposed_ext);
 
            });
 

	
 
            // on type the new filename set mode
 
            $filename.keyup(function(e){
 
                var file_data = getFilenameAndExt(this.value);
 
                if(file_data['ext'] != null){
 
                    var mimetype = getMimeTypeFromExt(file_data['ext']);
 
                    var detected_mode = detectCodeMirrorMode(this.value, mimetype);
 
                    if (detected_mode){
 
                        setCodeMirrorMode(myCodeMirror, detected_mode);
 
                        $modes_select.val(mimetype)
 
                    }
 
                }
 
            })
 
            </script>
 
        </div>
 
    </div>
 

	
 
</div>
 
</%def>
kallithea/templates/files/diff_2way.html
Show inline comments
 
## -*- coding: utf-8 -*-
 

	
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="js_extra()">
 
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/mergely.js')}"></script>
 
</%def>
 
<%def name="css_extra()">
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
 
<link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/>
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/mergely.css')}"/>
 
</%def>
 

	
 
<%def name="title()">
 
    ${_('%s File side-by-side diff') % c.repo_name}
 
    %if c.site_name:
 
        &middot; ${c.site_name}
 
    %endif
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${_('File diff')} ${h.show_id(c.changeset_1)} &rarr; ${h.show_id(c.changeset_2)}
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('repositories')}
 
</%def>
 

	
 
<%def name="main()">
 
${self.repo_context_bar('changelog')}
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
    </div>
 

	
 
    <div class="diff-container" style="overflow-x: hidden">
 
        <div class="diffblock comm" style="margin:3px; padding:1px">
 
            <div class="code-header">
 
                <div class="changeset_header">
 
                    <div class="changeset_file">
 
                        ${h.link_to(h.safe_unicode(c.node1.path),h.url('files_home',repo_name=c.repo_name,
 
                        revision=c.cs2.raw_id,f_path=h.safe_unicode(c.node1.path)))}
 
                    </div>
 
                    <div class="diff-actions">
 
                      <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full diff for this file'))}">
 
                          <img class="icon" src="${h.url('/images/icons/page_white_go.png')}"/>
 
                      </a>
 
                      <a href="${h.url('files_diff_2way_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='diff',fulldiff=1)}" class="tooltip" title="${h.tooltip(_('Show full side-by-side diff for this file'))}">
 
                          <img class="icon" src="${h.url('/images/icons/application_double.png')}"/>
 
                      </a>
 
                      <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='raw')}" class="tooltip" title="${h.tooltip(_('Raw diff'))}">
 
                          <img class="icon" src="${h.url('/images/icons/page_white.png')}"/>
 
                      </a>
 
                      <a href="${h.url('files_diff_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),diff2=c.cs2.raw_id,diff1=c.cs1.raw_id,diff='download')}" class="tooltip" title="${h.tooltip(_('Download diff'))}">
 
                          <img class="icon" src="${h.url('/images/icons/page_save.png')}"/>
 
                      </a>
 
                      ${h.checkbox('ignorews', label=_('Ignore whitespace'))}
 
                      ${h.checkbox('edit_mode', label=_('Edit'))}
 
                    </div>
 
                </div>
 
            </div>
 
            <div id="compare"></div>
 
        </div>
 
    </div>
 

	
 
<script>
 
var orig1_url = '${h.url('files_raw_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node1.path),revision=c.cs1.raw_id)}';
 
var orig2_url = '${h.url('files_raw_home',repo_name=c.repo_name,f_path=h.safe_unicode(c.node2.path),revision=c.cs2.raw_id)}';
 

	
 
$(document).ready(function () {
 
    $('#compare').mergely({
 
        width: 'auto',
 
        height: '600',
 
        fgcolor: {a:'#ddffdd',c:'#cccccc',d:'#ffdddd'},
 
        bgcolor: '#fff',
 
        viewport: true,
 
        cmsettings: {mode: 'text/plain', readOnly: true, lineWrapping: false, lineNumbers: true},
 
        lhs: function(setValue) {
 
            if("${c.node1.is_binary}" == "True"){
 
                setValue('Binary file')
 
            }
 
            else{
 
                $.ajax(orig1_url, {dataType: 'text', success: setValue});
 
            }
 

	
 
        },
 
        rhs: function(setValue) {
 
            if("${c.node2.is_binary}" == "True"){
 
                setValue('Binary file')
 
            }
 
            else{
 
                $.ajax(orig2_url, {dataType: 'text', success: setValue});
 
            }
 
        }
 
    });
 
    $('#ignorews').change(function(e){
 
        var val = e.currentTarget.checked;
 
        $('#compare').mergely('options', {ignorews: val});
 
        $('#compare').mergely('update');
 
    })
 
    $('#edit_mode').change(function(e){
 
        var val = !e.currentTarget.checked;
 
        $('#compare').mergely('cm', 'lhs').setOption('readOnly', val);
 
        $('#compare').mergely('cm', 'rhs').setOption('readOnly', val);
 
        $('#compare').mergely('update');
kallithea/templates/files/files_add.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('%s Files Add') % c.repo_name}
 
    %if c.site_name:
 
        &middot; ${c.site_name}
 
    %endif
 
</%def>
 

	
 
<%def name="js_extra()">
 
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/meta_ext.js')}"></script>
 
</%def>
 
<%def name="css_extra()">
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
 
<link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/>
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('repositories')}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${_('Add New File')} @ ${h.show_id(c.cs)}
 
</%def>
 

	
 
<%def name="main()">
 
${self.repo_context_bar('files')}
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
        <ul class="links">
 
            <li>
 
              <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span>
 
            </li>
 
        </ul>
 
    </div>
 
    <div class="table" id="edit">
 
        <div id="files_data">
 
          ${h.form(h.url.current(),method='post',id='eform',enctype="multipart/form-data", class_="form-horizontal")}
 
          <h3 class="files_location">
 
            ${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.raw_id,c.f_path)} /
 
              <span id="filename_container" class="file reviewer_ac">
 
                  <input class="input-small" type="text" value="" size="30" name="filename" id="filename" placeholder="${_('Enter filename...')}">
 
                  <input type="hidden" value="${c.f_path}" size="30" name="location" id="location">
 
                  ${_('or')} <div class="btn btn-small" id="upload_file_enable">${_('Upload File')}</div>
 
              </span>
 
              <span id="upload_file_container" class="reviewer_ac" style="display:none">
 
                  <input type="file"  size="20" name="upload_file" id="upload_file">
 
                  ${_('or')} <div class="btn btn-small" id="file_enable">${_('Create New File')}</div>
 
              </span>
 
          </h3>
 
            <div id="body" class="codeblock">
 
            <div class="code-header" id="set_mode_header">
 
                <label class="commit" for="set_mode">${_('New file mode')}</label>
 
                ${h.select('set_mode','plain',[('plain',_('plain'))])}
 
            </div>
 
                <div id="editor_container">
 
                    <pre id="editor_pre"></pre>
 
                    <textarea id="editor" name="content" style="display:none"></textarea>
 
                </div>
 
                <div style="padding: 10px;color:#666666">${_('Commit Message')}</div>
 
                <textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea>
 
            </div>
 
            <div style="text-align: left;padding-top: 5px">
 
            ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")}
 
            ${h.reset('reset',_('Reset'),class_="btn btn-small")}
 
            </div>
 
            ${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);
 
            CodeMirror.modeURL = "${h.url('/js/mode/%N/%N.js')}";
 
            CodeMirror.modeURL = "${h.url('/codemirror/mode/%N/%N.js')}";
 

	
 
            //inject new modes, based on codeMirrors modeInfo object
 
            $('#set_mode').each(function(){
 
                var modes_select = this;
 
                for(var i=0;i<CodeMirror.modeInfo.length;i++){
 
                    var m = CodeMirror.modeInfo[i];
 
                    var opt = new Option(m.name, m.mode);
 
                    modes_select.options[i+1] = opt
 
                }
 
            });
 
            $('#set_mode').change(function(e){
 
                var selected = e.currentTarget;
 
                var new_mode = selected.options[selected.selectedIndex].value;
 
                setCodeMirrorMode(myCodeMirror, new_mode);
 
            });
 
            </script>
 
        </div>
 
    </div>
 
</div>
 
</%def>
kallithea/templates/files/files_delete.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('%s Files Delete') % c.repo_name}
 
    %if c.site_name:
 
        &middot; ${c.site_name}
 
    %endif
 
</%def>
 

	
 
<%def name="js_extra()">
 
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/meta_ext.js')}"></script>
 
</%def>
 
<%def name="css_extra()">
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
 
<link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/>
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('repositories')}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${_('Delete file')} @ ${h.show_id(c.cs)}
 
</%def>
 

	
 
<%def name="main()">
 
${self.repo_context_bar('files')}
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
        <ul class="links">
 
            <li>
 
              <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span>
 
            </li>
 
        </ul>
 
    </div>
 
    <div class="table" id="edit">
 
        <div id="files_data">
 
            ${h.form(h.url.current(),method='post',class_="form-horizontal")}
 
            <h3 class="files_location">
 
                ${_('Delete file')}: ${h.files_breadcrumbs(c.repo_name,c.cs.raw_id,c.f_path)}
 
            </h3>
 

	
 
            <div id="body" class="codeblock">
 
                <div id="editor_container">
 
                    <pre id="editor_pre"></pre>
 
                    <textarea id="editor" name="content" style="display:none"></textarea>
 
                </div>
 
                <div style="padding: 10px;color:#666666">${_('Commit Message')}</div>
 
                <textarea id="commit" name="message" style="height: 100px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea>
 
            </div>
 
            <div style="text-align: left;padding-top: 5px">
 
                ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")}
 
                ${h.reset('reset',_('Reset'),class_="btn btn-small")}
 
            </div>
 
            ${h.end_form()}
 
        </div>
 
    </div>
 
</div>
 
</%def>
kallithea/templates/files/files_edit.html
Show inline comments
 
<%inherit file="/base/base.html"/>
 

	
 
<%def name="title()">
 
    ${_('%s File Edit') % c.repo_name}
 
    %if c.site_name:
 
        &middot; ${c.site_name}
 
    %endif
 
</%def>
 

	
 
<%def name="js_extra()">
 
<script type="text/javascript" src="${h.url('/js/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/lib/codemirror.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/codemirror_loadmode.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/codemirror/mode/meta.js')}"></script>
 
<script type="text/javascript" src="${h.url('/js/meta_ext.js')}"></script>
 
</%def>
 
<%def name="css_extra()">
 
<link rel="stylesheet" type="text/css" href="${h.url('/css/codemirror.css')}"/>
 
<link rel="stylesheet" type="text/css" href="${h.url('/codemirror/lib/codemirror.css')}"/>
 
</%def>
 

	
 
<%def name="page_nav()">
 
    ${self.menu('repositories')}
 
</%def>
 

	
 
<%def name="breadcrumbs_links()">
 
    ${_('Edit file')} @ ${h.show_id(c.cs)}
 
</%def>
 

	
 
<%def name="main()">
 
${self.repo_context_bar('files')}
 
<div class="box">
 
    <!-- box / title -->
 
    <div class="title">
 
        ${self.breadcrumbs()}
 
        <ul class="links">
 
            <li>
 
              <span><a href="#">${_('Branch')}: ${c.cs.branch}</a></span>
 
            </li>
 
        </ul>
 
    </div>
 
    <div class="table" id="edit">
 
        <div id="files_data">
 
            <h3 class="files_location">${_('Location')}: ${h.files_breadcrumbs(c.repo_name,c.cs.revision,c.file.path)}</h3>
 
            ${h.form(h.url.current(),method='post',id='eform')}
 
            <div id="body" class="codeblock">
 
            <div class="code-header">
 
                <div class="stats">
 
                    <div class="left"><i class="icon-file"></i></div>
 
                    <div class="left item">${h.link_to(h.show_id(c.file.changeset),h.url('changeset_home',repo_name=c.repo_name,revision=c.file.changeset.raw_id))}</div>
 
                    <div class="left item">${h.format_byte_size(c.file.size,binary=True)}</div>
 
                    <div class="left item last">${c.file.mimetype}</div>
 
                    <div class="buttons">
 
                      ${h.link_to(_('Show Annotation'),h.url('files_annotate_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")}
 
                      ${h.link_to(_('Show as Raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")}
 
                      ${h.link_to(_('Download as Raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")}
 
                      % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
 
                       % if not c.file.is_binary:
 
                        ${h.link_to(_('Source'),h.url('files_home',repo_name=c.repo_name,revision=c.cs.raw_id,f_path=c.f_path),class_="btn btn-mini")}
 
                       % endif
 
                      % endif
 
                    </div>
 
                </div>
 
                <label class="commit" for="set_mode">${_('Editing file')}: ${c.file.unicode_path}</label>
 
                ${h.select('set_mode','plain',[('plain',_('plain'))])}
 
            </div>
 
                <pre id="editor_pre"></pre>
 
                <textarea id="editor" name="content" style="display:none">${h.escape(c.file.content)|n}</textarea>
 
                <div style="padding: 10px;color:#666666">${_('Commit Message')}</div>
 
                <textarea id="commit" name="message" style="height: 60px;width: 99%;margin-left:4px" placeholder="${c.default_message}"></textarea>
 
            </div>
 
            <div style="text-align: left;padding-top: 5px">
 
            ${h.submit('commit',_('Commit Changes'),class_="btn btn-small btn-success")}
 
            ${h.reset('reset',_('Reset'),class_="btn btn-small")}
 
            </div>
 
            ${h.end_form()}
 
        </div>
 
    </div>
 
</div>
 

	
 
<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);
 
    CodeMirror.modeURL = "${h.url('/js/mode/%N/%N.js')}";
 
    CodeMirror.modeURL = "${h.url('/codemirror/mode/%N/%N.js')}";
 

	
 
   //inject new modes, based on codeMirrors modeInfo object
 
    var modes_select = $('#set_mode');
 
    for(var i=0;i<CodeMirror.modeInfo.length;i++){
 
        var m = CodeMirror.modeInfo[i];
 
        var opt = $('<option></option>').val(m.mode).text(m.name)
 
        modes_select.append(opt)
 
    }
 

	
 
    // try to detect the mode based on the file we edit
 
    var detected_mode = detectCodeMirrorMode("${c.file.name}", "${c.file.mimetype}")
 
    if(detected_mode){
 
        setCodeMirrorMode(myCodeMirror, detected_mode);
 
        $($('#set_mode option[value="'+detected_mode+'"]')[0]).attr("selected", "selected")
 
    }
 

	
 
    $(modes_select).on('change', function(e){
 
        var selected = e.currentTarget;
 
        var new_mode = selected.options[selected.selectedIndex].value;
 
        setCodeMirrorMode(myCodeMirror, new_mode);
 
    })
 
})
 
</script>
 
</%def>
0 comments (0 inline, 0 general)