diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.txt
similarity index 86%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.bin
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.txt
index bc894e9f7ade322f7685c8c6f1d3327b96fe69ea..03b4141ea59406ba6c87870e5af4356926e64d58 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.bin
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.txt
@@ -1,11 +1,13 @@
 List of CodeMirror contributors. Updated before every release.
 
+4oo4
 4r2r
 Aaron Brooks
 Abdelouahab
 Abe Fettig
 Adam Ahmed
 Adam King
+Adam Particka
 adanlobato
 Ad谩n Lobato
 Adrian Aichner
@@ -29,6 +31,7 @@ alexey-k
 Alex Piggott
 Aliaksei Chapyzhenka
 Allen Sarkisyan
+Ami Fischman
 Amin Shali
 Amin Ullah Khan
 amshali@google.com
@@ -46,6 +49,7 @@ Andreas Reischuck
 Andres Taylor
 Andre von Houck
 Andrew Cheng
+Andrew Dassonville
 Andrey Fedorov
 Andrey Klyuchnikov
 Andrey Lushnikov
@@ -66,14 +70,19 @@ Anthony Grimes
 Anton Kovalyov
 Apollo Zhu
 AQNOUCH Mohammed
+Aram Shatakhtsyan
 areos
 Arnab Bose
+Ars猫ne von Wyss
 Arthur M眉ller
+Arun Narasani
 as3boyan
+asolove
 atelierbram
 AtomicPages LLC
 Atul Bhouraskar
 Aurelian Oancea
+Axel Lewenhaupt
 Barret Rennie
 Basarat Ali Syed
 Bastian Mu虉ller
@@ -82,6 +91,7 @@ Bem Jones-Bey
 benbro
 Beni Cherniavsky-Paskin
 Benjamin DeCoste
+Benjamin Young
 Ben Keen
 Ben Miller
 Ben Mosher
@@ -99,15 +109,19 @@ borawjm
 Brad Metcalf
 Brandon Frohs
 Brandon Wamboldt
+Bret Little
 Brett Zamir
 Brian Grinstead
 Brian Sletten
+brrd
 Bruce Mitchener
 Bryan Massoth
 Caitlin Potter
 Calin Barbat
 callodacity
 Camilo Roca
+Casey Klebba
+C茅sar Gonz谩lez 脥帽iguez
 Chad Jolly
 Chandra Sekhar Pydi
 Charles Skelton
@@ -118,18 +132,23 @@ Chris Granger
 Chris Houseknecht
 Chris Lohfink
 Chris Morgan
+Chris Reeves
 Chris Smith
+Christian Gruen
 Christian Oyarzun
 Christian Petrov
 Christopher Brown
+Christopher Kramer
 Christopher Mitchell
 Christopher Pfohl
 Chunliang Lyu
 ciaranj
 CodeAnimal
+CodeBitt
 coderaiser
 Cole R Lawrence
 ComFreek
+Cristian Prieto
 Curtis Gagliardi
 dagsta
 daines
@@ -144,6 +163,8 @@ Daniel Kesler
 Daniel KJ
 Daniel Neel
 Daniel Parnell
+Daniel Thwaites
+Danila Malyutin
 Danny Yoo
 darealshinji
 Darius Roberts
@@ -173,6 +194,7 @@ Drew Khoury
 Drini Cami
 Dror BG
 duralog
+dwelle
 eborden
 edsharp
 ekhaled
@@ -194,12 +216,16 @@ Felix Raab
 ficristo
 Filip Noetzel
 Filip Stoll谩r
+Filype Pereira
 flack
+Florian Felten
 ForbesLindesay
 Forbes Lindesay
 Ford_Lawnmower
 Forrest Oliphant
+Franco Catena
 Frank Wiegand
+Fredrik Borg
 Gabriel Gheorghian
 Gabriel Horner
 Gabriel Nahmias
@@ -209,6 +235,7 @@ Gautam Mehta
 Gavin Douglas
 gekkoe
 Geordie Hall
+George Stephanis
 geowarin
 Gerard Braad
 Gergely Hegykozi
@@ -223,6 +250,7 @@ Grant Skinner
 greengiant
 Gregory Koberger
 Grzegorz Mazur
+Guan Gui
 Guillaume Masse虂
 Guillaume Mass茅
 guraga
@@ -232,15 +260,20 @@ Hans Engel
 Hardest
 Harshvardhan Gupta
 Hasan Karahan
+Heanes
 Hector Oswaldo Caballero
+H茅lio
 Hendrik Wallbaum
+Henrik Haugb酶lle
 Herculano Campos
 Hiroyuki Makino
 hitsthings
 Hocdoc
 Hugues Malphettes
 Ian Beck
+Ian Davies
 Ian Dickinson
+Ian Rose
 Ian Wehrman
 Ian Wetherbee
 Ice White
@@ -252,6 +285,7 @@ Irakli Gozalishvili
 Ivan Kurnosov
 Ivoah
 Jacob Lee
+Jaimin
 Jake Peyser
 Jakob Miland
 Jakub Vrana
@@ -260,6 +294,7 @@ James Campos
 James Howard
 James Thorne
 Jamie Hill
+Jamie Morris
 Jan Jongboom
 jankeromnes
 Jan Keromnes
@@ -275,9 +310,11 @@ Jason Grout
 Jason Johnston
 Jason San Jose
 Jason Siefken
+Jayaprabhakar
 Jaydeep Solanki
 Jean Boussier
 Jeff Blaisdell
+Jeff Hanke
 Jeff Jenkins
 jeffkenton
 Jeff Pickhardt
@@ -285,6 +322,7 @@ jem (graphite)
 Jeremy Parmenter
 Jim
 Jim Avery
+jkaplon
 JobJob
 jochenberger
 Jochen Berger
@@ -299,6 +337,8 @@ John Snelson
 John Van Der Loo
 Jon Ander Pe帽alba
 Jonas D枚bertin
+Jonas Helfer
+Jonathan Hart
 Jonathan Malmaud
 Jon Gacnik
 jongalloway
@@ -317,6 +357,7 @@ ju1ius
 Juan Benavides Romero
 Jucovschi Constantin
 Juho Vuori
+Julien CROUZET
 Julien Rebetez
 Justin Andresen
 Justin Hileman
@@ -329,6 +370,7 @@ Ken Newman
 ken restivo
 Ken Rockot
 Kevin Earls
+Kevin Kwok
 Kevin Muret
 Kevin Sawicki
 Kevin Ushey
@@ -342,19 +384,25 @@ ks-ifware
 kubelsmieci
 KwanEsq
 Kyle Kelley
+KyleMcNutt
 Lanfei
 Lanny
 Laszlo Vidacs
 leaf corcoran
+Lemmon
 Leonid Khachaturov
 Leon Sorokin
 Leonya Khachaturov
 Liam Newman
 Libo Cannici
+Lior Goldberg
+Lior Shub
 LloydMilligan
 LM
 lochel
 Lorenzo Stoakes
+Louis Mauchet
+Luca Fabbri
 Luciano Longo
 Lu Fangjian
 Luke Browning
@@ -383,6 +431,7 @@ Mark Lentczner
 Marko Bonaci
 Mark Peace
 Markus Bordihn
+Markus Olsson
 Martin Balek
 Mart铆n Gait谩n
 Martin Haso艌
@@ -411,7 +460,9 @@ Max Schaefer
 Max Xiantu
 mbarkhau
 McBrainy
+mce2
 melpon
+meshuamam
 Metatheos
 Micah Dubinko
 Michael
@@ -419,8 +470,11 @@ Michael Goderbauer
 Michael Grey
 Michael Kaminsky
 Michael Lehenbauer
+Michael Walker
 Michael Zhou
+Michal 膶iha艡
 Michal Dorner
+Michal Kapiczynski
 Mighty Guava
 Miguel Castillo
 mihailik
@@ -436,22 +490,29 @@ misfo
 mkaminsky11
 mloginov
 Moritz Schw枚rer
+Moshe Wajnberg
 mps
 ms
 mtaran-google
 Mu-An Chiou
+mzabuawala
 Narciso Jaramillo
 Nathan Williams
 ndr
+Neil Anderson
+neon-dev
 nerbert
+NetworkNode
 nextrevision
 ngn
 nguillaumin
 Ng Zhi An
 Nicholas Bollweg
 Nicholas Bollweg (Nick)
+NickKolok
 Nick Kreeger
 Nick Small
+Nicolas Kick
 Nicol貌 Ribaudo
 Niels van Groningen
 nightwing
@@ -463,11 +524,15 @@ Nisarg Jhaveri
 nlwillia
 noragrossman
 Norman Rzepka
+opl-
 Oreoluwa Onatemowo
 Oskar Segersv盲rd
+overdodactyl
 pablo
 pabloferz
+Pablo Zubieta
 Page
+paladox
 Panupong Pasupat
 paris
 Paris
@@ -490,12 +555,15 @@ peterkroon
 Peter Kroon
 Philipp A
 Philip Stadermann
+Pi Delport
 Pierre Gerold
-Pi毛t Delport
+Pieter Ouwerkerk
 Pontus Melke
 prasanthj
 Prasanth J
 Prayag Verma
+Prendota
+Qiang Li
 Radek Pi贸rkowski
 Rahul
 Rahul Anand
@@ -503,14 +571,20 @@ ramwin1
 Randall Mason
 Randy Burden
 Randy Edmunds
+Randy Luecke
+Raphael Amorim
 Rasmus Erik Voel Jensen
+Rasmus Schultz
+Raymond Hill
 ray ratchup
 Ray Ratchup
 Remi Nyborg
+Renaud Durlin
 Richard Denton
 Richard van der Meer
 Richard Z.H. Wang
 Rishi Goomar
+Robert Brignull
 Robert Crossfield
 Roberto Abdelkader Mart铆nez P茅rez
 robertop23
@@ -518,41 +592,51 @@ Robert Plummer
 Rrandom
 Rrrandom
 Ruslan Osmanov
+Ryan Petrello
 Ryan Prior
+ryu-sato
 sabaca
 Sam Lee
+Sam Rawlins
 Samuel Ainsworth
 Sam Wilson
 sandeepshetty
 Sander AKA Redsandro
 Sander Verweij
 santec
+Sarah McAlear and Wenlin Zhang
 Sascha Peilicke
 satamas
 satchmorun
 sathyamoorthi
+Saul Costa
 S. Chris Colbert
 SCLINIC\jdecker
 Scott Aikin
 Scott Goodhew
+Sebastian Wilzbach
 Sebastian Zaha
 Sergey Goder
 Sergey Tselovalnikov
 Se-Won Kim
+Shane Liesegang
 shaund
 shaun gilchrist
 Shawn A
 Shea Bunge
 sheopory
+Shil S
 Shiv Deepak
 Shmuel Englard
 Shubham Jain
 Siamak Mokhtari
 silverwind
+Simon Edwards
 sinkuu
 snasa
 soliton4
 sonson
+Sorab Bisht
 spastorelli
 srajanpaliwal
 Stanislav Oaserele
@@ -560,6 +644,8 @@ Stas Kobzar
 Stefan Borsje
 Steffen Beyer
 Steffen Bruchmann
+Steffen Kowalski
+Stephane Moore
 Stephen Lavelle
 Steve Champagne
 Steve Hoover
@@ -572,15 +658,18 @@ Taha Jahangir
 takamori
 Tako Schotanus
 Takuji Shimokawa
+Takuya Matsuyama
 Tarmil
 TDaglis
 tel
+Tentone
 tfjgeorge
 Thaddee Tyl
 thanasis
 TheHowl
 themrmax
 think
+Thomas Brouard
 Thomas Dvornik
 Thomas Kluyver
 Thomas Schmid
@@ -589,29 +678,38 @@ Tim Baumann
 Timothy Farrell
 Timothy Gu
 Timothy Hatcher
+Tobias Bertelsen
 TobiasBg
 Todd Berman
+Todd Kennedy
 Tomas-A
 Tomas Varaneckas
 Tom Erik St酶wer
 Tom Klancer
 Tom MacWright
+Tom McLaughlin
 Tony Jian
+tophf
+totalamd
 Travis Heppe
 Triangle717
 Tristan Tarrant
 TSUYUSATO Kitsune
 twifkak
+Tyler Long
+Vaibhav Sagar
 VapidWorx
 Vestimir Markov
 vf
 Victor Bocharsky
 Vincent Woo
 Volker Mische
+vtripolitakis
 Weiyan Shao
 wenli
 Wes Cossick
 Wesley Wiser
+Weston Ruter
 Will Binns-Smith
 Will Dean
 William Jamieson
@@ -624,9 +722,11 @@ Yassin N. Hassan
 YNH Webdev
 Yunchi Luo
 Yuvi Panda
+Yvonnick Esnault
 Zac Anger
 Zachary Dremann
 Zeno Rocha
 Zhang Hao
+Ziv
 zziuni
 榄忛箯鍒�
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.xml
index 847d415cbebe60b3b4406ae72384148e997eeaec..5b4b1221e7f82be1dbcdf94451427972bc5cdd69 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/AUTHORS.xml
@@ -2,29 +2,25 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
         <item>
             <key> <string>__name__</string> </key>
             <value> <string>AUTHORS</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.txt
similarity index 81%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.bin
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.txt
index 588d0318d59947929d2c474e1b760a8f6c0bea8e..a8199fd30b518a32b3c79aeefcaa40ef0d831893 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.bin
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.txt
@@ -1,3 +1,337 @@
+## 5.36.0 (2018-03-20)
+
+### Bug fixes
+
+Make sure all document-level event handlers are registered on the document that the editor is part of.
+
+Fix issue that prevented edits whose origin starts with `+` from being combined in history events for an editor-less document.
+
+[multiplex addon](http://codemirror.net/demo/multiplex.html): Improve handling of indentation.
+
+[merge addon](http://codemirror.net/doc/manual.html#addon_merge): Use CSS `:after` element to style the scroll-lock icon.
+
+[javascript-hint addon](http://codemirror.net/doc/manual.html#addon_javascript-hint): Don't provide completions in JSON mode.
+
+[continuelist addon](http://codemirror.net/doc/manual.html#addon_continuelist): Fix numbering error.
+
+[show-hint addon](http://codemirror.net/doc/manual.html#addon_show-hint): Make `fromList` completion strategy act on the current token up to the cursor, rather than the entire token.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Fix a regexp with potentially exponental complexity.
+
+### New features
+
+New theme: [lucario](http://codemirror.net/demo/theme.html#lucario).
+
+## 5.35.0 (2018-02-20)
+
+### Bug fixes
+
+Fix problem where selection undo might change read-only documents.
+
+Fix crash when calling `addLineWidget` on a document that has no attached editor.
+
+[searchcursor addon](http://codemirror.net/doc/manual.html#addon_searchcursor): Fix behavior of `^` in multiline regexp mode.
+
+[match-highlighter addon](http://codemirror.net/doc/manual.html#addon_match-highlighter): Fix problem with matching words that have regexp special syntax in them.
+
+[sublime bindings](http://codemirror.net/demo/sublime.html): Fix `addCursorToSelection` for short lines.
+
+[javascript mode](http://codemirror.net/mode/javascript/): Support TypeScript intersection types, dynamic `import`.
+
+[stex mode](http://codemirror.net/mode/stex/): Fix parsing of `\(` `\)` delimiters, recognize more atom arguments.
+
+[haskell mode](http://codemirror.net/mode/haskell/): Highlight more builtins, support `<*` and `*>`.
+
+[sql mode](http://codemirror.net/mode/sql/): Make it possible to disable backslash escapes in strings for dialects that don't have them, do this for MS SQL.
+
+[dockerfile mode](http://codemirror.net/mode/dockerfile/): Highlight strings and ports, recognize more instructions.
+
+### New features
+
+[vim bindings](http://codemirror.net/demo/vim.html): Support alternative delimiters in replace command.
+
+## 5.34.0 (2018-01-29)
+
+### Bug fixes
+
+[markdown mode](http://codemirror.net/mode/markdown/): Fix a problem where inline styles would persist across list items.
+
+[sublime bindings](http://codemirror.net/demo/sublime.html): Fix the `toggleBookmark` command.
+
+[closebrackets addon](http://codemirror.net/doc/manual.html#addon_closebrackets): Improve behavior when closing triple quotes.
+
+[xml-fold addon](http://codemirror.net/demo/folding.html): Fix folding of line-broken XML tags.
+
+[shell mode](http://codemirror.net/mode/shell/): Better handling of nested quoting.
+
+[javascript-lint addon](http://codemirror.net/demo/lint.html): Clean up and simplify.
+
+[matchbrackets addon](http://codemirror.net/doc/manual.html#addon_matchbrackets): Fix support for multiple editors at the same time.
+
+### New features
+
+New themes: [oceanic-next](http://codemirror.net/demo/theme.html#oceanic-next) and [shadowfox](http://codemirror.net/demo/theme.html#shadowfox).
+
+## 5.33.0 (2017-12-21)
+
+### Bug fixes
+
+[lint addon](http://codemirror.net/doc/manual.html#addon_lint): Make updates more efficient.
+
+[css mode](http://codemirror.net/mode/css/): The mode is now properly case-insensitive.
+
+[continuelist addon](http://codemirror.net/doc/manual.html#addon_continuelist): Fix broken handling of unordered lists introduced in previous release.
+
+[swift](http://codemirror.net/mode/swift) and [scala](http://codemirror.net/mode/clike/) modes: Support nested block comments.
+
+[mllike mode](http://codemirror.net/mode/mllike/index.html): Improve OCaml support.
+
+[sublime bindings](http://codemirror.net/demo/sublime.html): Use the proper key bindings for `addCursorToNextLine` and `addCursorToPrevLine`.
+
+### New features
+
+[jsx mode](http://codemirror.net/mode/jsx/index.html): Support JSX fragments.
+
+[closetag addon](http://codemirror.net/demo/closetag.html): Add an option to disable auto-indenting.
+
+## 5.32.0 (2017-11-22)
+
+### Bug fixes
+
+Increase contrast on default bracket-matching colors.
+
+[javascript mode](http://codemirror.net/mode/javascript/): Recognize TypeScript type parameters for calls, type guards, and type parameter defaults. Improve handling of `enum` and `module` keywords.
+
+[comment addon](http://codemirror.net/doc/manual.html#addon_comment): Fix bug when uncommenting a comment that spans all but the last selected line.
+
+[searchcursor addon](http://codemirror.net/doc/manual.html#addon_searchcursor): Fix bug in case folding.
+
+[emacs bindings](http://codemirror.net/demo/emacs.html): Prevent single-character deletions from resetting the kill ring.
+
+[closebrackets addon](http://codemirror.net/doc/manual.html#addon_closebrackets): Tweak quote matching behavior.
+
+### New features
+
+[continuelist addon](http://codemirror.net/doc/manual.html#addon_continuelist): Increment ordered list numbers when adding one.
+
+## 5.31.0 (2017-10-20)
+
+### Bug fixes
+
+Further improve selection drawing and cursor motion in right-to-left documents.
+
+[vim bindings](http://codemirror.net/demo/vim.html): Fix ctrl-w behavior, support quote-dot and backtick-dot marks, make the wide cursor visible in contentEditable [input mode](http://codemirror.net/doc/manual.html#option_contentEditable).
+
+[continuecomment addon](http://codemirror.net/doc/manual.html#addon_continuecomment): Fix bug when pressing enter after a single-line block comment.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Fix issue with leaving indented fenced code blocks.
+
+[javascript mode](http://codemirror.net/mode/javascript/): Fix bad parsing of operators without spaces between them. Fix some corner cases around semicolon insertion and regexps.
+
+### New features
+
+Modes added with [`addOverlay`](http://codemirror.net/doc/manual.html#addOverlay) now have access to a [`baseToken`](http://codemirror.net/doc/manual.html#baseToken) method on their input stream, giving access to the tokens of the underlying mode.
+
+## 5.30.0 (2017-09-20)
+
+### Bug fixes
+
+Fixed a number of issues with drawing right-to-left selections and mouse selection in bidirectional text.
+
+[search addon](http://codemirror.net/demo/search/): Fix crash when restarting search after doing empty search.
+
+[mark-selection addon](http://cm/doc/manual.html#addon_mark-selection): Fix off-by-one bug.
+
+[tern addon](http://codemirror.net/demo/tern.html): Fix bad request made when editing at the bottom of a large document.
+
+[javascript mode](http://codemirror.net/mode/javascript/): Improve parsing in a number of corner cases.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Fix crash when a sub-mode doesn't support indentation, allow uppercase X in task lists.
+
+[gfm mode](http://codemirror.net/mode/gfm/): Don't highlight SHA1 'hashes' without numbers to avoid false positives.
+
+[soy mode](http://codemirror.net/mode/soy/): Support injected data and `@param` in comments.
+
+### New features
+
+[simple mode addon](http://codemirror.net/demo/simplemode.html): Allow groups in regexps when `token` isn't an array.
+
+## 5.29.0 (2017-08-24)
+
+### Bug fixes
+
+Fix crash in contentEditable input style when editing near a bookmark.
+
+Make sure change origins are preserved when splitting changes on [read-only marks](http://codemirror.net/doc/manual.html#mark_readOnly).
+
+[javascript mode](http://codemirror.net/mode/javascript/): More support for TypeScript syntax.
+
+[d mode](http://codemirror.net/mode/d/): Support nested comments.
+
+[python mode](http://codemirror.net/mode/python/): Improve tokenizing of operators.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Further improve CommonMark conformance.
+
+[css mode](http://codemirror.net/mode/css/): Don't run comment tokens through the mode's state machine.
+
+[shell mode](http://codemirror.net/mode/shell/): Allow strings to span lines.
+
+[search addon](http://codemirror.net/demo/search/): Fix crash in persistent search when `extraKeys` is null.
+
+## 5.28.0 (2017-07-21)
+
+### Bug fixes
+
+Fix copying of, or replacing editor content with, a single dash character when copying a big selection in some corner cases.
+
+Make [`"goLineLeft"`](http://codemirror.net/doc/manual.html#command_goLineLeft)/`"goLineRight"` behave better on wrapped lines.
+
+[sql mode](http://codemirror.net/mode/sql/): Fix tokenizing of multi-dot operator and allow digits in subfield names.
+
+[searchcursor addon](http://codemirror.net/doc/manual.html#addon_searchcursor): Fix infinite loop on some composed character inputs.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Make list parsing more CommonMark-compliant.
+
+[gfm mode](http://codemirror.net/mode/gfm/): Highlight colon syntax for emoji.
+
+### New features
+
+Expose [`startOperation`](http://codemirror.net/doc/manual.html#startOperation) and `endOperation` for explicit operation management.
+
+[sublime bindings](http://codemirror.net/demo/sublime.html): Add extend-selection (Ctrl-Alt- or Cmd-Shift-Up/Down).
+
+## 5.27.4 (2017-06-29)
+
+### Bug fixes
+
+Fix crash when using mode lookahead.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Don't block inner mode's indentation support.
+
+## 5.27.2 (2017-06-22)
+
+### Bug fixes
+
+Fix crash in the [simple mode](http://codemirror.net/demo/simplemode.html)< addon.
+
+## 5.27.0 (2017-06-22)
+
+### Bug fixes
+
+Fix infinite loop in forced display update.
+
+Properly disable the hidden textarea when `readOnly` is `"nocursor"`.
+
+Calling the `Doc` constructor without `new` works again.
+
+[sql mode](http://codemirror.net/mode/sql/): Handle nested comments.
+
+[javascript mode](http://codemirror.net/mode/javascript/): Improve support for TypeScript syntax.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Fix bug where markup was ignored on indented paragraph lines.
+
+[vim bindings](http://codemirror.net/demo/vim.html): Referencing invalid registers no longer causes an uncaught exception.
+
+[rust mode](http://codemirror.net/mode/rust/): Add the correct MIME type.
+
+[matchbrackets addon](http://codemirror.net/doc/manual.html#addon_matchbrackets): Document options.
+
+### New features
+
+Mouse button clicks can now be bound in keymaps by using names like `"LeftClick"` or `"Ctrl-Alt-MiddleTripleClick"`. When bound to a function, that function will be passed the position of the click as second argument.
+
+The behavior of mouse selection and dragging can now be customized with the [`configureMouse`](http://codemirror.net/doc/manual.html#option_configureMouse) option.
+
+Modes can now look ahead across line boundaries with the [`StringStream`](http://codemirror.net/doc/manual.html#StringStream)`.lookahead` method.
+
+Introduces a `"type"` token type, makes modes that recognize types output it, and add styling for it to the themes.
+
+New [`pasteLinesPerSelection`](http://codemirror.net/doc/manual.html#option_pasteLinesPerSelection) option to control the behavior of pasting multiple lines into multiple selections.
+
+[searchcursor addon](http://codemirror.net/doc/manual.html#addon_searchcursor): Support multi-line regular expression matches, and normalize strings when matching.
+
+## 5.26.0 (2017-05-22)
+
+### Bug fixes
+
+In textarea-mode, don't reset the input field during composition.
+
+More careful restoration of selections in widgets, during editor redraw.
+
+[javascript mode](http://codemirror.net/mode/javascript/): More TypeScript parsing fixes.
+
+[julia mode](http://codemirror.net/mode/julia/): Fix issue where the mode gets stuck.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Understand cross-line links, parse all bracketed things as links.
+
+[soy mode](http://codemirror.net/mode/soy/): Support single-quoted strings.
+
+[go mode](http://codemirror.net/mode/go/): Don't try to indent inside strings or comments.
+
+### New features
+
+[vim bindings](http://codemirror.net/demo/vim.html): Parse line offsets in line or range specs.
+
+## 5.25.2 (2017-04-20)
+
+### Bug fixes
+
+Better handling of selections that cover the whole viewport in contentEditable-mode.
+
+No longer accidentally scroll the editor into view when calling `setValue`.
+
+Work around Chrome Android bug when converting screen coordinates to editor positions.
+
+Make sure long-clicking a selection sets a cursor and doesn't show the editor losing focus.
+
+Fix issue where pointer events were incorrectly disabled on Chrome's overlay scrollbars.
+
+[javascript mode](http://codemirror.net/mode/javascript/): Recognize annotations and TypeScript-style type parameters.
+
+[shell mode](http://codemirror.net/mode/shell/): Handle nested braces.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Make parsing of strong/em delimiters CommonMark-compliant.
+
+## 5.25.0 (2017-03-20)
+
+### Bug fixes
+
+In contentEditable-mode, properly locate changes that repeat a character when inserted with IME.
+
+Fix handling of selections bigger than the viewport in contentEditable mode.
+
+Improve handling of changes that insert or delete lines in contentEditable mode.
+
+Count Unicode control characters 0x80 to 0x9F as special (non-printing) chars.
+
+Fix handling of shadow DOM roots when finding the active element.
+
+Add `role=presentation` to more DOM elements to improve screen reader support.
+
+[merge addon](http://codemirror.net/doc/manual.html#addon_merge): Make aligning of unchanged chunks more robust.
+
+[comment addon](http://codemirror.net/doc/manual.html#addon_comment): Fix comment-toggling on a block of text that starts and ends in a (differnet) block comment.
+
+[javascript mode](http://codemirror.net/mode/javascript/): Improve support for TypeScript syntax.
+
+[r mode](http://codemirror.net/mode/r/): Fix indentation after semicolon-less statements.
+
+[shell mode](http://codemirror.net/mode/shell/): Properly handle escaped parentheses in parenthesized expressions.
+
+[markdown mode](http://codemirror.net/mode/markdown/): Fix a few bugs around leaving fenced code blocks.
+
+[soy mode](http://codemirror.net/mode/soy/): Improve indentation.
+
+### New features
+
+[lint addon](http://codemirror.net/doc/manual.html#addon_lint): Support asynchronous linters that return promises.
+
+[continuelist addon](http://codemirror.net/doc/manual.html#addon_continuelist): Support continuing task lists.
+
+[vim bindings](http://codemirror.net/demo/vim.html): Make Y behave like yy.
+
+[sql mode](http://codemirror.net/mode/sql/): Support sqlite dialect.
+
 ## 5.24.2 (2017-02-22)
 
 ### Bug fixes
@@ -40,7 +374,7 @@ Fix bug in handling of read-only marked text.
 
 Positions now support a `sticky` property which determines whether they should be associated with the character before (value `"before"`) or after (value `"after"`) them.
 
-[vim bindings](http://codemirror.net/mode/demo/vim.html): Make it possible to remove built-in bindings through the API.
+[vim bindings](http://codemirror.net/demo/vim.html): Make it possible to remove built-in bindings through the API.
 
 [comment addon](http://codemirror.net/doc/manual.html#addon_comment): Support a per-mode <code>useInnerComments</code> option to optionally suppress descending to the inner modes to get comment strings.
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.xml
index 9b9f66232c8b80ec826d23aea60c60e24d46289b..81fb38ccc2b93b288e3420a5e209f765276bbc68 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CHANGELOG.md.xml
@@ -2,29 +2,25 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
         <item>
             <key> <string>__name__</string> </key>
             <value> <string>CHANGELOG.md</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.txt
similarity index 95%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.bin
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.txt
index c4cd019a7c2fc32791ad95e3327969cd94184a9a..1b0b104d3a088303a045eec9020e3089a2561d88 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.bin
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.txt
@@ -47,6 +47,10 @@ should be asked on the
 
 ## Contributing code
 
+Note that we are not accepting any new addons or modes into the main
+distribution. If you've written such a module, please distribute it as
+a separate NPM package.
+
 - Make sure you have a [GitHub Account](https://github.com/signup/free)
 - Fork [CodeMirror](https://github.com/codemirror/CodeMirror/)
   ([how to fork a repo](https://help.github.com/articles/fork-a-repo))
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.xml
index c38b8c297c4eded89bfe3a3fe54d84925e621f52..83c5f21761b1d33c16c2bec48ca6bd27546b7d54 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/CONTRIBUTING.md.xml
@@ -2,29 +2,25 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
         <item>
             <key> <string>__name__</string> </key>
             <value> <string>CONTRIBUTING.md</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/LICENSE.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/LICENSE.txt
similarity index 100%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/LICENSE.bin
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/LICENSE.txt
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/LICENSE.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/LICENSE.xml
index 529339155d596fbb892641c75eac4ee3db507d15..ae2311dfa42d1c72d1d72af7c9d24145a5ee5554 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/LICENSE.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/LICENSE.xml
@@ -2,29 +2,25 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
         <item>
             <key> <string>__name__</string> </key>
             <value> <string>LICENSE</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.txt
similarity index 92%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.bin
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.txt
index 3328e3bdfb99cb7155c2b35b97db99deb6757111..a3a351be4d86fcf92c88dd42c3d3708bcadc57f0 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.bin
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.txt
@@ -7,7 +7,8 @@
 CodeMirror is a versatile text editor implemented in JavaScript for
 the browser. It is specialized for editing code, and comes with over
 100 language modes and various addons that implement more advanced
-editing functionality.
+editing functionality. Every language comes with fully-featured code
+and syntax highlighting to help with reading and editing complex code.
 
 A rich programming API and a CSS theming system are available for
 customizing CodeMirror to fit your application, and extending it with
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.xml
index 28371d3c93d61df58cf7063d387c89d3d34bb93f..52117bd9d916d7332172dbc13a66feee4aab3346 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/README.md.xml
@@ -2,29 +2,25 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
         <item>
             <key> <string>__name__</string> </key>
             <value> <string>README.md</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/closebrackets.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/closebrackets.js.js
index 01fdd96ce1a6ba31a1aa39000c27a5df13c23e32..86b2fe1c95a932f803bc7e560f0466d3e8ba5f78 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/closebrackets.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/closebrackets.js.js
@@ -23,6 +23,7 @@
       cm.state.closeBrackets = null;
     }
     if (val) {
+      ensureBound(getOption(val, "pairs"))
       cm.state.closeBrackets = val;
       cm.addKeyMap(keyMap);
     }
@@ -34,10 +35,14 @@
     return defaults[name];
   }
 
-  var bind = defaults.pairs + "`";
   var keyMap = {Backspace: handleBackspace, Enter: handleEnter};
-  for (var i = 0; i < bind.length; i++)
-    keyMap["'" + bind.charAt(i) + "'"] = handler(bind.charAt(i));
+  function ensureBound(chars) {
+    for (var i = 0; i < chars.length; i++) {
+      var ch = chars.charAt(i), key = "'" + ch + "'"
+      if (!keyMap[key]) keyMap[key] = handler(ch)
+    }
+  }
+  ensureBound(defaults.pairs + "`")
 
   function handler(ch) {
     return function(cm) { return handleChar(cm, ch); };
@@ -79,7 +84,8 @@
       if (!around || explode.indexOf(around) % 2 != 0) return CodeMirror.Pass;
     }
     cm.operation(function() {
-      cm.replaceSelection("\n\n", null);
+      var linesep = cm.lineSeparator() || "\n";
+      cm.replaceSelection(linesep + linesep, null);
       cm.execCommand("goCharLeft");
       ranges = cm.listSelections();
       for (var i = 0; i < ranges.length; i++) {
@@ -123,11 +129,12 @@
         else
           curType = "skip";
       } else if (identical && cur.ch > 1 && triples.indexOf(ch) >= 0 &&
-                 cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch &&
-                 (cur.ch <= 2 || cm.getRange(Pos(cur.line, cur.ch - 3), Pos(cur.line, cur.ch - 2)) != ch)) {
+                 cm.getRange(Pos(cur.line, cur.ch - 2), cur) == ch + ch) {
+        if (cur.ch > 2 && /\bstring/.test(cm.getTokenTypeAt(Pos(cur.line, cur.ch - 2)))) return CodeMirror.Pass;
         curType = "addFour";
       } else if (identical) {
-        if (!CodeMirror.isWordChar(next) && enteringString(cm, cur, ch)) curType = "both";
+        var prev = cur.ch == 0 ? " " : cm.getRange(Pos(cur.line, cur.ch - 1), cur)
+        if (!CodeMirror.isWordChar(next) && prev != ch && !CodeMirror.isWordChar(prev)) curType = "both";
         else return CodeMirror.Pass;
       } else if (opening && (cm.getLine(cur.line).length == cur.ch ||
                              isClosingBracket(next, pairs) ||
@@ -179,24 +186,9 @@
     return str.length == 2 ? str : null;
   }
 
-  // Project the token type that will exists after the given char is
-  // typed, and use it to determine whether it would cause the start
-  // of a string token.
-  function enteringString(cm, pos, ch) {
-    var line = cm.getLine(pos.line);
-    var token = cm.getTokenAt(pos);
-    if (/\bstring2?\b/.test(token.type) || stringStartsAfter(cm, pos)) return false;
-    var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
-    stream.pos = stream.start = token.start;
-    for (;;) {
-      var type1 = cm.getMode().token(stream, token.state);
-      if (stream.pos >= pos.ch + 1) return /\bstring2?\b/.test(type1);
-      stream.start = stream.pos;
-    }
-  }
-
   function stringStartsAfter(cm, pos) {
     var token = cm.getTokenAt(Pos(pos.line, pos.ch + 1))
-    return /\bstring/.test(token.type) && token.start == pos.ch
+    return /\bstring/.test(token.type) && token.start == pos.ch &&
+      (pos.ch == 0 || !/\bstring/.test(cm.getTokenTypeAt(pos)))
   }
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/closetag.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/closetag.js.js
index a518da3ec12aae850d45c61cfbe4da3f25882ce7..83f133a5e74b256d3b1916ef7b69590306358120 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/closetag.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/closetag.js.js
@@ -53,13 +53,14 @@
   function autoCloseGT(cm) {
     if (cm.getOption("disableInput")) return CodeMirror.Pass;
     var ranges = cm.listSelections(), replacements = [];
+    var opt = cm.getOption("autoCloseTags");
     for (var i = 0; i < ranges.length; i++) {
       if (!ranges[i].empty()) return CodeMirror.Pass;
       var pos = ranges[i].head, tok = cm.getTokenAt(pos);
       var inner = CodeMirror.innerMode(cm.getMode(), tok.state), state = inner.state;
       if (inner.mode.name != "xml" || !state.tagName) return CodeMirror.Pass;
 
-      var opt = cm.getOption("autoCloseTags"), html = inner.mode.configuration == "html";
+      var html = inner.mode.configuration == "html";
       var dontCloseTags = (typeof opt == "object" && opt.dontCloseTags) || (html && htmlDontClose);
       var indentTags = (typeof opt == "object" && opt.indentTags) || (html && htmlIndent);
 
@@ -81,13 +82,14 @@
                          newPos: indent ? CodeMirror.Pos(pos.line + 1, 0) : CodeMirror.Pos(pos.line, pos.ch + 1)};
     }
 
+    var dontIndentOnAutoClose = (typeof opt == "object" && opt.dontIndentOnAutoClose);
     for (var i = ranges.length - 1; i >= 0; i--) {
       var info = replacements[i];
       cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, "+insert");
       var sel = cm.listSelections().slice(0);
       sel[i] = {head: info.newPos, anchor: info.newPos};
       cm.setSelections(sel);
-      if (info.indent) {
+      if (!dontIndentOnAutoClose && info.indent) {
         cm.indentLine(info.newPos.line, null, true);
         cm.indentLine(info.newPos.line + 1, null, true);
       }
@@ -97,6 +99,8 @@
   function autoCloseCurrent(cm, typingSlash) {
     var ranges = cm.listSelections(), replacements = [];
     var head = typingSlash ? "/" : "</";
+    var opt = cm.getOption("autoCloseTags");
+    var dontIndentOnAutoClose = (typeof opt == "object" && opt.dontIndentOnSlash);
     for (var i = 0; i < ranges.length; i++) {
       if (!ranges[i].empty()) return CodeMirror.Pass;
       var pos = ranges[i].head, tok = cm.getTokenAt(pos);
@@ -127,9 +131,11 @@
     }
     cm.replaceSelections(replacements);
     ranges = cm.listSelections();
-    for (var i = 0; i < ranges.length; i++)
-      if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
-        cm.indentLine(ranges[i].head.line);
+    if (!dontIndentOnAutoClose) {
+        for (var i = 0; i < ranges.length; i++)
+            if (i == ranges.length - 1 || ranges[i].head.line < ranges[i + 1].head.line)
+                cm.indentLine(ranges[i].head.line);
+    }
   }
 
   function autoCloseSlash(cm) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/continuelist.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/continuelist.js.js
index 5a845907d7b8d15f5cb9dc22c0fec1b8bf52b2e1..4e7d39287429c5bb77e4d68f8644518cfc227062 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/continuelist.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/continuelist.js.js
@@ -11,8 +11,8 @@
 })(function(CodeMirror) {
   "use strict";
 
-  var listRE = /^(\s*)(>[> ]*|- \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,
-      emptyListRE = /^(\s*)(>[> ]*|- \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,
+  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,
+      emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,
       unorderedListRE = /[*+-]\s/;
 
   CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
@@ -25,7 +25,8 @@
       var inQuote = eolState.quote !== 0;
 
       var line = cm.getLine(pos.line), match = listRE.exec(line);
-      if (!ranges[i].empty() || (!inList && !inQuote) || !match) {
+      var cursorBeforeBullet = /^\s*$/.test(line.slice(0, pos.ch));
+      if (!ranges[i].empty() || (!inList && !inQuote) || !match || cursorBeforeBullet) {
         cm.execCommand("newlineAndIndent");
         return;
       }
@@ -38,14 +39,51 @@
         replacements[i] = "\n";
       } else {
         var indent = match[1], after = match[5];
-        var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
-          ? match[2].replace("x", " ")
-          : (parseInt(match[3], 10) + 1) + match[4];
-
+        var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
+        var bullet = numbered ? (parseInt(match[3], 10) + 1) + match[4] : match[2].replace("x", " ");
         replacements[i] = "\n" + indent + bullet + after;
+
+        if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
       }
     }
 
     cm.replaceSelections(replacements);
   };
+
+  // Auto-updating Markdown list numbers when a new item is added to the
+  // middle of a list
+  function incrementRemainingMarkdownListNumbers(cm, pos) {
+    var startLine = pos.line, lookAhead = 0, skipCount = 0;
+    var startItem = listRE.exec(cm.getLine(startLine)), startIndent = startItem[1];
+
+    do {
+      lookAhead += 1;
+      var nextLineNumber = startLine + lookAhead;
+      var nextLine = cm.getLine(nextLineNumber), nextItem = listRE.exec(nextLine);
+
+      if (nextItem) {
+        var nextIndent = nextItem[1];
+        var newNumber = (parseInt(startItem[3], 10) + lookAhead - skipCount);
+        var nextNumber = (parseInt(nextItem[3], 10)), itemNumber = nextNumber;
+
+        if (startIndent === nextIndent && !isNaN(nextNumber)) {
+          if (newNumber === nextNumber) itemNumber = nextNumber + 1;
+          if (newNumber > nextNumber) itemNumber = newNumber + 1;
+          cm.replaceRange(
+            nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
+          {
+            line: nextLineNumber, ch: 0
+          }, {
+            line: nextLineNumber, ch: nextLine.length
+          });
+        } else {
+          if (startIndent.length > nextIndent.length) return;
+          // This doesn't run if the next line immediatley indents, as it is
+          // not clear of the users intention (new indented item or same level)
+          if ((startIndent.length < nextIndent.length) && (lookAhead === 1)) return;
+          skipCount += 1;
+        }
+      }
+    } while (nextItem);
+  }
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/matchbrackets.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/matchbrackets.js.js
index 76754ed557fe03c0449cbadd4b927151a3be898d..c9851bda31f22a4950807ecd1e8fefdc149d9269 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/matchbrackets.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/cm_edit/matchbrackets.js.js
@@ -16,12 +16,21 @@
 
   var matching = {"(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<"};
 
-  function findMatchingBracket(cm, where, strict, config) {
+  function findMatchingBracket(cm, where, config) {
     var line = cm.getLineHandle(where.line), pos = where.ch - 1;
-    var match = (pos >= 0 && matching[line.text.charAt(pos)]) || matching[line.text.charAt(++pos)];
+    var afterCursor = config && config.afterCursor
+    if (afterCursor == null)
+      afterCursor = /(^| )cm-fat-cursor($| )/.test(cm.getWrapperElement().className)
+
+    // A cursor is defined as between two characters, but in in vim command mode
+    // (i.e. not insert mode), the cursor is visually represented as a
+    // highlighted box on top of the 2nd character. Otherwise, we allow matches
+    // from before or after the cursor.
+    var match = (!afterCursor && pos >= 0 && matching[line.text.charAt(pos)]) ||
+        matching[line.text.charAt(++pos)];
     if (!match) return null;
     var dir = match.charAt(1) == ">" ? 1 : -1;
-    if (strict && (dir > 0) != (pos == where.ch)) return null;
+    if (config && config.strict && (dir > 0) != (pos == where.ch)) return null;
     var style = cm.getTokenTypeAt(Pos(where.line, pos + 1));
 
     var found = scanForBracket(cm, Pos(where.line, pos + (dir > 0 ? 1 : 0)), dir, style || null, config);
@@ -69,7 +78,7 @@
     var maxHighlightLen = cm.state.matchBrackets.maxHighlightLineLength || 1000;
     var marks = [], ranges = cm.listSelections();
     for (var i = 0; i < ranges.length; i++) {
-      var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, false, config);
+      var match = ranges[i].empty() && findMatchingBracket(cm, ranges[i].head, config);
       if (match && cm.getLine(match.from.line).length <= maxHighlightLen) {
         var style = match.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
         marks.push(cm.markText(match.from, Pos(match.from.line, match.from.ch + 1), {className: style}));
@@ -93,18 +102,23 @@
     }
   }
 
-  var currentlyHighlighted = null;
   function doMatchBrackets(cm) {
     cm.operation(function() {
-      if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
-      currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
+      if (cm.state.matchBrackets.currentlyHighlighted) {
+        cm.state.matchBrackets.currentlyHighlighted();
+        cm.state.matchBrackets.currentlyHighlighted = null;
+      }
+      cm.state.matchBrackets.currentlyHighlighted = matchBrackets(cm, false, cm.state.matchBrackets);
     });
   }
 
   CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
     if (old && old != CodeMirror.Init) {
       cm.off("cursorActivity", doMatchBrackets);
-      if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
+      if (cm.state.matchBrackets && cm.state.matchBrackets.currentlyHighlighted) {
+        cm.state.matchBrackets.currentlyHighlighted();
+        cm.state.matchBrackets.currentlyHighlighted = null;
+      }
     }
     if (val) {
       cm.state.matchBrackets = typeof val == "object" ? val : {};
@@ -113,8 +127,17 @@
   });
 
   CodeMirror.defineExtension("matchBrackets", function() {matchBrackets(this, true);});
-  CodeMirror.defineExtension("findMatchingBracket", function(pos, strict, config){
-    return findMatchingBracket(this, pos, strict, config);
+  CodeMirror.defineExtension("findMatchingBracket", function(pos, config, oldConfig){
+    // Backwards-compatibility kludge
+    if (oldConfig || typeof config == "boolean") {
+      if (!oldConfig) {
+        config = config ? {strict: true} : null
+      } else {
+        oldConfig.strict = config
+        config = oldConfig
+      }
+    }
+    return findMatchingBracket(this, pos, config)
   });
   CodeMirror.defineExtension("scanForBracket", function(pos, dir, style, config){
     return scanForBracket(this, pos, dir, style, config);
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/comment/comment.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/comment/comment.js.js
index 1c9878716f7a233417a34b26cd14801cfe2a8eb4..84c67edf7898a01033fb58935f3e1112037a79db 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/comment/comment.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/comment/comment.js.js
@@ -46,7 +46,7 @@
 
   // Rough heuristic to try and detect lines that are part of multi-line string
   function probablyInsideString(cm, pos, line) {
-    return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"`]/.test(line)
+    return /\bstring\b/.test(cm.getTokenTypeAt(Pos(pos.line, 0))) && !/^[\'\"\`]/.test(line)
   }
 
   function getMode(cm, pos) {
@@ -172,13 +172,11 @@
     if (open == -1) return false
     var endLine = end == start ? startLine : self.getLine(end)
     var close = endLine.indexOf(endString, end == start ? open + startString.length : 0);
-    if (close == -1 && start != end) {
-      endLine = self.getLine(--end);
-      close = endLine.indexOf(endString);
-    }
+    var insideStart = Pos(start, open + 1), insideEnd = Pos(end, close + 1)
     if (close == -1 ||
-        !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) ||
-        !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1))))
+        !/comment/.test(self.getTokenTypeAt(insideStart)) ||
+        !/comment/.test(self.getTokenTypeAt(insideEnd)) ||
+        self.getRange(insideStart, insideEnd, "\n").indexOf(endString) > -1)
       return false;
 
     // Avoid killing block comments completely outside the selection.
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/comment/continuecomment.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/comment/continuecomment.js.js
index b11d51e6ca573c91184be8611c802adbd9f25c0d..d92318b3459667af86dd48d4dee20cd3aaceec54 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/comment/continuecomment.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/comment/continuecomment.js.js
@@ -9,39 +9,32 @@
   else // Plain browser env
     mod(CodeMirror);
 })(function(CodeMirror) {
-  var modes = ["clike", "css", "javascript"];
-
-  for (var i = 0; i < modes.length; ++i)
-    CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "});
-
   function continueComment(cm) {
     if (cm.getOption("disableInput")) return CodeMirror.Pass;
     var ranges = cm.listSelections(), mode, inserts = [];
     for (var i = 0; i < ranges.length; i++) {
-      var pos = ranges[i].head, token = cm.getTokenAt(pos);
-      if (token.type != "comment") return CodeMirror.Pass;
-      var modeHere = CodeMirror.innerMode(cm.getMode(), token.state).mode;
+      var pos = ranges[i].head
+      if (!/\bcomment\b/.test(cm.getTokenTypeAt(pos))) return CodeMirror.Pass;
+      var modeHere = cm.getModeAt(pos)
       if (!mode) mode = modeHere;
       else if (mode != modeHere) return CodeMirror.Pass;
 
       var insert = null;
       if (mode.blockCommentStart && mode.blockCommentContinue) {
-        var end = token.string.indexOf(mode.blockCommentEnd);
-        var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found;
-        if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) {
+        var line = cm.getLine(pos.line).slice(0, pos.ch)
+        var end = line.lastIndexOf(mode.blockCommentEnd), found
+        if (end != -1 && end == pos.ch - mode.blockCommentEnd.length) {
           // Comment ended, don't continue it
-        } else if (token.string.indexOf(mode.blockCommentStart) == 0) {
-          insert = full.slice(0, token.start);
-          if (!/^\s*$/.test(insert)) {
-            insert = "";
-            for (var j = 0; j < token.start; ++j) insert += " ";
+        } else if ((found = line.lastIndexOf(mode.blockCommentStart)) > -1 && found > end) {
+          insert = line.slice(0, found)
+          if (/\S/.test(insert)) {
+            insert = ""
+            for (var j = 0; j < found; ++j) insert += " "
           }
-        } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 &&
-                   found + mode.blockCommentContinue.length > token.start &&
-                   /^\s*$/.test(full.slice(0, found))) {
-          insert = full.slice(0, found);
+        } else if ((found = line.indexOf(mode.blockCommentContinue)) > -1 && !/\S/.test(line.slice(0, found))) {
+          insert = line.slice(0, found)
         }
-        if (insert != null) insert += mode.blockCommentContinue;
+        if (insert != null) insert += mode.blockCommentContinue
       }
       if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) {
         var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment);
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/dialog/dialog.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/dialog/dialog.css.xml
index 5b4262a8bd6b2ad820f8c3517d9c9859f7b53869..e00cc67ffd6e094fe19094227c79ee12ff4fc0c6 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/dialog/dialog.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/dialog/dialog.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>dialog.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/fullscreen.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/fullscreen.css.xml
index 23a8f2318a79e3e6cd46dc41c9c68d970f7f7d66..b0e268c1023aadafde8a8697745f17f46832c0e5 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/fullscreen.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/fullscreen.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>fullscreen.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/panel.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/panel.js.js
index 74199ff059da7a27548c3e6dff2ce5f473c2bfb9..f88d152b8018ba8e6cdb85267f25abecdea9cb47 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/panel.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/panel.js.js
@@ -66,7 +66,7 @@
   Panel.prototype.changed = function(height) {
     var newHeight = height == null ? this.node.offsetHeight : height;
     var info = this.cm.state.panels;
-    this.cm._setSize(null, info.height += (newHeight - this.height));
+    this.cm._setSize(null, info.heightLeft -= (newHeight - this.height));
     this.height = newHeight;
   };
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/placeholder.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/placeholder.js.js
index 2f8b1f84ae0cf1893991358742cc2a4bebe6e118..65753ebf3f372886738e2e044653b1fa71a7c3a9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/placeholder.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/display/placeholder.js.js
@@ -38,6 +38,7 @@
     clearPlaceholder(cm);
     var elt = cm.state.placeholder = document.createElement("pre");
     elt.style.cssText = "height: 0; overflow: visible";
+    elt.style.direction = cm.getOption("direction");
     elt.className = "CodeMirror-placeholder";
     var placeHolder = cm.getOption("placeholder")
     if (typeof placeHolder == "string") placeHolder = document.createTextNode(placeHolder)
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/foldcode.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/foldcode.js.js
index 78b36c4641985eafc6f040c86cfebe4bee9dc7ae..826766b69fc1c743ca569cdd06943cba2dd10083 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/foldcode.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/foldcode.js.js
@@ -65,6 +65,8 @@
       widget = document.createElement("span");
       widget.appendChild(text);
       widget.className = "CodeMirror-foldmarker";
+    } else if (widget) {
+      widget = widget.cloneNode(true)
     }
     return widget;
   }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/foldgutter.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/foldgutter.css.xml
index 617a8df19c8ae4bd85399eacdacc8a1444a84228..901ac2cdc9c03a00ff8c90e4fff4961d782b5c6c 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/foldgutter.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/foldgutter.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>foldgutter.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/indent-fold.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/indent-fold.js.js
index 743150c6238e0815010c56aca599559cb2052b6b..f93edec22c1fb8b839a84c8092a83162c7a39578 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/indent-fold.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/indent-fold.js.js
@@ -18,7 +18,7 @@ function lineIndent(cm, lineNo) {
     return -1
   return CodeMirror.countColumn(text, null, cm.getOption("tabSize"))
 }
-               !
+
 CodeMirror.registerHelper("fold", "indent", function(cm, start) {
   var myIndent = lineIndent(cm, start.line)
   if (myIndent < 0) return
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/xml-fold.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/xml-fold.js.js
index 75a9e305bd9c2cecad61c570ee9e48714cf6bc13..f4be78602ee56b7c8a0d53191e0ebff560acfc76 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/xml-fold.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/fold/xml-fold.js.js
@@ -138,7 +138,7 @@
     var iter = new Iter(cm, start.line, 0);
     for (;;) {
       var openTag = toNextTag(iter), end;
-      if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;
+      if (!openTag || !(end = toTagEnd(iter)) || iter.line != start.line) return;
       if (!openTag[1] && end != "selfClose") {
         var startPos = Pos(iter.line, iter.ch);
         var endPos = findMatchingClose(iter, openTag[2]);
@@ -163,10 +163,10 @@
     }
   };
 
-  CodeMirror.findEnclosingTag = function(cm, pos, range) {
+  CodeMirror.findEnclosingTag = function(cm, pos, range, tag) {
     var iter = new Iter(cm, pos.line, pos.ch, range);
     for (;;) {
-      var open = findMatchingOpen(iter);
+      var open = findMatchingOpen(iter, tag);
       if (!open) break;
       var forward = new Iter(cm, pos.line, pos.ch, range);
       var close = findMatchingClose(forward, open.tag);
@@ -174,7 +174,7 @@
     }
   };
 
-  // Used by addon/edit/closetag.js
+  // Used by addon/cm_edit/closetag.js
   CodeMirror.scanForClosingTag = function(cm, pos, name, end) {
     var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null);
     return findMatchingClose(iter, name);
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/javascript-hint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/javascript-hint.js.js
index d7088c191b16022ef622d25ebf93c6f6da5afb07..f6ab2a2e8975122685fd35b17c0f449af0aa7b07 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/javascript-hint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/javascript-hint.js.js
@@ -32,7 +32,9 @@
     // Find the token at the cursor
     var cur = editor.getCursor(), token = getToken(editor, cur);
     if (/\b(?:string|comment)\b/.test(token.type)) return;
-    token.state = CodeMirror.innerMode(editor.getMode(), token.state).state;
+    var innerMode = CodeMirror.innerMode(editor.getMode(), token.state);
+    if (innerMode.mode.helperType === "json") return;
+    token.state = innerMode.state;
 
     // If it's not a 'word-style' token, ignore the token.
     if (!/^[\w$_]*$/.test(token.string)) {
@@ -92,8 +94,8 @@
   var arrayProps = ("length concat join splice push pop shift unshift slice reverse sort indexOf " +
                     "lastIndexOf every some filter forEach map reduce reduceRight ").split(" ");
   var funcProps = "prototype apply call bind".split(" ");
-  var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " +
-                  "if in instanceof new null return switch throw true try typeof var void while with").split(" ");
+  var javascriptKeywords = ("break case catch class const continue debugger default delete do else export extends false finally for function " +
+                  "if in import instanceof new null return super switch this throw true try typeof var void while with yield").split(" ");
   var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " +
                   "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" ");
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/show-hint.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/show-hint.css.xml
index 76c95d924c815e3b2b605a97e1a602e68a8c56a2..176849d384c08d4847d62031743ffdd8a1ee9d07 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/show-hint.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/show-hint.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>show-hint.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/show-hint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/show-hint.js.js
index 604bd3b715550860b63f1fff38117f7259e3feae..81a63fc9921e88b2739ae9c533c800ae8cbcb432 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/show-hint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/show-hint.js.js
@@ -121,7 +121,6 @@
       var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle);
       if (this.widget) this.widget.close();
 
-      if (data && this.data && isNewCompletion(this.data, data)) return;
       this.data = data;
 
       if (data && data.list.length) {
@@ -135,11 +134,6 @@
     }
   };
 
-  function isNewCompletion(old, nw) {
-    var moved = CodeMirror.cmpPos(nw.from, old.from)
-    return moved > 0 && old.to.ch - old.from.ch != nw.to.ch - nw.from.ch
-  }
-
   function parseOptions(cm, pos, options) {
     var editor = cm.options.hintOptions;
     var out = {};
@@ -302,7 +296,7 @@
       setTimeout(function(){cm.focus();}, 20);
     });
 
-    CodeMirror.signal(data, "select", completions[0], hints.firstChild);
+    CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]);
     return true;
   }
 
@@ -403,12 +397,13 @@
   });
 
   CodeMirror.registerHelper("hint", "fromList", function(cm, options) {
-    var cur = cm.getCursor(), token = cm.getTokenAt(cur);
-    var to = CodeMirror.Pos(cur.line, token.end);
-    if (token.string && /\w/.test(token.string[token.string.length - 1])) {
-      var term = token.string, from = CodeMirror.Pos(cur.line, token.start);
+    var cur = cm.getCursor(), token = cm.getTokenAt(cur)
+    var term, from = CodeMirror.Pos(cur.line, token.start), to = cur
+    if (token.start < cur.ch && /\w/.test(token.string.charAt(cur.ch - token.start - 1))) {
+      term = token.string.substr(0, cur.ch - token.start)
     } else {
-      var term = "", from = to;
+      term = ""
+      from = cur
     }
     var found = [];
     for (var i = 0; i < options.words.length; i++) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/sql-hint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/sql-hint.js.js
index 1ee4f0bbed06f1d1595a58b077915b6b39fda19a..5d20eea625420c7571d27b2b9325241922a45642 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/sql-hint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/hint/sql-hint.js.js
@@ -14,6 +14,7 @@
   var tables;
   var defaultTable;
   var keywords;
+  var identifierQuote;
   var CONS = {
     QUERY_DIV: ";",
     ALIAS_KEYWORD: "AS"
@@ -28,6 +29,12 @@
     return CodeMirror.resolveMode(mode).keywords;
   }
 
+  function getIdentifierQuote(editor) {
+    var mode = editor.doc.modeOption;
+    if (mode === "sql") mode = "text/x-sql";
+    return CodeMirror.resolveMode(mode).identifierQuote || "`";
+  }
+
   function getText(item) {
     return typeof item == "string" ? item : item.text;
   }
@@ -86,17 +93,25 @@
   }
 
   function cleanName(name) {
-    // Get rid name from backticks(`) and preceding dot(.)
+    // Get rid name from identifierQuote and preceding dot(.)
     if (name.charAt(0) == ".") {
       name = name.substr(1);
     }
-    return name.replace(/`/g, "");
+    // replace doublicated identifierQuotes with single identifierQuotes
+    // and remove single identifierQuotes
+    var nameParts = name.split(identifierQuote+identifierQuote);
+    for (var i = 0; i < nameParts.length; i++)
+      nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,"g"), "");
+    return nameParts.join(identifierQuote);
   }
 
-  function insertBackticks(name) {
+  function insertIdentifierQuotes(name) {
     var nameParts = getText(name).split(".");
     for (var i = 0; i < nameParts.length; i++)
-      nameParts[i] = "`" + nameParts[i] + "`";
+      nameParts[i] = identifierQuote +
+        // doublicate identifierQuotes
+        nameParts[i].replace(new RegExp(identifierQuote,"g"), identifierQuote+identifierQuote) +
+        identifierQuote;
     var escaped = nameParts.join(".");
     if (typeof name == "string") return escaped;
     name = shallowClone(name);
@@ -106,13 +121,13 @@
 
   function nameCompletion(cur, token, result, editor) {
     // Try to complete table, column names and return start position of completion
-    var useBacktick = false;
+    var useIdentifierQuotes = false;
     var nameParts = [];
     var start = token.start;
     var cont = true;
     while (cont) {
       cont = (token.string.charAt(0) == ".");
-      useBacktick = useBacktick || (token.string.charAt(0) == "`");
+      useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote);
 
       start = token.start;
       nameParts.unshift(cleanName(token.string));
@@ -127,12 +142,12 @@
     // Try to complete table names
     var string = nameParts.join(".");
     addMatches(result, string, tables, function(w) {
-      return useBacktick ? insertBackticks(w) : w;
+      return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
     });
 
     // Try to complete columns from defaultTable
     addMatches(result, string, defaultTable, function(w) {
-      return useBacktick ? insertBackticks(w) : w;
+      return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
     });
 
     // Try to complete columns
@@ -162,7 +177,7 @@
           w = shallowClone(w);
           w.text = tableInsert + "." + w.text;
         }
-        return useBacktick ? insertBackticks(w) : w;
+        return useIdentifierQuotes ? insertIdentifierQuotes(w) : w;
       });
     }
 
@@ -170,12 +185,9 @@
   }
 
   function eachWord(lineText, f) {
-    if (!lineText) return;
-    var excepted = /[,;]/g;
-    var words = lineText.split(" ");
-    for (var i = 0; i < words.length; i++) {
-      f(words[i]?words[i].replace(excepted, '') : '');
-    }
+    var words = lineText.split(/\s+/)
+    for (var i = 0; i < words.length; i++)
+      if (words[i]) f(words[i].replace(/[,;]/g, ''))
   }
 
   function findTableByAlias(alias, editor) {
@@ -210,18 +222,20 @@
       prevItem = separator[i];
     }
 
-    var query = doc.getRange(validRange.start, validRange.end, false);
-
-    for (var i = 0; i < query.length; i++) {
-      var lineText = query[i];
-      eachWord(lineText, function(word) {
-        var wordUpperCase = word.toUpperCase();
-        if (wordUpperCase === aliasUpperCase && getTable(previousWord))
-          table = previousWord;
-        if (wordUpperCase !== CONS.ALIAS_KEYWORD)
-          previousWord = word;
-      });
-      if (table) break;
+    if (validRange.start) {
+      var query = doc.getRange(validRange.start, validRange.end, false);
+
+      for (var i = 0; i < query.length; i++) {
+        var lineText = query[i];
+        eachWord(lineText, function(word) {
+          var wordUpperCase = word.toUpperCase();
+          if (wordUpperCase === aliasUpperCase && getTable(previousWord))
+            table = previousWord;
+          if (wordUpperCase !== CONS.ALIAS_KEYWORD)
+            previousWord = word;
+        });
+        if (table) break;
+      }
     }
     return table;
   }
@@ -232,6 +246,7 @@
     var disableKeywords = options && options.disableKeywords;
     defaultTable = defaultTableName && getTable(defaultTableName);
     keywords = getKeywords(editor);
+    identifierQuote = getIdentifierQuote(editor);
 
     if (defaultTableName && !defaultTable)
       defaultTable = findTableByAlias(defaultTableName, editor);
@@ -249,7 +264,7 @@
       token.string = token.string.slice(0, cur.ch - token.start);
     }
 
-    if (token.string.match(/^[.`\w@]\w*$/)) {
+    if (token.string.match(/^[.`"\w@]\w*$/)) {
       search = token.string;
       start = token.start;
       end = token.end;
@@ -257,11 +272,11 @@
       start = end = cur.ch;
       search = "";
     }
-    if (search.charAt(0) == "." || search.charAt(0) == "`") {
+    if (search.charAt(0) == "." || search.charAt(0) == identifierQuote) {
       start = nameCompletion(cur, token, result, editor);
     } else {
-      addMatches(result, search, tables, function(w) {return w;});
       addMatches(result, search, defaultTable, function(w) {return w;});
+      addMatches(result, search, tables, function(w) {return w;});
       if (!disableKeywords)
         addMatches(result, search, keywords, function(w) {return w.toUpperCase();});
     }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/coffeescript-lint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/coffeescript-lint.js.js
index 7e39428f7a6640ce26d9839febd24c14b356d932..70621a1bddf1f7df62f66c276d47d5873ab2ef51 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/coffeescript-lint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/coffeescript-lint.js.js
@@ -17,6 +17,12 @@
 
 CodeMirror.registerHelper("lint", "coffeescript", function(text) {
   var found = [];
+  if (!window.coffeelint) {
+    if (window.console) {
+      window.console.error("Error: window.coffeelint not defined, CodeMirror CoffeeScript linting cannot run.");
+    }
+    return found;
+  }
   var parseError = function(err) {
     var loc = err.lineNumber;
     found.push({from: CodeMirror.Pos(loc-1, 0),
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/css-lint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/css-lint.js.js
index 1f61b479b2afd95483d5a8b66b6a393f79128933..135d031a356ed243a87a2b5097b9289c2284f2d8 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/css-lint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/css-lint.js.js
@@ -15,10 +15,15 @@
 })(function(CodeMirror) {
 "use strict";
 
-CodeMirror.registerHelper("lint", "css", function(text) {
+CodeMirror.registerHelper("lint", "css", function(text, options) {
   var found = [];
-  if (!window.CSSLint) return found;
-  var results = CSSLint.verify(text), messages = results.messages, message = null;
+  if (!window.CSSLint) {
+    if (window.console) {
+        window.console.error("Error: window.CSSLint not defined, CodeMirror CSS linting cannot run.");
+    }
+    return found;
+  }
+  var results = CSSLint.verify(text, options), messages = results.messages, message = null;
   for ( var i = 0; i < messages.length; i++) {
     message = messages[i];
     var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col;
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/html-lint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/html-lint.js.js
index 1e8417098d0c234444096ca4d8fbd9b931a87948..23de9bb2043854d4ffe9f21f32e8dee21c171f96 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/html-lint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/html-lint.js.js
@@ -11,8 +11,8 @@
   else if (typeof define == "function" && define.amd) // AMD
     define(["../../lib/codemirror", "htmlhint"], mod);
   else // Plain browser env
-    mod(CodeMirror);
-})(function(CodeMirror) {
+    mod(CodeMirror, window.HTMLHint);
+})(function(CodeMirror, HTMLHint) {
   "use strict";
 
   var defaultRules = {
@@ -29,7 +29,14 @@
 
   CodeMirror.registerHelper("lint", "html", function(text, options) {
     var found = [];
-    if (!window.HTMLHint) return found;
+    if (HTMLHint && !HTMLHint.verify) HTMLHint = HTMLHint.HTMLHint;
+    if (!HTMLHint) HTMLHint = window.HTMLHint;
+    if (!HTMLHint) {
+      if (window.console) {
+          window.console.error("Error: HTMLHint not found, not defined on window, or not available through define/require, CodeMirror HTML linting cannot run.");
+      }
+      return found;
+    }
     var messages = HTMLHint.verify(text, options && options.rules || defaultRules);
     for (var i = 0; i < messages.length; i++) {
       var message = messages[i];
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/javascript-lint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/javascript-lint.js.js
index d4f2ae9a1faac1925f9efc5fad34d61c20ea2e53..8266b7e747a8a5fcbf53162574151a9f63ab0fef 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/javascript-lint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/javascript-lint.js.js
@@ -12,17 +12,15 @@
   "use strict";
   // declare global: JSHINT
 
-  var bogus = [ "Dangerous comment" ];
-
-  var warnings = [ [ "Expected '{'",
-                     "Statement body should be inside '{ }' braces." ] ];
-
-  var errors = [ "Missing semicolon", "Extra comma", "Missing property name",
-                 "Unmatched ", " and instead saw", " is not defined",
-                 "Unclosed string", "Stopping, unable to continue" ];
-
   function validator(text, options) {
-    if (!window.JSHINT) return [];
+    if (!window.JSHINT) {
+      if (window.console) {
+        window.console.error("Error: window.JSHINT not defined, CodeMirror JavaScript linting cannot run.");
+      }
+      return [];
+    }
+    if (!options.indent) // JSHint error.character actually is a column index, this fixes underlining on lines using tabs for indentation
+      options.indent = 1; // JSHint default value is 4
     JSHINT(text, options, options.globals);
     var errors = JSHINT.data().errors, result = [];
     if (errors) parseErrors(errors, result);
@@ -31,105 +29,34 @@
 
   CodeMirror.registerHelper("lint", "javascript", validator);
 
-  function cleanup(error) {
-    // All problems are warnings by default
-    fixWith(error, warnings, "warning", true);
-    fixWith(error, errors, "error");
-
-    return isBogus(error) ? null : error;
-  }
-
-  function fixWith(error, fixes, severity, force) {
-    var description, fix, find, replace, found;
-
-    description = error.description;
-
-    for ( var i = 0; i < fixes.length; i++) {
-      fix = fixes[i];
-      find = (typeof fix === "string" ? fix : fix[0]);
-      replace = (typeof fix === "string" ? null : fix[1]);
-      found = description.indexOf(find) !== -1;
-
-      if (force || found) {
-        error.severity = severity;
-      }
-      if (found && replace) {
-        error.description = replace;
-      }
-    }
-  }
-
-  function isBogus(error) {
-    var description = error.description;
-    for ( var i = 0; i < bogus.length; i++) {
-      if (description.indexOf(bogus[i]) !== -1) {
-        return true;
-      }
-    }
-    return false;
-  }
-
   function parseErrors(errors, output) {
     for ( var i = 0; i < errors.length; i++) {
       var error = errors[i];
       if (error) {
-        var linetabpositions, index;
-
-        linetabpositions = [];
-
-        // This next block is to fix a problem in jshint. Jshint
-        // replaces
-        // all tabs with spaces then performs some checks. The error
-        // positions (character/space) are then reported incorrectly,
-        // not taking the replacement step into account. Here we look
-        // at the evidence line and try to adjust the character position
-        // to the correct value.
-        if (error.evidence) {
-          // Tab positions are computed once per line and cached
-          var tabpositions = linetabpositions[error.line];
-          if (!tabpositions) {
-            var evidence = error.evidence;
-            tabpositions = [];
-            // ugggh phantomjs does not like this
-            // forEachChar(evidence, function(item, index) {
-            Array.prototype.forEach.call(evidence, function(item,
-                                                            index) {
-              if (item === '\t') {
-                // First col is 1 (not 0) to match error
-                // positions
-                tabpositions.push(index + 1);
-              }
-            });
-            linetabpositions[error.line] = tabpositions;
-          }
-          if (tabpositions.length > 0) {
-            var pos = error.character;
-            tabpositions.forEach(function(tabposition) {
-              if (pos > tabposition) pos -= 1;
-            });
-            error.character = pos;
+        if (error.line <= 0) {
+          if (window.console) {
+            window.console.warn("Cannot display JSHint error (invalid line " + error.line + ")", error);
           }
+          continue;
         }
 
         var start = error.character - 1, end = start + 1;
         if (error.evidence) {
-          index = error.evidence.substring(start).search(/.\b/);
+          var index = error.evidence.substring(start).search(/.\b/);
           if (index > -1) {
             end += index;
           }
         }
 
         // Convert to format expected by validation service
-        error.description = error.reason;// + "(jshint)";
-        error.start = error.character;
-        error.end = end;
-        error = cleanup(error);
-
-        if (error)
-          output.push({message: error.description,
-                       severity: error.severity,
-                       from: CodeMirror.Pos(error.line - 1, start),
-                       to: CodeMirror.Pos(error.line - 1, end)});
+        var hint = {
+          message: error.reason,
+          severity: error.code ? (error.code.startsWith('W') ? "warning" : "error") : "error",
+          from: CodeMirror.Pos(error.line - 1, start),
+          to: CodeMirror.Pos(error.line - 1, end)
+        };
+
+        output.push(hint);
       }
     }
   }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/json-lint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/json-lint.js.js
index 9dbb616b3b440ef1bc9f8193e2dd7f4801845e2e..849641ee5e1c9f50d64373386815e59d6b2d429d 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/json-lint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/json-lint.js.js
@@ -17,6 +17,12 @@
 
 CodeMirror.registerHelper("lint", "json", function(text) {
   var found = [];
+  if (!window.jsonlint) {
+    if (window.console) {
+      window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.");
+    }
+    return found;
+  }
   jsonlint.parseError = function(str, hash) {
     var loc = hash.loc;
     found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column),
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/lint.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/lint.css.xml
index 86c981f4b61d0a9bfa8ea1174e13b9d6d9a41665..88c4498f7f9d8207ac62d326aeb0ad74b2a7aa30 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/lint.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/lint.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>lint.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/lint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/lint.js.js
index c1f1702f92152462c0bb59d3ae8745f093a6c839..e00e77a20c25af7e96c8b11fbf4460d6172bd9f8 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/lint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/lint.js.js
@@ -112,7 +112,11 @@
     if (!severity) severity = "error";
     var tip = document.createElement("div");
     tip.className = "CodeMirror-lint-message-" + severity;
-    tip.appendChild(document.createTextNode(ann.message));
+    if (typeof ann.messageHTML != 'undefined') {
+        tip.innerHTML = ann.messageHTML;
+    } else {
+        tip.appendChild(document.createTextNode(ann.message));
+    }
     return tip;
   }
 
@@ -128,19 +132,28 @@
       cm.off("change", abort)
       if (state.waitingFor != id) return
       if (arg2 && annotations instanceof CodeMirror) annotations = arg2
-      updateLinting(cm, annotations)
+      cm.operation(function() {updateLinting(cm, annotations)})
     }, passOptions, cm);
   }
 
   function startLinting(cm) {
     var state = cm.state.lint, options = state.options;
-    var passOptions = options.options || options; // Support deprecated passing of `options` property in options
+    /*
+     * Passing rules in `options` property prevents JSHint (and other linters) from complaining
+     * about unrecognized rules like `onUpdateLinting`, `delay`, `lintOnChange`, etc.
+     */
+    var passOptions = options.options || options;
     var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint");
     if (!getAnnotations) return;
     if (options.async || getAnnotations.async) {
       lintAsync(cm, getAnnotations, passOptions)
     } else {
-      updateLinting(cm, getAnnotations(cm.getValue(), passOptions, cm));
+      var annotations = getAnnotations(cm.getValue(), passOptions, cm);
+      if (!annotations) return;
+      if (annotations.then) annotations.then(function(issues) {
+        cm.operation(function() {updateLinting(cm, issues)})
+      });
+      else cm.operation(function() {updateLinting(cm, annotations)})
     }
   }
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/yaml-lint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/yaml-lint.js.js
index 3f77e525b78152eeb871e6701e0a1f6a50427cc7..3954ed38ebf4267658c135aa679336feee303c90 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/yaml-lint.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/lint/yaml-lint.js.js
@@ -17,10 +17,23 @@
 
 CodeMirror.registerHelper("lint", "yaml", function(text) {
   var found = [];
+  if (!window.jsyaml) {
+    if (window.console) {
+      window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run.");
+    }
+    return found;
+  }
   try { jsyaml.load(text); }
   catch(e) {
-      var loc = e.mark;
-      found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message });
+      var loc = e.mark,
+          // js-yaml YAMLException doesn't always provide an accurate lineno
+          // e.g., when there are multiple yaml docs
+          // ---
+          // ---
+          // foo:bar
+          from = loc ? CodeMirror.Pos(loc.line, loc.column) : CodeMirror.Pos(0, 0),
+          to = from;
+      found.push({ from: from, to: to, message: e.message });
   }
   return found;
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.css.css
index bda3d9f8061a867e7cd7a3f78d9ec0a6153e3c1a..dadd7f59c788f08e8f1a5ddf3efdffa5900832e5 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.css.css
@@ -48,6 +48,12 @@
   color: #555;
   line-height: 1;
 }
+.CodeMirror-merge-scrolllock:after {
+  content: "\21db\00a0\00a0\21da";
+}
+.CodeMirror-merge-scrolllock.CodeMirror-merge-scrolllock-enabled:after {
+  content: "\21db\21da";
+}
 
 .CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right {
   position: absolute;
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.css.xml
index 8ad33f265cc7f38b9f071b29d366bf1640d7a657..9837f12e29be02c9815c1273a5f84fddb9e44a05 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>merge.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.js.js
index 66d160f36077829469acb647fc1d5425a8e6e439..3a77f7a64c084b10cd15cfa31d08cbe2b035c6f5 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/merge/merge.js.js
@@ -49,17 +49,17 @@
       if (Object.prototype.toString.call(classLocation) != "[object Array]") classLocation = [classLocation]
       this.classes.classLocation = classLocation
 
-      this.diff = getDiff(asString(orig), asString(options.value));
+      this.diff = getDiff(asString(orig), asString(options.value), this.mv.options.ignoreWhitespace);
       this.chunks = getChunks(this.diff);
       this.diffOutOfDate = this.dealigned = false;
       this.needsScrollSync = null
 
       this.showDifferences = options.showDifferences !== false;
     },
-    registerEvents: function() {
+    registerEvents: function(otherDv) {
       this.forceUpdate = registerUpdate(this);
       setScrollLock(this, true, false);
-      registerScroll(this);
+      registerScroll(this, otherDv);
     },
     setShowDifferences: function(val) {
       val = val !== false;
@@ -72,7 +72,7 @@
 
   function ensureDiff(dv) {
     if (dv.diffOutOfDate) {
-      dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue());
+      dv.diff = getDiff(dv.orig.getValue(), dv.edit.getValue(), dv.mv.options.ignoreWhitespace);
       dv.chunks = getChunks(dv.diff);
       dv.diffOutOfDate = false;
       CodeMirror.signal(dv.edit, "updateDiff", dv.diff);
@@ -128,6 +128,7 @@
     }
     function swapDoc() {
       dv.diffOutOfDate = true;
+      dv.dealigned = true;
       update("full");
     }
     dv.edit.on("change", change);
@@ -144,12 +145,13 @@
     return update;
   }
 
-  function registerScroll(dv) {
+  function registerScroll(dv, otherDv) {
     dv.edit.on("scroll", function() {
       syncScroll(dv, true) && makeConnections(dv);
     });
     dv.orig.on("scroll", function() {
       syncScroll(dv, false) && makeConnections(dv);
+      if (otherDv) syncScroll(otherDv, true) && makeConnections(otherDv);
     });
   }
 
@@ -209,7 +211,7 @@
   function setScrollLock(dv, val, action) {
     dv.lockScroll = val;
     if (val && action != false) syncScroll(dv, DIFF_INSERT) && makeConnections(dv);
-    dv.lockButton.innerHTML = val ? "\u21db\u21da" : "\u21db&nbsp;&nbsp;\u21da";
+    (val ? CodeMirror.addClass : CodeMirror.rmClass)(dv.lockButton, "CodeMirror-merge-scrolllock-enabled");
   }
 
   // Updating the marks for editor content
@@ -352,11 +354,11 @@
     var result = []
     for (var i = 0;; i++) {
       var chunk = chunks[i]
-      var chunkStart = !chunk ? cm.lastLine() + 1 : isOrig ? chunk.origFrom : chunk.editFrom
+      var chunkStart = !chunk ? 1e9 : isOrig ? chunk.origFrom : chunk.editFrom
       for (; trackI < tracker.alignable.length; trackI += 2) {
         var n = tracker.alignable[trackI] + 1
         if (n <= start) continue
-        if (n < chunkStart) result.push(n)
+        if (n <= chunkStart) result.push(n)
         else break
       }
       if (!chunk) break
@@ -370,14 +372,22 @@
   // lines that need to be aligned with each other.
   function mergeAlignable(result, origAlignable, chunks, setIndex) {
     var rI = 0, origI = 0, chunkI = 0, diff = 0
-    for (;; rI++) {
+    outer: for (;; rI++) {
       var nextR = result[rI], nextO = origAlignable[origI]
       if (!nextR && nextO == null) break
 
       var rLine = nextR ? nextR[0] : 1e9, oLine = nextO == null ? 1e9 : nextO
       while (chunkI < chunks.length) {
         var chunk = chunks[chunkI]
-        if (chunk.editTo > rLine) break
+        if (chunk.origFrom <= oLine && chunk.origTo > oLine) {
+          origI++
+          rI--
+          continue outer;
+        }
+        if (chunk.editTo > rLine) {
+          if (chunk.editFrom <= rLine) continue outer;
+          break
+        }
         diff += (chunk.origTo - chunk.origFrom) - (chunk.editTo - chunk.editFrom)
         chunkI++
       }
@@ -467,7 +477,7 @@
     var elt = document.createElement("div");
     elt.className = "CodeMirror-merge-spacer";
     elt.style.height = size + "px"; elt.style.minWidth = "1px";
-    return cm.addLineWidget(line, elt, {height: size, above: above, mergeSpacer: true});
+    return cm.addLineWidget(line, elt, {height: size, above: above, mergeSpacer: true, handleMouseEvents: true});
   }
 
   function drawConnectorsForChunk(dv, chunk, sTopOrig, sTopEdit, w) {
@@ -567,8 +577,8 @@
       this.aligners = [];
       alignChunks(this.left || this.right, true);
     }
-    if (left) left.registerEvents()
-    if (right) right.registerEvents()
+    if (left) left.registerEvents(right)
+    if (right) right.registerEvents(left)
 
 
     var onResize = function() {
@@ -634,14 +644,15 @@
   }
 
   // Operations on diffs
+  var dmp;
+  function getDiff(a, b, ignoreWhitespace) {
+    if (!dmp) dmp = new diff_match_patch();
 
-  var dmp = new diff_match_patch();
-  function getDiff(a, b) {
     var diff = dmp.diff_main(a, b);
     // The library sometimes leaves in empty parts, which confuse the algorithm
     for (var i = 0; i < diff.length; ++i) {
       var part = diff[i];
-      if (!part[1]) {
+      if (ignoreWhitespace ? !/[^ \t]/.test(part[1]) : !part[1]) {
         diff.splice(i--, 1);
       } else if (i && diff[i - 1][0] == part[0]) {
         diff.splice(i--, 1);
@@ -658,7 +669,7 @@
     for (var i = 0; i < diff.length; ++i) {
       var part = diff[i], tp = part[0];
       if (tp == DIFF_EQUAL) {
-        var startOff = startOfLineClean(diff, i) ? 0 : 1;
+        var startOff = !startOfLineClean(diff, i) || edit.line < startEdit || orig.line < startOrig ? 1 : 0;
         var cleanFromEdit = edit.line + startOff, cleanFromOrig = orig.line + startOff;
         moveOver(edit, part[1], null, orig);
         var endOff = endOfLineClean(diff, i) ? 1 : 0;
@@ -727,6 +738,9 @@
       mark.clear();
       cm.removeLineClass(from, "wrap", "CodeMirror-merge-collapsed-line");
     }
+    if (mark.explicitlyCleared) clear();
+    CodeMirror.on(widget, "click", clear);
+    mark.on("clear", clear);
     CodeMirror.on(widget, "click", clear);
     return {mark: mark, clear: clear};
   }
@@ -826,6 +840,7 @@
   function TrackAlignable(cm) {
     this.cm = cm
     this.alignable = []
+    this.height = cm.doc.height
     var self = this
     cm.on("markerAdded", function(_, marker) {
       if (!marker.collapsed) return
@@ -855,11 +870,15 @@
       self.check(end, F_MARKER, self.hasMarker)
       if (nBefore || nAfter) self.check(change.from.line, F_MARKER, self.hasMarker)
     })
+    cm.on("viewportChange", function() {
+      if (self.cm.doc.height != self.height) self.signal()
+    })
   }
 
   TrackAlignable.prototype = {
     signal: function() {
       CodeMirror.signal(this, "realign")
+      this.height = this.cm.doc.height
     },
 
     set: function(n, flags) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/mode/multiplex.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/mode/multiplex.js.js
index 3d8b34c452013d25d732bb88cf842a048b73fffb..a084f7025a6820144a353f2b07d25a1e38b4452b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/mode/multiplex.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/mode/multiplex.js.js
@@ -50,7 +50,15 @@ CodeMirror.multiplexingMode = function(outer /*, others */) {
           if (found == stream.pos) {
             if (!other.parseDelimiters) stream.match(other.open);
             state.innerActive = other;
-            state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
+
+            // Get the outer indent, making sure to handle CodeMirror.Pass
+            var outerIndent = 0;
+            if (outer.indent) {
+              var possibleOuterIndent = outer.indent(state.outer, "");
+              if (possibleOuterIndent !== CodeMirror.Pass) outerIndent = possibleOuterIndent;
+            }
+
+            state.inner = CodeMirror.startState(other.mode, outerIndent);
             return other.delimStyle && (other.delimStyle + " " + other.delimStyle + "-open");
           } else if (found != -1 && found < cutOff) {
             cutOff = found;
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/mode/simple.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/mode/simple.js.js
index df663365e8c23459a6b1f1ea4f186a9a0b839f4c..c0f801088c39ad84a60575eb8108e3384167099a 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/mode/simple.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/mode/simple.js.js
@@ -77,6 +77,7 @@
 
   function asToken(val) {
     if (!val) return null;
+    if (val.apply) return val
     if (typeof val == "string") return val.replace(/\./g, " ");
     var result = [];
     for (var i = 0; i < val.length; i++)
@@ -133,17 +134,19 @@
             state.indent.push(stream.indentation() + config.indentUnit);
           if (rule.data.dedent)
             state.indent.pop();
-          if (matches.length > 2) {
+          var token = rule.token
+          if (token && token.apply) token = token(matches)
+          if (matches.length > 2 && rule.token && typeof rule.token != "string") {
             state.pending = [];
             for (var j = 2; j < matches.length; j++)
               if (matches[j])
                 state.pending.push({text: matches[j], token: rule.token[j - 1]});
             stream.backUp(matches[0].length - (matches[1] ? matches[1].length : 0));
-            return rule.token[0];
-          } else if (rule.token && rule.token.join) {
-            return rule.token[0];
+            return token[0];
+          } else if (token && token.join) {
+            return token[0];
           } else {
-            return rule.token;
+            return token;
           }
         }
       }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/runmode/runmode-standalone.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/runmode/runmode-standalone.js.js
index f4f352c80352448cd6de3746853c3fdaa2c4fa99..1bd808c787a2f0bc433d7891e8082f0acc06acaf 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/runmode/runmode-standalone.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/runmode/runmode-standalone.js.js
@@ -65,7 +65,8 @@ StringStream.prototype = {
     this.lineStart += n;
     try { return inner(); }
     finally { this.lineStart -= n; }
-  }
+  },
+  lookAhead: function() { return null }
 };
 CodeMirror.StringStream = StringStream;
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/runmode/runmode.node.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/runmode/runmode.node.js.js
index b22a5187f3b67e8dfb904e97d0a30517f8aa3453..21c72696c88b225ea785c289670c1a23d82f1ec4 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/runmode/runmode.node.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/runmode/runmode.node.js.js
@@ -7,7 +7,7 @@ function splitLines(string){return string.split(/\r\n?|\n/);};
 
 // Counts the column offset in a string, taking tabs into account.
 // Used mostly to find indentation.
-var countColumn = function(string, end, tabSize, startIndex, startValue) {
+var countColumn = exports.countColumn = function(string, end, tabSize, startIndex, startValue) {
   if (end == null) {
     end = string.search(/[^\s\u00a0]/);
     if (end == -1) end = string.length;
@@ -22,12 +22,13 @@ var countColumn = function(string, end, tabSize, startIndex, startValue) {
   }
 };
 
-function StringStream(string, tabSize) {
+function StringStream(string, tabSize, context) {
   this.pos = this.start = 0;
   this.string = string;
   this.tabSize = tabSize || 8;
   this.lastColumnPos = this.lastColumnValue = 0;
   this.lineStart = 0;
+  this.context = context
 };
 
 StringStream.prototype = {
@@ -91,6 +92,10 @@ StringStream.prototype = {
     this.lineStart += n;
     try { return inner(); }
     finally { this.lineStart -= n; }
+  },
+  lookAhead: function(n) {
+    var line = this.context.line + n
+    return line >= this.context.lines.length ? null : this.context.lines[line]
   }
 };
 exports.StringStream = StringStream;
@@ -158,14 +163,27 @@ exports.getMode = function(options, spec) {
 
   return modeObj;
 };
+
+exports.innerMode = function(mode, state) {
+  var info;
+  while (mode.innerMode) {
+    info = mode.innerMode(state);
+    if (!info || info.mode == mode) break;
+    state = info.state;
+    mode = info.mode;
+  }
+  return info || {mode: mode, state: state};
+}
+
 exports.registerHelper = exports.registerGlobalHelper = Math.min;
 
 exports.runMode = function(string, modespec, callback, options) {
   var mode = exports.getMode({indentUnit: 2}, modespec);
   var lines = splitLines(string), state = (options && options.state) || exports.startState(mode);
-  for (var i = 0, e = lines.length; i < e; ++i) {
+  var context = {lines: lines, line: 0}
+  for (var i = 0, e = lines.length; i < e; ++i, ++context.line) {
     if (i) callback("\n");
-    var stream = new exports.StringStream(lines[i]);
+    var stream = new exports.StringStream(lines[i], 4, context);
     if (!stream.string && mode.blankLine) mode.blankLine(state);
     while (!stream.eol()) {
       var style = mode.token(stream, state);
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/scroll/simplescrollbars.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/scroll/simplescrollbars.css.xml
index 6948b62f68bf8579c3cc276ae42f01f794a1456a..b7633327fd456c45d82c1d005376b84c969630e1 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/scroll/simplescrollbars.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/scroll/simplescrollbars.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>simplescrollbars.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/match-highlighter.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/match-highlighter.js.js
index 73ba0e0537090815be9ac6c7aeb3deff264d3a6d..260cdeb2aa6662bcb8c4815542cbe35ab9ef409c 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/match-highlighter.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/match-highlighter.js.js
@@ -90,7 +90,7 @@
     var state = cm.state.matchHighlighter;
     cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
     if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
-      var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
+      var searchFor = hasBoundary ? new RegExp("\\b" + query.replace(/[\\\[.+*?(){|^$]/g, "\\$&") + "\\b") : query;
       state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false,
         {className: "CodeMirror-selection-highlight-scrollbar"});
     }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/matchesonscrollbar.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/matchesonscrollbar.css.xml
index 296d7cbfe2ccd09e8732f7cd5aceed27a995414f..c3ecaef5cf0c94c06e7f636b774566c47a351bf9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/matchesonscrollbar.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/matchesonscrollbar.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>matchesonscrollbar.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/search.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/search.js.js
index 753b1afe1e779e39dcae56cdd485d8cb1519594d..4059ccdd0eadff4f482b1f3302ca5a4555ccfbff 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/search.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/search.js.js
@@ -54,7 +54,7 @@
 
   function getSearchCursor(cm, query, pos) {
     // Heuristic: if the query string is all lowercase, do a case insensitive search.
-    return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
+    return cm.getSearchCursor(query, pos, {caseFold: queryCaseInsensitive(query), multiline: true});
   }
 
   function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {
@@ -99,7 +99,7 @@
   }
 
   var queryDialog =
-    'Search: <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
+    '<span class="CodeMirror-search-label">Search:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
 
   function startSearch(cm, state, query) {
     state.queryText = query;
@@ -117,6 +117,7 @@
     var state = getSearchState(cm);
     if (state.query) return findNext(cm, rev);
     var q = cm.getSelection() || state.lastQuery;
+    if (q instanceof RegExp && q.source == "x^") q = null
     if (persistent && cm.openDialog) {
       var hiding = null
       var searchNext = function(query, event) {
@@ -137,8 +138,7 @@
       };
       persistentDialog(cm, queryDialog, q, searchNext, function(event, query) {
         var keyName = CodeMirror.keyName(event)
-        var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][keyName]
-        if (!cmd) cmd = cm.getOption('extraKeys')[keyName]
+        var extra = cm.getOption('extraKeys'), cmd = (extra && extra[keyName]) || CodeMirror.keyMap[cm.getOption("keyMap")][keyName]
         if (cmd == "findNext" || cmd == "findPrev" ||
           cmd == "findPersistentNext" || cmd == "findPersistentPrev") {
           CodeMirror.e_stop(event);
@@ -188,8 +188,8 @@
 
   var replaceQueryDialog =
     ' <input type="text" style="width: 10em" class="CodeMirror-search-field"/> <span style="color: #888" class="CodeMirror-search-hint">(Use /re/ syntax for regexp search)</span>';
-  var replacementQueryDialog = 'With: <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
-  var doReplaceConfirm = "Replace? <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>";
+  var replacementQueryDialog = '<span class="CodeMirror-search-label">With:</span> <input type="text" style="width: 10em" class="CodeMirror-search-field"/>';
+  var doReplaceConfirm = '<span class="CodeMirror-search-label">Replace?</span> <button>Yes</button> <button>No</button> <button>All</button> <button>Stop</button>';
 
   function replaceAll(cm, query, text) {
     cm.operation(function() {
@@ -205,7 +205,7 @@
   function replace(cm, all) {
     if (cm.getOption("readOnly")) return;
     var query = cm.getSelection() || getSearchState(cm).lastQuery;
-    var dialogText = all ? "Replace all:" : "Replace:"
+    var dialogText = '<span class="CodeMirror-search-label">' + (all ? 'Replace all:' : 'Replace:') + '</span>';
     dialog(cm, dialogText + replaceQueryDialog, dialogText, query, function(query) {
       if (!query) return;
       query = parseQuery(query);
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/searchcursor.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/searchcursor.js.js
index b70242ee4b8cf1b698e58be59fd4a4cd05065005..e606c5e7cf59a2cb802e3ed361c6850cbabb7b44 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/searchcursor.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/search/searchcursor.js.js
@@ -3,187 +3,291 @@
 
 (function(mod) {
   if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../../lib/codemirror"));
+    mod(require("../../lib/codemirror"))
   else if (typeof define == "function" && define.amd) // AMD
-    define(["../../lib/codemirror"], mod);
+    define(["../../lib/codemirror"], mod)
   else // Plain browser env
-    mod(CodeMirror);
+    mod(CodeMirror)
 })(function(CodeMirror) {
-  "use strict";
-  var Pos = CodeMirror.Pos;
-
-  function SearchCursor(doc, query, pos, caseFold) {
-    this.atOccurrence = false; this.doc = doc;
-    if (caseFold == null && typeof query == "string") caseFold = false;
-
-    pos = pos ? doc.clipPos(pos) : Pos(0, 0);
-    this.pos = {from: pos, to: pos};
-
-    // The matches method is filled in based on the type of query.
-    // It takes a position and a direction, and returns an object
-    // describing the next occurrence of the query, or null if no
-    // more matches were found.
-    if (typeof query != "string") { // Regexp match
-      if (!query.global) query = new RegExp(query.source, query.ignoreCase ? "ig" : "g");
+  "use strict"
+  var Pos = CodeMirror.Pos
+
+  function regexpFlags(regexp) {
+    var flags = regexp.flags
+    return flags != null ? flags : (regexp.ignoreCase ? "i" : "")
+      + (regexp.global ? "g" : "")
+      + (regexp.multiline ? "m" : "")
+  }
+
+  function ensureFlags(regexp, flags) {
+    var current = regexpFlags(regexp), target = current
+    for (var i = 0; i < flags.length; i++) if (target.indexOf(flags.charAt(i)) == -1)
+      target += flags.charAt(i)
+    return current == target ? regexp : new RegExp(regexp.source, target)
+  }
+
+  function maybeMultiline(regexp) {
+    return /\\s|\\n|\n|\\W|\\D|\[\^/.test(regexp.source)
+  }
+
+  function searchRegexpForward(doc, regexp, start) {
+    regexp = ensureFlags(regexp, "g")
+    for (var line = start.line, ch = start.ch, last = doc.lastLine(); line <= last; line++, ch = 0) {
+      regexp.lastIndex = ch
+      var string = doc.getLine(line), match = regexp.exec(string)
+      if (match)
+        return {from: Pos(line, match.index),
+                to: Pos(line, match.index + match[0].length),
+                match: match}
+    }
+  }
+
+  function searchRegexpForwardMultiline(doc, regexp, start) {
+    if (!maybeMultiline(regexp)) return searchRegexpForward(doc, regexp, start)
+
+    regexp = ensureFlags(regexp, "gm")
+    var string, chunk = 1
+    for (var line = start.line, last = doc.lastLine(); line <= last;) {
+      // This grows the search buffer in exponentially-sized chunks
+      // between matches, so that nearby matches are fast and don't
+      // require concatenating the whole document (in case we're
+      // searching for something that has tons of matches), but at the
+      // same time, the amount of retries is limited.
+      for (var i = 0; i < chunk; i++) {
+        if (line > last) break
+        var curLine = doc.getLine(line++)
+        string = string == null ? curLine : string + "\n" + curLine
+      }
+      chunk = chunk * 2
+      regexp.lastIndex = start.ch
+      var match = regexp.exec(string)
+      if (match) {
+        var before = string.slice(0, match.index).split("\n"), inside = match[0].split("\n")
+        var startLine = start.line + before.length - 1, startCh = before[before.length - 1].length
+        return {from: Pos(startLine, startCh),
+                to: Pos(startLine + inside.length - 1,
+                        inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),
+                match: match}
+      }
+    }
+  }
+
+  function lastMatchIn(string, regexp) {
+    var cutOff = 0, match
+    for (;;) {
+      regexp.lastIndex = cutOff
+      var newMatch = regexp.exec(string)
+      if (!newMatch) return match
+      match = newMatch
+      cutOff = match.index + (match[0].length || 1)
+      if (cutOff == string.length) return match
+    }
+  }
+
+  function searchRegexpBackward(doc, regexp, start) {
+    regexp = ensureFlags(regexp, "g")
+    for (var line = start.line, ch = start.ch, first = doc.firstLine(); line >= first; line--, ch = -1) {
+      var string = doc.getLine(line)
+      if (ch > -1) string = string.slice(0, ch)
+      var match = lastMatchIn(string, regexp)
+      if (match)
+        return {from: Pos(line, match.index),
+                to: Pos(line, match.index + match[0].length),
+                match: match}
+    }
+  }
+
+  function searchRegexpBackwardMultiline(doc, regexp, start) {
+    regexp = ensureFlags(regexp, "gm")
+    var string, chunk = 1
+    for (var line = start.line, first = doc.firstLine(); line >= first;) {
+      for (var i = 0; i < chunk; i++) {
+        var curLine = doc.getLine(line--)
+        string = string == null ? curLine.slice(0, start.ch) : curLine + "\n" + string
+      }
+      chunk *= 2
+
+      var match = lastMatchIn(string, regexp)
+      if (match) {
+        var before = string.slice(0, match.index).split("\n"), inside = match[0].split("\n")
+        var startLine = line + before.length, startCh = before[before.length - 1].length
+        return {from: Pos(startLine, startCh),
+                to: Pos(startLine + inside.length - 1,
+                        inside.length == 1 ? startCh + inside[0].length : inside[inside.length - 1].length),
+                match: match}
+      }
+    }
+  }
+
+  var doFold, noFold
+  if (String.prototype.normalize) {
+    doFold = function(str) { return str.normalize("NFD").toLowerCase() }
+    noFold = function(str) { return str.normalize("NFD") }
+  } else {
+    doFold = function(str) { return str.toLowerCase() }
+    noFold = function(str) { return str }
+  }
+
+  // Maps a position in a case-folded line back to a position in the original line
+  // (compensating for codepoints increasing in number during folding)
+  function adjustPos(orig, folded, pos, foldFunc) {
+    if (orig.length == folded.length) return pos
+    for (var min = 0, max = pos + Math.max(0, orig.length - folded.length);;) {
+      if (min == max) return min
+      var mid = (min + max) >> 1
+      var len = foldFunc(orig.slice(0, mid)).length
+      if (len == pos) return mid
+      else if (len > pos) max = mid
+      else min = mid + 1
+    }
+  }
+
+  function searchStringForward(doc, query, start, caseFold) {
+    // Empty string would match anything and never progress, so we
+    // define it to match nothing instead.
+    if (!query.length) return null
+    var fold = caseFold ? doFold : noFold
+    var lines = fold(query).split(/\r|\n\r?/)
+
+    search: for (var line = start.line, ch = start.ch, last = doc.lastLine() + 1 - lines.length; line <= last; line++, ch = 0) {
+      var orig = doc.getLine(line).slice(ch), string = fold(orig)
+      if (lines.length == 1) {
+        var found = string.indexOf(lines[0])
+        if (found == -1) continue search
+        var start = adjustPos(orig, string, found, fold) + ch
+        return {from: Pos(line, adjustPos(orig, string, found, fold) + ch),
+                to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold) + ch)}
+      } else {
+        var cutFrom = string.length - lines[0].length
+        if (string.slice(cutFrom) != lines[0]) continue search
+        for (var i = 1; i < lines.length - 1; i++)
+          if (fold(doc.getLine(line + i)) != lines[i]) continue search
+        var end = doc.getLine(line + lines.length - 1), endString = fold(end), lastLine = lines[lines.length - 1]
+        if (endString.slice(0, lastLine.length) != lastLine) continue search
+        return {from: Pos(line, adjustPos(orig, string, cutFrom, fold) + ch),
+                to: Pos(line + lines.length - 1, adjustPos(end, endString, lastLine.length, fold))}
+      }
+    }
+  }
+
+  function searchStringBackward(doc, query, start, caseFold) {
+    if (!query.length) return null
+    var fold = caseFold ? doFold : noFold
+    var lines = fold(query).split(/\r|\n\r?/)
+
+    search: for (var line = start.line, ch = start.ch, first = doc.firstLine() - 1 + lines.length; line >= first; line--, ch = -1) {
+      var orig = doc.getLine(line)
+      if (ch > -1) orig = orig.slice(0, ch)
+      var string = fold(orig)
+      if (lines.length == 1) {
+        var found = string.lastIndexOf(lines[0])
+        if (found == -1) continue search
+        return {from: Pos(line, adjustPos(orig, string, found, fold)),
+                to: Pos(line, adjustPos(orig, string, found + lines[0].length, fold))}
+      } else {
+        var lastLine = lines[lines.length - 1]
+        if (string.slice(0, lastLine.length) != lastLine) continue search
+        for (var i = 1, start = line - lines.length + 1; i < lines.length - 1; i++)
+          if (fold(doc.getLine(start + i)) != lines[i]) continue search
+        var top = doc.getLine(line + 1 - lines.length), topString = fold(top)
+        if (topString.slice(topString.length - lines[0].length) != lines[0]) continue search
+        return {from: Pos(line + 1 - lines.length, adjustPos(top, topString, top.length - lines[0].length, fold)),
+                to: Pos(line, adjustPos(orig, string, lastLine.length, fold))}
+      }
+    }
+  }
+
+  function SearchCursor(doc, query, pos, options) {
+    this.atOccurrence = false
+    this.doc = doc
+    pos = pos ? doc.clipPos(pos) : Pos(0, 0)
+    this.pos = {from: pos, to: pos}
+
+    var caseFold
+    if (typeof options == "object") {
+      caseFold = options.caseFold
+    } else { // Backwards compat for when caseFold was the 4th argument
+      caseFold = options
+      options = null
+    }
+
+    if (typeof query == "string") {
+      if (caseFold == null) caseFold = false
       this.matches = function(reverse, pos) {
-        if (reverse) {
-          query.lastIndex = 0;
-          var line = doc.getLine(pos.line).slice(0, pos.ch), cutOff = 0, match, start;
-          for (;;) {
-            query.lastIndex = cutOff;
-            var newMatch = query.exec(line);
-            if (!newMatch) break;
-            match = newMatch;
-            start = match.index;
-            cutOff = match.index + (match[0].length || 1);
-            if (cutOff == line.length) break;
-          }
-          var matchLen = (match && match[0].length) || 0;
-          if (!matchLen) {
-            if (start == 0 && line.length == 0) {match = undefined;}
-            else if (start != doc.getLine(pos.line).length) {
-              matchLen++;
-            }
-          }
-        } else {
-          query.lastIndex = pos.ch;
-          var line = doc.getLine(pos.line), match = query.exec(line);
-          var matchLen = (match && match[0].length) || 0;
-          var start = match && match.index;
-          if (start + matchLen != line.length && !matchLen) matchLen = 1;
-        }
-        if (match && matchLen)
-          return {from: Pos(pos.line, start),
-                  to: Pos(pos.line, start + matchLen),
-                  match: match};
-      };
-    } else { // String query
-      var origQuery = query;
-      if (caseFold) query = query.toLowerCase();
-      var fold = caseFold ? function(str){return str.toLowerCase();} : function(str){return str;};
-      var target = query.split("\n");
-      // Different methods for single-line and multi-line queries
-      if (target.length == 1) {
-        if (!query.length) {
-          // Empty string would match anything and never progress, so
-          // we define it to match nothing instead.
-          this.matches = function() {};
-        } else {
-          this.matches = function(reverse, pos) {
-            if (reverse) {
-              var orig = doc.getLine(pos.line).slice(0, pos.ch), line = fold(orig);
-              var match = line.lastIndexOf(query);
-              if (match > -1) {
-                match = adjustPos(orig, line, match);
-                return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
-              }
-             } else {
-               var orig = doc.getLine(pos.line).slice(pos.ch), line = fold(orig);
-               var match = line.indexOf(query);
-               if (match > -1) {
-                 match = adjustPos(orig, line, match) + pos.ch;
-                 return {from: Pos(pos.line, match), to: Pos(pos.line, match + origQuery.length)};
-               }
-            }
-          };
+        return (reverse ? searchStringBackward : searchStringForward)(doc, query, pos, caseFold)
+      }
+    } else {
+      query = ensureFlags(query, "gm")
+      if (!options || options.multiline !== false)
+        this.matches = function(reverse, pos) {
+          return (reverse ? searchRegexpBackwardMultiline : searchRegexpForwardMultiline)(doc, query, pos)
         }
-      } else {
-        var origTarget = origQuery.split("\n");
+      else
         this.matches = function(reverse, pos) {
-          var last = target.length - 1;
-          if (reverse) {
-            if (pos.line - (target.length - 1) < doc.firstLine()) return;
-            if (fold(doc.getLine(pos.line).slice(0, origTarget[last].length)) != target[target.length - 1]) return;
-            var to = Pos(pos.line, origTarget[last].length);
-            for (var ln = pos.line - 1, i = last - 1; i >= 1; --i, --ln)
-              if (target[i] != fold(doc.getLine(ln))) return;
-            var line = doc.getLine(ln), cut = line.length - origTarget[0].length;
-            if (fold(line.slice(cut)) != target[0]) return;
-            return {from: Pos(ln, cut), to: to};
-          } else {
-            if (pos.line + (target.length - 1) > doc.lastLine()) return;
-            var line = doc.getLine(pos.line), cut = line.length - origTarget[0].length;
-            if (fold(line.slice(cut)) != target[0]) return;
-            var from = Pos(pos.line, cut);
-            for (var ln = pos.line + 1, i = 1; i < last; ++i, ++ln)
-              if (target[i] != fold(doc.getLine(ln))) return;
-            if (fold(doc.getLine(ln).slice(0, origTarget[last].length)) != target[last]) return;
-            return {from: from, to: Pos(ln, origTarget[last].length)};
-          }
-        };
-      }
+          return (reverse ? searchRegexpBackward : searchRegexpForward)(doc, query, pos)
+        }
     }
   }
 
   SearchCursor.prototype = {
-    findNext: function() {return this.find(false);},
-    findPrevious: function() {return this.find(true);},
+    findNext: function() {return this.find(false)},
+    findPrevious: function() {return this.find(true)},
 
     find: function(reverse) {
-      var self = this, pos = this.doc.clipPos(reverse ? this.pos.from : this.pos.to);
-      function savePosAndFail(line) {
-        var pos = Pos(line, 0);
-        self.pos = {from: pos, to: pos};
-        self.atOccurrence = false;
-        return false;
-      }
+      var result = this.matches(reverse, this.doc.clipPos(reverse ? this.pos.from : this.pos.to))
 
-      for (;;) {
-        if (this.pos = this.matches(reverse, pos)) {
-          this.atOccurrence = true;
-          return this.pos.match || true;
-        }
+      // Implements weird auto-growing behavior on null-matches for
+      // backwards-compatiblity with the vim code (unfortunately)
+      while (result && CodeMirror.cmpPos(result.from, result.to) == 0) {
         if (reverse) {
-          if (!pos.line) return savePosAndFail(0);
-          pos = Pos(pos.line-1, this.doc.getLine(pos.line-1).length);
-        }
-        else {
-          var maxLine = this.doc.lineCount();
-          if (pos.line == maxLine - 1) return savePosAndFail(maxLine);
-          pos = Pos(pos.line + 1, 0);
+          if (result.from.ch) result.from = Pos(result.from.line, result.from.ch - 1)
+          else if (result.from.line == this.doc.firstLine()) result = null
+          else result = this.matches(reverse, this.doc.clipPos(Pos(result.from.line - 1)))
+        } else {
+          if (result.to.ch < this.doc.getLine(result.to.line).length) result.to = Pos(result.to.line, result.to.ch + 1)
+          else if (result.to.line == this.doc.lastLine()) result = null
+          else result = this.matches(reverse, Pos(result.to.line + 1, 0))
         }
       }
+
+      if (result) {
+        this.pos = result
+        this.atOccurrence = true
+        return this.pos.match || true
+      } else {
+        var end = Pos(reverse ? this.doc.firstLine() : this.doc.lastLine() + 1, 0)
+        this.pos = {from: end, to: end}
+        return this.atOccurrence = false
+      }
     },
 
-    from: function() {if (this.atOccurrence) return this.pos.from;},
-    to: function() {if (this.atOccurrence) return this.pos.to;},
+    from: function() {if (this.atOccurrence) return this.pos.from},
+    to: function() {if (this.atOccurrence) return this.pos.to},
 
     replace: function(newText, origin) {
-      if (!this.atOccurrence) return;
-      var lines = CodeMirror.splitLines(newText);
-      this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin);
+      if (!this.atOccurrence) return
+      var lines = CodeMirror.splitLines(newText)
+      this.doc.replaceRange(lines, this.pos.from, this.pos.to, origin)
       this.pos.to = Pos(this.pos.from.line + lines.length - 1,
-                        lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0));
-    }
-  };
-
-  // Maps a position in a case-folded line back to a position in the original line
-  // (compensating for codepoints increasing in number during folding)
-  function adjustPos(orig, folded, pos) {
-    if (orig.length == folded.length) return pos;
-    for (var pos1 = Math.min(pos, orig.length);;) {
-      var len1 = orig.slice(0, pos1).toLowerCase().length;
-      if (len1 < pos) ++pos1;
-      else if (len1 > pos) --pos1;
-      else return pos1;
+                        lines[lines.length - 1].length + (lines.length == 1 ? this.pos.from.ch : 0))
     }
   }
 
   CodeMirror.defineExtension("getSearchCursor", function(query, pos, caseFold) {
-    return new SearchCursor(this.doc, query, pos, caseFold);
-  });
+    return new SearchCursor(this.doc, query, pos, caseFold)
+  })
   CodeMirror.defineDocExtension("getSearchCursor", function(query, pos, caseFold) {
-    return new SearchCursor(this, query, pos, caseFold);
-  });
+    return new SearchCursor(this, query, pos, caseFold)
+  })
 
   CodeMirror.defineExtension("selectMatches", function(query, caseFold) {
-    var ranges = [];
-    var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold);
+    var ranges = []
+    var cur = this.getSearchCursor(query, this.getCursor("from"), caseFold)
     while (cur.findNext()) {
-      if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break;
-      ranges.push({anchor: cur.from(), head: cur.to()});
+      if (CodeMirror.cmpPos(cur.to(), this.getCursor("to")) > 0) break
+      ranges.push({anchor: cur.from(), head: cur.to()})
     }
     if (ranges.length)
-      this.setSelections(ranges, 0);
-  });
+      this.setSelections(ranges, 0)
+  })
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/selection/mark-selection.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/selection/mark-selection.js.js
index 5c42d21eb2d0d00e65d7a1fe139cf767f2ead084..1602acc3deb82f5ba4ce603754fe8aadd4d82a06 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/selection/mark-selection.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/selection/mark-selection.js.js
@@ -34,11 +34,12 @@
   });
 
   function onCursorActivity(cm) {
-    cm.operation(function() { update(cm); });
+    if (cm.state.markedSelection)
+      cm.operation(function() { update(cm); });
   }
 
   function onChange(cm) {
-    if (cm.state.markedSelection.length)
+    if (cm.state.markedSelection && cm.state.markedSelection.length)
       cm.operation(function() { clear(cm); });
   }
 
@@ -85,7 +86,7 @@
     if (!array.length) return coverRange(cm, from, to);
 
     var coverStart = array[0].find(), coverEnd = array[array.length - 1].find();
-    if (!coverStart || !coverEnd || to.line - from.line < CHUNK_SIZE ||
+    if (!coverStart || !coverEnd || to.line - from.line <= CHUNK_SIZE ||
         cmp(from, coverEnd.to) >= 0 || cmp(to, coverStart.from) <= 0)
       return reset(cm);
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/tern/tern.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/tern/tern.css.xml
index 495a1fbb7ba55f70221e2189ca3baf4d8cde12ec..5d28ca09c9c7679ca726069052b0988b94a7fe1d 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/tern/tern.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/tern/tern.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>tern.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/tern/tern.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/tern/tern.js.js
index efdf2ed628a487c1831d52aad6e549478f46ec48..6276b53893a173133de142400d43386eeecafa2b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/tern/tern.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/addon/tern/tern.js.js
@@ -334,7 +334,11 @@
     tip.appendChild(document.createTextNode(tp.rettype ? ") ->\u00a0" : ")"));
     if (tp.rettype) tip.appendChild(elt("span", cls + "type", tp.rettype));
     var place = cm.cursorCoords(null, "page");
-    ts.activeArgHints = makeTooltip(place.right + 1, place.bottom, tip);
+    var tooltip = ts.activeArgHints = makeTooltip(place.right + 1, place.bottom, tip)
+    setTimeout(function() {
+      tooltip.clear = onEditorActivity(cm, function() {
+        if (ts.activeArgHints == tooltip) closeArgHints(ts) })
+    }, 20)
   }
 
   function parseFnType(text) {
@@ -567,7 +571,7 @@
     return {type: "part",
             name: data.name,
             offsetLines: from.line,
-            text: doc.getRange(from, Pos(endLine, 0))};
+            text: doc.getRange(from, Pos(endLine, end.line == endLine ? null : 0))};
   }
 
   // Generic utilities
@@ -604,24 +608,33 @@
     }
     function clear() {
       cm.state.ternTooltip = null;
-      if (!tip.parentNode) return;
-      cm.off("cursorActivity", clear);
-      cm.off('blur', clear);
-      cm.off('scroll', clear);
-      fadeOut(tip);
+      if (tip.parentNode) fadeOut(tip)
+      clearActivity()
     }
     var mouseOnTip = false, old = false;
     CodeMirror.on(tip, "mousemove", function() { mouseOnTip = true; });
     CodeMirror.on(tip, "mouseout", function(e) {
-      if (!CodeMirror.contains(tip, e.relatedTarget || e.toElement)) {
+      var related = e.relatedTarget || e.toElement
+      if (!related || !CodeMirror.contains(tip, related)) {
         if (old) clear();
         else mouseOnTip = false;
       }
     });
     setTimeout(maybeClear, ts.options.hintDelay ? ts.options.hintDelay : 1700);
-    cm.on("cursorActivity", clear);
-    cm.on('blur', clear);
-    cm.on('scroll', clear);
+    var clearActivity = onEditorActivity(cm, clear)
+  }
+
+  function onEditorActivity(cm, f) {
+    cm.on("cursorActivity", f)
+    cm.on("blur", f)
+    cm.on("scroll", f)
+    cm.on("setDoc", f)
+    return function() {
+      cm.off("cursorActivity", f)
+      cm.off("blur", f)
+      cm.off("scroll", f)
+      cm.off("setDoc", f)
+    }
   }
 
   function makeTooltip(x, y, content) {
@@ -650,7 +663,11 @@
   }
 
   function closeArgHints(ts) {
-    if (ts.activeArgHints) { remove(ts.activeArgHints); ts.activeArgHints = null; }
+    if (ts.activeArgHints) {
+      if (ts.activeArgHints.clear) ts.activeArgHints.clear()
+      remove(ts.activeArgHints)
+      ts.activeArgHints = null
+    }
   }
 
   function docValue(ts, doc) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin.xml
deleted file mode 100644
index 0e5bcdb3e1d756a828a153faf4669f1f06141eb4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Folder" module="OFS.Folder"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_objects</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>bin</string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/authors.sh.sh b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/authors.sh.sh
deleted file mode 100644
index b3ee99c6ddbd78431e765cdda703051541380985..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/authors.sh.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-# Combine existing list of authors with everyone known in git, sort, add header.
-tail --lines=+3 AUTHORS > AUTHORS.tmp
-git log --format='%aN' >> AUTHORS.tmp
-echo -e "List of CodeMirror contributors. Updated before every release.\n" > AUTHORS
-sort -u AUTHORS.tmp >> AUTHORS
-rm -f AUTHORS.tmp
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/authors.sh.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/authors.sh.xml
deleted file mode 100644
index 1258f6590a99c343a21ec4b464a9825fbe97f704..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/authors.sh.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>authors.sh</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/x-sh</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/compress.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/compress.bin
deleted file mode 100644
index d358f9c3a02d56551872f8a03c5c4533e34233e9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/compress.bin
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env node
-
-// Compression helper for CodeMirror
-//
-// Example:
-//
-//   bin/compress codemirror runmode javascript xml
-//
-// Will take lib/codemirror.js, addon/runmode/runmode.js,
-// mode/javascript/javascript.js, and mode/xml/xml.js, run them though
-// the online minifier at http://marijnhaverbeke.nl/uglifyjs, and spit
-// out the result.
-//
-//   bin/compress codemirror --local /path/to/bin/UglifyJS
-//
-// Will use a local minifier instead of the online default one.
-//
-// Script files are specified without .js ending. Prefixing them with
-// their full (local) path is optional. So you may say lib/codemirror
-// or mode/xml/xml to be more precise. In fact, even the .js suffix
-// may be specified, if wanted.
-
-"use strict";
-
-var fs = require("fs");
-
-function help(ok) {
-  console.log("usage: " + process.argv[1] + " [--local /path/to/uglifyjs] files...");
-  process.exit(ok ? 0 : 1);
-}
-
-var local = null, args = [], extraArgs = null, files = [], blob = "";
-
-for (var i = 2; i < process.argv.length; ++i) {
-  var arg = process.argv[i];
-  if (arg == "--local" && i + 1 < process.argv.length) {
-    var parts = process.argv[++i].split(/\s+/);
-    local = parts[0];
-    extraArgs = parts.slice(1);
-    if (!extraArgs.length) extraArgs = ["-c", "-m"];
-  } else if (arg == "--help") {
-    help(true);
-  } else if (arg[0] != "-") {
-    files.push({name: arg, re: new RegExp("(?:\\/|^)" + arg + (/\.js$/.test(arg) ? "$" : "\\.js$"))});
-  } else help(false);
-}
-
-function walk(dir) {
-  fs.readdirSync(dir).forEach(function(fname) {
-    if (/^[_\.]/.test(fname)) return;
-    var file = dir + fname;
-    if (fs.statSync(file).isDirectory()) return walk(file + "/");
-    if (files.some(function(spec, i) {
-      var match = spec.re.test(file);
-      if (match) files.splice(i, 1);
-      return match;
-    })) {
-      if (local) args.push(file);
-      else blob += fs.readFileSync(file, "utf8");
-    }
-  });
-}
-
-walk("lib/");
-walk("addon/");
-walk("mode/");
-
-if (!local && !blob) help(false);
-
-if (files.length) {
-  console.log("Some specified files were not found: " +
-              files.map(function(a){return a.name;}).join(", "));
-  process.exit(1);
-}
-  
-if (local) {
-  require("child_process").spawn(local, args.concat(extraArgs), {stdio: ["ignore", process.stdout, process.stderr]});
-} else {
-  var data = new Buffer("js_code=" + require("querystring").escape(blob), "utf8");
-  var req = require("http").request({
-    host: "marijnhaverbeke.nl",
-    port: 80,
-    method: "POST",
-    path: "/uglifyjs",
-    headers: {"content-type": "application/x-www-form-urlencoded",
-              "content-length": data.length}
-  });
-  req.on("response", function(resp) {
-    resp.on("data", function (chunk) { process.stdout.write(chunk); });
-  });
-  req.end(data);
-}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/compress.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/compress.xml
deleted file mode 100644
index 7a3f5c4a4b812973a20d73c12b611e917f4f2864..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/compress.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>compress</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/lint.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/lint.bin
deleted file mode 100644
index 47f45f3676f5288169cd3814bdabe029ff012a2f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/lint.bin
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env node
-
-process.exit(require("../test/lint").ok ? 0 : 1);
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/lint.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/lint.xml
deleted file mode 100644
index 4213fd28a888b8d65c36778a2503c40179e505e7..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/lint.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>lint</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/release.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/release.bin
deleted file mode 100644
index b31d5118578436af76a2aded719ab18bef216c73..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/release.bin
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env node
-
-var fs = require("fs"), child = require("child_process");
-
-var number, bumpOnly;
-
-for (var i = 2; i < process.argv.length; i++) {
-  if (process.argv[i] == "-bump") bumpOnly = true;
-  else if (/^\d+\.\d+\.\d+$/.test(process.argv[i])) number = process.argv[i];
-  else { console.log("Bogus command line arg: " + process.argv[i]); process.exit(1); }
-}
-
-if (!number) { console.log("Must give a version"); process.exit(1); }
-
-function rewrite(file, f) {
-  fs.writeFileSync(file, f(fs.readFileSync(file, "utf8")), "utf8");
-}
-
-rewrite("src/edit/main.js", function(lib) {
-  return lib.replace(/CodeMirror\.version = "\d+\.\d+\.\d+"/,
-                     "CodeMirror.version = \"" + number + "\"");
-});
-function rewriteJSON(pack) {
-  return pack.replace(/"version":\s*"\d+\.\d+\.\d+"/, "\"version\": \"" + number + "\"");
-}
-rewrite("package.json", rewriteJSON);
-rewrite("doc/manual.html", function(manual) {
-  return manual.replace(/>version \d+\.\d+\.\d+<\/span>/, ">version " + number + "</span>");
-});
-
-if (bumpOnly) process.exit(0);
-
-child.exec("bash bin/authors.sh", function(){});
-
-rewrite("index.html", function(index) {
-  return index.replace(/\.zip">\d+\.\d+\.\d+<\/a>/,
-                       ".zip\">" + number + "</a>");
-});
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/release.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/release.xml
deleted file mode 100644
index f71bfb468234b1f4dc223c70e65e9a69d0c78f6f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/release.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>release</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/source-highlight.bin b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/source-highlight.bin
deleted file mode 100644
index 0d6239c2bcc104a5eb545ff9b026574282c26394..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/source-highlight.bin
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/env node
-
-// Simple command-line code highlighting tool. Reads code from stdin,
-// spits html to stdout. For example:
-//
-//   echo 'function foo(a) { return a; }' | bin/source-highlight -s javascript
-//   bin/source-highlight -s 
-
-var fs = require("fs");
-
-var CodeMirror = require("../addon/runmode/runmode.node.js");
-require("../mode/meta.js");
-
-var sPos = process.argv.indexOf("-s");
-if (sPos == -1 || sPos == process.argv.length - 1) {
-   console.error("Usage: source-highlight -s language");
-   process.exit(1);
-}
-var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang;
-var found = CodeMirror.findModeByMIME(lang) || CodeMirror.findModeByName(lang)
-if (found) {
-  modeName = found.mode
-  lang = found.mime
-}
-
-if (!CodeMirror.modes[modeName])
-  require("../mode/" + modeName + "/" + modeName + ".js");
-
-function esc(str) {
-  return str.replace(/[<&]/g, function(ch) { return ch == "&" ? "&amp;" : "&lt;"; });
-}
-
-var code = fs.readFileSync("/dev/stdin", "utf8");
-var curStyle = null, accum = "";
-function flush() {
-  if (curStyle) process.stdout.write("<span class=\"" + curStyle.replace(/(^|\s+)/g, "$1cm-") + "\">" + esc(accum) + "</span>");
-  else process.stdout.write(esc(accum));
-}
-
-CodeMirror.runMode(code, lang, function(text, style) {
-  if (style != curStyle) {
-    flush();
-    curStyle = style; accum = text;
-  } else {
-    accum += text;
-  }
-});
-flush();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/source-highlight.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/source-highlight.xml
deleted file mode 100644
index 2e6ac896b99baaeadf1ae3fade8b547da4833fef..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/source-highlight.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>source-highlight</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/octet-stream</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/upload-release.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/upload-release.js.js
deleted file mode 100644
index 7c8551468c86797be8a427a804cd6ef1705c9a98..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/upload-release.js.js
+++ /dev/null
@@ -1,35 +0,0 @@
-"use strict"
-
-let version = process.argv[2]
-let auth = process.argv[3]
-
-if (!auth) {
-  console.log("Usage: upload-release.js [TAG] [github-user:password]")
-  process.exit(1)
-}
-
-require('child_process').exec("git --no-pager show -s --format='%s' " + version, (error, stdout) => {
-  if (error) throw error
-  let message = stdout.split("\n").slice(2)
-  message = message.slice(0, message.indexOf("-----BEGIN PGP SIGNATURE-----")).join("\n")
-
-  let req = require("https").request({
-    host: "api.github.com",
-    auth: auth,
-    headers: {"user-agent": "Release uploader"},
-    path: "/repos/codemirror/codemirror/releases",
-    method: "POST"
-  }, res => {
-    if (res.statusCode >= 300) {
-      console.error(res.statusMessage)
-      res.on("data", d => console.log(d.toString()))
-      res.on("end", process.exit(1))
-    }
-  })
-  req.write(JSON.stringify({
-    tag_name: version,
-    name: version,
-    body: message
-  }))
-  req.end()
-})
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/upload-release.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/upload-release.js.xml
deleted file mode 100644
index f02a0823b066a081e33b60c1d099765dd23d14c4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/bin/upload-release.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>upload-release.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo.xml
deleted file mode 100644
index 21ebea76b8829d0ccd075e802b4b5e033bb28929..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Folder" module="OFS.Folder"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_objects</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>demo</string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/activeline.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/activeline.html.html
deleted file mode 100644
index 86c8c18e1d5520c597f1127aaf4e24c2302c0218..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/activeline.html.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Active Line Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../addon/selection/active-line.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Active Line</a>
-  </ul>
-</div>
-
-<article>
-<h2>Active Line Demo</h2>
-<form><textarea id="code" name="code">
-<?xml version="1.0" encoding="UTF-8"?>
-<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"
-     xmlns:georss="http://www.georss.org/georss"
-     xmlns:twitter="http://api.twitter.com">
-  <channel>
-    <title>Twitter / codemirror</title>
-    <link>http://twitter.com/codemirror</link>
-    <atom:link type="application/rss+xml"
-               href="http://twitter.com/statuses/user_timeline/242283288.rss" rel="self"/>
-    <description>Twitter updates from CodeMirror / codemirror.</description>
-    <language>en-us</language>
-    <ttl>40</ttl>
-  <item>
-    <title>codemirror: http://cloud-ide.com &#8212; they're springing up like mushrooms. This one
-      uses CodeMirror as its editor.</title>
-    <description>codemirror: http://cloud-ide.com &#8212; they're springing up like mushrooms. This
-      one uses CodeMirror as its editor.</description>
-    <pubDate>Thu, 17 Mar 2011 23:34:47 +0000</pubDate>
-    <guid>http://twitter.com/codemirror/statuses/48527733722058752</guid>
-    <link>http://twitter.com/codemirror/statuses/48527733722058752</link>
-    <twitter:source>web</twitter:source>
-    <twitter:place/>
-  </item>
-  <item>
-    <title>codemirror: Posted a description of the CodeMirror 2 internals at
-      http://codemirror.net/2/internals.html</title>
-    <description>codemirror: Posted a description of the CodeMirror 2 internals at
-      http://codemirror.net/2/internals.html</description>
-    <pubDate>Wed, 02 Mar 2011 12:15:09 +0000</pubDate>
-    <guid>http://twitter.com/codemirror/statuses/42920879788789760</guid>
-    <link>http://twitter.com/codemirror/statuses/42920879788789760</link>
-    <twitter:source>web</twitter:source>
-    <twitter:place/>
-  </item>
-  </channel>
-</rss></textarea></form>
-
-    <script>
-var nonEmpty = false;
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  mode: "application/xml",
-  styleActiveLine: true,
-  lineNumbers: true,
-  lineWrapping: true
-});
-
-function toggleSelProp() {
-  nonEmpty = !nonEmpty;
-  editor.setOption("styleActiveLine", {nonEmpty: nonEmpty});
-  var label = nonEmpty ? 'Disable nonEmpty option' : 'Enable nonEmpty option';
-  document.getElementById('toggleButton').innerText = label;
-}
-</script>
-
-    <p>Styling the current cursor line.</p>
-
-    <button onclick="toggleSelProp()" id="toggleButton">Enable <code>nonEmpty</code> option</button>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/activeline.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/activeline.html.xml
deleted file mode 100644
index b3dc1206e6d990f2d71d104afb36c038f80fc6e1..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/activeline.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>activeline.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/anywordhint.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/anywordhint.html.html
deleted file mode 100644
index 0a7caece2405453a55944c88c8a6f6c244defdbb..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/anywordhint.html.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Any Word Completion Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/hint/show-hint.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/hint/show-hint.js"></script>
-<script src="../addon/hint/anyword-hint.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Any Word Completion</a>
-  </ul>
-</div>
-
-<article>
-<h2>Any Word Completion Demo</h2>
-<form><textarea id="code" name="code">
-(function() {
-  "use strict";
-
-  var WORD = /[\w$]+/g, RANGE = 500;
-
-  CodeMirror.registerHelper("hint", "anyword", function(editor, options) {
-    var word = options && options.word || WORD;
-    var range = options && options.range || RANGE;
-    var cur = editor.getCursor(), curLine = editor.getLine(cur.line);
-    var start = cur.ch, end = start;
-    while (end < curLine.length && word.test(curLine.charAt(end))) ++end;
-    while (start && word.test(curLine.charAt(start - 1))) --start;
-    var curWord = start != end && curLine.slice(start, end);
-
-    var list = [], seen = {};
-    function scan(dir) {
-      var line = cur.line, end = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir;
-      for (; line != end; line += dir) {
-        var text = editor.getLine(line), m;
-        word.lastIndex = 0;
-        while (m = word.exec(text)) {
-          if ((!curWord || m[0].indexOf(curWord) == 0) && !seen.hasOwnProperty(m[0])) {
-            seen[m[0]] = true;
-            list.push(m[0]);
-          }
-        }
-      }
-    }
-    scan(-1);
-    scan(1);
-    return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)};
-  });
-})();
-</textarea></form>
-
-<p>Press <strong>ctrl-space</strong> to activate autocompletion. The
-completion uses
-the <a href="../doc/manual.html#addon_anyword-hint">anyword-hint.js</a>
-module, which simply looks at nearby words in the buffer and completes
-to those.</p>
-
-    <script>
-      CodeMirror.commands.autocomplete = function(cm) {
-        cm.showHint({hint: CodeMirror.hint.anyword});
-      }
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        extraKeys: {"Ctrl-Space": "autocomplete"}
-      });
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/anywordhint.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/anywordhint.html.xml
deleted file mode 100644
index 17835798ef10bf0297c1fe41897d4658cc8cd5b3..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/anywordhint.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>anywordhint.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/bidi.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/bidi.html.html
deleted file mode 100644
index 6dd73bec3a56e96e5ea00d1b5044e8517475c9fd..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/bidi.html.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Bi-directional Text Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Bi-directional Text</a>
-  </ul>
-</div>
-
-<article>
-<h2>Bi-directional Text Demo</h2>
-<form><textarea id="code" name="code"><!-- Piece of the CodeMirror manual, 'translated' into Arabic by
-     Google Translate -->
-
-<dl>
-  <dt id=option_value><code>value (string or Doc)</code></dt>
-  <dd>賯賷賲丞 丕賱亘丿丕賷丞 丕賱賲丨乇乇. 賷賲賰賳 兀賳 鬲賰賵賳 爻賱爻賱丞貙 兀賵. 賰丕卅賳 賲爻鬲賳丿.</dd>
-  <dt id=option_mode><code>mode (string or object)</code></dt>
-  <dd>賵囟毓 丕賱丕爻鬲禺丿丕賲. 毓賳丿賲丕 賱丕 鬲毓胤賶貙 賵賴匕丕 丕賱丕賮鬲乇丕囟賷 廿賱賶 丕賱胤乇賷賯丞 丕賱丕賵賱賶
-  丕賱鬲賷 鬲賲 鬲丨賲賷賱賴丕. 賯丿 賷賰賵賳 賲賳 爻賱爻賱丞貙 賵丕賱鬲賷 廿賲丕 兀爻賲丕亍 兀賵 亘亘爻丕胤丞 賴賵 賵囟毓
-  MIME 賳賵毓 丕賱賲乇鬲亘胤丞 丕爻胤丞. 亘丿賱丕 賲賳 匕賱賰貙 賯丿 賷賰賵賳 賲賳 賰丕卅賳 賷丨鬲賵賷 毓賱賶
-  禺賷丕乇丕鬲 丕賱鬲賰賵賷賳 賱賵丕爻胤丞貙 賲毓 <code>name</code> 丕賱禺丕氐賷丞 丕賱鬲賷 賵囟毓 兀爻賲丕亍
-  (毓賱賶 爻亘賷賱 丕賱賲孬丕賱 <code>{name: "javascript", json: true}</code>).
-  氐賮丨丕鬲 丕賱鬲噩乇賷亘賷 賱賰賱 賵囟毓 鬲丨鬲賵賷 毓賱賶 賲毓賱賵賲丕鬲 丨賵賱 賲丕 賲毓賱賲丕鬲 鬲賰賵賷賳 賵囟毓
-  賷丿毓賲賴丕. 賷賲賰賳賰 兀賳 鬲胤賱亘 CodeMirror 丕賱鬲賷 鬲賲 鬲毓乇賷賮賴丕 胤乇賯 賵兀賳賵丕毓 MIME
-  丕賱賰卮賮 毓賱賶 <code>CodeMirror.modes</code>
-  賵 <code>CodeMirror.mimeModes</code> 丕賱賰丕卅賳丕鬲. 賵囟毓 禺乇丕卅胤 丕賱兀爻賲丕亍
-  丕賱兀賵賱賶 賱賲賳卮卅丕鬲 丕賱禺丕氐丞 亘賴賲貙 賵禺乇丕卅胤 賱兀賳賵丕毓 MIME 2 丕賱賲賵丕氐賮丕鬲
-  賵丕爻胤丞.</dd>
-  <dt id=option_theme><code>theme (string)</code></dt>
-  <dd>賲賵囟賵毓 賱賳賲胤 丕賱賲丨乇乇 賲毓. 賷噩亘 毓賱賷賰 丕賱鬲兀賰丿 賲賳 丕賱賲賱賮 CSS 鬲丨丿賷丿
-  丕賱賲賯丕亘賱丞 <code>.cm-s-[name]</code> 賷鬲賲 鬲丨賲賷賱 兀賳賲丕胤 (丕賳馗乇
-  <a href="../theme/"><code>theme</code></a> 丕賱丿賱賷賱 賮賷 丕賱鬲賵夭賷毓).
-  丕賱丕賮鬲乇丕囟賷 賴賵 <code>"default"</code> 貙 賵丕賱鬲賷 鬲賲 鬲囟賲賷賳賴丕 賮賷
-  丕賱兀賱賵丕賳 <code>codemirror.css</code>. 賮賲賳 丕賱賲賲賰賳 丕爻鬲禺丿丕賲 賮卅丕鬲 賲鬲毓丿丿丞
-  賮賷 鬲胤亘賷賯 丕賱爻賲丕鬲 賲乇丞 賵丕丨丿丞 毓賱賶 爻亘賷賱 丕賱賲孬丕賱 <code>"foo bar"</code>
-  爻賷鬲賲 鬲毓賷賷賳 賰賱 賲賳 <code>cm-s-foo</code> 賵 <code>cm-s-bar</code>
-  丕賱胤亘賯丕鬲 廿賱賶 丕賱賲丨乇乇.</dd>
-</dl>
-</textarea></form>
-
-    <script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  mode: "text/html",
-  lineNumbers: true
-});
-</script>
-
-  <p>Demonstration of bi-directional text support. See
-  the <a href="http://marijnhaverbeke.nl/blog/cursor-in-bidi-text.html">related
-  blog post</a> for more background.</p>
-
-  <p><strong>Note:</strong> There is
-  a <a href="https://github.com/codemirror/CodeMirror/issues/1757">known
-  bug</a> with cursor motion and mouse clicks in bi-directional lines
-  that are line wrapped.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/bidi.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/bidi.html.xml
deleted file mode 100644
index bed82ca76bacda51fe2eb5ad0f55d22d642a3c16..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/bidi.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>bidi.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/btree.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/btree.html.html
deleted file mode 100644
index ba07bc74f4dd437d1341d4827184e4095eab7865..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/btree.html.html
+++ /dev/null
@@ -1,83 +0,0 @@
-锘�<!doctype html>
-
-<title>CodeMirror: B-Tree visualization</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<style type="text/css">
-      .lineblock { display: inline-block; margin: 1px; height: 5px; }
-      .CodeMirror {border: 1px solid #aaa; height: 400px}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">B-Tree visualization</a>
-  </ul>
-</div>
-
-<article>
-<h2>B-Tree visualization</h2>
-<form><textarea id="code" name="code">type here, see a summary of the document b-tree below</textarea></form>
-      <div style="display: inline-block; height: 402px; overflow-y: auto" id="output"></div>
-
-    <script id="me">
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true,
-  lineWrapping: true
-});
-var updateTimeout;
-editor.on("change", function(cm) {
-  clearTimeout(updateTimeout);
-  updateTimeout = setTimeout(updateVisual, 200);
-});
-updateVisual();
-
-function updateVisual() {
-  var out = document.getElementById("output");
-  out.innerHTML = "";
-
-  function drawTree(out, node) {
-    if (node.lines) {
-      out.appendChild(document.createElement("div")).innerHTML =
-        "<b>leaf</b>: " + node.lines.length + " lines, " + Math.round(node.height) + " px";
-      var lines = out.appendChild(document.createElement("div"));
-      lines.style.lineHeight = "6px"; lines.style.marginLeft = "10px";
-      for (var i = 0; i < node.lines.length; ++i) {
-        var line = node.lines[i], lineElt = lines.appendChild(document.createElement("div"));
-        lineElt.className = "lineblock";
-        var gray = Math.min(line.text.length * 3, 230), col = gray.toString(16);
-        if (col.length == 1) col = "0" + col;
-        lineElt.style.background = "#" + col + col + col;
-        lineElt.style.width = Math.max(Math.round(line.height / 3), 1) + "px";
-      }
-    } else {
-      out.appendChild(document.createElement("div")).innerHTML =
-        "<b>node</b>: " + node.size + " lines, " + Math.round(node.height) + " px";
-      var sub = out.appendChild(document.createElement("div"));
-      sub.style.paddingLeft = "20px";
-      for (var i = 0; i < node.children.length; ++i)
-        drawTree(sub, node.children[i]);
-    }
-  }
-  drawTree(out, editor.getDoc());
-}
-
-function fillEditor() {
-  var sc = document.getElementById("me");
-  var doc = (sc.textContent || sc.innerText || sc.innerHTML).replace(/^\s*/, "") + "\n";
-  doc += doc; doc += doc; doc += doc; doc += doc; doc += doc; doc += doc;
-  editor.setValue(doc);
-}
-    </script>
-
-<p><button onclick="fillEditor()">Add a lot of content</button></p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/btree.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/btree.html.xml
deleted file mode 100644
index 53884a88b6c49090a201cc1b9e5698fcb461f838..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/btree.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>btree.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/buffers.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/buffers.html.html
deleted file mode 100644
index 16ffc7dfe9dd4aa85804a25c7b1c0fcf28b653d7..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/buffers.html.html
+++ /dev/null
@@ -1,109 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Multiple Buffer & Split View Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/css/css.js"></script>
-<style type="text/css" id=style>
-      .CodeMirror {border: 1px solid black; height: 250px;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Multiple Buffer & Split View</a>
-  </ul>
-</div>
-
-<article>
-<h2>Multiple Buffer & Split View Demo</h2>
-
-
-    <div id=code_top></div>
-    <div>
-      Select buffer: <select id=buffers_top></select>
-      &nbsp; &nbsp; <button onclick="newBuf('top')">New buffer</button>
-    </div>
-    <div id=code_bot></div>
-    <div>
-      Select buffer: <select id=buffers_bot></select>
-      &nbsp; &nbsp; <button onclick="newBuf('bot')">New buffer</button>
-    </div>
-
-    <script id=script>
-var sel_top = document.getElementById("buffers_top");
-CodeMirror.on(sel_top, "change", function() {
-  selectBuffer(ed_top, sel_top.options[sel_top.selectedIndex].value);
-});
-
-var sel_bot = document.getElementById("buffers_bot");
-CodeMirror.on(sel_bot, "change", function() {
-  selectBuffer(ed_bot, sel_bot.options[sel_bot.selectedIndex].value);
-});
-
-var buffers = {};
-
-function openBuffer(name, text, mode) {
-  buffers[name] = CodeMirror.Doc(text, mode);
-  var opt = document.createElement("option");
-  opt.appendChild(document.createTextNode(name));
-  sel_top.appendChild(opt);
-  sel_bot.appendChild(opt.cloneNode(true));
-}
-
-function newBuf(where) {
-  var name = prompt("Name for the buffer", "*scratch*");
-  if (name == null) return;
-  if (buffers.hasOwnProperty(name)) {
-    alert("There's already a buffer by that name.");
-    return;
-  }
-  openBuffer(name, "", "javascript");
-  selectBuffer(where == "top" ? ed_top : ed_bot, name);
-  var sel = where == "top" ? sel_top : sel_bot;
-  sel.value = name;
-}
-
-function selectBuffer(editor, name) {
-  var buf = buffers[name];
-  if (buf.getEditor()) buf = buf.linkedDoc({sharedHist: true});
-  var old = editor.swapDoc(buf);
-  var linked = old.iterLinkedDocs(function(doc) {linked = doc;});
-  if (linked) {
-    // Make sure the document in buffers is the one the other view is looking at
-    for (var name in buffers) if (buffers[name] == old) buffers[name] = linked;
-    old.unlinkDoc(linked);
-  }
-  editor.focus();
-}
-
-function nodeContent(id) {
-  var node = document.getElementById(id), val = node.textContent || node.innerText;
-  val = val.slice(val.match(/^\s*/)[0].length, val.length - val.match(/\s*$/)[0].length) + "\n";
-  return val;
-}
-openBuffer("js", nodeContent("script"), "javascript");
-openBuffer("css", nodeContent("style"), "css");
-
-var ed_top = CodeMirror(document.getElementById("code_top"), {lineNumbers: true});
-selectBuffer(ed_top, "js");
-var ed_bot = CodeMirror(document.getElementById("code_bot"), {lineNumbers: true});
-selectBuffer(ed_bot, "js");
-</script>
-
-    <p>Demonstration of
-    using <a href="../doc/manual.html#linkedDoc">linked documents</a>
-    to provide a split view on a document, and
-    using <a href="../doc/manual.html#swapDoc"><code>swapDoc</code></a>
-    to use a single editor to display multiple documents.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/buffers.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/buffers.html.xml
deleted file mode 100644
index 6fa944cc20bf516c036dfd6e3a3f619ec59be411..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/buffers.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>buffers.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/changemode.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/changemode.html.html
deleted file mode 100644
index 9405932abe689801167b22c01b43a88046f6b1b4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/changemode.html.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Mode-Changing Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/scheme/scheme.js"></script>
-<style type="text/css">
-      .CodeMirror {border: 1px solid black;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Mode-Changing</a>
-  </ul>
-</div>
-
-<article>
-<h2>Mode-Changing Demo</h2>
-<form><textarea id="code" name="code">
-;; If there is Scheme code in here, the editor will be in Scheme mode.
-;; If you put in JS instead, it'll switch to JS mode.
-
-(define (double x)
-  (* x x))
-</textarea></form>
-
-<p>On changes to the content of the above editor, a (crude) script
-tries to auto-detect the language used, and switches the editor to
-either JavaScript or Scheme mode based on that.</p>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    mode: "scheme",
-    lineNumbers: true
-  });
-  var pending;
-  editor.on("change", function() {
-    clearTimeout(pending);
-    pending = setTimeout(update, 400);
-  });
-  function looksLikeScheme(code) {
-    return !/^\s*\(\s*function\b/.test(code) && /^\s*[;\(]/.test(code);
-  }
-  function update() {
-    editor.setOption("mode", looksLikeScheme(editor.getValue()) ? "scheme" : "javascript");
-  }
-</script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/changemode.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/changemode.html.xml
deleted file mode 100644
index 0fdddc5f5eb4d9201c24c864039b4b65aaf122a5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/changemode.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>changemode.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closebrackets.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closebrackets.html.html
deleted file mode 100644
index d702f526962b6a420dd02709493d591d8681620e..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closebrackets.html.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Closebrackets Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/edit/closebrackets.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Closebrackets</a>
-  </ul>
-</div>
-
-<article>
-<h2>Closebrackets Demo</h2>
-<form><textarea id="code" name="code">function Grid(width, height) {
-  this.width = width;
-  this.height = height;
-  this.cells = new Array(width * height);
-}
-Grid.prototype.valueAt = function(point) {
-  return this.cells[point.y * this.width + point.x];
-};
-Grid.prototype.setValueAt = function(point, value) {
-  this.cells[point.y * this.width + point.x] = value;
-};
-Grid.prototype.isInside = function(point) {
-  return point.x >= 0 && point.y >= 0 &&
-         point.x < this.width && point.y < this.height;
-};
-Grid.prototype.moveValue = function(from, to) {
-  this.setValueAt(to, this.valueAt(from));
-  this.setValueAt(from, undefined);
-};</textarea></form>
-
-    <script type="text/javascript">
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {autoCloseBrackets: true});
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closetag.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closetag.html.html
deleted file mode 100644
index 79959d2c4d09f75a077ef10b746bc9ffb2b88bbc..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closetag.html.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Close-Tag Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/edit/closetag.js"></script>
-<script src="../addon/fold/xml-fold.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/css/css.js"></script>
-<script src="../mode/htmlmixed/htmlmixed.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Close-Tag</a>
-  </ul>
-</div>
-
-<article>
-<h2>Close-Tag Demo</h2>
-<form><textarea id="code" name="code"><html</textarea></form>
-
-    <script type="text/javascript">
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: 'text/html',
-        autoCloseTags: true
-      });
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closetag.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closetag.html.xml
deleted file mode 100644
index 2298cc8da5f1ebfd526da1bddf19f37f948581a1..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closetag.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>closetag.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/complete.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/complete.html.html
deleted file mode 100644
index 18e17c8126447c716bfbbe8d95ded6457231edb3..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/complete.html.html
+++ /dev/null
@@ -1,126 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Autocomplete Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/hint/show-hint.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/hint/show-hint.js"></script>
-<script src="../addon/hint/javascript-hint.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/markdown/markdown.js"></script>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Autocomplete</a>
-  </ul>
-</div>
-
-<article>
-<h2>Autocomplete Demo</h2>
-<form><textarea id="code" name="code">
-function getCompletions(token, context) {
-  var found = [], start = token.string;
-  function maybeAdd(str) {
-    if (str.indexOf(start) == 0) found.push(str);
-  }
-  function gatherCompletions(obj) {
-    if (typeof obj == "string") forEach(stringProps, maybeAdd);
-    else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
-    else if (obj instanceof Function) forEach(funcProps, maybeAdd);
-    for (var name in obj) maybeAdd(name);
-  }
-
-  if (context) {
-    // If this is a property, see if it belongs to some object we can
-    // find in the current environment.
-    var obj = context.pop(), base;
-    if (obj.className == "js-variable")
-      base = window[obj.string];
-    else if (obj.className == "js-string")
-      base = "";
-    else if (obj.className == "js-atom")
-      base = 1;
-    while (base != null && context.length)
-      base = base[context.pop().string];
-    if (base != null) gatherCompletions(base);
-  }
-  else {
-    // If not, just look in the window object and any local scope
-    // (reading into JS mode internals to get at the local variables)
-    for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
-    gatherCompletions(window);
-    forEach(keywords, maybeAdd);
-  }
-  return found;
-}
-</textarea></form>
-
-<p>Press <strong>ctrl-space</strong> to activate autocompletion. Built
-on top of the <a href="../doc/manual.html#addon_show-hint"><code>show-hint</code></a>
-and <a href="../doc/manual.html#addon_javascript-hint"><code>javascript-hint</code></a>
-addons.</p>
-
-<form><textarea style="display: none" id="synonyms" name="synonyms">
-Here, the completion use an asynchronous hinting functions to provide
-synonyms for each words. If your browser support `Promises`, the
-hinting function can also return one.
-</textarea></form>
-
-<script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true,
-  extraKeys: {"Ctrl-Space": "autocomplete"},
-  mode: {name: "javascript", globalVars: true}
-});
-
-if (typeof Promise !== undefined) {
-  var comp = [
-    ["here", "hither"],
-    ["asynchronous", "nonsynchronous"],
-    ["completion", "achievement", "conclusion", "culmination", "expirations"],
-    ["hinting", "advive", "broach", "imply"],
-    ["function","action"],
-    ["provide", "add", "bring", "give"],
-    ["synonyms", "equivalents"],
-    ["words", "token"],
-    ["each", "every"],
-  ]
-
-  function synonyms(cm, option) {
-    return new Promise(function(accept) {
-      setTimeout(function() {
-        var cursor = cm.getCursor(), line = cm.getLine(cursor.line)
-        var start = cursor.ch, end = cursor.ch
-        while (start && /\w/.test(line.charAt(start - 1))) --start
-        while (end < line.length && /\w/.test(line.charAt(end))) ++end
-        var word = line.slice(start, end).toLowerCase()
-        for (var i = 0; i < comp.length; i++) if (comp[i].indexOf(word) != -1)
-          return accept({list: comp[i],
-                         from: CodeMirror.Pos(cursor.line, start),
-                         to: CodeMirror.Pos(cursor.line, end)})
-        return accept(null)
-      }, 100)
-    })
-  }
-
-  var editor2 = CodeMirror.fromTextArea(document.getElementById("synonyms"), {
-    extraKeys: {"Ctrl-Space": "autocomplete"},
-    lineNumbers: true,
-    lineWrapping: true,
-    mode: "text/x-markdown",
-    hintOptions: {hint: synonyms}
-  })
-}
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/complete.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/complete.html.xml
deleted file mode 100644
index 1f5f5f0f79c29114a6d03d0915a1960b895fc4fa..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/complete.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>complete.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/emacs.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/emacs.html.html
deleted file mode 100644
index c626b8d408a3e4c6f63350c589034c017fbe9d52..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/emacs.html.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Emacs bindings demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/dialog/dialog.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/clike/clike.js"></script>
-<script src="../keymap/emacs.js"></script>
-<script src="../addon/edit/matchbrackets.js"></script>
-<script src="../addon/comment/comment.js"></script>
-<script src="../addon/dialog/dialog.js"></script>
-<script src="../addon/search/searchcursor.js"></script>
-<script src="../addon/search/search.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Emacs bindings</a>
-  </ul>
-</div>
-
-<article>
-<h2>Emacs bindings demo</h2>
-<form><textarea id="code" name="code">
-#include "syscalls.h"
-/* getchar:  simple buffered version */
-int getchar(void)
-{
-  static char buf[BUFSIZ];
-  static char *bufp = buf;
-  static int n = 0;
-  if (n == 0) {  /* buffer is empty */
-    n = read(0, buf, sizeof buf);
-    bufp = buf;
-  }
-  return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-</textarea></form>
-
-<p>The emacs keybindings are enabled by
-including <a href="../keymap/emacs.js">keymap/emacs.js</a> and setting
-the <code>keyMap</code> option to <code>"emacs"</code>. Because
-CodeMirror's internal API is quite different from Emacs, they are only
-a loose approximation of actual emacs bindings, though.</p>
-
-<p>Also note that a lot of browsers disallow certain keys from being
-captured. For example, Chrome blocks both Ctrl-W and Ctrl-N, with the
-result that idiomatic use of Emacs keys will constantly close your tab
-or open a new window.</p>
-
-    <script>
-      CodeMirror.commands.save = function() {
-        var elt = editor.getWrapperElement();
-        elt.style.background = "#def";
-        setTimeout(function() { elt.style.background = ""; }, 300);
-      };
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "text/x-csrc",
-        keyMap: "emacs"
-      });
-    </script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/emacs.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/emacs.html.xml
deleted file mode 100644
index 301639a91217c30800589250b870e85da238c677..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/emacs.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>emacs.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/folding.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/folding.html.html
deleted file mode 100644
index 06d5830208fa17fd39a151af308b1f4b90947bcd..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/folding.html.html
+++ /dev/null
@@ -1,124 +0,0 @@
-<!doctype html>
-
-<head>
-  <title>CodeMirror: Code Folding Demo</title>
-  <meta charset="utf-8"/>
-  <link rel=stylesheet href="../doc/docs.css">
-
-  <link rel="stylesheet" href="../lib/codemirror.css">
-  <link rel="stylesheet" href="../addon/fold/foldgutter.css" />
-  <script src="../lib/codemirror.js"></script>
-  <script src="../addon/fold/foldcode.js"></script>
-  <script src="../addon/fold/foldgutter.js"></script>
-  <script src="../addon/fold/brace-fold.js"></script>
-  <script src="../addon/fold/xml-fold.js"></script>
-  <script src="../addon/fold/indent-fold.js"></script>
-  <script src="../addon/fold/markdown-fold.js"></script>
-  <script src="../addon/fold/comment-fold.js"></script>
-  <script src="../mode/javascript/javascript.js"></script>
-  <script src="../mode/xml/xml.js"></script>
-  <script src="../mode/python/python.js"></script>
-  <script src="../mode/markdown/markdown.js"></script>
-  <style type="text/css">
-    .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-  </style>
-</head>
-
-<body>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Code Folding</a>
-  </ul>
-</div>
-
-<article>
-  <h2>Code Folding Demo</h2>
-  <form>
-    <div style="max-width: 50em; margin-bottom: 1em">JavaScript:<br>
-    <textarea id="code" name="code"></textarea></div>
-    <div style="max-width: 50em; margin-bottom: 1em">HTML:<br>
-    <textarea id="code-html" name="code-html"></textarea></div>
-    <div style="max-width: 50em">Python:<br>
-    <textarea id="code-python" name="code">
-def foo():
-  do_some_stuff()
-  here
-  return None
-
-class Bar:
-  __init__(self):
-    if True:
-      print("True")
-    else:
-      print("False")
-
-  this_code_makes_no_sense():
-    pass
-
-# A comment</textarea></div>
-    <div style="max-width: 50em">Markdown:<br>
-    <textarea id="code-markdown" name="code"></textarea></div>
-  </form>
-  <script id="script">
-/*
- * Demonstration of code folding
- */
-window.onload = function() {
-  var te = document.getElementById("code");
-  var sc = document.getElementById("script");
-  te.value = (sc.textContent || sc.innerText || sc.innerHTML).replace(/^\s*/, "");
-  sc.innerHTML = "";
-  var te_html = document.getElementById("code-html");
-  te_html.value = document.documentElement.innerHTML;
-  var te_python = document.getElementById("code-python");
-  var te_markdown = document.getElementById("code-markdown");
-  te_markdown.value = "# Foo\n## Bar\n\nblah blah\n\n## Baz\n\nblah blah\n\n# Quux\n\nblah blah\n"
-
-  window.editor = CodeMirror.fromTextArea(te, {
-    mode: "javascript",
-    lineNumbers: true,
-    lineWrapping: true,
-    extraKeys: {"Ctrl-Q": function(cm){ cm.foldCode(cm.getCursor()); }},
-    foldGutter: true,
-    gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
-  });
-  editor.foldCode(CodeMirror.Pos(13, 0));
-
-  window.editor_html = CodeMirror.fromTextArea(te_html, {
-    mode: "text/html",
-    lineNumbers: true,
-    lineWrapping: true,
-    extraKeys: {"Ctrl-Q": function(cm){ cm.foldCode(cm.getCursor()); }},
-    foldGutter: true,
-    gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
-  });
-  editor_html.foldCode(CodeMirror.Pos(0, 0));
-  editor_html.foldCode(CodeMirror.Pos(21, 0));
-
-  window.editor_python = CodeMirror.fromTextArea(te_python, {
-    mode: "python",
-    lineNumbers: true,
-    extraKeys: {"Ctrl-Q": function(cm){ cm.foldCode(cm.getCursor()); }},
-    foldGutter: true,
-    gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
-  });
-
-  window.editor_markdown = CodeMirror.fromTextArea(te_markdown, {
-    mode: "markdown",
-    lineNumbers: true,
-    lineWrapping: true,
-    extraKeys: {"Ctrl-Q": function(cm){ cm.foldCode(cm.getCursor()); }},
-    foldGutter: true,
-    gutters: ["CodeMirror-linenumbers", "CodeMirror-foldgutter"]
-  });
-};
-  </script>
-</article>
-</body>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/folding.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/folding.html.xml
deleted file mode 100644
index fa4731709ee19d4067ef0b360fb3ec72fb9a372b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/folding.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>folding.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/fullscreen.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/fullscreen.html.html
deleted file mode 100644
index 1fbdc488e1a54957e3cde719a8b25026dc9995ed..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/fullscreen.html.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Full Screen Editing</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/display/fullscreen.css">
-<link rel="stylesheet" href="../theme/night.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../addon/display/fullscreen.js"></script>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Full Screen Editing</a>
-  </ul>
-</div>
-
-<article>
-<h2>Full Screen Editing</h2>
-<form><textarea id="code" name="code" rows="5">
-<dl>
-  <dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt>
-  <dd>Whether, when indenting, the first N*<code>tabSize</code>
-  spaces should be replaced by N tabs. Default is false.</dd>
-
-  <dt id="option_electricChars"><code><strong>electricChars</strong>: boolean</code></dt>
-  <dd>Configures whether the editor should re-indent the current
-  line when a character is typed that might change its proper
-  indentation (only works if the mode supports indentation).
-  Default is true.</dd>
-
-  <dt id="option_specialChars"><code><strong>specialChars</strong>: RegExp</code></dt>
-  <dd>A regular expression used to determine which characters
-  should be replaced by a
-  special <a href="#option_specialCharPlaceholder">placeholder</a>.
-  Mostly useful for non-printing special characters. The default
-  is <code>/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/</code>.</dd>
-  <dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char)聽鈫捖燛lement</code></dt>
-  <dd>A function that, given a special character identified by
-  the <a href="#option_specialChars"><code>specialChars</code></a>
-  option, produces a DOM node that is used to represent the
-  character. By default, a red dot (<span style="color: red">鈥�</span>)
-  is shown, with a title tooltip to indicate the character code.</dd>
-
-  <dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt>
-  <dd>Determines whether horizontal cursor movement through
-  right-to-left (Arabic, Hebrew) text is visual (pressing the left
-  arrow moves the cursor left) or logical (pressing the left arrow
-  moves to the next lower index in the string, which is visually
-  right in right-to-left text). The default is <code>false</code>
-  on Windows, and <code>true</code> on other platforms.</dd>
-</dl>
-</textarea></form>
-  <script>
-    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-      lineNumbers: true,
-      theme: "night",
-      extraKeys: {
-        "F11": function(cm) {
-          cm.setOption("fullScreen", !cm.getOption("fullScreen"));
-        },
-        "Esc": function(cm) {
-          if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
-        }
-      }
-    });
-  </script>
-
-    <p>Demonstration of
-    the <a href="../doc/manual.html#addon_fullscreen">fullscreen</a>
-    addon. Press <strong>F11</strong> when cursor is in the editor to
-    toggle full screen editing. <strong>Esc</strong> can also be used
-    to <i>exit</i> full screen editing.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/fullscreen.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/fullscreen.html.xml
deleted file mode 100644
index 09539b835017775fe2fed59905b9084c6b861c32..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/fullscreen.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>fullscreen.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/hardwrap.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/hardwrap.html.html
deleted file mode 100644
index 84ba0cc0c2d3772ef9086e5c7373e2208848c81b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/hardwrap.html.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Hard-wrapping Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/markdown/markdown.js"></script>
-<script src="../addon/wrap/hardwrap.js"></script>
-<style type="text/css">
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Hard-wrapping</a>
-  </ul>
-</div>
-
-<article>
-<h2>Hard-wrapping Demo</h2>
-<form><textarea id="code" name="code">Lorem ipsum dolor sit amet, vim augue dictas constituto ex,
-sit falli simul viderer te. Graeco scaevola maluisset sit
-ut, in idque viris praesent sea. Ea sea eirmod indoctum
-repudiare. Vel noluisse suscipit pericula ut. In ius nulla
-alienum molestie. Mei essent discere democritum id.
-
-Equidem ponderum expetendis ius in, mea an erroribus
-constituto, congue timeam perfecto ad est. Ius ut primis
-timeam, per in ullum mediocrem. An case vero labitur pri,
-vel dicit laoreet et. An qui prompta conclusionemque, eam
-timeam sapientem in, cum dictas epicurei eu.
-
-Usu cu vide dictas deseruisse, eum choro graece adipiscing
-ut. Cibo qualisque ius ad, et dicat scripta mea, eam nihil
-mentitum aliquando cu. Debet aperiam splendide at quo, ad
-paulo nostro commodo duo. Sea adhuc utinam conclusionemque
-id, quas doming malorum nec ad. Tollit eruditi vivendum ad
-ius, eos soleat ignota ad.
-</textarea></form>
-
-<p>Demonstration of
-the <a href="../doc/manual.html#addon_hardwrap">hardwrap</a> addon.
-The above editor has its change event hooked up to
-the <code>wrapParagraphsInRange</code> method, so that the paragraphs
-are reflown as you are typing.</p>
-
-<script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  mode: "markdown",
-  lineNumbers: true,
-  extraKeys: {
-    "Ctrl-Q": function(cm) { cm.wrapParagraph(cm.getCursor(), options); }
-  }
-});
-var wait, options = {column: 60}, changing = false;
-editor.on("change", function(cm, change) {
-  if (changing) return;
-  clearTimeout(wait);
-  wait = setTimeout(function() {
-    changing = true;
-    cm.wrapParagraphsInRange(change.from, CodeMirror.changeEnd(change), options);
-    changing = false;
-  }, 200);
-});
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/hardwrap.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/hardwrap.html.xml
deleted file mode 100644
index 7af9040f1cba5bb2d7ba37315ec1a9d15e34cc47..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/hardwrap.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>hardwrap.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/html5complete.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/html5complete.html.html
deleted file mode 100644
index 411baae3edfe7f30a92224b7aab84b9cb83793c6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/html5complete.html.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!doctype html>
-
-<head>
-  <title>CodeMirror: HTML completion demo</title>
-  <meta charset="utf-8"/>
-  <link rel=stylesheet href="../doc/docs.css">
-
-  <link rel="stylesheet" href="../lib/codemirror.css">
-  <link rel="stylesheet" href="../addon/hint/show-hint.css">
-  <script src="../lib/codemirror.js"></script>
-  <script src="../addon/hint/show-hint.js"></script>
-  <script src="../addon/hint/xml-hint.js"></script>
-  <script src="../addon/hint/html-hint.js"></script>
-  <script src="../mode/xml/xml.js"></script>
-  <script src="../mode/javascript/javascript.js"></script>
-  <script src="../mode/css/css.js"></script>
-  <script src="../mode/htmlmixed/htmlmixed.js"></script>
-  <style type="text/css">
-    .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;}
-  </style>
-</head>
-
-<body>
-  <div id=nav>
-    <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-    <ul>
-      <li><a href="../index.html">Home</a>
-      <li><a href="../doc/manual.html">Manual</a>
-      <li><a href="https://github.com/codemirror/codemirror">Code</a>
-    </ul>
-    <ul>
-      <li><a class=active href="#">HTML completion</a>
-    </ul>
-  </div>
-
-  <article>
-    <h2>HTML completion demo</h2>
-
-    <p>Shows the <a href="xmlcomplete.html">XML completer</a>
-    parameterized with information about the tags in HTML.
-    Press <strong>ctrl-space</strong> to activate completion.</p>
-
-    <div id="code"></div>
-
-    <script type="text/javascript">
-      window.onload = function() {
-        editor = CodeMirror(document.getElementById("code"), {
-          mode: "text/html",
-          extraKeys: {"Ctrl-Space": "autocomplete"},
-          value: document.documentElement.innerHTML
-        });
-      };
-    </script>
-  </article>
-</body>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/indentwrap.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/indentwrap.html.html
deleted file mode 100644
index 3d3d0af6abd386e9d09ef1ac74bd433945aff1d9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/indentwrap.html.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Indented wrapped line demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .CodeMirror pre > * { text-indent: 0px; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Indented wrapped line</a>
-  </ul>
-</div>
-
-<article>
-<h2>Indented wrapped line demo</h2>
-<form><textarea id="code" name="code">
-<!doctype html>
-<body>
-  <h2 id="overview">Overview</h2>
-
-  <p>CodeMirror is a code-editor component that can be embedded in Web pages. The core library provides <em>only</em> the editor component, no accompanying buttons, auto-completion, or other IDE functionality. It does provide a rich API on top of which such functionality can be straightforwardly implemented. See the <a href="#addons">add-ons</a> included in the distribution, and the <a href="https://github.com/jagthedrummer/codemirror-ui">CodeMirror UI</a> project, for reusable implementations of extra features.</p>
-
-  <p>CodeMirror works with language-specific modes. Modes are JavaScript programs that help color (and optionally indent) text written in a given language. The distribution comes with a number of modes (see the <a href="../mode/"><code>mode/</code></a> directory), and it isn't hard to <a href="#modeapi">write new ones</a> for other languages.</p>
-</body>
-</textarea></form>
-
-    <p>This page uses a hack on top of the <code>"renderLine"</code>
-    event to make wrapped text line up with the base indentation of
-    the line.</p>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        lineWrapping: true,
-        mode: "text/html"
-      });
-      var charWidth = editor.defaultCharWidth(), basePadding = 4;
-      editor.on("renderLine", function(cm, line, elt) {
-        var off = CodeMirror.countColumn(line.text, null, cm.getOption("tabSize")) * charWidth;
-        elt.style.textIndent = "-" + off + "px";
-        elt.style.paddingLeft = (basePadding + off) + "px";
-      });
-      editor.refresh();
-    </script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/indentwrap.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/indentwrap.html.xml
deleted file mode 100644
index 39c564fb4d6592fff6960749c01dbd2658bf75e6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/indentwrap.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>indentwrap.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/lint.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/lint.html.html
deleted file mode 100644
index 96009b4e1fe24b437fe4ad003cf93b31638fc4cc..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/lint.html.html
+++ /dev/null
@@ -1,171 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Linter Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/lint/lint.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/css/css.js"></script>
-<script src="//ajax.aspnetcdn.com/ajax/jshint/r07/jshint.js"></script>
-<script src="https://rawgithub.com/zaach/jsonlint/79b553fb65c192add9066da64043458981b3972b/lib/jsonlint.js"></script>
-<script src="http://csslint.net/js/csslint.js"></script>
-<script src="../addon/lint/lint.js"></script>
-<script src="../addon/lint/javascript-lint.js"></script>
-<script src="../addon/lint/json-lint.js"></script>
-<script src="../addon/lint/css-lint.js"></script>
-<style type="text/css">
-      .CodeMirror {border: 1px solid black;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Linter</a>
-  </ul>
-</div>
-
-<article>
-<h2>Linter Demo</h2>
-
-
-    <p><textarea id="code-js">var widgets = []
-function updateHints() {
-  editor.operation(function(){
-    for (var i = 0; i < widgets.length; ++i)
-      editor.removeLineWidget(widgets[i]);
-    widgets.length = 0;
-
-    JSHINT(editor.getValue());
-    for (var i = 0; i < JSHINT.errors.length; ++i) {
-      var err = JSHINT.errors[i];
-      if (!err) continue;
-      var msg = document.createElement("div");
-      var icon = msg.appendChild(document.createElement("span"));
-      icon.innerHTML = "!!";
-      icon.className = "lint-error-icon";
-      msg.appendChild(document.createTextNode(err.reason));
-      msg.className = "lint-error";
-      widgets.push(editor.addLineWidget(err.line - 1, msg, {coverGutter: false, noHScroll: true}));
-    }
-  });
-  var info = editor.getScrollInfo();
-  var after = editor.charCoords({line: editor.getCursor().line + 1, ch: 0}, "local").top;
-  if (info.top + info.clientHeight < after)
-    editor.scrollTo(null, after - info.clientHeight + 3);
-}
-</textarea></p>
-
-    <p><textarea id="code-json">[
- {
-  _id: "post 1",
-  "author": "Bob",
-  "content": "...",
-  "page_views": 5
- },
- {
-  "_id": "post 2",
-  "author": "Bob",
-  "content": "...",
-  "page_views": 9
- },
- {
-  "_id": "post 3",
-  "author": "Bob",
-  "content": "...",
-  "page_views": 8
- }
-]
-</textarea></p>
-
-    <p><textarea id="code-css">@charset "UTF-8";
-
-@import url("booya.css") print, screen;
-@import "whatup.css" screen;
-@import "wicked.css";
-
-/*Error*/
-@charset "UTF-8";
-
-
-@namespace "http://www.w3.org/1999/xhtml";
-@namespace svg "http://www.w3.org/2000/svg";
-
-/*Warning: empty ruleset */
-.foo {
-}
-
-h1 {
-    font-weight: bold;
-}
-
-/*Warning: qualified heading */
-.foo h1 {
-    font-weight: bold;
-}
-
-/*Warning: adjoining classes */
-.foo.bar {
-    zoom: 1;
-}
-
-li.inline {
-    width: 100%;  /*Warning: 100% can be problematic*/
-}
-
-li.last {
-  display: inline;
-  padding-left: 3px !important;
-  padding-right: 3px;
-  border-right: 0px;
-}
-
-@media print {
-    li.inline {
-      color: black;
-    }
-}
-
-@page {
-  margin: 10%;
-  counter-increment: page;
-
-  @top-center {
-    font-family: sans-serif;
-    font-weight: bold;
-    font-size: 2em;
-    content: counter(page);
-  }
-}
-</textarea></p>
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code-js"), {
-    lineNumbers: true,
-    mode: "javascript",
-    gutters: ["CodeMirror-lint-markers"],
-    lint: true
-  });
-
-  var editor_json = CodeMirror.fromTextArea(document.getElementById("code-json"), {
-    lineNumbers: true,
-    mode: "application/json",
-    gutters: ["CodeMirror-lint-markers"],
-    lint: true
-  });
-  
-  var editor_css = CodeMirror.fromTextArea(document.getElementById("code-css"), {
-    lineNumbers: true,
-    mode: "css",
-    gutters: ["CodeMirror-lint-markers"],
-    lint: true
-  });
-</script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/lint.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/lint.html.xml
deleted file mode 100644
index cce42de22cc376a5ff7f3069bee1a66723b5f2cd..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/lint.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>lint.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/loadmode.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/loadmode.html.html
deleted file mode 100644
index 809cd90225cb2a9054d745b8d9d14eacbee0877d..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/loadmode.html.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Lazy Mode Loading Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/mode/loadmode.js"></script>
-<script src="../mode/meta.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Lazy Mode Loading</a>
-  </ul>
-</div>
-
-<article>
-<h2>Lazy Mode Loading Demo</h2>
-<p style="color: gray">Current mode: <span id="modeinfo">text/plain</span></p>
-<form><textarea id="code" name="code">This is the editor.
-// It starts out in plain text mode,
-#  use the control below to load and apply a mode
-  "you'll see the highlighting of" this text /*change*/.
-</textarea></form>
-<p>Filename, mime, or mode name: <input type=text value=foo.js id=mode> <button type=button onclick="change()">change mode</button></p>
-
-    <script>
-CodeMirror.modeURL = "../mode/%N/%N.js";
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true
-});
-var modeInput = document.getElementById("mode");
-CodeMirror.on(modeInput, "keypress", function(e) {
-  if (e.keyCode == 13) change();
-});
-function change() {
-  var val = modeInput.value, m, mode, spec;
-  if (m = /.+\.([^.]+)$/.exec(val)) {
-    var info = CodeMirror.findModeByExtension(m[1]);
-    if (info) {
-      mode = info.mode;
-      spec = info.mime;
-    }
-  } else if (/\//.test(val)) {
-    var info = CodeMirror.findModeByMIME(val);
-    if (info) {
-      mode = info.mode;
-      spec = val;
-    }
-  } else {
-    mode = spec = val;
-  }
-  if (mode) {
-    editor.setOption("mode", spec);
-    CodeMirror.autoLoadMode(editor, mode);
-    document.getElementById("modeinfo").textContent = spec;
-  } else {
-    alert("Could not find a mode corresponding to " + val);
-  }
-}
-</script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/loadmode.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/loadmode.html.xml
deleted file mode 100644
index 717965189e824f2ae218d0c3cb26d5ffe286b286..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/loadmode.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>loadmode.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/marker.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/marker.html.html
deleted file mode 100644
index 3a8b850009e276c31c01275be3e62300e5ef7570..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/marker.html.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Breakpoint Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<style type="text/css">
-      .breakpoints {width: .8em;}
-      .breakpoint { color: #822; }
-      .CodeMirror {border: 1px solid #aaa;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Breakpoint</a>
-  </ul>
-</div>
-
-<article>
-<h2>Breakpoint Demo</h2>
-<form><textarea id="code" name="code">
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true,
-  gutters: ["CodeMirror-linenumbers", "breakpoints"]
-});
-editor.on("gutterClick", function(cm, n) {
-  var info = cm.lineInfo(n);
-  cm.setGutterMarker(n, "breakpoints", info.gutterMarkers ? null : makeMarker());
-});
-
-function makeMarker() {
-  var marker = document.createElement("div");
-  marker.style.color = "#822";
-  marker.innerHTML = "鈼�";
-  return marker;
-}
-</textarea></form>
-
-<p>Click the line-number gutter to add or remove 'breakpoints'.</p>
-
-    <script>eval(document.getElementById("code").value);</script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/marker.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/marker.html.xml
deleted file mode 100644
index a3dc727a182a3e4cd7db81f1befa6bb64389fcce..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/marker.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>marker.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/markselection.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/markselection.html.html
deleted file mode 100644
index d4c8a7a0d145c7b131b7a685cbc049a1fea20311..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/markselection.html.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Selection Marking Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/search/searchcursor.js"></script>
-<script src="../addon/selection/mark-selection.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .CodeMirror-selected  { background-color: blue !important; }
-      .CodeMirror-selectedtext { color: white; }
-      .styled-background { background-color: #ff7; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Selection Marking</a>
-  </ul>
-</div>
-
-<article>
-<h2>Selection Marking Demo</h2>
-<form><textarea id="code" name="code">
-Select something from here. You'll see that the selection's foreground
-color changes to white! Since, by default, CodeMirror only puts an
-independent "marker" layer behind the text, you'll need something like
-this to change its colour.
-
-Also notice that turning this addon on (with the default style) allows
-you to safely give text a background color without screwing up the
-visibility of the selection.</textarea></form>
-
-    <script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true,
-  styleSelectedText: true
-});
-editor.markText({line: 6, ch: 26}, {line: 6, ch: 42}, {className: "styled-background"});
-</script>
-
-    <p>Simple addon to easily mark (and style) selected text. <a href="../doc/manual.html#addon_mark-selection">Docs</a>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchhighlighter.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchhighlighter.html.html
deleted file mode 100644
index 893d72134b4c7d4902b731ff48dd401c5d515ad9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchhighlighter.html.html
+++ /dev/null
@@ -1,103 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Match Highlighter Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/scroll/annotatescrollbar.js"></script>
-<script src="../addon/search/matchesonscrollbar.js"></script>
-<script src="../addon/search/searchcursor.js"></script>
-<script src="../addon/search/match-highlighter.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .CodeMirror-focused .cm-matchhighlight {
-        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAYAAABytg0kAAAAFklEQVQI12NgYGBgkKzc8x9CMDAwAAAmhwSbidEoSQAAAABJRU5ErkJggg==);
-        background-position: bottom;
-        background-repeat: repeat-x;
-      }
-      .cm-matchhighlight {background-color: lightgreen}
-      .CodeMirror-selection-highlight-scrollbar {background-color: green}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Match Highlighter</a>
-  </ul>
-</div>
-
-<article>
-<h2>Match Highlighter Demo</h2>
-<form><textarea id="code" name="code">Select this text: hardtospot
-  And everywhere else in your code where hardtospot appears will
-automatically illuminate.  Give it a try!  No more hard to spot
-variables - stay in context of your code all the time.
-
-Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut pharetra
-interdum dui eu pulvinar. Mauris maximus ligula venenatis tempus
-interdum. Cras hendrerit, ipsum sed ultrices pharetra, ligula diam
-porttitor lacus, ac tempor eros est a massa. Nam orci elit, vulputate
-in tristique quis, consectetur vitae metus. Pellentesque et enim
-elementum, lobortis augue in, lacinia sapien. Morbi eu nunc semper,
-sagittis felis a, pellentesque mauris. Lorem ipsum dolor sit amet,
-consectetur adipiscing elit. Aenean quis diam turpis.
-
-Fusce lobortis nisl quis aliquet euismod. Aenean vitae nulla non ipsum
-efficitur scelerisque. Curabitur auctor, lorem non rhoncus porttitor,
-augue ligula lacinia dolor, et vehicula magna lorem imperdiet velit.
-Fusce risus sem, hardtospot commodo eleifend hendrerit vitae, mollis
-quis risus. Cras tincidunt, justo vitae hendrerit venenatis, urna
-dolor placerat tortor, eu lobortis lectus dolor in ligula. Nullam non
-erat non nisl vulputate ultrices sit amet vestibulum dolor. Quisque in
-tortor porta, pellentesque odio nec, malesuada nibh.
-
-In a dui feugiat, ullamcorper urna in, accumsan magna. Donec egestas
-sem nec eros rhoncus, vel gravida purus ornare. Nulla orci mauris,
-porta nec pharetra sed, ornare et lorem. Donec luctus turpis nunc,
-eget dictum felis mollis et.  Sed sodales hardtospot nunc vitae leo
-rhoncus imperdiet. Donec elementum malesuada velit quis placerat.
-Proin accumsan lorem id nisi volutpat ullamcorper. Vivamus laoreet
-dolor ac sem malesuada, ac scelerisque ex efficitur. Aliquam tempus
-libero velit, vel tristique augue vulputate nec.
-
-Mauris ultrices leo felis, sit amet congue augue aliquam condimentum.
-Vivamus purus leo, mattis vitae dignissim vel, ultricies ac ex. Mauris
-eu dolor eu purus ultricies ultrices. Sed euismod feugiat ex et
-mattis. Morbi cursus laoreet pharetra. Donec eu dolor sodales,
-ultricies nisi et, malesuada urna.  Praesent sit amet fringilla felis.
-Nam rhoncus, est blandit auctor auctor, lorem ipsum laoreet ipsum,
-quis sodales libero odio in lorem. Phasellus odio dolor, elementum
-sagittis nibh non, fermentum semper libero. Mauris hendrerit
-hardtospot lectus sit amet commodo eleifend. Morbi pulvinar eget nisl
-at eleifend. Fusce eget porta erat, vitae lobortis libero.
-
-Phasellus sit amet massa in massa pharetra malesuada. Vestibulum at
-quam vel libero aliquam volutpat at ut dui. Praesent scelerisque vel
-mauris sit amet vehicula. Phasellus at mi nec ligula cursus interdum
-sit amet non quam. Aliquam tempus sollicitudin euismod. Nulla euismod
-mollis enim tincidunt placerat.  Proin ac scelerisque enim, quis
-sollicitudin metus. Pellentesque congue nec sapien ut rhoncus. Sed
-eget ornare diam, ut consectetur ante. Aenean eleifend mauris quis
-ornare accumsan. In hac habitasse hardtospot platea dictumst.
-
-</textarea></form>
-
-    <script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true,
-  // To highlight on scrollbars as well, pass annotateScrollbar in options
-  // as below.
-  highlightSelectionMatches: {showToken: /\w/, annotateScrollbar: true}
-});
-</script>
-
-    <p>Search and highlight occurences of the selected text.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchhighlighter.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchhighlighter.html.xml
deleted file mode 100644
index 3de19908ac2adccdca8a332b6c7a6d399f470669..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchhighlighter.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>matchhighlighter.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchtags.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchtags.html.html
deleted file mode 100644
index 175639a3965105d10e44d5de221767afa9edd8fb..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchtags.html.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Tag Matcher Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/fold/xml-fold.js"></script>
-<script src="../addon/edit/matchtags.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Tag Matcher</a>
-  </ul>
-</div>
-
-<article>
-<h2>Tag Matcher Demo</h2>
-
-
-    <div id="editor"></div>
-
-    <script>
-window.onload = function() {
-  editor = CodeMirror(document.getElementById("editor"), {
-    value: "<html>\n  " + document.documentElement.innerHTML + "\n</html>",
-    mode: "text/html",
-    matchTags: {bothTags: true},
-    extraKeys: {"Ctrl-J": "toMatchingTag"}
-  });
-};
-    </script>
-
-    <p>Put the cursor on or inside a pair of tags to highlight them.
-    Press Ctrl-J to jump to the tag that matches the one under the
-    cursor.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchtags.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchtags.html.xml
deleted file mode 100644
index a49b3c895366f30c4268e8d12b5b0d289c9c4289..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/matchtags.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>matchtags.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/merge.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/merge.html.html
deleted file mode 100644
index 20783b866cdfc60bf35acc16ca723c9d19407f62..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/merge.html.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: merge view demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel=stylesheet href="../lib/codemirror.css">
-<link rel=stylesheet href="../addon/merge/merge.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../mode/css/css.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/htmlmixed/htmlmixed.js"></script>
-<script src="https://cdnjs.cloudflare.com/ajax/libs/diff_match_patch/20121119/diff_match_patch.js"></script>
-<script src="../addon/merge/merge.js"></script>
-<style>
-    .CodeMirror { line-height: 1.2; }
-    @media screen and (min-width: 1300px) {
-      article { max-width: 1000px; }
-      #nav { border-right: 499px solid transparent; }
-    }
-    span.clicky {
-      cursor: pointer;
-      background: #d70;
-      color: white;
-      padding: 0 3px;
-      border-radius: 3px;
-    }
-  </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">merge view</a>
-  </ul>
-</div>
-
-<article>
-<h2>merge view demo</h2>
-
-
-<div id=view></div>
-
-<p>The <a href="../doc/manual.html#addon_merge"><code>merge</code></a>
-addon provides an interface for displaying and merging diffs,
-either <span class=clicky onclick="panes = 2; initUI()">two-way</span>
-or <span class=clicky onclick="panes = 3; initUI()">three-way</span>.
-The left (or center) pane is editable, and the differences with the
-other pane(s) are <span class=clicky
-onclick="toggleDifferences()">optionally</span> shown live as you edit
-it. In the two-way configuration, there are also options to pad changed
-sections to <span class=clicky onclick="connect = connect ? null :
-'align'; initUI()">align</span> them, and to <span class=clicky
-onclick="collapse = !collapse; initUI()">collapse</span> unchanged
-stretches of text.</p>
-
-<p>This addon depends on
-the <a href="https://code.google.com/p/google-diff-match-patch/">google-diff-match-patch</a>
-library to compute the diffs.</p>
-
-<script>
-var value, orig1, orig2, dv, panes = 2, highlight = true, connect = null, collapse = false;
-function initUI() {
-  if (value == null) return;
-  var target = document.getElementById("view");
-  target.innerHTML = "";
-  dv = CodeMirror.MergeView(target, {
-    value: value,
-    origLeft: panes == 3 ? orig1 : null,
-    orig: orig2,
-    lineNumbers: true,
-    mode: "text/html",
-    highlightDifferences: highlight,
-    connect: connect,
-    collapseIdentical: collapse
-  });
-}
-
-function toggleDifferences() {
-  dv.setShowDifferences(highlight = !highlight);
-}
-
-window.onload = function() {
-  value = document.documentElement.innerHTML;
-  orig1 = "<!doctype html>\n\n" + value.replace(/\.\.\//g, "codemirror/").replace("yellow", "orange");
-  orig2 = value.replace(/\u003cscript/g, "\u003cscript type=text/javascript ")
-    .replace("white", "purple;\n      font: comic sans;\n      text-decoration: underline;\n      height: 15em");
-  initUI();
-};
-
-function mergeViewHeight(mergeView) {
-  function editorHeight(editor) {
-    if (!editor) return 0;
-    return editor.getScrollInfo().height;
-  }
-  return Math.max(editorHeight(mergeView.leftOriginal()),
-                  editorHeight(mergeView.editor()),
-                  editorHeight(mergeView.rightOriginal()));
-}
-
-function resize(mergeView) {
-  var height = mergeViewHeight(mergeView);
-  for(;;) {
-    if (mergeView.leftOriginal())
-      mergeView.leftOriginal().setSize(null, height);
-    mergeView.editor().setSize(null, height);
-    if (mergeView.rightOriginal())
-      mergeView.rightOriginal().setSize(null, height);
-
-    var newHeight = mergeViewHeight(mergeView);
-    if (newHeight >= height) break;
-    else height = newHeight;
-  }
-  mergeView.wrap.style.height = height + "px";
-}
-</script>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/merge.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/merge.html.xml
deleted file mode 100644
index ca214a8191b01c3d897521901b9fc537d01b81f9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/merge.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>merge.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/multiplex.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/multiplex.html.html
deleted file mode 100644
index ca8c80aedc6d808161cafcd02113aaef893f38a3..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/multiplex.html.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Multiplexing Parser Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/mode/multiplex.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<style type="text/css">
-      .CodeMirror {border: 1px solid black;}
-      .cm-delimit {color: #fa4;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Multiplexing Parser</a>
-  </ul>
-</div>
-
-<article>
-<h2>Multiplexing Parser Demo</h2>
-<form><textarea id="code" name="code">
-<html>
-  <body style="<<magic>>">
-    <h1><< this is not <html >></h1>
-    <<
-        multiline
-        not html
-        at all : &amp;amp; <link/>
-    >>
-    <p>this is html again</p>
-  </body>
-</html>
-</textarea></form>
-
-    <script>
-CodeMirror.defineMode("demo", function(config) {
-  return CodeMirror.multiplexingMode(
-    CodeMirror.getMode(config, "text/html"),
-    {open: "<<", close: ">>",
-     mode: CodeMirror.getMode(config, "text/plain"),
-     delimStyle: "delimit"}
-    // .. more multiplexed styles can follow here
-  );
-});
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  mode: "demo",
-  lineNumbers: true,
-  lineWrapping: true
-});
-</script>
-
-    <p>Demonstration of a multiplexing mode, which, at certain
-    boundary strings, switches to one or more inner modes. The out
-    (HTML) mode does not get fed the content of the <code>&lt;&lt;
-    >></code> blocks. See
-    the <a href="../doc/manual.html#addon_multiplex">manual</a> and
-    the <a href="../addon/mode/multiplex.js">source</a> for more
-    information.</p>
-
-    <p>
-      <strong>Parsing/Highlighting Tests:</strong>
-      <a href="../test/index.html#multiplexing_*">normal</a>,
-      <a href="../test/index.html#verbose,multiplexing_*">verbose</a>.
-    </p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/multiplex.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/multiplex.html.xml
deleted file mode 100644
index e35fffeaa1c04894e45876ba26b1b9470ba7282e..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/multiplex.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>multiplex.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/mustache.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/mustache.html.html
deleted file mode 100644
index ae4e6a891bbd2513c0974eca9c4737425a8a74e1..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/mustache.html.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Overlay Parser Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/mode/overlay.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<style type="text/css">
-      .CodeMirror {border: 1px solid black;}
-      .cm-mustache {color: #0ca;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Overlay Parser</a>
-  </ul>
-</div>
-
-<article>
-<h2>Overlay Parser Demo</h2>
-<form><textarea id="code" name="code">
-<html>
-  <body>
-    <h1>{{title}}</h1>
-    <p>These are links to {{things}}:</p>
-    <ul>{{#links}}
-      <li><a href="{{url}}">{{text}}</a></li>
-    {{/links}}</ul>
-  </body>
-</html>
-</textarea></form>
-
-    <script>
-CodeMirror.defineMode("mustache", function(config, parserConfig) {
-  var mustacheOverlay = {
-    token: function(stream, state) {
-      var ch;
-      if (stream.match("{{")) {
-        while ((ch = stream.next()) != null)
-          if (ch == "}" && stream.next() == "}") {
-            stream.eat("}");
-            return "mustache";
-          }
-      }
-      while (stream.next() != null && !stream.match("{{", false)) {}
-      return null;
-    }
-  };
-  return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay);
-});
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "mustache"});
-</script>
-
-    <p>Demonstration of a mode that parses HTML, highlighting
-    the <a href="http://mustache.github.com/">Mustache</a> templating
-    directives inside of it by using the code
-    in <a href="../addon/mode/overlay.js"><code>overlay.js</code></a>. View
-    source to see the 15 lines of code needed to accomplish this.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/mustache.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/mustache.html.xml
deleted file mode 100644
index c9e26aed0c77d68abcfed73fde13608f75ffd901..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/mustache.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>mustache.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/panel.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/panel.html.html
deleted file mode 100644
index 1ce3d87c792532ae5d7e1dcf1971215c9390f37e..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/panel.html.html
+++ /dev/null
@@ -1,136 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Panel Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../mode/htmlmixed/htmlmixed.js"></script>
-<script src="../addon/display/panel.js"></script>
-<style type="text/css">
-  .border {
-    border: 1px solid #f7f7f7;
-  }
-  .add-panel {
-    background: orange;
-    padding: 3px 6px;
-    color: white !important; 
-    border-radius: 3px;
-  }
-  .add-panel, .remove-panel {
-    cursor: pointer;
-  }
-  .remove-panel {
-    float: right;
-  }
-  .panel {
-    background: #f7f7f7;
-    padding: 3px 7px;
-    font-size: 0.85em;
-  }
-  .panel.top, .panel.after-top {
-    border-bottom: 1px solid #ddd;
-  }
-  .panel.bottom, .panel.before-bottom {
-    border-top: 1px solid #ddd;
-  }
-</style>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Panel</a>
-  </ul>
-</div>
-
-<article>
-
-<h2>Panel Demo</h2>
-
-<div class="border">
-    <textarea id="code" name="code"></textarea>
-</div>
-
-<p>
-  The <a href="../doc/manual.html#addon_panel"><code>panel</code></a>
-  addon allows you to display panels above or below an editor.
-  <br>
-  Click the links below to add panels at the given position:
-</p>
-
-<div id="demo">
-<p>
-  <a class="add-panel" onclick="addPanel('top')">top</a>
-  <a class="add-panel" onclick="addPanel('after-top')">after-top</a>
-  <a class="add-panel" onclick="addPanel('before-bottom')">before-bottom</a>
-  <a class="add-panel" onclick="addPanel('bottom')">bottom</a>
-</p>
-<p>
-  You can also replace an existing panel:
-</p>
-<form onsubmit="return replacePanel(this);" name="replace_panel">
-  <input type="submit" value="Replace panel n掳" />
-  <input type="number" name="panel_id" min="1" value="1" />
-</form>
-
-<script>
-var textarea = document.getElementById("code");
-var demo = document.getElementById("demo");
-var numPanels = 0;
-var panels = {};
-var editor;
-
-textarea.value = demo.innerHTML.trim();
-editor = CodeMirror.fromTextArea(textarea, {
-  lineNumbers: true,
-  mode: "htmlmixed"
-});
-
-function makePanel(where) {
-  var node = document.createElement("div");
-  var id = ++numPanels;
-  var widget, close, label;
-
-  node.id = "panel-" + id;
-  node.className = "panel " + where;
-  close = node.appendChild(document.createElement("a"));
-  close.setAttribute("title", "Remove me!");
-  close.setAttribute("class", "remove-panel");
-  close.textContent = "鉁�";
-  CodeMirror.on(close, "click", function() {
-    panels[node.id].clear();
-  });
-  label = node.appendChild(document.createElement("span"));
-  label.textContent = "I'm panel n掳" + id;
-  return node;
-}
-function addPanel(where) {
-  var node = makePanel(where);
-  panels[node.id] = editor.addPanel(node, {position: where, stable: true});
-}
-
-addPanel("top");
-addPanel("bottom");
-
-function replacePanel(form) {
-  var id = form.elements.panel_id.value;
-  var panel = panels["panel-" + id];
-  var node = makePanel("");
-
-  panels[node.id] = editor.addPanel(node, {replace: panel, position: "after-top", stable: true});
-  return false;
-}
-</script>
-
-</div>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/panel.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/panel.html.xml
deleted file mode 100644
index 1bb59383f5410188643fcfac7e01a3761284b176..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/panel.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>panel.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/placeholder.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/placeholder.html.html
deleted file mode 100644
index 432331a4862e5750e46b23d3e883e4a9dfe59998..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/placeholder.html.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Placeholder demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/display/placeholder.js"></script>
-<style type="text/css">
-      .CodeMirror { border: 1px solid silver; }
-      .CodeMirror-empty { outline: 1px solid #c22; }
-      .CodeMirror-empty.CodeMirror-focused { outline: none; }
-      .CodeMirror pre.CodeMirror-placeholder { color: #999; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Placeholder</a>
-  </ul>
-</div>
-
-<article>
-<h2>Placeholder demo</h2>
-<form><textarea id="code" name="code" placeholder="Code goes here..."></textarea></form>
-
-    <p>The <a href="../doc/manual.html#addon_placeholder">placeholder</a>
-    plug-in adds an option <code>placeholder</code> that can be set to
-    make text appear in the editor when it is empty and not focused.
-    If the source textarea has a <code>placeholder</code> attribute,
-    it will automatically be inherited.</p>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true
-      });
-    </script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/placeholder.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/placeholder.html.xml
deleted file mode 100644
index bbfea28e7aaa9a4362d016a69d37f2d386871a80..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/placeholder.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>placeholder.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/preview.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/preview.html.html
deleted file mode 100644
index 19e1530b8080289a808e82c70c4ffaec959e1bce..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/preview.html.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: HTML5 preview</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel=stylesheet href=../lib/codemirror.css>
-<script src=../lib/codemirror.js></script>
-<script src=../mode/xml/xml.js></script>
-<script src=../mode/javascript/javascript.js></script>
-<script src=../mode/css/css.js></script>
-<script src=../mode/htmlmixed/htmlmixed.js></script>
-<style type=text/css>
-      .CodeMirror {
-        float: left;
-        width: 50%;
-        border: 1px solid black;
-      }
-      iframe {
-        width: 49%;
-        float: left;
-        height: 300px;
-        border: 1px solid black;
-        border-left: 0px;
-      }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">HTML5 preview</a>
-  </ul>
-</div>
-
-<article>
-<h2>HTML5 preview</h2>
-
-    <textarea id=code name=code>
-<!doctype html>
-<html>
-  <head>
-    <meta charset=utf-8>
-    <title>HTML5 canvas demo</title>
-    <style>p {font-family: monospace;}</style>
-  </head>
-  <body>
-    <p>Canvas pane goes here:</p>
-    <canvas id=pane width=300 height=200></canvas>
-    <script>
-      var canvas = document.getElementById('pane');
-      var context = canvas.getContext('2d');
-
-      context.fillStyle = 'rgb(250,0,0)';
-      context.fillRect(10, 10, 55, 50);
-
-      context.fillStyle = 'rgba(0, 0, 250, 0.5)';
-      context.fillRect(30, 30, 55, 50);
-    </script>
-  </body>
-</html></textarea>
-    <iframe id=preview></iframe>
-    <script>
-      var delay;
-      // Initialize CodeMirror editor with a nice html5 canvas demo.
-      var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
-        mode: 'text/html'
-      });
-      editor.on("change", function() {
-        clearTimeout(delay);
-        delay = setTimeout(updatePreview, 300);
-      });
-      
-      function updatePreview() {
-        var previewFrame = document.getElementById('preview');
-        var preview =  previewFrame.contentDocument ||  previewFrame.contentWindow.document;
-        preview.open();
-        preview.write(editor.getValue());
-        preview.close();
-      }
-      setTimeout(updatePreview, 300);
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/preview.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/preview.html.xml
deleted file mode 100644
index 8b70024d62b9f1c6e36e7aaf19a53595c726f4ab..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/preview.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>preview.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/requirejs.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/requirejs.html.html
deleted file mode 100644
index 438ef9fbf682e020869fa3fdec84485529815e54..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/requirejs.html.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!doctype html>
-
-<head>
-  <title>CodeMirror: HTML completion demo</title>
-  <meta charset="utf-8"/>
-  <link rel=stylesheet href="../doc/docs.css">
-
-  <link rel="stylesheet" href="../lib/codemirror.css">
-  <link rel="stylesheet" href="../addon/hint/show-hint.css">
-  <script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script>
-  <style type="text/css">
-    .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;}
-  </style>
-</head>
-
-<body>
-  <div id=nav>
-    <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-    <ul>
-      <li><a href="../index.html">Home</a>
-      <li><a href="../doc/manual.html">Manual</a>
-      <li><a href="https://github.com/codemirror/codemirror">Code</a>
-    </ul>
-    <ul>
-      <li><a class=active href="#">HTML completion</a>
-    </ul>
-  </div>
-
-  <article>
-    <h2>RequireJS module loading demo</h2>
-
-    <p>This demo does the same thing as
-    the <a href="html5complete.html">HTML5 completion demo</a>, but
-    loads its dependencies
-    with <a href="http://requirejs.org/">Require.js</a>, rather than
-    explicitly. Press <strong>ctrl-space</strong> to activate
-    completion.</p>
-
-    <div id="code"></div>
-
-    <button id="markdown">Dynamically load Markdown mode</button>
-
-    <script type="text/javascript">
-      require.config({
-        packages: [{
-          name: "codemirror",
-          location: "../",
-          main: "lib/codemirror"
-        }]
-      });
-      require(["codemirror", "codemirror/mode/htmlmixed/htmlmixed",
-               "codemirror/addon/hint/show-hint", "codemirror/addon/hint/html-hint",
-               "codemirror/addon/mode/loadmode"], function(CodeMirror) {
-        editor = CodeMirror(document.getElementById("code"), {
-          mode: "text/html",
-          extraKeys: {"Ctrl-Space": "autocomplete"},
-          value: document.documentElement.innerHTML
-        });
-
-        CodeMirror.modeURL = "codemirror/mode/%N/%N";
-        document.getElementById("markdown").addEventListener("click", function() {
-          CodeMirror.requireMode("markdown", function() {
-            editor.replaceRange("This is **Markdown**.\n\n", {line: 0, ch: 0});
-            editor.setOption("mode", "markdown");
-          });
-        });
-      });
-    </script>
-  </article>
-</body>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/requirejs.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/requirejs.html.xml
deleted file mode 100644
index c7afeb470708ceab67bf2e092b82532e9e66e154..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/requirejs.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>requirejs.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/resize.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/resize.html.html
deleted file mode 100644
index 1c1ef390ab3e658ac6c75136b7eb27f86bce33b6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/resize.html.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Autoresize Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/css/css.js"></script>
-<style type="text/css">
-      .CodeMirror {
-        border: 1px solid #eee;
-        height: auto;
-      }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Autoresize</a>
-  </ul>
-</div>
-
-<article>
-<h2>Autoresize Demo</h2>
-<form><textarea id="code" name="code">
-.CodeMirror {
-  border: 1px solid #eee;
-  height: auto;
-}
-</textarea></form>
-
-<p>By setting an editor's <code>height</code> style
-to <code>auto</code> and giving
-the <a href="../doc/manual.html#option_viewportMargin"><code>viewportMargin</code></a>
-a value of <code>Infinity</code>, CodeMirror can be made to
-automatically resize to fit its content.</p>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        viewportMargin: Infinity
-      });
-    </script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/resize.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/resize.html.xml
deleted file mode 100644
index 9642b64b0fdcc8c6f5f961665ea35ddc8ad86649..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/resize.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>resize.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/rulers.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/rulers.html.html
deleted file mode 100644
index 2ac4111582e3c6d5fd2d74dd68a623571041786b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/rulers.html.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Ruler Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/display/rulers.js"></script>
-<style type="text/css">
-  .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Ruler demo</a>
-  </ul>
-</div>
-
-<article>
-<h2>Ruler Demo</h2>
-
-<script type="text/javascript">
-  var nums = "0123456789", space = "          ";
-  var colors = ["#fcc", "#f5f577", "#cfc", "#aff", "#ccf", "#fcf"];
-  var rulers = [], value = "";
-  for (var i = 1; i <= 6; i++) {
-    rulers.push({color: colors[i], column: i * 10, lineStyle: "dashed"});
-    for (var j = 1; j < i; j++) value += space;
-    value += nums + "\n";
-  }
-  var editor = CodeMirror(document.body.lastChild, {
-    rulers: rulers,
-    value: value + value + value,
-    lineNumbers: true
-});
-</script>
-
-<p>Demonstration of
-the <a href="../doc/manual.html#addon_rulers">rulers</a> addon, which
-displays vertical lines at given column offsets.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/rulers.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/rulers.html.xml
deleted file mode 100644
index 6621941e61089375e1f4054492fe6032172ed836..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/rulers.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>rulers.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/runmode.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/runmode.html.html
deleted file mode 100644
index ab8938d8d38b3e875b4981b2ab1233df4b95dd34..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/runmode.html.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Mode Runner Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/runmode/runmode.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Mode Runner</a>
-  </ul>
-</div>
-
-<article>
-<h2>Mode Runner Demo</h2>
-
-
-    <textarea id="code" style="width: 90%; height: 7em; border: 1px solid black; padding: .2em .4em;">
-<foobar>
-  <blah>Enter your xml here and press the button below to display
-    it as highlighted by the CodeMirror XML mode</blah>
-  <tag2 foo="2" bar="&amp;quot;bar&amp;quot;"/>
-</foobar></textarea><br>
-    <button onclick="doHighlight();">Highlight!</button>
-    <pre id="output" class="cm-s-default"></pre>
-
-    <script>
-function doHighlight() {
-  CodeMirror.runMode(document.getElementById("code").value, "application/xml",
-                     document.getElementById("output"));
-}
-</script>
-
-    <p>Running a CodeMirror mode outside of the editor.
-    The <code>CodeMirror.runMode</code> function, defined
-    in <code><a href="../addon/runmode/runmode.js">addon/runmode/runmode.js</a></code> takes the following arguments:</p>
-
-    <dl>
-      <dt><code>text (string)</code></dt>
-      <dd>The document to run through the highlighter.</dd>
-      <dt><code>mode (<a href="../doc/manual.html#option_mode">mode spec</a>)</code></dt>
-      <dd>The mode to use (must be loaded as normal).</dd>
-      <dt><code>output (function or DOM node)</code></dt>
-      <dd>If this is a function, it will be called for each token with
-      two arguments, the token's text and the token's style class (may
-      be <code>null</code> for unstyled tokens). If it is a DOM node,
-      the tokens will be converted to <code>span</code> elements as in
-      an editor, and inserted into the node
-      (through <code>innerHTML</code>).</dd>
-    </dl>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/runmode.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/runmode.html.xml
deleted file mode 100644
index a611e9dcbcddae8ccf454cc10c887098b1bf5554..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/runmode.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>runmode.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/search.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/search.html.html
deleted file mode 100644
index 4ca81e20f561788b04ae39df23d26ae64db964a4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/search.html.html
+++ /dev/null
@@ -1,99 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Search/Replace Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/dialog/dialog.css">
-<link rel="stylesheet" href="../addon/search/matchesonscrollbar.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../addon/dialog/dialog.js"></script>
-<script src="../addon/search/searchcursor.js"></script>
-<script src="../addon/search/search.js"></script>
-<script src="../addon/scroll/annotatescrollbar.js"></script>
-<script src="../addon/search/matchesonscrollbar.js"></script>
-<script src="../addon/search/jump-to-line.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      dt {font-family: monospace; color: #666;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Search/Replace</a>
-  </ul>
-</div>
-
-<article>
-<h2>Search/Replace Demo</h2>
-<form><textarea id="code" name="code">
-<dl>
-  <dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt>
-  <dd>Whether, when indenting, the first N*<code>tabSize</code>
-  spaces should be replaced by N tabs. Default is false.</dd>
-
-  <dt id="option_electricChars"><code><strong>electricChars</strong>: boolean</code></dt>
-  <dd>Configures whether the editor should re-indent the current
-  line when a character is typed that might change its proper
-  indentation (only works if the mode supports indentation).
-  Default is true.</dd>
-
-  <dt id="option_specialChars"><code><strong>specialChars</strong>: RegExp</code></dt>
-  <dd>A regular expression used to determine which characters
-  should be replaced by a
-  special <a href="#option_specialCharPlaceholder">placeholder</a>.
-  Mostly useful for non-printing special characters. The default
-  is <code>/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/</code>.</dd>
-  <dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char)聽鈫捖燛lement</code></dt>
-  <dd>A function that, given a special character identified by
-  the <a href="#option_specialChars"><code>specialChars</code></a>
-  option, produces a DOM node that is used to represent the
-  character. By default, a red dot (<span style="color: red">鈥�</span>)
-  is shown, with a title tooltip to indicate the character code.</dd>
-
-  <dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt>
-  <dd>Determines whether horizontal cursor movement through
-  right-to-left (Arabic, Hebrew) text is visual (pressing the left
-  arrow moves the cursor left) or logical (pressing the left arrow
-  moves to the next lower index in the string, which is visually
-  right in right-to-left text). The default is <code>false</code>
-  on Windows, and <code>true</code> on other platforms.</dd>
-</dl>
-</textarea></form>
-
-    <script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  mode: "text/html",
-  lineNumbers: true,
-  extraKeys: {"Alt-F": "findPersistent"}
-});
-</script>
-
-    <p>Demonstration of primitive search/replace functionality. The
-    keybindings (which can be configured with custom keymaps) are:</p>
-    <dl>
-      <dt>Ctrl-F / Cmd-F</dt><dd>Start searching</dd>
-      <dt>Ctrl-G / Cmd-G</dt><dd>Find next</dd>
-      <dt>Shift-Ctrl-G / Shift-Cmd-G</dt><dd>Find previous</dd>
-      <dt>Shift-Ctrl-F / Cmd-Option-F</dt><dd>Replace</dd>
-      <dt>Shift-Ctrl-R / Shift-Cmd-Option-F</dt><dd>Replace all</dd>
-      <dt>Alt-F</dt><dd>Persistent search (dialog doesn't autoclose,
-      enter to find next, Shift-Enter to find previous)</dd>
-      <dt>Alt-G</dt><dd>Jump to line</dd>
-    </dl>
-    <p>Searching is enabled by
-    including <a href="../addon/search/search.js">addon/search/search.js</a>
-    and <a href="../addon/search/searchcursor.js">addon/search/searchcursor.js</a>.
-    Jump to line - including <a href="../addon/search/jump-to-line.js">addon/search/jump-to-line.js</a>.</p>
-    <p>For good-looking input dialogs, you also want to include
-    <a href="../addon/dialog/dialog.js">addon/dialog/dialog.js</a>
-    and <a href="../addon/dialog/dialog.css">addon/dialog/dialog.css</a>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/search.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/search.html.xml
deleted file mode 100644
index 1e6d31fe6290c57e422e7988dd97d781853103c9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/search.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>search.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplemode.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplemode.html.html
deleted file mode 100644
index d719b63d1896b2ad023ef2fdda669dc64ad28b34..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplemode.html.html
+++ /dev/null
@@ -1,186 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Simple Mode Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/mode/simple.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<style type="text/css">
-  .CodeMirror {border: 1px solid silver; margin-bottom: 1em; }
-  dt { text-indent: -2em; padding-left: 2em; margin-top: 1em; }
-  dd { margin-left: 1.5em; margin-bottom: 1em; }
-  dt {margin-top: 1em;}
-</style>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Simple Mode</a>
-  </ul>
-</div>
-
-<article>
-<h2>Simple Mode Demo</h2>
-
-<p>The <a href="../addon/mode/simple.js"><code>mode/simple</code></a>
-addon allows CodeMirror modes to be specified using a relatively simple
-declarative format. This format is not as powerful as writing code
-directly against the <a href="../doc/manual.html#modeapi">mode
-interface</a>, but is a lot easier to get started with, and
-sufficiently expressive for many simple language modes.</p>
-
-<p>This interface is still in flux. It is unlikely to be scrapped or
-overhauled completely, so do start writing code against it, but
-details might change as it stabilizes, and you might have to tweak
-your code when upgrading.</p>
-
-<p>Simple modes (loosely based on
-the <a href="https://github.com/mozilla/skywriter/wiki/Common-JavaScript-Syntax-Highlighting-Specification">Common
-JavaScript Syntax Highlighting Specification</a>, which never took
-off), are state machines, where each state has a number of rules that
-match tokens. A rule describes a type of token that may occur in the
-current state, and possibly a transition to another state caused by
-that token.</p>
-
-<p>The <code>CodeMirror.defineSimpleMode(name, states)</code> method
-takes a mode name and an object that describes the mode's states. The
-editor below shows an example of such a mode (and is itself
-highlighted by the mode shown in it).</p>
-
-<div id="code"></div>
-
-<p>Each state is an array of rules. A rule may have the following properties:</p>
-
-<dl>
-  <dt><code><strong>regex</strong>: string | RegExp</code></dt>
-  <dd>The regular expression that matches the token. May be a string
-  or a regex object. When a regex, the <code>ignoreCase</code> flag
-  will be taken into account when matching the token. This regex
-  should only capture groups when the <code>token</code> property is
-  an array.</dd>
-  <dt><code><strong>token</strong></code>: string | null</dt>
-  <dd>An optional token style. Multiple styles can be specified by
-  separating them with dots or spaces. When the <code>regex</code> for
-  this rule captures groups, it must capture <em>all</em> of the
-  string (since JS provides no way to find out where a group matched),
-  and this property must hold an array of token styles that has one
-  style for each matched group.</dd>
-  <dt><code><strong>sol</strong></code>: boolean</dt>
-  <dd>When true, this token will only match at the start of the line.
-  (The <code>^</code> regexp marker doesn't work as you'd expect in
-  this context because of limitations in JavaScript's RegExp
-  API.)</dd>
-  <dt><code><strong>next</strong>: string</code></dt>
-  <dd>When a <code>next</code> property is present, the mode will
-  transfer to the state named by the property when the token is
-  encountered.</dd>
-  <dt><code><strong>push</strong>: string</code></dt>
-  <dd>Like <code>next</code>, but instead replacing the current state
-  by the new state, the current state is kept on a stack, and can be
-  returned to with the <code>pop</code> directive.</dd>
-  <dt><code><strong>pop</strong>: bool</code></dt>
-  <dd>When true, and there is another state on the state stack, will
-  cause the mode to pop that state off the stack and transition to
-  it.</dd>
-  <dt><code><strong>mode</strong>: {spec, end, persistent}</code></dt>
-  <dd>Can be used to embed another mode inside a mode. When present,
-  must hold an object with a <code>spec</code> property that describes
-  the embedded mode, and an optional <code>end</code> end property
-  that specifies the regexp that will end the extent of the mode. When
-  a <code>persistent</code> property is set (and true), the nested
-  mode's state will be preserved between occurrences of the mode.</dd>
-  <dt><code><strong>indent</strong>: bool</code></dt>
-  <dd>When true, this token changes the indentation to be one unit
-  more than the current line's indentation.</dd>
-  <dt><code><strong>dedent</strong>: bool</code></dt>
-  <dd>When true, this token will pop one scope off the indentation
-  stack.</dd>
-  <dt><code><strong>dedentIfLineStart</strong>: bool</code></dt>
-  <dd>If a token has its <code>dedent</code> property set, it will, by
-  default, cause lines where it appears at the start to be dedented.
-  Set this property to false to prevent that behavior.</dd>
-</dl>
-
-<p>The <code>meta</code> property of the states object is special, and
-will not be interpreted as a state. Instead, properties set on it will
-be set on the mode, which is useful for properties
-like <a href="../doc/manual.html#addon_comment"><code>lineComment</code></a>,
-which sets the comment style for a mode. The simple mode addon also
-recognizes a few such properties:</p>
-
-<dl>
-  <dt><code><strong>dontIndentStates</strong>: array&lt;string&gt;</code></dt>
-  <dd>An array of states in which the mode's auto-indentation should
-  not take effect. Usually used for multi-line comment and string
-  states.</dd>
-</dl>
-
-<script id="modecode">/* Example definition of a simple mode that understands a subset of
- * JavaScript:
- */
-
-CodeMirror.defineSimpleMode("simplemode", {
-  // The start state contains the rules that are intially used
-  start: [
-    // The regex matches the token, the token property contains the type
-    {regex: /"(?:[^\\]|\\.)*?(?:"|$)/, token: "string"},
-    // You can match multiple tokens at once. Note that the captured
-    // groups must span the whole string in this case
-    {regex: /(function)(\s+)([a-z$][\w$]*)/,
-     token: ["keyword", null, "variable-2"]},
-    // Rules are matched in the order in which they appear, so there is
-    // no ambiguity between this one and the one above
-    {regex: /(?:function|var|return|if|for|while|else|do|this)\b/,
-     token: "keyword"},
-    {regex: /true|false|null|undefined/, token: "atom"},
-    {regex: /0x[a-f\d]+|[-+]?(?:\.\d+|\d+\.?\d*)(?:e[-+]?\d+)?/i,
-     token: "number"},
-    {regex: /\/\/.*/, token: "comment"},
-    {regex: /\/(?:[^\\]|\\.)*?\//, token: "variable-3"},
-    // A next property will cause the mode to move to a different state
-    {regex: /\/\*/, token: "comment", next: "comment"},
-    {regex: /[-+\/*=<>!]+/, token: "operator"},
-    // indent and dedent properties guide autoindentation
-    {regex: /[\{\[\(]/, indent: true},
-    {regex: /[\}\]\)]/, dedent: true},
-    {regex: /[a-z$][\w$]*/, token: "variable"},
-    // You can embed other modes with the mode property. This rule
-    // causes all code between << and >> to be highlighted with the XML
-    // mode.
-    {regex: /<</, token: "meta", mode: {spec: "xml", end: />>/}}
-  ],
-  // The multi-line comment state.
-  comment: [
-    {regex: /.*?\*\//, token: "comment", next: "start"},
-    {regex: /.*/, token: "comment"}
-  ],
-  // The meta property contains global information about the mode. It
-  // can contain properties like lineComment, which are supported by
-  // all modes, and also directives like dontIndentStates, which are
-  // specific to simple modes.
-  meta: {
-    dontIndentStates: ["comment"],
-    lineComment: "//"
-  }
-});
-</script>
-
-<script>
-var sc = document.getElementById("modecode");
-var code = document.getElementById("code");
-var editor = CodeMirror(code, {
-  value: (sc.textContent || sc.innerText || sc.innerHTML),
-  mode: "simplemode"
-});
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplemode.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplemode.html.xml
deleted file mode 100644
index 9388e4b62fd4b2578ebf114a25c09d092720c13d..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplemode.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>simplemode.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplescrollbars.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplescrollbars.html.html
deleted file mode 100644
index 9d40932649771309648f96af15f79f4eaa511db5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplescrollbars.html.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Simple Scrollbar Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/scroll/simplescrollbars.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/markdown/markdown.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../addon/scroll/simplescrollbars.js"></script>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Simple Scrollbar</a>
-  </ul>
-</div>
-
-<article>
-<h2>Simple Scrollbar Demo</h2>
-<form><textarea id="code" name="code"># Custom Scrollbars
-
-This is a piece of text that creates scrollbars
-
-Lorem ipsum dolor sit amet, turpis nec facilisis neque vestibulum adipiscing, magna nunc est luctus orci a,
-aliquam duis ad volutpat nostra. Vestibulum ultricies suspendisse commodo volutpat pede sed. Bibendum odio
-dignissim, ad vitae mollis ac sed nibh quis, suspendisse diam, risus quas blandit phasellus luctus nec,
-integer nunc vitae posuere scelerisque. Lobortis quam porta conubia nulla. Et nisl ac, imperdiet vitae ac.
-Parturient sit. Et vestibulum euismod, rutrum nunc libero mauris purus convallis. Cum id adipiscing et eget
-pretium rutrum, ultrices sapien magnis fringilla sit lorem, eu vitae scelerisque ipsum aliquet, magna sed
-fusce vel.
-
-Lectus ultricies libero dolor convallis, sed etiam vel hendrerit egestas viverra, at urna mauris, eget
-vulputate dolor voluptatem, nulla eget sollicitudin. Sed tincidunt, elit sociis. Mattis mi tortor dui id
-sodales mi, maecenas nam fringilla risus turpis mauris praesent, imperdiet maecenas ultrices nonummy tellus
-quis est. Scelerisque nec pharetra quis varius fringilla. Varius vestibulum non dictum pharetra, tincidunt in
-vestibulum iaculis molestie, id condimentum blandit elit urna magna pulvinar, quam suspendisse pellentesque
-donec. Vel amet ad ac. Nec aut viverra, morbi mi neque massa, turpis enim proin. Tellus eu, fermentum velit
-est convallis aliquam velit, rutrum in diam lacus, praesent tempor pellentesque dictum semper augue. Felis
-explicabo massa amet lectus phasellus dolor. Ut lorem quis arcu neque felis ultricies, senectus vitae
-curabitur sed pellentesque et, id sed risus in sed ac accumsan, blandit arcu quam duis nunc.
-
-Sed leo sollicitudin odio vitae, purus sit egestas, justo eros inceptos auctor fermentum lectus. Ligula luctus
-turpis, quod massa vitae elementum orci, nullam fringilla elit tortor. Justo ante tempor amet quam posuere
-volutpat. Facilisis pede erat ut hac ultrices ipsum, wisi duis sit metus. Dolor vitae est sed sed vitae. Sed
-eu ligula, morbi vestibulum nunc nibh velit ut taciti, ligula elit semper sagittis in, auctor arcu vel eget.
-Mauris at vitae nec suspendisse et, aenean proin blandit suscipit. Morbi quam, dolor ultricies. Viverra
-tempus. Suspendisse sit dapibus, ac fuga aenean, magna nisl nonummy augue posuere, dictum ut fuga velit
-parturient augue interdum, mattis sit tellus.
-
-Vehicula commodo tempus curabitur eros, lacinia erat vulputate lorem vel fermentum donec, lectus sed conubia
-id pellentesque. Vel senectus donec pede aliquet dolor sit, nec vivamus justo placerat interdum maecenas,
-sodales euismod. Quis netus sapien amet, vestibulum quam nec amet lacinia, quis aliquet, tempor vivamus tellus
-enim, suscipit quis eleifend. Amet class phasellus orci pretium, risus in nulla. Neque sit ullamcorper,
-ultricies platea id nec suspendisse ac. Et elementum. Dictum nam, ut dui fermentum egestas facilisis elit
-augue, adipiscing donec ipsum erat nam pellentesque convallis, vestibulum vestibulum risus id nulla ut mauris,
-curabitur aute aptent. Ultrices orci wisi dui ipsum praesent, pharetra felis eu quis. Est fringilla etiam,
-maxime sem dapibus et eget, mi enim dignissim nec pretium, augue vehicula, volutpat proin. Et occaecati
-lobortis viverra, cum in sed, vivamus tellus. Libero at malesuada est vivamus leo tortor.
-</textarea></form>
-
-<p>The <a href="../doc/manual.html#addon_simplescrollbars"><code>simplescrollbars</code></a> addon defines two
-styles of non-native scrollbars: <a href="javascript:editor.setOption('scrollbarStyle', 'simple')"><code>"simple"</code></a> and <a href="javascript:editor.setOption('scrollbarStyle', 'overlay')"><code>"overlay"</code></a> (click to try), which can be passed to
-the <a href="../doc/manual.html#option_scrollbarStyle"><code>scrollbarStyle</code></a> option. These implement
-the scrollbar using DOM elements, allowing more control over
-its <a href="../addon/scroll/simplescrollbars.css">appearance</a>.</p>
-
-  <script>
-    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-      lineNumbers: true,
-      scrollbarStyle: "simple"
-    });
-  </script>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplescrollbars.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplescrollbars.html.xml
deleted file mode 100644
index 6396a537ea80b131ce21885bfdf02345209bfddd..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/simplescrollbars.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>simplescrollbars.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/spanaffectswrapping_shim.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/spanaffectswrapping_shim.html.html
deleted file mode 100644
index 879d99b606947daae2bcc8d294260bf1a4393d4e..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/spanaffectswrapping_shim.html.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Automatically derive odd wrapping behavior for your browser</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Automatically derive odd wrapping behavior for your browser</a>
-  </ul>
-</div>
-
-<article>
-<h2>Automatically derive odd wrapping behavior for your browser</h2>
-
-
-    <p>This is a hack to automatically derive
-    a <code>spanAffectsWrapping</code> regexp for a browser. See the
-    comments above that variable
-    in <a href="../lib/codemirror.js"><code>lib/codemirror.js</code></a>
-    for some more details.</p>
-
-    <div style="white-space: pre-wrap; width: 50px;" id="area"></div>
-    <pre id="output"></pre>
-
-    <script id="script">
-      var a = document.getElementById("area"), bad = Object.create(null);
-      var chars = "a~`!@#$%^&*()-_=+}{[]\\|'\"/?.>,<:;", l = chars.length;
-      for (var x = 0; x < l; ++x) for (var y = 0; y < l; ++y) {
-        var s1 = "foooo" + chars.charAt(x), s2 = chars.charAt(y) + "br";
-        a.appendChild(document.createTextNode(s1 + s2));
-        var h1 = a.offsetHeight;
-        a.innerHTML = "";
-        a.appendChild(document.createElement("span")).appendChild(document.createTextNode(s1));
-        a.appendChild(document.createElement("span")).appendChild(document.createTextNode(s2));
-        if (a.offsetHeight != h1)
-          bad[chars.charAt(x)] = (bad[chars.charAt(x)] || "") + chars.charAt(y);
-        a.innerHTML = "";
-      }
-
-      var re = "";
-      function toREElt(str) {
-        if (str.length > 1) {
-          var invert = false;
-          if (str.length > chars.length * .6) {
-            invert = true;
-            var newStr = "";
-            for (var i = 0; i < l; ++i) if (str.indexOf(chars.charAt(i)) == -1) newStr += chars.charAt(i);
-            str = newStr;
-          }
-          str = str.replace(/[\-\.\]\"\'\\\/\^a]/g, function(orig) { return orig == "a" ? "\\w" : "\\" + orig; });
-          return "[" + (invert ? "^" : "") + str + "]";
-        } else if (str == "a") {
-          return "\\w";
-        } else if (/[?$*()+{}[\]\.|/\'\"]/.test(str)) {
-          return "\\" + str;
-        } else {
-          return str;
-        }
-      }
-
-      var newRE = "";
-      for (;;) {
-        var left = null;
-        for (var left in bad) break;
-        if (left == null) break;
-        var right = bad[left];
-        delete bad[left];
-        for (var other in bad) if (bad[other] == right) {
-          left += other;
-          delete bad[other];
-        }
-        newRE += (newRE ? "|" : "") + toREElt(left) + toREElt(right);
-      }
-
-      document.getElementById("output").appendChild(document.createTextNode("Your regexp is: " + (newRE || "^$")));
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/spanaffectswrapping_shim.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/spanaffectswrapping_shim.html.xml
deleted file mode 100644
index fc0118c7eaace6c5ce0fbabba0a35760a8b2063c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/spanaffectswrapping_shim.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>spanaffectswrapping_shim.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/sublime.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/sublime.html.html
deleted file mode 100644
index 233dd83a4ea7daac44e10c685fc3fa6c06884df4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/sublime.html.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Sublime Text bindings demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/fold/foldgutter.css">
-<link rel="stylesheet" href="../addon/dialog/dialog.css">
-<link rel="stylesheet" href="../theme/monokai.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/search/searchcursor.js"></script>
-<script src="../addon/search/search.js"></script>
-<script src="../addon/dialog/dialog.js"></script>
-<script src="../addon/edit/matchbrackets.js"></script>
-<script src="../addon/edit/closebrackets.js"></script>
-<script src="../addon/comment/comment.js"></script>
-<script src="../addon/wrap/hardwrap.js"></script>
-<script src="../addon/fold/foldcode.js"></script>
-<script src="../addon/fold/brace-fold.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../keymap/sublime.js"></script>
-<style type="text/css">
-  .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee; line-height: 1.3; height: 500px}
-  .CodeMirror-linenumbers { padding: 0 8px; }
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Sublime bindings</a>
-  </ul>
-</div>
-
-<article>
-<h2>Sublime Text bindings demo</h2>
-
-<p>The <code>sublime</code> keymap defines many Sublime Text-specific
-bindings for CodeMirror. See the code below for an overview.</p>
-
-<p>Enable the keymap by
-loading <a href="../keymap/sublime.js"><code>keymap/sublime.js</code></a>
-and setting
-the <a href="../doc/manual.html#option_keyMap"><code>keyMap</code></a>
-option to <code>"sublime"</code>.</p>
-
-<p>(A lot of the search functionality is still missing.)
-
-<script>
-  var value = "// The bindings defined specifically in the Sublime Text mode\nvar bindings = {\n";
-  var map = CodeMirror.keyMap.sublime;
-  for (var key in map) {
-    var val = map[key];
-    if (key != "fallthrough" && val != "..." && (!/find/.test(val) || /findUnder/.test(val)))
-      value += "  \"" + key + "\": \"" + val + "\",\n";
-  }
-  value += "}\n\n// The implementation of joinLines\n";
-  value += CodeMirror.commands.joinLines.toString().replace(/^function\s*\(/, "function joinLines(").replace(/\n  /g, "\n") + "\n";
-  var editor = CodeMirror(document.body.getElementsByTagName("article")[0], {
-    value: value,
-    lineNumbers: true,
-    mode: "javascript",
-    keyMap: "sublime",
-    autoCloseBrackets: true,
-    matchBrackets: true,
-    showCursorWhenSelecting: true,
-    theme: "monokai",
-    tabSize: 2
-  });
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/sublime.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/sublime.html.xml
deleted file mode 100644
index e26987d184b94b7d231d3803848678d485c8dc15..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/sublime.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>sublime.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/tern.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/tern.html.html
deleted file mode 100644
index d0dee8a70e85daf8cbc16432b48f0ff1017498b0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/tern.html.html
+++ /dev/null
@@ -1,133 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Tern Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/dialog/dialog.css">
-<link rel="stylesheet" href="../addon/hint/show-hint.css">
-<link rel="stylesheet" href="../addon/tern/tern.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../addon/dialog/dialog.js"></script>
-<script src="../addon/hint/show-hint.js"></script>
-<script src="../addon/tern/tern.js"></script>
-<script src="//ternjs.net/node_modules/acorn/dist/acorn.js"></script>
-<script src="//ternjs.net/node_modules/acorn/dist/acorn_loose.js"></script>
-<script src="//ternjs.net/node_modules/acorn/dist/walk.js"></script>
-<script src="//ternjs.net/doc/demo/polyfill.js"></script>
-<script src="//ternjs.net/lib/signal.js"></script>
-<script src="//ternjs.net/lib/tern.js"></script>
-<script src="//ternjs.net/lib/def.js"></script>
-<script src="//ternjs.net/lib/comment.js"></script>
-<script src="//ternjs.net/lib/infer.js"></script>
-<script src="//ternjs.net/plugin/doc_comment.js"></script>
-<style>
-      .CodeMirror {border: 1px solid #ddd;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Tern</a>
-  </ul>
-</div>
-
-<article>
-<h2>Tern Demo</h2>
-<form><textarea id="code" name="code">// Use ctrl-space to complete something
-// Put the cursor in or after an expression, press ctrl-o to
-// find its type
-
-var foo = ["array", "of", "strings"];
-var bar = foo.slice(0, 2).join("").split("a")[0];
-
-// Works for locally defined types too.
-
-function CTor() { this.size = 10; }
-CTor.prototype.hallo = "hallo";
-
-var baz = new CTor;
-baz.
-
-// You can press ctrl-q when the cursor is on a variable name to
-// rename it. Try it with CTor...
-
-// When the cursor is in an argument list, the arguments are
-// shown below the editor.
-
-[1].reduce(  );
-
-// And a little more advanced code...
-
-(function(exports) {
-  exports.randomElt = function(arr) {
-    return arr[Math.floor(arr.length * Math.random())];
-  };
-  exports.strList = "foo".split("");
-  exports.intList = exports.strList.map(function(s) { return s.charCodeAt(0); });
-})(window.myMod = {});
-
-var randomStr = myMod.randomElt(myMod.strList);
-var randomInt = myMod.randomElt(myMod.intList);
-</textarea></form>
-
-<p>Demonstrates integration of <a href="http://ternjs.net/">Tern</a>
-and CodeMirror. The following keys are bound:</p>
-
-<dl>
-  <dt>Ctrl-Space</dt><dd>Autocomplete</dd>
-  <dt>Ctrl-O</dt><dd>Find docs for the expression at the cursor</dd>
-  <dt>Ctrl-I</dt><dd>Find type at cursor</dd>
-  <dt>Alt-.</dt><dd>Jump to definition (Alt-, to jump back)</dd>
-  <dt>Ctrl-Q</dt><dd>Rename variable</dd>
-  <dt>Ctrl-.</dt><dd>Select all occurrences of a variable</dd>
-</dl>
-
-<p>Documentation is sparse for now. See the top of
-the <a href="../addon/tern/tern.js">script</a> for a rough API
-overview.</p>
-
-<script>
-  function getURL(url, c) {
-    var xhr = new XMLHttpRequest();
-    xhr.open("get", url, true);
-    xhr.send();
-    xhr.onreadystatechange = function() {
-      if (xhr.readyState != 4) return;
-      if (xhr.status < 400) return c(null, xhr.responseText);
-      var e = new Error(xhr.responseText || "No response");
-      e.status = xhr.status;
-      c(e);
-    };
-  }
-
-  var server;
-  getURL("//ternjs.net/defs/ecmascript.json", function(err, code) {
-    if (err) throw new Error("Request for ecmascript.json: " + err);
-    server = new CodeMirror.TernServer({defs: [JSON.parse(code)]});
-    editor.setOption("extraKeys", {
-      "Ctrl-Space": function(cm) { server.complete(cm); },
-      "Ctrl-I": function(cm) { server.showType(cm); },
-      "Ctrl-O": function(cm) { server.showDocs(cm); },
-      "Alt-.": function(cm) { server.jumpToDef(cm); },
-      "Alt-,": function(cm) { server.jumpBack(cm); },
-      "Ctrl-Q": function(cm) { server.rename(cm); },
-      "Ctrl-.": function(cm) { server.selectName(cm); }
-    })
-    editor.on("cursorActivity", function(cm) { server.updateArgHints(cm); });
-  });
-
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    mode: "javascript"
-  });
-</script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/tern.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/tern.html.xml
deleted file mode 100644
index 3ca9b0e0aea325e151e23b9bc85798e4781a6a08..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/tern.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>tern.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/theme.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/theme.html.html
deleted file mode 100644
index 9194dcea8b8626e7fd162cea635737d901ec3258..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/theme.html.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Theme Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../theme/3024-day.css">
-<link rel="stylesheet" href="../theme/3024-night.css">
-<link rel="stylesheet" href="../theme/abcdef.css">
-<link rel="stylesheet" href="../theme/ambiance.css">
-<link rel="stylesheet" href="../theme/base16-dark.css">
-<link rel="stylesheet" href="../theme/bespin.css">
-<link rel="stylesheet" href="../theme/base16-light.css">
-<link rel="stylesheet" href="../theme/blackboard.css">
-<link rel="stylesheet" href="../theme/cobalt.css">
-<link rel="stylesheet" href="../theme/colorforth.css">
-<link rel="stylesheet" href="../theme/dracula.css">
-<link rel="stylesheet" href="../theme/duotone-dark.css">
-<link rel="stylesheet" href="../theme/duotone-light.css">
-<link rel="stylesheet" href="../theme/eclipse.css">
-<link rel="stylesheet" href="../theme/elegant.css">
-<link rel="stylesheet" href="../theme/erlang-dark.css">
-<link rel="stylesheet" href="../theme/hopscotch.css">
-<link rel="stylesheet" href="../theme/icecoder.css">
-<link rel="stylesheet" href="../theme/isotope.css">
-<link rel="stylesheet" href="../theme/lesser-dark.css">
-<link rel="stylesheet" href="../theme/liquibyte.css">
-<link rel="stylesheet" href="../theme/material.css">
-<link rel="stylesheet" href="../theme/mbo.css">
-<link rel="stylesheet" href="../theme/mdn-like.css">
-<link rel="stylesheet" href="../theme/midnight.css">
-<link rel="stylesheet" href="../theme/monokai.css">
-<link rel="stylesheet" href="../theme/neat.css">
-<link rel="stylesheet" href="../theme/neo.css">
-<link rel="stylesheet" href="../theme/night.css">
-<link rel="stylesheet" href="../theme/panda-syntax.css">
-<link rel="stylesheet" href="../theme/paraiso-dark.css">
-<link rel="stylesheet" href="../theme/paraiso-light.css">
-<link rel="stylesheet" href="../theme/pastel-on-dark.css">
-<link rel="stylesheet" href="../theme/railscasts.css">
-<link rel="stylesheet" href="../theme/rubyblue.css">
-<link rel="stylesheet" href="../theme/seti.css">
-<link rel="stylesheet" href="../theme/solarized.css">
-<link rel="stylesheet" href="../theme/the-matrix.css">
-<link rel="stylesheet" href="../theme/tomorrow-night-bright.css">
-<link rel="stylesheet" href="../theme/tomorrow-night-eighties.css">
-<link rel="stylesheet" href="../theme/ttcn.css">
-<link rel="stylesheet" href="../theme/twilight.css">
-<link rel="stylesheet" href="../theme/vibrant-ink.css">
-<link rel="stylesheet" href="../theme/xq-dark.css">
-<link rel="stylesheet" href="../theme/xq-light.css">
-<link rel="stylesheet" href="../theme/yeti.css">
-<link rel="stylesheet" href="../theme/zenburn.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../addon/selection/active-line.js"></script>
-<script src="../addon/edit/matchbrackets.js"></script>
-<style type="text/css">
-      .CodeMirror {border: 1px solid black; font-size:13px}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Theme</a>
-  </ul>
-</div>
-
-<article>
-<h2>Theme Demo</h2>
-<form><textarea id="code" name="code">
-function findSequence(goal) {
-  function find(start, history) {
-    if (start == goal)
-      return history;
-    else if (start > goal)
-      return null;
-    else
-      return find(start + 5, "(" + history + " + 5)") ||
-             find(start * 3, "(" + history + " * 3)");
-  }
-  return find(1, "1");
-}</textarea></form>
-
-<p>Select a theme: <select onchange="selectTheme()" id=select>
-    <option selected>default</option>
-    <option>3024-day</option>
-    <option>3024-night</option>
-    <option>abcdef</option>
-    <option>ambiance</option>
-    <option>base16-dark</option>
-    <option>base16-light</option>
-    <option>bespin</option>
-    <option>blackboard</option>
-    <option>cobalt</option>
-    <option>colorforth</option>
-    <option>dracula</option>
-    <option>duotone-dark</option>
-    <option>duotone-light</option>
-    <option>eclipse</option>
-    <option>elegant</option>
-    <option>erlang-dark</option>
-    <option>hopscotch</option>
-    <option>icecoder</option>
-    <option>isotope</option>
-    <option>lesser-dark</option>
-    <option>liquibyte</option>
-    <option>material</option>
-    <option>mbo</option>
-    <option>mdn-like</option>
-    <option>midnight</option>
-    <option>monokai</option>
-    <option>neat</option>
-    <option>neo</option>
-    <option>night</option>
-    <option>panda-syntax</option>
-    <option>paraiso-dark</option>
-    <option>paraiso-light</option>
-    <option>pastel-on-dark</option>
-    <option>railscasts</option>
-    <option>rubyblue</option>
-    <option>seti</option>
-    <option>solarized dark</option>
-    <option>solarized light</option>
-    <option>the-matrix</option>
-    <option>tomorrow-night-bright</option>
-    <option>tomorrow-night-eighties</option>
-    <option>ttcn</option>
-    <option>twilight</option>
-    <option>vibrant-ink</option>
-    <option>xq-dark</option>
-    <option>xq-light</option>
-    <option>yeti</option>
-    <option>zenburn</option>
-</select>
-</p>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    styleActiveLine: true,
-    matchBrackets: true
-  });
-  var input = document.getElementById("select");
-  function selectTheme() {
-    var theme = input.options[input.selectedIndex].textContent;
-    editor.setOption("theme", theme);
-    location.hash = "#" + theme;
-  }
-  var choice = (location.hash && location.hash.slice(1)) ||
-               (document.location.search &&
-                decodeURIComponent(document.location.search.slice(1)));
-  if (choice) {
-    input.value = choice;
-    editor.setOption("theme", choice);
-  }
-  CodeMirror.on(window, "hashchange", function() {
-    var theme = location.hash.slice(1);
-    if (theme) { input.value = theme; selectTheme(); }
-  });
-</script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/theme.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/theme.html.xml
deleted file mode 100644
index 424162d330ef58eba7949120870ad94061382fbf..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/theme.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>theme.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/trailingspace.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/trailingspace.html.html
deleted file mode 100644
index 1992ba3ff92b88332eac95f227447598470245ec..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/trailingspace.html.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Trailing Whitespace Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/edit/trailingspace.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .cm-trailingspace {
-        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAACCAYAAAB/qH1jAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUXCToH00Y1UgAAACFJREFUCNdjPMDBUc/AwNDAAAFMTAwMDA0OP34wQgX/AQBYgwYEx4f9lQAAAABJRU5ErkJggg==);
-        background-position: bottom left;
-        background-repeat: repeat-x;
-      }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Trailing Whitespace</a>
-  </ul>
-</div>
-
-<article>
-<h2>Trailing Whitespace Demo</h2>
-<form><textarea id="code" name="code">This text  
- has some	 
-trailing whitespace!</textarea></form>
-
-    <script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true,
-  showTrailingSpace: true
-});
-</script>
-
-<p>Uses
-the <a href="../doc/manual.html#addon_trailingspace">trailingspace</a>
-addon to highlight trailing whitespace.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/trailingspace.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/trailingspace.html.xml
deleted file mode 100644
index 04b54bd46345fb2d960eb68c0e7f1eb5951db184..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/trailingspace.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>trailingspace.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/variableheight.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/variableheight.html.html
deleted file mode 100644
index d49942864b1e248990649280de6737f427c0cf45..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/variableheight.html.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Variable Height Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/markdown/markdown.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<style type="text/css">
-      .CodeMirror {border: 1px solid silver; border-width: 1px 2px; }
-      .cm-header { font-family: arial; }
-      .cm-header-1 { font-size: 150%; }
-      .cm-header-2 { font-size: 130%; }
-      .cm-header-3 { font-size: 120%; }
-      .cm-header-4 { font-size: 110%; }
-      .cm-header-5 { font-size: 100%; }
-      .cm-header-6 { font-size: 90%; }
-      .cm-strong { font-size: 140%; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Variable Height</a>
-  </ul>
-</div>
-
-<article>
-<h2>Variable Height Demo</h2>
-<form><textarea id="code" name="code"># A First Level Header
-
-**Bold** text in a normal-size paragraph.
-
-And a very long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long, wrapped line with a piece of **big** text inside of it.
-
-## A Second Level Header
-
-Now is the time for all good men to come to
-the aid of their country. This is just a
-regular paragraph.
-
-The quick brown fox jumped over the lazy
-dog's back.
-
-### Header 3
-
-> This is a blockquote.
-> 
-> This is the second paragraph in the blockquote.
->
-> ## This is an H2 in a blockquote       
-</textarea></form>
-    <script id="script">
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        lineWrapping: true,
-        mode: "markdown"
-      });
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/variableheight.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/variableheight.html.xml
deleted file mode 100644
index a86e6b8ca5356fb85b9d21ff8132da08885258fb..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/variableheight.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>variableheight.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/vim.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/vim.html.html
deleted file mode 100644
index f27b8b8e2bdd15e16a5a1487724998acf39b6fd6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/vim.html.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Vim bindings demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/dialog/dialog.css">
-<link rel="stylesheet" href="../theme/midnight.css">
-<link rel="stylesheet" href="../theme/solarized.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/dialog/dialog.js"></script>
-<script src="../addon/search/searchcursor.js"></script>
-<script src="../mode/clike/clike.js"></script>
-<script src="../addon/edit/matchbrackets.js"></script>
-<script src="../keymap/vim.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Vim bindings</a>
-  </ul>
-</div>
-
-<article>
-<h2>Vim bindings demo</h2>
-
-<p><strong style="color: #c33; text-decoration: none">Note:</strong> The CodeMirror vim bindings do not have an
-active maintainer. That means that if you report bugs in it, they are
-likely to go unanswered. It also means that if you want to help, you
-are very welcome to look
-at <a href="https://github.com/codemirror/codemirror/issues?q=is%3Aissue+is%3Aopen+label%3Avim">the
-open issues</a> and see which ones you can solve.</p>
-
-<form><textarea id="code" name="code">
-#include "syscalls.h"
-/* getchar:  simple buffered version */
-int getchar(void)
-{
-  static char buf[BUFSIZ];
-  static char *bufp = buf;
-  static int n = 0;
-  if (n == 0) {  /* buffer is empty */
-    n = read(0, buf, sizeof buf);
-    bufp = buf;
-  }
-  return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-</textarea></form>
-<div style="font-size: 13px; width: 300px; height: 30px;">Key buffer: <span id="command-display"></span></div>
-
-<p>The vim keybindings are enabled by including <code><a
-href="../keymap/vim.js">keymap/vim.js</a></code> and setting the
-<code>keyMap</code> option to <code>vim</code>.</p>
-
-<p><strong>Features</strong></p>
-
-<ul>
-  <li>All common motions and operators, including text objects</li>
-  <li>Operator motion orthogonality</li>
-  <li>Visual mode - characterwise, linewise, blockwise</li>
-  <li>Full macro support (q, @)</li>
-  <li>Incremental highlighted search (/, ?, #, *, g#, g*)</li>
-  <li>Search/replace with confirm (:substitute, :%s)</li>
-  <li>Search history</li>
-  <li>Jump lists (Ctrl-o, Ctrl-i)</li>
-  <li>Key/command mapping with API (:map, :nmap, :vmap)</li>
-  <li>Sort (:sort)</li>
-  <li>Marks (`, ')</li>
-  <li>:global</li>
-  <li>Insert mode behaves identical to base CodeMirror</li>
-  <li>Cross-buffer yank/paste</li>
-</ul>
-
-<p>For the full list of key mappings and Ex commands, refer to the
-<code>defaultKeymap</code> and <code>defaultExCommandMap</code> at the
-top of <code><a href="../keymap/vim.js">keymap/vim.js</a></code>.
-
-<p>Note that while the vim mode tries to emulate the most useful
-features of vim as faithfully as possible, it does not strive to
-become a complete vim implementation</p>
-
-    <script>
-      CodeMirror.commands.save = function(){ alert("Saving"); };
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "text/x-csrc",
-        keyMap: "vim",
-        matchBrackets: true,
-        showCursorWhenSelecting: true
-      });
-      var commandDisplay = document.getElementById('command-display');
-      var keys = '';
-      CodeMirror.on(editor, 'vim-keypress', function(key) {
-        keys = keys + key;
-        commandDisplay.innerHTML = keys;
-      });
-      CodeMirror.on(editor, 'vim-command-done', function(e) {
-        keys = '';
-        commandDisplay.innerHTML = keys;
-      });
-    </script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/vim.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/vim.html.xml
deleted file mode 100644
index 6ab656a9a4fc46cc6797a2246ce302620c775cbf..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/vim.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>vim.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/visibletabs.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/visibletabs.html.html
deleted file mode 100644
index 2eec337ed395b2863bda37963f56ef9625965ea1..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/visibletabs.html.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Visible tabs demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/clike/clike.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid #eee; border-bottom: 1px solid #eee;}
-      .cm-tab {
-         background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);
-         background-position: right;
-         background-repeat: no-repeat;
-      }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Visible tabs</a>
-  </ul>
-</div>
-
-<article>
-<h2>Visible tabs demo</h2>
-<form><textarea id="code" name="code">
-#include "syscalls.h"
-/* getchar:  simple buffered version */
-int getchar(void)
-{
-	static char buf[BUFSIZ];
-	static char *bufp = buf;
-	static int n = 0;
-	if (n == 0) {  /* buffer is empty */
-		n = read(0, buf, sizeof buf);
-		bufp = buf;
-	}
-	return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
-}
-</textarea></form>
-
-<p>Tabs inside the editor are spans with the
-class <code>cm-tab</code>, and can be styled.</p>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        tabSize: 4,
-        indentUnit: 4,
-        indentWithTabs: true,
-        mode: "text/x-csrc"
-      });
-    </script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/visibletabs.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/visibletabs.html.xml
deleted file mode 100644
index 6515b843729ac5416a311460feb4a5c6a4f5d764..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/visibletabs.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>visibletabs.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/widget.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/widget.html.html
deleted file mode 100644
index da39a9297a378a4981e3ad813c3577c81ddbd425..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/widget.html.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Inline Widget Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="//ajax.aspnetcdn.com/ajax/jshint/r07/jshint.js"></script>
-<style type="text/css">
-      .CodeMirror {border: 1px solid black;}
-      .lint-error {font-family: arial; font-size: 70%; background: #ffa; color: #a00; padding: 2px 5px 3px; }
-      .lint-error-icon {color: white; background-color: red; font-weight: bold; border-radius: 50%; padding: 0 3px; margin-right: 7px;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Inline Widget</a>
-  </ul>
-</div>
-
-<article>
-<h2>Inline Widget Demo</h2>
-
-
-    <div id=code></div>
-    <script id="script">var widgets = []
-function updateHints() {
-  editor.operation(function(){
-    for (var i = 0; i < widgets.length; ++i)
-      editor.removeLineWidget(widgets[i]);
-    widgets.length = 0;
-
-    JSHINT(editor.getValue());
-    for (var i = 0; i < JSHINT.errors.length; ++i) {
-      var err = JSHINT.errors[i];
-      if (!err) continue;
-      var msg = document.createElement("div");
-      var icon = msg.appendChild(document.createElement("span"));
-      icon.innerHTML = "!!";
-      icon.className = "lint-error-icon";
-      msg.appendChild(document.createTextNode(err.reason));
-      msg.className = "lint-error";
-      widgets.push(editor.addLineWidget(err.line - 1, msg, {coverGutter: false, noHScroll: true}));
-    }
-  });
-  var info = editor.getScrollInfo();
-  var after = editor.charCoords({line: editor.getCursor().line + 1, ch: 0}, "local").top;
-  if (info.top + info.clientHeight < after)
-    editor.scrollTo(null, after - info.clientHeight + 3);
-}
-
-window.onload = function() {
-  var sc = document.getElementById("script");
-  var content = sc.textContent || sc.innerText || sc.innerHTML;
-
-  window.editor = CodeMirror(document.getElementById("code"), {
-    lineNumbers: true,
-    mode: "javascript",
-    value: content
-  });
-
-  var waiting;
-  editor.on("change", function() {
-    clearTimeout(waiting);
-    waiting = setTimeout(updateHints, 500);
-  });
-
-  setTimeout(updateHints, 100);
-};
-
-"long line to create a horizontal scrollbar, in order to test whether the (non-inline) widgets stay in place when scrolling to the right";
-</script>
-<p>This demo runs <a href="http://jshint.com">JSHint</a> over the code
-in the editor (which is the script used on this page), and
-inserts <a href="../doc/manual.html#addLineWidget">line widgets</a> to
-display the warnings that JSHint comes up with.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/widget.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/widget.html.xml
deleted file mode 100644
index 8453c6581c0726c4f417b8d3127c828d8b3d9bea..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/widget.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>widget.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/xmlcomplete.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/xmlcomplete.html.html
deleted file mode 100644
index 043f0c429c72944a3286cd967cbf4c431b8616c3..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/xmlcomplete.html.html
+++ /dev/null
@@ -1,119 +0,0 @@
-锘�<!doctype html>
-
-<title>CodeMirror: XML Autocomplete Demo</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="../addon/hint/show-hint.css">
-<script src="../lib/codemirror.js"></script>
-<script src="../addon/hint/show-hint.js"></script>
-<script src="../addon/hint/xml-hint.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<style type="text/css">
-      .CodeMirror { border: 1px solid #eee; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">XML Autocomplete</a>
-  </ul>
-</div>
-
-<article>
-<h2>XML Autocomplete Demo</h2>
-<form><textarea id="code" name="code"><!-- write some xml below -->
-</textarea></form>
-
-    <p>Press <strong>ctrl-space</strong>, or type a '&lt;' character to
-    activate autocompletion. This demo defines a simple schema that
-    guides completion. The schema can be customized鈥攕ee
-    the <a href="../doc/manual.html#addon_xml-hint">manual</a>.</p>
-
-    <p>Development of the <code>xml-hint</code> addon was kindly
-    sponsored
-    by <a href="http://www.xperiment.mobi">www.xperiment.mobi</a>.</p>
-
-    <script>
-      var dummy = {
-        attrs: {
-          color: ["red", "green", "blue", "purple", "white", "black", "yellow"],
-          size: ["large", "medium", "small"],
-          description: null
-        },
-        children: []
-      };
-
-      var tags = {
-        "!top": ["top"],
-        "!attrs": {
-          id: null,
-          class: ["A", "B", "C"]
-        },
-        top: {
-          attrs: {
-            lang: ["en", "de", "fr", "nl"],
-            freeform: null
-          },
-          children: ["animal", "plant"]
-        },
-        animal: {
-          attrs: {
-            name: null,
-            isduck: ["yes", "no"]
-          },
-          children: ["wings", "feet", "body", "head", "tail"]
-        },
-        plant: {
-          attrs: {name: null},
-          children: ["leaves", "stem", "flowers"]
-        },
-        wings: dummy, feet: dummy, body: dummy, head: dummy, tail: dummy,
-        leaves: dummy, stem: dummy, flowers: dummy
-      };
-
-      function completeAfter(cm, pred) {
-        var cur = cm.getCursor();
-        if (!pred || pred()) setTimeout(function() {
-          if (!cm.state.completionActive)
-            cm.showHint({completeSingle: false});
-        }, 100);
-        return CodeMirror.Pass;
-      }
-
-      function completeIfAfterLt(cm) {
-        return completeAfter(cm, function() {
-          var cur = cm.getCursor();
-          return cm.getRange(CodeMirror.Pos(cur.line, cur.ch - 1), cur) == "<";
-        });
-      }
-
-      function completeIfInTag(cm) {
-        return completeAfter(cm, function() {
-          var tok = cm.getTokenAt(cm.getCursor());
-          if (tok.type == "string" && (!/['"]/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1)) return false;
-          var inner = CodeMirror.innerMode(cm.getMode(), tok.state).state;
-          return inner.tagName;
-        });
-      }
-
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "xml",
-        lineNumbers: true,
-        extraKeys: {
-          "'<'": completeAfter,
-          "'/'": completeIfAfterLt,
-          "' '": completeIfInTag,
-          "'='": completeIfInTag,
-          "Ctrl-Space": "autocomplete"
-        },
-        hintOptions: {schemaInfo: tags}
-      });
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/xmlcomplete.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/xmlcomplete.html.xml
deleted file mode 100644
index 6157ee4d572ae7a74970f62a5d365c0cf4ca44d5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/xmlcomplete.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>xmlcomplete.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc.xml
deleted file mode 100644
index a38fce040a582ef528e2f126e00e63553af96ba0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Folder" module="OFS.Folder"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_objects</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>doc</string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/activebookmark.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/activebookmark.js.js
deleted file mode 100644
index 407282d02ccde63611e66bff550b52ea51abfdc5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/activebookmark.js.js
+++ /dev/null
@@ -1,57 +0,0 @@
-// Kludge in HTML5 tag recognition in IE8
-document.createElement("section");
-document.createElement("article");
-
-(function() {
-  if (!window.addEventListener) return;
-  var pending = false, prevVal = null;
-
-  function updateSoon() {
-    if (!pending) {
-      pending = true;
-      setTimeout(update, 250);
-    }
-  }
-
-  function update() {
-    pending = false;
-    var marks = document.getElementById("nav").getElementsByTagName("a"), found;
-    for (var i = 0; i < marks.length; ++i) {
-      var mark = marks[i], m;
-      if (mark.getAttribute("data-default")) {
-        if (found == null) found = i;
-      } else if (m = mark.href.match(/#(.*)/)) {
-        var ref = document.getElementById(m[1]);
-        if (ref && ref.getBoundingClientRect().top < 50)
-          found = i;
-      }
-    }
-    if (found != null && found != prevVal) {
-      prevVal = found;
-      var lis = document.getElementById("nav").getElementsByTagName("li");
-      for (var i = 0; i < lis.length; ++i) lis[i].className = "";
-      for (var i = 0; i < marks.length; ++i) {
-        if (found == i) {
-          marks[i].className = "active";
-          for (var n = marks[i]; n; n = n.parentNode)
-            if (n.nodeName == "LI") n.className = "active";
-        } else {
-          marks[i].className = "";
-        }
-      }
-    }
-  }
-
-  window.addEventListener("scroll", updateSoon);
-  window.addEventListener("load", updateSoon);
-  window.addEventListener("hashchange", function() {
-    setTimeout(function() {
-      var hash = document.location.hash, found = null, m;
-      var marks = document.getElementById("nav").getElementsByTagName("a");
-      for (var i = 0; i < marks.length; i++)
-        if ((m = marks[i].href.match(/(#.*)/)) && m[1] == hash) { found = i; break; }
-      if (found != null) for (var i = 0; i < marks.length; i++)
-        marks[i].className = i == found ? "active" : "";
-    }, 300);
-  });
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/activebookmark.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/activebookmark.js.xml
deleted file mode 100644
index 09f878da0e5794805fdb3da5a46e0afddeb0387d..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/activebookmark.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>activebookmark.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/docs.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/docs.css.css
deleted file mode 100644
index 881d2aa455138f1f13ea224ba9c1dc47f765458f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/docs.css.css
+++ /dev/null
@@ -1,271 +0,0 @@
-@font-face {
-  font-family: 'Source Sans Pro';
-  font-style: normal;
-  font-weight: 400;
-  src: local('Source Sans Pro'), local('SourceSansPro-Regular'), url(//themes.googleusercontent.com/static/fonts/sourcesanspro/v5/ODelI1aHBYDBqgeIAH2zlBM0YzuT7MdOe03otPbuUS0.woff) format('woff');
-}
-
-body, html { margin: 0; padding: 0; height: 100%; }
-section, article { display: block; padding: 0; }
-
-body {
-  background: #f8f8f8;
-  font-family: 'Source Sans Pro', Helvetica, Arial, sans-serif;
-  line-height: 1.5;
-}
-
-p { margin-top: 0; }
-
-h2, h3, h1 {
-  font-weight: normal;
-  margin-bottom: .7em;
-}
-h1 { font-size: 140%; }
-h2 { font-size: 120%; }
-h3 { font-size: 110%; }
-article > h2:first-child, section:first-child > h2 { margin-top: 0; }
-
-#nav h1 {
-  margin-right: 12px;
-  margin-top: 0;
-  margin-bottom: 2px;
-  color: #d30707;
-  letter-spacing: .5px;
-}
-
-a, a:visited, a:link, .quasilink {
-  color: #A21313;
-  text-decoration: none;
-}
-
-em {
-  padding-right: 2px;
-}
-
-.quasilink {
-  cursor: pointer;
-}
-
-article {
-  max-width: 700px;
-  margin: 0 0 0 160px;
-  border-left: 2px solid #E30808;
-  border-right: 1px solid #ddd;
-  padding: 30px 50px 100px 50px;
-  background: white;
-  z-index: 2;
-  position: relative;
-  min-height: 100%;
-  box-sizing: border-box;
-  -moz-box-sizing: border-box;
-}
-
-#nav {
-  position: fixed;
-  padding-top: 30px;
-  max-height: 100%;
-  box-sizing: -moz-border-box;
-  box-sizing: border-box;
-  overflow-y: auto;
-  left: 0; right: none;
-  width: 160px;
-  text-align: right;
-  z-index: 1;
-}
-
-@media screen and (min-width: 1000px) {
-  article {
-    margin: 0 auto;
-  }
-  #nav {
-    right: 50%;
-    width: auto;
-    border-right: 349px solid transparent;
-  }
-}
-
-#nav ul {
-  display: block;
-  margin: 0; padding: 0;
-  margin-bottom: 32px;
-}
-
-#nav li {
-  display: block;
-  margin-bottom: 4px;
-}
-
-#nav li ul {
-  font-size: 80%;
-  margin-bottom: 0;
-  display: none;
-}
-
-#nav li.active ul {
-  display: block;
-}
-
-#nav li li a {
-  padding-right: 20px;
-  display: inline-block;
-}
-
-#nav ul a {
-  color: black;
-  padding: 0 7px 1px 11px;
-}
-
-#nav ul a.active, #nav ul a:hover {
-  border-bottom: 1px solid #E30808;
-  margin-bottom: -1px;
-  color: #E30808;
-}
-
-#logo {
-  border: 0;
-  margin-right: 12px;
-  margin-bottom: 25px;
-}
-
-section {
-  border-top: 1px solid #E30808;
-  margin: 1.5em 0;
-}
-
-section.first {
-  border: none;
-  margin-top: 0;
-}
-
-#demo {
-  position: relative;
-}
-
-#demolist {
-  position: absolute;
-  right: 5px;
-  top: 5px;
-  z-index: 25;
-}
-
-.yinyang {
-  position: absolute;
-  top: -10px;
-  left: 0; right: 0;
-  margin: auto;
-  display: block;
-  height: 120px;
-}
-
-.actions {
-  margin: 1em 0 0;
-  min-height: 100px;
-  position: relative;
-}
-
-.actionspicture {
-  pointer-events: none;
-  position: absolute;
-  height: 100px;
-  top: 0; left: 0; right: 0;
-}
-
-.actionlink {
-  pointer-events: auto;
-  font-family: arial;
-  font-size: 80%;
-  font-weight: bold;
-  position: absolute;
-  top: 0; bottom: 0;
-  line-height: 1;
-  height: 1em;
-  margin: auto;
-}
-
-.actionlink.download {
-  color: white;
-  right: 50%;
-  margin-right: 13px;
-  text-shadow: -1px 1px 3px #b00, -1px -1px 3px #b00, 1px 0px 3px #b00;
-}
-
-.actionlink.fund {
-  color: #b00;
-  left: 50%;
-  margin-left: 15px;
-}
-
-.actionlink:hover {
-  text-decoration: underline;
-}
-
-.actionlink a {
-  color: inherit;
-}
-
-.actionsleft {
-  float: left;
-}
-
-.actionsright {
-  float: right;
-  text-align: right;
-}
-
-@media screen and (max-width: 800px) {
-  .actions {
-    padding-top: 120px;
-  }
-  .actionsleft, .actionsright {
-    float: none;
-    text-align: left;
-    margin-bottom: 1em;
-  }
-}
-
-th {
-  text-decoration: underline;
-  font-weight: normal;
-  text-align: left;
-}
-
-#features ul {
-  list-style: none;
-  margin: 0 0 1em;
-  padding: 0 0 0 1.2em;
-}
-
-#features li:before {
-  content: "-";
-  width: 1em;
-  display: inline-block;
-  padding: 0;
-  margin: 0;
-  margin-left: -1em;
-}
-
-.rel {
-  margin-bottom: 0;
-}
-.rel-note {
-  margin-top: 0;
-  color: #555;
-}
-
-pre {
-  padding-left: 15px;
-  border-left: 2px solid #ddd;
-}
-
-code {
-  padding: 0 2px;
-}
-
-strong {
-  text-decoration: underline;
-  font-weight: normal;
-}
-
-.field {
-  border: 1px solid #A21313;
-}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/docs.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/docs.css.xml
deleted file mode 100644
index f822107900aefc47aecda9a33d3fb5c198822729..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/docs.css.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>docs.css</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/internals.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/internals.html.html
deleted file mode 100644
index 079466f6302f2a1224b475414cef48d4c48ce5ad..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/internals.html.html
+++ /dev/null
@@ -1,504 +0,0 @@
-锘�<!doctype html>
-
-<title>CodeMirror: Internals</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="docs.css">
-<style>dl dl {margin: 0;} .update {color: #d40 !important}</style>
-<script src="activebookmark.js"></script>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="#top">Introduction</a></li>
-    <li><a href="#approach">General Approach</a></li>
-    <li><a href="#input">Input</a></li>
-    <li><a href="#selection">Selection</a></li>
-    <li><a href="#update">Intelligent Updating</a></li>
-    <li><a href="#parse">Parsing</a></li>
-    <li><a href="#summary">What Gives?</a></li>
-    <li><a href="#btree">Content Representation</a></li>
-    <li><a href="#keymap">Key Maps</a></li>
-  </ul>
-</div>
-
-<article>
-
-<h2 id=top>(Re-) Implementing A Syntax-Highlighting Editor in JavaScript</h2>
-
-<p style="font-size: 85%" id="intro">
-  <strong>Topic:</strong> JavaScript, code editor implementation<br>
-  <strong>Author:</strong> Marijn Haverbeke<br>
-  <strong>Date:</strong> March 2nd 2011 (updated November 13th 2011)
-</p>
-
-<p style="padding: 0 3em 0 2em"><strong>Caution</strong>: this text was written briefly after
-version 2 was initially written. It no longer (even including the
-update at the bottom) fully represents the current implementation. I'm
-leaving it here as a historic document. For more up-to-date
-information, look at the entries
-tagged <a href="http://marijnhaverbeke.nl/blog/#cm-internals">cm-internals</a>
-on my blog.</p>
-
-<p>This is a followup to
-my <a href="http://codemirror.net/story.html">Brutal Odyssey to the
-Dark Side of the DOM Tree</a> story. That one describes the
-mind-bending process of implementing (what would become) CodeMirror 1.
-This one describes the internals of CodeMirror 2, a complete rewrite
-and rethink of the old code base. I wanted to give this piece another
-Hunter Thompson copycat subtitle, but somehow that would be out of
-place鈥攖he process this time around was one of straightforward
-engineering, requiring no serious mind-bending whatsoever.</p>
-
-<p>So, what is wrong with CodeMirror 1? I'd estimate, by mailing list
-activity and general search-engine presence, that it has been
-integrated into about a thousand systems by now. The most prominent
-one, since a few weeks,
-being <a href="http://googlecode.blogspot.com/2011/01/make-quick-fixes-quicker-on-google.html">Google
-code's project hosting</a>. It works, and it's being used widely.</p>
-
-<p>Still, I did not start replacing it because I was bored. CodeMirror
-1 was heavily reliant on <code>designMode</code>
-or <code>contentEditable</code> (depending on the browser). Neither of
-these are well specified (HTML5 tries
-to <a href="http://www.w3.org/TR/html5/editing.html#contenteditable">specify</a>
-their basics), and, more importantly, they tend to be one of the more
-obscure and buggy areas of browser functionality鈥擟odeMirror, by using
-this functionality in a non-typical way, was constantly running up
-against browser bugs. WebKit wouldn't show an empty line at the end of
-the document, and in some releases would suddenly get unbearably slow.
-Firefox would show the cursor in the wrong place. Internet Explorer
-would insist on linkifying everything that looked like a URL or email
-address, a behaviour that can't be turned off. Some bugs I managed to
-work around (which was often a frustrating, painful process), others,
-such as the Firefox cursor placement, I gave up on, and had to tell
-user after user that they were known problems, but not something I
-could help.</p>
-
-<p>Also, there is the fact that <code>designMode</code> (which seemed
-to be less buggy than <code>contentEditable</code> in Webkit and
-Firefox, and was thus used by CodeMirror 1 in those browsers) requires
-a frame. Frames are another tricky area. It takes some effort to
-prevent getting tripped up by domain restrictions, they don't
-initialize synchronously, behave strangely in response to the back
-button, and, on several browsers, can't be moved around the DOM
-without having them re-initialize. They did provide a very nice way to
-namespace the library, though鈥擟odeMirror 1 could freely pollute the
-namespace inside the frame.</p>
-
-<p>Finally, working with an editable document means working with
-selection in arbitrary DOM structures. Internet Explorer (8 and
-before) has an utterly different (and awkward) selection API than all
-of the other browsers, and even among the different implementations of
-<code>document.selection</code>, details about how exactly a selection
-is represented vary quite a bit. Add to that the fact that Opera's
-selection support tended to be very buggy until recently, and you can
-imagine why CodeMirror 1 contains 700 lines of selection-handling
-code.</p>
-
-<p>And that brings us to the main issue with the CodeMirror 1
-code base: The proportion of browser-bug-workarounds to real
-application code was getting dangerously high. By building on top of a
-few dodgy features, I put the system in a vulnerable position鈥攁ny
-incompatibility and bugginess in these features, I had to paper over
-with my own code. Not only did I have to do some serious stunt-work to
-get it to work on older browsers (as detailed in the
-previous <a href="http://codemirror.net/story.html">story</a>), things
-also kept breaking in newly released versions, requiring me to come up
-with <em>new</em> scary hacks in order to keep up. This was starting
-to lose its appeal.</p>
-
-<section id=approach>
-  <h2>General Approach</h2>
-
-<p>What CodeMirror 2 does is try to sidestep most of the hairy hacks
-that came up in version 1. I owe a lot to the
-<a href="http://ace.ajax.org">ACE</a> editor for inspiration on how to
-approach this.</p>
-
-<p>I absolutely did not want to be completely reliant on key events to
-generate my input. Every JavaScript programmer knows that key event
-information is horrible and incomplete. Some people (most awesomely
-Mihai Bazon with <a href="http://ymacs.org">Ymacs</a>) have been able
-to build more or less functioning editors by directly reading key
-events, but it takes a lot of work (the kind of never-ending, fragile
-work I described earlier), and will never be able to properly support
-things like multi-keystoke international character
-input. <a href="#keymap" class="update">[see below for caveat]</a></p>
-
-<p>So what I do is focus a hidden textarea, and let the browser
-believe that the user is typing into that. What we show to the user is
-a DOM structure we built to represent his document. If this is updated
-quickly enough, and shows some kind of believable cursor, it feels
-like a real text-input control.</p>
-
-<p>Another big win is that this DOM representation does not have to
-span the whole document. Some CodeMirror 1 users insisted that they
-needed to put a 30 thousand line XML document into CodeMirror. Putting
-all that into the DOM takes a while, especially since, for some
-reason, an editable DOM tree is slower than a normal one on most
-browsers. If we have full control over what we show, we must only
-ensure that the visible part of the document has been added, and can
-do the rest only when needed. (Fortunately, the <code>onscroll</code>
-event works almost the same on all browsers, and lends itself well to
-displaying things only as they are scrolled into view.)</p>
-</section>
-<section id="input">
-  <h2>Input</h2>
-
-<p>ACE uses its hidden textarea only as a text input shim, and does
-all cursor movement and things like text deletion itself by directly
-handling key events. CodeMirror's way is to let the browser do its
-thing as much as possible, and not, for example, define its own set of
-key bindings. One way to do this would have been to have the whole
-document inside the hidden textarea, and after each key event update
-the display DOM to reflect what's in that textarea.</p>
-
-<p>That'd be simple, but it is not realistic. For even medium-sized
-document the editor would be constantly munging huge strings, and get
-terribly slow. What CodeMirror 2 does is put the current selection,
-along with an extra line on the top and on the bottom, into the
-textarea.</p>
-
-<p>This means that the arrow keys (and their ctrl-variations), home,
-end, etcetera, do not have to be handled specially. We just read the
-cursor position in the textarea, and update our cursor to match it.
-Also, copy and paste work pretty much for free, and people get their
-native key bindings, without any special work on my part. For example,
-I have emacs key bindings configured for Chrome and Firefox. There is
-no way for a script to detect this. <a class="update"
-href="#keymap">[no longer the case]</a></p>
-
-<p>Of course, since only a small part of the document sits in the
-textarea, keys like page up and ctrl-end won't do the right thing.
-CodeMirror is catching those events and handling them itself.</p>
-</section>
-<section id="selection">
-  <h2>Selection</h2>
-
-<p>Getting and setting the selection range of a textarea in modern
-browsers is trivial鈥攜ou just use the <code>selectionStart</code>
-and <code>selectionEnd</code> properties. On IE you have to do some
-insane stuff with temporary ranges and compensating for the fact that
-moving the selection by a 'character' will treat \r\n as a single
-character, but even there it is possible to build functions that
-reliably set and get the selection range.</p>
-
-<p>But consider this typical case: When I'm somewhere in my document,
-press shift, and press the up arrow, something gets selected. Then, if
-I, still holding shift, press the up arrow again, the top of my
-selection is adjusted. The selection remembers where its <em>head</em>
-and its <em>anchor</em> are, and moves the head when we shift-move.
-This is a generally accepted property of selections, and done right by
-every editing component built in the past twenty years.</p>
-
-<p>But not something that the browser selection APIs expose.</p>
-
-<p>Great. So when someone creates an 'upside-down' selection, the next
-time CodeMirror has to update the textarea, it'll re-create the
-selection as an 'upside-up' selection, with the anchor at the top, and
-the next cursor motion will behave in an unexpected way鈥攐ur second
-up-arrow press in the example above will not do anything, since it is
-interpreted in exactly the same way as the first.</p>
-
-<p>No problem. We'll just, ehm, detect that the selection is
-upside-down (you can tell by the way it was created), and then, when
-an upside-down selection is present, and a cursor-moving key is
-pressed in combination with shift, we quickly collapse the selection
-in the textarea to its start, allow the key to take effect, and then
-combine its new head with its old anchor to get the <em>real</em>
-selection.</p>
-
-<p>In short, scary hacks could not be avoided entirely in CodeMirror
-2.</p>
-
-<p>And, the observant reader might ask, how do you even know that a
-key combo is a cursor-moving combo, if you claim you support any
-native key bindings? Well, we don't, but we can learn. The editor
-keeps a set known cursor-movement combos (initialized to the
-predictable defaults), and updates this set when it observes that
-pressing a certain key had (only) the effect of moving the cursor.
-This, of course, doesn't work if the first time the key is used was
-for extending an inverted selection, but it works most of the
-time.</p>
-</section>
-<section id="update">
-  <h2>Intelligent Updating</h2>
-
-<p>One thing that always comes up when you have a complicated internal
-state that's reflected in some user-visible external representation
-(in this case, the displayed code and the textarea's content) is
-keeping the two in sync. The naive way is to just update the display
-every time you change your state, but this is not only error prone
-(you'll forget), it also easily leads to duplicate work on big,
-composite operations. Then you start passing around flags indicating
-whether the display should be updated in an attempt to be efficient
-again and, well, at that point you might as well give up completely.</p>
-
-<p>I did go down that road, but then switched to a much simpler model:
-simply keep track of all the things that have been changed during an
-action, and then, only at the end, use this information to update the
-user-visible display.</p>
-
-<p>CodeMirror uses a concept of <em>operations</em>, which start by
-calling a specific set-up function that clears the state and end by
-calling another function that reads this state and does the required
-updating. Most event handlers, and all the user-visible methods that
-change state are wrapped like this. There's a method
-called <code>operation</code> that accepts a function, and returns
-another function that wraps the given function as an operation.</p>
-
-<p>It's trivial to extend this (as CodeMirror does) to detect nesting,
-and, when an operation is started inside an operation, simply
-increment the nesting count, and only do the updating when this count
-reaches zero again.</p>
-
-<p>If we have a set of changed ranges and know the currently shown
-range, we can (with some awkward code to deal with the fact that
-changes can add and remove lines, so we're dealing with a changing
-coordinate system) construct a map of the ranges that were left
-intact. We can then compare this map with the part of the document
-that's currently visible (based on scroll offset and editor height) to
-determine whether something needs to be updated.</p>
-
-<p>CodeMirror uses two update algorithms鈥攁 full refresh, where it just
-discards the whole part of the DOM that contains the edited text and
-rebuilds it, and a patch algorithm, where it uses the information
-about changed and intact ranges to update only the out-of-date parts
-of the DOM. When more than 30 percent (which is the current heuristic,
-might change) of the lines need to be updated, the full refresh is
-chosen (since it's faster to do than painstakingly finding and
-updating all the changed lines), in the other case it does the
-patching (so that, if you scroll a line or select another character,
-the whole screen doesn't have to be
-re-rendered). <span class="update">[the full-refresh
-algorithm was dropped, it wasn't really faster than the patching
-one]</span></p>
-
-<p>All updating uses <code>innerHTML</code> rather than direct DOM
-manipulation, since that still seems to be by far the fastest way to
-build documents. There's a per-line function that combines the
-highlighting, <a href="manual.html#markText">marking</a>, and
-selection info for that line into a snippet of HTML. The patch updater
-uses this to reset individual lines, the refresh updater builds an
-HTML chunk for the whole visible document at once, and then uses a
-single <code>innerHTML</code> update to do the refresh.</p>
-</section>
-<section id="parse">
-  <h2>Parsers can be Simple</h2>
-
-<p>When I wrote CodeMirror 1, I
-thought <a href="http://codemirror.net/story.html#parser">interruptable
-parsers</a> were a hugely scary and complicated thing, and I used a
-bunch of heavyweight abstractions to keep this supposed complexity
-under control: parsers
-were <a href="http://bob.pythonmac.org/archives/2005/07/06/iteration-in-javascript/">iterators</a>
-that consumed input from another iterator, and used funny
-closure-resetting tricks to copy and resume themselves.</p>
-
-<p>This made for a rather nice system, in that parsers formed strictly
-separate modules, and could be composed in predictable ways.
-Unfortunately, it was quite slow (stacking three or four iterators on
-top of each other), and extremely intimidating to people not used to a
-functional programming style.</p>
-
-<p>With a few small changes, however, we can keep all those
-advantages, but simplify the API and make the whole thing less
-indirect and inefficient. CodeMirror
-2's <a href="manual.html#modeapi">mode API</a> uses explicit state
-objects, and makes the parser/tokenizer a function that simply takes a
-state and a character stream abstraction, advances the stream one
-token, and returns the way the token should be styled. This state may
-be copied, optionally in a mode-defined way, in order to be able to
-continue a parse at a given point. Even someone who's never touched a
-lambda in his life can understand this approach. Additionally, far
-fewer objects are allocated in the course of parsing now.</p>
-
-<p>The biggest speedup comes from the fact that the parsing no longer
-has to touch the DOM though. In CodeMirror 1, on an older browser, you
-could <em>see</em> the parser work its way through the document,
-managing some twenty lines in each 50-millisecond time slice it got. It
-was reading its input from the DOM, and updating the DOM as it went
-along, which any experienced JavaScript programmer will immediately
-spot as a recipe for slowness. In CodeMirror 2, the parser usually
-finishes the whole document in a single 100-millisecond time slice鈥攊t
-manages some 1500 lines during that time on Chrome. All it has to do
-is munge strings, so there is no real reason for it to be slow
-anymore.</p>
-</section>
-<section id="summary">
-  <h2>What Gives?</h2>
-
-<p>Given all this, what can you expect from CodeMirror 2?</p>
-
-<ul>
-
-<li><strong>Small.</strong> the base library is
-some <span class="update">45k</span> when minified
-now, <span class="update">17k</span> when gzipped. It's smaller than
-its own logo.</li>
-
-<li><strong>Lightweight.</strong> CodeMirror 2 initializes very
-quickly, and does almost no work when it is not focused. This means
-you can treat it almost like a textarea, have multiple instances on a
-page without trouble.</li>
-
-<li><strong>Huge document support.</strong> Since highlighting is
-really fast, and no DOM structure is being built for non-visible
-content, you don't have to worry about locking up your browser when a
-user enters a megabyte-sized document.</li>
-
-<li><strong>Extended API.</strong> Some things kept coming up in the
-mailing list, such as marking pieces of text or lines, which were
-extremely hard to do with CodeMirror 1. The new version has proper
-support for these built in.</li>
-
-<li><strong>Tab support.</strong> Tabs inside editable documents were,
-for some reason, a no-go. At least six different people announced they
-were going to add tab support to CodeMirror 1, none survived (I mean,
-none delivered a working version). CodeMirror 2 no longer removes tabs
-from your document.</li>
-
-<li><strong>Sane styling.</strong> <code>iframe</code> nodes aren't
-really known for respecting document flow. Now that an editor instance
-is a plain <code>div</code> element, it is much easier to size it to
-fit the surrounding elements. You don't even have to make it scroll if
-you do not <a href="../demo/resize.html">want to</a>.</li>
-
-</ul>
-
-<p>On the downside, a CodeMirror 2 instance is <em>not</em> a native
-editable component. Though it does its best to emulate such a
-component as much as possible, there is functionality that browsers
-just do not allow us to hook into. Doing select-all from the context
-menu, for example, is not currently detected by CodeMirror.</p>
-
-<p id="changes" style="margin-top: 2em;"><span style="font-weight:
-bold">[Updates from November 13th 2011]</span> Recently, I've made
-some changes to the codebase that cause some of the text above to no
-longer be current. I've left the text intact, but added markers at the
-passages that are now inaccurate. The new situation is described
-below.</p>
-</section>
-<section id="btree">
-  <h2>Content Representation</h2>
-
-<p>The original implementation of CodeMirror 2 represented the
-document as a flat array of line objects. This worked well鈥攕plicing
-arrays will require the part of the array after the splice to be
-moved, but this is basically just a simple <code>memmove</code> of a
-bunch of pointers, so it is cheap even for huge documents.</p>
-
-<p>However, I recently added line wrapping and code folding (line
-collapsing, basically). Once lines start taking up a non-constant
-amount of vertical space, looking up a line by vertical position
-(which is needed when someone clicks the document, and to determine
-the visible part of the document during scrolling) can only be done
-with a linear scan through the whole array, summing up line heights as
-you go. Seeing how I've been going out of my way to make big documents
-fast, this is not acceptable.</p>
-
-<p>The new representation is based on a B-tree. The leaves of the tree
-contain arrays of line objects, with a fixed minimum and maximum size,
-and the non-leaf nodes simply hold arrays of child nodes. Each node
-stores both the amount of lines that live below them and the vertical
-space taken up by these lines. This allows the tree to be indexed both
-by line number and by vertical position, and all access has
-logarithmic complexity in relation to the document size.</p>
-
-<p>I gave line objects and tree nodes parent pointers, to the node
-above them. When a line has to update its height, it can simply walk
-these pointers to the top of the tree, adding or subtracting the
-difference in height from each node it encounters. The parent pointers
-also make it cheaper (in complexity terms, the difference is probably
-tiny in normal-sized documents) to find the current line number when
-given a line object. In the old approach, the whole document array had
-to be searched. Now, we can just walk up the tree and count the sizes
-of the nodes coming before us at each level.</p>
-
-<p>I chose B-trees, not regular binary trees, mostly because they
-allow for very fast bulk insertions and deletions. When there is a big
-change to a document, it typically involves adding, deleting, or
-replacing a chunk of subsequent lines. In a regular balanced tree, all
-these inserts or deletes would have to be done separately, which could
-be really expensive. In a B-tree, to insert a chunk, you just walk
-down the tree once to find where it should go, insert them all in one
-shot, and then break up the node if needed. This breaking up might
-involve breaking up nodes further up, but only requires a single pass
-back up the tree. For deletion, I'm somewhat lax in keeping things
-balanced鈥擨 just collapse nodes into a leaf when their child count goes
-below a given number. This means that there are some weird editing
-patterns that may result in a seriously unbalanced tree, but even such
-an unbalanced tree will perform well, unless you spend a day making
-strangely repeating edits to a really big document.</p>
-</section>
-<section id="keymap">
-  <h2>Keymaps</h2>
-
-<p><a href="#approach">Above</a>, I claimed that directly catching key
-events for things like cursor movement is impractical because it
-requires some browser-specific kludges. I then proceeded to explain
-some awful <a href="#selection">hacks</a> that were needed to make it
-possible for the selection changes to be detected through the
-textarea. In fact, the second hack is about as bad as the first.</p>
-
-<p>On top of that, in the presence of user-configurable tab sizes and
-collapsed and wrapped lines, lining up cursor movement in the textarea
-with what's visible on the screen becomes a nightmare. Thus, I've
-decided to move to a model where the textarea's selection is no longer
-depended on.</p>
-
-<p>So I moved to a model where all cursor movement is handled by my
-own code. This adds support for a goal column, proper interaction of
-cursor movement with collapsed lines, and makes it possible for
-vertical movement to move through wrapped lines properly, instead of
-just treating them like non-wrapped lines.</p>
-
-<p>The key event handlers now translate the key event into a string,
-something like <code>Ctrl-Home</code> or <code>Shift-Cmd-R</code>, and
-use that string to look up an action to perform. To make keybinding
-customizable, this lookup goes through
-a <a href="manual.html#option_keyMap">table</a>, using a scheme that
-allows such tables to be chained together (for example, the default
-Mac bindings fall through to a table named 'emacsy', which defines
-basic Emacs-style bindings like <code>Ctrl-F</code>, and which is also
-used by the custom Emacs bindings).</p>
-
-<p>A new
-option <a href="manual.html#option_extraKeys"><code>extraKeys</code></a>
-allows ad-hoc keybindings to be defined in a much nicer way than what
-was possible with the
-old <a href="manual.html#option_onKeyEvent"><code>onKeyEvent</code></a>
-callback. You simply provide an object mapping key identifiers to
-functions, instead of painstakingly looking at raw key events.</p>
-
-<p>Built-in commands map to strings, rather than functions, for
-example <code>"goLineUp"</code> is the default action bound to the up
-arrow key. This allows new keymaps to refer to them without
-duplicating any code. New commands can be defined by assigning to
-the <code>CodeMirror.commands</code> object, which maps such commands
-to functions.</p>
-
-<p>The hidden textarea now only holds the current selection, with no
-extra characters around it. This has a nice advantage: polling for
-input becomes much, much faster. If there's a big selection, this text
-does not have to be read from the textarea every time鈥攚hen we poll,
-just noticing that something is still selected is enough to tell us
-that no new text was typed.</p>
-
-<p>The reason that cheap polling is important is that many browsers do
-not fire useful events on IME (input method engine) input, which is
-the thing where people inputting a language like Japanese or Chinese
-use multiple keystrokes to create a character or sequence of
-characters. Most modern browsers fire <code>input</code> when the
-composing is finished, but many don't fire anything when the character
-is updated <em>during</em> composition. So we poll, whenever the
-editor is focused, to provide immediate updates of the display.</p>
-
-</section>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/internals.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/internals.html.xml
deleted file mode 100644
index 4b6fc4011bcfd151d77d02448fcad58d99d17fb5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/internals.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>internals.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.png.png b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.png.png
deleted file mode 100644
index 9aabda1d709f565bb115fa083cc16b6d52db64cf..0000000000000000000000000000000000000000
Binary files a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.png.png and /dev/null differ
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.png.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.png.xml
deleted file mode 100644
index 566afcc7afceffca844b085e6aa489f55acd77b8..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.png.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Image" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>logo.png</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>image/png</string> </value>
-        </item>
-        <item>
-            <key> <string>height</string> </key>
-            <value> <int>105</int> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>width</string> </key>
-            <value> <int>113</int> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.svg.svg b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.svg.svg
deleted file mode 100644
index 0aa6323f9e09b3804cdc7b8c430d5d7ed6e61e79..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.svg.svg
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://creativecommons.org/ns#"
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-   xmlns:svg="http://www.w3.org/2000/svg"
-   xmlns="http://www.w3.org/2000/svg"
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   id="svg2"
-   version="1.1"
-   inkscape:version="0.48.4 r9939"
-   width="640"
-   height="640"
-   xml:space="preserve"
-   sodipodi:docname="logo.svg"
-   inkscape:export-filename="/home/marijn/src/js/codemirror/doc/logo.png"
-   inkscape:export-xdpi="16.601332"
-   inkscape:export-ydpi="16.601332"><metadata
-     id="metadata8"><rdf:RDF><cc:Work
-         rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
-     id="defs6"><clipPath
-       clipPathUnits="userSpaceOnUse"
-       id="clipPath16"><path
-         d="M 0,512 512,512 512,0 0,0 0,512 z"
-         id="path18" /></clipPath><clipPath
-       clipPathUnits="userSpaceOnUse"
-       id="clipPath40"><path
-         d="m 435.607,369.899 31.242,0 0,-64.782 -31.242,0 0,64.782 z"
-         id="path42" /></clipPath><clipPath
-       clipPathUnits="userSpaceOnUse"
-       id="clipPath56"><path
-         d="m 421.796,349.477 39.074,0 0,-88.423 -39.074,0 0,88.423 z"
-         id="path58" /></clipPath></defs><sodipodi:namedview
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1"
-     objecttolerance="10"
-     gridtolerance="10"
-     guidetolerance="10"
-     inkscape:pageopacity="0"
-     inkscape:pageshadow="2"
-     inkscape:window-width="1600"
-     inkscape:window-height="875"
-     id="namedview4"
-     showgrid="false"
-     showguides="true"
-     inkscape:guide-bbox="true"
-     inkscape:zoom="0.52149125"
-     inkscape:cx="303.572"
-     inkscape:cy="574.48012"
-     inkscape:window-x="0"
-     inkscape:window-y="25"
-     inkscape:window-maximized="0"
-     inkscape:current-layer="g10" /><g
-     id="g10"
-     inkscape:groupmode="layer"
-     inkscape:label="2014-10_codeMirror_logo_vectors"
-     transform="matrix(1.25,0,0,-1.25,0,640)"><path
-       inkscape:connector-curvature="0"
-       id="path22"
-       style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 233.97976,469.37438 c 0,0 7.01353,-14.94848 -2.94916,-31.42373 -4.97925,-8.23417 -130.50847,-34.94915 -179.50847,-102.94915 -30,-47 -76,-183 71,-273 66,-34 94,-33 94,-33 0,0 -44,31 -16,52 28,21 69,31 80,60 13,-10 34,-31 54,-29 -2,13 -7,18 9,20 16,2 24,2 24,2 0,0 -15,12 -32,13 -17,1 -49,34 -48,48 21,12 48,32 64,26 16,-6 32,-16 35,-25 0,-6 -3,-16 10,-8 13,8 10,13 15,24 5,11 6,13 -5,22 -11,9 -37,30 -58,24 -21,-6 -65,-23 -87,-2 9,20 23,52 16,74 13,10 28,21 30,39 15,2 47,11 41,27 -6,16 -48.59322,87.16949 -113.59322,73.16949"
-       sodipodi:nodetypes="cscccsccscscscsssscccsc" /><path
-       inkscape:connector-curvature="0"
-       id="path26"
-       style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 441.52213,306.0015 c 11,29 29,78 12,80 -17,2 -36,-44 -41,-56 -5,-12 -25,-72 -14,-80 11,-8 43,56 43,56" /><path
-       inkscape:connector-curvature="0"
-       id="path30"
-       style="fill:#da687d;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 348.52213,384.0015 c 3.13,4.919 5.82086,0.64508 -7.67914,-0.35492 -13.5,-1 -29.62196,-5.18461 -32.38899,-11.04836 -5.19174,-11.00208 -6.93187,-38.09672 -26.43187,-44.09672 -1,-7 0,-23 27.5,-26 27.5,-3 28.5,15 44.5,14.5 16,-0.5 14.5,5.5 9,10 -5.5,4.5 -24.5,35 -24.5,45 0,10 6.5,6.5 10,12"
-       sodipodi:nodetypes="csscssssc" /><path
-       inkscape:connector-curvature="0"
-       id="path34"
-       style="fill:#da687d;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 103.02213,82.502 c 0,0 -8.5,22.5 16.5,34.5 25,12 47.5,2.5 52,-6 4.5,-8.5 -7.5,-42.5 -50.5,-43 -10.5,8.5 -18,14.5 -18,14.5" /><g
-       id="g38"
-       transform="translate(-21.47687,0)" /><g
-       id="g44"
-       transform="translate(-21.47687,0)"><g
-         style="opacity:0.69999701"
-         id="g46"
-         clip-path="url(#clipPath40)"><g
-           id="g48"
-           transform="translate(466.2583,369.8384)"><path
-             inkscape:connector-curvature="0"
-             id="path50"
-             style="fill:#da687d;fill-opacity:1;fill-rule:evenodd;stroke:none"
-             d="M 0,0 C 0.423,-1.569 0.298,-3.199 0.255,-4.838 0.213,-6.452 0.062,-8.15 -0.349,-9.801 c 0.106,-0.377 -0.082,-0.814 -0.018,-1.201 -0.41,-0.515 -0.194,-0.903 -0.284,-1.354 0.661,-0.674 1.522,-1.313 1.152,-2.162 -0.259,-0.596 -0.874,-0.706 -1.464,-0.995 -0.389,-1.403 -0.709,-3.099 -1.028,-4.649 -0.097,-0.476 -0.044,-1.051 -0.187,-1.485 -0.334,-1.01 -0.691,-1.978 -0.971,-3.09 -0.237,-0.945 0.034,-2.689 -1.063,-2.811 -0.423,-1.049 -0.663,-1.841 -1.165,-2.83 -0.286,-0.163 -0.452,0.106 -0.692,0.009 -0.305,-0.348 -0.294,-0.823 -0.577,-1.114 -0.222,-0.229 -0.503,-0.163 -0.665,-0.385 -0.363,-0.5 -0.266,-1.24 -0.523,-1.902 -0.468,-0.4 -0.862,-0.905 -1.147,-1.478 -0.588,-1.179 -0.698,-2.681 -1.591,-3.593 -0.28,-0.286 -0.761,-0.365 -1.011,-0.647 -0.238,-0.269 -0.455,-0.665 -0.689,-0.98 -0.338,-0.452 -0.669,-1.045 -0.972,-1.583 -1.004,-1.787 -2.383,-3.71 -3.301,-5.664 -0.173,-0.369 -0.199,-0.805 -0.364,-1.165 -0.381,-0.827 -0.943,-1.579 -1.257,-2.333 -0.516,-1.239 -1.31,-3.339 -2.538,-4.42 -0.149,-0.131 -0.473,-0.254 -0.606,-0.414 -0.179,-0.215 -0.136,-0.568 -0.32,-0.808 -0.086,-0.113 -0.4,-0.164 -0.537,-0.302 -0.208,-0.211 -0.306,-0.481 -0.479,-0.639 -0.426,-0.388 -1.015,-0.555 -1.381,-0.959 -0.277,-0.306 -0.397,-0.743 -0.692,-1.127 -0.318,-0.413 -0.761,-0.784 -1.09,-1.202 -0.994,-1.264 -1.38,-2.8 -2.702,-3.396 -0.393,-0.178 -0.88,-0.12 -1.291,-0.241 -0.374,0.344 -0.078,0.818 -0.163,1.164 -0.055,0.222 -0.285,0.382 -0.346,0.583 -0.143,0.474 -0.347,1.336 -0.34,1.878 0.007,0.538 0.305,0.971 0.375,1.612 0.061,0.549 -0.137,1.246 -0.177,1.856 -0.021,0.306 0.064,0.624 0.059,0.956 -0.008,0.533 -0.066,0.801 0.008,1.442 0.086,0.743 -0.074,1.462 -0.171,2.152 0.342,1.705 0.531,3.008 1.09,4.919 0.258,0.881 0.721,2.367 1.18,3.346 0.886,1.895 1.64,3.964 2.6,5.945 0.319,0.656 0.825,1.196 1.139,1.852 0.182,0.381 0.211,0.828 0.395,1.215 1.617,3.398 3.877,6.233 5.565,9.731 1.399,2.859 2.88,5.418 4.745,8.545 0.842,1.415 1.568,2.917 2.434,4.086 0.66,0.891 1.632,2.413 2.334,3.916 0.278,0.596 0.269,1.073 1.005,1.102 0.758,0.948 1.326,2.018 2.119,2.824 0.2,0.202 0.51,0.303 0.733,0.498 0.26,0.228 0.383,0.57 0.638,0.778 0.541,0.441 1.432,0.832 2.035,1.659 0.16,0.22 0.229,0.451 0.406,0.682 0.414,0.539 1.191,1.866 1.81,2.013 C -0.241,0.085 -0.126,0.061 0,0" /></g></g></g><g
-       id="g54"
-       transform="translate(-21.47687,0)" /><g
-       id="g60"
-       transform="translate(-21.47687,0)"><g
-         style="opacity:0.69999701"
-         id="g62"
-         clip-path="url(#clipPath56)"><g
-           id="g64"
-           transform="translate(459.8965,349.4487)"><path
-             inkscape:connector-curvature="0"
-             id="path66"
-             style="fill:#da687d;fill-opacity:1;fill-rule:evenodd;stroke:none"
-             d="m 0,0 c 0.688,-1.936 0.765,-4.106 0.935,-6.266 -0.019,-2.14 -0.168,-4.579 -0.715,-6.943 0.098,-0.492 -0.155,-1.108 -0.109,-1.623 -0.519,-0.752 -0.295,-1.25 -0.438,-1.876 0.718,-0.835 1.666,-1.609 1.155,-2.836 -0.37,-0.846 -1.118,-1.037 -1.845,-1.479 -0.64,-1.905 -1.226,-4.263 -1.846,-6.305 -0.187,-0.635 -0.212,-1.395 -0.447,-1.977 -0.547,-1.362 -1.111,-2.656 -1.597,-4.101 -0.416,-1.238 -0.356,-3.498 -1.652,-3.689 -0.61,-1.355 -0.978,-2.373 -1.674,-3.651 -0.35,-0.217 -0.512,0.119 -0.801,-0.013 -0.392,-0.456 -0.442,-1.063 -0.795,-1.445 -0.269,-0.298 -0.585,-0.226 -0.785,-0.514 -0.449,-0.651 -0.386,-1.58 -0.723,-2.425 -0.282,-0.266 -0.546,-0.564 -0.784,-0.888 -0.119,-0.162 -0.233,-0.33 -0.337,-0.505 l -0.153,-0.266 -0.072,-0.136 -0.034,-0.069 -0.003,-0.004 0,-10e-4 c 0.099,0.238 0.028,0.066 0.05,0.119 l -10e-4,-0.002 -0.001,-10e-4 -0.004,-0.01 -0.008,-0.019 -0.016,-0.037 c -0.697,-1.635 -0.851,-3.63 -1.895,-4.955 -0.335,-0.421 -0.872,-0.577 -1.142,-0.971 -0.259,-0.375 -0.491,-0.912 -0.746,-1.347 -0.366,-0.625 -0.722,-1.432 -1.046,-2.164 -1.085,-2.456 -2.571,-5.274 -3.572,-8.03 -0.188,-0.523 -0.205,-1.106 -0.385,-1.617 -0.422,-1.173 -1.022,-2.273 -1.394,-3.342 -0.626,-1.753 -1.474,-4.727 -3.01,-6.377 -0.182,-0.2 -0.567,-0.415 -0.732,-0.65 -0.22,-0.315 -0.191,-0.786 -0.42,-1.137 -0.106,-0.164 -0.475,-0.275 -0.642,-0.48 -0.254,-0.313 -0.383,-0.69 -0.594,-0.926 -0.503,-0.581 -1.23,-0.865 -1.714,-1.438 -0.365,-0.435 -0.562,-1.029 -0.958,-1.568 -0.426,-0.578 -0.991,-1.104 -1.428,-1.683 -0.65,-0.928 -1.251,-1.786 -1.828,-2.608 -0.592,-0.813 -1.215,-1.514 -2.047,-1.884 -0.495,-0.219 -1.042,-0.12 -1.539,-0.256 -0.353,0.473 0.086,1.071 0.061,1.524 -0.018,0.288 -0.25,0.504 -0.28,0.766 -0.07,0.615 -0.141,1.712 -0.035,2.387 0.099,0.676 0.548,1.191 0.712,2.005 0.125,0.708 -0.034,1.591 -0.025,2.359 0.004,0.387 0.13,0.791 0.153,1.206 0.038,0.668 -0.008,0.999 0.13,1.795 0.163,0.922 -0.034,1.854 -0.121,2.709 0.426,2.191 0.686,3.806 1.265,6.362 0.273,1.176 0.786,3.104 1.265,4.488 0.472,1.315 0.904,2.681 1.347,4.063 0.445,1.4 0.906,2.841 1.424,4.249 0.347,0.939 0.896,1.734 1.274,2.728 0.213,0.565 0.249,1.192 0.465,1.767 0.475,1.25 0.99,2.514 1.541,3.656 0.553,1.123 1.13,2.228 1.711,3.336 l 0.938,1.807 c 0.326,0.58 0.653,1.161 0.981,1.745 0.649,1.172 1.283,2.367 1.886,3.609 1.027,1.966 2.073,3.828 3.188,5.725 1.116,1.844 2.324,3.757 3.629,5.817 1.158,1.853 2.248,3.825 3.357,5.355 0.827,1.167 2.173,3.163 3.042,5.126 0.342,0.78 0.349,1.38 1.197,1.482 0.907,1.274 1.649,2.697 2.452,3.773 0.214,0.276 0.563,0.445 0.808,0.722 0.286,0.323 0.408,0.762 0.693,1.065 0.582,0.653 1.672,1.277 2.21,2.569 0.151,0.332 0.198,0.653 0.368,1.006 0.397,0.822 1.098,2.779 1.78,3.145 C -0.284,0.044 -0.151,0.044 0,0" /></g></g></g><path
-       inkscape:connector-curvature="0"
-       id="path70"
-       style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 416.68863,327.0015 c 0,0 -8,-30.667 -4.667,-56 0.667,8 4.667,56 4.667,56" /><path
-       inkscape:connector-curvature="0"
-       id="path74"
-       style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 426.18913,347.7256 c -0.61,2.147 -4.597,-59.478 -3.432,-61.636 1.166,-2.159 7.147,48.575 3.432,61.636" /><path
-       inkscape:connector-curvature="0"
-       id="path78"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 235.24913,465.60369 c 0,0 4.667,-26.6198 -38.667,-40.6198 -43.333,-14 -103.0605,-25.98239 -147.0605,-78.64939 -44.0000004,-52.666 -52.0000004,-139.999 -22,-197.333 30,-57.333 103.333,-128.667 235.333,-128.667 132,0 236.85312,101.50582 236.85312,171.50582 0,36.667 -20.1469,28.4918 -27.11433,-5.90828 C 466.30468,154.88286 408.18863,39.0015 262.18863,39.0015 c -146,0 -220.667,88.667 -230,164.667 -9.334,76 11.898969,141.46925 88.56597,180.80225 76.667,39.334 125.32039,23.66435 114.65339,80.99735"
-       sodipodi:nodetypes="cssssssscsc" /><path
-       inkscape:connector-curvature="0"
-       id="path82"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 198.85713,260.335 c 0,0 -8.667,-40.001 -50.667,-59.333 -42,-19.334 -60,-30 -66,-63.334 16,26.666 62.667,32 88.667,58 26,26 28,64.667 28,64.667" /><path
-       inkscape:connector-curvature="0"
-       id="path86"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 210.19013,353.0015 c 0,0 36,-46.667 78.667,-24 42.666,22.667 20.667,75.333 20,78.667 -0.667,3.333 4.666,-58.667 -27.334,-69.334 -32,-10.666 -71.333,14.667 -71.333,14.667" /><path
-       inkscape:connector-curvature="0"
-       id="path90"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 116.18913,74.3359 c 0,0 22.666,-1.334 39.333,17.332 16.667,18.668 7.334,48 34.667,58.668 27.333,10.666 46,4 46,4 0,0 -48.667,-6.668 -52.667,-34.668 -4,-28 -10.666,-40.666 -21.333,-49.332 -10.667,-8.668 -24.667,-10 -24.667,-10 l -21.333,14 z" /><path
-       inkscape:connector-curvature="0"
-       id="path94"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 219.02213,219.502 c 0,0 40.523,6.783 59,48 15.167,33.833 5,63 5,63 l -20.5,-3 c 0,0 8.5,-24.5 2,-46.5 -6.5,-22 -21.5,-47.5 -45.5,-61.5" /><path
-       inkscape:connector-curvature="0"
-       id="path98"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 437.13303,313.1621 c -14.461,-36.13 -35.773,-62.068 -38.265,-60.674 -4.494,2.513 -0.358,34.036 14.104,70.166 14.46,36.13 32.432,63.635 39.104,61.014 6.672,-2.621 -0.483,-34.376 -14.943,-70.506 m 20.999,72.506 c -16.442,8.934 -36.644,-24.449 -53.276,-63.334 -16.633,-38.885 -18.542,-70.229 -5.759,-75.836 17.092,-7.496 33.127,22.285 49.759,61.17 16.632,38.885 24,70 9.276,78" /><path
-       inkscape:connector-curvature="0"
-       id="path102"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 159.52163,189.668 c 0,0 10.331,-31.037 62,-24.666 48.667,6 69.59,24.744 99.333,43.334 21.334,13.332 20,7.332 22.667,6.666 2.667,-0.666 14.667,-8 27.333,-6.666 0.667,-6.668 -5.999,-1.334 -8.666,-7.334 -1.333,-4 10.12,-22.824 26.666,-20 27.334,4.666 19.667,16 25.001,28.666 5.333,12.666 9,19.334 -17.667,37.334 -20.667,18.666 -32,13.999 -42,13.999 -10,0 -36,-13.999 -54,-10.666 -18,3.333 -29.334,10 -29.334,10 l -11.999,-13.333 c 0,0 21.999,-16.666 47.333,-10.666 25.333,6 44.001,25.332 66.001,15.332 22,-10 26.282,-16.701 32.999,-21.666 7.667,-5.668 8.333,-11.666 3,-17 -5.334,-5.334 0.001,-9.334 -3.332,-15.334 -3.334,-6 -20,-8.666 -20,-8.666 0,0 18.273,23.477 -4,25.332 -16,1.334 -26,22.668 -48.667,11.334 -32.55,-16.277 -78.668,-44 -110.668,-47.332 -31.193,-3.248 -42.667,6.666 -50.667,25.332 -9.333,-8 -11.333,-14 -11.333,-14" /><path
-       inkscape:connector-curvature="0"
-       id="path106"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 274.18863,183.002 c 0,0 22.667,-12 16,-38 -6.667,-26 -36.667,-44 -56,-52.668 -19.333,-8.666 -33.743,-20.127 -19.333,-27.332 12,-6 18.667,9.334 36,12 17.333,2.666 32.667,-4 34,-14 -7.334,4 -12.667,4 -12.667,4 0,0 6,-4 6.667,-10.668 0.666,-6.666 -0.667,-3.332 -4.667,-3.332 -10,0 -11.333,8.666 -20,7.332 -22,-2 -23.333,-11.334 -35.333,-12.666 -12,-1.334 -32,5.334 -29.334,20.666 2.667,15.334 23.334,26 42.667,34 19.333,8 48.667,33.334 44.667,56 -4,22.668 -21.334,18 -21.334,18 l 18.667,6.668 z" /><path
-       inkscape:connector-curvature="0"
-       id="path110"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 331.02213,371.7515 c 0,0 9.5,-4.75 15.5,-28.75 4,-8.667 9.333,-15.667 14,-17.667 4.667,-2 -2,-4 -5.333,-3.333 -3.334,0.667 -10.334,3.667 -15,-0.333 -4.667,-4 -16,-14.667 -32,-12 -16,2.666 -29.667,12.833 -29.667,12.833 0,0 6,-26.5 41.667,-24.833 24.721,1.155 19.333,14 36,16.666 16.666,2.667 14.893,11.089 11.333,18 -5.667,11 -23.333,13.667 -25.333,45.834 -2,3.333 -14.5,-0.417 -11.167,-6.417" /><path
-       inkscape:connector-curvature="0"
-       id="path114"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 388.01383,204.4707 c 1.506,-1.477 -11.825,-31.469 -11.825,-31.469 0,0 -2.667,-7.334 -9.814,-4.75 -7.311,2.645 -5.413,7.948 -5.413,7.948 l 17.026,30.837 c 0,0 9.353,-1.906 10.026,-2.566" /><path
-       inkscape:connector-curvature="0"
-       id="path118"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 406.74623,247.168 c -0.667,-2 -3.333,-10 -3.333,-10 l -10.891,8.334 2.891,6.332 11.333,-4.666 z" /><path
-       inkscape:connector-curvature="0"
-       id="path122"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 284.85563,189.002 c -2,-7.334 23.333,-50.002 40.667,-47.334 17.333,2.666 19.999,-2.668 14.666,-6 -5.333,-3.334 -14.666,-4.668 -13.333,-9.334 1.333,-4.666 5,-9.334 -3.667,-8 -8.666,1.334 -26.333,10.668 -37,28.668 -3.333,-10.668 -4.666,-14 -4.666,-14 0,0 34,-35.334 68.666,-20.668 -6,4.668 -22.666,3.334 -8.666,11.334 14,8 24.666,10.666 31.333,-2 3.333,0.666 3.333,30 -40.667,28 -15.333,2 -36,32 -36,47.334 -4,-4 -9.333,-0.666 -11.333,-8" /><path
-       inkscape:connector-curvature="0"
-       id="path126"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 420.44553,336.5015 c 0,0 -8.75,-26.286 -5.104,-48 0.729,6.857 5.104,48 5.104,48" /><path
-       inkscape:connector-curvature="0"
-       id="path130"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 429.40543,352.0503 c -0.444,1.66 -4.07,-45.761 -3.203,-47.435 0.868,-1.673 5.909,37.339 3.203,47.435" /><path
-       inkscape:connector-curvature="0"
-       id="path134"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 312.85513,378.335 c 0,0 37.667,3.333 31,18.333 -20.105,45.239 -58.333,71.667 -129,69 40,16 74.00021,14.00025 106.667,-14 16.33311,-13.99988 23.89324,-31.04069 29.74979,-44.08296 9.34044,-20.80074 6.58914,-22.74696 -3.74979,-28.58304 -12.56847,-7.0946 -34.191,-2.57 -34.667,-0.667"
-       sodipodi:nodetypes="cccsssc" /><path
-       inkscape:connector-curvature="0"
-       id="path138"
-       style="fill:#2d2b2c;fill-opacity:1;fill-rule:nonzero;stroke:none"
-       d="m 316.7084,372.58242 c 0,0 10.36415,-7.13802 18.50215,-1.32602 3.74086,3.84884 6.23323,5.95026 -4.37137,5.51213 l -12.90479,0.52875 c -8.94116,1.82452 -8.7647,-0.93753 -1.22599,-4.71486 z"
-       sodipodi:nodetypes="ccccc" /></g></svg>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.svg.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.svg.xml
deleted file mode 100644
index efb41ae18ec7ba00a12f813f38037712efe2b906..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/logo.svg.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>logo.svg</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>image/svg+xml</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/manual.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/manual.html.html
deleted file mode 100644
index e6d2a70ca46e5c2c29703e53b82a5285e5e281bc..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/manual.html.html
+++ /dev/null
@@ -1,3443 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: User Manual</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="docs.css">
-<script src="activebookmark.js"></script>
-
-<script src="../lib/codemirror.js"></script>
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../addon/runmode/runmode.js"></script>
-<script src="../addon/runmode/colorize.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../mode/css/css.js"></script>
-<script src="../mode/htmlmixed/htmlmixed.js"></script>
-<style>
-  dt { text-indent: -2em; padding-left: 2em; margin-top: 1em; }
-  dd { margin-left: 1.5em; margin-bottom: 1em; }
-  dt {margin-top: 1em;}
-  dd dl, dd dt, dd dd, dd ul { margin-top: 0; margin-bottom: 0; }
-  dt + dt { margin-top: 0; }
-  dt.command { position: relative; }
-  span.keybinding { position: absolute; right: 0; font-size: 80%; color: #555; text-indent: 0; }
-</style>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="logo.png"></a>
-  <ul>
-    <li><a href="../index.html">Home</a></li>
-    <li><a href="#overview" class=active data-default="true">Manual</a></li>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a></li>
-  </ul>
-  <ul>
-    <li><a href="#usage">Basic Usage</a></li>
-    <li><a href="#config">Configuration</a></li>
-    <li><a href="#events">Events</a></li>
-    <li><a href="#keymaps">Key maps</a></li>
-    <li><a href="#commands">Commands</a></li>
-    <li><a href="#styling">Customized Styling</a></li>
-    <li><a href="#api">Programming API</a>
-      <ul>
-        <li><a href="#api_constructor">Constructor</a></li>
-        <li><a href="#api_content">Content manipulation</a></li>
-        <li><a href="#api_selection">Selection</a></li>
-        <li><a href="#api_configuration">Configuration</a></li>
-        <li><a href="#api_doc">Document management</a></li>
-        <li><a href="#api_history">History</a></li>
-        <li><a href="#api_marker">Text-marking</a></li>
-        <li><a href="#api_decoration">Widget, gutter, and decoration</a></li>
-        <li><a href="#api_sizing">Sizing, scrolling, and positioning</a></li>
-        <li><a href="#api_mode">Mode, state, and tokens</a></li>
-        <li><a href="#api_misc">Miscellaneous methods</a></li>
-        <li><a href="#api_static">Static properties</a></li>
-      </ul>
-    </li>
-    <li><a href="#addons">Addons</a></li>
-    <li><a href="#modeapi">Writing CodeMirror Modes</a></li>
-    <li><a href="#vimapi">Vim Mode API</a>
-      <ul>
-        <li><a href="#vimapi_configuration">Configuration</a></li>
-        <li><a href="#vimapi_extending">Extending VIM</a></li>
-      </ul>
-    </li>
-  </ul>
-</div>
-
-<article>
-
-<section class=first id=overview>
-    <h2 style="position: relative">
-      User manual and reference guide
-      <span style="color: #888; font-size: 1rem; position: absolute; right: 0; bottom: 0">version 5.24.2</span>
-    </h2>
-
-    <p>CodeMirror is a code-editor component that can be embedded in
-    Web pages. The core library provides <em>only</em> the editor
-    component, no accompanying buttons, auto-completion, or other IDE
-    functionality. It does provide a rich API on top of which such
-    functionality can be straightforwardly implemented. See
-    the <a href="#addons">addons</a> included in the distribution,
-    and the <a href="https://github.com/codemirror/CodeMirror/wiki/CodeMirror-addons">list
-    of externally hosted addons</a>, for reusable
-    implementations of extra features.</p>
-
-    <p>CodeMirror works with language-specific modes. Modes are
-    JavaScript programs that help color (and optionally indent) text
-    written in a given language. The distribution comes with a number
-    of modes (see the <a href="../mode/"><code>mode/</code></a>
-    directory), and it isn't hard to <a href="#modeapi">write new
-    ones</a> for other languages.</p>
-</section>
-
-<section id=usage>
-    <h2>Basic Usage</h2>
-
-    <p>The easiest way to use CodeMirror is to simply load the script
-    and style sheet found under <code>lib/</code> in the distribution,
-    plus a mode script from one of the <code>mode/</code> directories.
-    For example:</p>
-
-    <pre data-lang="text/html">&lt;script src="lib/codemirror.js">&lt;/script>
-&lt;link rel="stylesheet" href="lib/codemirror.css">
-&lt;script src="mode/javascript/javascript.js">&lt;/script></pre>
-
-    <p>(Alternatively, use a module loader. <a href="#modloader">More
-    about that later.</a>)</p>
-
-    <p>Having done this, an editor instance can be created like
-    this:</p>
-
-    <pre data-lang="javascript">var myCodeMirror = CodeMirror(document.body);</pre>
-
-    <p>The editor will be appended to the document body, will start
-    empty, and will use the mode that we loaded. To have more control
-    over the new editor, a configuration object can be passed
-    to <a href="#CodeMirror"><code>CodeMirror</code></a> as a second
-    argument:</p>
-
-    <pre data-lang="javascript">var myCodeMirror = CodeMirror(document.body, {
-  value: "function myScript(){return 100;}\n",
-  mode:  "javascript"
-});</pre>
-
-    <p>This will initialize the editor with a piece of code already in
-    it, and explicitly tell it to use the JavaScript mode (which is
-    useful when multiple modes are loaded).
-    See <a href="#config">below</a> for a full discussion of the
-    configuration options that CodeMirror accepts.</p>
-
-    <p>In cases where you don't want to append the editor to an
-    element, and need more control over the way it is inserted, the
-    first argument to the <code>CodeMirror</code> function can also
-    be a function that, when given a DOM element, inserts it into the
-    document somewhere. This could be used to, for example, replace a
-    textarea with a real editor:</p>
-
-    <pre data-lang="javascript">var myCodeMirror = CodeMirror(function(elt) {
-  myTextArea.parentNode.replaceChild(elt, myTextArea);
-}, {value: myTextArea.value});</pre>
-
-    <p>However, for this use case, which is a common way to use
-    CodeMirror, the library provides a much more powerful
-    shortcut:</p>
-
-    <pre data-lang="javascript">var myCodeMirror = CodeMirror.fromTextArea(myTextArea);</pre>
-
-    <p>This will, among other things, ensure that the textarea's value
-    is updated with the editor's contents when the form (if it is part
-    of a form) is submitted. See the <a href="#fromTextArea">API
-    reference</a> for a full description of this method.</p>
-
-    <h3 id=modloader>Module loaders</h3>
-
-    <p>The files in the CodeMirror distribution contain shims for
-    loading them (and their dependencies) in AMD or CommonJS
-    environments. If the variables <code>exports</code>
-    and <code>module</code> exist and have type object, CommonJS-style
-    require will be used. If not, but there is a
-    function <code>define</code> with an <code>amd</code> property
-    present, AMD-style (RequireJS) will be used.</p>
-
-    <p>It is possible to
-    use <a href="http://browserify.org/">Browserify</a> or similar
-    tools to statically build modules using CodeMirror. Alternatively,
-    use <a href="http://requirejs.org/">RequireJS</a> to dynamically
-    load dependencies at runtime. Both of these approaches have the
-    advantage that they don't use the global namespace and can, thus,
-    do things like load multiple versions of CodeMirror alongside each
-    other.</p>
-
-    <p>Here's a simple example of using RequireJS to load CodeMirror:</p>
-
-    <pre data-lang="javascript">require([
-  "cm/lib/codemirror", "cm/mode/htmlmixed/htmlmixed"
-], function(CodeMirror) {
-  CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    mode: "htmlmixed"
-  });
-});</pre>
-
-    <p>It will automatically load the modes that the mixed HTML mode
-    depends on (XML, JavaScript, and CSS). Do <em>not</em> use
-    RequireJS' <code>paths</code> option to configure the path to
-    CodeMirror, since it will break loading submodules through
-    relative paths. Use
-    the <a href="http://requirejs.org/docs/api.html#packages"><code>packages</code></a>
-    configuration option instead, as in:</p>
-
-    <pre data-lang=javascript>require.config({
-  packages: [{
-    name: "codemirror",
-    location: "../path/to/codemirror",
-    main: "lib/codemirror"
-  }]
-});</pre>
-
-</section>
-
-<section id=config>
-    <h2>Configuration</h2>
-
-    <p>Both the <a href="#CodeMirror"><code>CodeMirror</code></a>
-    function and its <code>fromTextArea</code> method take as second
-    (optional) argument an object containing configuration options.
-    Any option not supplied like this will be taken
-    from <a href="#defaults"><code>CodeMirror.defaults</code></a>, an
-    object containing the default options. You can update this object
-    to change the defaults on your page.</p>
-
-    <p>Options are not checked in any way, so setting bogus option
-    values is bound to lead to odd errors.</p>
-
-    <p>These are the supported options:</p>
-
-    <dl>
-      <dt id="option_value"><code><strong>value</strong>: string|CodeMirror.Doc</code></dt>
-      <dd>The starting value of the editor. Can be a string, or
-      a <a href="#api_doc">document object</a>.</dd>
-
-      <dt id="option_mode"><code><strong>mode</strong>: string|object</code></dt>
-      <dd>The mode to use. When not given, this will default to the
-      first mode that was loaded. It may be a string, which either
-      simply names the mode or is
-      a <a href="http://en.wikipedia.org/wiki/MIME">MIME</a> type
-      associated with the mode. Alternatively, it may be an object
-      containing configuration options for the mode, with
-      a <code>name</code> property that names the mode (for
-      example <code>{name: "javascript", json: true}</code>). The demo
-      pages for each mode contain information about what configuration
-      parameters the mode supports. You can ask CodeMirror which modes
-      and MIME types have been defined by inspecting
-      the <code>CodeMirror.modes</code>
-      and <code>CodeMirror.mimeModes</code> objects. The first maps
-      mode names to their constructors, and the second maps MIME types
-      to mode specs.</dd>
-
-      <dt id="option_lineSeparator"><code><strong>lineSeparator</strong>: string|null</code></dt>
-      <dd>Explicitly set the line separator for the editor. By default
-      (value <code>null</code>), the document will be split on CRLFs
-      as well as lone CRs and LFs, and a single LF will be used as
-      line separator in all output (such
-      as <a href="#getValue"><code>getValue</code></a>). When a
-      specific string is given, lines will only be split on that
-      string, and output will, by default, use that same
-      separator.</dd>
-
-      <dt id="option_theme"><code><strong>theme</strong>: string</code></dt>
-      <dd>The theme to style the editor with. You must make sure the
-      CSS file defining the corresponding <code>.cm-s-[name]</code>
-      styles is loaded (see
-      the <a href="../theme/"><code>theme</code></a> directory in the
-      distribution). The default is <code>"default"</code>, for which
-      colors are included in <code>codemirror.css</code>. It is
-      possible to use multiple theming classes at once鈥攆or
-      example <code>"foo bar"</code> will assign both
-      the <code>cm-s-foo</code> and the <code>cm-s-bar</code> classes
-      to the editor.</dd>
-
-      <dt id="option_indentUnit"><code><strong>indentUnit</strong>: integer</code></dt>
-      <dd>How many spaces a block (whatever that means in the edited
-      language) should be indented. The default is 2.</dd>
-
-      <dt id="option_smartIndent"><code><strong>smartIndent</strong>: boolean</code></dt>
-      <dd>Whether to use the context-sensitive indentation that the
-      mode provides (or just indent the same as the line before).
-      Defaults to true.</dd>
-
-      <dt id="option_tabSize"><code><strong>tabSize</strong>: integer</code></dt>
-      <dd>The width of a tab character. Defaults to 4.</dd>
-
-      <dt id="option_indentWithTabs"><code><strong>indentWithTabs</strong>: boolean</code></dt>
-      <dd>Whether, when indenting, the first N*<code>tabSize</code>
-      spaces should be replaced by N tabs. Default is false.</dd>
-
-      <dt id="option_electricChars"><code><strong>electricChars</strong>: boolean</code></dt>
-      <dd>Configures whether the editor should re-indent the current
-      line when a character is typed that might change its proper
-      indentation (only works if the mode supports indentation).
-      Default is true.</dd>
-
-      <dt id="option_specialChars"><code><strong>specialChars</strong>: RegExp</code></dt>
-      <dd>A regular expression used to determine which characters
-      should be replaced by a
-      special <a href="#option_specialCharPlaceholder">placeholder</a>.
-      Mostly useful for non-printing special characters. The default
-      is <code>/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/</code>.</dd>
-      <dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char)聽鈫捖燛lement</code></dt>
-      <dd>A function that, given a special character identified by
-      the <a href="#option_specialChars"><code>specialChars</code></a>
-      option, produces a DOM node that is used to represent the
-      character. By default, a red dot (<span style="color: red">鈥�</span>)
-      is shown, with a title tooltip to indicate the character code.</dd>
-
-      <dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt>
-      <dd>Determines whether horizontal cursor movement through
-      right-to-left (Arabic, Hebrew) text is visual (pressing the left
-      arrow moves the cursor left) or logical (pressing the left arrow
-      moves to the next lower index in the string, which is visually
-      right in right-to-left text). The default is <code>false</code>
-      on Windows, and <code>true</code> on other platforms.</dd>
-
-      <dt id="option_keyMap"><code><strong>keyMap</strong>: string</code></dt>
-      <dd>Configures the key map to use. The default
-      is <code>"default"</code>, which is the only key map defined
-      in <code>codemirror.js</code> itself. Extra key maps are found in
-      the <a href="../keymap/"><code>key map</code></a> directory. See
-      the <a href="#keymaps">section on key maps</a> for more
-      information.</dd>
-
-      <dt id="option_extraKeys"><code><strong>extraKeys</strong>: object</code></dt>
-      <dd>Can be used to specify extra key bindings for the editor,
-      alongside the ones defined
-      by <a href="#option_keyMap"><code>keyMap</code></a>. Should be
-      either null, or a valid <a href="#keymaps">key map</a> value.</dd>
-
-      <dt id="option_lineWrapping"><code><strong>lineWrapping</strong>: boolean</code></dt>
-      <dd>Whether CodeMirror should scroll or wrap for long lines.
-      Defaults to <code>false</code> (scroll).</dd>
-
-      <dt id="option_lineNumbers"><code><strong>lineNumbers</strong>: boolean</code></dt>
-      <dd>Whether to show line numbers to the left of the editor.</dd>
-
-      <dt id="option_firstLineNumber"><code><strong>firstLineNumber</strong>: integer</code></dt>
-      <dd>At which number to start counting lines. Default is 1.</dd>
-
-      <dt id="option_lineNumberFormatter"><code><strong>lineNumberFormatter</strong>: function(line: integer) 鈫� string</code></dt>
-      <dd>A function used to format line numbers. The function is
-      passed the line number, and should return a string that will be
-      shown in the gutter.</dd>
-
-      <dt id="option_gutters"><code><strong>gutters</strong>: array&lt;string&gt;</code></dt>
-      <dd>Can be used to add extra gutters (beyond or instead of the
-      line number gutter). Should be an array of CSS class names, each
-      of which defines a <code>width</code> (and optionally a
-      background), and which will be used to draw the background of
-      the gutters. <em>May</em> include
-      the <code>CodeMirror-linenumbers</code> class, in order to
-      explicitly set the position of the line number gutter (it will
-      default to be to the right of all other gutters). These class
-      names are the keys passed
-      to <a href="#setGutterMarker"><code>setGutterMarker</code></a>.</dd>
-
-      <dt id="option_fixedGutter"><code><strong>fixedGutter</strong>: boolean</code></dt>
-      <dd>Determines whether the gutter scrolls along with the content
-      horizontally (false) or whether it stays fixed during horizontal
-      scrolling (true, the default).</dd>
-
-      <dt id="option_scrollbarStyle"><code><strong>scrollbarStyle</strong>: string</code></dt>
-      <dd>Chooses a scrollbar implementation. The default
-      is <code>"native"</code>, showing native scrollbars. The core
-      library also provides the <code>"null"</code> style, which
-      completely hides the
-      scrollbars. <a href="#addon_simplescrollbars">Addons</a> can
-      implement additional scrollbar models.</dd>
-
-      <dt id="option_coverGutterNextToScrollbar"><code><strong>coverGutterNextToScrollbar</strong>: boolean</code></dt>
-      <dd>When <a href="#option_fixedGutter"><code>fixedGutter</code></a>
-      is on, and there is a horizontal scrollbar, by default the
-      gutter will be visible to the left of this scrollbar. If this
-      option is set to true, it will be covered by an element with
-      class <code>CodeMirror-gutter-filler</code>.</dd>
-
-      <dt id="option_inputStyle"><code><strong>inputStyle</strong>: string</code></dt>
-      <dd>Selects the way CodeMirror handles input and focus. The core
-      library defines the <code>"textarea"</code>
-      and <code>"contenteditable"</code> input models. On mobile
-      browsers, the default is <code>"contenteditable"</code>. On
-      desktop browsers, the default is <code>"textarea"</code>.
-      Support for IME and screen readers is better in
-      the <code>"contenteditable"</code> model. The intention is to
-      make it the default on modern desktop browsers in the
-      future.</dd>
-
-      <dt id="option_readOnly"><code><strong>readOnly</strong>: boolean|string</code></dt>
-      <dd>This disables editing of the editor content by the user. If
-      the special value <code>"nocursor"</code> is given (instead of
-      simply <code>true</code>), focusing of the editor is also
-      disallowed.</dd>
-
-      <dt id="option_showCursorWhenSelecting"><code><strong>showCursorWhenSelecting</strong>: boolean</code></dt>
-      <dd>Whether the cursor should be drawn when a selection is
-      active. Defaults to false.</dd>
-
-      <dt id="option_lineWiseCopyCut"><code><strong>lineWiseCopyCut</strong>: boolean</code></dt>
-      <dd>When enabled, which is the default, doing copy or cut when
-      there is no selection will copy or cut the whole lines that have
-      cursors on them.</dd>
-
-      <dt id="option_undoDepth"><code><strong>undoDepth</strong>: integer</code></dt>
-      <dd>The maximum number of undo levels that the editor stores.
-      Note that this includes selection change events. Defaults to
-      200.</dd>
-
-      <dt id="option_historyEventDelay"><code><strong>historyEventDelay</strong>: integer</code></dt>
-      <dd>The period of inactivity (in milliseconds) that will cause a
-      new history event to be started when typing or deleting.
-      Defaults to 1250.</dd>
-
-      <dt id="option_tabindex"><code><strong>tabindex</strong>: integer</code></dt>
-      <dd>The <a href="http://www.w3.org/TR/html401/interact/forms.html#adef-tabindex">tab
-      index</a> to assign to the editor. If not given, no tab index
-      will be assigned.</dd>
-
-      <dt id="option_autofocus"><code><strong>autofocus</strong>: boolean</code></dt>
-      <dd>Can be used to make CodeMirror focus itself on
-      initialization. Defaults to off.
-      When <a href="#fromTextArea"><code>fromTextArea</code></a> is
-      used, and no explicit value is given for this option, it will be
-      set to true when either the source textarea is focused, or it
-      has an <code>autofocus</code> attribute and no other element is
-      focused.</dd>
-    </dl>
-
-    <p>Below this a few more specialized, low-level options are
-    listed. These are only useful in very specific situations, you
-    might want to skip them the first time you read this manual.</p>
-
-    <dl>
-      <dt id="option_dragDrop"><code><strong>dragDrop</strong>: boolean</code></dt>
-      <dd>Controls whether drag-and-drop is enabled. On by default.</dd>
-
-      <dt id="option_allowDropFileTypes"><code><strong>allowDropFileTypes</strong>: array&lt;string&gt;</code></dt>
-      <dd>When set (default is <code>null</code>) only files whose
-      type is in the array can be dropped into the editor. The strings
-      should be MIME types, and will be checked against
-      the <a href="https://w3c.github.io/FileAPI/#dfn-type"><code>type</code></a>
-      of the <code>File</code> object as reported by the browser.</dd>
-
-      <dt id="option_cursorBlinkRate"><code><strong>cursorBlinkRate</strong>: number</code></dt>
-      <dd>Half-period in milliseconds used for cursor blinking. The default blink
-      rate is 530ms. By setting this to zero, blinking can be disabled. A
-      negative value hides the cursor entirely.</dd>
-
-      <dt id="option_cursorScrollMargin"><code><strong>cursorScrollMargin</strong>: number</code></dt>
-      <dd>How much extra space to always keep above and below the
-      cursor when approaching the top or bottom of the visible view in
-      a scrollable document. Default is 0.</dd>
-
-      <dt id="option_cursorHeight"><code><strong>cursorHeight</strong>: number</code></dt>
-      <dd>Determines the height of the cursor. Default is 1, meaning
-      it spans the whole height of the line. For some fonts (and by
-      some tastes) a smaller height (for example <code>0.85</code>),
-      which causes the cursor to not reach all the way to the bottom
-      of the line, looks better</dd>
-
-      <dt id="option_resetSelectionOnContextMenu"><code><strong>resetSelectionOnContextMenu</strong>: boolean</code></dt>
-      <dd>Controls whether, when the context menu is opened with a
-      click outside of the current selection, the cursor is moved to
-      the point of the click. Defaults to <code>true</code>.</dd>
-
-      <dt id="option_workTime"><code id="option_wordkDelay"><strong>workTime</strong>, <strong>workDelay</strong>: number</code></dt>
-      <dd>Highlighting is done by a pseudo background-thread that will
-      work for <code>workTime</code> milliseconds, and then use
-      timeout to sleep for <code>workDelay</code> milliseconds. The
-      defaults are 200 and 300, you can change these options to make
-      the highlighting more or less aggressive.</dd>
-
-      <dt id="option_pollInterval"><code><strong>pollInterval</strong>: number</code></dt>
-      <dd>Indicates how quickly CodeMirror should poll its input
-      textarea for changes (when focused). Most input is captured by
-      events, but some things, like IME input on some browsers, don't
-      generate events that allow CodeMirror to properly detect it.
-      Thus, it polls. Default is 100 milliseconds.</dd>
-
-      <dt id="option_flattenSpans"><code><strong>flattenSpans</strong>: boolean</code></dt>
-      <dd>By default, CodeMirror will combine adjacent tokens into a
-      single span if they have the same class. This will result in a
-      simpler DOM tree, and thus perform better. With some kinds of
-      styling (such as rounded corners), this will change the way the
-      document looks. You can set this option to false to disable this
-      behavior.</dd>
-
-      <dt id="option_addModeClass"><code><strong>addModeClass</strong>: boolean</code></dt>
-      <dd>When enabled (off by default), an extra CSS class will be
-      added to each token, indicating the
-      (<a href="#innerMode">inner</a>) mode that produced it, prefixed
-      with <code>"cm-m-"</code>. For example, tokens from the XML mode
-      will get the <code>cm-m-xml</code> class.</dd>
-
-      <dt id="option_maxHighlightLength"><code><strong>maxHighlightLength</strong>: number</code></dt>
-      <dd>When highlighting long lines, in order to stay responsive,
-      the editor will give up and simply style the rest of the line as
-      plain text when it reaches a certain position. The default is
-      10 000. You can set this to <code>Infinity</code> to turn off
-      this behavior.</dd>
-
-      <dt id="option_viewportMargin"><code><strong>viewportMargin</strong>: integer</code></dt>
-      <dd>Specifies the amount of lines that are rendered above and
-      below the part of the document that's currently scrolled into
-      view. This affects the amount of updates needed when scrolling,
-      and the amount of work that such an update does. You should
-      usually leave it at its default, 10. Can be set
-      to <code>Infinity</code> to make sure the whole document is
-      always rendered, and thus the browser's text search works on it.
-      This <em>will</em> have bad effects on performance of big
-      documents.</dd>
-    </dl>
-</section>
-
-<section id=events>
-    <h2>Events</h2>
-
-    <p>Various CodeMirror-related objects emit events, which allow
-    client code to react to various situations. Handlers for such
-    events can be registered with the <a href="#on"><code>on</code></a>
-    and <a href="#off"><code>off</code></a> methods on the objects
-    that the event fires on. To fire your own events,
-    use <code>CodeMirror.signal(target, name, args...)</code>,
-    where <code>target</code> is a non-DOM-node object.</p>
-
-    <p>An editor instance fires the following events.
-    The <code>instance</code> argument always refers to the editor
-    itself.</p>
-
-    <dl>
-      <dt id="event_change"><code><strong>"change"</strong> (instance: CodeMirror, changeObj: object)</code></dt>
-      <dd>Fires every time the content of the editor is changed.
-      The <code>changeObj</code> is a <code>{from, to, text, removed,
-      origin}</code> object containing information about the changes
-      that occurred as second argument. <code>from</code>
-      and <code>to</code> are the positions (in the pre-change
-      coordinate system) where the change started and ended (for
-      example, it might be <code>{ch:0, line:18}</code> if the
-      position is at the beginning of line #19). <code>text</code> is
-      an array of strings representing the text that replaced the
-      changed range (split by line). <code>removed</code> is the text
-      that used to be between <code>from</code> and <code>to</code>,
-      which is overwritten by this change. This event is
-      fired <em>before</em> the end of
-      an <a href="#operation">operation</a>, before the DOM updates
-      happen.</dd>
-
-      <dt id="event_changes"><code><strong>"changes"</strong> (instance: CodeMirror, changes: array&lt;object&gt;)</code></dt>
-      <dd>Like the <a href="#event_change"><code>"change"</code></a>
-      event, but batched per <a href="#operation">operation</a>,
-      passing an array containing all the changes that happened in the
-      operation. This event is fired after the operation finished, and
-      display changes it makes will trigger a new operation.</dd>
-
-      <dt id="event_beforeChange"><code><strong>"beforeChange"</strong> (instance: CodeMirror, changeObj: object)</code></dt>
-      <dd>This event is fired before a change is applied, and its
-      handler may choose to modify or cancel the change.
-      The <code>changeObj</code> object
-      has <code>from</code>, <code>to</code>, and <code>text</code>
-      properties, as with
-      the <a href="#event_change"><code>"change"</code></a> event. It
-      also has a <code>cancel()</code> method, which can be called to
-      cancel the change, and, <strong>if</strong> the change isn't
-      coming from an undo or redo event, an <code>update(from, to,
-      text)</code> method, which may be used to modify the change.
-      Undo or redo changes can't be modified, because they hold some
-      metainformation for restoring old marked ranges that is only
-      valid for that specific change. All three arguments
-      to <code>update</code> are optional, and can be left off to
-      leave the existing value for that field
-      intact. <strong>Note:</strong> you may not do anything from
-      a <code>"beforeChange"</code> handler that would cause changes
-      to the document or its visualization. Doing so will, since this
-      handler is called directly from the bowels of the CodeMirror
-      implementation, probably cause the editor to become
-      corrupted.</dd>
-
-      <dt id="event_cursorActivity"><code><strong>"cursorActivity"</strong> (instance: CodeMirror)</code></dt>
-      <dd>Will be fired when the cursor or selection moves, or any
-      change is made to the editor content.</dd>
-
-      <dt id="event_keyHandled"><code><strong>"keyHandled"</strong> (instance: CodeMirror, name: string, event: Event)</code></dt>
-      <dd>Fired after a key is handled through a
-      key map. <code>name</code> is the name of the handled key (for
-      example <code>"Ctrl-X"</code> or <code>"'q'"</code>),
-      and <code>event</code> is the DOM <code>keydown</code>
-      or <code>keypress</code> event.</dd>
-
-      <dt id="event_inputRead"><code><strong>"inputRead"</strong> (instance: CodeMirror, changeObj: object)</code></dt>
-      <dd>Fired whenever new input is read from the hidden textarea
-      (typed or pasted by the user).</dd>
-
-      <dt id="event_electricInput"><code><strong>"electricInput"</strong> (instance: CodeMirror, line: integer)</code></dt>
-      <dd>Fired if text input matched the
-      mode's <a href="#option_electricChars">electric</a> patterns,
-      and this caused the line's indentation to change.</dd>
-
-      <dt id="event_beforeSelectionChange"><code><strong>"beforeSelectionChange"</strong> (instance: CodeMirror, obj: {ranges, origin, update})</code></dt>
-      <dd>This event is fired before the selection is moved. Its
-      handler may inspect the set of selection ranges, present as an
-      array of <code>{anchor, head}</code> objects in
-      the <code>ranges</code> property of the <code>obj</code>
-      argument, and optionally change them by calling
-      the <code>update</code> method on this object, passing an array
-      of ranges in the same format. The object also contains
-      an <code>origin</code> property holding the origin string passed
-      to the selection-changing method, if any. Handlers for this
-      event have the same restriction
-      as <a href="#event_beforeChange"><code>"beforeChange"</code></a>
-      handlers 鈥� they should not do anything to directly update the
-      state of the editor.</dd>
-
-      <dt id="event_viewportChange"><code><strong>"viewportChange"</strong> (instance: CodeMirror, from: number, to: number)</code></dt>
-      <dd>Fires whenever the <a href="#getViewport">view port</a> of
-      the editor changes (due to scrolling, editing, or any other
-      factor). The <code>from</code> and <code>to</code> arguments
-      give the new start and end of the viewport.</dd>
-
-      <dt id="event_swapDoc"><code><strong>"swapDoc"</strong> (instance: CodeMirror, oldDoc: Doc)</code></dt>
-      <dd>This is signalled when the editor's document is replaced
-      using the <a href="#swapDoc"><code>swapDoc</code></a>
-      method.</dd>
-
-      <dt id="event_gutterClick"><code><strong>"gutterClick"</strong> (instance: CodeMirror, line: integer, gutter: string, clickEvent: Event)</code></dt>
-      <dd>Fires when the editor gutter (the line-number area) is
-      clicked. Will pass the editor instance as first argument, the
-      (zero-based) number of the line that was clicked as second
-      argument, the CSS class of the gutter that was clicked as third
-      argument, and the raw <code>mousedown</code> event object as
-      fourth argument.</dd>
-
-      <dt id="event_gutterContextMenu"><code><strong>"gutterContextMenu"</strong> (instance: CodeMirror, line: integer, gutter: string, contextMenu: Event: Event)</code></dt>
-      <dd>Fires when the editor gutter (the line-number area)
-      receives a <code>contextmenu</code> event. Will pass the editor
-      instance as first argument, the (zero-based) number of the line
-      that was clicked as second argument, the CSS class of the
-      gutter that was clicked as third argument, and the raw
-      <code>contextmenu</code> mouse event object as fourth argument.
-      You can <code>preventDefault</code> the event, to signal that
-      CodeMirror should do no further handling.</dd>
-
-      <dt id="event_focus"><code><strong>"focus"</strong> (instance: CodeMirror, event: Event)</code></dt>
-      <dd>Fires whenever the editor is focused.</dd>
-
-      <dt id="event_blur"><code><strong>"blur"</strong> (instance: CodeMirror, event: Event)</code></dt>
-      <dd>Fires whenever the editor is unfocused.</dd>
-
-      <dt id="event_scroll"><code><strong>"scroll"</strong> (instance: CodeMirror)</code></dt>
-      <dd>Fires when the editor is scrolled.</dd>
-
-      <dt id="event_refresh"><code><strong>"refresh"</strong> (instance: CodeMirror)</code></dt>
-      <dd>Fires when the editor is <a href="#refresh">refreshed</a>
-      or <a href="#setSize">resized</a>. Mostly useful to invalidate
-      cached values that depend on the editor or character size.</dd>
-
-      <dt id="event_optionChange"><code><strong>"optionChange"</strong> (instance: CodeMirror, option: string)</code></dt>
-      <dd>Dispatched every time an option is changed with <a href="#setOption"><code>setOption</code></a>.</dd>
-
-      <dt id="event_scrollCursorIntoView"><code><strong>"scrollCursorIntoView"</strong> (instance: CodeMirror, event: Event)</code></dt>
-      <dd>Fires when the editor tries to scroll its cursor into view.
-      Can be hooked into to take care of additional scrollable
-      containers around the editor. When the event object has
-      its <code>preventDefault</code> method called, CodeMirror will
-      not itself try to scroll the window.</dd>
-
-      <dt id="event_update"><code><strong>"update"</strong> (instance: CodeMirror)</code></dt>
-      <dd>Will be fired whenever CodeMirror updates its DOM display.</dd>
-
-      <dt id="event_renderLine"><code><strong>"renderLine"</strong> (instance: CodeMirror, line: LineHandle, element: Element)</code></dt>
-      <dd>Fired whenever a line is (re-)rendered to the DOM. Fired
-      right after the DOM element is built, <em>before</em> it is
-      added to the document. The handler may mess with the style of
-      the resulting element, or add event handlers, but
-      should <em>not</em> try to change the state of the editor.</dd>
-
-      <dt id="event_dom"><code><strong>"mousedown"</strong>,
-      <strong>"dblclick"</strong>, <strong>"touchstart"</strong>, <strong>"contextmenu"</strong>,
-      <strong>"keydown"</strong>, <strong>"keypress"</strong>,
-      <strong>"keyup"</strong>, <strong>"cut"</strong>, <strong>"copy"</strong>, <strong>"paste"</strong>,
-      <strong>"dragstart"</strong>, <strong>"dragenter"</strong>,
-      <strong>"dragover"</strong>, <strong>"dragleave"</strong>,
-      <strong>"drop"</strong>
-      (instance: CodeMirror, event: Event)</code></dt>
-      <dd>Fired when CodeMirror is handling a DOM event of this type.
-      You can <code>preventDefault</code> the event, or give it a
-      truthy <code>codemirrorIgnore</code> property, to signal that
-      CodeMirror should do no further handling.</dd>
-    </dl>
-
-    <p>Document objects (instances
-    of <a href="#Doc"><code>CodeMirror.Doc</code></a>) emit the
-    following events:</p>
-
-    <dl>
-      <dt id="event_doc_change"><code><strong>"change"</strong> (doc: CodeMirror.Doc, changeObj: object)</code></dt>
-      <dd>Fired whenever a change occurs to the
-      document. <code>changeObj</code> has a similar type as the
-      object passed to the
-      editor's <a href="#event_change"><code>"change"</code></a>
-      event.</dd>
-
-      <dt id="event_doc_beforeChange"><code><strong>"beforeChange"</strong> (doc: CodeMirror.Doc, change: object)</code></dt>
-      <dd>See the <a href="#event_beforeChange">description of the
-      same event</a> on editor instances.</dd>
-
-      <dt id="event_doc_cursorActivity"><code><strong>"cursorActivity"</strong> (doc: CodeMirror.Doc)</code></dt>
-      <dd>Fired whenever the cursor or selection in this document
-      changes.</dd>
-
-      <dt id="event_doc_beforeSelectionChange"><code><strong>"beforeSelectionChange"</strong> (doc: CodeMirror.Doc, selection: {head, anchor})</code></dt>
-      <dd>Equivalent to
-      the <a href="#event_beforeSelectionChange">event by the same
-      name</a> as fired on editor instances.</dd>
-    </dl>
-
-    <p>Line handles (as returned by, for
-    example, <a href="#getLineHandle"><code>getLineHandle</code></a>)
-    support these events:</p>
-
-    <dl>
-      <dt id="event_delete"><code><strong>"delete"</strong> ()</code></dt>
-      <dd>Will be fired when the line object is deleted. A line object
-      is associated with the <em>start</em> of the line. Mostly useful
-      when you need to find out when your <a href="#setGutterMarker">gutter
-      markers</a> on a given line are removed.</dd>
-      <dt id="event_line_change"><code><strong>"change"</strong> (line: LineHandle, changeObj: object)</code></dt>
-      <dd>Fires when the line's text content is changed in any way
-      (but the line is not deleted outright). The <code>change</code>
-      object is similar to the one passed
-      to <a href="#event_change">change event</a> on the editor
-      object.</dd>
-    </dl>
-
-    <p>Marked range handles (<code>CodeMirror.TextMarker</code>), as returned
-    by <a href="#markText"><code>markText</code></a>
-    and <a href="#setBookmark"><code>setBookmark</code></a>, emit the
-    following events:</p>
-
-    <dl>
-      <dt id="event_beforeCursorEnter"><code><strong>"beforeCursorEnter"</strong> ()</code></dt>
-      <dd>Fired when the cursor enters the marked range. From this
-      event handler, the editor state may be inspected
-      but <em>not</em> modified, with the exception that the range on
-      which the event fires may be cleared.</dd>
-      <dt id="event_clear"><code><strong>"clear"</strong> (from: {line, ch}, to: {line, ch})</code></dt>
-      <dd>Fired when the range is cleared, either through cursor
-      movement in combination
-      with <a href="#mark_clearOnEnter"><code>clearOnEnter</code></a>
-      or through a call to its <code>clear()</code> method. Will only
-      be fired once per handle. Note that deleting the range through
-      text editing does not fire this event, because an undo action
-      might bring the range back into existence. <code>from</code>
-      and <code>to</code> give the part of the document that the range
-      spanned when it was cleared.</dd>
-      <dt id="event_hide"><code><strong>"hide"</strong> ()</code></dt>
-      <dd>Fired when the last part of the marker is removed from the
-      document by editing operations.</dd>
-      <dt id="event_unhide"><code><strong>"unhide"</strong> ()</code></dt>
-      <dd>Fired when, after the marker was removed by editing, a undo
-      operation brought the marker back.</dd>
-    </dl>
-
-    <p>Line widgets (<code>CodeMirror.LineWidget</code>), returned
-    by <a href="#addLineWidget"><code>addLineWidget</code></a>, fire
-    these events:</p>
-
-    <dl>
-      <dt id="event_redraw"><code><strong>"redraw"</strong> ()</code></dt>
-      <dd>Fired whenever the editor re-adds the widget to the DOM.
-      This will happen once right after the widget is added (if it is
-      scrolled into view), and then again whenever it is scrolled out
-      of view and back in again, or when changes to the editor options
-      or the line the widget is on require the widget to be
-      redrawn.</dd>
-    </dl>
-</section>
-
-<section id=keymaps>
-    <h2>Key Maps</h2>
-
-    <p>Key maps are ways to associate keys with functionality. A key map
-    is an object mapping strings that identify the keys to functions
-    that implement their functionality.</p>
-
-    <p>The CodeMirror distributions comes
-    with <a href="../demo/emacs.html">Emacs</a>, <a href="../demo/vim.html">Vim</a>,
-    and <a href="../demo/sublime.html">Sublime Text</a>-style keymaps.</p>
-
-    <p>Keys are identified either by name or by character.
-    The <code>CodeMirror.keyNames</code> object defines names for
-    common keys and associates them with their key codes. Examples of
-    names defined here are <code>Enter</code>, <code>F5</code>,
-    and <code>Q</code>. These can be prefixed
-    with <code>Shift-</code>, <code>Cmd-</code>, <code>Ctrl-</code>,
-    and <code>Alt-</code> to specify a modifier. So for
-    example, <code>Shift-Ctrl-Space</code> would be a valid key
-    identifier.</p>
-
-    <p>Common example: map the Tab key to insert spaces instead of a tab
-    character.</p>
-
-    <pre data-lang="javascript">
-editor.setOption("extraKeys", {
-  Tab: function(cm) {
-    var spaces = Array(cm.getOption("indentUnit") + 1).join(" ");
-    cm.replaceSelection(spaces);
-  }
-});</pre>
-
-    <p>Alternatively, a character can be specified directly by
-    surrounding it in single quotes, for example <code>'$'</code>
-    or <code>'q'</code>. Due to limitations in the way browsers fire
-    key events, these may not be prefixed with modifiers.</p>
-
-    <p id="normalizeKeyMap">Multi-stroke key bindings can be specified
-    by separating the key names by spaces in the property name, for
-    example <code>Ctrl-X Ctrl-V</code>. When a map contains
-    multi-stoke bindings or keys with modifiers that are not specified
-    in the default order (<code>Shift-Cmd-Ctrl-Alt</code>), you must
-    call <code>CodeMirror.normalizeKeyMap</code> on it before it can
-    be used. This function takes a keymap and modifies it to normalize
-    modifier order and properly recognize multi-stroke bindings. It
-    will return the keymap itself.</p>
-
-    <p>The <code>CodeMirror.keyMap</code> object associates key maps
-    with names. User code and key map definitions can assign extra
-    properties to this object. Anywhere where a key map is expected, a
-    string can be given, which will be looked up in this object. It
-    also contains the <code>"default"</code> key map holding the
-    default bindings.</p>
-
-    <p>The values of properties in key maps can be either functions of
-    a single argument (the CodeMirror instance), strings, or
-    <code>false</code>. Strings refer
-    to <a href="#commands">commands</a>, which are described below. If
-    the property is set to <code>false</code>, CodeMirror leaves
-    handling of the key up to the browser. A key handler function may
-    return <code>CodeMirror.Pass</code> to indicate that it has
-    decided not to handle the key, and other handlers (or the default
-    behavior) should be given a turn.</p>
-
-    <p>Keys mapped to command names that start with the
-    characters <code>"go"</code> or to functions that have a
-    truthy <code>motion</code> property (which should be used for
-    cursor-movement actions) will be fired even when an
-    extra <code>Shift</code> modifier is present (i.e. <code>"Up":
-    "goLineUp"</code> matches both up and shift-up). This is used to
-    easily implement shift-selection.</p>
-
-    <p>Key maps can defer to each other by defining
-    a <code>fallthrough</code> property. This indicates that when a
-    key is not found in the map itself, one or more other maps should
-    be searched. It can hold either a single key map or an array of
-    key maps.</p>
-
-    <p>When a key map needs to set something up when it becomes
-    active, or tear something down when deactivated, it can
-    contain <code>attach</code> and/or <code>detach</code> properties,
-    which should hold functions that take the editor instance and the
-    next or previous keymap. Note that this only works for the
-    <a href="#option_keyMap">top-level keymap</a>, not for fallthrough
-    maps or maps added
-    with <a href="#option_extraKeys"><code>extraKeys</code></a>
-    or <a href="#addKeyMap"><code>addKeyMap</code></a>.</p>
-</section>
-
-<section id=commands>
-    <h2>Commands</h2>
-
-    <p>Commands are parameter-less actions that can be performed on an
-    editor. Their main use is for key bindings. Commands are defined by
-    adding properties to the <code>CodeMirror.commands</code> object.
-    A number of common commands are defined by the library itself,
-    most of them used by the default key bindings. The value of a
-    command property must be a function of one argument (an editor
-    instance).</p>
-
-    <p>Some of the commands below are referenced in the default
-    key map, but not defined by the core library. These are intended to
-    be defined by user code or addons.</p>
-
-    <p>Commands can also be run with
-    the <a href="#execCommand"><code>execCommand</code></a>
-    method.</p>
-
-    <dl>
-      <dt class=command id=command_selectAll><code><strong>selectAll</strong></code><span class=keybinding>Ctrl-A (PC), Cmd-A (Mac)</span></dt>
-      <dd>Select the whole content of the editor.</dd>
-
-      <dt class=command id=command_singleSelection><code><strong>singleSelection</strong></code><span class=keybinding>Esc</span></dt>
-      <dd>When multiple selections are present, this deselects all but
-      the primary selection.</dd>
-
-      <dt class=command id=command_killLine><code><strong>killLine</strong></code><span class=keybinding>Ctrl-K (Mac)</span></dt>
-      <dd>Emacs-style line killing. Deletes the part of the line after
-      the cursor. If that consists only of whitespace, the newline at
-      the end of the line is also deleted.</dd>
-
-      <dt class=command id=command_deleteLine><code><strong>deleteLine</strong></code><span class=keybinding>Ctrl-D (PC), Cmd-D (Mac)</span></dt>
-      <dd>Deletes the whole line under the cursor, including newline at the end.</dd>
-
-      <dt class=command id=command_delLineLeft><code><strong>delLineLeft</strong></code></dt>
-      <dd>Delete the part of the line before the cursor.</dd>
-
-      <dt class=command id=command_delWrappedLineLeft><code><strong>delWrappedLineLeft</strong></code><span class=keybinding>Cmd-Backspace (Mac)</span></dt>
-      <dd>Delete the part of the line from the left side of the visual line the cursor is on to the cursor.</dd>
-
-      <dt class=command id=command_delWrappedLineRight><code><strong>delWrappedLineRight</strong></code><span class=keybinding>Cmd-Delete (Mac)</span></dt>
-      <dd>Delete the part of the line from the cursor to the right side of the visual line the cursor is on.</dd>
-
-      <dt class=command id=command_undo><code><strong>undo</strong></code><span class=keybinding>Ctrl-Z (PC), Cmd-Z (Mac)</span></dt>
-      <dd>Undo the last change.</dd>
-
-      <dt class=command id=command_redo><code><strong>redo</strong></code><span class=keybinding>Ctrl-Y (PC), Shift-Cmd-Z (Mac), Cmd-Y (Mac)</span></dt>
-      <dd>Redo the last undone change.</dd>
-
-      <dt class=command id=command_undoSelection><code><strong>undoSelection</strong></code><span class=keybinding>Ctrl-U (PC), Cmd-U (Mac)</span></dt>
-      <dd>Undo the last change to the selection, or if there are no
-      selection-only changes at the top of the history, undo the last
-      change.</dd>
-
-      <dt class=command id=command_redoSelection><code><strong>redoSelection</strong></code><span class=keybinding>Alt-U (PC), Shift-Cmd-U (Mac)</span></dt>
-      <dd>Redo the last change to the selection, or the last text change if
-      no selection changes remain.</dd>
-
-      <dt class=command id=command_goDocStart><code><strong>goDocStart</strong></code><span class=keybinding>Ctrl-Home (PC), Cmd-Up (Mac), Cmd-Home (Mac)</span></dt>
-      <dd>Move the cursor to the start of the document.</dd>
-
-      <dt class=command id=command_goDocEnd><code><strong>goDocEnd</strong></code><span class=keybinding>Ctrl-End (PC), Cmd-End (Mac), Cmd-Down (Mac)</span></dt>
-      <dd>Move the cursor to the end of the document.</dd>
-
-      <dt class=command id=command_goLineStart><code><strong>goLineStart</strong></code><span class=keybinding>Alt-Left (PC), Ctrl-A (Mac)</span></dt>
-      <dd>Move the cursor to the start of the line.</dd>
-
-      <dt class=command id=command_goLineStartSmart><code><strong>goLineStartSmart</strong></code><span class=keybinding>Home</span></dt>
-      <dd>Move to the start of the text on the line, or if we are
-      already there, to the actual start of the line (including
-      whitespace).</dd>
-
-      <dt class=command id=command_goLineEnd><code><strong>goLineEnd</strong></code><span class=keybinding>Alt-Right (PC), Ctrl-E (Mac)</span></dt>
-      <dd>Move the cursor to the end of the line.</dd>
-
-      <dt class=command id=command_goLineRight><code><strong>goLineRight</strong></code><span class=keybinding>Cmd-Right (Mac)</span></dt>
-      <dd>Move the cursor to the right side of the visual line it is on.</dd>
-
-      <dt class=command id=command_goLineLeft><code><strong>goLineLeft</strong></code><span class=keybinding>Cmd-Left (Mac)</span></dt>
-      <dd>Move the cursor to the left side of the visual line it is on. If
-      this line is wrapped, that may not be the start of the line.</dd>
-
-      <dt class=command id=command_goLineLeftSmart><code><strong>goLineLeftSmart</strong></code></dt>
-      <dd>Move the cursor to the left side of the visual line it is
-      on. If that takes it to the start of the line, behave
-      like <a href="#command_goLineStartSmart"><code>goLineStartSmart</code></a>.</dd>
-
-      <dt class=command id=command_goLineUp><code><strong>goLineUp</strong></code><span class=keybinding>Up, Ctrl-P (Mac)</span></dt>
-      <dd>Move the cursor up one line.</dd>
-
-      <dt class=command id=command_goLineDown><code><strong>goLineDown</strong></code><span class=keybinding>Down, Ctrl-N (Mac)</span></dt>
-      <dd>Move down one line.</dd>
-
-      <dt class=command id=command_goPageUp><code><strong>goPageUp</strong></code><span class=keybinding>PageUp, Shift-Ctrl-V (Mac)</span></dt>
-      <dd>Move the cursor up one screen, and scroll up by the same distance.</dd>
-
-      <dt class=command id=command_goPageDown><code><strong>goPageDown</strong></code><span class=keybinding>PageDown, Ctrl-V (Mac)</span></dt>
-      <dd>Move the cursor down one screen, and scroll down by the same distance.</dd>
-
-      <dt class=command id=command_goCharLeft><code><strong>goCharLeft</strong></code><span class=keybinding>Left, Ctrl-B (Mac)</span></dt>
-      <dd>Move the cursor one character left, going to the previous line
-      when hitting the start of line.</dd>
-
-      <dt class=command id=command_goCharRight><code><strong>goCharRight</strong></code><span class=keybinding>Right, Ctrl-F (Mac)</span></dt>
-      <dd>Move the cursor one character right, going to the next line
-      when hitting the end of line.</dd>
-
-      <dt class=command id=command_goColumnLeft><code><strong>goColumnLeft</strong></code></dt>
-      <dd>Move the cursor one character left, but don't cross line boundaries.</dd>
-
-      <dt class=command id=command_goColumnRight><code><strong>goColumnRight</strong></code></dt>
-      <dd>Move the cursor one character right, don't cross line boundaries.</dd>
-
-      <dt class=command id=command_goWordLeft><code><strong>goWordLeft</strong></code><span class=keybinding>Alt-B (Mac)</span></dt>
-      <dd>Move the cursor to the start of the previous word.</dd>
-
-      <dt class=command id=command_goWordRight><code><strong>goWordRight</strong></code><span class=keybinding>Alt-F (Mac)</span></dt>
-      <dd>Move the cursor to the end of the next word.</dd>
-
-      <dt class=command id=command_goGroupLeft><code><strong>goGroupLeft</strong></code><span class=keybinding>Ctrl-Left (PC), Alt-Left (Mac)</span></dt>
-      <dd>Move to the left of the group before the cursor. A group is
-      a stretch of word characters, a stretch of punctuation
-      characters, a newline, or a stretch of <em>more than one</em>
-      whitespace character.</dd>
-
-      <dt class=command id=command_goGroupRight><code><strong>goGroupRight</strong></code><span class=keybinding>Ctrl-Right (PC), Alt-Right (Mac)</span></dt>
-      <dd>Move to the right of the group after the cursor
-      (see <a href="#command_goGroupLeft">above</a>).</dd>
-
-      <dt class=command id=command_delCharBefore><code><strong>delCharBefore</strong></code><span class=keybinding>Shift-Backspace, Ctrl-H (Mac)</span></dt>
-      <dd>Delete the character before the cursor.</dd>
-
-      <dt class=command id=command_delCharAfter><code><strong>delCharAfter</strong></code><span class=keybinding>Delete, Ctrl-D (Mac)</span></dt>
-      <dd>Delete the character after the cursor.</dd>
-
-      <dt class=command id=command_delWordBefore><code><strong>delWordBefore</strong></code><span class=keybinding>Alt-Backspace (Mac)</span></dt>
-      <dd>Delete up to the start of the word before the cursor.</dd>
-
-      <dt class=command id=command_delWordAfter><code><strong>delWordAfter</strong></code><span class=keybinding>Alt-D (Mac)</span></dt>
-      <dd>Delete up to the end of the word after the cursor.</dd>
-
-      <dt class=command id=command_delGroupBefore><code><strong>delGroupBefore</strong></code><span class=keybinding>Ctrl-Backspace (PC), Alt-Backspace (Mac)</span></dt>
-      <dd>Delete to the left of the <a href="#command_goGroupLeft">group</a> before the cursor.</dd>
-
-      <dt class=command id=command_delGroupAfter><code><strong>delGroupAfter</strong></code><span class=keybinding>Ctrl-Delete (PC), Ctrl-Alt-Backspace (Mac), Alt-Delete (Mac)</span></dt>
-      <dd>Delete to the start of the <a href="#command_goGroupLeft">group</a> after the cursor.</dd>
-
-      <dt class=command id=command_indentAuto><code><strong>indentAuto</strong></code><span class=keybinding>Shift-Tab</span></dt>
-      <dd>Auto-indent the current line or selection.</dd>
-
-      <dt class=command id=command_indentMore><code><strong>indentMore</strong></code><span class=keybinding>Ctrl-] (PC), Cmd-] (Mac)</span></dt>
-      <dd>Indent the current line or selection by one <a href="#option_indentUnit">indent unit</a>.</dd>
-
-      <dt class=command id=command_indentLess><code><strong>indentLess</strong></code><span class=keybinding>Ctrl-[ (PC), Cmd-[ (Mac)</span></dt>
-      <dd>Dedent the current line or selection by one <a href="#option_indentUnit">indent unit</a>.</dd>
-
-      <dt class=command id=command_insertTab><code><strong>insertTab</strong></code></dt>
-      <dd>Insert a tab character at the cursor.</dd>
-
-      <dt class=command id=command_insertSoftTab><code><strong>insertSoftTab</strong></code></dt>
-      <dd>Insert the amount of spaces that match the width a tab at
-      the cursor position would have.</dd>
-
-      <dt class=command id=command_defaultTab><code><strong>defaultTab</strong></code><span class=keybinding>Tab</span></dt>
-      <dd>If something is selected, indent it by
-      one <a href="#option_indentUnit">indent unit</a>. If nothing is
-      selected, insert a tab character.</dd>
-
-      <dt class=command id=command_transposeChars><code><strong>transposeChars</strong></code><span class=keybinding>Ctrl-T (Mac)</span></dt>
-      <dd>Swap the characters before and after the cursor.</dd>
-
-      <dt class=command id=command_newlineAndIndent><code><strong>newlineAndIndent</strong></code><span class=keybinding>Enter</span></dt>
-      <dd>Insert a newline and auto-indent the new line.</dd>
-
-      <dt class=command id=command_toggleOverwrite><code><strong>toggleOverwrite</strong></code><span class=keybinding>Insert</span></dt>
-      <dd>Flip the <a href="#toggleOverwrite">overwrite</a> flag.</dd>
-
-      <dt class=command id=command_save><code><strong>save</strong></code><span class=keybinding>Ctrl-S (PC), Cmd-S (Mac)</span></dt>
-      <dd>Not defined by the core library, only referred to in
-      key maps. Intended to provide an easy way for user code to define
-      a save command.</dd>
-
-      <dt class=command id=command_find><code><strong>find</strong></code><span class=keybinding>Ctrl-F (PC), Cmd-F (Mac)</span></dt>
-      <dt class=command id=command_findNext><code><strong>findNext</strong></code><span class=keybinding>Ctrl-G (PC), Cmd-G (Mac)</span></dt>
-      <dt class=command id=command_findPrev><code><strong>findPrev</strong></code><span class=keybinding>Shift-Ctrl-G (PC), Shift-Cmd-G (Mac)</span></dt>
-      <dt class=command id=command_replace><code><strong>replace</strong></code><span class=keybinding>Shift-Ctrl-F (PC), Cmd-Alt-F (Mac)</span></dt>
-      <dt class=command id=command_replaceAll><code><strong>replaceAll</strong></code><span class=keybinding>Shift-Ctrl-R (PC), Shift-Cmd-Alt-F (Mac)</span></dt>
-      <dd>Not defined by the core library, but defined in
-      the <a href="#addon_search">search addon</a> (or custom client
-      addons).</dd>
-
-    </dl>
-
-</section>
-
-<section id=styling>
-    <h2>Customized Styling</h2>
-
-    <p>Up to a certain extent, CodeMirror's look can be changed by
-    modifying style sheet files. The style sheets supplied by modes
-    simply provide the colors for that mode, and can be adapted in a
-    very straightforward way. To style the editor itself, it is
-    possible to alter or override the styles defined
-    in <a href="../lib/codemirror.css"><code>codemirror.css</code></a>.</p>
-
-    <p>Some care must be taken there, since a lot of the rules in this
-    file are necessary to have CodeMirror function properly. Adjusting
-    colors should be safe, of course, and with some care a lot of
-    other things can be changed as well. The CSS classes defined in
-    this file serve the following roles:</p>
-
-    <dl>
-      <dt id="class_CodeMirror"><code><strong>CodeMirror</strong></code></dt>
-      <dd>The outer element of the editor. This should be used for the
-      editor width, height, borders and positioning. Can also be used
-      to set styles that should hold for everything inside the editor
-      (such as font and font size), or to set a background. Setting
-      this class' <code>height</code> style to <code>auto</code> will
-      make the editor <a href="../demo/resize.html">resize to fit its
-      content</a> (it is recommended to also set
-      the <a href="#option_viewportMargin"><code>viewportMargin</code>
-      option</a> to <code>Infinity</code> when doing this.</dd>
-
-      <dt id="class_CodeMirror_focused"><code><strong>CodeMirror-focused</strong></code></dt>
-      <dd>Whenever the editor is focused, the top element gets this
-      class. This is used to hide the cursor and give the selection a
-      different color when the editor is not focused.</dd>
-
-      <dt id="class_CodeMirror_gutters"><code><strong>CodeMirror-gutters</strong></code></dt>
-      <dd>This is the backdrop for all gutters. Use it to set the
-      default gutter background color, and optionally add a border on
-      the right of the gutters.</dd>
-
-      <dt id="class_CodeMirror_linenumbers"><code><strong>CodeMirror-linenumbers</strong></code></dt>
-      <dd>Use this for giving a background or width to the line number
-      gutter.</dd>
-
-      <dt id="class_CodeMirror_linenumber"><code><strong>CodeMirror-linenumber</strong></code></dt>
-      <dd>Used to style the actual individual line numbers. These
-      won't be children of the <code>CodeMirror-linenumbers</code>
-      (plural) element, but rather will be absolutely positioned to
-      overlay it. Use this to set alignment and text properties for
-      the line numbers.</dd>
-
-      <dt id="class_CodeMirror_lines"><code><strong>CodeMirror-lines</strong></code></dt>
-      <dd>The visible lines. This is where you specify vertical
-      padding for the editor content.</dd>
-
-      <dt id="class_CodeMirror_cursor"><code><strong>CodeMirror-cursor</strong></code></dt>
-      <dd>The cursor is a block element that is absolutely positioned.
-      You can make it look whichever way you want.</dd>
-
-      <dt id="class_CodeMirror_selected"><code><strong>CodeMirror-selected</strong></code></dt>
-      <dd>The selection is represented by <code>span</code> elements
-      with this class.</dd>
-
-      <dt id="class_CodeMirror_matchingbracket"><code><strong>CodeMirror-matchingbracket</strong></code>,
-        <code><strong>CodeMirror-nonmatchingbracket</strong></code></dt>
-      <dd>These are used to style matched (or unmatched) brackets.</dd>
-    </dl>
-
-    <p>If your page's style sheets do funky things to
-    all <code>div</code> or <code>pre</code> elements (you probably
-    shouldn't do that), you'll have to define rules to cancel these
-    effects out again for elements under the <code>CodeMirror</code>
-    class.</p>
-
-    <p>Themes are also simply CSS files, which define colors for
-    various syntactic elements. See the files in
-    the <a href="../theme/"><code>theme</code></a> directory.</p>
-</section>
-
-<section id=api>
-    <h2>Programming API</h2>
-
-    <p>A lot of CodeMirror features are only available through its
-    API. Thus, you need to write code (or
-    use <a href="#addons">addons</a>) if you want to expose them to
-    your users.</p>
-
-    <p>Whenever points in the document are represented, the API uses
-    objects with <code>line</code> and <code>ch</code> properties.
-    Both are zero-based. CodeMirror makes sure to 'clip' any positions
-    passed by client code so that they fit inside the document, so you
-    shouldn't worry too much about sanitizing your coordinates. If you
-    give <code>ch</code> a value of <code>null</code>, or don't
-    specify it, it will be replaced with the length of the specified
-    line. Such positions may also have a <code>sticky</code> property
-    holding <code>"before"</code> or <code>"after"</code>, whether the
-    position is associated with the character before or after it. This
-    influences, for example, where the cursor is drawn on a
-    line-break or bidi-direction boundary.</p>
-
-    <p>Methods prefixed with <code>doc.</code> can, unless otherwise
-    specified, be called both on <code>CodeMirror</code> (editor)
-    instances and <code>CodeMirror.Doc</code> instances. Methods
-    prefixed with <code>cm.</code> are <em>only</em> available
-    on <code>CodeMirror</code> instances.</p>
-
-    <h3 id="api_constructor">Constructor</h3>
-
-    <p id="CodeMirror">Constructing an editor instance is done with
-    the <code><strong>CodeMirror</strong>(place: Element|fn(Element),
-    ?option: object)</code> constructor. If the <code>place</code>
-    argument is a DOM element, the editor will be appended to it. If
-    it is a function, it will be called, and is expected to place the
-    editor into the document. <code>options</code> may be an element
-    mapping <a href="#config">option names</a> to values. The options
-    that it doesn't explicitly specify (or all options, if it is not
-    passed) will be taken
-    from <a href="#defaults"><code>CodeMirror.defaults</code></a>.</p>
-
-    <p>Note that the options object passed to the constructor will be
-    mutated when the instance's options
-    are <a href="#setOption">changed</a>, so you shouldn't share such
-    objects between instances.</p>
-
-    <p>See <a href="#fromTextArea"><code>CodeMirror.fromTextArea</code></a>
-    for another way to construct an editor instance.</p>
-
-    <h3 id="api_content">Content manipulation methods</h3>
-
-    <dl>
-      <dt id="getValue"><code><strong>doc.getValue</strong>(?separator: string) 鈫� string</code></dt>
-      <dd>Get the current editor content. You can pass it an optional
-      argument to specify the string to be used to separate lines
-      (defaults to <code>"\n"</code>).</dd>
-      <dt id="setValue"><code><strong>doc.setValue</strong>(content: string)</code></dt>
-      <dd>Set the editor content.</dd>
-
-      <dt id="getRange"><code><strong>doc.getRange</strong>(from: {line, ch}, to: {line, ch}, ?separator: string) 鈫� string</code></dt>
-      <dd>Get the text between the given points in the editor, which
-      should be <code>{line, ch}</code> objects. An optional third
-      argument can be given to indicate the line separator string to
-      use (defaults to <code>"\n"</code>).</dd>
-      <dt id="replaceRange"><code><strong>doc.replaceRange</strong>(replacement: string, from: {line, ch}, to:聽{line,聽ch}, ?origin:聽string)</code></dt>
-      <dd>Replace the part of the document between <code>from</code>
-      and <code>to</code> with the given string. <code>from</code>
-      and <code>to</code> must be <code>{line, ch}</code>
-      objects. <code>to</code> can be left off to simply insert the
-      string at position <code>from</code>. When <code>origin</code>
-      is given, it will be passed on
-      to <a href="#event_change"><code>"change"</code> events</a>, and
-      its first letter will be used to determine whether this change
-      can be merged with previous history events, in the way described
-      for <a href="#selection_origin">selection origins</a>.</dd>
-
-      <dt id="getLine"><code><strong>doc.getLine</strong>(n: integer) 鈫� string</code></dt>
-      <dd>Get the content of line <code>n</code>.</dd>
-
-      <dt id="lineCount"><code><strong>doc.lineCount</strong>() 鈫� integer</code></dt>
-      <dd>Get the number of lines in the editor.</dd>
-      <dt id="firstLine"><code><strong>doc.firstLine</strong>() 鈫� integer</code></dt>
-      <dd>Get the first line of the editor. This will
-      usually be zero but for <a href="#linkedDoc_from">linked sub-views</a>,
-      or <a href="#api_doc">documents</a> instantiated with a non-zero
-      first line, it might return other values.</dd>
-      <dt id="lastLine"><code><strong>doc.lastLine</strong>() 鈫� integer</code></dt>
-      <dd>Get the last line of the editor. This will
-      usually be <code>doc.lineCount() - 1</code>,
-      but for <a href="#linkedDoc_from">linked sub-views</a>,
-      it might return other values.</dd>
-
-      <dt id="getLineHandle"><code><strong>doc.getLineHandle</strong>(num: integer) 鈫� LineHandle</code></dt>
-      <dd>Fetches the line handle for the given line number.</dd>
-      <dt id="getLineNumber"><code><strong>doc.getLineNumber</strong>(handle: LineHandle) 鈫� integer</code></dt>
-      <dd>Given a line handle, returns the current position of that
-      line (or <code>null</code> when it is no longer in the
-      document).</dd>
-      <dt id="eachLine"><code><strong>doc.eachLine</strong>(f: (line: LineHandle))</code></dt>
-      <dt><code><strong>doc.eachLine</strong>(start: integer, end: integer, f: (line: LineHandle))</code></dt>
-      <dd>Iterate over the whole document, or if <code>start</code>
-      and <code>end</code> line numbers are given, the range
-      from <code>start</code> up to (not including) <code>end</code>,
-      and call <code>f</code> for each line, passing the line handle.
-      This is a faster way to visit a range of line handlers than
-      calling <a href="#getLineHandle"><code>getLineHandle</code></a>
-      for each of them. Note that line handles have
-      a <code>text</code> property containing the line's content (as a
-      string).</dd>
-
-      <dt id="markClean"><code><strong>doc.markClean</strong>()</code></dt>
-      <dd>Set the editor content as 'clean', a flag that it will
-      retain until it is edited, and which will be set again when such
-      an edit is undone again. Useful to track whether the content
-      needs to be saved. This function is deprecated in favor
-      of <a href="#changeGeneration"><code>changeGeneration</code></a>,
-      which allows multiple subsystems to track different notions of
-      cleanness without interfering.</dd>
-      <dt id="changeGeneration"><code><strong>doc.changeGeneration</strong>(?closeEvent: boolean) 鈫� integer</code></dt>
-      <dd>Returns a number that can later be passed
-      to <a href="#isClean"><code>isClean</code></a> to test whether
-      any edits were made (and not undone) in the meantime.
-      If <code>closeEvent</code> is true, the current history event
-      will be 鈥榗losed鈥�, meaning it can't be combined with further
-      changes (rapid typing or deleting events are typically
-      combined).</dd>
-      <dt id="isClean"><code><strong>doc.isClean</strong>(?generation: integer) 鈫� boolean</code></dt>
-      <dd>Returns whether the document is currently clean 鈥� not
-      modified since initialization or the last call
-      to <a href="#markClean"><code>markClean</code></a> if no
-      argument is passed, or since the matching call
-      to <a href="#changeGeneration"><code>changeGeneration</code></a>
-      if a generation value is given.</dd>
-    </dl>
-
-    <h3 id="api_selection">Cursor and selection methods</h3>
-
-    <dl>
-      <dt id="getSelection"><code><strong>doc.getSelection</strong>(?lineSep: string) 鈫� string</code></dt>
-      <dd>Get the currently selected code. Optionally pass a line
-      separator to put between the lines in the output. When multiple
-      selections are present, they are concatenated with instances
-      of <code>lineSep</code> in between.</dd>
-      <dt id="getSelections"><code><strong>doc.getSelections</strong>(?lineSep: string) 鈫� array&lt;string&gt;</code></dt>
-      <dd>Returns an array containing a string for each selection,
-      representing the content of the selections.</dd>
-
-      <dt id="replaceSelection"><code><strong>doc.replaceSelection</strong>(replacement: string, ?select: string)</code></dt>
-      <dd>Replace the selection(s) with the given string. By default,
-      the new selection ends up after the inserted text. The
-      optional <code>select</code> argument can be used to change
-      this鈥攑assing <code>"around"</code> will cause the new text to be
-      selected, passing <code>"start"</code> will collapse the
-      selection to the start of the inserted text.</dd>
-      <dt id="replaceSelections"><code><strong>doc.replaceSelections</strong>(replacements: array&lt;string&gt;, ?select: string)</code></dt>
-      <dd>The length of the given array should be the same as the
-      number of active selections. Replaces the content of the
-      selections with the strings in the array.
-      The <code>select</code> argument works the same as
-      in <a href="#replaceSelection"><code>replaceSelection</code></a>.</dd>
-
-      <dt id="getCursor"><code><strong>doc.getCursor</strong>(?start: string) 鈫� {line, ch}</code></dt>
-      <dd>Retrieve one end of the <em>primary</em>
-      selection. <code>start</code> is an optional string indicating
-      which end of the selection to return. It may
-      be <code>"from"</code>, <code>"to"</code>, <code>"head"</code>
-      (the side of the selection that moves when you press
-      shift+arrow), or <code>"anchor"</code> (the fixed side of the
-      selection). Omitting the argument is the same as
-      passing <code>"head"</code>. A <code>{line, ch}</code> object
-      will be returned.</dd>
-      <dt id="listSelections"><code><strong>doc.listSelections</strong>() 鈫� array&lt;{anchor, head}&gt;</code></dt>
-      <dd>Retrieves a list of all current selections. These will
-      always be sorted, and never overlap (overlapping selections are
-      merged). Each object in the array contains <code>anchor</code>
-      and <code>head</code> properties referring to <code>{line,
-      ch}</code> objects.</dd>
-
-      <dt id="somethingSelected"><code><strong>doc.somethingSelected</strong>() 鈫� boolean</code></dt>
-      <dd>Return true if any text is selected.</dd>
-      <dt id="setCursor"><code><strong>doc.setCursor</strong>(pos: {line, ch}|number, ?ch: number, ?options: object)</code></dt>
-      <dd>Set the cursor position. You can either pass a
-      single <code>{line, ch}</code> object, or the line and the
-      character as two separate parameters. Will replace all
-      selections with a single, empty selection at the given position.
-      The supported options are the same as for <a href="#setSelection"><code>setSelection</code></a>.</dd>
-
-      <dt id="setSelection"><code><strong>doc.setSelection</strong>(anchor: {line, ch}, ?head: {line, ch}, ?options: object)</code></dt>
-      <dd>Set a single selection range. <code>anchor</code>
-      and <code>head</code> should be <code>{line, ch}</code>
-      objects. <code>head</code> defaults to <code>anchor</code> when
-      not given. These options are supported:
-      <dl>
-        <dt id="selection_scroll"><code><strong>scroll</strong>: boolean</code></dt>
-        <dd>Determines whether the selection head should be scrolled
-        into view. Defaults to true.</dd>
-        <dt id="selection_origin"><code><strong>origin</strong>: string</code></dt>
-        <dd>Determines whether the selection history event may be
-        merged with the previous one. When an origin starts with the
-        character <code>+</code>, and the last recorded selection had
-        the same origin and was similar (close
-        in <a href="#option_historyEventDelay">time</a>, both
-        collapsed or both non-collapsed), the new one will replace the
-        old one. When it starts with <code>*</code>, it will always
-        replace the previous event (if that had the same origin).
-        Built-in motion uses the <code>"+move"</code> origin. User input uses the <code>"+input"</code> origin.</dd>
-        <dt id="selection_bias"><code><strong>bias</strong>: number</code></dt>
-        <dd>Determine the direction into which the selection endpoints
-        should be adjusted when they fall inside
-        an <a href="#mark_atomic">atomic</a> range. Can be either -1
-        (backward) or 1 (forward). When not given, the bias will be
-        based on the relative position of the old selection鈥攖he editor
-        will try to move further away from that, to prevent getting
-        stuck.</dd>
-      </dl></dd>
-
-      <dt id="setSelections"><code><strong>doc.setSelections</strong>(ranges: array&lt;{anchor, head}&gt;, ?primary: integer, ?options: object)</code></dt>
-      <dd>Sets a new set of selections. There must be at least one
-      selection in the given array. When <code>primary</code> is a
-      number, it determines which selection is the primary one. When
-      it is not given, the primary index is taken from the previous
-      selection, or set to the last range if the previous selection
-      had less ranges than the new one. Supports the same options
-      as <a href="#setSelection"><code>setSelection</code></a>.</dd>
-      <dt id="addSelection"><code><strong>doc.addSelection</strong>(anchor: {line, ch}, ?head: {line, ch})</code></dt>
-      <dd>Adds a new selection to the existing set of selections, and
-      makes it the primary selection.</dd>
-
-      <dt id="extendSelection"><code><strong>doc.extendSelection</strong>(from: {line, ch}, ?to: {line, ch}, ?options: object)</code></dt>
-      <dd>Similar
-      to <a href="#setSelection"><code>setSelection</code></a>, but
-      will, if shift is held or
-      the <a href="#setExtending">extending</a> flag is set, move the
-      head of the selection while leaving the anchor at its current
-      place. <code>to</code> is optional, and can be passed to ensure
-      a region (for example a word or paragraph) will end up selected
-      (in addition to whatever lies between that region and the
-      current anchor). When multiple selections are present, all but
-      the primary selection will be dropped by this method.
-      Supports the same options as <a href="#setSelection"><code>setSelection</code></a>.</dd>
-      <dt id="extendSelections"><code><strong>doc.extendSelections</strong>(heads: array&lt;{line, ch}&gt;, ?options: object)</code></dt>
-      <dd>An equivalent
-      of <a href="#extendSelection"><code>extendSelection</code></a>
-      that acts on all selections at once.</dd>
-      <dt id="extendSelectionsBy"><code><strong>doc.extendSelectionsBy</strong>(f: function(range: {anchor, head}) 鈫捖爗line, ch}), ?options: object)</code></dt>
-      <dd>Applies the given function to all existing selections, and
-      calls <a href="#extendSelections"><code>extendSelections</code></a>
-      on the result.</dd>
-      <dt id="setExtending"><code><strong>doc.setExtending</strong>(value: boolean)</code></dt>
-      <dd>Sets or clears the 'extending' flag, which acts similar to
-      the shift key, in that it will cause cursor movement and calls
-      to <a href="#extendSelection"><code>extendSelection</code></a>
-      to leave the selection anchor in place.</dd>
-      <dt id="getExtending"><code><strong>doc.getExtending</strong>() 鈫� boolean</code></dt>
-      <dd>Get the value of the 'extending' flag.</dd>
-
-      <dt id="hasFocus"><code><strong>cm.hasFocus</strong>() 鈫� boolean</code></dt>
-      <dd>Tells you whether the editor currently has focus.</dd>
-
-      <dt id="findPosH"><code><strong>cm.findPosH</strong>(start: {line, ch}, amount: integer, unit: string, visually:聽boolean) 鈫捖爗line, ch, ?hitSide: boolean}</code></dt>
-      <dd>Used to find the target position for horizontal cursor
-      motion. <code>start</code> is a <code>{line, ch}</code>
-      object, <code>amount</code> an integer (may be negative),
-      and <code>unit</code> one of the
-      string <code>"char"</code>, <code>"column"</code>,
-      or <code>"word"</code>. Will return a position that is produced
-      by moving <code>amount</code> times the distance specified
-      by <code>unit</code>. When <code>visually</code> is true, motion
-      in right-to-left text will be visual rather than logical. When
-      the motion was clipped by hitting the end or start of the
-      document, the returned value will have a <code>hitSide</code>
-      property set to true.</dd>
-      <dt id="findPosV"><code><strong>cm.findPosV</strong>(start: {line, ch}, amount: integer, unit: string) 鈫� {line, ch, ?hitSide: boolean}</code></dt>
-      <dd>Similar to <a href="#findPosH"><code>findPosH</code></a>,
-      but used for vertical motion. <code>unit</code> may
-      be <code>"line"</code> or <code>"page"</code>. The other
-      arguments and the returned value have the same interpretation as
-      they have in <code>findPosH</code>.</dd>
-
-      <dt id="findWordAt"><code><strong>cm.findWordAt</strong>(pos: {line, ch}) 鈫� {anchor: {line, ch}, head: {line, ch}}</code></dt>
-      <dd>Returns the start and end of the 'word' (the stretch of
-      letters, whitespace, or punctuation) at the given position.</dd>
-    </dl>
-
-    <h3 id="api_configuration">Configuration methods</h3>
-
-    <dl>
-      <dt id="setOption"><code><strong>cm.setOption</strong>(option: string, value: any)</code></dt>
-      <dd>Change the configuration of the editor. <code>option</code>
-      should the name of an <a href="#config">option</a>,
-      and <code>value</code> should be a valid value for that
-      option.</dd>
-      <dt id="getOption"><code><strong>cm.getOption</strong>(option: string) 鈫� any</code></dt>
-      <dd>Retrieves the current value of the given option for this
-      editor instance.</dd>
-
-      <dt id="addKeyMap"><code><strong>cm.addKeyMap</strong>(map: object, bottom: boolean)</code></dt>
-      <dd>Attach an additional <a href="#keymaps">key map</a> to the
-      editor. This is mostly useful for addons that need to register
-      some key handlers without trampling on
-      the <a href="#option_extraKeys"><code>extraKeys</code></a>
-      option. Maps added in this way have a higher precedence than
-      the <code>extraKeys</code>
-      and <a href="#option_keyMap"><code>keyMap</code></a> options,
-      and between them, the maps added earlier have a lower precedence
-      than those added later, unless the <code>bottom</code> argument
-      was passed, in which case they end up below other key maps added
-      with this method.</dd>
-      <dt id="removeKeyMap"><code><strong>cm.removeKeyMap</strong>(map: object)</code></dt>
-      <dd>Disable a keymap added
-      with <a href="#addKeyMap"><code>addKeyMap</code></a>. Either
-      pass in the key map object itself, or a string, which will be
-      compared against the <code>name</code> property of the active
-      key maps.</dd>
-
-      <dt id="addOverlay"><code><strong>cm.addOverlay</strong>(mode: string|object, ?options: object)</code></dt>
-      <dd>Enable a highlighting overlay. This is a stateless mini-mode
-      that can be used to add extra highlighting. For example,
-      the <a href="../demo/search.html">search addon</a> uses it to
-      highlight the term that's currently being
-      searched. <code>mode</code> can be a <a href="#option_mode">mode
-      spec</a> or a mode object (an object with
-      a <a href="#token"><code>token</code></a> method).
-      The <code>options</code> parameter is optional. If given, it
-      should be an object, optionally containing the following options:
-        <dl>
-          <dt><code><strong>opaque</strong>: bool</code></dt>
-          <dd>Defaults to off, but can be given to allow the overlay
-          styling, when not <code>null</code>, to override the styling of
-          the base mode entirely, instead of the two being applied
-          together.</dd>
-          <dt><code><strong>priority</strong>: number</code></dt>
-          <dd>Determines the ordering in which the overlays are
-          applied. Those with high priority are applied after those
-          with lower priority, and able to override the opaqueness of
-          the ones that come before. Defaults to 0.</dd>
-        </dl>
-      </dd>
-
-      <dt id="removeOverlay"><code><strong>cm.removeOverlay</strong>(mode: string|object)</code></dt>
-      <dd>Pass this the exact value passed for the <code>mode</code>
-      parameter to <a href="#addOverlay"><code>addOverlay</code></a>,
-      or a string that corresponds to the <code>name</code> property of
-      that value, to remove an overlay again.</dd>
-
-      <dt id="on"><code><strong>cm.on</strong>(type: string, func: (...args))</code></dt>
-      <dd>Register an event handler for the given event type (a
-      string) on the editor instance. There is also
-      a <code>CodeMirror.on(object, type, func)</code> version
-      that allows registering of events on any object.</dd>
-      <dt id="off"><code><strong>cm.off</strong>(type: string, func: (...args))</code></dt>
-      <dd>Remove an event handler on the editor instance. An
-      equivalent <code>CodeMirror.off(object, type,
-      func)</code> also exists.</dd>
-    </dl>
-
-    <h3 id="api_doc">Document management methods</h3>
-
-    <p id="Doc">Each editor is associated with an instance
-    of <code>CodeMirror.Doc</code>, its document. A document
-    represents the editor content, plus a selection, an undo history,
-    and a <a href="#option_mode">mode</a>. A document can only be
-    associated with a single editor at a time. You can create new
-    documents by calling the <code>CodeMirror.Doc(text, mode,
-    firstLineNumber)</code> constructor. The last two arguments are
-    optional and can be used to set a mode for the document and make
-    it start at a line number other than 0, respectively.</p>
-
-    <dl>
-      <dt id="getDoc"><code><strong>cm.getDoc</strong>() 鈫� Doc</code></dt>
-      <dd>Retrieve the currently active document from an editor.</dd>
-      <dt id="getEditor"><code><strong>doc.getEditor</strong>() 鈫� CodeMirror</code></dt>
-      <dd>Retrieve the editor associated with a document. May
-      return <code>null</code>.</dd>
-
-      <dt id="swapDoc"><code><strong>cm.swapDoc</strong>(doc: CodeMirror.Doc) 鈫� Doc</code></dt>
-      <dd>Attach a new document to the editor. Returns the old
-      document, which is now no longer associated with an editor.</dd>
-
-      <dt id="copy"><code><strong>doc.copy</strong>(copyHistory: boolean) 鈫� Doc</code></dt>
-      <dd>Create an identical copy of the given doc.
-      When <code>copyHistory</code> is true, the history will also be
-      copied. Can not be called directly on an editor.</dd>
-
-      <dt id="linkedDoc"><code><strong>doc.linkedDoc</strong>(options: object) 鈫� Doc</code></dt>
-      <dd>Create a new document that's linked to the target document.
-      Linked documents will stay in sync (changes to one are also
-      applied to the other) until <a href="#unlinkDoc">unlinked</a>.
-      These are the options that are supported:
-        <dl>
-          <dt id="linkedDoc_sharedHist"><code><strong>sharedHist</strong>: boolean</code></dt>
-          <dd>When turned on, the linked copy will share an undo
-          history with the original. Thus, something done in one of
-          the two can be undone in the other, and vice versa.</dd>
-          <dt id="linkedDoc_from"><code><strong>from</strong>: integer</code></dt>
-          <dt id="linkedDoc_to"><code><strong>to</strong>: integer</code></dt>
-          <dd>Can be given to make the new document a subview of the
-          original. Subviews only show a given range of lines. Note
-          that line coordinates inside the subview will be consistent
-          with those of the parent, so that for example a subview
-          starting at line 10 will refer to its first line as line 10,
-          not 0.</dd>
-          <dt id="linkedDoc_mode"><code><strong>mode</strong>: string|object</code></dt>
-          <dd>By default, the new document inherits the mode of the
-          parent. This option can be set to
-          a <a href="#option_mode">mode spec</a> to give it a
-          different mode.</dd>
-        </dl></dd>
-      <dt id="unlinkDoc"><code><strong>doc.unlinkDoc</strong>(doc: CodeMirror.Doc)</code></dt>
-      <dd>Break the link between two documents. After calling this,
-      changes will no longer propagate between the documents, and, if
-      they had a shared history, the history will become
-      separate.</dd>
-      <dt id="iterLinkedDocs"><code><strong>doc.iterLinkedDocs</strong>(function: (doc: CodeMirror.Doc, sharedHist: boolean))</code></dt>
-      <dd>Will call the given function for all documents linked to the
-      target document. It will be passed two arguments, the linked document
-      and a boolean indicating whether that document shares history
-      with the target.</dd>
-    </dl>
-
-    <h3 id="api_history">History-related methods</h3>
-
-    <dl>
-      <dt id="undo"><code><strong>doc.undo</strong>()</code></dt>
-      <dd>Undo one edit (if any undo events are stored).</dd>
-      <dt id="redo"><code><strong>doc.redo</strong>()</code></dt>
-      <dd>Redo one undone edit.</dd>
-
-      <dt id="undoSelection"><code><strong>doc.undoSelection</strong>()</code></dt>
-      <dd>Undo one edit or selection change.</dd>
-      <dt id="redoSelection"><code><strong>doc.redoSelection</strong>()</code></dt>
-      <dd>Redo one undone edit or selection change.</dd>
-
-      <dt id="historySize"><code><strong>doc.historySize</strong>() 鈫� {undo: integer, redo: integer}</code></dt>
-      <dd>Returns an object with <code>{undo, redo}</code> properties,
-      both of which hold integers, indicating the amount of stored
-      undo and redo operations.</dd>
-      <dt id="clearHistory"><code><strong>doc.clearHistory</strong>()</code></dt>
-      <dd>Clears the editor's undo history.</dd>
-      <dt id="getHistory"><code><strong>doc.getHistory</strong>() 鈫� object</code></dt>
-      <dd>Get a (JSON-serializable) representation of the undo history.</dd>
-      <dt id="setHistory"><code><strong>doc.setHistory</strong>(history: object)</code></dt>
-      <dd>Replace the editor's undo history with the one provided,
-      which must be a value as returned
-      by <a href="#getHistory"><code>getHistory</code></a>. Note that
-      this will have entirely undefined results if the editor content
-      isn't also the same as it was when <code>getHistory</code> was
-      called.</dd>
-    </dl>
-
-    <h3 id="api_marker">Text-marking methods</h3>
-
-    <dl>
-      <dt id="markText"><code><strong>doc.markText</strong>(from: {line, ch}, to: {line, ch}, ?options: object) 鈫� TextMarker</code></dt>
-      <dd>Can be used to mark a range of text with a specific CSS
-      class name. <code>from</code> and <code>to</code> should
-      be <code>{line, ch}</code> objects. The <code>options</code>
-      parameter is optional. When given, it should be an object that
-      may contain the following configuration options:
-      <dl>
-        <dt id="mark_className"><code><strong>className</strong>: string</code></dt>
-        <dd>Assigns a CSS class to the marked stretch of text.</dd>
-        <dt id="mark_inclusiveLeft"><code><strong>inclusiveLeft</strong>: boolean</code></dt>
-        <dd>Determines whether
-        text inserted on the left of the marker will end up inside
-        or outside of it.</dd>
-        <dt id="mark_inclusiveRight"><code><strong>inclusiveRight</strong>: boolean</code></dt>
-        <dd>Like <code>inclusiveLeft</code>,
-        but for the right side.</dd>
-        <dt id="mark_atomic"><code><strong>atomic</strong>: boolean</code></dt>
-        <dd>Atomic ranges act as a single unit when cursor movement is
-        concerned鈥攊.e. it is impossible to place the cursor inside of
-        them. In atomic ranges, <code>inclusiveLeft</code>
-        and <code>inclusiveRight</code> have a different meaning鈥攖hey
-        will prevent the cursor from being placed respectively
-        directly before and directly after the range.</dd>
-        <dt id="mark_collapsed"><code><strong>collapsed</strong>: boolean</code></dt>
-        <dd>Collapsed ranges do not show up in the display. Setting a
-        range to be collapsed will automatically make it atomic.</dd>
-        <dt id="mark_clearOnEnter"><code><strong>clearOnEnter</strong>: boolean</code></dt>
-        <dd>When enabled, will cause the mark to clear itself whenever
-        the cursor enters its range. This is mostly useful for
-        text-replacement widgets that need to 'snap open' when the
-        user tries to edit them. The
-        <a href="#event_clear"><code>"clear"</code></a> event
-        fired on the range handle can be used to be notified when this
-        happens.</dd>
-        <dt id="mark_clearWhenEmpty"><code><strong>clearWhenEmpty</strong>: boolean</code></dt>
-        <dd>Determines whether the mark is automatically cleared when
-        it becomes empty. Default is true.</dd>
-        <dt id="mark_replacedWith"><code><strong>replacedWith</strong>: Element</code></dt>
-        <dd>Use a given node to display this range. Implies both
-        collapsed and atomic. The given DOM node <em>must</em> be an
-        inline element (as opposed to a block element).</dd>
-        <dt><code><strong>handleMouseEvents</strong>: boolean</code></dt>
-        <dd>When <code>replacedWith</code> is given, this determines
-        whether the editor will capture mouse and drag events
-        occurring in this widget. Default is false鈥攖he events will be
-        left alone for the default browser handler, or specific
-        handlers on the widget, to capture.</dd>
-        <dt id="mark_readOnly"><code><strong>readOnly</strong>: boolean</code></dt>
-        <dd>A read-only span can, as long as it is not cleared, not be
-        modified except by
-        calling <a href="#setValue"><code>setValue</code></a> to reset
-        the whole document. <em>Note:</em> adding a read-only span
-        currently clears the undo history of the editor, because
-        existing undo events being partially nullified by read-only
-        spans would corrupt the history (in the current
-        implementation).</dd>
-        <dt id="mark_addToHistory"><code><strong>addToHistory</strong>: boolean</code></dt>
-        <dd>When set to true (default is false), adding this marker
-        will create an event in the undo history that can be
-        individually undone (clearing the marker).</dd>
-        <dt id="mark_startStyle"><code><strong>startStyle</strong>: string</code></dt><dd>Can be used to specify
-        an extra CSS class to be applied to the leftmost span that
-        is part of the marker.</dd>
-        <dt id="mark_endStyle"><code><strong>endStyle</strong>: string</code></dt><dd>Equivalent
-        to <code>startStyle</code>, but for the rightmost span.</dd>
-        <dt id="mark_css"><code><strong>css</strong>: string</code></dt>
-        <dd>A string of CSS to be applied to the covered text. For example <code>"color: #fe3"</code>.</dd>
-        <dt id="mark_title"><code><strong>title</strong>:
-        string</code></dt><dd>When given, will give the nodes created
-        for this span a HTML <code>title</code> attribute with the
-        given value.</dd>
-        <dt id="mark_shared"><code><strong>shared</strong>: boolean</code></dt><dd>When the
-        target document is <a href="#linkedDoc">linked</a> to other
-        documents, you can set <code>shared</code> to true to make the
-        marker appear in all documents. By default, a marker appears
-        only in its target document.</dd>
-      </dl>
-      The method will return an object that represents the marker
-      (with constructor <code>CodeMirror.TextMarker</code>), which
-      exposes three methods:
-      <code><strong>clear</strong>()</code>, to remove the mark,
-      <code><strong>find</strong>()</code>, which returns
-      a <code>{from, to}</code> object (both holding document
-      positions), indicating the current position of the marked range,
-      or <code>undefined</code> if the marker is no longer in the
-      document, and finally <code><strong>changed</strong>()</code>,
-      which you can call if you've done something that might change
-      the size of the marker (for example changing the content of
-      a <a href="#mark_replacedWith"><code>replacedWith</code></a>
-      node), and want to cheaply update the display.</dd>
-
-      <dt id="setBookmark"><code><strong>doc.setBookmark</strong>(pos: {line, ch}, ?options: object) 鈫� TextMarker</code></dt>
-      <dd>Inserts a bookmark, a handle that follows the text around it
-      as it is being edited, at the given position. A bookmark has two
-      methods <code>find()</code> and <code>clear()</code>. The first
-      returns the current position of the bookmark, if it is still in
-      the document, and the second explicitly removes the bookmark.
-      The options argument is optional. If given, the following
-      properties are recognized:
-      <dl>
-        <dt><code><strong>widget</strong>: Element</code></dt><dd>Can be used to display a DOM
-        node at the current location of the bookmark (analogous to
-        the <a href="#mark_replacedWith"><code>replacedWith</code></a>
-        option to <a href="#markText"><code>markText</code></a>).</dd>
-        <dt><code><strong>insertLeft</strong>: boolean</code></dt><dd>By default, text typed
-        when the cursor is on top of the bookmark will end up to the
-        right of the bookmark. Set this option to true to make it go
-        to the left instead.</dd>
-        <dt><code><strong>shared</strong>: boolean</code></dt><dd>See
-        the corresponding <a href="#mark_shared">option</a>
-        to <code>markText</code>.</dd>
-        <dt><code><strong>handleMouseEvents</strong>: boolean</code></dt>
-        <dd>As with <a href="#markText"><code>markText</code></a>,
-        this determines whether mouse events on the widget inserted
-        for this bookmark are handled by CodeMirror. The default is
-        false.</dd>
-      </dl></dd>
-
-      <dt id="findMarks"><code><strong>doc.findMarks</strong>(from: {line, ch}, to: {line, ch}) 鈫� array&lt;TextMarker&gt;</code></dt>
-      <dd>Returns an array of all the bookmarks and marked ranges
-      found between the given positions (non-inclusive).</dd>
-      <dt id="findMarksAt"><code><strong>doc.findMarksAt</strong>(pos: {line, ch}) 鈫� array&lt;TextMarker&gt;</code></dt>
-      <dd>Returns an array of all the bookmarks and marked ranges
-      present at the given position.</dd>
-      <dt id="getAllMarks"><code><strong>doc.getAllMarks</strong>() 鈫� array&lt;TextMarker&gt;</code></dt>
-      <dd>Returns an array containing all marked ranges in the document.</dd>
-    </dl>
-
-    <h3 id="api_decoration">Widget, gutter, and decoration methods</h3>
-
-    <dl>
-      <dt id="setGutterMarker"><code><strong>doc.setGutterMarker</strong>(line: integer|LineHandle, gutterID: string, value: Element) 鈫� LineHandle</code></dt>
-      <dd>Sets the gutter marker for the given gutter (identified by
-      its CSS class, see
-      the <a href="#option_gutters"><code>gutters</code></a> option)
-      to the given value. Value can be either <code>null</code>, to
-      clear the marker, or a DOM element, to set it. The DOM element
-      will be shown in the specified gutter next to the specified
-      line.</dd>
-
-      <dt id="clearGutter"><code><strong>doc.clearGutter</strong>(gutterID: string)</code></dt>
-      <dd>Remove all gutter markers in
-      the <a href="#option_gutters">gutter</a> with the given ID.</dd>
-
-      <dt id="addLineClass"><code><strong>doc.addLineClass</strong>(line: integer|LineHandle, where: string, class: string) 鈫� LineHandle</code></dt>
-      <dd>Set a CSS class name for the given line. <code>line</code>
-      can be a number or a line handle. <code>where</code> determines
-      to which element this class should be applied, can can be one
-      of <code>"text"</code> (the text element, which lies in front of
-      the selection), <code>"background"</code> (a background element
-      that will be behind the selection), <code>"gutter"</code> (the
-      line's gutter space), or <code>"wrap"</code> (the wrapper node
-      that wraps all of the line's elements, including gutter
-      elements). <code>class</code> should be the name of the class to
-      apply.</dd>
-
-      <dt id="removeLineClass"><code><strong>doc.removeLineClass</strong>(line: integer|LineHandle, where: string, class: string) 鈫� LineHandle</code></dt>
-      <dd>Remove a CSS class from a line. <code>line</code> can be a
-      line handle or number. <code>where</code> should be one
-      of <code>"text"</code>, <code>"background"</code>,
-      or <code>"wrap"</code>
-      (see <a href="#addLineClass"><code>addLineClass</code></a>). <code>class</code>
-      can be left off to remove all classes for the specified node, or
-      be a string to remove only a specific class.</dd>
-
-      <dt id="lineInfo"><code><strong>doc.lineInfo</strong>(line: integer|LineHandle) 鈫� object</code></dt>
-      <dd>Returns the line number, text content, and marker status of
-      the given line, which can be either a number or a line handle.
-      The returned object has the structure <code>{line, handle, text,
-      gutterMarkers, textClass, bgClass, wrapClass, widgets}</code>,
-      where <code>gutterMarkers</code> is an object mapping gutter IDs
-      to marker elements, and <code>widgets</code> is an array
-      of <a href="#addLineWidget">line widgets</a> attached to this
-      line, and the various class properties refer to classes added
-      with <a href="#addLineClass"><code>addLineClass</code></a>.</dd>
-
-      <dt id="addWidget"><code><strong>cm.addWidget</strong>(pos: {line, ch}, node: Element, scrollIntoView: boolean)</code></dt>
-      <dd>Puts <code>node</code>, which should be an absolutely
-      positioned DOM node, into the editor, positioned right below the
-      given <code>{line, ch}</code> position.
-      When <code>scrollIntoView</code> is true, the editor will ensure
-      that the entire node is visible (if possible). To remove the
-      widget again, simply use DOM methods (move it somewhere else, or
-      call <code>removeChild</code> on its parent).</dd>
-
-      <dt id="addLineWidget"><code><strong>doc.addLineWidget</strong>(line: integer|LineHandle, node: Element, ?options: object) 鈫� LineWidget</code></dt>
-      <dd>Adds a line widget, an element shown below a line, spanning
-      the whole of the editor's width, and moving the lines below it
-      downwards. <code>line</code> should be either an integer or a
-      line handle, and <code>node</code> should be a DOM node, which
-      will be displayed below the given line. <code>options</code>,
-      when given, should be an object that configures the behavior of
-      the widget. The following options are supported (all default to
-      false):
-        <dl>
-          <dt><code><strong>coverGutter</strong>: boolean</code></dt>
-          <dd>Whether the widget should cover the gutter.</dd>
-          <dt><code><strong>noHScroll</strong>: boolean</code></dt>
-          <dd>Whether the widget should stay fixed in the face of
-          horizontal scrolling.</dd>
-          <dt><code><strong>above</strong>: boolean</code></dt>
-          <dd>Causes the widget to be placed above instead of below
-          the text of the line.</dd>
-          <dt><code><strong>handleMouseEvents</strong>: boolean</code></dt>
-          <dd>Determines whether the editor will capture mouse and
-          drag events occurring in this widget. Default is false鈥攖he
-          events will be left alone for the default browser handler,
-          or specific handlers on the widget, to capture.</dd>
-          <dt><code><strong>insertAt</strong>: integer</code></dt>
-          <dd>By default, the widget is added below other widgets for
-          the line. This option can be used to place it at a different
-          position (zero for the top, N to put it after the Nth other
-          widget). Note that this only has effect once, when the
-          widget is created.
-        </dl>
-      Note that the widget node will become a descendant of nodes with
-      CodeMirror-specific CSS classes, and those classes might in some
-      cases affect it. This method returns an object that represents
-      the widget placement. It'll have a <code>line</code> property
-      pointing at the line handle that it is associated with, and the following methods:
-        <dl>
-          <dt id="widget_clear"><code><strong>clear</strong>()</code></dt><dd>Removes the widget.</dd>
-          <dt id="widget_changed"><code><strong>changed</strong>()</code></dt><dd>Call
-          this if you made some change to the widget's DOM node that
-          might affect its height. It'll force CodeMirror to update
-          the height of the line that contains the widget.</dd>
-        </dl>
-      </dd>
-    </dl>
-
-    <h3 id="api_sizing">Sizing, scrolling and positioning methods</h3>
-
-    <dl>
-      <dt id="setSize"><code><strong>cm.setSize</strong>(width: number|string, height: number|string)</code></dt>
-      <dd>Programmatically set the size of the editor (overriding the
-      applicable <a href="#css-resize">CSS
-      rules</a>). <code>width</code> and <code>height</code>
-      can be either numbers (interpreted as pixels) or CSS units
-      (<code>"100%"</code>, for example). You can
-      pass <code>null</code> for either of them to indicate that that
-      dimension should not be changed.</dd>
-
-      <dt id="scrollTo"><code><strong>cm.scrollTo</strong>(x: number, y: number)</code></dt>
-      <dd>Scroll the editor to a given (pixel) position. Both
-      arguments may be left as <code>null</code>
-      or <code>undefined</code> to have no effect.</dd>
-      <dt id="getScrollInfo"><code><strong>cm.getScrollInfo</strong>() 鈫� {left, top, width, height, clientWidth, clientHeight}</code></dt>
-      <dd>Get an <code>{left, top, width, height, clientWidth,
-      clientHeight}</code> object that represents the current scroll
-      position, the size of the scrollable area, and the size of the
-      visible area (minus scrollbars).</dd>
-      <dt id="scrollIntoView"><code><strong>cm.scrollIntoView</strong>(what: {line, ch}|{left, top, right, bottom}|{from, to}|null, ?margin: number)</code></dt>
-      <dd>Scrolls the given position into view. <code>what</code> may
-      be <code>null</code> to scroll the cursor into view,
-      a <code>{line, ch}</code> position to scroll a character into
-      view, a <code>{left, top, right, bottom}</code> pixel range (in
-      editor-local coordinates), or a range <code>{from, to}</code>
-      containing either two character positions or two pixel squares.
-      The <code>margin</code> parameter is optional. When given, it
-      indicates the amount of vertical pixels around the given area
-      that should be made visible as well.</dd>
-
-      <dt id="cursorCoords"><code><strong>cm.cursorCoords</strong>(where: boolean|{line, ch}, mode: string) 鈫� {left, top, bottom}</code></dt>
-      <dd>Returns an <code>{left, top, bottom}</code> object
-      containing the coordinates of the cursor position.
-      If <code>mode</code> is <code>"local"</code>, they will be
-      relative to the top-left corner of the editable document. If it
-      is <code>"page"</code> or not given, they are relative to the
-      top-left corner of the page. If <code>mode</code>
-      is <code>"window"</code>, the coordinates are relative to the
-      top-left corner of the currently visible (scrolled)
-      window. <code>where</code> can be a boolean indicating whether
-      you want the start (<code>true</code>) or the end
-      (<code>false</code>) of the selection, or, if a <code>{line,
-      ch}</code> object is given, it specifies the precise position at
-      which you want to measure.</dd>
-      <dt id="charCoords"><code><strong>cm.charCoords</strong>(pos: {line, ch}, ?mode: string) 鈫� {left, right, top, bottom}</code></dt>
-      <dd>Returns the position and dimensions of an arbitrary
-      character. <code>pos</code> should be a <code>{line, ch}</code>
-      object. This differs from <code>cursorCoords</code> in that
-      it'll give the size of the whole character, rather than just the
-      position that the cursor would have when it would sit at that
-      position.</dd>
-      <dt id="coordsChar"><code><strong>cm.coordsChar</strong>(object: {left, top}, ?mode: string) 鈫� {line, ch}</code></dt>
-      <dd>Given an <code>{left, top}</code> object, returns
-      the <code>{line, ch}</code> position that corresponds to it. The
-      optional <code>mode</code> parameter determines relative to what
-      the coordinates are interpreted. It may
-      be <code>"window"</code>, <code>"page"</code> (the default),
-      or <code>"local"</code>.</dd>
-      <dt id="lineAtHeight"><code><strong>cm.lineAtHeight</strong>(height: number, ?mode: string) 鈫� number</code></dt>
-      <dd>Computes the line at the given pixel
-      height. <code>mode</code> can be one of the same strings
-      that <a href="#coordsChar"><code>coordsChar</code></a>
-      accepts.</dd>
-      <dt id="heightAtLine"><code><strong>cm.heightAtLine</strong>(line: integer|LineHandle, ?mode: string, ?includeWidgets: bool) 鈫� number</code></dt>
-      <dd>Computes the height of the top of a line, in the coordinate
-      system specified by <code>mode</code>
-      (see <a href="#coordsChar"><code>coordsChar</code></a>), which
-      defaults to <code>"page"</code>. When a line below the bottom of
-      the document is specified, the returned value is the bottom of
-      the last line in the document. By default, the position of the
-      actual text is returned. If `includeWidgets` is true and the
-      line has line widgets, the position above the first line widget
-      is returned.</dd>
-      <dt id="defaultTextHeight"><code><strong>cm.defaultTextHeight</strong>() 鈫� number</code></dt>
-      <dd>Returns the line height of the default font for the editor.</dd>
-      <dt id="defaultCharWidth"><code><strong>cm.defaultCharWidth</strong>() 鈫� number</code></dt>
-      <dd>Returns the pixel width of an 'x' in the default font for
-      the editor. (Note that for non-monospace fonts, this is mostly
-      useless, and even for monospace fonts, non-ascii characters
-      might have a different width).</dd>
-
-      <dt id="getViewport"><code><strong>cm.getViewport</strong>() 鈫� {from: number, to: number}</code></dt>
-      <dd>Returns a <code>{from, to}</code> object indicating the
-      start (inclusive) and end (exclusive) of the currently rendered
-      part of the document. In big documents, when most content is
-      scrolled out of view, CodeMirror will only render the visible
-      part, and a margin around it. See also
-      the <a href="#event_viewportChange"><code>viewportChange</code></a>
-      event.</dd>
-
-      <dt id="refresh"><code><strong>cm.refresh</strong>()</code></dt>
-      <dd>If your code does something to change the size of the editor
-      element (window resizes are already listened for), or unhides
-      it, you should probably follow up by calling this method to
-      ensure CodeMirror is still looking as intended. See also
-      the <a href="#addon_autorefresh">autorefresh addon</a>.</dd>
-    </dl>
-
-    <h3 id="api_mode">Mode, state, and token-related methods</h3>
-
-    <p>When writing language-aware functionality, it can often be
-    useful to hook into the knowledge that the CodeMirror language
-    mode has. See <a href="#modeapi">the section on modes</a> for a
-    more detailed description of how these work.</p>
-
-    <dl>
-      <dt id="getMode"><code><strong>doc.getMode</strong>() 鈫� object</code></dt>
-      <dd>Gets the (outer) mode object for the editor. Note that this
-      is distinct from <code>getOption("mode")</code>, which gives you
-      the mode specification, rather than the resolved, instantiated
-      <a href="#defineMode">mode object</a>.</dd>
-
-      <dt id="getModeAt"><code><strong>cm.getModeAt</strong>(pos: {line, ch}) 鈫� object</code></dt>
-      <dd>Gets the inner mode at a given position. This will return
-      the same as <a href="#getMode"><code>getMode</code></a> for
-      simple modes, but will return an inner mode for nesting modes
-      (such as <code>htmlmixed</code>).</dd>
-
-      <dt id="getTokenAt"><code><strong>cm.getTokenAt</strong>(pos: {line, ch}, ?precise: boolean) 鈫� object</code></dt>
-      <dd>Retrieves information about the token the current mode found
-      before the given position (a <code>{line, ch}</code> object). The
-      returned object has the following properties:
-      <dl>
-        <dt><code><strong>start</strong></code></dt><dd>The character (on the given line) at which the token starts.</dd>
-        <dt><code><strong>end</strong></code></dt><dd>The character at which the token ends.</dd>
-        <dt><code><strong>string</strong></code></dt><dd>The token's string.</dd>
-        <dt><code><strong>type</strong></code></dt><dd>The token type the mode assigned
-        to the token, such as <code>"keyword"</code>
-        or <code>"comment"</code> (may also be null).</dd>
-        <dt><code><strong>state</strong></code></dt><dd>The mode's state at the end of this token.</dd>
-      </dl>
-      If <code>precise</code> is true, the token will be guaranteed to be accurate based on recent edits. If false or
-      not specified, the token will use cached state information, which will be faster but might not be accurate if
-      edits were recently made and highlighting has not yet completed.
-      </dd>
-
-      <dt id="getLineTokens"><code><strong>cm.getLineTokens</strong>(line: integer, ?precise: boolean) 鈫� array&lt;{start, end, string, type, state}&gt;</code></dt>
-      <dd>This is similar
-      to <a href="#getTokenAt"><code>getTokenAt</code></a>, but
-      collects all tokens for a given line into an array. It is much
-      cheaper than repeatedly calling <code>getTokenAt</code>, which
-      re-parses the part of the line before the token for every call.</dd>
-
-      <dt id="getTokenTypeAt"><code><strong>cm.getTokenTypeAt</strong>(pos: {line, ch}) 鈫� string</code></dt>
-      <dd>This is a (much) cheaper version
-      of <a href="#getTokenAt"><code>getTokenAt</code></a> useful for
-      when you just need the type of the token at a given position,
-      and no other information. Will return <code>null</code> for
-      unstyled tokens, and a string, potentially containing multiple
-      space-separated style names, otherwise.</dd>
-
-      <dt id="getHelpers"><code><strong>cm.getHelpers</strong>(pos: {line, ch}, type: string) 鈫� array&lt;helper&gt;</code></dt>
-      <dd>Fetch the set of applicable helper values for the given
-      position. Helpers provide a way to look up functionality
-      appropriate for a mode. The <code>type</code> argument provides
-      the helper namespace (see
-      <a href="#registerHelper"><code>registerHelper</code></a>), in
-      which the values will be looked up. When the mode itself has a
-      property that corresponds to the <code>type</code>, that
-      directly determines the keys that are used to look up the helper
-      values (it may be either a single string, or an array of
-      strings). Failing that, the mode's <code>helperType</code>
-      property and finally the mode's name are used.</dd>
-      <dd>For example, the JavaScript mode has a
-      property <code>fold</code> containing <code>"brace"</code>. When
-      the <code>brace-fold</code> addon is loaded, that defines a
-      helper named <code>brace</code> in the <code>fold</code>
-      namespace. This is then used by
-      the <a href="#addon_foldcode"><code>foldcode</code></a> addon to
-      figure out that it can use that folding function to fold
-      JavaScript code.</dd>
-      <dd>When any <a href="#registerGlobalHelper">'global'</a>
-      helpers are defined for the given namespace, their predicates
-      are called on the current mode and editor, and all those that
-      declare they are applicable will also be added to the array that
-      is returned.</dd>
-
-      <dt id="getHelper"><code><strong>cm.getHelper</strong>(pos: {line, ch}, type: string) 鈫� helper</code></dt>
-      <dd>Returns the first applicable helper value.
-      See <a href="#getHelpers"><code>getHelpers</code></a>.</dd>
-
-      <dt id="getStateAfter"><code><strong>cm.getStateAfter</strong>(?line: integer, ?precise: boolean) 鈫� object</code></dt>
-      <dd>Returns the mode's parser state, if any, at the end of the
-      given line number. If no line number is given, the state at the
-      end of the document is returned. This can be useful for storing
-      parsing errors in the state, or getting other kinds of
-      contextual information for a line. <code>precise</code> is defined
-      as in <code>getTokenAt()</code>.</dd>
-    </dl>
-
-    <h3 id="api_misc">Miscellaneous methods</h3>
-
-    <dl>
-      <dt id="operation"><code><strong>cm.operation</strong>(func: () 鈫� any) 鈫� any</code></dt>
-      <dd>CodeMirror internally buffers changes and only updates its
-      DOM structure after it has finished performing some operation.
-      If you need to perform a lot of operations on a CodeMirror
-      instance, you can call this method with a function argument. It
-      will call the function, buffering up all changes, and only doing
-      the expensive update after the function returns. This can be a
-      lot faster. The return value from this method will be the return
-      value of your function.</dd>
-
-      <dt id="indentLine"><code><strong>cm.indentLine</strong>(line: integer, ?dir: string|integer)</code></dt>
-      <dd>Adjust the indentation of the given line. The second
-      argument (which defaults to <code>"smart"</code>) may be one of:
-        <dl>
-          <dt><code><strong>"prev"</strong></code></dt>
-          <dd>Base indentation on the indentation of the previous line.</dd>
-          <dt><code><strong>"smart"</strong></code></dt>
-          <dd>Use the mode's smart indentation if available, behave
-          like <code>"prev"</code> otherwise.</dd>
-          <dt><code><strong>"add"</strong></code></dt>
-          <dd>Increase the indentation of the line by
-          one <a href="#option_indentUnit">indent unit</a>.</dd>
-          <dt><code><strong>"subtract"</strong></code></dt>
-          <dd>Reduce the indentation of the line.</dd>
-          <dt><code><strong>&lt;integer></strong></code></dt>
-          <dd>Add (positive number) or reduce (negative number) the
-          indentation by the given amount of spaces.</dd>
-        </dl></dd>
-
-      <dt id="toggleOverwrite"><code><strong>cm.toggleOverwrite</strong>(?value: boolean)</code></dt>
-      <dd>Switches between overwrite and normal insert mode (when not
-      given an argument), or sets the overwrite mode to a specific
-      state (when given an argument).</dd>
-
-      <dt id="isReadOnly"><code><strong>cm.isReadOnly</strong>() 鈫� boolean</code></dt>
-      <dd>Tells you whether the editor's content can be edited by the
-      user.</dd>
-
-      <dt id="lineSeparator"><code><strong>doc.lineSeparator</strong>()</code></dt>
-      <dd>Returns the preferred line separator string for this
-      document, as per the <a href="#option_lineSeparator">option</a>
-      by the same name. When that option is <code>null</code>, the
-      string <code>"\n"</code> is returned.</dd>
-
-      <dt id="execCommand"><code><strong>cm.execCommand</strong>(name: string)</code></dt>
-      <dd>Runs the <a href="#commands">command</a> with the given name on the editor.</dd>
-
-      <dt id="posFromIndex"><code><strong>doc.posFromIndex</strong>(index: integer) 鈫� {line, ch}</code></dt>
-      <dd>Calculates and returns a <code>{line, ch}</code> object for a
-      zero-based <code>index</code> who's value is relative to the start of the
-      editor's text. If the <code>index</code> is out of range of the text then
-      the returned object is clipped to start or end of the text
-      respectively.</dd>
-      <dt id="indexFromPos"><code><strong>doc.indexFromPos</strong>(object: {line, ch}) 鈫� integer</code></dt>
-      <dd>The reverse of <a href="#posFromIndex"><code>posFromIndex</code></a>.</dd>
-
-      <dt id="focus"><code><strong>cm.focus</strong>()</code></dt>
-      <dd>Give the editor focus.</dd>
-
-      <dt id="getInputField"><code><strong>cm.getInputField</strong>() 鈫� Element</code></dt>
-      <dd>Returns the input field for the editor. Will be a textarea
-      or an editable div, depending on the value of
-      the <a href="#option_inputStyle"><code>inputStyle</code></a>
-      option.</dd>
-      <dt id="getWrapperElement"><code><strong>cm.getWrapperElement</strong>() 鈫� Element</code></dt>
-      <dd>Returns the DOM node that represents the editor, and
-      controls its size. Remove this from your tree to delete an
-      editor instance.</dd>
-      <dt id="getScrollerElement"><code><strong>cm.getScrollerElement</strong>() 鈫� Element</code></dt>
-      <dd>Returns the DOM node that is responsible for the scrolling
-      of the editor.</dd>
-      <dt id="getGutterElement"><code><strong>cm.getGutterElement</strong>() 鈫� Element</code></dt>
-      <dd>Fetches the DOM node that contains the editor gutters.</dd>
-    </dl>
-
-    <h3 id="api_static">Static properties</h3>
-    <p>The <code>CodeMirror</code> object itself provides
-    several useful properties.</p>
-
-    <dl>
-      <dt id="version"><code><strong>CodeMirror.version</strong>: string</code></dt>
-      <dd>It contains a string that indicates the version of the
-      library. This is a triple of
-      integers <code>"major.minor.patch"</code>,
-      where <code>patch</code> is zero for releases, and something
-      else (usually one) for dev snapshots.</dd>
-
-      <dt id="fromTextArea"><code><strong>CodeMirror.fromTextArea</strong>(textArea: TextAreaElement, ?config: object)</code></dt>
-      <dd>This method provides another way to initialize an editor. It
-      takes a textarea DOM node as first argument and an optional
-      configuration object as second. It will replace the textarea
-      with a CodeMirror instance, and wire up the form of that
-      textarea (if any) to make sure the editor contents are put into
-      the textarea when the form is submitted. The text in the
-      textarea will provide the content for the editor. A CodeMirror
-      instance created this way has three additional methods:
-      <dl>
-        <dt id="save"><code><strong>cm.save</strong>()</code></dt>
-        <dd>Copy the content of the editor into the textarea.</dd>
-
-        <dt id="toTextArea"><code><strong>cm.toTextArea</strong>()</code></dt>
-        <dd>Remove the editor, and restore the original textarea (with
-        the editor's current content). If you dynamically create and
-        destroy editors made with `fromTextArea`, without destroying
-        the form they are part of, you should make sure to call
-        `toTextArea` to remove the editor, or its `"submit"` handler
-        on the form will cause a memory leak.</dd>
-
-        <dt id="getTextArea"><code><strong>cm.getTextArea</strong>() 鈫� TextAreaElement</code></dt>
-        <dd>Returns the textarea that the instance was based on.</dd>
-      </dl>
-      </dd>
-
-      <dt id="defaults"><code><strong>CodeMirror.defaults</strong>: object</code></dt>
-      <dd>An object containing default values for
-      all <a href="#config">options</a>. You can assign to its
-      properties to modify defaults (though this won't affect editors
-      that have already been created).</dd>
-
-      <dt id="defineExtension"><code><strong>CodeMirror.defineExtension</strong>(name: string, value: any)</code></dt>
-      <dd>If you want to define extra methods in terms of the
-      CodeMirror API, it is possible to
-      use <code>defineExtension</code>. This will cause the given
-      value (usually a method) to be added to all CodeMirror instances
-      created from then on.</dd>
-
-      <dt id="defineDocExtension"><code><strong>CodeMirror.defineDocExtension</strong>(name: string, value: any)</code></dt>
-      <dd>Like <a href="#defineExtension"><code>defineExtension</code></a>,
-      but the method will be added to the interface
-      for <a href="#Doc"><code>Doc</code></a> objects instead.</dd>
-
-      <dt id="defineOption"><code><strong>CodeMirror.defineOption</strong>(name: string,
-      default: any, updateFunc: function)</code></dt>
-      <dd>Similarly, <code>defineOption</code> can be used to define new options for
-      CodeMirror. The <code>updateFunc</code> will be called with the
-      editor instance and the new value when an editor is initialized,
-      and whenever the option is modified
-      through <a href="#setOption"><code>setOption</code></a>.</dd>
-
-      <dt id="defineInitHook"><code><strong>CodeMirror.defineInitHook</strong>(func: function)</code></dt>
-      <dd>If your extension just needs to run some
-      code whenever a CodeMirror instance is initialized,
-      use <code>CodeMirror.defineInitHook</code>. Give it a function as
-      its only argument, and from then on, that function will be called
-      (with the instance as argument) whenever a new CodeMirror instance
-      is initialized.</dd>
-
-      <dt id="registerHelper"><code><strong>CodeMirror.registerHelper</strong>(type:聽string, name:聽string, value:聽helper)</code></dt>
-      <dd>Registers a helper value with the given <code>name</code> in
-      the given namespace (<code>type</code>). This is used to define
-      functionality that may be looked up by mode. Will create (if it
-      doesn't already exist) a property on the <code>CodeMirror</code>
-      object for the given <code>type</code>, pointing to an object
-      that maps names to values. I.e. after
-      doing <code>CodeMirror.registerHelper("hint", "foo",
-      myFoo)</code>, the value <code>CodeMirror.hint.foo</code> will
-      point to <code>myFoo</code>.</dd>
-
-      <dt id="registerGlobalHelper"><code><strong>CodeMirror.registerGlobalHelper</strong>(type:聽string, name:聽string, predicate:聽fn(mode,聽CodeMirror), value:聽helper)</code></dt>
-      <dd>Acts
-      like <a href="#registerHelper"><code>registerHelper</code></a>,
-      but also registers this helper as 'global', meaning that it will
-      be included by <a href="#getHelpers"><code>getHelpers</code></a>
-      whenever the given <code>predicate</code> returns true when
-      called with the local mode and editor.</dd>
-
-      <dt id="Pos"><code><strong>CodeMirror.Pos</strong>(line: integer, ?ch: integer, ?sticky: string)</code></dt>
-      <dd>A constructor for the objects that are used to represent
-      positions in editor documents. <code>sticky</code> defaults to
-      null, but can be set to <code>"before"</code>
-      or <code>"after"</code> to make the position explicitly
-      associate with the character before or after it.</dd>
-
-      <dt id="changeEnd"><code><strong>CodeMirror.changeEnd</strong>(change: object) 鈫� {line, ch}</code></dt>
-      <dd>Utility function that computes an end position from a change
-      (an object with <code>from</code>, <code>to</code>,
-      and <code>text</code> properties, as passed to
-      various <a href="#event_change">event handlers</a>). The
-      returned position will be the end of the changed
-      range, <em>after</em> the change is applied.</dd>
-    </dl>
-</section>
-
-<section id=addons>
-    <h2 id="addons">Addons</h2>
-
-    <p>The <code>addon</code> directory in the distribution contains a
-    number of reusable components that implement extra editor
-    functionality (on top of extension functions
-    like <a href="#defineOption"><code>defineOption</code></a>, <a href="#defineExtension"><code>defineExtension</code></a>,
-    and <a href="#registerHelper"><code>registerHelper</code></a>). In
-    brief, they are:</p>
-
-    <dl>
-      <dt id="addon_dialog"><a href="../addon/dialog/dialog.js"><code>dialog/dialog.js</code></a></dt>
-      <dd>Provides a very simple way to query users for text input.
-      Adds the <strong><code>openDialog(template, callback, options) 鈫�
-      closeFunction</code></strong> method to CodeMirror instances,
-      which can be called with an HTML fragment or a detached DOM
-      node that provides the prompt (should include an <code>input</code>
-      or <code>button</code> tag), and a callback function that is called
-      when the user presses enter. It returns a function <code>closeFunction</code>
-      which, if called, will close the dialog immediately.
-      <strong><code>openDialog</code></strong> takes the following options:
-        <dl>
-          <dt><code><strong>closeOnEnter</strong>: bool</code></dt>
-          <dd>If true, the dialog will be closed when the user presses
-          enter in the input. Defaults to <code>true</code>.</dd>
-          <dt><code><strong>closeOnBlur</strong>: bool</code></dt>
-          <dd>Determines whether the dialog is closed when it loses focus. Defaults to <code>true</code>.</dd>
-          <dt><code><strong>onKeyDown</strong>: fn(event: KeyboardEvent, value: string, close: fn()) 鈫� bool</code></dt>
-          <dd>An event handler that will be called whenever <code>keydown</code> fires in the
-          dialog's input. If your callback returns <code>true</code>,
-          the dialog will not do any further processing of the event.</dd>
-          <dt><code><strong>onKeyUp</strong>: fn(event: KeyboardEvent, value: string, close: fn()) 鈫� bool</code></dt>
-          <dd>Same as <code>onKeyDown</code> but for the
-          <code>keyup</code> event.</dd>
-          <dt><code><strong>onInput</strong>: fn(event: InputEvent, value: string, close: fn()) 鈫� bool</code></dt>
-          <dd>Same as <code>onKeyDown</code> but for the
-          <code>input</code> event.</dd>
-          <dt><code><strong>onClose</strong>: fn(instance)</code>:</dt>
-          <dd>A callback that will be called after the dialog has been closed and
-          removed from the DOM. No return value.</dd>
-        </dl>
-
-      <p>Also adds an <strong><code>openNotification(template, options) 鈫�
-      closeFunction</code></strong> function that simply shows an HTML
-      fragment as a notification at the top of the editor. It takes a
-      single option: <code>duration</code>, the amount of time after
-      which the notification will be automatically closed. If <code>
-      duration</code> is zero, the dialog will not be closed automatically.</p>
-
-      <p>Depends on <code>addon/dialog/dialog.css</code>.</p></dd>
-
-      <dt id="addon_searchcursor"><a href="../addon/search/searchcursor.js"><code>search/searchcursor.js</code></a></dt>
-      <dd>Adds the <code>getSearchCursor(query, start, caseFold) 鈫�
-      cursor</code> method to CodeMirror instances, which can be used
-      to implement search/replace functionality. <code>query</code>
-      can be a regular expression or a string (only strings will match
-      across lines鈥攊f they contain newlines). <code>start</code>
-      provides the starting position of the search. It can be
-      a <code>{line, ch}</code> object, or can be left off to default
-      to the start of the document. <code>caseFold</code> is only
-      relevant when matching a string. It will cause the search to be
-      case-insensitive. A search cursor has the following methods:
-        <dl>
-          <dt><code><strong>findNext</strong>() 鈫� boolean</code></dt>
-          <dt><code><strong>findPrevious</strong>() 鈫� boolean</code></dt>
-          <dd>Search forward or backward from the current position.
-          The return value indicates whether a match was found. If
-          matching a regular expression, the return value will be the
-          array returned by the <code>match</code> method, in case you
-          want to extract matched groups.</dd>
-          <dt><code><strong>from</strong>() 鈫� {line, ch}</code></dt>
-          <dt><code><strong>to</strong>() 鈫� {line, ch}</code></dt>
-          <dd>These are only valid when the last call
-          to <code>findNext</code> or <code>findPrevious</code> did
-          not return false. They will return <code>{line, ch}</code>
-          objects pointing at the start and end of the match.</dd>
-          <dt><code><strong>replace</strong>(text: string, ?origin:聽string)</code></dt>
-          <dd>Replaces the currently found match with the given text
-          and adjusts the cursor position to reflect the
-          replacement.</dd>
-        </dl></dd>
-
-      <dt id="addon_search"><a href="../addon/search/search.js"><code>search/search.js</code></a></dt>
-      <dd>Implements the search commands. CodeMirror has keys bound to
-      these by default, but will not do anything with them unless an
-      implementation is provided. Depends
-      on <code>searchcursor.js</code>, and will make use
-      of <a href="#addon_dialog"><code>openDialog</code></a> when
-      available to make prompting for search queries less ugly.</dd>
-
-      <dt id="addon_jump-to-line"><a href="../addon/search/jump-to-line.js"><code>search/jump-to-line.js</code></a></dt>
-      <dd>Implements a <code>jumpToLine</code> command and binding <code>Alt-G</code> to it.
-      Accepts <code>linenumber</code>, <code>+/-linenumber</code>, <code>line:char</code>,
-      <code>scroll%</code> and <code>:linenumber</code> formats.
-      This will make use of <a href="#addon_dialog"><code>openDialog</code></a>
-      when available to make prompting for line number neater.</dd>
-
-      <dt id="addon_matchesonscrollbar"><a href="../addon/search/matchesonscrollbar.js"><code>search/matchesonscrollbar.js</code></a></dt>
-      <dd>Adds a <code>showMatchesOnScrollbar</code> method to editor
-      instances, which should be given a query (string or regular
-      expression), optionally a case-fold flag (only applicable for
-      strings), and optionally a class name (defaults
-      to <code>CodeMirror-search-match</code>) as arguments. When
-      called, matches of the given query will be displayed on the
-      editor's vertical scrollbar. The method returns an object with
-      a <code>clear</code> method that can be called to remove the
-      matches. Depends on
-      the <a href="#addon_annotatescrollbar"><code>annotatescrollbar</code></a>
-      addon, and
-      the <a href="../addon/search/matchesonscrollbar.css"><code>matchesonscrollbar.css</code></a>
-      file provides a default (transparent yellowish) definition of
-      the CSS class applied to the matches. Note that the matches are
-      only perfectly aligned if your scrollbar does not have buttons
-      at the top and bottom. You can use
-      the <a href="#addon_simplescrollbars"><code>simplescrollbar</code></a>
-      addon to make sure of this. If this addon is loaded,
-      the <a href="#addon_search"><code>search</code></a> addon will
-      automatically use it.</dd>
-
-      <dt id="addon_matchbrackets"><a href="../addon/edit/matchbrackets.js"><code>edit/matchbrackets.js</code></a></dt>
-      <dd>Defines an option <code>matchBrackets</code> which, when set
-      to true, causes matching brackets to be highlighted whenever the
-      cursor is next to them. It also adds a
-      method <code>matchBrackets</code> that forces this to happen
-      once, and a method <code>findMatchingBracket</code> that can be
-      used to run the bracket-finding algorithm that this uses
-      internally.</dd>
-
-      <dt id="addon_closebrackets"><a href="../addon/edit/closebrackets.js"><code>edit/closebrackets.js</code></a></dt>
-      <dd>Defines an option <code>autoCloseBrackets</code> that will
-      auto-close brackets and quotes when typed. By default, it'll
-      auto-close <code>()[]{}''""</code>, but you can pass it a string
-      similar to that (containing pairs of matching characters), or an
-      object with <code>pairs</code> and
-      optionally <code>explode</code> properties to customize
-      it. <code>explode</code> should be a similar string that gives
-      the pairs of characters that, when enter is pressed between
-      them, should have the second character also moved to its own
-      line. By default, if the active mode has
-      a <code>closeBrackets</code> property, that overrides the
-      configuration given in the option. But you can add
-      an <code>override</code> property with a truthy value to
-      override mode-specific
-      configuration. <a href="../demo/closebrackets.html">Demo
-      here</a>.</dd>
-
-      <dt id="addon_matchtags"><a href="../addon/edit/matchtags.js"><code>edit/matchtags.js</code></a></dt>
-      <dd>Defines an option <code>matchTags</code> that, when enabled,
-      will cause the tags around the cursor to be highlighted (using
-      the <code>CodeMirror-matchingtag</code> class). Also
-      defines
-      a <a href="#commands">command</a> <code>toMatchingTag</code>,
-      which you can bind a key to in order to jump to the tag matching
-      the one under the cursor. Depends on
-      the <code>addon/fold/xml-fold.js</code>
-      addon. <a href="../demo/matchtags.html">Demo here.</a></dd>
-
-      <dt id="addon_trailingspace"><a href="../addon/edit/trailingspace.js"><code>edit/trailingspace.js</code></a></dt>
-      <dd>Adds an option <code>showTrailingSpace</code> which, when
-      enabled, adds the CSS class <code>cm-trailingspace</code> to
-      stretches of whitespace at the end of lines.
-      The <a href="../demo/trailingspace.html">demo</a> has a nice
-      squiggly underline style for this class.</dd>
-
-      <dt id="addon_closetag"><a href="../addon/edit/closetag.js"><code>edit/closetag.js</code></a></dt>
-      <dd>Defines an <code>autoCloseTags</code> option that will
-      auto-close XML tags when '<code>&gt;</code>' or '<code>/</code>'
-      is typed, and
-      a <code>closeTag</code> <a href="#commands">command</a> that
-      closes the nearest open tag. Depends on
-      the <code>fold/xml-fold.js</code> addon. See
-      the <a href="../demo/closetag.html">demo</a>.</dd>
-
-      <dt id="addon_continuelist"><a href="../addon/edit/continuelist.js"><code>edit/continuelist.js</code></a></dt>
-      <dd>Markdown specific. Defines
-      a <code>"newlineAndIndentContinueMarkdownList"</code> <a href="#commands">command</a>
-      that can be bound to <code>enter</code> to automatically
-      insert the leading characters for continuing a list. See
-      the <a href="../mode/markdown/index.html">Markdown mode
-      demo</a>.</dd>
-
-      <dt id="addon_comment"><a href="../addon/comment/comment.js"><code>comment/comment.js</code></a></dt>
-      <dd>Addon for commenting and uncommenting code. Adds four
-      methods to CodeMirror instances:
-      <dl>
-        <dt id="toggleComment"><code><strong>toggleComment</strong>(from: {line, ch}, to: {line, ch}, ?options: object)</code></dt>
-        <dd>Tries to uncomment the current selection, and if that
-        fails, line-comments it.</dd>
-        <dt id="lineComment"><code><strong>lineComment</strong>(from: {line, ch}, to: {line, ch}, ?options: object)</code></dt>
-        <dd>Set the lines in the given range to be line comments. Will
-        fall back to <code>blockComment</code> when no line comment
-        style is defined for the mode.</dd>
-        <dt id="blockComment"><code><strong>blockComment</strong>(from: {line, ch}, to: {line, ch}, ?options: object)</code></dt>
-        <dd>Wrap the code in the given range in a block comment. Will
-        fall back to <code>lineComment</code> when no block comment
-        style is defined for the mode.</dd>
-        <dt id="uncomment"><code><strong>uncomment</strong>(from: {line, ch}, to: {line, ch}, ?options: object) 鈫� boolean</code></dt>
-        <dd>Try to uncomment the given range.
-          Returns <code>true</code> if a comment range was found and
-          removed, <code>false</code> otherwise.</dd>
-      </dl>
-      The <code>options</code> object accepted by these methods may
-      have the following properties:
-      <dl>
-        <dt><code>blockCommentStart, blockCommentEnd, blockCommentLead, lineComment: string</code></dt>
-        <dd>Override the <a href="#mode_comment">comment string
-        properties</a> of the mode with custom comment strings.</dd>
-        <dt><code><strong>padding</strong>: string</code></dt>
-        <dd>A string that will be inserted after opening and leading
-        markers, and before closing comment markers. Defaults to a
-        single space.</dd>
-        <dt><code><strong>commentBlankLines</strong>: boolean</code></dt>
-        <dd>Whether, when adding line comments, to also comment lines
-        that contain only whitespace.</dd>
-        <dt><code><strong>indent</strong>: boolean</code></dt>
-        <dd>When adding line comments and this is turned on, it will
-        align the comment block to the current indentation of the
-        first line of the block.</dd>
-        <dt><code><strong>fullLines</strong>: boolean</code></dt>
-        <dd>When block commenting, this controls whether the whole
-        lines are indented, or only the precise range that is given.
-        Defaults to <code>true</code>.</dd>
-      </dl>
-      The addon also defines
-      a <code>toggleComment</code> <a href="#commands">command</a>,
-      which is a shorthand command for calling
-      <code>toggleComment</code> with no options.</dd>
-
-      <dt id="addon_foldcode"><a href="../addon/fold/foldcode.js"><code>fold/foldcode.js</code></a></dt>
-      <dd>Helps with code folding. Adds a <code>foldCode</code> method
-      to editor instances, which will try to do a code fold starting
-      at the given line, or unfold the fold that is already present.
-      The method takes as first argument the position that should be
-      folded (may be a line number or
-      a <a href="#Pos"><code>Pos</code></a>), and as second optional
-      argument either a range-finder function, or an options object,
-      supporting the following properties:
-      <dl>
-        <dt><code><strong>rangeFinder</strong>: fn(CodeMirror, Pos)</code></dt>
-        <dd id="helper_fold_auto">The function that is used to find
-        foldable ranges. If this is not directly passed, it will
-        default to <code>CodeMirror.fold.auto</code>, which
-        uses <a href="#getHelpers"><code>getHelpers</code></a> with
-        a <code>"fold"</code> type to find folding functions
-        appropriate for the local mode. There are files in
-        the <a href="../addon/fold/"><code>addon/fold/</code></a>
-        directory providing <code>CodeMirror.fold.brace</code>, which
-        finds blocks in brace languages (JavaScript, C, Java,
-        etc), <code>CodeMirror.fold.indent</code>, for languages where
-        indentation determines block structure (Python, Haskell),
-        and <code>CodeMirror.fold.xml</code>, for XML-style languages,
-        and <code>CodeMirror.fold.comment</code>, for folding comment
-        blocks.</dd>
-        <dt><code><strong>widget</strong>: string|Element</code></dt>
-        <dd>The widget to show for folded ranges. Can be either a
-        string, in which case it'll become a span with
-        class <code>CodeMirror-foldmarker</code>, or a DOM node.</dd>
-        <dt><code><strong>scanUp</strong>: boolean</code></dt>
-        <dd>When true (default is false), the addon will try to find
-        foldable ranges on the lines above the current one if there
-        isn't an eligible one on the given line.</dd>
-        <dt><code><strong>minFoldSize</strong>: integer</code></dt>
-        <dd>The minimum amount of lines that a fold should span to be
-        accepted. Defaults to 0, which also allows single-line
-        folds.</dd>
-      </dl>
-      See <a href="../demo/folding.html">the demo</a> for an
-      example.</dd>
-
-      <dt id="addon_foldgutter"><a href="../addon/fold/foldgutter.js"><code>fold/foldgutter.js</code></a></dt>
-      <dd>Provides an option <code>foldGutter</code>, which can be
-      used to create a gutter with markers indicating the blocks that
-      can be folded. Create a gutter using
-      the <a href="#option_gutters"><code>gutters</code></a> option,
-      giving it the class <code>CodeMirror-foldgutter</code> or
-      something else if you configure the addon to use a different
-      class, and this addon will show markers next to folded and
-      foldable blocks, and handle clicks in this gutter. Note that
-      CSS styles should be applied to make the gutter, and the fold
-      markers within it, visible. A default set of CSS styles are
-      available in:
-      <a href="../addon/fold/foldgutter.css">
-        <code>addon/fold/foldgutter.css</code>
-      </a>.
-      The option
-      can be either set to <code>true</code>, or an object containing
-      the following optional option fields:
-      <dl>
-        <dt><code><strong>gutter</strong>: string</code></dt>
-        <dd>The CSS class of the gutter. Defaults
-        to <code>"CodeMirror-foldgutter"</code>. You will have to
-        style this yourself to give it a width (and possibly a
-        background). See the default gutter style rules above.</dd>
-        <dt><code><strong>indicatorOpen</strong>: string | Element</code></dt>
-        <dd>A CSS class or DOM element to be used as the marker for
-        open, foldable blocks. Defaults
-        to <code>"CodeMirror-foldgutter-open"</code>.</dd>
-        <dt><code><strong>indicatorFolded</strong>: string | Element</code></dt>
-        <dd>A CSS class or DOM element to be used as the marker for
-        folded blocks. Defaults to <code>"CodeMirror-foldgutter-folded"</code>.</dd>
-        <dt><code><strong>rangeFinder</strong>: fn(CodeMirror, Pos)</code></dt>
-        <dd>The range-finder function to use when determining whether
-        something can be folded. When not
-        given, <a href="#helper_fold_auto"><code>CodeMirror.fold.auto</code></a>
-        will be used as default.</dd>
-      </dl>
-      The <code>foldOptions</code> editor option can be set to an
-      object to provide an editor-wide default configuration.
-      Demo <a href="../demo/folding.html">here</a>.</dd>
-
-      <dt id="addon_runmode"><a href="../addon/runmode/runmode.js"><code>runmode/runmode.js</code></a></dt>
-      <dd>Can be used to run a CodeMirror mode over text without
-      actually opening an editor instance.
-      See <a href="../demo/runmode.html">the demo</a> for an example.
-      There are alternate versions of the file available for
-      running <a href="../addon/runmode/runmode-standalone.js">stand-alone</a>
-      (without including all of CodeMirror) and
-      for <a href="../addon/runmode/runmode.node.js">running under
-      node.js</a> (see <code>bin/source-highlight</code> for an example of using the latter).</dd>
-
-      <dt id="addon_colorize"><a href="../addon/runmode/colorize.js"><code>runmode/colorize.js</code></a></dt>
-      <dd>Provides a convenient way to syntax-highlight code snippets
-      in a webpage. Depends on
-      the <a href="#addon_runmode"><code>runmode</code></a> addon (or
-      its standalone variant). Provides
-      a <code>CodeMirror.colorize</code> function that can be called
-      with an array (or other array-ish collection) of DOM nodes that
-      represent the code snippets. By default, it'll get
-      all <code>pre</code> tags. Will read the <code>data-lang</code>
-      attribute of these nodes to figure out their language, and
-      syntax-color their content using the relevant CodeMirror mode
-      (you'll have to load the scripts for the relevant modes
-      yourself). A second argument may be provided to give a default
-      mode, used when no language attribute is found for a node. Used
-      in this manual to highlight example code.</dd>
-
-      <dt id="addon_overlay"><a href="../addon/mode/overlay.js"><code>mode/overlay.js</code></a></dt>
-      <dd>Mode combinator that can be used to extend a mode with an
-      'overlay' 鈥� a secondary mode is run over the stream, along with
-      the base mode, and can color specific pieces of text without
-      interfering with the base mode.
-      Defines <code>CodeMirror.overlayMode</code>, which is used to
-      create such a mode. See <a href="../demo/mustache.html">this
-      demo</a> for a detailed example.</dd>
-
-      <dt id="addon_multiplex"><a href="../addon/mode/multiplex.js"><code>mode/multiplex.js</code></a></dt>
-      <dd>Mode combinator that can be used to easily 'multiplex'
-      between several modes.
-      Defines <code>CodeMirror.multiplexingMode</code> which, when
-      given as first argument a mode object, and as other arguments
-      any number of <code>{open, close, mode [, delimStyle, innerStyle, parseDelimiters]}</code>
-      objects, will return a mode object that starts parsing using the
-      mode passed as first argument, but will switch to another mode
-      as soon as it encounters a string that occurs in one of
-      the <code>open</code> fields of the passed objects. When in a
-      sub-mode, it will go back to the top mode again when
-      the <code>close</code> string is encountered.
-      Pass <code>"\n"</code> for <code>open</code> or <code>close</code>
-      if you want to switch on a blank line.
-      <ul><li>When <code>delimStyle</code> is specified, it will be the token
-      style returned for the delimiter tokens (as well as
-      <code>[delimStyle]-open</code> on the opening token and
-      <code>[delimStyle]-close</code> on the closing token).</li>
-      <li>When <code>innerStyle</code> is specified, it will be the token
-      style added for each inner mode token.</li>
-      <li>When <code>parseDelimiters</code> is true, the content of
-      the delimiters will also be passed to the inner mode.
-      (And <code>delimStyle</code> is ignored.)</li></ul> The outer
-      mode will not see the content between the delimiters.
-      See <a href="../demo/multiplex.html">this demo</a> for an
-      example.</dd>
-
-      <dt id="addon_show-hint"><a href="../addon/hint/show-hint.js"><code>hint/show-hint.js</code></a></dt>
-      <dd>Provides a framework for showing autocompletion hints.
-      Defines <code>editor.showHint</code>, which takes an optional
-      options object, and pops up a widget that allows the user to
-      select a completion. Finding hints is done with a hinting
-      functions (the <code>hint</code> option), which is a function
-      that take an editor instance and options object, and return
-      a <code>{list, from, to}</code> object, where <code>list</code>
-      is an array of strings or objects (the completions),
-      and <code>from</code> and <code>to</code> give the start and end
-      of the token that is being completed as <code>{line, ch}</code>
-      objects. An optional <code>selectedHint</code> property (an
-      integer) can be added to the completion object to control the
-      initially selected hint.</dd>
-      <dd>If no hinting function is given, the addon will
-      use <code>CodeMirror.hint.auto</code>, which
-      calls <a href="#getHelpers"><code>getHelpers</code></a> with
-      the <code>"hint"</code> type to find applicable hinting
-      functions, and tries them one by one. If that fails, it looks
-      for a <code>"hintWords"</code> helper to fetch a list of
-      completable words for the mode, and
-      uses <code>CodeMirror.hint.fromList</code> to complete from
-      those.</dd>
-      <dd>When completions aren't simple strings, they should be
-      objects with the following properties:
-      <dl>
-        <dt><code><strong>text</strong>: string</code></dt>
-        <dd>The completion text. This is the only required
-        property.</dd>
-        <dt><code><strong>displayText</strong>: string</code></dt>
-        <dd>The text that should be displayed in the menu.</dd>
-        <dt><code><strong>className</strong>: string</code></dt>
-        <dd>A CSS class name to apply to the completion's line in the
-        menu.</dd>
-        <dt><code><strong>render</strong>: fn(Element, self, data)</code></dt>
-        <dd>A method used to create the DOM structure for showing the
-        completion by appending it to its first argument.</dd>
-        <dt><code><strong>hint</strong>: fn(CodeMirror, self, data)</code></dt>
-        <dd>A method used to actually apply the completion, instead of
-        the default behavior.</dd>
-        <dt><code><strong>from</strong>: {line, ch}</code></dt>
-        <dd>Optional <code>from</code> position that will be used by <code>pick()</code> instead
-        of the global one passed with the full list of completions.</dd>
-        <dt><code><strong>to</strong>: {line, ch}</code></dt>
-        <dd>Optional <code>to</code> position that will be used by <code>pick()</code> instead
-        of the global one passed with the full list of completions.</dd>
-      </dl></dd>
-
-      <dd>The plugin understands the following options (the options object
-      will also be passed along to the hinting function, which may
-      understand additional options):
-      <dl>
-        <dt><code><strong>hint</strong>: function</code></dt>
-        <dd>A hinting function, as specified above. It is possible to
-        set the <code>async</code> property on a hinting function to
-        true, in which case it will be called with
-        arguments <code>(cm, callback, ?options)</code>, and the
-        completion interface will only be popped up when the hinting
-        function calls the callback, passing it the object holding the
-        completions.
-        The hinting function can also return a promise, and the completion
-        interface will only be popped when the promise resolves.
-        By default, hinting only works when there is no
-        selection. You can give a hinting function
-        a <code>supportsSelection</code> property with a truthy value
-        to indicate that it supports selections.</dd>
-        <dt><code><strong>completeSingle</strong>: boolean</code></dt>
-        <dd>Determines whether, when only a single completion is
-        available, it is completed without showing the dialog.
-        Defaults to true.</dd>
-        <dt><code><strong>alignWithWord</strong>: boolean</code></dt>
-        <dd>Whether the pop-up should be horizontally aligned with the
-        start of the word (true, default), or with the cursor (false).</dd>
-        <dt><code><strong>closeOnUnfocus</strong>: boolean</code></dt>
-        <dd>When enabled (which is the default), the pop-up will close
-        when the editor is unfocused.</dd>
-        <dt><code><strong>customKeys</strong>: keymap</code></dt>
-        <dd>Allows you to provide a custom key map of keys to be active
-        when the pop-up is active. The handlers will be called with an
-        extra argument, a handle to the completion menu, which
-        has <code>moveFocus(n)</code>, <code>setFocus(n)</code>, <code>pick()</code>,
-        and <code>close()</code> methods (see the source for details),
-        that can be used to change the focused element, pick the
-        current element or close the menu. Additionally <code>menuSize()</code>
-        can give you access to the size of the current dropdown menu,
-        <code>length</code> give you the number of available completions, and
-        <code>data</code> give you full access to the completion returned by the
-        hinting function.</dd>
-        <dt><code><strong>extraKeys</strong>: keymap</code></dt>
-        <dd>Like <code>customKeys</code> above, but the bindings will
-        be added to the set of default bindings, instead of replacing
-        them.</dd>
-      </dl>
-      The following events will be fired on the completions object
-      during completion:
-      <dl>
-        <dt><code><strong>"shown"</strong> ()</code></dt>
-        <dd>Fired when the pop-up is shown.</dd>
-        <dt><code><strong>"select"</strong> (completion, Element)</code></dt>
-        <dd>Fired when a completion is selected. Passed the completion
-        value (string or object) and the DOM node that represents it
-        in the menu.</dd>
-        <dt><code><strong>"pick"</strong> (completion)</code></dt>
-        <dd>Fired when a completion is picked. Passed the completion value
-        (string or object).</dd>
-        <dt><code><strong>"close"</strong> ()</code></dt>
-        <dd>Fired when the completion is finished.</dd>
-      </dl>
-      This addon depends on styles
-      from <code>addon/hint/show-hint.css</code>. Check
-      out <a href="../demo/complete.html">the demo</a> for an
-      example.</dd>
-
-      <dt id="addon_javascript-hint"><a href="../addon/hint/javascript-hint.js"><code>hint/javascript-hint.js</code></a></dt>
-      <dd>Defines a simple hinting function for JavaScript
-      (<code>CodeMirror.hint.javascript</code>) and CoffeeScript
-      (<code>CodeMirror.hint.coffeescript</code>) code. This will
-      simply use the JavaScript environment that the editor runs in as
-      a source of information about objects and their properties.</dd>
-
-      <dt id="addon_xml-hint"><a href="../addon/hint/xml-hint.js"><code>hint/xml-hint.js</code></a></dt>
-      <dd>Defines <code>CodeMirror.hint.xml</code>, which produces
-      hints for XML tagnames, attribute names, and attribute values,
-      guided by a <code>schemaInfo</code> option (a property of the
-      second argument passed to the hinting function, or the third
-      argument passed to <code>CodeMirror.showHint</code>).<br>The
-      schema info should be an object mapping tag names to information
-      about these tags, with optionally a <code>"!top"</code> property
-      containing a list of the names of valid top-level tags. The
-      values of the properties should be objects with optional
-      properties <code>children</code> (an array of valid child
-      element names, omit to simply allow all tags to appear)
-      and <code>attrs</code> (an object mapping attribute names
-      to <code>null</code> for free-form attributes, and an array of
-      valid values for restricted
-      attributes). <a href="../demo/xmlcomplete.html">Demo
-      here.</a></dd>
-
-      <dt id="addon_html-hint"><a href="../addon/hint/html-hint.js"><code>hint/html-hint.js</code></a></dt>
-      <dd>Provides schema info to
-      the <a href="#addon_xml-hint">xml-hint</a> addon for HTML
-      documents. Defines a schema
-      object <code>CodeMirror.htmlSchema</code> that you can pass to
-      as a <code>schemaInfo</code> option, and
-      a <code>CodeMirror.hint.html</code> hinting function that
-      automatically calls <code>CodeMirror.hint.xml</code> with this
-      schema data. See
-      the <a href="../demo/html5complete.html">demo</a>.</dd>
-
-      <dt id="addon_css-hint"><a href="../addon/hint/css-hint.js"><code>hint/css-hint.js</code></a></dt>
-      <dd>A hinting function for CSS, SCSS, or LESS code.
-      Defines <code>CodeMirror.hint.css</code>.</dd>
-
-      <dt id="addon_anyword-hint"><a href="../addon/hint/anyword-hint.js"><code>hint/anyword-hint.js</code></a></dt>
-      <dd>A very simple hinting function
-      (<code>CodeMirror.hint.anyword</code>) that simply looks for
-      words in the nearby code and completes to those. Takes two
-      optional options, <code>word</code>, a regular expression that
-      matches words (sequences of one or more character),
-      and <code>range</code>, which defines how many lines the addon
-      should scan when completing (defaults to 500).</dd>
-
-      <dt id="addon_sql-hint"><a href="../addon/hint/sql-hint.js"><code>hint/sql-hint.js</code></a></dt>
-      <dd>A simple SQL hinter. Defines <code>CodeMirror.hint.sql</code>.
-      Takes two optional options, <code>tables</code>, a object with
-      table names as keys and array of respective column names as values,
-      and <code>defaultTable</code>, a string corresponding to a
-      table name in <code>tables</code> for autocompletion.</dd>
-
-      <dt id="addon_match-highlighter"><a href="../addon/search/match-highlighter.js"><code>search/match-highlighter.js</code></a></dt>
-      <dd>Adds a <code>highlightSelectionMatches</code> option that
-      can be enabled to highlight all instances of a currently
-      selected word. Can be set either to true or to an object
-      containing the following options: <code>minChars</code>, for the
-      minimum amount of selected characters that triggers a highlight
-      (default 2), <code>style</code>, for the style to be used to
-      highlight the matches (default <code>"matchhighlight"</code>,
-      which will correspond to CSS
-      class <code>cm-matchhighlight</code>), <code>trim</code>, which
-      controls whether whitespace is trimmed from the selection,
-      and <code>showToken</code> which can be set to <code>true</code>
-      or to a regexp matching the characters that make up a word. When
-      enabled, it causes the current word to be highlighted when
-      nothing is selected (defaults to off).
-      Demo <a href="../demo/matchhighlighter.html">here</a>.</dd>
-
-      <dt id="addon_lint"><a href="../addon/lint/lint.js"><code>lint/lint.js</code></a></dt>
-      <dd>Defines an interface component for showing linting warnings,
-      with pluggable warning sources
-      (see <a href="../addon/lint/html-lint.js"><code>html-lint.js</code></a>,
-      <a href="../addon/lint/json-lint.js"><code>json-lint.js</code></a>,
-      <a href="../addon/lint/javascript-lint.js"><code>javascript-lint.js</code></a>,
-      <a href="../addon/lint/coffeescript-lint.js"><code>coffeescript-lint.js</code></a>,
-      and <a href="../addon/lint/css-lint.js"><code>css-lint.js</code></a>
-      in the same directory). Defines a <code>lint</code> option that
-      can be set to an annotation source (for
-      example <code>CodeMirror.lint.javascript</code>), to an options
-      object (in which case the <code>getAnnotations</code> field is
-      used as annotation source), or simply to <code>true</code>. When
-      no annotation source is
-      specified, <a href="#getHelper"><code>getHelper</code></a> with
-      type <code>"lint"</code> is used to find an annotation function.
-      An annotation source function should, when given a document
-      string, an options object, and an editor instance, return an
-      array of <code>{message, severity, from, to}</code> objects
-      representing problems. When the function has
-      an <code>async</code> property with a truthy value, it will be
-      called with an additional second argument, which is a callback
-      to pass the array to. By default, the linter will run
-      (debounced) whenever the document is changed. You can pass
-      a <code>lintOnChange: false</code> option to disable that.
-      Depends on <code>addon/lint/lint.css</code>. A demo can be
-      found <a href="../demo/lint.html">here</a>.</dd>
-
-      <dt id="addon_mark-selection"><a href="../addon/selection/mark-selection.js"><code>selection/mark-selection.js</code></a></dt>
-      <dd>Causes the selected text to be marked with the CSS class
-      <code>CodeMirror-selectedtext</code> when the <code>styleSelectedText</code> option
-      is enabled. Useful to change the colour of the selection (in addition to the background),
-      like in <a href="../demo/markselection.html">this demo</a>.</dd>
-
-      <dt id="addon_active-line"><a href="../addon/selection/active-line.js"><code>selection/active-line.js</code></a></dt>
-      <dd>Defines a <code>styleActiveLine</code> option that, when
-      enabled, gives the wrapper of the line that contains the cursor
-      the class <code>CodeMirror-activeline</code>, adds a background
-      with the class <code>CodeMirror-activeline-background</code>,
-      and adds the class <code>CodeMirror-activeline-gutter</code> to
-      the line's gutter space is enabled. The option's value may be a
-      boolean or an object specifying the following options:
-        <dl>
-          <dt><code><strong>nonEmpty</strong>: bool</code></dt>
-          <dd>Controls whether single-line selections, or just cursor
-          selections, are styled. Defaults to false (only cursor
-          selections).</dd>
-        </dl>
-      See the <a href="../demo/activeline.html">demo</a>.</dd>
-
-      <dt id="addon_selection-pointer"><a href="../addon/selection/selection-pointer.js"><code>selection/selection-pointer.js</code></a></dt>
-      <dd>Defines a <code>selectionPointer</code> option which you can
-      use to control the mouse cursor appearance when hovering over
-      the selection. It can be set to a string,
-      like <code>"pointer"</code>, or to true, in which case
-      the <code>"default"</code> (arrow) cursor will be used. You can
-      see a demo <a href="../mode/htmlmixed/index.html">here</a>.</dd>
-
-      <dt id="addon_loadmode"><a href="../addon/mode/loadmode.js"><code>mode/loadmode.js</code></a></dt>
-      <dd>Defines a <code>CodeMirror.requireMode(modename,
-      callback)</code> function that will try to load a given mode and
-      call the callback when it succeeded. You'll have to
-      set <code>CodeMirror.modeURL</code> to a string that mode paths
-      can be constructed from, for
-      example <code>"mode/%N/%N.js"</code>鈥攖he <code>%N</code>'s will
-      be replaced with the mode name. Also
-      defines <code>CodeMirror.autoLoadMode(instance, mode)</code>,
-      which will ensure the given mode is loaded and cause the given
-      editor instance to refresh its mode when the loading
-      succeeded. See the <a href="../demo/loadmode.html">demo</a>.</dd>
-
-      <dt id="addon_meta"><a href="../mode/meta.js"><code>mode/meta.js</code></a></dt>
-      <dd>Provides meta-information about all the modes in the
-      distribution in a single file.
-      Defines <code>CodeMirror.modeInfo</code>, an array of objects
-      with <code>{name, mime, mode}</code> properties,
-      where <code>name</code> is the human-readable
-      name, <code>mime</code> the MIME type, and <code>mode</code> the
-      name of the mode file that defines this MIME. There are optional
-      properties <code>mimes</code>, which holds an array of MIME
-      types for modes with multiple MIMEs associated,
-      and <code>ext</code>, which holds an array of file extensions
-      associated with this mode. Four convenience
-      functions, <code>CodeMirror.findModeByMIME</code>,
-      <code>CodeMirror.findModeByExtension</code>,
-      <code>CodeMirror.findModeByFileName</code>
-      and <code>CodeMirror.findModeByName</code> are provided, which
-      return such an object given a MIME, extension, file name or mode name
-      string. Note that, for historical reasons, this file resides in the
-      top-level <code>mode</code> directory, not
-      under <code>addon</code>. <a href="../demo/loadmode.html">Demo</a>.</dd>
-
-      <dt id="addon_continuecomment"><a href="../addon/comment/continuecomment.js"><code>comment/continuecomment.js</code></a></dt>
-      <dd>Adds a <code>continueComments</code> option, which sets whether the
-      editor will make the next line continue a comment when you press Enter
-      inside a comment block. Can be set to a boolean to enable/disable this
-      functionality. Set to a string, it will continue comments using a custom
-      shortcut. Set to an object, it will use the <code>key</code> property for
-      a custom shortcut and the boolean <code>continueLineComment</code>
-      property to determine whether single-line comments should be continued
-      (defaulting to <code>true</code>).</dd>
-
-      <dt id="addon_placeholder"><a href="../addon/display/placeholder.js"><code>display/placeholder.js</code></a></dt>
-      <dd>Adds a <code>placeholder</code> option that can be used to
-      make content appear in the editor when it is empty and not
-      focused. It can hold either a string or a DOM node. Also gives
-      the editor a <code>CodeMirror-empty</code> CSS class whenever it
-      doesn't contain any text.
-      See <a href="../demo/placeholder.html">the demo</a>.</dd>
-
-      <dt id="addon_fullscreen"><a href="../addon/display/fullscreen.js"><code>display/fullscreen.js</code></a></dt>
-      <dd>Defines an option <code>fullScreen</code> that, when set
-      to <code>true</code>, will make the editor full-screen (as in,
-      taking up the whole browser window). Depends
-      on <a href="../addon/display/fullscreen.css"><code>fullscreen.css</code></a>. <a href="../demo/fullscreen.html">Demo
-      here</a>.</dd>
-
-      <dt id="addon_autorefresh"><a href="../addon/display/autorefresh.js"><code>display/autorefresh.js</code></a></dt>
-      <dd>This addon can be useful when initializing an editor in a
-      hidden DOM node, in cases where it is difficult to
-      call <a href="#refresh"><code>refresh</code></a> when the editor
-      becomes visible. It defines an option <code>autoRefresh</code>
-      which you can set to true to ensure that, if the editor wasn't
-      visible on initialization, it will be refreshed the first time
-      it becomes visible. This is done by polling every 250
-      milliseconds (you can pass a value like <code>{delay:
-      500}</code> as the option value to configure this). Note that
-      this addon will only refresh the editor <em>once</em> when it
-      first becomes visible, and won't take care of further restyling
-      and resizing.</dd>
-
-      <dt id="addon_simplescrollbars"><a href="../addon/scroll/simplescrollbars.js"><code>scroll/simplescrollbars.js</code></a></dt>
-      <dd>Defines two additional scrollbar
-      models, <code>"simple"</code> and <code>"overlay"</code>
-      (see <a href="../demo/simplescrollbars.html">demo</a>) that can
-      be selected with
-      the <a href="#option_scrollbarStyle"><code>scrollbarStyle</code></a>
-      option. Depends
-      on <a href="../addon/scroll/simplescrollbars.css"><code>simplescrollbars.css</code></a>,
-      which can be further overridden to style your own
-      scrollbars.</dd>
-
-      <dt id="addon_annotatescrollbar"><a href="../addon/scroll/annotatescrollbar.js"><code>scroll/annotatescrollbar.js</code></a></dt>
-      <dd>Provides functionality for showing markers on the scrollbar
-      to call out certain parts of the document. Adds a
-      method <code>annotateScrollbar</code> to editor instances that
-      can be called, with a CSS class name as argument, to create a
-      set of annotations. The method returns an object
-      whose <code>update</code> method can be called with a sorted array
-      of <code>{from: Pos, to: Pos}</code> objects marking the ranges
-      to be highlighted. To detach the annotations, call the
-      object's <code>clear</code> method.</dd>
-
-      <dt id="addon_rulers"><a href="../addon/display/rulers.js"><code>display/rulers.js</code></a></dt>
-      <dd>Adds a <code>rulers</code> option, which can be used to show
-      one or more vertical rulers in the editor. The option, if
-      defined, should be given an array of <code>{column [, className,
-      color, lineStyle, width]}</code> objects or numbers (which
-      indicate a column). The ruler will be displayed at the column
-      indicated by the number or the <code>column</code> property.
-      The <code>className</code> property can be used to assign a
-      custom style to a ruler. <a href="../demo/rulers.html">Demo
-      here</a>.</dd>
-
-      <dt id="addon_panel"><a href="../addon/display/panel.js"><code>display/panel.js</code></a></dt>
-      <dd>Defines an <code>addPanel</code> method for CodeMirror
-      instances, which places a DOM node above or below an editor, and
-      shrinks the editor to make room for the node. The method takes
-      as first argument as DOM node, and as second an optional options
-      object. The <code>Panel</code> object returned by this method
-      has a <code>clear</code> method that is used to remove the
-      panel, and a <code>changed</code> method that can be used to
-      notify the addon when the size of the panel's DOM node has
-      changed.<br/>
-      The method accepts the following options:
-      <dl>
-        <dt><code><strong>position</strong>: string</code></dt>
-        <dd>Controls the position of the newly added panel. The
-        following values are recognized:
-          <dl>
-            <dt><code><strong>top</strong> (default)</code></dt>
-            <dd>Adds the panel at the very top.</dd>
-            <dt><code><strong>after-top</strong></code></dt>
-            <dd>Adds the panel at the bottom of the top panels.</dd>
-            <dt><code><strong>bottom</strong></code></dt>
-            <dd>Adds the panel at the very bottom.</dd>
-            <dt><code><strong>before-bottom</strong></code></dt>
-            <dd>Adds the panel at the top of the bottom panels.</dd>
-          </dl>
-        </dd>
-        <dt><code><strong>before</strong>: Panel</code></dt>
-        <dd>The new panel will be added before the given panel.</dd>
-        <dt><code><strong>after</strong>: Panel</code></dt>
-        <dd>The new panel will be added after the given panel.</dd>
-        <dt><code><strong>replace</strong>: Panel</code></dt>
-        <dd>The new panel will replace the given panel.</dd>
-        <dt><code><strong>stable</strong>: bool</code></dt>
-        <dd>Whether to scroll the editor to keep the text's vertical
-        position stable, when adding a panel above it. Defaults to false.</dd>
-      </dl>
-      When using the <code>after</code>, <code>before</code> or <code>replace</code> options,
-      if the panel doesn't exists or has been removed,
-      the value of the <code>position</code> option will be used as a fallback.
-      <br>
-      A demo of the addon is available <a href="../demo/panel.html">here</a>.
-      </dd>
-
-      <dt id="addon_hardwrap"><a href="../addon/wrap/hardwrap.js"><code>wrap/hardwrap.js</code></a></dt>
-      <dd>Addon to perform hard line wrapping/breaking for paragraphs
-      of text. Adds these methods to editor instances:
-        <dl>
-          <dt><code><strong>wrapParagraph</strong>(?pos: {line, ch}, ?options: object)</code></dt>
-          <dd>Wraps the paragraph at the given position.
-          If <code>pos</code> is not given, it defaults to the cursor
-          position.</dd>
-          <dt><code><strong>wrapRange</strong>(from: {line, ch}, to: {line, ch}, ?options: object)</code></dt>
-          <dd>Wraps the given range as one big paragraph.</dd>
-          <dt><code><strong>wrapParagraphsInRange</strong>(from: {line, ch}, to: {line, ch}, ?options: object)</code></dt>
-          <dd>Wraps the paragraphs in (and overlapping with) the
-          given range individually.</dd>
-        </dl>
-        The following options are recognized:
-        <dl>
-          <dt><code><strong>paragraphStart</strong>, <strong>paragraphEnd</strong>: RegExp</code></dt>
-          <dd>Blank lines are always considered paragraph boundaries.
-          These options can be used to specify a pattern that causes
-          lines to be considered the start or end of a paragraph.</dd>
-          <dt><code><strong>column</strong>: number</code></dt>
-          <dd>The column to wrap at. Defaults to 80.</dd>
-          <dt><code><strong>wrapOn</strong>: RegExp</code></dt>
-          <dd>A regular expression that matches only those
-          two-character strings that allow wrapping. By default, the
-          addon wraps on whitespace and after dash characters.</dd>
-          <dt><code><strong>killTrailingSpace</strong>: boolean</code></dt>
-          <dd>Whether trailing space caused by wrapping should be
-          preserved, or deleted. Defaults to true.</dd>
-        </dl>
-        A demo of the addon is available <a href="../demo/hardwrap.html">here</a>.
-      </dd>
-
-      <dt id="addon_merge"><a href="../addon/merge/merge.js"><code>merge/merge.js</code></a></dt>
-      <dd>Implements an interface for merging changes, using either a
-      2-way or a 3-way view. The <code>CodeMirror.MergeView</code>
-      constructor takes arguments similar to
-      the <a href="#CodeMirror"><code>CodeMirror</code></a>
-      constructor, first a node to append the interface to, and then
-      an options object. Options are passed through to the editors
-      inside the view. These extra options are recognized:
-        <dl>
-          <dt><code><strong>origLeft</strong></code> and <code><strong>origRight</strong>: string</code></dt>
-          <dd>If given these provide original versions of the
-          document, which will be shown to the left and right of the
-          editor in non-editable CodeMirror instances. The merge
-          interface will highlight changes between the editable
-          document and the original(s). To create a 2-way (as opposed
-          to 3-way) merge view, provide only one of them.</dd>
-          <dt><code><strong>revertButtons</strong>: boolean</code></dt>
-          <dd>Determines whether buttons that allow the user to revert
-          changes are shown. Defaults to true.</dd>
-          <dt><code><strong>revertChunk</strong>: fn(mv: MergeView, from: CodeMirror, fromStart: Pos, fromEnd: Pos, to: CodeMirror, toStart: Pos, toEnd: Pos)</code></dt>
-          <dd>Can be used to define custom behavior when the user
-          reverts a changed chunk.</dd>
-          <dt><code><strong>connect</strong>: string</code></dt>
-          <dd>Sets the style used to connect changed chunks of code.
-          By default, connectors are drawn. When this is set
-          to <code>"align"</code>, the smaller chunk is padded to
-          align with the bigger chunk instead.</dd>
-          <dt><code><strong>collapseIdentical</strong>: boolean|number</code></dt>
-          <dd>When true (default is false), stretches of unchanged
-          text will be collapsed. When a number is given, this
-          indicates the amount of lines to leave visible around such
-          stretches (which defaults to 2).</dd>
-          <dt><code><strong>allowEditingOriginals</strong>: boolean</code></dt>
-          <dd>Determines whether the original editor allows editing.
-          Defaults to false.</dd>
-          <dt><code><strong>showDifferences</strong>: boolean</code></dt>
-          <dd>When true (the default), changed pieces of text are
-          highlighted.</dd>
-          <dt><code><strong>chunkClassLocation</strong>: string|Array</code></dt>
-          <dd>By default the chunk highlights are added
-          using <a href="#addLineClass"><code>addLineClass</code></a>
-          with "background". Override this to customize it to be any
-          valid `where` parameter or an Array of valid `where`
-          parameters.</dd>
-        </dl>
-        The addon also defines commands <code>"goNextDiff"</code>
-        and <code>"goPrevDiff"</code> to quickly jump to the next
-        changed chunk. <a href="../demo/merge.html">Demo
-        here</a>.</dd>
-
-      <dt id="addon_tern"><a href="../addon/tern/tern.js"><code>tern/tern.js</code></a></dt>
-      <dd>Provides integration with
-      the <a href="http://ternjs.net">Tern</a> JavaScript analysis
-      engine, for completion, definition finding, and minor
-      refactoring help. See the <a href="../demo/tern.html">demo</a>
-      for a very simple integration. For more involved scenarios, see
-      the comments at the top of
-      the <a href="../addon/tern/tern.js">addon</a> and the
-      implementation of the
-      (multi-file) <a href="http://ternjs.net/doc/demo.html">demonstration
-      on the Tern website</a>.</dd>
-    </dl>
-</section>
-
-<section id=modeapi>
-    <h2>Writing CodeMirror Modes</h2>
-
-    <p>Modes typically consist of a single JavaScript file. This file
-    defines, in the simplest case, a lexer (tokenizer) for your
-    language鈥攁 function that takes a character stream as input,
-    advances it past a token, and returns a style for that token. More
-    advanced modes can also handle indentation for the language.</p>
-
-    <p>This section describes the low-level mode interface. Many modes
-    are written directly against this, since it offers a lot of
-    control, but for a quick mode definition, you might want to use
-    the <a href="../demo/simplemode.html">simple mode addon</a>.</p>
-
-    <p id="defineMode">The mode script should
-    call <code><strong>CodeMirror.defineMode</strong></code> to
-    register itself with CodeMirror. This function takes two
-    arguments. The first should be the name of the mode, for which you
-    should use a lowercase string, preferably one that is also the
-    name of the files that define the mode (i.e. <code>"xml"</code> is
-    defined in <code>xml.js</code>). The second argument should be a
-    function that, given a CodeMirror configuration object (the thing
-    passed to the <code>CodeMirror</code> function) and an optional
-    mode configuration object (as in
-    the <a href="#option_mode"><code>mode</code></a> option), returns
-    a mode object.</p>
-
-    <p>Typically, you should use this second argument
-    to <code>defineMode</code> as your module scope function (modes
-    should not leak anything into the global scope!), i.e. write your
-    whole mode inside this function.</p>
-
-    <p>The main responsibility of a mode script is <em>parsing</em>
-    the content of the editor. Depending on the language and the
-    amount of functionality desired, this can be done in really easy
-    or extremely complicated ways. Some parsers can be stateless,
-    meaning that they look at one element (<em>token</em>) of the code
-    at a time, with no memory of what came before. Most, however, will
-    need to remember something. This is done by using a <em>state
-    object</em>, which is an object that is always passed when
-    reading a token, and which can be mutated by the tokenizer.</p>
-
-    <p id="startState">Modes that use a state must define
-    a <code><strong>startState</strong></code> method on their mode
-    object. This is a function of no arguments that produces a state
-    object to be used at the start of a document.</p>
-
-    <p id="token">The most important part of a mode object is
-    its <code><strong>token</strong>(stream, state)</code> method. All
-    modes must define this method. It should read one token from the
-    stream it is given as an argument, optionally update its state,
-    and return a style string, or <code>null</code> for tokens that do
-    not have to be styled. For your styles, you are encouraged to use
-    the 'standard' names defined in the themes (without
-    the <code>cm-</code> prefix). If that fails, it is also possible
-    to come up with your own and write your own CSS theme file.<p>
-
-    <p id="token_style_line">A typical token string would
-    be <code>"variable"</code> or <code>"comment"</code>. Multiple
-    styles can be returned (separated by spaces), for
-    example <code>"string error"</code> for a thing that looks like a
-    string but is invalid somehow (say, missing its closing quote).
-    When a style is prefixed by <code>"line-"</code>
-    or <code>"line-background-"</code>, the style will be applied to
-    the whole line, analogous to what
-    the <a href="#addLineClass"><code>addLineClass</code></a> method
-    does鈥攕tyling the <code>"text"</code> in the simple case, and
-    the <code>"background"</code> element
-    when <code>"line-background-"</code> is prefixed.</p>
-
-    <p id="StringStream">The stream object that's passed
-    to <code>token</code> encapsulates a line of code (tokens may
-    never span lines) and our current position in that line. It has
-    the following API:</p>
-
-    <dl>
-      <dt><code><strong>eol</strong>() 鈫� boolean</code></dt>
-      <dd>Returns true only if the stream is at the end of the
-      line.</dd>
-      <dt><code><strong>sol</strong>() 鈫� boolean</code></dt>
-      <dd>Returns true only if the stream is at the start of the
-      line.</dd>
-
-      <dt><code><strong>peek</strong>() 鈫� string</code></dt>
-      <dd>Returns the next character in the stream without advancing
-      it. Will return a <code>null</code> at the end of the
-      line.</dd>
-      <dt><code><strong>next</strong>() 鈫� string</code></dt>
-      <dd>Returns the next character in the stream and advances it.
-      Also returns <code>null</code> when no more characters are
-      available.</dd>
-
-      <dt><code><strong>eat</strong>(match: string|regexp|function(char: string) 鈫� boolean) 鈫� string</code></dt>
-      <dd><code>match</code> can be a character, a regular expression,
-      or a function that takes a character and returns a boolean. If
-      the next character in the stream 'matches' the given argument,
-      it is consumed and returned. Otherwise, <code>undefined</code>
-      is returned.</dd>
-      <dt><code><strong>eatWhile</strong>(match: string|regexp|function(char: string) 鈫� boolean) 鈫� boolean</code></dt>
-      <dd>Repeatedly calls <code>eat</code> with the given argument,
-      until it fails. Returns true if any characters were eaten.</dd>
-      <dt><code><strong>eatSpace</strong>() 鈫� boolean</code></dt>
-      <dd>Shortcut for <code>eatWhile</code> when matching
-      white-space.</dd>
-      <dt><code><strong>skipToEnd</strong>()</code></dt>
-      <dd>Moves the position to the end of the line.</dd>
-      <dt><code><strong>skipTo</strong>(str: string) 鈫� boolean</code></dt>
-      <dd>Skips to the start of the next occurrence of the given string, if
-      found on the current line (doesn't advance the stream if the
-      string does not occur on the line). Returns true if the
-      string was found.</dd>
-      <dt><code><strong>match</strong>(pattern: string, ?consume: boolean, ?caseFold: boolean) 鈫� boolean</code></dt>
-      <dt><code><strong>match</strong>(pattern: regexp, ?consume: boolean) 鈫� array&lt;string&gt;</code></dt>
-      <dd>Act like a
-      multi-character <code>eat</code>鈥攊f <code>consume</code> is true
-      or not given鈥攐r a look-ahead that doesn't update the stream
-      position鈥攊f it is false. <code>pattern</code> can be either a
-      string or a regular expression starting with <code>^</code>.
-      When it is a string, <code>caseFold</code> can be set to true to
-      make the match case-insensitive. When successfully matching a
-      regular expression, the returned value will be the array
-      returned by <code>match</code>, in case you need to extract
-      matched groups.</dd>
-
-      <dt><code><strong>backUp</strong>(n: integer)</code></dt>
-      <dd>Backs up the stream <code>n</code> characters. Backing it up
-      further than the start of the current token will cause things to
-      break, so be careful.</dd>
-      <dt><code><strong>column</strong>() 鈫� integer</code></dt>
-      <dd>Returns the column (taking into account tabs) at which the
-      current token starts.</dd>
-      <dt><code><strong>indentation</strong>() 鈫� integer</code></dt>
-      <dd>Tells you how far the current line has been indented, in
-      spaces. Corrects for tab characters.</dd>
-
-      <dt><code><strong>current</strong>() 鈫� string</code></dt>
-      <dd>Get the string between the start of the current token and
-      the current stream position.</dd>
-    </dl>
-
-    <p id="blankLine">By default, blank lines are simply skipped when
-    tokenizing a document. For languages that have significant blank
-    lines, you can define
-    a <code><strong>blankLine</strong>(state)</code> method on your
-    mode that will get called whenever a blank line is passed over, so
-    that it can update the parser state.</p>
-
-    <p id="copyState">Because state object are mutated, and CodeMirror
-    needs to keep valid versions of a state around so that it can
-    restart a parse at any line, copies must be made of state objects.
-    The default algorithm used is that a new state object is created,
-    which gets all the properties of the old object. Any properties
-    which hold arrays get a copy of these arrays (since arrays tend to
-    be used as mutable stacks). When this is not correct, for example
-    because a mode mutates non-array properties of its state object, a
-    mode object should define
-    a <code><strong>copyState</strong></code> method, which is given a
-    state and should return a safe copy of that state.</p>
-
-    <p id="indent">If you want your mode to provide smart indentation
-    (through the <a href="#indentLine"><code>indentLine</code></a>
-    method and the <code>indentAuto</code>
-    and <code>newlineAndIndent</code> commands, to which keys can be
-    <a href="#option_extraKeys">bound</a>), you must define
-    an <code><strong>indent</strong>(state, textAfter)</code> method
-    on your mode object.</p>
-
-    <p>The indentation method should inspect the given state object,
-    and optionally the <code>textAfter</code> string, which contains
-    the text on the line that is being indented, and return an
-    integer, the amount of spaces to indent. It should usually take
-    the <a href="#option_indentUnit"><code>indentUnit</code></a>
-    option into account. An indentation method may
-    return <code>CodeMirror.Pass</code> to indicate that it
-    could not come up with a precise indentation.</p>
-
-    <p id="mode_comment">To work well with
-    the <a href="#addon_comment">commenting addon</a>, a mode may
-    define <code><strong>lineComment</strong></code> (string that
-    starts a line
-    comment), <code><strong>blockCommentStart</strong></code>, <code><strong>blockCommentEnd</strong></code>
-    (strings that start and end block comments),
-    and <code>blockCommentLead</code> (a string to put at the start of
-    continued lines in a block comment). All of these are
-    optional.</p>
-
-    <p id="electricChars">Finally, a mode may define either
-    an <code>electricChars</code> or an <code>electricInput</code>
-    property, which are used to automatically reindent the line when
-    certain patterns are typed and
-    the <a href="#option_electricChars"><code>electricChars</code></a>
-    option is enabled. <code>electricChars</code> may be a string, and
-    will trigger a reindent whenever one of the characters in that
-    string are typed. Often, it is more appropriate to
-    use <code>electricInput</code>, which should hold a regular
-    expression, and will trigger indentation when the part of the
-    line <em>before</em> the cursor matches the expression. It should
-    usually end with a <code>$</code> character, so that it only
-    matches when the indentation-changing pattern was just typed, not when something was
-    typed after the pattern.</p>
-
-    <p>So, to summarize, a mode <em>must</em> provide
-    a <code>token</code> method, and it <em>may</em>
-    provide <code>startState</code>, <code>copyState</code>,
-    and <code>indent</code> methods. For an example of a trivial mode,
-    see the <a href="../mode/diff/diff.js">diff mode</a>, for a more
-    involved example, see the <a href="../mode/clike/clike.js">C-like
-    mode</a>.</p>
-
-    <p>Sometimes, it is useful for modes to <em>nest</em>鈥攖o have one
-    mode delegate work to another mode. An example of this kind of
-    mode is the <a href="../mode/htmlmixed/htmlmixed.js">mixed-mode HTML
-    mode</a>. To implement such nesting, it is usually necessary to
-    create mode objects and copy states yourself. To create a mode
-    object, there are <code>CodeMirror.getMode(options,
-    parserConfig)</code>, where the first argument is a configuration
-    object as passed to the mode constructor function, and the second
-    argument is a mode specification as in
-    the <a href="#option_mode"><code>mode</code></a> option. To copy a
-    state object, call <code>CodeMirror.copyState(mode, state)</code>,
-    where <code>mode</code> is the mode that created the given
-    state.</p>
-
-    <p id="innerMode">In a nested mode, it is recommended to add an
-    extra method, <code><strong>innerMode</strong></code> which, given
-    a state object, returns a <code>{state, mode}</code> object with
-    the inner mode and its state for the current position. These are
-    used by utility scripts such as the <a href="#addon_closetag">tag
-    closer</a> to get context information. Use
-    the <code>CodeMirror.innerMode</code> helper function to, starting
-    from a mode and a state, recursively walk down to the innermost
-    mode and state.</p>
-
-    <p>To make indentation work properly in a nested parser, it is
-    advisable to give the <code>startState</code> method of modes that
-    are intended to be nested an optional argument that provides the
-    base indentation for the block of code. The JavaScript and CSS
-    parser do this, for example, to allow JavaScript and CSS code
-    inside the mixed-mode HTML mode to be properly indented.</p>
-
-    <p id="defineMIME">It is possible, and encouraged, to associate
-    your mode, or a certain configuration of your mode, with
-    a <a href="http://en.wikipedia.org/wiki/MIME">MIME</a> type. For
-    example, the JavaScript mode associates itself
-    with <code>text/javascript</code>, and its JSON variant
-    with <code>application/json</code>. To do this,
-    call <code><strong>CodeMirror.defineMIME</strong>(mime,
-    modeSpec)</code>, where <code>modeSpec</code> can be a string or
-    object specifying a mode, as in
-    the <a href="#option_mode"><code>mode</code></a> option.</p>
-
-    <p>If a mode specification wants to add some properties to the
-    resulting mode object, typically for use
-    with <a href="#getHelpers"><code>getHelpers</code></a>, it may
-    contain a <code>modeProps</code> property, which holds an object.
-    This object's properties will be copied to the actual mode
-    object.</p>
-
-    <p id="extendMode">Sometimes, it is useful to add or override mode
-    object properties from external code.
-    The <code><strong>CodeMirror.extendMode</strong></code> function
-    can be used to add properties to mode objects produced for a
-    specific mode. Its first argument is the name of the mode, its
-    second an object that specifies the properties that should be
-    added. This is mostly useful to add utilities that can later be
-    looked up through <a href="#getMode"><code>getMode</code></a>.</p>
-</section>
-
-<section id="vimapi">
-    <h2>VIM Mode API</h2>
-
-    <p>CodeMirror has a robust VIM mode that attempts to faithfully
-    emulate VIM's most useful features. It can be enabled by
-    including <a href="../keymap/vim.js"><code>keymap/vim.js</code>
-    </a> and setting the <code>keyMap</code> option to
-    <code>"vim"</code>.</p>
-
-    <h3 id="vimapi_configuration">Configuration</h3>
-
-    <p>VIM mode accepts configuration options for customizing
-    behavior at run time. These methods can be called at any time
-    and will affect all existing CodeMirror instances unless
-    specified otherwise. The methods are exposed on the
-    <code><strong>CodeMirror.Vim</strong></code> object.</p>
-
-    <dl>
-      <dt id="vimapi_setOption"><code><strong>setOption(name: string, value: any, ?cm: CodeMirror, ?cfg: object)</strong></code></dt>
-      <dd>Sets the value of a VIM option. <code>name</code> should
-      be the name of an option. If <code>cfg.scope</code> is not set
-      and <code>cm</code> is provided, then sets the global and
-      instance values of the option. Otherwise, sets either the
-      global or instance value of the option depending on whether
-      <code>cfg.scope</code> is <code>global</code> or
-      <code>local</code>.</dd>
-      <dt id="vimapi_getOption"><code><strong>getOption(name: string, ?cm: CodeMirror: ?cfg: object)</strong></code></dt>
-      <dd>Gets the current value of a VIM option. If
-      <code>cfg.scope</code> is not set and <code>cm</code> is
-      provided, then gets the instance value of the option, falling
-      back to the global value if not set. If <code>cfg.scope</code> is provided, then gets the <code>global</code> or
-      <code>local</code> value without checking the other.</dd>
-
-      <dt id="vimapi_map"><code><strong>map(lhs: string, rhs: string, ?context: string)</strong></code></dt>
-      <dd>Maps a key sequence to another key sequence. Implements
-      VIM's <code>:map</code> command. To map ; to : in VIM would be
-      <code><strong>:map ; :</strong></code>. That would translate to
-      <code><strong>CodeMirror.Vim.map(';', ':');</strong></code>.
-      The <code>context</code> can be <code>normal</code>,
-      <code>visual</code>, or <code>insert</code>, which correspond
-      to <code>:nmap</code>, <code>:vmap</code>, and
-      <code>:imap</code>
-      respectively.</dd>
-
-      <dt id="vimapi_mapCommand"><code><strong>mapCommand(keys: string, type: string, name: string, ?args: object, ?extra: object)</strong></code></dt>
-      <dd>Maps a key sequence to a <code>motion</code>,
-      <code>operator</code>, or <code>action</code> type command.
-      The args object is passed through to the command when it is
-      invoked by the provided key sequence.
-      <code>extras.context</code> can be <code>normal</code>,
-      <code>visual</code>, or <code>insert</code>, to map the key
-      sequence only in the corresponding mode.
-      <code>extras.isEdit</code> is applicable only to actions,
-      determining whether it is recorded for replay for the
-      <code>.</code> single-repeat command.
-    </dl>
-
-    <h3 id="vimapi_extending">Extending VIM</h3>
-
-    <p>CodeMirror's VIM mode implements a large subset of VIM's core
-    editing functionality. But since there's always more to be
-    desired, there is a set of APIs for extending VIM's
-    functionality. As with the configuration API, the methods are
-    exposed on <code><strong>CodeMirror.Vim</strong></code> and may
-    be called at any time.</p>
-
-    <dl>
-      <dt id="vimapi_defineOption"><code><strong>defineOption(name: string, default: any, type: string, ?aliases: array&lt;string&gt;, ?callback: function (?value: any, ?cm: CodeMirror) 鈫� ?any)</strong></code></dt>
-      <dd>Defines a VIM style option and makes it available to the
-      <code>:set</code> command. Type can be <code>boolean</code> or
-      <code>string</code>, used for validation and by
-      <code>:set</code> to determine which syntax to accept. If a
-      <code>callback</code> is passed in, VIM does not store the value of the
-      option itself, but instead uses the callback as a setter/getter. If the
-      first argument to the callback is <code>undefined</code>, then the
-      callback should return the value of the option. Otherwise, it should set
-      instead. Since VIM options have global and instance values, whether a
-      <code>CodeMirror</code> instance is passed in denotes whether the global
-      or local value should be used. Consequently, it's possible for the
-      callback to be called twice for a single <code>setOption</code> or
-      <code>getOption</code> call. Note that right now, VIM does not support
-      defining buffer-local options that do not have global values. If an
-      option should not have a global value, either always ignore the
-      <code>cm</code> parameter in the callback, or always pass in a
-      <code>cfg.scope</code> to <code>setOption</code> and
-      <code>getOption</code>.</dd>
-
-      <dt id="vimapi_defineMotion"><code><strong>defineMotion(name: string, fn: function(cm: CodeMirror, head: {line, ch}, ?motionArgs: object}) 鈫� {line, ch})</strong></code></dt>
-      <dd>Defines a motion command for VIM. The motion should return
-      the desired result position of the cursor. <code>head</code>
-      is the current position of the cursor. It can differ from
-      <code>cm.getCursor('head')</code> if VIM is in visual mode.
-      <code>motionArgs</code> is the object passed into
-      <strong><code>mapCommand()</code></strong>.</dd>
-
-      <dt id="vimapi_defineOperator"><strong><code>defineOperator(name: string, fn: function(cm: CodeMirror, ?operatorArgs: object, ranges: array&lt;{anchor, head}&gt;) 鈫� ?{line, ch})</code></strong></dt>
-      <dd>Defines an operator command, similar to <strong><code>
-      defineMotion</code></strong>. <code>ranges</code> is the range
-      of text the operator should operate on. If the cursor should
-      be set to a certain position after the operation finishes, it
-      can return a cursor object.</dd>
-
-      <dt id="vimapi_defineActon"><strong><code>defineAction(name: string, fn: function(cm: CodeMirror, ?actionArgs: object))</code></strong></dt>
-      <dd>Defines an action command, similar to
-      <strong><code>defineMotion</code></strong>. Action commands
-      can have arbitrary behavior, making them more flexible than
-      motions and operators, at the loss of orthogonality.</dd>
-
-      <dt id="vimapi_defineEx"><strong><code>defineEx(name: string, ?prefix: string, fn: function(cm: CodeMirror, ?params: object))</code></strong></dt>
-      <dd>Defines an Ex command, and maps it to <code>:name</code>.
-      If a prefix is provided, it, and any prefixed substring of the
-      <code>name</code> beginning with the <code>prefix</code> can
-      be used to invoke the command. If the <code>prefix</code> is
-      falsy, then <code>name</code> is used as the prefix. <code>
-      params.argString</code> contains the part of the prompted
-      string after the command name. <code>params.args</code> is
-      <code>params.argString</code> split by whitespace. If the
-      command was prefixed with a
-      <code><strong><a href="http://vimdoc.sourceforge.net/htmldoc/cmdline.html#cmdline-ranges">line range</a></strong></code>,
-      <code>params.line</code> and <code>params.lineEnd</code> will
-      be set.
-    </dl>
-
-</section>
-
-</article>
-
-<script>setTimeout(function(){CodeMirror.colorize();}, 20);</script>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/manual.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/manual.html.xml
deleted file mode 100644
index cfdb716e2abffd47191d174344f8e9cf8520ef0b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/manual.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>manual.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/realworld.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/realworld.html.html
deleted file mode 100644
index 2f36caf4a97514e66a69449a5f8cbdaf8ead10ed..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/realworld.html.html
+++ /dev/null
@@ -1,188 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Real-world Uses</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="docs.css">
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Real-world uses</a>
-  </ul>
-</div>
-
-<article>
-
-<h2>CodeMirror real-world uses</h2>
-
-    <p>Create a <a href="https://github.com/codemirror/codemirror">pull
-    request</a> if you'd like your project to be added to this list.</p>
-
-    <ul>
-      <li><a href="http://brackets.io">Adobe Brackets</a> (code editor)</li>
-      <li><a href="http://alm.tools">ALM Tools</a> (TypeScript powered IDE)</li>
-      <li><a href="http://amber-lang.net/">Amber</a> (JavaScript-based Smalltalk system)</li>
-      <li><a href="http://apachegui.ca/">Apache GUI</a></li>
-      <li><a href="http://apeye.org/">APEye</a> (tool for testing &amp; documenting APIs)</li>
-      <li><a href="https://github.com/google/appengine-codiad">Appengine Codiad</a></li>
-      <li><a href="https://chrome.google.com/webstore/detail/better-text-viewer/lcaidopdffhfemoefoaadecppnjdknkc">Better Text Viewer</a> (plain text reader app for Chrome)</li>
-      <li><a href="http://blog.bitbucket.org/2013/05/14/edit-your-code-in-the-cloud-with-bitbucket/">Bitbucket</a> (code hosting)</li>
-      <li><a href="http://buzz.blogger.com/2013/04/improvements-to-blogger-template-html.html">Blogger's template editor</a></li>
-      <li><a href="http://bluegriffon.org/">BlueGriffon</a> (HTML editor)</li>
-      <li><a href="https://github.com/isdampe/BosonEditorExperimental">Boson Editor</a> (code editor)</li>
-      <li><a href="http://cargocollective.com/">Cargo Collective</a> (creative publishing platform)</li>
-      <li><a href="https://developers.google.com/chrome-developer-tools/">Chrome DevTools</a></li>
-      <li><a href="http://clickhelp.co/">ClickHelp</a> (technical writing tool)</li>
-      <li><a href="http://code.world/">CodeWorld</a> (Haskell playground)</li>
-      <li><a href="http://complete-ly.appspot.com/playground/code.playground.html">Complete.ly playground</a></li>
-      <li><a href="https://codeanywhere.com/">Codeanywhere</a> (multi-platform cloud editor)</li>
-      <li><a href="http://drupal.org/project/cpn">Code per Node</a> (Drupal module)</li>
-      <li><a href="http://www.codebugapp.com/">Codebug</a> (PHP Xdebug front-end)</li>
-      <li><a href="https://github.com/angelozerr/CodeMirror-Eclipse">CodeMirror Eclipse</a> (embed CM in Eclipse)</li>
-      <li><a href="http://emmet.io/blog/codemirror-movie/">CodeMirror movie</a> (scripted editing demos)</li>
-      <li><a href="http://code.google.com/p/codemirror2-gwt/">CodeMirror2-GWT</a> (Google Web Toolkit wrapper)</li>
-      <li><a href="http://www.crunchzilla.com/code-monster">Code Monster</a> & <a href="http://www.crunchzilla.com/code-maven">Code Maven</a> (learning environment)</li>
-      <li><a href="http://codepen.io">Codepen</a> (gallery of animations)</li>
-      <li><a href="https://coderpad.io/">Coderpad</a> (interviewing tool)</li>
-      <li><a href="http://sasstwo.codeschool.com/levels/1/challenges/1">Code School</a> (online tech learning environment)</li>
-      <li><a href="http://code-snippets.bungeshea.com/">Code Snippets</a> (WordPress snippet management plugin)</li>
-      <li><a href="http://antonmi.github.io/code_together/">Code together</a> (collaborative editing)</li>
-      <li><a href="http://codev.it/">Codev</a> (collaborative IDE)</li>
-      <li><a href="http://www.codezample.com">CodeZample</a> (code snippet sharing)</li>
-      <li><a href="http://codio.com">Codio</a> (Web IDE)</li>
-      <li><a href="http://ot.substance.io/demo/">Collaborative CodeMirror demo</a> (CodeMirror + operational transforms)</li>
-      <li><a href="http://www.communitycodecamp.com/">Community Code Camp</a> (code snippet sharing)</li>
-      <li><a href="http://www.compilejava.net/">compilejava.net</a> (online Java sandbox)</li>
-      <li><a href="http://www.ckwnc.com/">CKWNC</a> (UML editor)</li>
-      <li><a href="http://www.crossui.com/">CrossUI</a> (cross-platform UI builder)</li>
-      <li><a href="http://rsnous.com/cruncher/">Cruncher</a> (notepad with calculation features)</li>
-      <li><a href="http://www.crudzilla.com/">Crudzilla</a> (self-hosted web IDE)</li>
-      <li><a href="http://cssdeck.com/">CSSDeck</a> (CSS showcase)</li>
-      <li><a href="http://ireneros.com/deck/deck.js-codemirror/introduction/#textarea-code">Deck.js integration</a> (slides with editors)</li>
-      <li><a href="http://www.dbninja.com">DbNinja</a> (MySQL access interface)</li>
-      <li><a href="https://chat.echoplex.us/">Echoplexus</a> (chat and collaborative coding)</li>
-      <li><a href="http://www.ecsspert.com/">eCSSpert</a> (CSS demos and experiments)</li>
-      <li><a href="http://elm-lang.org/Examples.elm">Elm language examples</a></li>
-      <li><a href="http://eloquentjavascript.net/chapter1.html">Eloquent JavaScript</a> (book)</li>
-      <li><a href="http://emmet.io">Emmet</a> (fast XML editing)</li>
-      <li><a href="https://github.com/espruino/EspruinoWebIDE">Espruino Web IDE</a> (Chrome App for writing code on Espruino devices)</li>
-      <li><a href="http://www.fastfig.com/">Fastfig</a> (online computation/math tool)</li>
-      <li><a href="https://metacpan.org/module/Farabi">Farabi</a> (modern Perl IDE)</li>
-      <li><a href="http://blog.pamelafox.org/2012/02/interactive-html5-slides-with-fathomjs.html">FathomJS integration</a> (slides with editors, again)</li>
-      <li><a href="https://phantomus.com/">Phantomus</a> (blogging platform)</li>
-      <li><a href="http://fiddlesalad.com/">Fiddle Salad</a> (web development environment)</li>
-      <li><a href="https://github.com/simogeo/Filemanager">Filemanager</a></li>
-      <li><a href="https://hacks.mozilla.org/2013/11/firefox-developer-tools-episode-27-edit-as-html-codemirror-more/">Firefox Developer Tools</a></li>
-      <li><a href="http://www.firepad.io">Firepad</a> (collaborative text editor)</li>
-      <li><a href="https://gerritcodereview.com/">Gerrit</a>'s diff view and inline editor</li>
-      <li><a href="https://github.com/maks/git-crx">Git Crx</a> (Chrome App for browsing local git repos)</li>
-      <li><a href="http://tour.golang.org">Go language tour</a></li>
-      <li><a href="https://github.com/github/android">GitHub's Android app</a></li>
-      <li><a href="https://script.google.com/">Google Apps Script</a></li>
-      <li><a href="http://web.uvic.ca/~siefkenj/graphit/graphit.html">Graphit</a> (function graphing)</li>
-      <li><a href="https://hackmd.io">HackMD</a> (Realtime collaborative markdown notes on all platforms)</li>
-      <li><a href="http://www.handcraft.com/">Handcraft</a> (HTML prototyping)</li>
-      <li><a href="http://hawkee.com/">Hawkee</a></li>
-      <li><a href="http://try.haxe.org">Haxe</a> (Haxe Playground) </li>
-      <li><a href="http://haxpad.com/">HaxPad</a> (editor for Win RT)</li>
-      <li><a href="http://megafonweblab.github.com/histone-javascript/">Histone template engine playground</a></li>
-      <li><a href="http://www.homegenie.it/docs/automation_getstarted.php">Homegenie</a> (home automation server)</li>
-      <li><a href="http://icecoder.net">ICEcoder</a> (web IDE)</li>
-      <li><a href="http://ipython.org/">IPython</a> (interactive computing shell)</li>
-      <li><a href="joelpinheiro.github.io/itrading/">iTrading</a> (Algorithmic Trading)</li>
-      <li><a href="http://i-mos.org/imos/">i-MOS</a> (modeling and simulation platform)</li>
-      <li><a href="http://www.janvas.com/">Janvas</a> (vector graphics editor)</li>
-      <li><a href="http://extensions.joomla.org/extensions/edition/editors/8723">Joomla plugin</a></li>
-      <li><a href="http://jqfundamentals.com/">jQuery fundamentals</a> (interactive tutorial)</li>
-      <li><a href="http://jsbin.com">jsbin.com</a> (JS playground)</li>
-      <li><a href="http://tool.jser.com/preprocessor">JSER preprocessor</a></li>
-      <li><a href="https://github.com/kucherenko/jscpd">jscpd</a> (code duplication detector)</li>
-      <li><a href="http://jsfiddle.net">JSFiddle</a> (another JS playground)</li>
-      <li><a href="http://www.jshint.com/">JSHint</a> (JS linter)</li>
-      <li><a href="http://jumpseller.com/">Jumpseller</a> (online store builder)</li>
-      <li><a href="http://kl1p.com/cmtest/1">kl1p</a> (paste service)</li>
-      <li><a href="http://www.kodhus.com/kodity/">Kodit</a></li>
-      <li><a href="http://kodtest.com/">Kodtest</a> (HTML/JS/CSS playground)</li>
-      <li><a href="http://try.kotlinlang.org">Kotlin</a> (web-based mini-IDE for Kotlin)</li>
-      <li><a href="https://laborate.io/">Laborate</a> (collaborative coding)</li>
-      <li><a href="http://lighttable.com/">Light Table</a> (experimental IDE)</li>
-      <li><a href="http://liveweave.com/">Liveweave</a> (HTML/CSS/JS scratchpad)</li>
-      <li><a href="http://marklighteditor.com/">Marklight editor</a> (lightweight markup editor)</li>
-      <li><a href="http://www.mergely.com/">Mergely</a> (interactive diffing)</li>
-      <li><a href="http://www.iunbug.com/mihtool">MIHTool</a> (iOS web-app debugging tool)</li>
-      <li><a href="http://mongo-mapreduce-webbrowser.opensagres.cloudbees.net/">Mongo MapReduce WebBrowser</a></li>
-      <li><a href="http://montagestudio.com/">Montage Studio</a> (web app creator suite)</li>
-      <li><a href="http://mscgen.js.org/index.html">mscgen_js</a> (online sequence chart editor)</li>
-      <li><a href="http://mvcplayground.apphb.com/">MVC Playground</a></li>
-      <li><a href="https://www.my2ndgeneration.com/">My2ndGeneration</a> (social coding)</li>
-      <li><a href="http://www.navigatecms.com">Navigate CMS</a></li>
-      <li><a href="https://github.com/soliton4/nodeMirror">nodeMirror</a> (IDE project)</li>
-      <li><a href="https://notex.ch">NoTex</a> (rST authoring)</li>
-      <li><a href="https://nteract.io">nteract</a> (interactive literate coding notebook)</li>
-      <li><a href="http://oakoutliner.com">Oak</a> (online outliner)</li>
-      <li><a href="http://www.greycampus.com/opencampus">OpenCampus</a></li>
-      <li><a href="http://clrhome.org/asm/">ORG</a> (z80 assembly IDE)</li>
-      <li><a href="https://github.com/mamacdon/orion-codemirror">Orion-CodeMirror integration</a> (running CodeMirror modes in Orion)</li>
-      <li><a href="http://paperjs.org/">Paper.js</a> (graphics scripting)</li>
-      <li><a href="http://pharaoh.js.org/">Pharaoh</a> (browser &amp; desktop editor for the classroom)</li>
-      <li><a href="http://prinbit.com/">PrinBit</a> (collaborative coding tool)</li>
-      <li><a href="http://prose.io/">Prose.io</a> (github content editor)</li>
-      <li><a href="https://pypi.python.org/pypi/PubliForge/">PubliForge</a> (online publishing system)</li>
-      <li><a href="http://www.puzzlescript.net/">Puzzlescript</a> (puzzle game engine)</li>
-      <li><a href="http://ql.io/">ql.io</a> (http API query helper)</li>
-      <li><a href="http://qyapp.com">QiYun web app platform</a></li>
-      <li><a href="http://ariya.ofilabs.com/2011/09/hybrid-webnative-desktop-codemirror.html">Qt+Webkit integration</a> (building a desktop CodeMirror app)</li>
-      <li><a href="http://www.quivive-file-manager.com">Quivive File Manager</a></li>
-      <li><a href="http://rascalmicro.com/docs/basic-tutorial-getting-started.html">Rascal</a> (tiny computer)</li>
-      <li><a href="https://www.realtime.io/">RealTime.io</a> (Internet-of-Things infrastructure)</li>
-      <li><a href="http://refork.com/">Refork</a> (animation demo gallery and sharing)</li>
-      <li><a href="http://sagecell.sagemath.org">SageMathCell</a> (interactive mathematical software)</li>
-      <li><a href="https://cloud.sagemath.com/">SageMathCloud</a> (interactive mathematical software environment)</li>
-      <li><a href="https://chrome.google.com/webstore/detail/servephp/mnpikomdchjhkhbhmbboehfdjkobbfpo">ServePHP</a> (PHP code testing in Chrome dev tools)</li>
-      <li><a href="https://www.shadertoy.com/">Shadertoy</a> (shader sharing)</li>
-      <li><a href="http://www.sketchpatch.net/labs/livecodelabIntro.html">sketchPatch Livecodelab</a></li>
-      <li><a href="http://www.skulpt.org/">Skulpt</a> (in-browser Python environment)</li>
-      <li><a href="https://www.sourcelair.com">SourceLair</a> (in-browser IDE for Django, Node.js, PHP and HTML5)</li>
-      <li><a href="http://snaptomato.appspot.com/editor.html">Snap Tomato</a> (HTML editing/testing page)</li>
-      <li><a href="http://snippets.pro/">Snippets.pro</a> (code snippet sharing)</li>
-      <li><a href="http://www.solidshops.com/">SolidShops</a> (hosted e-commerce platform)</li>
-      <li><a href="http://www.cemetech.net/sc/">SourceCoder 3</a> (online calculator IDE and editor)</li>
-      <li><a href="http://sqlfiddle.com">SQLFiddle</a> (SQL playground)</li>
-      <li><a href="http://www.subte.org/page/programar-ta-te-ti-online/">SubTe</a> (AI bot programming environment)</li>
-      <li><a href="http://xuanji.appspot.com/isicp/">Structure and Interpretation of Computer Programs</a>, Interactive Version</li>
-      <li><a href="http://syframework.alwaysdata.net">SyBox</a> (PHP playground)</li>
-      <li><a href="http://www.tagspaces.org/">TagSpaces</a> (personal data manager)</li>
-      <li><a href="https://textbox.io/">Textbox.io</a> (WYSIWYG rich text editor)</a></li>
-      <li><a href="https://thefiletree.com">The File Tree</a> (collab editor)</li>
-      <li><a href="http://www.mapbox.com/tilemill/">TileMill</a> (map design tool)</li>
-      <li><a href="http://doc.tiki.org/Syntax+Highlighter">Tiki</a> (wiki CMS groupware)</li>
-      <li><a href="http://www.toolsverse.com/products/data-explorer/">Toolsverse Data Explorer</a> (database management)</li>
-      <li><a href="http://enjalot.com/tributary/2636296/sinwaves.js">Tributary</a> (augmented editing)</li>
-      <li><a href="http://blog.englard.net/post/39608000629/codeintumblr">Tumblr code highlighting shim</a></li>
-      <li><a href="http://turbopy.com/">TurboPY</a> (web publishing framework)</li>
-      <li><a href="http://cruise.eecs.uottawa.ca/umpleonline/">UmpleOnline</a> (model-oriented programming tool)</li>
-      <li><a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-7706e7832aa9e2fd0c2decdb5cbef2225692c696/platform/platform-impl/src/com/intellij/openapi/editor/impl/EditorFactoryImpl.java">Upsource</a> (code browser and review tool)</li>
-      <li><a href="https://github.com/mgaitan/waliki">Waliki</a> (wiki engine)</li>
-      <li><a href="http://wamer.net/">Wamer</a> (web application builder)</li>
-      <li><a href="https://github.com/brettz9/webappfind">webappfind</a> (windows file bindings for webapps)</li>
-      <li><a href="http://www.webglacademy.com/">WebGL academy</a> (learning WebGL)</li>
-      <li><a href="http://webglplayground.net/">WebGL playground</a></li>
-      <li><a href="https://www.webkit.org/blog/2518/state-of-web-inspector/#source-code">WebKit Web inspector</a></li>
-      <li><a href="http://www.wescheme.org/">WeScheme</a> (learning tool)</li>
-      <li><a href="https://github.com/b3log/wide">Wide</a> (golang web IDE)</li>
-      <li><a href="http://wordpress.org/extend/plugins/codemirror-for-codeeditor/">WordPress plugin</a></li>
-      <li><a href="https://www.writelatex.com">writeLaTeX</a> (Collaborative LaTeX Editor)</li>
-      <li><a href="http://www.xosystem.org/home/applications_websites/xosystem_website/xoside_EN.php">XOSide</a> (online editor)</li>
-      <li><a href="http://videlibri.sourceforge.net/cgi-bin/xidelcgi">XQuery tester</a></li>
-      <li><a href="http://q42jaap.github.io/xsd2codemirror/">xsd2codemirror</a> (convert XSD to CM XML completion info)</li>
-      <li><a href="http://www.yacas.org/yacas_online/yacas_online.html">Yacas Online</a> (interactive mathematical software)</li>
-    </ul>
-
-</article>
-
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/realworld.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/realworld.html.xml
deleted file mode 100644
index ccd1c2cc3e1482ee1026cf18c5a5ed815ba2c23a..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/realworld.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>realworld.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/releases.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/releases.html.html
deleted file mode 100644
index e975cbd03e5f52f1e67b8753859aa75179dfa191..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/releases.html.html
+++ /dev/null
@@ -1,1414 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Release History</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="docs.css">
-<script src="activebookmark.js"></script>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active data-default="true" href="#v5">Version 5.x</a>
-    <li><a href="#v4">Version 4.x</a>
-    <li><a href="#v3">Version 3.x</a>
-    <li><a href="#v2">Version 2.x</a>
-    <li><a href="#v1">Version 0.x</a>
-  </ul>
-</div>
-
-<article>
-
-<h2>Release notes and version history</h2>
-
-<section id=v5 class=first>
-
-  <h2>Version 5.x</h2>
-
-  <p class="rel">22-02-2017: <a href="http://codemirror.net/codemirror-5.24.2.zip">Version 5.24.2</a>:</p>
-
-  <ul class=rel-note>
-    <li><a href="http://codemirror.net/mode/javascript/">javascript mode</a>: Support computed class method names.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_merge">merge addon</a>: Improve aligning of unchanged code in the presence of marks and line widgets.</li>
-  </ul>
-
-  <p class="rel">20-02-2017: <a href="http://codemirror.net/codemirror-5.24.0.zip">Version 5.24.0</a>:</p>
-
-  <ul class=rel-note>
-    <li>Positions now support a <code>sticky</code> property which determines whether they should be associated with the character before (value <code>"before"</code>) or after (value <code>"after"</code>) them.</li>
-    <li><a href="http://codemirror.net/mode/demo/vim.html">vim bindings</a>: Make it possible to remove built-in bindings through the API.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_comment">comment addon</a>: Support a per-mode <code>useInnerComments</code> option to optionally suppress descending to the inner modes to get comment strings.</li>
-    <li>A cursor directly before a line-wrapping break is now drawn before or after the line break depending on which direction you arrived from.</li>
-    <li>Visual cursor motion in line-wrapped right-to-left text should be much more correct.</li>
-    <li>Fix bug in handling of read-only marked text.</li>
-    <li><a href="http://codemirror.net/mode/shell/">shell mode</a>: Properly tokenize nested parentheses.</li>
-    <li><a href="http://codemirror.net/mode/python/">python mode</a>: Support underscores in number literals.</li>
-    <li><a href="http://codemirror.net/mode/sass/">sass mode</a>: Uses the full list of CSS properties and keywords from the CSS mode, rather than defining its own incomplete subset. Now depends on the css mode.</li>
-    <li><a href="http://codemirror.net/mode/css/">css mode</a>: Expose <code>lineComment</code> property for LESS and SCSS dialects. Recognize vendor prefixes on pseudo-elements.</li>
-    <li><a href="http://codemirror.net/mode/julia/">julia mode</a>: Properly indent <code>elseif</code> lines.</li>
-    <li><a href="http://codemirror.net/mode/markdown/">markdown mode</a>: Properly recognize the end of fenced code blocks when inside other markup.</li>
-    <li><a href="http://codemirror.net/mode/clike/">scala mode</a>: Improve handling of operators containing <code>#</code>, <code>@</code>, and <code>:</code> chars.</li>
-    <li><a href="http://codemirror.net/mode/xml/">xml mode</a>: Allow dashes in HTML tag names.</li>
-    <li><a href="http://codemirror.net/mode/javascript/">javascript mode</a>: Improve parsing of async methods, TypeScript-style comma-separated superclass lists.</li>
-    <li><a href="http://codemirror.net/demo/folding.html">indent-fold addon</a>: Ignore comment lines.</li>
-  </ul>
-
-  <p class="rel">19-01-2017: <a href="http://codemirror.net/codemirror-5.23.0.zip">Version 5.23.0</a>:</p>
-
-  <ul class=rel-note>
-    <li>Presentation-related elements DOM elements are now marked as such to help screen readers.</li>
-    <li><a href="http://codemirror.net/mode/markdown/">markdown mode</a>: Be more picky about what HTML tags look like to avoid false positives.</li>
-    <li><code>findModeByMIME</code> now understands <code>+json</code> and <code>+xml</code> MIME suffixes.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_closebrackets">closebrackets addon</a>: Add support for an <code>override</code> option to ignore language-specific defaults.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_panel">panel addon</a>: Add a <code>stable</code> option that auto-scrolls the content to keep it in the same place when inserting/removing a panel.</li>
-  </ul>
-
-  <p class="rel">20-12-2016: <a href="http://codemirror.net/codemirror-5.22.0.zip">Version 5.22.0</a>:</p>
-
-  <ul class=rel-note>
-    <li><a href="http://codemirror.net/demo/sublime.html">sublime bindings</a>: Make <code>selectBetweenBrackets</code> work with multiple cursors.</li>
-    <li><a href="http://codemirror.net/mode/javascript/">javascript mode</a>: Fix issues with parsing complex TypeScript types, imports, and exports.</li>
-    <li>A contentEditable editor instance with autofocus enabled no longer crashes during initializing.</li>
-    <li><a href="http://codemirror.net/demo/emacs.html">emacs bindings</a>: Export <code>CodeMirror.emacs</code> to allow other addons to hook into Emacs-style functionality.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_active-line">active-line addon</a>: Add <code>nonEmpty</code> option.</li>
-    <li>New event: <a href="http://codemirror.net/doc/manual.html#event_optionChange"><code>optionChange</code></a>.</li>
-  </ul>
-
-  <p class="rel">21-11-2016: <a href="http://codemirror.net/codemirror-5.21.0.zip">Version 5.21.0</a>:</p>
-
-  <ul class=rel-note>
-    <li>Tapping/clicking the editor in <a href="http://codemirror.net/doc/manual.html#option_inputStyle">contentEditable mode</a> on Chrome now puts the cursor at the tapped position.</li>
-    <li>Fix various crashes and misbehaviors when reading composition events in <a href="http://codemirror.net/doc/manual.html#option_inputStyle">contentEditable mode</a>.</li>
-    <li>Catches and ignores an IE 'Unspecified Error' when creating an editor in an iframe before there is a <code>&lt;body&gt;</code>.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_merge">merge addon</a>: Fix several issues in the chunk-aligning feature.</li>
-    <li><a href="http://codemirror.net/mode/verilog">verilog mode</a>: Rewritten to address various issues.</li>
-    <li><a href="http://codemirror.net/mode/julia">julia mode</a>: Recognize Julia 0.5 syntax.</li>
-    <li><a href="http://codemirror.net/mode/swift">swift mode</a>: Various fixes and adjustments to current syntax.</li>
-    <li><a href="http://codemirror.net/mode/markdown">markdown mode</a>: Allow lists without a blank line above them.</li>
-    <li>The <a href="http://codemirror.net/doc/manual.html#setGutterMarker"><code>setGutterMarker</code></a>, <a href="http://codemirror.net/doc/manual.html#clearGutter"><code>clearGutter</code></a>, and <a href="http://codemirror.net/doc/manual.html#lineInfo"><code>lineInfo</code></a> methods are now available on <code>Doc</code> objects.</li>
-    <li>The <a href="http://codemirror.net/doc/manual.html#heightAtLine"><code>heightAtLine</code></a> method now takes an extra argument to allow finding the height at the top of the line's line widgets.</li>
-    <li><a href="http://codemirror.net/mode/ruby">ruby mode</a>: <code>else</code> and <code>elsif</code> are now immediately indented.</li>
-    <li><a href="http://codemirror.net/demo/vim.html">vim bindings</a>: Bind Ctrl-T and Ctrl-D to in- and dedent in insert mode.</li>
-  </ul>
-
-  <p class="rel">20-10-2016: <a href="http://codemirror.net/codemirror-5.20.0.zip">Version 5.20.0</a>:</p>
-
-  <ul class=rel-note>
-    <li>Make <code>newlineAndIndent</code> command work with multiple cursors on the same line.</li>
-    <li>Make sure keypress events for backspace are ignored.</li>
-    <li>Tokens styled with overlays no longer get a nonsense <code>cm-cm-overlay</code> class.</li>
-    <li>Line endings for pasted content are now normalized to the editor's <a href="http://codemirror.net/doc/manual.html#option_lineSeparator">preferred ending</a>.</li>
-    <li><a href="http://codemirror.net/mode/javascript">javascript mode</a>: Improve support for class expressions. Support TypeScript optional class properties, the <code>abstract</code> keyword, and return type declarations for arrow functions.</li>
-    <li><a href="http://codemirror.net/mode/css">css mode</a>: Fix highlighting of mixed-case keywords.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_closebrackets">closebrackets addon</a>: Improve behavior when typing a quote before a string.</li>
-    <li>The core is now maintained as a number of small files, using ES6 syntax and modules, under the <code>src/</code> directory. A git checkout no longer contains a working <code>codemirror.js</code> until you <code>npm build</code> (but when installing from NPM, it is included).</li>
-    <li>The <a href="http://codemirror.net/doc/manual.html#event_refresh"><code>refresh</code></a> event is now documented and stable.</li>
-  </ul>
-
-  <p class="rel">20-09-2016: <a href="http://codemirror.net/codemirror-5.19.0.zip">Version 5.19.0</a>:</p>
-
-  <ul class=rel-note>
-    <li><a href="http://codemirror.net/mode/erlang">erlang mode</a>: Fix mode crash when trying to read an empty context.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_comment">comment addon</a>: Fix broken behavior when toggling comments inside a comment.</li>
-    <li>xml-fold addon: Fix a null-dereference bug.</li>
-    <li>Page up and page down now do something even in single-line documents.</li>
-    <li>Fix an issue where the cursor position could be off in really long (~8000 character) tokens.</li>
-    <li><a href="http://codemirror.net/mode/javascript">javascript mode</a>: Better indentation when semicolons are missing. Better support for TypeScript classes, optional parameters, and the <code>type</code> keyword.</li>
-    <li>The <a href="http://codemirror.net/doc/manual.html#event_blur"><code>blur</code></a> and <a href="http://codemirror.net/doc/manual.html#event_focus"><code>focus</code></a> events now pass the DOM event to their handlers.</li>
-  </ul>
-
-  <p class="rel">23-08-2016: <a href="http://codemirror.net/codemirror-5.18.2.zip">Version 5.18.2</a>:</p>
-
-  <ul class=rel-note>
-    <li><a href="http://codemirror.net/mode/vue">vue mode</a>: Fix outdated references to renamed Pug mode dependency.</li>
-  </ul>
-
-  <p class="rel">22-08-2016: <a href="http://codemirror.net/codemirror-5.18.0.zip">Version 5.18.0</a>:</p>
-
-  <ul class=rel-note>
-    <li>Make sure <a href="http://codemirror.net/doc/manual.html#addLineClass">gutter backgrounds</a> stick to the rest of the gutter during horizontal scrolling.</li>
-    <li>The contenteditable <a href="http://codemirror.net/doc/manual.html#option_inputStyle"><code>inputStyle</code></a> now properly supports pasting on pre-Edge IE versions.</li>
-    <li><a href="http://codemirror.net/mode/javascript">javascript mode</a>: Fix some small parsing bugs and improve TypeScript support.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_matchbrackets">matchbrackets addon</a>: Fix bug where active highlighting was left in editor when the addon was disabled.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_match-highlighter">match-highlighter addon</a>: Only start highlighting things when the editor gains focus.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_javascript-hint">javascript-hint addon</a>: Also complete non-enumerable properties.</li>
-    <li>The <a href="http://codemirror.net/doc/manual.html#addOverlay"><code>addOverlay</code></a> method now supports a <code>priority</code> option to control the order in which overlays are applied.</li>
-    <li>MIME types that end in <code>+json</code> now default to the JSON mode when the MIME itself is not defined.</li>
-    <li>The mode formerly known as Jade was renamed to <a href="http://codemirror.net/mode/pug">Pug</a>.</li>
-    <li>The <a href="http://codemirror.net/mode/python">Python mode</a> now defaults to Python 3 (rather than 2) syntax.</li>
-  </ul>
-
-  <p class="rel">19-07-2016: <a href="http://codemirror.net/codemirror-5.17.0.zip">Version 5.17.0</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix problem with wrapped trailing whitespace displaying incorrectly.</li>
-    <li>Prevent IME dialog from overlapping typed content in Chrome.</li>
-    <li>Improve measuring of characters near a line wrap.</li>
-    <li><a href="http://codemirror.net/mode/javascript">javascript mode</a>: Improve support for <code>async</code>, allow trailing commas in <code>import</code> lists.</li>
-    <li><a href="http://codemirror.net/demo/vim.html">vim bindings</a>: Fix backspace in replace mode.</li>
-    <li><a href="http://codemirror.net/demo/sublime.html">sublime bindings</a>: Fix some key bindings on OS X to match Sublime Text.</li>
-    <li><a href="http://codemirror.net/mode/markdown">markdown mode</a>: Add more classes to image links in highlight-formatting mode.</li>
-  </ul>
-
-  <p class="rel">20-06-2016: <a href="http://codemirror.net/codemirror-5.16.0.zip">Version 5.16.0</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix glitches when dragging content caused by the drop indicator receiving mouse events.</li>
-    <li>Make Control-drag work on Firefox.</li>
-    <li>Make clicking or selection-dragging at the end of a wrapped line select the right position.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_show-hint">show-hint addon</a>: Prevent widget scrollbar from hiding part of the hint text.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_rulers">rulers addon</a>: Prevent rulers from forcing a horizontal editor scrollbar.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_search">search addon</a>: Automatically bind search-related keys in persistent dialog.</li>
-    <li><a href="http://codemirror.net/demo/sublime.html">sublime keymap</a>: Add a multi-cursor aware smart backspace binding.</li>
-  </ul>
-
-  <p class="rel">20-05-2016: <a href="http://codemirror.net/codemirror-5.15.2.zip">Version 5.15.2</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix a critical document corruption bug that occurs when a document is gradually grown.</li>
-  </ul>
-
-  <p class="rel">20-05-2016: <a href="http://codemirror.net/codemirror-5.15.0.zip">Version 5.15.0</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix bug that caused the selection to reset when focusing the editor in contentEditable input mode.</li>
-    <li>Fix issue where not all ASCII control characters were being replaced by placeholders.</li>
-    <li>Remove the assumption that all modes have a <code>startState</code> method from several wrapping modes.</li>
-    <li>Fix issue where the editor would complain about overlapping collapsed ranges when there weren't any.</li>
-    <li>Optimize document tree building when loading or pasting huge chunks of content.</li>
-    <li>Explicitly bind Ctrl-O on OS X to make that binding (鈥渙pen line鈥�) act as expected.</li>
-    <li>Pasting <a href="http://codemirror.net/doc/manual.html#option_lineWiseCopyCut">linewise-copied</a> content when there is no selection now inserts the lines above the current line.</li>
-    <li><a href="http://codemirror.net/mode/markdown/">markdown mode</a>: Fix several issues in matching link targets.</li>
-    <li><a href="http://codemirror.net/mode/clike/">clike mode</a>: Improve indentation of C++ template declarations.</li>
-    <li><a href="http://codemirror.net/mode/javascript/">javascript mode</a>: Support <code>async</code>/<code>await</code> and improve support for TypeScript type syntax.</li>
-  </ul>
-
-  <p class="rel">20-04-2016: <a href="http://codemirror.net/codemirror-5.14.0.zip">Version 5.14.0</a>:</p>
-
-  <ul class="rel-note">
-    <li><a href="http://codemirror.net/doc/manual.html#posFromIndex"><code>posFromIndex</code></a> and <a href="http://codemirror.net/doc/manual.html#indexFromPos"><code>indexFromPos</code></a> now take <a href="http://codemirror.net/doc/manual.html#option_lineSeparator"><code>lineSeparator</code></a> into account</li>
-    <li><a href="http://codemirror.net/demo/vim.html">vim bindings</a>: Only call <code>.save()</code> when it is actually available</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_comment">comment addon</a>: Be careful not to mangle multi-line strings</li>
-    <li><a href="http://codemirror.net/mode/python/index.html">Python mode</a>: Improve distinguishing of decorators from <code>@</code> operators</li>
-    <li><a href="http://codemirror.net/doc/manual.html#findMarks"><code>findMarks</code></a>: No longer return marks that touch but don't overlap given range</li>
-    <li><a href="http://codemirror.net/demo/vim.html">vim bindings</a>: Add yank command</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_match-highlighter">match-highlighter addon</a>: Add <code>trim</code> option to disable ignoring of whitespace</li>
-    <li><a href="http://codemirror.net/mode/powershell/index.html">PowerShell mode</a>: Added</li>
-    <li><a href="http://codemirror.net/mode/yacas/index.html">Yacas mode</a>: Added</li>
-    <li><a href="http://codemirror.net/mode/webidl/index.html">Web IDL mode</a>: Added</li>
-    <li><a href="http://codemirror.net/mode/sas/index.html">SAS mode</a>: Added</li>
-    <li><a href="http://codemirror.net/mode/mbox/index.html">mbox mode</a>: Added</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.13.4...5.14.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">21-03-2016: <a href="http://codemirror.net/codemirror-5.13.2.zip">Version 5.13.2</a>:</p>
-
-  <ul class="rel-note">
-    <li>Solves a problem where the gutter would sometimes not extend all the way to the end of the document.</li>
-  </ul>
-
-  <p class="rel">21-03-2016: <a href="http://codemirror.net/codemirror-5.13.zip">Version 5.13</a>:</p>
-
-  <ul class="rel-note">
-    <li>New DOM event forwarded: <a href="http://codemirror.net/doc/manual.html#event_dom"><code>&quot;dragleave&quot;</code></a>.</li>
-    <li><a href="http://codemirror.net/mode/protobuf/index.html">protobuf mode</a>: Newly added.</li>
-    <li>Fix problem where <a href="http://codemirror.net/doc/manual.html#findMarks"><code>findMarks</code></a> sometimes failed to find multi-line marks.</li>
-    <li>Fix crash that showed up when atomic ranges and bidi text were combined.</li>
-    <li><a href="http://codemirror.net/demo/complete.html">show-hint addon</a>: Completion widgets no longer close when the line indented or dedented.</li>
-    <li><a href="http://codemirror.net/demo/merge.html">merge addon</a>: Fix bug when merging chunks at the end of the file.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_placeholder">placeholder addon</a>: No longer gets confused by <a href="http://codemirror.net/doc/manual.html#swapDoc"><code>swapDoc</code></a>.</li>
-    <li><a href="http://codemirror.net/doc/manual.html#addon_simplescrollbars">simplescrollbars addon</a>: Fix invalid state when deleting at end of document.</li>
-    <li><a href="http://codemirror.net/mode/clike/index.html">clike mode</a>: No longer gets confused when a comment starts after an operator.</li>
-    <li><a href="http://codemirror.net/mode/markdown/index.html">markdown mode</a>: Now supports CommonMark-style flexible list indentation.</li>
-    <li><a href="http://codemirror.net/mode/dylan/index.html">dylan mode</a>: Several improvements and fixes.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.12.0...5.13.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">19-02-2016: <a href="http://codemirror.net/codemirror-5.12.zip">Version 5.12</a>:</p>
-
-  <ul class="rel-note">
-    <li><a href="http://codemirror.net/demo/vim.html">Vim bindings</a>: Ctrl-Q is now an alias for Ctrl-V.</li>
-    <li><a href="http://codemirror.net/demo/vim.html">Vim bindings</a>: The Vim API now exposes an <code>unmap</code> method to unmap bindings.</li>
-    <li><a href="http://codemirror.net/demo/activeline.html">active-line addon</a>: This addon can now style the active line's gutter.</li>
-    <li><a href="http://codemirror.net/mode/fcl/">FCL mode</a>: Newly added.</li>
-    <li><a href="http://codemirror.net/mode/sql/">SQL mode</a>: Now has a Postgresql dialect.</li>
-    <li>Fix <a href="https://github.com/codemirror/CodeMirror/issues/3781">issue</a> where trying to scroll to a horizontal position outside of the document's width could cause the gutter to be positioned incorrectly.</li>
-    <li>Use absolute, rather than fixed positioning in the context-menu intercept hack, to work around a <a href="https://github.com/codemirror/CodeMirror/issues/3238">problem</a> when the editor is inside a transformed parent container.</li>
-    <li>Solve a <a href="https://github.com/codemirror/CodeMirror/issues/3821">problem</a> where the horizontal scrollbar could hide text in Firefox.</li>
-    <li>Fix a <a href="https://github.com/codemirror/CodeMirror/issues/3834">bug</a> that caused phantom scroll space under the text in some situations.</li>
-    <li><a href="http://codemirror.net/demo/sublime.html">Sublime Text bindings</a>: Bind delete-line to Shift-Ctrl-K on OS X.</li>
-    <li><a href="http://codemirror.net/mode/markdown/">Markdown mode</a>: Fix <a href="https://github.com/codemirror/CodeMirror/issues/3787">issue</a> where the mode would keep state related to fenced code blocks in an unsafe way, leading to occasional corrupted parses.</li>
-    <li><a href="http://codemirror.net/mode/markdown/">Markdown mode</a>: Ignore backslashes in code fragments.</li>
-    <li><a href="http://codemirror.net/mode/markdown/">Markdown mode</a>: Use whichever mode is registered as <code>text/html</code> to parse HTML.</li>
-    <li><a href="http://codemirror.net/mode/clike/">Clike mode</a>: Improve indentation of Scala <code>=&gt;</code> functions.</li>
-    <li><a href="http://codemirror.net/mode/python/">Python mode</a>: Improve indentation of bracketed code.</li>
-    <li><a href="http://codemirror.net/mode/htmlmixed/">HTMLMixed mode</a>: Support multi-line opening tags for sub-languages (<code>&lt;script&gt;</code>, <code>&lt;style&gt;</code>, etc).</li>
-    <li><a href="http://codemirror.net/mode/spreadsheet/">Spreadsheet mode</a>: Fix bug where the mode did not advance the stream when finding a backslash.</li>
-    <li><a href="http://codemirror.net/mode/xml/">XML mode</a>: The mode now takes a <code>matchClosing</code> option to configure whether mismatched closing tags should be highlighted as errors.</li>
-  </ul>
-
-  <p class="rel">20-01-2016: <a href="http://codemirror.net/codemirror-5.11.zip">Version 5.11</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/jsx/index.html">JSX</a>, <a href="../mode/haskell-literate/index.html">literate Haskell</a></li>
-    <li>The editor now forwards more <a href="manual.html#event_dom">DOM events</a>: <code>cut</code>, <code>copy</code>, <code>paste</code>, and <code>touchstart</code>. It will also forward <code>mousedown</code> for drag events</li>
-    <li>Fixes a bug where bookmarks next to collapsed spans were not rendered</li>
-    <li>The <a href="../mode/swift/index.html">Swift</a> mode now supports auto-indentation</li>
-    <li>Frontmatters in the <a href="../mode/yaml-frontmatter/index.html">YAML frontmatter</a> mode are now optional as intended</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.10.0...5.11.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">21-12-2015: <a href="http://codemirror.net/codemirror-5.10.zip">Version 5.10</a>:</p>
-
-  <ul class="rel-note">
-    <li>Modify the way <a href="manual.html#mark_atomic">atomic ranges</a> are skipped by selection to try and make it less surprising.</li>
-    <li>The <a href="../mode/swift/index.html">Swift mode</a> was rewritten.</li>
-    <li>New addon: <a href="manual.html#addon_jump-to-line">jump-to-line</a>.</li>
-    <li>New method: <a href="manual.html#isReadOnly"><code>isReadOnly</code></a>.</li>
-    <li>The <a href="manual.html#addon_show-hint">show-hint addon</a> now defaults to picking completions on single click.</li>
-    <li>The object passed to <a href="manual.html#event_beforeSelectionChange"><code>&quot;beforeSelectionChange&quot;</code></a> events now has an <code>origin</code> property.</li>
-    <li>New mode: <a href="../mode/crystal/index.html">Crystal</a>.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.9.0...5.10.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">23-11-2015: <a href="http://codemirror.net/codemirror-5.9.zip">Version 5.9</a>:</p>
-
-  <ul class="rel-note">
-    <li>Improve the way overlay (OS X-style) scrollbars are handled</li>
-    <li>Make <a href="manual.html#addon_annotatescrollbar">annotatescrollbar</a> and scrollpastend addons work properly together</li>
-    <li>Make <a href="manual.html#addon_show-hint">show-hint</a> addon select options on single click by default, move selection to hovered item</li>
-    <li>Properly fold comments that include block-comment-start markers</li>
-    <li>Many small language mode fixes</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.8.0...5.9.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">20-10-2015: <a href="http://codemirror.net/codemirror-5.8.zip">Version 5.8</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fixes an infinite loop in
-    the <a href="manual.html#addon_hardwrap">hardwrap
-    addon</a></li>
-    <li>New modes: <a href="../mode/nsis/index.html">NSIS</a>, <a href="../mode/clike/index.html">Ceylon</a></li>
-    <li>The Kotlin mode is now a <a href="../mode/clike/index.html">clike</a> dialect, rather than a stand-alone mode</li>
-    <li>New option: <a href="manual.html#option_allowDropFileTypes"><code>allowDropFileTypes</code></a>. Binary files can no longer be dropped into CodeMirror</li>
-    <li>New themes: <a href="../demo/theme.html#bespin">bespin</a>, <a href="../demo/theme.html#hopscotch">hopscotch</a>, <a href="../demo/theme.html#isotope">isotope</a>, <a href="../demo/theme.html#railscasts">railscasts</a></li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.7.0...5.8.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">20-09-2015: <a href="http://codemirror.net/codemirror-5.7.zip">Version 5.7</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/vue/index.html">Vue</a>, <a href="../mode/oz/index.html">Oz</a>, <a href="../mode/mscgen/index.html">MscGen</a> (and dialects), <a href="../mode/css/gss.html">Closure Stylesheets</a></li>
-    <li>Implement <a href="http://commonmark.org">CommonMark</a>-style flexible list indent and cross-line code spans in <a href="../mode/markdown/index.html">Markdown</a> mode</li>
-    <li>Add a replace-all button to the <a href="manual.html#addon_search">search addon</a>, and make the persistent search dialog transparent when it obscures the match</li>
-    <li>Handle <code>acync</code>/<code>await</code> and ocal and binary numbers in <a href="../mode/javascript/index.html">JavaScript mode</a></li>
-    <li>Fix various issues with the <a href="../mode/haxe/index.html">Haxe mode</a></li>
-    <li>Make the <a href="manual.html#addon_closebrackets">closebrackets addon</a> select only the wrapped text when wrapping selection in brackets</li>
-    <li>Tokenize properties as properties in the <a href="../mode/coffeescript/index.html">CoffeeScript mode</a></li>
-    <li>The <a href="manual.html#addon_placeholder">placeholder addon</a> now accepts a DOM node as well as a string placeholder</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.6.0...5.7.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">20-08-2015: <a href="http://codemirror.net/codemirror-5.6.zip">Version 5.6</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix bug where you could paste into a <code>readOnly</code> editor</li>
-    <li>Show a cursor at the drop location when dragging over the editor</li>
-    <li>The <a href="../mode/rust/index.html">Rust mode</a> was rewritten to handle modern Rust</li>
-    <li>The editor and theme CSS was cleaned up. Some selectors are now less specific than before</li>
-    <li>New theme: <a href="../demo/theme.html#abcdef">abcdef</a></li>
-    <li>Lines longer than <a href="manual.html#option_maxHighlightLength"><code>maxHighlightLength</code></a> are now less likely to mess up indentation</li>
-    <li>New addons: <a href="manual.html#addon_autorefresh"><code>autorefresh</code></a> for refreshing an editor the first time it becomes visible, and <code>html-lint</code> for using <a href="http://htmlhint.com/">HTMLHint</a></li>
-    <li>The <a href="manual.html#addon_search"><code>search</code></a> addon now recognizes <code>\r</code> and <code>\n</code> in pattern and replacement input</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.5.0...5.6.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">20-07-2015: <a href="http://codemirror.net/codemirror-5.5.zip">Version 5.5</a>:</p>
-
-  <ul class="rel-note">
-    <li>New option: <a href="manual.html#option_lineSeparator"><code>lineSeparator</code></a> (with corresponding <a href="manual.html#lineSeparator">method</a>)
-    <li>New themes: <a href="../demo/theme.html#dracula">dracula</a>, <a href="../demo/theme.html#seti">seti</a>, <a href="../demo/theme.html#yeti">yeti</a>, <a href="../demo/theme.html#material">material</a>, and <a href="../demo/theme.html#icecoder">icecoder</a></li>
-    <li>New modes: <a href="../mode/brainfuck/index.html">Brainfuck</a>, <a href="../mode/vhdl/index.html">VHDL</a>, Squirrel (<a href="../mode/clike/index.html">clike</a> dialect)</li>
-    <li>Define a <code>findPersistent</code> command in
-    the <a href="../demo/search.html">search</a> addon, for a dialog
-    that stays open as you cycle through matches</li>
-    <li>From this release on, the NPM module doesn't include documentation and demos</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.4.0...5.5.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">25-06-2015: <a href="http://codemirror.net/codemirror-5.4.zip">Version 5.4</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/twig/index.html">Twig</a>, <a href="../mode/elm/index.html">Elm</a>, <a href="../mode/factor/index.html">Factor</a>, <a href="../mode/swift/index.html">Swift</a></li>
-    <li>Prefer clipboard API (if available) when pasting</li>
-    <li>Refined definition highlighting in <a href="../mode/clike/index.html">clike</a> mode</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.3.0...5.4.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">20-05-2015: <a href="http://codemirror.net/codemirror-5.3.zip">Version 5.3</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix several regressions in the <a href="manual.html#addon_show-hint"><code>show-hint</code></a> addon (<code>completeSingle</code> option, <code>"shown"</code> and <code>"close"</code> events)</li>
-    <li>The <a href="../demo/vim.html">vim mode</a> API was <a href="manual.html#vimapi">documented</a></li>
-    <li>New modes: <a href="../mode/asn.1/index.html">ASN.1</a>, <a href="../mode/ttcn/index.html">TTCN</a>, and <a href="../mode/ttcn-cfg/index.html">TTCN-CFG</a></li>
-    <li>The <a href="../mode/clike/index.html">clike</a> mode can now deep-indent <code>switch</code> statements, and roughly recognizes types and defined identifiers</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.2.0...5.3.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">20-04-2015: <a href="http://codemirror.net/codemirror-5.2.zip">Version 5.2</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix several race conditions
-    in <a href="manual.html#addon_show-hint"><code>show-hint</code></a>'s
-    asynchronous mode</li>
-    <li>Fix backspace binding in <a href="../demo/sublime.html">Sublime bindings</a></li>
-    <li>Change the way IME is handled in the <code>"textarea"</code> <a href="manual.html#option_inputStyle">input style</a></li>
-
-    <li>New modes: <a href="../mode/mumps/index.html">MUMPS</a>, <a href="../mode/handlebars/index.html">Handlebars</a></li>
-    <li>Rewritten modes: <a href="../mode/django/index.html">Django</a>, <a href="../mode/z80/index.html">Z80</a></li>
-    <li>New theme: <a href="../demo/theme.html#liquibyte">Liquibyte</a></li>
-    <li>New option: <a href="manual.html#option_lineWiseCopyCut"><code>lineWiseCopyCut</code></a></li>
-    <li>The <a href="../demo/vim.html">Vim mode</a> now supports buffer-local options and the <code>filetype</code> setting</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.1.0...5.2.0">list of patches</a></li>
-  </ul>
-
-  <p class="rel">23-03-2015: <a href="http://codemirror.net/codemirror-5.1.zip">Version 5.1</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/asciiarmor/index.html">ASCII armor</a> (PGP data), <a href="../mode/troff/index.html">Troff</a>, and <a href="../mode/cmake/index.html">CMake</a>.</li>
-    <li>Remove SmartyMixed mode, rewrite <a href="../mode/smarty/index.html">Smarty</a> mode to supersede it.</li>
-    <li>New commands in the <a href="manual.html#addon_merge">merge
-    addon</a>: <code>goNextDiff</code> and <code>goPrevDiff</code>.</li>
-    <li>The <a href="manual.html#addon_closebrackets">closebrackets addon</a> can now be configured per mode.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/5.0.0...5.1.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-02-2015: <a href="http://codemirror.net/codemirror-5.0.zip">Version 5.0</a>:</p>
-
-  <ul class="rel-note">
-    <li>Experimental mobile support (tested on iOS, Android Chrome, stock Android browser)</li>
-    <li>New option <a href="manual.html#option_inputStyle"><code>inputStyle</code></a> to switch between hidden textarea and contenteditable input.</li>
-    <li>The <a href="manual.html#getInputField"><code>getInputField</code></a>
-    method is no longer guaranteed to return a textarea.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.13.0...5.0.0">list of patches</a>.</li>
-  </ul>
-
-</section>
-
-<section id=v4 class=first>
-
-  <h2>Version 4.x</h2>
-
-  <p class="rel">20-02-2015: <a href="http://codemirror.net/codemirror-4.13.zip">Version 4.13</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix the way the <a href="../demo/closetag.html"><code>closetag</code></a> demo handles the slash character.</li>
-    <li>New modes: <a href="../mode/forth/index.html">Forth</a>, <a href="../mode/stylus/index.html">Stylus</a>.</li>
-    <li>Make the <a href="../mode/css/index.html">CSS mode</a> understand some modern CSS extensions.</li>
-    <li>Have the <a href="../mode/clike/index.html">Scala mode</a> handle symbols and triple-quoted strings.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.12.0...4.13.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">22-01-2015: <a href="http://codemirror.net/codemirror-4.12.zip">Version 4.12</a>:</p>
-
-  <ul class="rel-note">
-    <li>The <a href="manual.html#addon_closetag"><code>closetag</code></a>
-    addon now defines a <code>"closeTag"</code> command.</li>
-    <li>Adds a <code>findModeByFileName</code> to the <a href="manual.html#addon_meta">mode metadata</a>
-    addon.</li>
-    <li><a href="../demo/simplemode.html">Simple mode</a> rules can
-    now contain a <code>sol</code> property to only match at the start
-    of a line.</li>
-    <li>New
-    addon: <a href="manual.html#addon_selection-pointer"><code>selection-pointer</code></a>
-    to style the mouse cursor over the selection.</li>
-    <li>Improvements to the <a href="../mode/sass/index.html">Sass mode</a>'s indentation.</li>
-    <li>The <a href="../demo/vim.html">Vim keymap</a>'s search functionality now
-    supports <a href="manual.html#addon_matchesonscrollbar">scrollbar
-    annotation</a>.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.11.0...4.12.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">9-01-2015: <a href="http://codemirror.net/codemirror-4.11.zip">Version 4.11</a>:</p>
-
-  <p class="rel-note">Unfortunately, 4.10 did not take care of the
-  Firefox scrolling issue entirely. This release adds two more patches
-  to address that.</p>
-
-  <p class="rel">29-12-2014: <a href="http://codemirror.net/codemirror-4.10.zip">Version 4.10</a>:</p>
-
-  <p class="rel-note">Emergency single-patch update to 4.9. Fixes
-  Firefox-specific problem where the cursor could end up behind the
-  horizontal scrollbar.</p>
-
-  <p class="rel">23-12-2014: <a href="http://codemirror.net/codemirror-4.9.zip">Version 4.9</a>:</p>
-
-  <ul class="rel-note">
-    <li>Overhauled scroll bar handling.
-    Add pluggable <a href="../demo/simplescrollbars.html">scrollbar
-    implementations</a>.</li>
-    <li>Tweaked behavior for
-    the <a href="manual.html#addon_show-hint">completion addons</a> to
-    not take text after cursor into account.</li>
-    <li>Two new optional features in
-    the <a href="manual.html#addon_merge">merge addon</a>: aligning
-    editors, and folding unchanged text.</li>
-    <li>New
-    modes: <a href="../mode/dart/index.html">Dart</a>, <a href="../mode/ebnf/index.html">EBNF</a>, <a href="../mode/spreadsheet/index.html">spreadsheet</a>,
-    and <a href="../mode/soy/index.html">Soy</a>.</li>
-    <li>New <a href="../demo/panel.html">addon</a> to show persistent panels below/above an editor.</li>
-    <li>New themes: <a href="../demo/theme.html#zenburn">zenburn</a>
-    and <a href="../demo/theme.html#tomorrow-night-bright">tomorrow night
-    bright</a>.</li>
-    <li>Allow ctrl-click to clear existing cursors.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.8.0...4.9.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">22-11-2014: <a href="http://codemirror.net/codemirror-4.8.zip">Version 4.8</a>:</p>
-
-  <ul class="rel-note">
-    <li>Built-in support for <a href="manual.html#normalizeKeyMap">multi-stroke key bindings</a>.</li>
-    <li>New method: <a href="manual.html#getLineTokens"><code>getLineTokens</code></a>.</li>
-    <li>New modes: <a href="../mode/dockerfile/index.html">dockerfile</a>, <a href="../mode/idl/index.html">IDL</a>, <a href="../mode/clike/index.html">Objective C</a> (crude).</li>
-    <li>Support styling of gutter backgrounds, allow <code>"gutter"</code> styles in <a href="manual.html#addLineClass"><code>addLineClass</code></a>.</li>
-    <li>Many improvements to the <a href="../demo/vim.html">Vim mode</a>, rewritten visual mode.</li>
-    <li>Improvements to modes: <a href="../mode/gfm/index.html">gfm</a> (strikethrough), <a href="../mode/sparql/index.html">SPARQL</a> (version 1.1 support), and <a href="../mode/stex/index.html">sTeX</a> (no more runaway math mode).
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.7.0...4.8.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-10-2014: <a href="http://codemirror.net/codemirror-4.7.zip">Version 4.7</a>:</p>
-
-  <ul class="rel-note">
-    <li><strong>Incompatible</strong>:
-    The <a href="../demo/lint.html">lint addon</a> now passes the
-    editor's value as first argument to asynchronous lint functions,
-    for consistency. The editor is still passed, as fourth
-    argument.</li>
-    <li>Improved handling of unicode identifiers in modes for
-    languages that support them.</li>
-    <li>More mode
-    improvements: <a href="../mode/coffeescript/index.html">CoffeeScript</a>
-    (indentation), <a href="../mode/verilog/index.html">Verilog</a>
-    (indentation), <a href="../mode/clike/index.html">Scala</a>
-    (indentation, triple-quoted strings),
-    and <a href="../mode/php/index.html">PHP</a> (interpolated
-    variables in heredoc strings).</li>
-    <li>New modes: <a href="../mode/textile/index.html">Textile</a> and <a href="../mode/tornado/index.html">Tornado templates</a>.</li>
-    <li>Experimental new <a href="../demo/simplemode.html">way to define modes</a>.</li>
-    <li>Improvements to the <a href="../demo/vim.html">Vim
-    bindings</a>: Arbitrary insert mode key mappings are now possible,
-    and text objects are supported in visual mode.</li>
-    <li>The mode <a href="../mode/meta.js">meta-information file</a>
-    now includes information about file extensions,
-    and <a href="manual.html#addon_meta">helper
-    functions</a> <code>findModeByMIME</code>
-    and <code>findModeByExtension</code>.</li>
-    <li>New logo!</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.6.0...4.7.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">19-09-2014: <a href="http://codemirror.net/codemirror-4.6.zip">Version 4.6</a>:</p>
-
-  <ul class="rel-note">
-    <li>New mode: <a href="../mode/modelica/index.html">Modelica</a></li>
-    <li>New method: <a href="manual.html#findWordAt"><code>findWordAt</code></a></li>
-    <li>Make it easier to <a href="../demo/markselection.html">use text background styling</a></li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.5.0...4.6.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">21-08-2014: <a href="http://codemirror.net/codemirror-4.5.zip">Version 4.5</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix several serious bugs with horizontal scrolling</li>
-    <li>New mode: <a href="../mode/slim/index.html">Slim</a></li>
-    <li>New command: <a href="manual.html#command_goLineLeftSmart"><code>goLineLeftSmart</code></a></li>
-    <li>More fixes and extensions for the <a href="../demo/vim.html">Vim</a> visual block mode</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.4.0...4.5.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">21-07-2014: <a href="http://codemirror.net/codemirror-4.4.zip">Version 4.4</a>:</p>
-
-  <ul class="rel-note">
-    <li><strong>Note:</strong> Some events might now fire in slightly
-    different order (<code>"change"</code> is still guaranteed to fire
-    before <code>"cursorActivity"</code>)</li>
-    <li>Nested operations in multiple editors are now synced (complete
-    at same time, reducing DOM reflows)</li>
-    <li>Visual block mode for <a href="../demo/vim.html">vim</a> (&lt;C-v>) is nearly complete</li>
-    <li>New mode: <a href="../mode/kotlin/index.html">Kotlin</a></li>
-    <li>Better multi-selection paste for text copied from multiple CodeMirror selections</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.3.0...4.4.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">23-06-2014: <a href="http://codemirror.net/codemirror-4.3.zip">Version 4.3</a>:</p>
-
-  <ul class="rel-note">
-    <li>Several <a href="../demo/vim.html">vim bindings</a>
-    improvements: search and exCommand history, global flag
-    for <code>:substitute</code>, <code>:global</code> command.
-    <li>Allow hiding the cursor by
-    setting <a href="manual.html#option_cursorBlinkRate"><code>cursorBlinkRate</code></a>
-    to a negative value.</li>
-    <li>Make gutter markers themeable, use this in foldgutter.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.2.0...4.3.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">19-05-2014: <a href="http://codemirror.net/codemirror-4.2.zip">Version 4.2</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix problem where some modes were broken by the fact that empty tokens were forbidden.</li>
-    <li>Several fixes to context menu handling.</li>
-    <li>On undo, scroll <em>change</em>, not cursor, into view.</li>
-    <li>Rewritten <a href="../mode/jade/index.html">Jade</a> mode.</li>
-    <li>Various improvements to <a href="../mode/shell/index.html">Shell</a> (support for more syntax) and <a href="../mode/python/index.html">Python</a> (better indentation) modes.</li>
-    <li>New mode: <a href="../mode/cypher/index.html">Cypher</a>.</li>
-    <li>New theme: <a href="../demo/theme.html#neo">Neo</a>.</li>
-    <li>Support direct styling options (color, line style, width) in the <a href="manual.html#addon_rulers">rulers</a> addon.</li>
-    <li>Recognize per-editor configuration for the <a href="manual.html#addon_show-hint">show-hint</a> and <a href="manual.html#addon_foldcode">foldcode</a> addons.</li>
-    <li>More intelligent scanning for existing close tags in <a href="manual.html#addon_closetag">closetag</a> addon.</li>
-    <li>In the <a href="../demo/vim.html">Vim bindings</a>: Fix bracket matching, support case conversion in visual mode, visual paste, append action.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.1.0...4.2.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">22-04-2014: <a href="http://codemirror.net/codemirror-4.1.zip">Version 4.1</a>:</p>
-
-  <ul class="rel-note">
-    <li><em>Slightly incompatible</em>:
-    The <a href="manual.html#event_cursorActivity"><code>"cursorActivity"</code></a>
-    event now fires after all other events for the operation (and only
-    for handlers that were actually registered at the time the
-    activity happened).</li>
-    <li>New command: <a href="manual.html#command_insertSoftTab"><code>insertSoftTab</code></a>.</li>
-    <li>New mode: <a href="../mode/django/index.html">Django</a>.</li>
-    <li>Improved modes: <a href="../mode/verilog/index.html">Verilog</a> (rewritten), <a href="../mode/jinja2/index.html">Jinja2</a>, <a href="../mode/haxe/index.html">Haxe</a>, <a href="../mode/php/index.html">PHP</a> (string interpolation highlighted), <a href="../mode/javascript/index.html">JavaScript</a> (indentation of trailing else, template strings), <a href="../mode/livescript/index.html">LiveScript</a> (multi-line strings).</li>
-    <li>Many small issues from the 3.x鈫�4.x transition were found and fixed.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/4.0.3...4.1.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-03-2014: <a href="http://codemirror.net/codemirror-4.0.zip">Version 4.0</a>:</p>
-
-  <p class="rel-note">This is a new major version of CodeMirror. There
-  are a few <strong>incompatible</strong> changes in the API. Upgrade
-  with care, and read the <a href="upgrade_v4.html">upgrading
-  guide</a>.</p>
-
-  <ul class="rel-note">
-    <li>Multiple selections (ctrl-click, alt-drag, <a href="manual.html#setSelections">API</a>).</li>
-    <li>Sublime Text <a href="../demo/sublime.html">bindings</a>.</li>
-    <li><a href="manual.html#modloader">Module loader shims</a> wrapped around all modules.</li>
-    <li>Selection <a href="manual.html#command_undoSelection">undo</a>/<a href="manual.html#command_redoSelection">redo</a>.</li>
-    <li>Improved character measuring (faster, handles wrapped lines more robustly).</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.23.0...4.0.3">list of patches</a>.</li>
-  </ul>
-
-</section>
-
-<section id=v3>
-
-  <h2>Version 3.x</h2>
-
-  <p class="rel">22-04-2014: <a href="http://codemirror.net/codemirror-3.24.zip">Version 3.24</a>:</p>
-
-  <p class="rel-note">Merges the improvements from 4.1 that could
-  easily be applied to the 3.x code. Also improves the way the editor
-  size is updated when line widgets change.</p>
-
-  <p class="rel">20-03-2014: <a href="http://codemirror.net/codemirror-3.23.zip">Version 3.23</a>:</p>
-
-  <ul class="rel-note">
-    <li>In the <a href="../mode/xml/index.html">XML mode</a>,
-    add <code>brackets</code> style to angle brackets, fix
-    case-sensitivity of tags for HTML.</li>
-    <li>New mode: <a href="../mode/dylan/index.html">Dylan</a>.</li>
-    <li>Many improvements to the <a href="../demo/vim.html">Vim bindings</a>.</li>
-  </ul>
-
-  <p class="rel">21-02-2014: <a href="http://codemirror.net/codemirror-3.22.zip">Version 3.22</a>:</p>
-
-  <ul class="rel-note">
-    <li>Adds the <a href="manual.html#findMarks"><code>findMarks</code></a> method.</li>
-    <li>New addons: <a href="manual.html#addon_rulers">rulers</a>, markdown-fold, yaml-lint.</li>
-    <li>New theme: <a href="../demo/theme.html#mdn-like">mdn-like</a>.</li>
-    <li>New mode: <a href="../mode/solr/index.html">Solr</a>.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.21.0...3.22.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">16-01-2014: <a href="http://codemirror.net/codemirror-3.21.zip">Version 3.21</a>:</p>
-
-  <ul class="rel-note">
-    <li>Auto-indenting a block will no longer add trailing whitespace to blank lines.</li>
-    <li>Marking text has a new option <a href="manual.html#markText"><code>clearWhenEmpty</code></a> to control auto-removal.</li>
-    <li>Several bugfixes in the handling of bidirectional text.</li>
-    <li>The <a href="../mode/xml/index.html">XML</a> and <a href="../mode/css/index.html">CSS</a> modes were largely rewritten. <a href="../mode/css/less.html">LESS</a> support was added to the CSS mode.</li>
-    <li>The OCaml mode was moved to an <a href="../mode/mllike/index.html">mllike</a> mode, F# support added.</li>
-    <li>Make it possible to fetch multiple applicable helper values with <a href="manual.html#getHelpers"><code>getHelpers</code></a>, and to register helpers matched on predicates with <a href="manual.html#registerGlobalHelper"><code>registerGlobalHelper</code></a>.</li>
-    <li>New theme <a href="../demo/theme.html#pastel-on-dark">pastel-on-dark</a>.</li>
-    <li>Better ECMAScript 6 support in <a href="../mode/javascript/index.html">JavaScript</a> mode.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.20.0...3.21.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">21-11-2013: <a href="http://codemirror.net/codemirror-3.20.zip">Version 3.20</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/julia/index.html">Julia</a> and <a href="../mode/pegjs/index.html">PEG.js</a>.</li>
-    <li>Support ECMAScript 6 in the <a href="../mode/javascript/index.html">JavaScript mode</a>.</li>
-    <li>Improved indentation for the <a href="../mode/coffeescript/index.html">CoffeeScript mode</a>.</li>
-    <li>Make non-printable-character representation <a href="manual.html#option_specialChars">configurable</a>.</li>
-    <li>Add 鈥榥otification鈥� functionality to <a href="manual.html#addon_dialog">dialog</a> addon.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.19.0...3.20.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">21-10-2013: <a href="http://codemirror.net/codemirror-3.19.zip">Version 3.19</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/eiffel/index.html">Eiffel</a>, <a href="../mode/gherkin/index.html">Gherkin</a>, <a href="../mode/sql/?mime=text/x-mssql">MSSQL dialect</a>.</li>
-    <li>New addons: <a href="manual.html#addon_hardwrap">hardwrap</a>, <a href="manual.html#addon_sql-hint">sql-hint</a>.</li>
-    <li>New theme: <a href="../demo/theme.html#mbo">MBO</a>.</li>
-    <li>Add <a href="manual.html#token_style_line">support</a> for line-level styling from mode tokenizers.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.18.0...3.19.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">23-09-2013: <a href="http://codemirror.net/codemirror-3.18.zip">Version 3.18</a>:</p>
-
-  <p class="rel-note">Emergency release to fix a problem in 3.17
-  where <code>.setOption("lineNumbers", false)</code> would raise an
-  error.</p>
-
-  <p class="rel">23-09-2013: <a href="http://codemirror.net/codemirror-3.17.zip">Version 3.17</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/fortran/index.html">Fortran</a>, <a href="../mode/octave/index.html">Octave</a> (Matlab), <a href="../mode/toml/index.html">TOML</a>, and <a href="../mode/dtd/index.html">DTD</a>.</li>
-    <li>New addons: <a href="../addon/lint/css-lint.js"><code>css-lint</code></a>, <a href="manual.html#addon_css-hint"><code>css-hint</code></a>.</li>
-    <li>Improve resilience to CSS 'frameworks' that globally mess up <code>box-sizing</code>.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.16.0...3.17.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">21-08-2013: <a href="http://codemirror.net/codemirror-3.16.zip">Version 3.16</a>:</p>
-
-  <ul class="rel-note">
-    <li>The whole codebase is now under a single <a href="../LICENSE">license</a> file.</li>
-    <li>The project page was overhauled and redesigned.</li>
-    <li>New themes: <a href="../demo/theme.html#paraiso-dark">Paraiso</a> (<a href="../demo/theme.html#paraiso-light">light</a>), <a href="../demo/theme.html#the-matrix">The Matrix</a>.</li>
-    <li>Improved interaction between themes and <a href="manual.html#addon_active-line">active-line</a>/<a href="manual.html#addon_matchbrackets">matchbrackets</a> addons.</li>
-    <li>New <a href="manual.html#addon_foldcode">folding</a> function <code>CodeMirror.fold.comment</code>.</li>
-    <li>Added <a href="manual.html#addon_fullscreen">fullscreen</a> addon.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.15.0...3.16.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">29-07-2013: <a href="http://codemirror.net/codemirror-3.15.zip">Version 3.15</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/jade/index.html">Jade</a>, <a href="../mode/nginx/index.html">Nginx</a>.</li>
-    <li>New addons: <a href="../demo/tern.html">Tern</a>, <a href="manual.html#addon_matchtags">matchtags</a>, and <a href="manual.html#addon_foldgutter">foldgutter</a>.</li>
-    <li>Introduced <a href="manual.html#getHelper"><em>helper</em></a> concept (<a href="https://groups.google.com/forum/#!msg/codemirror/cOc0xvUUEUU/nLrX1-qnidgJ">context</a>).</li>
-    <li>New method: <a href="manual.html#getModeAt"><code>getModeAt</code></a>.</li>
-    <li>New themes: base16 <a href="../demo/theme.html#base16-dark">dark</a>/<a href="../demo/theme.html#base16-light">light</a>, 3024 <a href="../demo/theme.html#3024-night">dark</a>/<a href="../demo/theme.html#3024-day">light</a>, <a href="../demo/theme.html#tomorrow-night-eighties">tomorrow-night</a>.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.14.0...3.15.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-06-2013: <a href="http://codemirror.net/codemirror-3.14.zip">Version 3.14</a>:</p>
-
-  <ul class="rel-note">
-    <li>New
-    addons: <a href="manual.html#addon_trailingspace">trailing
-    space highlight</a>, <a href="manual.html#addon_xml-hint">XML
-    completion</a> (rewritten),
-    and <a href="manual.html#addon_merge">diff merging</a>.</li>
-    <li><a href="manual.html#markText"><code>markText</code></a>
-    and <a href="manual.html#addLineWidget"><code>addLineWidget</code></a>
-    now take a <code>handleMouseEvents</code> option.</li>
-    <li>New methods: <a href="manual.html#lineAtHeight"><code>lineAtHeight</code></a>,
-    <a href="manual.html#getTokenTypeAt"><code>getTokenTypeAt</code></a>.</li>
-    <li>More precise cleanness-tracking
-    using <a href="manual.html#changeGeneration"><code>changeGeneration</code></a>
-    and <a href="manual.html#isClean"><code>isClean</code></a>.</li>
-    <li>Many extensions to <a href="../demo/emacs.html">Emacs</a> mode
-    (prefixes, more navigation units, and more).</li>
-    <li>New
-    events <a href="manual.html#event_keyHandled"><code>"keyHandled"</code></a>
-    and <a href="manual.html#event_inputRead"><code>"inputRead"</code></a>.</li>
-    <li>Various improvements to <a href="../mode/ruby/index.html">Ruby</a>,
-    <a href="../mode/smarty/index.html">Smarty</a>, <a href="../mode/sql/index.html">SQL</a>,
-    and <a href="../demo/vim.html">Vim</a> modes.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/3.13.0...3.14.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-05-2013: <a href="http://codemirror.net/codemirror-3.13.zip">Version 3.13</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/cobol/index.html">COBOL</a> and <a href="../mode/haml/index.html">HAML</a>.</li>
-    <li>New options: <a href="manual.html#option_cursorScrollMargin"><code>cursorScrollMargin</code></a> and <a href="manual.html#option_coverGutterNextToScrollbar"><code>coverGutterNextToScrollbar</code></a>.</li>
-    <li>New addon: <a href="manual.html#addon_comment">commenting</a>.</li>
-    <li>More features added to the <a href="../demo/vim.html">Vim keymap</a>.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.12...3.13.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">19-04-2013: <a href="http://codemirror.net/codemirror-3.12.zip">Version 3.12</a>:</p>
-
-  <ul class="rel-note">
-    <li>New mode: <a href="../mode/gas/index.html">GNU assembler</a>.</li>
-    <li>New
-    options: <a href="manual.html#option_maxHighlightLength"><code>maxHighlightLength</code></a>
-    and <a href="manual.html#option_historyEventDelay"><code>historyEventDelay</code></a>.</li>
-    <li>Added <a href="manual.html#mark_addToHistory"><code>addToHistory</code></a>
-    option for <code>markText</code>.</li>
-    <li>Various fixes to JavaScript tokenization and indentation corner cases.</li>
-    <li>Further improvements to the vim mode.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.11...v3.12">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-03-2013: <a href="http://codemirror.net/codemirror-3.11.zip">Version 3.11</a>:</p>
-
-  <ul class="rel-note">
-    <li><strong>Removed code:</strong> <code>collapserange</code>,
-    <code>formatting</code>, and <code>simple-hint</code>
-    addons. <code>plsql</code> and <code>mysql</code> modes
-    (use <a href="../mode/sql/index.html"><code>sql</code></a> mode).</li>
-    <li><strong>Moved code:</strong> the range-finding functions for folding now have <a href="../addon/fold/">their own files</a>.</li>
-    <li><strong>Changed interface:</strong>
-    the <a href="manual.html#addon_continuecomment"><code>continuecomment</code></a>
-    addon now exposes an option, rather than a command.</li>
-    <li>New
-    modes: <a href="../mode/css/scss.html">SCSS</a>, <a href="../mode/tcl/index.html">Tcl</a>, <a href="../mode/livescript/index.html">LiveScript</a>,
-    and <a href="../mode/mirc/index.html">mIRC</a>.</li>
-    <li>New addons: <a href="../demo/placeholder.html"><code>placeholder</code></a>, <a href="../demo/html5complete.html">HTML completion</a>.</li>
-    <li>New
-    methods: <a href="manual.html#hasFocus"><code>hasFocus</code></a>, <a href="manual.html#defaultCharWidth"><code>defaultCharWidth</code></a>.</li>
-    <li>New events: <a href="manual.html#event_beforeCursorEnter"><code>beforeCursorEnter</code></a>, <a href="manual.html#event_renderLine"><code>renderLine</code></a>.</li>
-    <li>Many improvements to the <a href="manual.html#addon_show-hint"><code>show-hint</code></a> completion
-    dialog addon.</li>
-    <li>Tweak behavior of by-word cursor motion.</li>
-    <li>Further improvements to the <a href="../demo/vim.html">vim mode</a>.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.1...v3.11">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">21-02-2013: <a href="http://codemirror.net/codemirror-3.1.zip">Version 3.1</a>:</p>
-
-  <ul class="rel-note">
-    <li><strong>Incompatible:</strong> key handlers may
-    now <em>return</em>, rather
-    than <em>throw</em> <code>CodeMirror.Pass</code> to signal they
-    didn't handle the key.</li>
-    <li>Make documents a <a href="manual.html#api_doc">first-class
-    construct</a>, support split views and subviews.</li>
-    <li>Add a <a href="manual.html#addon_show-hint">new module</a>
-    for showing completion hints.
-    Deprecate <code>simple-hint.js</code>.</li>
-    <li>Extend <a href="../mode/htmlmixed/index.html">htmlmixed mode</a>
-    to allow custom handling of script types.</li>
-    <li>Support an <code>insertLeft</code> option
-    to <a href="manual.html#setBookmark"><code>setBookmark</code></a>.</li>
-    <li>Add an <a href="manual.html#eachLine"><code>eachLine</code></a>
-    method to iterate over a document.</li>
-    <li>New addon modules: <a href="../demo/markselection.html">selection
-    marking</a>, <a href="../demo/lint.html">linting</a>,
-    and <a href="../demo/closebrackets.html">automatic bracket
-    closing</a>.</li>
-    <li>Add <a href="manual.html#event_beforeChange"><code>"beforeChange"</code></a>
-    and <a href="manual.html#event_beforeSelectionChange"><code>"beforeSelectionChange"</code></a>
-    events.</li>
-    <li>Add <a href="manual.html#event_hide"><code>"hide"</code></a>
-    and <a href="manual.html#event_unhide"><code>"unhide"</code></a>
-    events to marked ranges.</li>
-    <li>Fix <a href="manual.html#coordsChar"><code>coordsChar</code></a>'s
-    interpretation of its argument to match the documentation.</li>
-    <li>New modes: <a href="../mode/turtle/index.html">Turtle</a>
-    and <a href="../mode/q/index.html">Q</a>.</li>
-    <li>Further improvements to the <a href="../demo/vim.html">vim mode</a>.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.01...v3.1">list of patches</a>.</li>
-  </ul>
-
-
-  <p class="rel">25-01-2013: <a href="http://codemirror.net/codemirror-3.02.zip">Version 3.02</a>:</p>
-
-  <p class="rel-note">Single-bugfix release. Fixes a problem that
-  prevents CodeMirror instances from being garbage-collected after
-  they become unused.</p>
-
-  <p class="rel">21-01-2013: <a href="http://codemirror.net/codemirror-3.01.zip">Version 3.01</a>:</p>
-
-  <ul class="rel-note">
-    <li>Move all add-ons into an organized directory structure
-    under <a href="../addon/"><code>/addon</code></a>. <strong>You might have to adjust your
-    paths.</strong></li>
-    <li>New
-    modes: <a href="../mode/d/index.html">D</a>, <a href="../mode/sass/index.html">Sass</a>, <a href="../mode/apl/index.html">APL</a>, <a href="../mode/sql/index.html">SQL</a>
-    (configurable), and <a href="../mode/asterisk/index.html">Asterisk</a>.</li>
-    <li>Several bugfixes in right-to-left text support.</li>
-    <li>Add <a href="manual.html#option_rtlMoveVisually"><code>rtlMoveVisually</code></a> option.</li>
-    <li>Improvements to vim keymap.</li>
-    <li>Add built-in (lightweight) <a href="manual.html#addOverlay">overlay mode</a> support.</li>
-    <li>Support <code>showIfHidden</code> option for <a href="manual.html#addLineWidget">line widgets</a>.</li>
-    <li>Add simple <a href="manual.html#addon_python-hint">Python hinter</a>.</li>
-    <li>Bring back the <a href="manual.html#option_fixedGutter"><code>fixedGutter</code></a> option.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.0...v3.01">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">10-12-2012: <a href="http://codemirror.net/codemirror-3.0.zip">Version 3.0</a>:</p>
-
-  <p class="rel-note"><strong>New major version</strong>. Only
-  partially backwards-compatible. See
-  the <a href="upgrade_v3.html">upgrading guide</a> for more
-  information. Changes since release candidate 2:</p>
-
-  <ul class="rel-note">
-    <li>Rewritten VIM mode.</li>
-    <li>Fix a few minor scrolling and sizing issues.</li>
-    <li>Work around Safari segfault when dragging.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.0rc2...v3.0">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-3.0rc2.zip">Version 3.0, release candidate 2</a>:</p>
-
-  <ul class="rel-note">
-    <li>New mode: <a href="../mode/http/index.html">HTTP</a>.</li>
-    <li>Improved handling of selection anchor position.</li>
-    <li>Improve IE performance on longer lines.</li>
-    <li>Reduce gutter glitches during horiz. scrolling.</li>
-    <li>Add <a href="manual.html#addKeyMap"><code>addKeyMap</code></a> and <a href="manual.html#removeKeyMap"><code>removeKeyMap</code></a> methods.</li>
-    <li>Rewrite <code>formatting</code> and <code>closetag</code> add-ons.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.0rc1...v3.0rc2">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-3.0rc1.zip">Version 3.0, release candidate 1</a>:</p>
-
-  <ul class="rel-note">
-    <li>New theme: <a href="../demo/theme.html#solarized%20light">Solarized</a>.</li>
-    <li>Introduce <a href="manual.html#addLineClass"><code>addLineClass</code></a>
-    and <a href="manual.html#removeLineClass"><code>removeLineClass</code></a>,
-    drop <code>setLineClass</code>.</li>
-    <li>Add a <em>lot</em> of
-    new <a href="manual.html#markText">options for marked text</a>
-    (read-only, atomic, collapsed, widget replacement).</li>
-    <li>Remove the old code folding interface in favour of these new ranges.</li>
-    <li>Add <a href="manual.html#isClean"><code>isClean</code></a>/<a href="manual.html#markClean"><code>markClean</code></a> methods.</li>
-    <li>Remove <code>compoundChange</code> method, use better undo-event-combining heuristic.</li>
-    <li>Improve scrolling performance smoothness.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.0beta2...v3.0rc1">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">22-10-2012: <a href="http://codemirror.net/codemirror-3.0beta2.zip">Version 3.0, beta 2</a>:</p>
-
-  <ul class="rel-note">
-    <li>Fix page-based coordinate computation.</li>
-    <li>Fix firing of <a href="manual.html#event_gutterClick"><code>gutterClick</code></a> event.</li>
-    <li>Add <a href="manual.html#option_cursorHeight"><code>cursorHeight</code></a> option.</li>
-    <li>Fix bi-directional text regression.</li>
-    <li>Add <a href="manual.html#option_viewportMargin"><code>viewportMargin</code></a> option.</li>
-    <li>Directly handle mousewheel events (again, hopefully better).</li>
-    <li>Make vertical cursor movement more robust (through widgets, big line gaps).</li>
-    <li>Add <a href="manual.html#option_flattenSpans"><code>flattenSpans</code></a> option.</li>
-    <li>Many optimizations. Poor responsiveness should be fixed.</li>
-    <li>Initialization in hidden state works again.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v3.0beta1...v3.0beta2">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">19-09-2012: <a href="http://codemirror.net/codemirror-3.0beta1.zip">Version 3.0, beta 1</a>:</p>
-
-  <ul class="rel-note">
-    <li>Bi-directional text support.</li>
-    <li>More powerful gutter model.</li>
-    <li>Support for arbitrary text/widget height.</li>
-    <li>In-line widgets.</li>
-    <li>Generalized event handling.</li>
-  </ul>
-
-</section>
-
-<section id=v2>
-
-  <h2>Version 2.x</h2>
-
-  <p class="rel">21-01-2013: <a href="http://codemirror.net/codemirror-2.38.zip">Version 2.38</a>:</p>
-
-  <p class="rel-note">Integrate some bugfixes, enhancements to the vim keymap, and new
-  modes
-  (<a href="../mode/d/index.html">D</a>, <a href="../mode/sass/index.html">Sass</a>, <a href="../mode/apl/index.html">APL</a>)
-  from the v3 branch.</p>
-
-  <p class="rel">20-12-2012: <a href="http://codemirror.net/codemirror-2.37.zip">Version 2.37</a>:</p>
-
-  <ul class="rel-note">
-    <li>New mode: <a href="../mode/sql/index.html">SQL</a> (will replace <a href="../mode/plsql/index.html">plsql</a> and <a href="../mode/mysql/index.html">mysql</a> modes).</li>
-    <li>Further work on the new VIM mode.</li>
-    <li>Fix Cmd/Ctrl keys on recent Operas on OS X.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v2.36...v2.37">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">20-11-2012: <a href="http://codemirror.net/codemirror-2.36.zip">Version 2.36</a>:</p>
-
-  <ul class="rel-note">
-    <li>New mode: <a href="../mode/z80/index.html">Z80 assembly</a>.</li>
-    <li>New theme: <a href="../demo/theme.html#twilight">Twilight</a>.</li>
-    <li>Add command-line compression helper.</li>
-    <li>Make <a href="manual.html#scrollIntoView"><code>scrollIntoView</code></a> public.</li>
-    <li>Add <a href="manual.html#defaultTextHeight"><code>defaultTextHeight</code></a> method.</li>
-    <li>Various extensions to the vim keymap.</li>
-    <li>Make <a href="../mode/php/index.html">PHP mode</a> build on <a href="../mode/htmlmixed/index.html">mixed HTML mode</a>.</li>
-    <li>Add <a href="manual.html#addon_continuecomment">comment-continuing</a> add-on.</li>
-    <li>Full <a href="../https://github.com/codemirror/CodeMirror/compare/v2.35...v2.36">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">22-10-2012: <a href="http://codemirror.net/codemirror-2.35.zip">Version 2.35</a>:</p>
-
-  <ul class="rel-note">
-    <li>New (sub) mode: <a href="../mode/javascript/typescript.html">TypeScript</a>.</li>
-    <li>Don't overwrite (insert key) when pasting.</li>
-    <li>Fix several bugs in <a href="manual.html#markText"><code>markText</code></a>/undo interaction.</li>
-    <li>Better indentation of JavaScript code without semicolons.</li>
-    <li>Add <a href="manual.html#defineInitHook"><code>defineInitHook</code></a> function.</li>
-    <li>Full <a href="https://github.com/codemirror/CodeMirror/compare/v2.34...v2.35">list of patches</a>.</li>
-  </ul>
-
-  <p class="rel">19-09-2012: <a href="http://codemirror.net/codemirror-2.34.zip">Version 2.34</a>:</p>
-
-  <ul class="rel-note">
-    <li>New mode: <a href="../mode/commonlisp/index.html">Common Lisp</a>.</li>
-    <li>Fix right-click select-all on most browsers.</li>
-    <li>Change the way highlighting happens:<br>&nbsp; Saves memory and CPU cycles.<br>&nbsp; <code>compareStates</code> is no longer needed.<br>&nbsp; <code>onHighlightComplete</code> no longer works.</li>
-    <li>Integrate mode (Markdown, XQuery, CSS, sTex) tests in central testsuite.</li>
-    <li>Add a <a href="manual.html#version"><code>CodeMirror.version</code></a> property.</li>
-    <li>More robust handling of nested modes in <a href="../demo/formatting.html">formatting</a> and <a href="../demo/closetag.html">closetag</a> plug-ins.</li>
-    <li>Un/redo now preserves <a href="manual.html#markText">marked text</a> and bookmarks.</li>
-    <li><a href="https://github.com/codemirror/CodeMirror/compare/v2.33...v2.34">Full list</a> of patches.</li>
-  </ul>
-
-  <p class="rel">23-08-2012: <a href="http://codemirror.net/codemirror-2.33.zip">Version 2.33</a>:</p>
-
-  <ul class="rel-note">
-    <li>New mode: <a href="../mode/sieve/index.html">Sieve</a>.</li>
-    <li>New <a href="manual.html#getViewport"><code>getViewPort</code></a> and <a href="manual.html#option_onViewportChange"><code>onViewportChange</code></a> API.</li>
-    <li><a href="manual.html#option_cursorBlinkRate">Configurable</a> cursor blink rate.</li>
-    <li>Make binding a key to <code>false</code> disabling handling (again).</li>
-    <li>Show non-printing characters as red dots.</li>
-    <li>More tweaks to the scrolling model.</li>
-    <li>Expanded testsuite. Basic linter added.</li>
-    <li>Remove most uses of <code>innerHTML</code>. Remove <code>CodeMirror.htmlEscape</code>.</li>
-    <li><a href="https://github.com/codemirror/CodeMirror/compare/v2.32...v2.33">Full list</a> of patches.</li>
-  </ul>
-
-  <p class="rel">23-07-2012: <a href="http://codemirror.net/codemirror-2.32.zip">Version 2.32</a>:</p>
-
-  <p class="rel-note">Emergency fix for a bug where an editor with
-  line wrapping on IE will break when there is <em>no</em>
-  scrollbar.</p>
-
-  <p class="rel">20-07-2012: <a href="http://codemirror.net/codemirror-2.31.zip">Version 2.31</a>:</p>
-
-  <ul class="rel-note">
-    <li>New modes: <a href="../mode/ocaml/index.html">OCaml</a>, <a href="../mode/haxe/index.html">Haxe</a>, and <a href="../mode/vb/index.html">VB.NET</a>.</li>
-    <li>Several fixes to the new scrolling model.</li>
-    <li>Add a <a href="manual.html#setSize"><code>setSize</code></a> method for programmatic resizing.</li>
-    <li>Add <a href="manual.html#getHistory"><code>getHistory</code></a> and <a href="manual.html#setHistory"><code>setHistory</code></a> methods.</li>
-    <li>Allow custom line separator string in <a href="manual.html#getValue"><code>getValue</code></a> and <a href="manual.html#getRange"><code>getRange</code></a>.</li>
-    <li>Support double- and triple-click drag, double-clicking whitespace.</li>
-    <li>And more... <a href="https://github.com/codemirror/CodeMirror/compare/v2.3...v2.31">(all patches)</a></li>
-  </ul>
-
-  <p class="rel">22-06-2012: <a href="http://codemirror.net/codemirror-2.3.zip">Version 2.3</a>:</p>
-
-  <ul class="rel-note">
-    <li><strong>New scrollbar implementation</strong>. Should flicker less. Changes DOM structure of the editor.</li>
-    <li>New theme: <a href="../demo/theme.html#vibrant-ink">vibrant-ink</a>.</li>
-    <li>Many extensions to the VIM keymap (including text objects).</li>
-    <li>Add <a href="../demo/multiplex.html">mode-multiplexing</a> utility script.</li>
-    <li>Fix bug where right-click paste works in read-only mode.</li>
-    <li>Add a <a href="manual.html#getScrollInfo"><code>getScrollInfo</code></a> method.</li>
-    <li>Lots of other <a href="https://github.com/codemirror/CodeMirror/compare/v2.25...v2.3">fixes</a>.</li>
-  </ul>
-
-  <p class="rel">23-05-2012: <a href="http://codemirror.net/codemirror-2.25.zip">Version 2.25</a>:</p>
-
-  <ul class="rel-note">
-    <li>New mode: <a href="../mode/erlang/index.html">Erlang</a>.</li>
-    <li><strong>Remove xmlpure mode</strong> (use <a href="../mode/xml/index.html">xml.js</a>).</li>
-    <li>Fix line-wrapping in Opera.</li>
-    <li>Fix X Windows middle-click paste in Chrome.</li>
-    <li>Fix bug that broke pasting of huge documents.</li>
-    <li>Fix backspace and tab key repeat in Opera.</li>
-  </ul>
-
-  <p class="rel">23-04-2012: <a href="http://codemirror.net/codemirror-2.24.zip">Version 2.24</a>:</p>
-
-  <ul class="rel-note">
-    <li><strong>Drop support for Internet Explorer 6</strong>.</li>
-    <li>New
-    modes: <a href="../mode/shell/index.html">Shell</a>, <a href="../mode/tiki/index.html">Tiki
-    wiki</a>, <a href="../mode/pig/index.html">Pig Latin</a>.</li>
-    <li>New themes: <a href="../demo/theme.html#ambiance">Ambiance</a>, <a href="../demo/theme.html#blackboard">Blackboard</a>.</li>
-    <li>More control over drag/drop
-    with <a href="manual.html#option_dragDrop"><code>dragDrop</code></a>
-    and <a href="manual.html#option_onDragEvent"><code>onDragEvent</code></a>
-    options.</li>
-    <li>Make HTML mode a bit less pedantic.</li>
-    <li>Add <a href="manual.html#compoundChange"><code>compoundChange</code></a> API method.</li>
-    <li>Several fixes in undo history and line hiding.</li>
-    <li>Remove (broken) support for <code>catchall</code> in key maps,
-    add <code>nofallthrough</code> boolean field instead.</li>
-  </ul>
-
-  <p class="rel">26-03-2012: <a href="http://codemirror.net/codemirror-2.23.zip">Version 2.23</a>:</p>
-
-  <ul class="rel-note">
-    <li>Change <strong>default binding for tab</strong> <a href="javascript:void(document.getElementById('tabbinding').style.display='')">[more]</a>
-      <div style="display: none" id=tabbinding>
-        Starting in 2.23, these bindings are default:
-        <ul><li>Tab: Insert tab character</li>
-          <li>Shift-tab: Reset line indentation to default</li>
-          <li>Ctrl/Cmd-[: Reduce line indentation (old tab behaviour)</li>
-          <li>Ctrl/Cmd-]: Increase line indentation (old shift-tab behaviour)</li>
-        </ul>
-      </div>
-    </li>
-    <li>New modes: <a href="../mode/xquery/index.html">XQuery</a> and <a href="../mode/vbscript/index.html">VBScript</a>.</li>
-    <li>Two new themes: <a href="../mode/less/index.html">lesser-dark</a> and <a href="../mode/xquery/index.html">xq-dark</a>.</li>
-    <li>Differentiate between background and text styles in <a href="manual.html#setLineClass"><code>setLineClass</code></a>.</li>
-    <li>Fix drag-and-drop in IE9+.</li>
-    <li>Extend <a href="manual.html#charCoords"><code>charCoords</code></a>
-    and <a href="manual.html#cursorCoords"><code>cursorCoords</code></a> with a <code>mode</code> argument.</li>
-    <li>Add <a href="manual.html#option_autofocus"><code>autofocus</code></a> option.</li>
-    <li>Add <a href="manual.html#findMarksAt"><code>findMarksAt</code></a> method.</li>
-  </ul>
-
-  <p class="rel">27-02-2012: <a href="http://codemirror.net/codemirror-2.22.zip">Version 2.22</a>:</p>
-
-  <ul class="rel-note">
-    <li>Allow <a href="manual.html#keymaps">key handlers</a> to pass up events, allow binding characters.</li>
-    <li>Add <a href="manual.html#option_autoClearEmptyLines"><code>autoClearEmptyLines</code></a> option.</li>
-    <li>Properly use tab stops when rendering tabs.</li>
-    <li>Make PHP mode more robust.</li>
-    <li>Support indentation blocks in <a href="manual.html#addon_foldcode">code folder</a>.</li>
-    <li>Add a script for <a href="manual.html#addon_match-highlighter">highlighting instances of the selection</a>.</li>
-    <li>New <a href="../mode/properties/index.html">.properties</a> mode.</li>
-    <li>Fix many bugs.</li>
-  </ul>
-
-  <p class="rel">27-01-2012: <a href="http://codemirror.net/codemirror-2.21.zip">Version 2.21</a>:</p>
-
-  <ul class="rel-note">
-    <li>Added <a href="../mode/less/index.html">LESS</a>, <a href="../mode/mysql/index.html">MySQL</a>,
-    <a href="../mode/go/index.html">Go</a>, and <a href="../mode/verilog/index.html">Verilog</a> modes.</li>
-    <li>Add <a href="manual.html#option_smartIndent"><code>smartIndent</code></a>
-    option.</li>
-    <li>Support a cursor in <a href="manual.html#option_readOnly"><code>readOnly</code></a>-mode.</li>
-    <li>Support assigning multiple styles to a token.</li>
-    <li>Use a new approach to drawing the selection.</li>
-    <li>Add <a href="manual.html#scrollTo"><code>scrollTo</code></a> method.</li>
-    <li>Allow undo/redo events to span non-adjacent lines.</li>
-    <li>Lots and lots of bugfixes.</li>
-  </ul>
-
-  <p class="rel">20-12-2011: <a href="http://codemirror.net/codemirror-2.2.zip">Version 2.2</a>:</p>
-
-  <ul class="rel-note">
-    <li>Slightly incompatible API changes. Read <a href="upgrade_v2.2.html">this</a>.</li>
-    <li>New approach
-    to <a href="manual.html#option_extraKeys">binding</a> keys,
-    support for <a href="manual.html#option_keyMap">custom
-    bindings</a>.</li>
-    <li>Support for overwrite (insert).</li>
-    <li><a href="manual.html#option_tabSize">Custom-width</a>
-    and <a href="../demo/visibletabs.html">stylable</a> tabs.</li>
-    <li>Moved more code into <a href="manual.html#addons">add-on scripts</a>.</li>
-    <li>Support for sane vertical cursor movement in wrapped lines.</li>
-    <li>More reliable handling of
-    editing <a href="manual.html#markText">marked text</a>.</li>
-    <li>Add minimal <a href="../demo/emacs.html">emacs</a>
-    and <a href="../demo/vim.html">vim</a> bindings.</li>
-    <li>Rename <code>coordsFromIndex</code>
-    to <a href="manual.html#posFromIndex"><code>posFromIndex</code></a>,
-    add <a href="manual.html#indexFromPos"><code>indexFromPos</code></a>
-    method.</li>
-  </ul>
-
-  <p class="rel">21-11-2011: <a href="http://codemirror.net/codemirror-2.18.zip">Version 2.18</a>:</p>
-  <p class="rel-note">Fixes <code>TextMarker.clear</code>, which is broken in 2.17.</p>
-
-  <p class="rel">21-11-2011: <a href="http://codemirror.net/codemirror-2.17.zip">Version 2.17</a>:</p>
-  <ul class="rel-note">
-    <li>Add support for <a href="manual.html#option_lineWrapping">line
-    wrapping</a> and <a href="manual.html#hideLine">code
-    folding</a>.</li>
-    <li>Add <a href="../mode/gfm/index.html">Github-style Markdown</a> mode.</li>
-    <li>Add <a href="../theme/monokai.css">Monokai</a>
-    and <a href="../theme/rubyblue.css">Rubyblue</a> themes.</li>
-    <li>Add <a href="manual.html#setBookmark"><code>setBookmark</code></a> method.</li>
-    <li>Move some of the demo code into reusable components
-    under <a href="../addon/"><code>lib/util</code></a>.</li>
-    <li>Make screen-coord-finding code faster and more reliable.</li>
-    <li>Fix drag-and-drop in Firefox.</li>
-    <li>Improve support for IME.</li>
-    <li>Speed up content rendering.</li>
-    <li>Fix browser's built-in search in Webkit.</li>
-    <li>Make double- and triple-click work in IE.</li>
-    <li>Various fixes to modes.</li>
-  </ul>
-
-  <p class="rel">27-10-2011: <a href="http://codemirror.net/codemirror-2.16.zip">Version 2.16</a>:</p>
-  <ul class="rel-note">
-    <li>Add <a href="../mode/perl/index.html">Perl</a>, <a href="../mode/rust/index.html">Rust</a>, <a href="../mode/tiddlywiki/index.html">TiddlyWiki</a>, and <a href="../mode/groovy/index.html">Groovy</a> modes.</li>
-    <li>Dragging text inside the editor now moves, rather than copies.</li>
-    <li>Add a <a href="manual.html#coordsFromIndex"><code>coordsFromIndex</code></a> method.</li>
-    <li><strong>API change</strong>: <code>setValue</code> now no longer clears history. Use <a href="manual.html#clearHistory"><code>clearHistory</code></a> for that.</li>
-    <li><strong>API change</strong>: <a href="manual.html#markText"><code>markText</code></a> now
-    returns an object with <code>clear</code> and <code>find</code>
-    methods. Marked text is now more robust when edited.</li>
-    <li>Fix editing code with tabs in Internet Explorer.</li>
-  </ul>
-
-  <p class="rel">26-09-2011: <a href="http://codemirror.net/codemirror-2.15.zip">Version 2.15</a>:</p>
-  <p class="rel-note">Fix bug that snuck into 2.14: Clicking the
-  character that currently has the cursor didn't re-focus the
-  editor.</p>
-
-  <p class="rel">26-09-2011: <a href="http://codemirror.net/codemirror-2.14.zip">Version 2.14</a>:</p>
-  <ul class="rel-note">
-    <li>Add <a href="../mode/clojure/index.html">Clojure</a>, <a href="../mode/pascal/index.html">Pascal</a>, <a href="../mode/ntriples/index.html">NTriples</a>, <a href="../mode/jinja2/index.html">Jinja2</a>, and <a href="../mode/markdown/index.html">Markdown</a> modes.</li>
-    <li>Add <a href="../theme/cobalt.css">Cobalt</a> and <a href="../theme/eclipse.css">Eclipse</a> themes.</li>
-    <li>Add a <a href="manual.html#option_fixedGutter"><code>fixedGutter</code></a> option.</li>
-    <li>Fix bug with <code>setValue</code> breaking cursor movement.</li>
-    <li>Make gutter updates much more efficient.</li>
-    <li>Allow dragging of text out of the editor (on modern browsers).</li>
-  </ul>
-
-
-  <p class="rel">23-08-2011: <a href="http://codemirror.net/codemirror-2.13.zip">Version 2.13</a>:</p>
-  <ul class="rel-note">
-    <li>Add <a href="../mode/ruby/index.html">Ruby</a>, <a href="../mode/r/index.html">R</a>, <a href="../mode/coffeescript/index.html">CoffeeScript</a>, and <a href="../mode/velocity/index.html">Velocity</a> modes.</li>
-    <li>Add <a href="manual.html#getGutterElement"><code>getGutterElement</code></a> to API.</li>
-    <li>Several fixes to scrolling and positioning.</li>
-    <li>Add <a href="manual.html#option_smartHome"><code>smartHome</code></a> option.</li>
-    <li>Add an experimental <a href="../mode/xmlpure/index.html">pure XML</a> mode.</li>
-  </ul>
-
-  <p class="rel">25-07-2011: <a href="http://codemirror.net/codemirror-2.12.zip">Version 2.12</a>:</p>
-  <ul class="rel-note">
-    <li>Add a <a href="../mode/sparql/index.html">SPARQL</a> mode.</li>
-    <li>Fix bug with cursor jumping around in an unfocused editor in IE.</li>
-    <li>Allow key and mouse events to bubble out of the editor. Ignore widget clicks.</li>
-    <li>Solve cursor flakiness after undo/redo.</li>
-    <li>Fix block-reindent ignoring the last few lines.</li>
-    <li>Fix parsing of multi-line attrs in XML mode.</li>
-    <li>Use <code>innerHTML</code> for HTML-escaping.</li>
-    <li>Some fixes to indentation in C-like mode.</li>
-    <li>Shrink horiz scrollbars when long lines removed.</li>
-    <li>Fix width feedback loop bug that caused the width of an inner DIV to shrink.</li>
-  </ul>
-
-  <p class="rel">04-07-2011: <a href="http://codemirror.net/codemirror-2.11.zip">Version 2.11</a>:</p>
-  <ul class="rel-note">
-    <li>Add a <a href="../mode/scheme/index.html">Scheme mode</a>.</li>
-    <li>Add a <code>replace</code> method to search cursors, for cursor-preserving replacements.</li>
-    <li>Make the <a href="../mode/clike/index.html">C-like mode</a> mode more customizable.</li>
-    <li>Update XML mode to spot mismatched tags.</li>
-    <li>Add <code>getStateAfter</code> API and <code>compareState</code> mode API methods for finer-grained mode magic.</li>
-    <li>Add a <code>getScrollerElement</code> API method to manipulate the scrolling DIV.</li>
-    <li>Fix drag-and-drop for Firefox.</li>
-    <li>Add a C# configuration for the <a href="../mode/clike/index.html">C-like mode</a>.</li>
-    <li>Add <a href="../demo/fullscreen.html">full-screen editing</a> and <a href="../demo/changemode.html">mode-changing</a> demos.</li>
-  </ul>
-
-  <p class="rel">07-06-2011: <a href="http://codemirror.net/codemirror-2.1.zip">Version 2.1</a>:</p>
-  <p class="rel-note">Add
-  a <a href="manual.html#option_theme">theme</a> system
-  (<a href="../demo/theme.html">demo</a>). Note that this is not
-  backwards-compatible鈥攜ou'll have to update your styles and
-  modes!</p>
-
-  <p class="rel">07-06-2011: <a href="http://codemirror.net/codemirror-2.02.zip">Version 2.02</a>:</p>
-  <ul class="rel-note">
-    <li>Add a <a href="../mode/lua/index.html">Lua mode</a>.</li>
-    <li>Fix reverse-searching for a regexp.</li>
-    <li>Empty lines can no longer break highlighting.</li>
-    <li>Rework scrolling model (the outer wrapper no longer does the scrolling).</li>
-    <li>Solve horizontal jittering on long lines.</li>
-    <li>Add <a href="../demo/runmode.html">runmode.js</a>.</li>
-    <li>Immediately re-highlight text when typing.</li>
-    <li>Fix problem with 'sticking' horizontal scrollbar.</li>
-  </ul>
-
-  <p class="rel">26-05-2011: <a href="http://codemirror.net/codemirror-2.01.zip">Version 2.01</a>:</p>
-  <ul class="rel-note">
-    <li>Add a <a href="../mode/smalltalk/index.html">Smalltalk mode</a>.</li>
-    <li>Add a <a href="../mode/rst/index.html">reStructuredText mode</a>.</li>
-    <li>Add a <a href="../mode/python/index.html">Python mode</a>.</li>
-    <li>Add a <a href="../mode/plsql/index.html">PL/SQL mode</a>.</li>
-    <li><code>coordsChar</code> now works</li>
-    <li>Fix a problem where <code>onCursorActivity</code> interfered with <code>onChange</code>.</li>
-    <li>Fix a number of scrolling and mouse-click-position glitches.</li>
-    <li>Pass information about the changed lines to <code>onChange</code>.</li>
-    <li>Support cmd-up/down on OS X.</li>
-    <li>Add triple-click line selection.</li>
-    <li>Don't handle shift when changing the selection through the API.</li>
-    <li>Support <code>"nocursor"</code> mode for <code>readOnly</code> option.</li>
-    <li>Add an <code>onHighlightComplete</code> option.</li>
-    <li>Fix the context menu for Firefox.</li>
-  </ul>
-
-  <p class="rel">28-03-2011: <a href="http://codemirror.net/codemirror-2.0.zip">Version 2.0</a>:</p>
-  <p class="rel-note">CodeMirror 2 is a complete rewrite that's
-  faster, smaller, simpler to use, and less dependent on browser
-  quirks. See <a href="internals.html">this</a>
-  and <a href="http://groups.google.com/group/codemirror/browse_thread/thread/5a8e894024a9f580">this</a>
-  for more information.</p>
-
-  <p class="rel">22-02-2011: <a href="https://github.com/codemirror/codemirror/tree/beta2">Version 2.0 beta 2</a>:</p>
-  <p class="rel-note">Somewhat more mature API, lots of bugs shaken out.</p>
-
-  <p class="rel">17-02-2011: <a href="http://codemirror.net/codemirror-0.94.zip">Version 0.94</a>:</p>
-  <ul class="rel-note">
-    <li><code>tabMode: "spaces"</code> was modified slightly (now indents when something is selected).</li>
-    <li>Fixes a bug that would cause the selection code to break on some IE versions.</li>
-    <li>Disabling spell-check on WebKit browsers now works.</li>
-  </ul>
-
-  <p class="rel">08-02-2011: <a href="http://codemirror.net/">Version 2.0 beta 1</a>:</p>
-  <p class="rel-note">CodeMirror 2 is a complete rewrite of
-  CodeMirror, no longer depending on an editable frame.</p>
-
-  <p class="rel">19-01-2011: <a href="http://codemirror.net/codemirror-0.93.zip">Version 0.93</a>:</p>
-  <ul class="rel-note">
-    <li>Added a <a href="contrib/regex/index.html">Regular Expression</a> parser.</li>
-    <li>Fixes to the PHP parser.</li>
-    <li>Support for regular expression in search/replace.</li>
-    <li>Add <code>save</code> method to instances created with <code>fromTextArea</code>.</li>
-    <li>Add support for MS T-SQL in the SQL parser.</li>
-    <li>Support use of CSS classes for highlighting brackets.</li>
-    <li>Fix yet another hang with line-numbering in hidden editors.</li>
-  </ul>
-</section>
-
-<section id=v1>
-
-  <h2>Version 0.x</h2>
-
-  <p class="rel">28-03-2011: <a href="http://codemirror.net/codemirror-1.0.zip">Version 1.0</a>:</p>
-  <ul class="rel-note">
-    <li>Fix error when debug history overflows.</li>
-    <li>Refine handling of C# verbatim strings.</li>
-    <li>Fix some issues with JavaScript indentation.</li>
-  </ul>
-
-  <p class="rel">17-12-2010: <a href="http://codemirror.net/codemirror-0.92.zip">Version 0.92</a>:</p>
-  <ul class="rel-note">
-    <li>Make CodeMirror work in XHTML documents.</li>
-    <li>Fix bug in handling of backslashes in Python strings.</li>
-    <li>The <code>styleNumbers</code> option is now officially
-    supported and documented.</li>
-    <li><code>onLineNumberClick</code> option added.</li>
-    <li>More consistent names <code>onLoad</code> and
-    <code>onCursorActivity</code> callbacks. Old names still work, but
-    are deprecated.</li>
-    <li>Add a <a href="contrib/freemarker/index.html">Freemarker</a> mode.</li>
-  </ul>
-
-  <p class="rel">11-11-2010: <a
-  href="http://codemirror.net/codemirror-0.91.zip">Version 0.91</a>:</p>
-  <ul class="rel-note">
-    <li>Adds support for <a href="contrib/java">Java</a>.</li>
-    <li>Small additions to the <a href="contrib/php">PHP</a> and <a href="contrib/sql">SQL</a> parsers.</li>
-    <li>Work around various <a href="https://bugs.webkit.org/show_bug.cgi?id=47806">Webkit</a> <a href="https://bugs.webkit.org/show_bug.cgi?id=23474">issues</a>.</li>
-    <li>Fix <code>toTextArea</code> to update the code in the textarea.</li>
-    <li>Add a <code>noScriptCaching</code> option (hack to ease development).</li>
-    <li>Make sub-modes of <a href="mixedtest.html">HTML mixed</a> mode configurable.</li>
-  </ul>
-
-  <p class="rel">02-10-2010: <a
-  href="http://codemirror.net/codemirror-0.9.zip">Version 0.9</a>:</p>
-  <ul class="rel-note">
-    <li>Add support for searching backwards.</li>
-    <li>There are now parsers for <a href="contrib/scheme/index.html">Scheme</a>, <a href="contrib/xquery/index.html">XQuery</a>, and <a href="contrib/ometa/index.html">OmetaJS</a>.</li>
-    <li>Makes <code>height: "dynamic"</code> more robust.</li>
-    <li>Fixes bug where paste did not work on OS X.</li>
-    <li>Add a <code>enterMode</code> and <code>electricChars</code> options to make indentation even more customizable.</li>
-    <li>Add <code>firstLineNumber</code> option.</li>
-    <li>Fix bad handling of <code>@media</code> rules by the CSS parser.</li>
-    <li>Take a new, more robust approach to working around the invisible-last-line bug in WebKit.</li>
-  </ul>
-
-  <p class="rel">22-07-2010: <a
-  href="http://codemirror.net/codemirror-0.8.zip">Version 0.8</a>:</p>
-  <ul class="rel-note">
-    <li>Add a <code>cursorCoords</code> method to find the screen
-    coordinates of the cursor.</li>
-    <li>A number of fixes and support for more syntax in the PHP parser.</li>
-    <li>Fix indentation problem with JSON-mode JS parser in Webkit.</li>
-    <li>Add a <a href="compress.html">minification</a> UI.</li>
-    <li>Support a <code>height: dynamic</code> mode, where the editor's
-    height will adjust to the size of its content.</li>
-    <li>Better support for IME input mode.</li>
-    <li>Fix JavaScript parser getting confused when seeing a no-argument
-    function call.</li>
-    <li>Have CSS parser see the difference between selectors and other
-    identifiers.</li>
-    <li>Fix scrolling bug when pasting in a horizontally-scrolled
-    editor.</li>
-    <li>Support <code>toTextArea</code> method in instances created with
-    <code>fromTextArea</code>.</li>
-    <li>Work around new Opera cursor bug that causes the cursor to jump
-    when pressing backspace at the end of a line.</li>
-  </ul>
-
-  <p class="rel">27-04-2010: <a
-  href="http://codemirror.net/codemirror-0.67.zip">Version
-  0.67</a>:</p>
-  <p class="rel-note">More consistent page-up/page-down behaviour
-  across browsers. Fix some issues with hidden editors looping forever
-  when line-numbers were enabled. Make PHP parser parse
-  <code>"\\"</code> correctly. Have <code>jumpToLine</code> work on
-  line handles, and add <code>cursorLine</code> function to fetch the
-  line handle where the cursor currently is. Add new
-  <code>setStylesheet</code> function to switch style-sheets in a
-  running editor.</p>
-
-  <p class="rel">01-03-2010: <a
-  href="http://codemirror.net/codemirror-0.66.zip">Version
-  0.66</a>:</p>
-  <p class="rel-note">Adds <code>removeLine</code> method to API.
-  Introduces the <a href="contrib/plsql/index.html">PLSQL parser</a>.
-  Marks XML errors by adding (rather than replacing) a CSS class, so
-  that they can be disabled by modifying their style. Fixes several
-  selection bugs, and a number of small glitches.</p>
-
-  <p class="rel">12-11-2009: <a
-  href="http://codemirror.net/codemirror-0.65.zip">Version
-  0.65</a>:</p>
-  <p class="rel-note">Add support for having both line-wrapping and
-  line-numbers turned on, make paren-highlighting style customisable
-  (<code>markParen</code> and <code>unmarkParen</code> config
-  options), work around a selection bug that Opera
-  <em>re</em>introduced in version 10.</p>
-
-  <p class="rel">23-10-2009: <a
-  href="http://codemirror.net/codemirror-0.64.zip">Version
-  0.64</a>:</p>
-  <p class="rel-note">Solves some issues introduced by the
-  paste-handling changes from the previous release. Adds
-  <code>setSpellcheck</code>, <code>setTextWrapping</code>,
-  <code>setIndentUnit</code>, <code>setUndoDepth</code>,
-  <code>setTabMode</code>, and <code>setLineNumbers</code> to
-  customise a running editor. Introduces an <a
-  href="contrib/sql/index.html">SQL</a> parser. Fixes a few small
-  problems in the <a href="contrib/python/index.html">Python</a>
-  parser. And, as usual, add workarounds for various newly discovered
-  browser incompatibilities.</p>
-
-  <p class="rel">31-08-2009: <a href="http://codemirror.net/codemirror-0.63.zip">Version 0.63</a>:</p>
-  <p class="rel-note"> Overhaul of paste-handling (less fragile), fixes for several
-  serious IE8 issues (cursor jumping, end-of-document bugs) and a number
-  of small problems.</p>
-
-  <p class="rel">30-05-2009: <a href="http://codemirror.net/codemirror-0.62.zip">Version 0.62</a>:</p>
-  <p class="rel-note">Introduces <a href="contrib/python/index.html">Python</a>
-  and <a href="contrib/lua/index.html">Lua</a> parsers. Add
-  <code>setParser</code> (on-the-fly mode changing) and
-  <code>clearHistory</code> methods. Make parsing passes time-based
-  instead of lines-based (see the <code>passTime</code> option).</p>
-
-</section>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/releases.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/releases.html.xml
deleted file mode 100644
index 24e973b12254ee4928359c809d7fb45625e25159..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/releases.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>releases.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/reporting.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/reporting.html.html
deleted file mode 100644
index 3c582d96185485547c47be8d6c035eb561e4eaf9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/reporting.html.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Reporting Bugs</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="docs.css">
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Reporting bugs</a>
-  </ul>
-</div>
-
-<article>
-
-<h2>Reporting bugs effectively</h2>
-
-<div class="left">
-
-<p>So you found a problem in CodeMirror. By all means, report it! Bug
-reports from users are the main drive behind improvements to
-CodeMirror. But first, please read over these points:</p>
-
-<ol>
-  <li>CodeMirror is maintained by volunteers. They don't owe you
-  anything, so be polite. Reports with an indignant or belligerent
-  tone tend to be moved to the bottom of the pile.</li>
-
-  <li>Include information about <strong>the browser in which the
-  problem occurred</strong>. Even if you tested several browsers, and
-  the problem occurred in all of them, mention this fact in the bug
-  report. Also include browser version numbers and the operating
-  system that you're on.</li>
-
-  <li>Mention which release of CodeMirror you're using. Preferably,
-  try also with the current development snapshot, to ensure the
-  problem has not already been fixed.</li>
-
-  <li>Mention very precisely what went wrong. "X is broken" is not a
-  good bug report. What did you expect to happen? What happened
-  instead? Describe the exact steps a maintainer has to take to make
-  the problem occur. We can not fix something that we can not
-  observe.</li>
-
-  <li>If the problem can not be reproduced in any of the demos
-  included in the CodeMirror distribution, please provide an HTML
-  document that demonstrates the problem. The best way to do this is
-  to go to <a href="http://jsbin.com/ihunin/1/edit">jsbin.com</a>, enter
-  it there, press save, and include the resulting link in your bug
-  report.</li>
-</ol>
-
-</div>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/reporting.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/reporting.html.xml
deleted file mode 100644
index cae545a1f9cea10c475dc49482aac6123f051c50..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/reporting.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>reporting.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v2.2.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v2.2.html.html
deleted file mode 100644
index 3948ce6e561a1948a3e6b0955cef53ca32e9f1d7..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v2.2.html.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Version 2.2 upgrade guide</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="docs.css">
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">2.2 upgrade guide</a>
-  </ul>
-</div>
-
-<article>
-
-<h2>Upgrading to v2.2</h2>
-
-<p>There are a few things in the 2.2 release that require some care
-when upgrading.</p>
-
-<h3>No more default.css</h3>
-
-<p>The default theme is now included
-in <a href="../lib/codemirror.css"><code>codemirror.css</code></a>, so
-you do not have to included it separately anymore. (It was tiny, so
-even if you're not using it, the extra data overhead is negligible.)
-
-<h3>Different key customization</h3>
-
-<p>CodeMirror has moved to a system
-where <a href="manual.html#option_keyMap">keymaps</a> are used to
-bind behavior to keys. This means <a href="../demo/emacs.html">custom
-bindings</a> are now possible.</p>
-
-<p>Three options that influenced key
-behavior, <code>tabMode</code>, <code>enterMode</code>,
-and <code>smartHome</code>, are no longer supported. Instead, you can
-provide custom bindings to influence the way these keys act. This is
-done through the
-new <a href="manual.html#option_extraKeys"><code>extraKeys</code></a>
-option, which can hold an object mapping key names to functionality. A
-simple example would be:</p>
-
-<pre>  extraKeys: {
-    "Ctrl-S": function(instance) { saveText(instance.getValue()); },
-    "Ctrl-/": "undo"
-  }</pre>
-
-<p>Keys can be mapped either to functions, which will be given the
-editor instance as argument, or to strings, which are mapped through
-functions through the <code>CodeMirror.commands</code> table, which
-contains all the built-in editing commands, and can be inspected and
-extended by external code.</p>
-
-<p>By default, the <code>Home</code> key is bound to
-the <code>"goLineStartSmart"</code> command, which moves the cursor to
-the first non-whitespace character on the line. You can set do this to
-make it always go to the very start instead:</p>
-
-<pre>  extraKeys: {"Home": "goLineStart"}</pre>
-
-<p>Similarly, <code>Enter</code> is bound
-to <code>"newlineAndIndent"</code> by default. You can bind it to
-something else to get different behavior. To disable special handling
-completely and only get a newline character inserted, you can bind it
-to <code>false</code>:</p>
-
-<pre>  extraKeys: {"Enter": false}</pre>
-
-<p>The same works for <code>Tab</code>. If you don't want CodeMirror
-to handle it, bind it to <code>false</code>. The default behaviour is
-to indent the current line more (<code>"indentMore"</code> command),
-and indent it less when shift is held (<code>"indentLess"</code>).
-There are also <code>"indentAuto"</code> (smart indent)
-and <code>"insertTab"</code> commands provided for alternate
-behaviors. Or you can write your own handler function to do something
-different altogether.</p>
-
-<h3>Tabs</h3>
-
-<p>Handling of tabs changed completely. The display width of tabs can
-now be set with the <code>tabSize</code> option, and tabs can
-be <a href="../demo/visibletabs.html">styled</a> by setting CSS rules
-for the <code>cm-tab</code> class.</p>
-
-<p>The default width for tabs is now 4, as opposed to the 8 that is
-hard-wired into browsers. If you are relying on 8-space tabs, make
-sure you explicitly set <code>tabSize: 8</code> in your options.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v2.2.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v2.2.html.xml
deleted file mode 100644
index 880fee4e6640fe8f980b70f7b1338c15f3dabc11..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v2.2.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>upgrade_v2.2.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v3.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v3.html.html
deleted file mode 100644
index 5f94067aa0bfabf82013181dd3efbb0b71a3de94..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v3.html.html
+++ /dev/null
@@ -1,230 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Version 3 upgrade guide</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="docs.css">
-<script src="../lib/codemirror.js"></script>
-<link rel="stylesheet" href="../lib/codemirror.css">
-<script src="../addon/runmode/runmode.js"></script>
-<script src="../addon/runmode/colorize.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../mode/css/css.js"></script>
-<script src="../mode/htmlmixed/htmlmixed.js"></script>
-<script src="activebookmark.js"></script>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#upgrade">Upgrade guide</a>
-    <li><a href="#dom">DOM structure</a></li>
-    <li><a href="#gutters">Gutter model</a></li>
-    <li><a href="#events">Event handling</a></li>
-    <li><a href="#marktext">markText method arguments</a></li>
-    <li><a href="#folding">Line folding</a></li>
-    <li><a href="#lineclass">Line CSS classes</a></li>
-    <li><a href="#positions">Position properties</a></li>
-    <li><a href="#matchbrackets">Bracket matching</a></li>
-    <li><a href="#modes">Mode management</a></li>
-    <li><a href="#new">New features</a></li>
-  </ul>
-</div>
-
-<article>
-
-<h2 id=upgrade>Upgrading to version 3</h2>
-
-<p>Version 3 does not depart too much from 2.x API, and sites that use
-CodeMirror in a very simple way might be able to upgrade without
-trouble. But it does introduce a number of incompatibilities. Please
-at least skim this text before upgrading.</p>
-
-<p>Note that <strong>version 3 drops full support for Internet
-Explorer 7</strong>. The editor will mostly work on that browser, but
-it'll be significantly glitchy.</p>
-
-<section id=dom>
-  <h2>DOM structure</h2>
-
-<p>This one is the most likely to cause problems. The internal
-structure of the editor has changed quite a lot, mostly to implement a
-new scrolling model.</p>
-
-<p>Editor height is now set on the outer wrapper element (CSS
-class <code>CodeMirror</code>), not on the scroller element
-(<code>CodeMirror-scroll</code>).</p>
-
-<p>Other nodes were moved, dropped, and added. If you have any code
-that makes assumptions about the internal DOM structure of the editor,
-you'll have to re-test it and probably update it to work with v3.</p>
-
-<p>See the <a href="manual.html#styling">styling section</a> of the
-manual for more information.</p>
-</section>
-<section id=gutters>
-  <h2>Gutter model</h2>
-
-<p>In CodeMirror 2.x, there was a single gutter, and line markers
-created with <code>setMarker</code> would have to somehow coexist with
-the line numbers (if present). Version 3 allows you to specify an
-array of gutters, <a href="manual.html#option_gutters">by class
-name</a>,
-use <a href="manual.html#setGutterMarker"><code>setGutterMarker</code></a>
-to add or remove markers in individual gutters, and clear whole
-gutters
-with <a href="manual.html#clearGutter"><code>clearGutter</code></a>.
-Gutter markers are now specified as DOM nodes, rather than HTML
-snippets.</p>
-
-<p>The gutters no longer horizontally scrolls along with the content.
-The <code>fixedGutter</code> option was removed (since it is now the
-only behavior).</p>
-
-<pre data-lang="text/html">
-&lt;style>
-  /* Define a gutter style */
-  .note-gutter { width: 3em; background: cyan; }
-&lt;/style>
-&lt;script>
-  // Create an instance with two gutters -- line numbers and notes
-  var cm = new CodeMirror(document.body, {
-    gutters: ["note-gutter", "CodeMirror-linenumbers"],
-    lineNumbers: true
-  });
-  // Add a note to line 0
-  cm.setGutterMarker(0, "note-gutter", document.createTextNode("hi"));
-&lt;/script>
-</pre>
-</section>
-<section id=events>
-  <h2>Event handling</h2>
-
-<p>Most of the <code>onXYZ</code> options have been removed. The same
-effect is now obtained by calling
-the <a href="manual.html#on"><code>on</code></a> method with a string
-identifying the event type. Multiple handlers can now be registered
-(and individually unregistered) for an event, and objects such as line
-handlers now also expose events. See <a href="manual.html#events">the
-full list here</a>.</p>
-
-<p>(The <code>onKeyEvent</code> and <code>onDragEvent</code> options,
-which act more as hooks than as event handlers, are still there in
-their old form.)</p>
-
-<pre data-lang="javascript">
-cm.on("change", function(cm, change) {
-  console.log("something changed! (" + change.origin + ")");
-});
-</pre>
-</section>
-<section id=marktext>
-  <h2>markText method arguments</h2>
-
-<p>The <a href="manual.html#markText"><code>markText</code></a> method
-(which has gained some interesting new features, such as creating
-atomic and read-only spans, or replacing spans with widgets) no longer
-takes the CSS class name as a separate argument, but makes it an
-optional field in the options object instead.</p>
-
-<pre data-lang="javascript">
-// Style first ten lines, and forbid the cursor from entering them
-cm.markText({line: 0, ch: 0}, {line: 10, ch: 0}, {
-  className: "magic-text",
-  inclusiveLeft: true,
-  atomic: true
-});
-</pre>
-</section>
-<section id=folding>
-  <h2>Line folding</h2>
-
-<p>The interface for hiding lines has been
-removed. <a href="manual.html#markText"><code>markText</code></a> can
-now be used to do the same in a more flexible and powerful way.</p>
-
-<p>The <a href="../demo/folding.html">folding script</a> has been
-updated to use the new interface, and should now be more robust.</p>
-
-<pre data-lang="javascript">
-// Fold a range, replacing it with the text "??"
-var range = cm.markText({line: 4, ch: 2}, {line: 8, ch: 1}, {
-  replacedWith: document.createTextNode("??"),
-  // Auto-unfold when cursor moves into the range
-  clearOnEnter: true
-});
-// Get notified when auto-unfolding
-CodeMirror.on(range, "clear", function() {
-  console.log("boom");
-});
-</pre>
-</section>
-<section id=lineclass>
-  <h2>Line CSS classes</h2>
-
-<p>The <code>setLineClass</code> method has been replaced
-by <a href="manual.html#addLineClass"><code>addLineClass</code></a>
-and <a href="manual.html#removeLineClass"><code>removeLineClass</code></a>,
-which allow more modular control over the classes attached to a line.</p>
-
-<pre data-lang="javascript">
-var marked = cm.addLineClass(10, "background", "highlighted-line");
-setTimeout(function() {
-  cm.removeLineClass(marked, "background", "highlighted-line");
-});
-</pre>
-</section>
-<section id=positions>
-  <h2>Position properties</h2>
-
-<p>All methods that take or return objects that represent screen
-positions now use <code>{left, top, bottom, right}</code> properties
-(not always all of them) instead of the <code>{x, y, yBot}</code> used
-by some methods in v2.x.</p>
-
-<p>Affected methods
-are <a href="manual.html#cursorCoords"><code>cursorCoords</code></a>, <a href="manual.html#charCoords"><code>charCoords</code></a>, <a href="manual.html#coordsChar"><code>coordsChar</code></a>,
-and <a href="manual.html#getScrollInfo"><code>getScrollInfo</code></a>.</p>
-</section>
-<section id=matchbrackets>
-  <h2>Bracket matching no longer in core</h2>
-
-<p>The <a href="manual.html#addon_matchbrackets"><code>matchBrackets</code></a>
-option is no longer defined in the core editor.
-Load <code>addon/edit/matchbrackets.js</code> to enable it.</p>
-</section>
-<section id=modes>
-  <h2>Mode management</h2>
-
-<p>The <code>CodeMirror.listModes</code>
-and <code>CodeMirror.listMIMEs</code> functions, used for listing
-defined modes, are gone. You are now encouraged to simply
-inspect <code>CodeMirror.modes</code> (mapping mode names to mode
-constructors) and <code>CodeMirror.mimeModes</code> (mapping MIME
-strings to mode specs).</p>
-</section>
-<section id=new>
-  <h2>New features</h2>
-
-<p>Some more reasons to upgrade to version 3.</p>
-
-<ul>
-  <li>Bi-directional text support. CodeMirror will now mostly do the
-  right thing when editing Arabic or Hebrew text.</li>
-  <li>Arbitrary line heights. Using fonts with different heights
-  inside the editor (whether off by one pixel or fifty) is now
-  supported and handled gracefully.</li>
-  <li>In-line widgets. See <a href="../demo/widget.html">the demo</a>
-  and <a href="manual.html#addLineWidget">the docs</a>.</li>
-  <li>Defining custom options
-  with <a href="manual.html#defineOption"><code>CodeMirror.defineOption</code></a>.</li>
-</ul>
-</section>
-</article>
-
-<script>setTimeout(function(){CodeMirror.colorize();}, 20);</script>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v3.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v3.html.xml
deleted file mode 100644
index 6cea5a4a312da9877b6e1c95f1035e3558a66df9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v3.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>upgrade_v3.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v4.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v4.html.html
deleted file mode 100644
index 09df00ca1bdaa467b410cfe7dad74e73aa511ad8..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v4.html.html
+++ /dev/null
@@ -1,144 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Version 4 upgrade guide</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="docs.css">
-<script src="activebookmark.js"></script>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#upgrade">Upgrade guide</a>
-    <li><a href="#multisel">Multiple selections</a>
-    <li><a href="#beforeSelectionChange">The beforeSelectionChange event</a>
-    <li><a href="#replaceSelection">replaceSelection and collapsing</a>
-    <li><a href="#changeEvent">change event data</a>
-    <li><a href="#showIfHidden">showIfHidden option to line widgets</a>
-    <li><a href="#module">Module loaders</a>
-    <li><a href="#shareddata">Mutating shared data structures</a></li>
-    <li><a href="#deprecated">Deprecated interfaces dropped</a>
-  </ul>
-</div>
-
-<article>
-
-<h2 id=upgrade>Upgrading to version 4</h2>
-
-<p>CodeMirror 4's interface is <em>very</em> close version 3, but it
-does fix a few awkward details in a backwards-incompatible ways. At
-least skim the text below before upgrading.</p>
-
-<section id=multisel><h2>Multiple selections</h2>
-
-<p>The main new feature in version 4 is multiple selections. The
-single-selection variants of methods are still there, but now
-typically act only on the <em>primary</em> selection (usually the last
-one added).</p>
-
-<p>The exception to this
-is <a href="manual.html#getSelection"><strong><code>getSelection</code></strong></a>,
-which will now return the content of <em>all</em> selections
-(separated by newlines, or whatever <code>lineSep</code> parameter you passed
-it).</p>
-
-</section>
-
-<section id=beforeSelectionChange><h2>The beforeSelectionChange event</h2>
-
-<p>This event still exists, but the object it is passed has
-a <a href="manual.html#event_beforeSelectionChange">completely new
-interface</a>, because such changes now concern multiple
-selections.</p>
-
-</section>
-
-<section id=replaceSelection><h2>replaceSelection's collapsing behavior</h2>
-
-<p>By
-default, <a href="manual.html#replaceSelection"><code>replaceSelection</code></a>
-would leave the newly inserted text selected. This is only rarely what
-you want, and also (slightly) more expensive in the new model, so the
-default was changed to <code>"end"</code>, meaning the old behavior
-must be explicitly specified by passing a second argument
-of <code>"around"</code>.</p>
-
-</section>
-
-<section id=changeEvent><h2>change event data</h2>
-
-<p>Rather than forcing client code to follow <code>next</code>
-pointers from one change object to the next, the library will now
-simply fire
-multiple <a href="manual.html#event_change"><code>"change"</code></a>
-events. Existing code will probably continue to work unmodified.</p>
-
-</section>
-
-<section id=showIfHidden><h2>showIfHidden option to line widgets</h2>
-
-<p>This option, which conceptually caused line widgets to be visible
-even if their line was hidden, was never really well-defined, and was
-buggy from the start. It would be a rather expensive feature, both in
-code complexity and run-time performance, to implement properly. It
-has been dropped entirely in 4.0.</p>
-
-</section>
-
-<section id=module><h2>Module loaders</h2>
-
-<p>All modules in the CodeMirror distribution are now wrapped in a
-shim function to make them compatible with both AMD
-(<a href="http://requirejs.org">requirejs</a>) and CommonJS (as used
-by <a href="http://nodejs.org/">node</a>
-and <a href="http://browserify.org/">browserify</a>) module loaders.
-When neither of these is present, they fall back to simply using the
-global <code>CodeMirror</code> variable.</p>
-
-<p>If you have a module loader present in your environment, CodeMirror
-will attempt to use it, and you might need to change the way you load
-CodeMirror modules.</p>
-
-</section>
-
-<section id=shareddata><h2>Mutating shared data structures</h2>
-
-<p>Data structures produced by the library should not be mutated
-unless explicitly allowed, in general. This is slightly more strict in
-4.0 than it was in earlier versions, which copied the position objects
-returned by <a href="manual.html#getCursor"><code>getCursor</code></a>
-for nebulous, historic reasons. In 4.0, mutating these
-objects <em>will</em> corrupt your editor's selection.</p>
-
-</section>
-
-<section id=deprecated><h2>Deprecated interfaces dropped</h2>
-
-<p>A few properties and methods that have been deprecated for a while
-are now gone. Most notably, the <code>onKeyEvent</code>
-and <code>onDragEvent</code> options (use the
-corresponding <a href="manual.html#event_dom">events</a> instead).</p>
-
-<p>Two silly methods, which were mostly there to stay close to the 0.x
-API, <code>setLine</code> and <code>removeLine</code> are now gone.
-Use the more
-flexible <a href="manual.html#replaceRange"><code>replaceRange</code></a>
-method instead.</p>
-
-<p>The long names for folding and completing functions
-(<code>CodeMirror.braceRangeFinder</code>, <code>CodeMirror.javascriptHint</code>,
-etc) are also gone
-(use <code>CodeMirror.fold.brace</code>, <code>CodeMirror.hint.javascript</code>).</p>
-
-<p>The <code>className</code> property in the return value
-of <a href="manual.html#getTokenAt"><code>getTokenAt</code></a>, which
-has been superseded by the <code>type</code> property, is also no
-longer present.</p>
-
-</section>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v4.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v4.html.xml
deleted file mode 100644
index 4071ef38cbe5e5f69e71a2d84e4a2a0ebb906cd5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/upgrade_v4.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>upgrade_v4.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/yinyang.png.png b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/yinyang.png.png
deleted file mode 100644
index 2eafd3f1ca137898ede8c27d0e64d99919bdc1ab..0000000000000000000000000000000000000000
Binary files a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/yinyang.png.png and /dev/null differ
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/yinyang.png.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/yinyang.png.xml
deleted file mode 100644
index 3ae7fd79b7e57b69b5eb8ee99f078483258682df..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/doc/yinyang.png.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Image" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>yinyang.png</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>image/png</string> </value>
-        </item>
-        <item>
-            <key> <string>height</string> </key>
-            <value> <int>120</int> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>width</string> </key>
-            <value> <int>120</int> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/index.html.html
deleted file mode 100644
index 8009154d1dc3fe245040cdee3ccfee97a10eb705..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/index.html.html
+++ /dev/null
@@ -1,199 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror</title>
-<meta charset="utf-8"/>
-
-<link rel=stylesheet href="lib/codemirror.css">
-<link rel=stylesheet href="doc/docs.css">
-<script src="lib/codemirror.js"></script>
-<script src="mode/xml/xml.js"></script>
-<script src="mode/javascript/javascript.js"></script>
-<script src="mode/css/css.js"></script>
-<script src="mode/htmlmixed/htmlmixed.js"></script>
-<script src="addon/edit/matchbrackets.js"></script>
-
-<script src="doc/activebookmark.js"></script>
-
-<style>
-  .CodeMirror { height: auto; border: 1px solid #ddd; }
-  .CodeMirror-scroll { max-height: 200px; }
-  .CodeMirror pre { padding-left: 7px; line-height: 1.25; }
-</style>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="doc/logo.png"></a>
-
-  <ul>
-    <li><a class=active data-default="true" href="#description">Home</a>
-    <li><a href="doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="#features">Features</a>
-    <li><a href="#community">Community</a>
-    <li><a href="#browsersupport">Browser support</a>
-  </ul>
-</div>
-
-<article>
-
-<section id=description class=first>
-  <p><strong>CodeMirror</strong> is a versatile text editor
-  implemented in JavaScript for the browser. It is specialized for
-  editing code, and comes with a number of <a href="mode/index.html">language modes</a> and <a href="doc/manual.html#addons">addons</a>
-  that implement more advanced editing functionality.</p>
-
-  <p>A rich <a href="doc/manual.html#api">programming API</a> and a
-  CSS <a href="doc/manual.html#styling">theming</a> system are
-  available for customizing CodeMirror to fit your application, and
-  extending it with new functionality.</p>
-</section>
-
-<section id=demo>
-  <h2>This is CodeMirror</h2>
-  <form style="position: relative; margin-top: .5em;"><textarea id=demotext>
-<!-- Create a simple CodeMirror instance -->
-<link rel="stylesheet" href="lib/codemirror.css">
-<script src="lib/codemirror.js"></script>
-<script>
-  var editor = CodeMirror.fromTextArea(myTextarea, {
-    lineNumbers: true
-  });
-</script></textarea>
-  <select id="demolist" onchange="document.location = this.options[this.selectedIndex].value;">
-    <option value="#">Other demos...</option>
-    <option value="demo/complete.html">Autocompletion</option>
-    <option value="demo/folding.html">Code folding</option>
-    <option value="demo/theme.html">Themes</option>
-    <option value="mode/htmlmixed/index.html">Mixed language modes</option>
-    <option value="demo/bidi.html">Bi-directional text</option>
-    <option value="demo/variableheight.html">Variable font sizes</option>
-    <option value="demo/search.html">Search interface</option>
-    <option value="demo/vim.html">Vim bindings</option>
-    <option value="demo/emacs.html">Emacs bindings</option>
-    <option value="demo/sublime.html">Sublime Text bindings</option>
-    <option value="demo/tern.html">Tern integration</option>
-    <option value="demo/merge.html">Merge/diff interface</option>
-    <option value="demo/fullscreen.html">Full-screen editor</option>
-    <option value="demo/simplescrollbars.html">Custom scrollbars</option>
-  </select></form>
-  <script>
-    var editor = CodeMirror.fromTextArea(document.getElementById("demotext"), {
-      lineNumbers: true,
-      mode: "text/html",
-      matchBrackets: true
-    });
-  </script>
-
-  <div class=actions>
-    <div class=actionspicture>
-      <img src="doc/yinyang.png" class=yinyang>
-      <div class="actionlink download">
-        <a href="http://codemirror.net/codemirror.zip">DOWNLOAD</a>
-      </div>
-      <div class="actionlink fund">
-        <a href="https://marijnhaverbeke.nl/fund/">FUND</a>
-      </div>
-    </div>
-    <div class=actionsleft>
-      Get the current version: <a href="http://codemirror.net/codemirror.zip">5.24.2</a>.<br>
-      You can see the <a href="https://github.com/codemirror/codemirror" title="Github repository">code</a>,<br>
-      read the <a href="doc/releases.html">release notes</a>,<br>
-      or study the <a href="doc/manual.html">user manual</a>.
-    </div>
-    <div class=actionsright>
-      Software needs maintenance,<br>
-      maintainers need to subsist.<br>
-      Current funding status = <img src="https://marijnhaverbeke.nl/fund/status_s.png" title="Current maintainer happiness" style="vertical-align: middle; height: 16px; width: 16px"><br>
-      You can help <a href="https://marijnhaverbeke.nl/fund/" title="Set up a monthly contribution">per month</a> or
-      <a title="Donate with PayPal" href="javascript:document.getElementById('paypal').submit();">once</a>.
-      <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal">
-        <input type="hidden" name="cmd" value="_s-xclick"/>
-        <input type="hidden" name="hosted_button_id" value="3FVHS5FGUY7CC"/>
-      </form>
-    </div>
-  </div>
-
-</section>
-
-<section id=features>
-  <h2>Features</h2>
-  <ul>
-    <li>Support for <a href="mode/index.html">over 100 languages</a> out of the box
-    <li>A powerful, <a href="mode/htmlmixed/index.html">composable</a> language mode <a href="doc/manual.html#modeapi">system</a>
-    <li><a href="doc/manual.html#addon_show-hint">Autocompletion</a> (<a href="demo/xmlcomplete.html">XML</a>)
-    <li><a href="doc/manual.html#addon_foldcode">Code folding</a>
-    <li><a href="doc/manual.html#option_extraKeys">Configurable</a> keybindings
-    <li><a href="demo/vim.html">Vim</a>, <a href="demo/emacs.html">Emacs</a>, and <a href="demo/sublime.html">Sublime Text</a> bindings
-    <li><a href="doc/manual.html#addon_search">Search and replace</a> interface
-    <li><a href="doc/manual.html#addon_matchbrackets">Bracket</a> and <a href="doc/manual.html#addon_matchtags">tag</a> matching
-    <li>Support for <a href="demo/buffers.html">split views</a>
-    <li><a href="doc/manual.html#addon_lint">Linter integration</a>
-    <li><a href="demo/variableheight.html">Mixing font sizes and styles</a>
-    <li><a href="demo/theme.html">Various themes</a>
-    <li>Able to <a href="demo/resize.html">resize to fit content</a>
-    <li><a href="doc/manual.html#mark_replacedWith">Inline</a> and <a href="doc/manual.html#addLineWidget">block</a> widgets
-    <li>Programmable <a href="demo/marker.html">gutters</a>
-    <li>Making ranges of text <a href="doc/manual.html#markText">styled, read-only, or atomic</a>
-    <li><a href="demo/bidi.html">Bi-directional text</a> support
-    <li>Many other <a href="doc/manual.html#api">methods</a> and <a href="doc/manual.html#addons">addons</a>...
-  </ul>
-</section>
-
-<section id=community>
-  <h2>Community</h2>
-
-  <p>CodeMirror is an open-source project shared under
-  an <a href="LICENSE">MIT license</a>. It is the editor used in the
-  dev tools for
-  both <a href="https://hacks.mozilla.org/2013/11/firefox-developer-tools-episode-27-edit-as-html-codemirror-more/">Firefox</a>
-  and <a href="https://developers.google.com/chrome-developer-tools/">Chrome</a>, <a href="http://www.lighttable.com/">Light
-  Table</a>, <a href="http://brackets.io/">Adobe
-  Brackets</a>, <a href="http://blog.bitbucket.org/2013/05/14/edit-your-code-in-the-cloud-with-bitbucket/">Bitbucket</a>,
-  and <a href="doc/realworld.html">many other projects</a>.</p>
-
-  <p>Development and bug tracking happens
-  on <a href="https://github.com/codemirror/CodeMirror/">github</a>
-  (<a href="http://marijnhaverbeke.nl/git/codemirror">alternate git
-  repository</a>).
-  Please <a href="http://codemirror.net/doc/reporting.html">read these
-  pointers</a> before submitting a bug. Use pull requests to submit
-  patches. All contributions must be released under the same MIT
-  license that CodeMirror uses.</p>
-
-  <p>Discussion around the project is done on
-  a <a href="https://discuss.codemirror.net">discussion forum</a>.
-  Announcements related to the project, such as new versions, are
-  posted in the
-  forum's <a href="https://discuss.codemirror.net/c/announce">"announce"</a>
-  category. If needed, you can
-  contact <a href="mailto:marijnh@gmail.com">the maintainer</a>
-  directly. We aim to be an inclusive, welcoming community. To make
-  that explicit, we have
-  a <a href="http://contributor-covenant.org/version/1/1/0/">code of
-  conduct</a> that applies to communication around the project.</p>
-
-  <p>A list of CodeMirror-related software that is not part of the
-  main distribution is maintained
-  on <a href="https://github.com/codemirror/CodeMirror/wiki/CodeMirror-addons">our
-  wiki</a>. Feel free to add your project.</p>
-</section>
-
-<section id=browsersupport>
-  <h2>Browser support</h2>
-  <p>The <em>desktop</em> versions of the following browsers,
-  in <em>standards mode</em> (HTML5 <code>&lt;!doctype聽html></code>
-  recommended) are supported:</p>
-  <table style="margin-bottom: 1em">
-    <tr><th>Firefox</th><td>version 4 and up</td></tr>
-    <tr><th>Chrome</th><td>any version</td></tr>
-    <tr><th>Safari</th><td>version 5.2 and up</td></tr>
-    <tr><th style="padding-right: 1em;">Internet Explorer</th><td>version 8 and up</td></tr>
-    <tr><th>Opera</th><td>version 9 and up</td></tr>
-  </table>
-  <p>Support for modern mobile browsers is experimental. Recent
-  versions of the iOS browser and Chrome on Android should work
-  pretty well.</p>
-</section>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/emacs.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/emacs.js.js
index 57cf6e8525423792c2ad1c28a436b1f0a202e58a..6e29b5951a71e7e594191b7caca2f086be899155 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/emacs.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/emacs.js.js
@@ -30,16 +30,16 @@
 
   var lastKill = null;
 
-  function kill(cm, from, to, mayGrow, text) {
+  function kill(cm, from, to, ring, text) {
     if (text == null) text = cm.getRange(from, to);
 
-    if (mayGrow && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))
+    if (ring == "grow" && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))
       growRingTop(text);
-    else
+    else if (ring !== false)
       addToRing(text);
     cm.replaceRange("", from, to, "+delete");
 
-    if (mayGrow) lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};
+    if (ring == "grow") lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};
     else lastKill = null;
   }
 
@@ -97,7 +97,7 @@
 
   function byExpr(cm, pos, dir) {
     var wrap;
-    if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, true))
+    if (cm.findMatchingBracket && (wrap = cm.findMatchingBracket(pos, {strict: true}))
         && wrap.match && (wrap.forward ? 1 : -1) == dir)
       return dir > 0 ? Pos(wrap.to.line, wrap.to.ch + 1) : wrap.to;
 
@@ -151,22 +151,22 @@
     return f;
   }
 
-  function killTo(cm, by, dir) {
+  function killTo(cm, by, dir, ring) {
     var selections = cm.listSelections(), cursor;
     var i = selections.length;
     while (i--) {
       cursor = selections[i].head;
-      kill(cm, cursor, findEnd(cm, cursor, by, dir), true);
+      kill(cm, cursor, findEnd(cm, cursor, by, dir), ring);
     }
   }
 
-  function killRegion(cm) {
+  function killRegion(cm, ring) {
     if (cm.somethingSelected()) {
       var selections = cm.listSelections(), selection;
       var i = selections.length;
       while (i--) {
         selection = selections[i];
-        kill(cm, selection.anchor, selection.head);
+        kill(cm, selection.anchor, selection.head, ring);
       }
       return true;
     }
@@ -276,7 +276,7 @@
   // Actual keymap
 
   var keyMap = CodeMirror.keyMap.emacs = CodeMirror.normalizeKeyMap({
-    "Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"));},
+    "Ctrl-W": function(cm) {kill(cm, cm.getCursor("start"), cm.getCursor("end"), true);},
     "Ctrl-K": repeated(function(cm) {
       var start = cm.getCursor(), end = cm.clipPos(Pos(start.line));
       var text = cm.getRange(start, end);
@@ -284,7 +284,7 @@
         text += "\n";
         end = Pos(start.line + 1, 0);
       }
-      kill(cm, start, end, true, text);
+      kill(cm, start, end, "grow", text);
     }),
     "Alt-W": function(cm) {
       addToRing(cm.getSelection());
@@ -301,31 +301,30 @@
 
     "Ctrl-F": move(byChar, 1), "Ctrl-B": move(byChar, -1),
     "Right": move(byChar, 1), "Left": move(byChar, -1),
-    "Ctrl-D": function(cm) { killTo(cm, byChar, 1); },
-    "Delete": function(cm) { killRegion(cm) || killTo(cm, byChar, 1); },
-    "Ctrl-H": function(cm) { killTo(cm, byChar, -1); },
-    "Backspace": function(cm) { killRegion(cm) || killTo(cm, byChar, -1); },
+    "Ctrl-D": function(cm) { killTo(cm, byChar, 1, false); },
+    "Delete": function(cm) { killRegion(cm, false) || killTo(cm, byChar, 1, false); },
+    "Ctrl-H": function(cm) { killTo(cm, byChar, -1, false); },
+    "Backspace": function(cm) { killRegion(cm, false) || killTo(cm, byChar, -1, false); },
 
     "Alt-F": move(byWord, 1), "Alt-B": move(byWord, -1),
-    "Alt-D": function(cm) { killTo(cm, byWord, 1); },
-    "Alt-Backspace": function(cm) { killTo(cm, byWord, -1); },
+    "Alt-D": function(cm) { killTo(cm, byWord, 1, "grow"); },
+    "Alt-Backspace": function(cm) { killTo(cm, byWord, -1, "grow"); },
 
     "Ctrl-N": move(byLine, 1), "Ctrl-P": move(byLine, -1),
     "Down": move(byLine, 1), "Up": move(byLine, -1),
     "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
     "End": "goLineEnd", "Home": "goLineStart",
 
-    "Alt-V": move(byPage, -1), "Ctrl-V": move(byPage, 1),
     "PageUp": move(byPage, -1), "PageDown": move(byPage, 1),
 
     "Ctrl-Up": move(byParagraph, -1), "Ctrl-Down": move(byParagraph, 1),
 
     "Alt-A": move(bySentence, -1), "Alt-E": move(bySentence, 1),
-    "Alt-K": function(cm) { killTo(cm, bySentence, 1); },
+    "Alt-K": function(cm) { killTo(cm, bySentence, 1, "grow"); },
 
-    "Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1); },
-    "Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1); },
-    "Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1),
+    "Ctrl-Alt-K": function(cm) { killTo(cm, byExpr, 1, "grow"); },
+    "Ctrl-Alt-Backspace": function(cm) { killTo(cm, byExpr, -1, "grow"); },
+    "Ctrl-Alt-F": move(byExpr, 1), "Ctrl-Alt-B": move(byExpr, -1, "grow"),
 
     "Shift-Ctrl-Alt-2": function(cm) {
       var cursor = cm.getCursor();
@@ -369,9 +368,11 @@
     "Ctrl-/": repeated("undo"), "Shift-Ctrl--": repeated("undo"),
     "Ctrl-Z": repeated("undo"), "Cmd-Z": repeated("undo"),
     "Shift-Alt-,": "goDocStart", "Shift-Alt-.": "goDocEnd",
-    "Ctrl-S": "findNext", "Ctrl-R": "findPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace",
+    "Ctrl-S": "findPersistentNext", "Ctrl-R": "findPersistentPrev", "Ctrl-G": quit, "Shift-Alt-5": "replace",
     "Alt-/": "autocomplete",
-    "Ctrl-J": "newlineAndIndent", "Enter": false, "Tab": "indentAuto",
+    "Enter": "newlineAndIndent",
+    "Ctrl-J": repeated(function(cm) { cm.replaceSelection("\n", "end"); }),
+    "Tab": "indentAuto",
 
     "Alt-G G": function(cm) {
       var prefix = getPrefix(cm, true);
@@ -396,7 +397,7 @@
     "Ctrl-X F": "open",
     "Ctrl-X U": repeated("undo"),
     "Ctrl-X K": "close",
-    "Ctrl-X Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), true); },
+    "Ctrl-X Delete": function(cm) { kill(cm, cm.getCursor(), bySentence(cm, cm.getCursor(), 1), "grow"); },
     "Ctrl-X H": "selectAll",
 
     "Ctrl-Q Tab": repeated("insertTab"),
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/sublime.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/sublime.js.js
index 0ce89558750c13756ccfcf1ac02685cd6669ba58..33bbb6a9820c7586f34e9fa5b04625cb923a844d 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/sublime.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/sublime.js.js
@@ -6,19 +6,16 @@
 
 (function(mod) {
   if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/edit/matchbrackets"));
+    mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/cm_edit/matchbrackets"));
   else if (typeof define == "function" && define.amd) // AMD
-    define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/edit/matchbrackets"], mod);
+    define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/cm_edit/matchbrackets"], mod);
   else // Plain browser env
     mod(CodeMirror);
 })(function(CodeMirror) {
   "use strict";
 
-  var map = CodeMirror.keyMap.sublime = {fallthrough: "default"};
   var cmds = CodeMirror.commands;
   var Pos = CodeMirror.Pos;
-  var mac = CodeMirror.keyMap["default"] == CodeMirror.keyMap.macDefault;
-  var ctrl = mac ? "Cmd-" : "Ctrl-";
 
   // This is not exactly Sublime's algorithm. I couldn't make heads or tails of that.
   function findPosSubword(doc, start, dir) {
@@ -52,16 +49,10 @@
     });
   }
 
-  var goSubwordCombo = mac ? "Ctrl-" : "Alt-";
+  cmds.goSubwordLeft = function(cm) { moveSubword(cm, -1); };
+  cmds.goSubwordRight = function(cm) { moveSubword(cm, 1); };
 
-  cmds[map[goSubwordCombo + "Left"] = "goSubwordLeft"] = function(cm) { moveSubword(cm, -1); };
-  cmds[map[goSubwordCombo + "Right"] = "goSubwordRight"] = function(cm) { moveSubword(cm, 1); };
-
-  if (mac) map["Cmd-Left"] = "goLineStartSmart";
-
-  var scrollLineCombo = mac ? "Ctrl-Alt-" : "Ctrl-";
-
-  cmds[map[scrollLineCombo + "Up"] = "scrollLineUp"] = function(cm) {
+  cmds.scrollLineUp = function(cm) {
     var info = cm.getScrollInfo();
     if (!cm.somethingSelected()) {
       var visibleBottomLine = cm.lineAtHeight(info.top + info.clientHeight, "local");
@@ -70,7 +61,7 @@
     }
     cm.scrollTo(null, info.top - cm.defaultTextHeight());
   };
-  cmds[map[scrollLineCombo + "Down"] = "scrollLineDown"] = function(cm) {
+  cmds.scrollLineDown = function(cm) {
     var info = cm.getScrollInfo();
     if (!cm.somethingSelected()) {
       var visibleTopLine = cm.lineAtHeight(info.top, "local")+1;
@@ -80,7 +71,7 @@
     cm.scrollTo(null, info.top + cm.defaultTextHeight());
   };
 
-  cmds[map["Shift-" + ctrl + "L"] = "splitSelectionByLine"] = function(cm) {
+  cmds.splitSelectionByLine = function(cm) {
     var ranges = cm.listSelections(), lineRanges = [];
     for (var i = 0; i < ranges.length; i++) {
       var from = ranges[i].from(), to = ranges[i].to();
@@ -92,14 +83,12 @@
     cm.setSelections(lineRanges, 0);
   };
 
-  map["Shift-Tab"] = "indentLess";
-
-  cmds[map["Esc"] = "singleSelectionTop"] = function(cm) {
+  cmds.singleSelectionTop = function(cm) {
     var range = cm.listSelections()[0];
     cm.setSelection(range.anchor, range.head, {scroll: false});
   };
 
-  cmds[map[ctrl + "L"] = "selectLine"] = function(cm) {
+  cmds.selectLine = function(cm) {
     var ranges = cm.listSelections(), extended = [];
     for (var i = 0; i < ranges.length; i++) {
       var range = ranges[i];
@@ -109,8 +98,6 @@
     cm.setSelections(extended);
   };
 
-  map["Shift-Ctrl-K"] = "deleteLine";
-
   function insertLine(cm, above) {
     if (cm.isReadOnly()) return CodeMirror.Pass
     cm.operation(function() {
@@ -129,9 +116,9 @@
     cm.execCommand("indentAuto");
   }
 
-  cmds[map[ctrl + "Enter"] = "insertLineAfter"] = function(cm) { return insertLine(cm, false); };
+  cmds.insertLineAfter = function(cm) { return insertLine(cm, false); };
 
-  cmds[map["Shift-" + ctrl + "Enter"] = "insertLineBefore"] = function(cm) { return insertLine(cm, true); };
+  cmds.insertLineBefore = function(cm) { return insertLine(cm, true); };
 
   function wordAt(cm, pos) {
     var start = pos.ch, end = start, line = cm.getLine(pos.line);
@@ -140,7 +127,7 @@
     return {from: Pos(pos.line, start), to: Pos(pos.line, end), word: line.slice(start, end)};
   }
 
-  cmds[map[ctrl + "D"] = "selectNextOccurrence"] = function(cm) {
+  cmds.selectNextOccurrence = function(cm) {
     var from = cm.getCursor("from"), to = cm.getCursor("to");
     var fullWord = cm.state.sublimeFindFullWord == cm.doc.sel;
     if (CodeMirror.cmpPos(from, to) == 0) {
@@ -165,6 +152,27 @@
       cm.state.sublimeFindFullWord = cm.doc.sel;
   };
 
+  function addCursorToSelection(cm, dir) {
+    var ranges = cm.listSelections(), newRanges = [];
+    for (var i = 0; i < ranges.length; i++) {
+      var range = ranges[i];
+      var newAnchor = cm.findPosV(
+          range.anchor, dir, "line", range.anchor.goalColumn);
+      var newHead = cm.findPosV(
+          range.head, dir, "line", range.head.goalColumn);
+      newAnchor.goalColumn = range.anchor.goalColumn != null ?
+          range.anchor.goalColumn : cm.cursorCoords(range.anchor, "div").left;
+      newHead.goalColumn = range.head.goalColumn != null ?
+          range.head.goalColumn : cm.cursorCoords(range.head, "div").left;
+      var newRange = {anchor: newAnchor, head: newHead};
+      newRanges.push(range);
+      newRanges.push(newRange);
+    }
+    cm.setSelections(newRanges);
+  }
+  cmds.addCursorToPrevLine = function(cm) { addCursorToSelection(cm, -1); };
+  cmds.addCursorToNextLine = function(cm) { addCursorToSelection(cm, 1); };
+
   function isSelectedRange(ranges, from, to) {
     for (var i = 0; i < ranges.length; i++)
       if (ranges[i].from() == from && ranges[i].to() == to) return true
@@ -181,9 +189,15 @@
         var closing = cm.scanForBracket(pos, 1);
         if (!closing) return false;
         if (closing.ch == mirror.charAt(mirror.indexOf(opening.ch) + 1)) {
-          newRanges.push({anchor: Pos(opening.pos.line, opening.pos.ch + 1),
-                          head: closing.pos});
-          break;
+          var startPos = Pos(opening.pos.line, opening.pos.ch + 1);
+          if (CodeMirror.cmpPos(startPos, range.from()) == 0 &&
+              CodeMirror.cmpPos(closing.pos, range.to()) == 0) {
+            opening = cm.scanForBracket(opening.pos, -1);
+            if (!opening) return false;
+          } else {
+            newRanges.push({anchor: startPos, head: closing.pos});
+            break;
+          }
         }
         pos = Pos(closing.pos.line, closing.pos.ch + 1);
       }
@@ -192,14 +206,14 @@
     return true;
   }
 
-  cmds[map["Shift-" + ctrl + "Space"] = "selectScope"] = function(cm) {
+  cmds.selectScope = function(cm) {
     selectBetweenBrackets(cm) || cm.execCommand("selectAll");
   };
-  cmds[map["Shift-" + ctrl + "M"] = "selectBetweenBrackets"] = function(cm) {
+  cmds.selectBetweenBrackets = function(cm) {
     if (!selectBetweenBrackets(cm)) return CodeMirror.Pass;
   };
 
-  cmds[map[ctrl + "M"] = "goToBracket"] = function(cm) {
+  cmds.goToBracket = function(cm) {
     cm.extendSelectionsBy(function(range) {
       var next = cm.scanForBracket(range.head, 1);
       if (next && CodeMirror.cmpPos(next.pos, range.head) != 0) return next.pos;
@@ -208,9 +222,7 @@
     });
   };
 
-  var swapLineCombo = mac ? "Cmd-Ctrl-" : "Shift-Ctrl-";
-
-  cmds[map[swapLineCombo + "Up"] = "swapLineUp"] = function(cm) {
+  cmds.swapLineUp = function(cm) {
     if (cm.isReadOnly()) return CodeMirror.Pass
     var ranges = cm.listSelections(), linesToMove = [], at = cm.firstLine() - 1, newSels = [];
     for (var i = 0; i < ranges.length; i++) {
@@ -237,7 +249,7 @@
     });
   };
 
-  cmds[map[swapLineCombo + "Down"] = "swapLineDown"] = function(cm) {
+  cmds.swapLineDown = function(cm) {
     if (cm.isReadOnly()) return CodeMirror.Pass
     var ranges = cm.listSelections(), linesToMove = [], at = cm.lastLine() + 1;
     for (var i = ranges.length - 1; i >= 0; i--) {
@@ -261,11 +273,11 @@
     });
   };
 
-  cmds[map[ctrl + "/"] = "toggleCommentIndented"] = function(cm) {
+  cmds.toggleCommentIndented = function(cm) {
     cm.toggleComment({ indent: true });
   }
 
-  cmds[map[ctrl + "J"] = "joinLines"] = function(cm) {
+  cmds.joinLines = function(cm) {
     var ranges = cm.listSelections(), joined = [];
     for (var i = 0; i < ranges.length; i++) {
       var range = ranges[i], from = range.from();
@@ -293,7 +305,7 @@
     });
   };
 
-  cmds[map["Shift-" + ctrl + "D"] = "duplicateLine"] = function(cm) {
+  cmds.duplicateLine = function(cm) {
     cm.operation(function() {
       var rangeCount = cm.listSelections().length;
       for (var i = 0; i < rangeCount; i++) {
@@ -307,7 +319,6 @@
     });
   };
 
-  if (!mac) map[ctrl + "T"] = "transposeChars";
 
   function sortLines(cm, caseSensitive) {
     if (cm.isReadOnly()) return CodeMirror.Pass
@@ -345,10 +356,10 @@
     });
   }
 
-  cmds[map["F9"] = "sortLines"] = function(cm) { sortLines(cm, true); };
-  cmds[map[ctrl + "F9"] = "sortLinesInsensitive"] = function(cm) { sortLines(cm, false); };
+  cmds.sortLines = function(cm) { sortLines(cm, true); };
+  cmds.sortLinesInsensitive = function(cm) { sortLines(cm, false); };
 
-  cmds[map["F2"] = "nextBookmark"] = function(cm) {
+  cmds.nextBookmark = function(cm) {
     var marks = cm.state.sublimeBookmarks;
     if (marks) while (marks.length) {
       var current = marks.shift();
@@ -360,7 +371,7 @@
     }
   };
 
-  cmds[map["Shift-F2"] = "prevBookmark"] = function(cm) {
+  cmds.prevBookmark = function(cm) {
     var marks = cm.state.sublimeBookmarks;
     if (marks) while (marks.length) {
       marks.unshift(marks.pop());
@@ -372,12 +383,12 @@
     }
   };
 
-  cmds[map[ctrl + "F2"] = "toggleBookmark"] = function(cm) {
+  cmds.toggleBookmark = function(cm) {
     var ranges = cm.listSelections();
     var marks = cm.state.sublimeBookmarks || (cm.state.sublimeBookmarks = []);
     for (var i = 0; i < ranges.length; i++) {
       var from = ranges[i].from(), to = ranges[i].to();
-      var found = cm.findMarks(from, to);
+      var found = ranges[i].empty() ? cm.findMarksAt(from) : cm.findMarks(from, to);
       for (var j = 0; j < found.length; j++) {
         if (found[j].sublimeBookmark) {
           found[j].clear();
@@ -392,13 +403,13 @@
     }
   };
 
-  cmds[map["Shift-" + ctrl + "F2"] = "clearBookmarks"] = function(cm) {
+  cmds.clearBookmarks = function(cm) {
     var marks = cm.state.sublimeBookmarks;
     if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear();
     marks.length = 0;
   };
 
-  cmds[map["Alt-F2"] = "selectBookmarks"] = function(cm) {
+  cmds.selectBookmarks = function(cm) {
     var marks = cm.state.sublimeBookmarks, ranges = [];
     if (marks) for (var i = 0; i < marks.length; i++) {
       var found = marks[i].find();
@@ -411,10 +422,6 @@
       cm.setSelections(ranges, 0);
   };
 
-  map["Alt-Q"] = "wrapLines";
-
-  var cK = ctrl + "K ";
-
   function modifyWordOrSelection(cm, mod) {
     cm.operation(function() {
       var ranges = cm.listSelections(), indices = [], replacements = [];
@@ -434,9 +441,7 @@
     });
   }
 
-  map[cK + ctrl + "Backspace"] = "delLineLeft";
-
-  cmds[map["Backspace"] = "smartBackspace"] = function(cm) {
+  cmds.smartBackspace = function(cm) {
     if (cm.somethingSelected()) return CodeMirror.Pass;
 
     cm.operation(function() {
@@ -464,7 +469,7 @@
     });
   };
 
-  cmds[map[cK + ctrl + "K"] = "delLineRight"] = function(cm) {
+  cmds.delLineRight = function(cm) {
     cm.operation(function() {
       var ranges = cm.listSelections();
       for (var i = ranges.length - 1; i >= 0; i--)
@@ -473,22 +478,22 @@
     });
   };
 
-  cmds[map[cK + ctrl + "U"] = "upcaseAtCursor"] = function(cm) {
+  cmds.upcaseAtCursor = function(cm) {
     modifyWordOrSelection(cm, function(str) { return str.toUpperCase(); });
   };
-  cmds[map[cK + ctrl + "L"] = "downcaseAtCursor"] = function(cm) {
+  cmds.downcaseAtCursor = function(cm) {
     modifyWordOrSelection(cm, function(str) { return str.toLowerCase(); });
   };
 
-  cmds[map[cK + ctrl + "Space"] = "setSublimeMark"] = function(cm) {
+  cmds.setSublimeMark = function(cm) {
     if (cm.state.sublimeMark) cm.state.sublimeMark.clear();
     cm.state.sublimeMark = cm.setBookmark(cm.getCursor());
   };
-  cmds[map[cK + ctrl + "A"] = "selectToSublimeMark"] = function(cm) {
+  cmds.selectToSublimeMark = function(cm) {
     var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
     if (found) cm.setSelection(cm.getCursor(), found);
   };
-  cmds[map[cK + ctrl + "W"] = "deleteToSublimeMark"] = function(cm) {
+  cmds.deleteToSublimeMark = function(cm) {
     var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
     if (found) {
       var from = cm.getCursor(), to = found;
@@ -497,7 +502,7 @@
       cm.replaceRange("", from, to);
     }
   };
-  cmds[map[cK + ctrl + "X"] = "swapWithSublimeMark"] = function(cm) {
+  cmds.swapWithSublimeMark = function(cm) {
     var found = cm.state.sublimeMark && cm.state.sublimeMark.find();
     if (found) {
       cm.state.sublimeMark.clear();
@@ -505,39 +510,16 @@
       cm.setCursor(found);
     }
   };
-  cmds[map[cK + ctrl + "Y"] = "sublimeYank"] = function(cm) {
+  cmds.sublimeYank = function(cm) {
     if (cm.state.sublimeKilled != null)
       cm.replaceSelection(cm.state.sublimeKilled, null, "paste");
   };
 
-  map[cK + ctrl + "G"] = "clearBookmarks";
-  cmds[map[cK + ctrl + "C"] = "showInCenter"] = function(cm) {
+  cmds.showInCenter = function(cm) {
     var pos = cm.cursorCoords(null, "local");
     cm.scrollTo(null, (pos.top + pos.bottom) / 2 - cm.getScrollInfo().clientHeight / 2);
   };
 
-  var selectLinesCombo = mac ? "Ctrl-Shift-" : "Ctrl-Alt-";
-  cmds[map[selectLinesCombo + "Up"] = "selectLinesUpward"] = function(cm) {
-    cm.operation(function() {
-      var ranges = cm.listSelections();
-      for (var i = 0; i < ranges.length; i++) {
-        var range = ranges[i];
-        if (range.head.line > cm.firstLine())
-          cm.addSelection(Pos(range.head.line - 1, range.head.ch));
-      }
-    });
-  };
-  cmds[map[selectLinesCombo + "Down"] = "selectLinesDownward"] = function(cm) {
-    cm.operation(function() {
-      var ranges = cm.listSelections();
-      for (var i = 0; i < ranges.length; i++) {
-        var range = ranges[i];
-        if (range.head.line < cm.lastLine())
-          cm.addSelection(Pos(range.head.line + 1, range.head.ch));
-      }
-    });
-  };
-
   function getTarget(cm) {
     var from = cm.getCursor("from"), to = cm.getCursor("to");
     if (CodeMirror.cmpPos(from, to) == 0) {
@@ -566,9 +548,9 @@
         cm.setSelection(target.from, target.to);
     }
   };
-  cmds[map[ctrl + "F3"] = "findUnder"] = function(cm) { findAndGoTo(cm, true); };
-  cmds[map["Shift-" + ctrl + "F3"] = "findUnderPrevious"] = function(cm) { findAndGoTo(cm,false); };
-  cmds[map["Alt-F3"] = "findAllUnder"] = function(cm) {
+  cmds.findUnder = function(cm) { findAndGoTo(cm, true); };
+  cmds.findUnderPrevious = function(cm) { findAndGoTo(cm,false); };
+  cmds.findAllUnder = function(cm) {
     var target = getTarget(cm);
     if (!target) return;
     var cur = cm.getSearchCursor(target.query);
@@ -582,15 +564,128 @@
     cm.setSelections(matches, primaryIndex);
   };
 
-  map["Shift-" + ctrl + "["] = "fold";
-  map["Shift-" + ctrl + "]"] = "unfold";
-  map[cK + ctrl + "0"] = map[cK + ctrl + "J"] = "unfoldAll";
-
-  map[ctrl + "I"] = "findIncremental";
-  map["Shift-" + ctrl + "I"] = "findIncrementalReverse";
-  map[ctrl + "H"] = "replace";
-  map["F3"] = "findNext";
-  map["Shift-F3"] = "findPrev";
 
-  CodeMirror.normalizeKeyMap(map);
+  var keyMap = CodeMirror.keyMap;
+  keyMap.macSublime = {
+    "Cmd-Left": "goLineStartSmart",
+    "Shift-Tab": "indentLess",
+    "Shift-Ctrl-K": "deleteLine",
+    "Alt-Q": "wrapLines",
+    "Ctrl-Left": "goSubwordLeft",
+    "Ctrl-Right": "goSubwordRight",
+    "Ctrl-Alt-Up": "scrollLineUp",
+    "Ctrl-Alt-Down": "scrollLineDown",
+    "Cmd-L": "selectLine",
+    "Shift-Cmd-L": "splitSelectionByLine",
+    "Esc": "singleSelectionTop",
+    "Cmd-Enter": "insertLineAfter",
+    "Shift-Cmd-Enter": "insertLineBefore",
+    "Cmd-D": "selectNextOccurrence",
+    "Shift-Cmd-Space": "selectScope",
+    "Shift-Cmd-M": "selectBetweenBrackets",
+    "Cmd-M": "goToBracket",
+    "Cmd-Ctrl-Up": "swapLineUp",
+    "Cmd-Ctrl-Down": "swapLineDown",
+    "Cmd-/": "toggleCommentIndented",
+    "Cmd-J": "joinLines",
+    "Shift-Cmd-D": "duplicateLine",
+    "F9": "sortLines",
+    "Cmd-F9": "sortLinesInsensitive",
+    "F2": "nextBookmark",
+    "Shift-F2": "prevBookmark",
+    "Cmd-F2": "toggleBookmark",
+    "Shift-Cmd-F2": "clearBookmarks",
+    "Alt-F2": "selectBookmarks",
+    "Backspace": "smartBackspace",
+    "Cmd-K Cmd-K": "delLineRight",
+    "Cmd-K Cmd-U": "upcaseAtCursor",
+    "Cmd-K Cmd-L": "downcaseAtCursor",
+    "Cmd-K Cmd-Space": "setSublimeMark",
+    "Cmd-K Cmd-A": "selectToSublimeMark",
+    "Cmd-K Cmd-W": "deleteToSublimeMark",
+    "Cmd-K Cmd-X": "swapWithSublimeMark",
+    "Cmd-K Cmd-Y": "sublimeYank",
+    "Cmd-K Cmd-C": "showInCenter",
+    "Cmd-K Cmd-G": "clearBookmarks",
+    "Cmd-K Cmd-Backspace": "delLineLeft",
+    "Cmd-K Cmd-0": "unfoldAll",
+    "Cmd-K Cmd-J": "unfoldAll",
+    "Ctrl-Shift-Up": "addCursorToPrevLine",
+    "Ctrl-Shift-Down": "addCursorToNextLine",
+    "Cmd-F3": "findUnder",
+    "Shift-Cmd-F3": "findUnderPrevious",
+    "Alt-F3": "findAllUnder",
+    "Shift-Cmd-[": "fold",
+    "Shift-Cmd-]": "unfold",
+    "Cmd-I": "findIncremental",
+    "Shift-Cmd-I": "findIncrementalReverse",
+    "Cmd-H": "replace",
+    "F3": "findNext",
+    "Shift-F3": "findPrev",
+    "fallthrough": "macDefault"
+  };
+  CodeMirror.normalizeKeyMap(keyMap.macSublime);
+
+  keyMap.pcSublime = {
+    "Shift-Tab": "indentLess",
+    "Shift-Ctrl-K": "deleteLine",
+    "Alt-Q": "wrapLines",
+    "Ctrl-T": "transposeChars",
+    "Alt-Left": "goSubwordLeft",
+    "Alt-Right": "goSubwordRight",
+    "Ctrl-Up": "scrollLineUp",
+    "Ctrl-Down": "scrollLineDown",
+    "Ctrl-L": "selectLine",
+    "Shift-Ctrl-L": "splitSelectionByLine",
+    "Esc": "singleSelectionTop",
+    "Ctrl-Enter": "insertLineAfter",
+    "Shift-Ctrl-Enter": "insertLineBefore",
+    "Ctrl-D": "selectNextOccurrence",
+    "Shift-Ctrl-Space": "selectScope",
+    "Shift-Ctrl-M": "selectBetweenBrackets",
+    "Ctrl-M": "goToBracket",
+    "Shift-Ctrl-Up": "swapLineUp",
+    "Shift-Ctrl-Down": "swapLineDown",
+    "Ctrl-/": "toggleCommentIndented",
+    "Ctrl-J": "joinLines",
+    "Shift-Ctrl-D": "duplicateLine",
+    "F9": "sortLines",
+    "Ctrl-F9": "sortLinesInsensitive",
+    "F2": "nextBookmark",
+    "Shift-F2": "prevBookmark",
+    "Ctrl-F2": "toggleBookmark",
+    "Shift-Ctrl-F2": "clearBookmarks",
+    "Alt-F2": "selectBookmarks",
+    "Backspace": "smartBackspace",
+    "Ctrl-K Ctrl-K": "delLineRight",
+    "Ctrl-K Ctrl-U": "upcaseAtCursor",
+    "Ctrl-K Ctrl-L": "downcaseAtCursor",
+    "Ctrl-K Ctrl-Space": "setSublimeMark",
+    "Ctrl-K Ctrl-A": "selectToSublimeMark",
+    "Ctrl-K Ctrl-W": "deleteToSublimeMark",
+    "Ctrl-K Ctrl-X": "swapWithSublimeMark",
+    "Ctrl-K Ctrl-Y": "sublimeYank",
+    "Ctrl-K Ctrl-C": "showInCenter",
+    "Ctrl-K Ctrl-G": "clearBookmarks",
+    "Ctrl-K Ctrl-Backspace": "delLineLeft",
+    "Ctrl-K Ctrl-0": "unfoldAll",
+    "Ctrl-K Ctrl-J": "unfoldAll",
+    "Ctrl-Alt-Up": "addCursorToPrevLine",
+    "Ctrl-Alt-Down": "addCursorToNextLine",
+    "Ctrl-F3": "findUnder",
+    "Shift-Ctrl-F3": "findUnderPrevious",
+    "Alt-F3": "findAllUnder",
+    "Shift-Ctrl-[": "fold",
+    "Shift-Ctrl-]": "unfold",
+    "Ctrl-I": "findIncremental",
+    "Shift-Ctrl-I": "findIncrementalReverse",
+    "Ctrl-H": "replace",
+    "F3": "findNext",
+    "Shift-F3": "findPrev",
+    "fallthrough": "pcDefault"
+  };
+  CodeMirror.normalizeKeyMap(keyMap.pcSublime);
+
+  var mac = keyMap.default == keyMap.macDefault;
+  keyMap.sublime = mac ? keyMap.macSublime : keyMap.pcSublime;
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/vim.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/vim.js.js
index 08f4374cacbabab220b27423eb325570fd952013..0a1ea773f1da6611d2ed4ad8d12e43c700f43c24 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/vim.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/keymap/vim.js.js
@@ -36,9 +36,9 @@
 
 (function(mod) {
   if (typeof exports == "object" && typeof module == "object") // CommonJS
-    mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/dialog/dialog"), require("../addon/edit/matchbrackets.js"));
+    mod(require("../lib/codemirror"), require("../addon/search/searchcursor"), require("../addon/dialog/dialog"), require("../addon/cm_edit/matchbrackets.js"));
   else if (typeof define == "function" && define.amd) // AMD
-    define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/dialog/dialog", "../addon/edit/matchbrackets"], mod);
+    define(["../lib/codemirror", "../addon/search/searchcursor", "../addon/dialog/dialog", "../addon/cm_edit/matchbrackets"], mod);
   else // Plain browser env
     mod(CodeMirror);
 })(function(CodeMirror) {
@@ -142,7 +142,7 @@
     { keys: 'X', type: 'operatorMotion', operator: 'delete', motion: 'moveByCharacters', motionArgs: { forward: false }, operatorMotionArgs: { visualLine: true }},
     { keys: 'D', type: 'operatorMotion', operator: 'delete', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
     { keys: 'D', type: 'operator', operator: 'delete', operatorArgs: { linewise: true }, context: 'visual'},
-    { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
+    { keys: 'Y', type: 'operatorMotion', operator: 'yank', motion: 'expandToLine', motionArgs: { linewise: true }, context: 'normal'},
     { keys: 'Y', type: 'operator', operator: 'yank', operatorArgs: { linewise: true }, context: 'visual'},
     { keys: 'C', type: 'operatorMotion', operator: 'change', motion: 'moveToEol', motionArgs: { inclusive: true }, context: 'normal'},
     { keys: 'C', type: 'operator', operator: 'change', operatorArgs: { linewise: true }, context: 'visual'},
@@ -255,20 +255,67 @@
     }
 
     function detachVimMap(cm, next) {
-      if (this == CodeMirror.keyMap.vim)
+      if (this == CodeMirror.keyMap.vim) {
         CodeMirror.rmClass(cm.getWrapperElement(), "cm-fat-cursor");
+        if (cm.getOption("inputStyle") == "contenteditable" && document.body.style.caretColor != null) {
+          disableFatCursorMark(cm);
+          cm.getInputField().style.caretColor = "";
+        }
+      }
 
       if (!next || next.attach != attachVimMap)
-        leaveVimMode(cm, false);
+        leaveVimMode(cm);
     }
     function attachVimMap(cm, prev) {
-      if (this == CodeMirror.keyMap.vim)
+      if (this == CodeMirror.keyMap.vim) {
         CodeMirror.addClass(cm.getWrapperElement(), "cm-fat-cursor");
+        if (cm.getOption("inputStyle") == "contenteditable" && document.body.style.caretColor != null) {
+          enableFatCursorMark(cm);
+          cm.getInputField().style.caretColor = "transparent";
+        }
+      }
 
       if (!prev || prev.attach != attachVimMap)
         enterVimMode(cm);
     }
 
+    function fatCursorMarks(cm) {
+      var ranges = cm.listSelections(), result = []
+      for (var i = 0; i < ranges.length; i++) {
+        var range = ranges[i]
+        if (range.empty()) {
+          if (range.anchor.ch < cm.getLine(range.anchor.line).length) {
+            result.push(cm.markText(range.anchor, Pos(range.anchor.line, range.anchor.ch + 1),
+                                    {className: "cm-fat-cursor-mark"}))
+          } else {
+            var widget = document.createElement("span")
+            widget.textContent = "\u00a0"
+            widget.className = "cm-fat-cursor-mark"
+            result.push(cm.setBookmark(range.anchor, {widget: widget}))
+          }
+        }
+      }
+      return result
+    }
+
+    function updateFatCursorMark(cm) {
+      var marks = cm.state.fatCursorMarks
+      if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear()
+      cm.state.fatCursorMarks = fatCursorMarks(cm)
+    }
+
+    function enableFatCursorMark(cm) {
+      cm.state.fatCursorMarks = fatCursorMarks(cm)
+      cm.on("cursorActivity", updateFatCursorMark)
+    }
+
+    function disableFatCursorMark(cm) {
+      var marks = cm.state.fatCursorMarks
+      if (marks) for (var i = 0; i < marks.length; i++) marks[i].clear()
+      cm.state.fatCursorMarks = null
+      cm.off("cursorActivity", updateFatCursorMark)
+    }
+
     // Deprecated, simply setting the keymap works again.
     CodeMirror.defineOption('vimMode', false, function(cm, val, prev) {
       if (val && cm.getOption("keyMap") != "vim")
@@ -411,11 +458,11 @@
       cfg = cfg || {};
       var scope = cfg.scope;
       if (!option) {
-        throw Error('Unknown option: ' + name);
+        return new Error('Unknown option: ' + name);
       }
       if (option.type == 'boolean') {
         if (value && value !== true) {
-          throw Error('Invalid argument: ' + name + '=' + value);
+          return new Error('Invalid argument: ' + name + '=' + value);
         } else if (value !== false) {
           // Boolean options are set to true if value is not defined.
           value = true;
@@ -443,7 +490,7 @@
       cfg = cfg || {};
       var scope = cfg.scope;
       if (!option) {
-        throw Error('Unknown option: ' + name);
+        return new Error('Unknown option: ' + name);
       }
       if (option.callback) {
         var local = cm && option.callback(undefined, cm);
@@ -649,9 +696,9 @@
         lastCharacterSearch: {increment:0, forward:true, selectedCharacter:''},
         registerController: new RegisterController({}),
         // search history buffer
-        searchHistoryController: new HistoryController({}),
+        searchHistoryController: new HistoryController(),
         // ex Command history buffer
-        exCommandHistoryController : new HistoryController({})
+        exCommandHistoryController : new HistoryController()
       };
       for (var optionName in options) {
         var option = options[optionName];
@@ -794,7 +841,7 @@
         }
 
         function handleKeyNonInsertMode() {
-          if (handleMacroRecording() || handleEsc()) { return true; };
+          if (handleMacroRecording() || handleEsc()) { return true; }
 
           var keys = vim.inputState.keyBuffer = vim.inputState.keyBuffer + key;
           if (/^[1-9]\d*$/.test(keys)) { return true; }
@@ -958,7 +1005,7 @@
      * for a reference implementation.
      */
     function defineRegister(name, register) {
-      var registers = vimGlobalState.registerController.registers[name];
+      var registers = vimGlobalState.registerController.registers;
       if (!name || name.length != 1) {
         throw Error('Register name must be 1 character');
       }
@@ -986,9 +1033,6 @@
     }
     RegisterController.prototype = {
       pushText: function(registerName, operator, text, linewise, blockwise) {
-        if (linewise && text.charAt(0) == '\n') {
-          text = text.slice(1) + '\n';
-        }
         if (linewise && text.charAt(text.length - 1) !== '\n'){
           text += '\n';
         }
@@ -1110,7 +1154,9 @@
           }
         }
         if (bestMatch.keys.slice(-11) == '<character>') {
-          inputState.selectedCharacter = lastChar(keys);
+          var character = lastChar(keys);
+          if (!character) return {type: 'none'};
+          inputState.selectedCharacter = character;
         }
         return {type: 'full', command: bestMatch};
       },
@@ -1380,7 +1426,7 @@
         } else {
           if (vim.visualMode) {
             showPrompt(cm, { onClose: onPromptClose, prefix: ':', value: '\'<,\'>',
-                onKeyDown: onPromptKeyDown});
+                onKeyDown: onPromptKeyDown, selectValueOnOpen: false});
           } else {
             showPrompt(cm, { onClose: onPromptClose, prefix: ':',
                 onKeyDown: onPromptKeyDown});
@@ -1627,9 +1673,8 @@
         return findNext(cm, prev/** prev */, query, motionArgs.repeat);
       },
       goToMark: function(cm, _head, motionArgs, vim) {
-        var mark = vim.marks[motionArgs.selectedCharacter];
-        if (mark) {
-          var pos = mark.find();
+        var pos = getMarkPos(cm, vim, motionArgs.selectedCharacter);
+        if (pos) {
           return motionArgs.linewise ? { line: pos.line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(pos.line)) } : pos;
         }
         return null;
@@ -1837,16 +1882,16 @@
         var ch = cursor.ch;
         var lineText = cm.getLine(line);
         var symbol;
-        do {
-          symbol = lineText.charAt(ch++);
+        for (; ch < lineText.length; ch++) {
+          symbol = lineText.charAt(ch);
           if (symbol && isMatchableSymbol(symbol)) {
-            var style = cm.getTokenTypeAt(Pos(line, ch));
+            var style = cm.getTokenTypeAt(Pos(line, ch + 1));
             if (style !== "string" && style !== "comment") {
               break;
             }
           }
-        } while (symbol);
-        if (symbol) {
+        }
+        if (ch < lineText.length) {
           var matched = cm.findMatchingBracket(Pos(line, ch));
           return matched.to;
         } else {
@@ -2036,7 +2081,8 @@
         vimGlobalState.registerController.pushText(
             args.registerName, 'delete', text,
             args.linewise, vim.visualBlock);
-        return clipCursorToContent(cm, finalHead);
+        var includeLineBreak = vim.insertMode
+        return clipCursorToContent(cm, finalHead, includeLineBreak);
       },
       indent: function(cm, args, ranges) {
         var vim = cm.state.vim;
@@ -2187,7 +2233,9 @@
       enterMacroRecordMode: function(cm, actionArgs) {
         var macroModeState = vimGlobalState.macroModeState;
         var registerName = actionArgs.selectedCharacter;
-        macroModeState.enterMacroRecordMode(cm, registerName);
+        if (vimGlobalState.registerController.isValidRegister(registerName)) {
+          macroModeState.enterMacroRecordMode(cm, registerName);
+        }
       },
       toggleOverwrite: function(cm) {
         if (!cm.state.overwrite) {
@@ -2589,25 +2637,32 @@
       incrementNumberToken: function(cm, actionArgs) {
         var cur = cm.getCursor();
         var lineStr = cm.getLine(cur.line);
-        var re = /-?\d+/g;
+        var re = /(-?)(?:(0x)([\da-f]+)|(0b|0|)(\d+))/gi;
         var match;
         var start;
         var end;
         var numberStr;
-        var token;
         while ((match = re.exec(lineStr)) !== null) {
-          token = match[0];
           start = match.index;
-          end = start + token.length;
+          end = start + match[0].length;
           if (cur.ch < end)break;
         }
         if (!actionArgs.backtrack && (end <= cur.ch))return;
-        if (token) {
+        if (match) {
+          var baseStr = match[2] || match[4]
+          var digits = match[3] || match[5]
           var increment = actionArgs.increase ? 1 : -1;
-          var number = parseInt(token) + (increment * actionArgs.repeat);
+          var base = {'0b': 2, '0': 8, '': 10, '0x': 16}[baseStr.toLowerCase()];
+          var number = parseInt(match[1] + digits, base) + (increment * actionArgs.repeat);
+          numberStr = number.toString(base);
+          var zeroPadding = baseStr ? new Array(digits.length - numberStr.length + 1 + match[1].length).join('0') : ''
+          if (numberStr.charAt(0) === '-') {
+            numberStr = '-' + baseStr + zeroPadding + numberStr.substr(1);
+          } else {
+            numberStr = baseStr + zeroPadding + numberStr;
+          }
           var from = Pos(cur.line, start);
           var to = Pos(cur.line, end);
-          numberStr = number.toString();
           cm.replaceRange(numberStr, from, to);
         } else {
           return;
@@ -2705,7 +2760,7 @@
       }
     }
     function lastChar(keys) {
-      var match = /^.*(<[\w\-]+>)$/.exec(keys);
+      var match = /^.*(<[^>]+>)$/.exec(keys);
       var selectedCharacter = match ? match[1] : keys.slice(-1);
       if (selectedCharacter.length > 1){
         switch(selectedCharacter){
@@ -2716,6 +2771,7 @@
             selectedCharacter=' ';
             break;
           default:
+            selectedCharacter='';
             break;
         }
       }
@@ -2816,7 +2872,6 @@
         var range = {anchor: new Pos(line, baseCh), head: new Pos(line, headCh)};
         selections.push(range);
       }
-      primIndex = head.line == lastLine ? selections.length - 1 : 0;
       cm.setSelections(selections);
       selectionEnd.ch = headCh;
       base.ch = baseCh;
@@ -3244,7 +3299,7 @@
       return cur;
     }
 
-    /**
+    /*
      * Returns the boundaries of the next word. If the cursor in the middle of
      * the word, then returns the boundaries of the current word, starting at
      * the cursor. If the cursor is at the start/end of a word, and we are going
@@ -3628,7 +3683,15 @@
       }
     }
     function splitBySlash(argString) {
-      var slashes = findUnescapedSlashes(argString) || [];
+      return splitBySeparator(argString, '/');
+    }
+
+    function findUnescapedSlashes(argString) {
+      return findUnescapedSeparators(argString, '/');
+    }
+
+    function splitBySeparator(argString, separator) {
+      var slashes = findUnescapedSeparators(argString, separator) || [];
       if (!slashes.length) return [];
       var tokens = [];
       // in case of strings like foo/bar
@@ -3640,12 +3703,15 @@
       return tokens;
     }
 
-    function findUnescapedSlashes(str) {
+    function findUnescapedSeparators(str, separator) {
+      if (!separator)
+        separator = '/';
+
       var escapeNextChar = false;
       var slashes = [];
       for (var i = 0; i < str.length; i++) {
         var c = str.charAt(i);
-        if (!escapeNextChar && c == '/') {
+        if (!escapeNextChar && c == separator) {
           slashes.push(i);
         }
         escapeNextChar = !escapeNextChar && (c == '\\');
@@ -3973,6 +4039,26 @@
       return {top: from.line, bottom: to.line};
     }
 
+    function getMarkPos(cm, vim, markName) {
+      if (markName == '\'') {
+        var history = cm.doc.history.done;
+        var event = history[history.length - 2];
+        return event && event.ranges && event.ranges[0].head;
+      } else if (markName == '.') {
+        if (cm.doc.history.lastModTime == 0) {
+          return  // If no changes, bail out; don't bother to copy or reverse history array.
+        } else {
+          var changeHistory = cm.doc.history.done.filter(function(el){ if (el.changes !== undefined) { return el } });
+          changeHistory.reverse();
+          var lastEditPos = changeHistory[0].changes[0].to;
+        }
+        return lastEditPos;
+      }
+
+      var mark = vim.marks[markName];
+      return mark && mark.find();
+    }
+
     var ExCommandDispatcher = function() {
       this.buildCommandMap_();
     };
@@ -4073,24 +4159,42 @@
       parseLineSpec_: function(cm, inputStream) {
         var numberMatch = inputStream.match(/^(\d+)/);
         if (numberMatch) {
+          // Absolute line number plus offset (N+M or N-M) is probably a typo,
+          // not something the user actually wanted. (NB: vim does allow this.)
           return parseInt(numberMatch[1], 10) - 1;
         }
         switch (inputStream.next()) {
           case '.':
-            return cm.getCursor().line;
+            return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);
           case '$':
-            return cm.lastLine();
+            return this.parseLineSpecOffset_(inputStream, cm.lastLine());
           case '\'':
-            var mark = cm.state.vim.marks[inputStream.next()];
-            if (mark && mark.find()) {
-              return mark.find().line;
-            }
-            throw new Error('Mark not set');
+            var markName = inputStream.next();
+            var markPos = getMarkPos(cm, cm.state.vim, markName);
+            if (!markPos) throw new Error('Mark not set');
+            return this.parseLineSpecOffset_(inputStream, markPos.line);
+          case '-':
+          case '+':
+            inputStream.backUp(1);
+            // Offset is relative to current line if not otherwise specified.
+            return this.parseLineSpecOffset_(inputStream, cm.getCursor().line);
           default:
             inputStream.backUp(1);
             return undefined;
         }
       },
+      parseLineSpecOffset_: function(inputStream, line) {
+        var offsetMatch = inputStream.match(/^([+-])?(\d+)/);
+        if (offsetMatch) {
+          var offset = parseInt(offsetMatch[2], 10);
+          if (offsetMatch[1] == "-") {
+            line -= offset;
+          } else {
+            line += offset;
+          }
+        }
+        return line;
+      },
       parseCommandArgs_: function(inputStream, params, command) {
         if (inputStream.eol()) {
           return;
@@ -4270,13 +4374,18 @@
         // If no value is provided, then we assume this is a get.
         if (!optionIsBoolean && value === undefined || forceGet) {
           var oldValue = getOption(optionName, cm, setCfg);
-          if (oldValue === true || oldValue === false) {
+          if (oldValue instanceof Error) {
+            showConfirm(cm, oldValue.message);
+          } else if (oldValue === true || oldValue === false) {
             showConfirm(cm, ' ' + (oldValue ? '' : 'no') + optionName);
           } else {
             showConfirm(cm, '  ' + optionName + '=' + oldValue);
           }
         } else {
-          setOption(optionName, value, cm, setCfg);
+          var setOptionReturn = setOption(optionName, value, cm, setCfg);
+          if (setOptionReturn instanceof Error) {
+            showConfirm(cm, setOptionReturn.message);
+          }
         }
       },
       setlocal: function (cm, params) {
@@ -4468,13 +4577,17 @@
               'any other getSearchCursor implementation.');
         }
         var argString = params.argString;
-        var tokens = argString ? splitBySlash(argString) : [];
+        var tokens = argString ? splitBySeparator(argString, argString[0]) : [];
         var regexPart, replacePart = '', trailing, flagsPart, count;
         var confirm = false; // Whether to confirm each replace.
         var global = false; // True to replace all instances on a line, false to replace only 1.
         if (tokens.length) {
           regexPart = tokens[0];
           replacePart = tokens[1];
+          if (regexPart && regexPart[regexPart.length - 1] === '$') {
+            regexPart = regexPart.slice(0, regexPart.length - 1) + '\\n';
+            replacePart = replacePart ? replacePart + '\n' : '\n';
+          }
           if (replacePart !== undefined) {
             if (getOption('pcre')) {
               replacePart = unescapeRegexReplace(replacePart);
@@ -4508,7 +4621,7 @@
               global = true;
               flagsPart.replace('g', '');
             }
-            regexPart = regexPart + '/' + flagsPart;
+            regexPart = regexPart.replace(/\//g, "\\/") + '/' + flagsPart;
           }
         }
         if (regexPart) {
@@ -4724,7 +4837,7 @@
       }
       if (!confirm) {
         replaceAll();
-        if (callback) { callback(); };
+        if (callback) { callback(); }
         return;
       }
       showPrompt(cm, {
@@ -4750,7 +4863,8 @@
       // so as to update the ". register as expected in real vim.
       var text = [];
       if (!isPlaying) {
-        var selLength = lastChange.inVisualBlock ? vim.lastSelection.visualBlock.height : 1;
+        var selLength = lastChange.inVisualBlock && vim.lastSelection ?
+            vim.lastSelection.visualBlock.height : 1;
         var changes = lastChange.changes;
         var text = [];
         var i = 0;
@@ -4859,7 +4973,7 @@
             exitInsertMode(cm);
           }
         }
-      };
+      }
       macroModeState.isPlaying = false;
     }
 
@@ -4894,7 +5008,7 @@
      * Listens for changes made in insert mode.
      * Should only be active in insert mode.
      */
-    function onChange(_cm, changeObj) {
+    function onChange(cm, changeObj) {
       var macroModeState = vimGlobalState.macroModeState;
       var lastChange = macroModeState.lastInsertModeChanges;
       if (!macroModeState.isPlaying) {
@@ -4907,7 +5021,11 @@
               lastChange.changes = [];
               lastChange.maybeReset = false;
             }
-            lastChange.changes.push(text);
+            if (cm.state.overwrite && !/\n/.test(text)) {
+                lastChange.changes.push([text]);
+            } else {
+                lastChange.changes.push(text);
+            }
           }
           // Change objects may be chained with next.
           changeObj = changeObj.next;
@@ -5059,7 +5177,7 @@
         exitInsertMode(cm);
       }
       macroModeState.isPlaying = false;
-    };
+    }
 
     function repeatInsertModeChanges(cm, changes, repeat) {
       function keyHandler(binding) {
@@ -5089,9 +5207,13 @@
           var change = changes[j];
           if (change instanceof InsertModeKey) {
             CodeMirror.lookupKey(change.keyName, 'vim-insert', keyHandler);
-          } else {
+          } else if (typeof change == "string") {
             var cur = cm.getCursor();
             cm.replaceRange(change, cur, cur);
+          } else {
+            var start = cm.getCursor();
+            var end = offsetCursor(start, 0, change[0].length);
+            cm.replaceRange(change[0], start, end);
           }
         }
       }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.css.css
index 2a6a262282ba47706e32b8d7a52062c5c9392a8c..c7a8ae70478fc8f253524bb64c0094766f191c1b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.css.css
@@ -5,6 +5,7 @@
   font-family: monospace;
   height: 300px;
   color: black;
+  direction: ltr;
 }
 
 /* PADDING */
@@ -58,7 +59,12 @@
 .cm-fat-cursor div.CodeMirror-cursors {
   z-index: 1;
 }
-
+.cm-fat-cursor-mark {
+  background-color: rgba(20, 255, 20, 0.5);
+  -webkit-animation: blink 1.06s steps(1) infinite;
+  -moz-animation: blink 1.06s steps(1) infinite;
+  animation: blink 1.06s steps(1) infinite;
+}
 .cm-animate-fat-cursor {
   width: auto;
   border: 0;
@@ -119,7 +125,7 @@
 .cm-s-default .cm-property,
 .cm-s-default .cm-operator {}
 .cm-s-default .cm-variable-2 {color: #05a;}
-.cm-s-default .cm-variable-3 {color: #085;}
+.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;}
 .cm-s-default .cm-comment {color: #a50;}
 .cm-s-default .cm-string {color: #a11;}
 .cm-s-default .cm-string-2 {color: #f50;}
@@ -139,8 +145,8 @@
 
 /* Default styles for common addons */
 
-div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
-div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
+div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;}
+div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;}
 .CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
 .CodeMirror-activeline-background {background: #e8f2ff;}
 
@@ -223,11 +229,8 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
   cursor: default;
   z-index: 4;
 }
-.CodeMirror-gutter-wrapper {
-  -webkit-user-select: none;
-  -moz-user-select: none;
-  user-select: none;
-}
+.CodeMirror-gutter-wrapper ::selection { background-color: transparent }
+.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent }
 
 .CodeMirror-lines {
   cursor: text;
@@ -267,11 +270,13 @@ div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
 .CodeMirror-linewidget {
   position: relative;
   z-index: 2;
-  overflow: auto;
+  padding: 0.1px; /* Force widget margins to stay inside of the container */
 }
 
 .CodeMirror-widget {}
 
+.CodeMirror-rtl pre { direction: rtl; }
+
 .CodeMirror-code {
   outline: none;
 }
@@ -320,8 +325,8 @@ div.CodeMirror-dragcursors {
 .CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; }
 
 .cm-searching {
-  background: #ffa;
-  background: rgba(255, 255, 0, .4);
+  background-color: #ffa;
+  background-color: rgba(255, 255, 0, .4);
 }
 
 /* Used to force a border model for a node */
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.css.xml
index 5ec9239269b9e48bf12b5946da9eddef5475f848..e3eaf226f2aa0bfa1316c5c021f05346ad50c2d3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>codemirror.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.js.js
index 6b312bde8fbdbb141c9f17c1b09c89f93614f354..56f7a12000e9e8048bb0a07a8c5daa503d14710d 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/lib/codemirror.js.js
@@ -33,8 +33,9 @@ var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent)
 var phantom = /PhantomJS/.test(userAgent)
 
 var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent)
+var android = /Android/.test(userAgent)
 // This is woefully incomplete. Suggestions for alternative methods welcome.
-var mobile = ios || /Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
+var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent)
 var mac = ios || /Mac/.test(platform)
 var chromeOS = /\bCrOS\b/.test(userAgent)
 var windows = /win/i.test(platform)
@@ -75,6 +76,12 @@ function elt(tag, content, className, style) {
   else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]) } }
   return e
 }
+// wrapper for elt, which removes the elt from the accessibility tree
+function eltP(tag, content, className, style) {
+  var e = elt(tag, content, className, style)
+  e.setAttribute("role", "presentation")
+  return e
+}
 
 var range
 if (document.createRange) { range = function(node, start, end, endNode) {
@@ -114,8 +121,8 @@ function activeElt() {
   } catch(e) {
     activeElement = document.body || null
   }
-  while (activeElement && activeElement.root && activeElement.root.activeElement)
-    { activeElement = activeElement.root.activeElement }
+  while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement)
+    { activeElement = activeElement.shadowRoot.activeElement }
   return activeElement
 }
 
@@ -271,13 +278,18 @@ function skipExtendingChars(str, pos, dir) {
 }
 
 // Returns the value from the range [`from`; `to`] that satisfies
-// `pred` and is closest to `from`. Assumes that at least `to` satisfies `pred`.
+// `pred` and is closest to `from`. Assumes that at least `to`
+// satisfies `pred`. Supports `from` being greater than `to`.
 function findFirst(pred, from, to) {
+  // At any point we are certain `to` satisfies `pred`, don't know
+  // whether `from` does.
+  var dir = from > to ? -1 : 1
   for (;;) {
-    if (Math.abs(from - to) <= 1) { return pred(from) ? from : to }
-    var mid = Math.floor((from + to) / 2)
+    if (from == to) { return from }
+    var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF)
+    if (mid == from) { return pred(mid) ? from : to }
     if (pred(mid)) { to = mid }
-    else { from = mid }
+    else { from = mid + dir }
   }
 }
 
@@ -297,7 +309,7 @@ function Display(place, doc, input) {
   d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler")
   d.gutterFiller.setAttribute("cm-not-content", "true")
   // Will contain the actual code, positioned to cover the viewport.
-  d.lineDiv = elt("div", null, "CodeMirror-code")
+  d.lineDiv = eltP("div", null, "CodeMirror-code")
   // Elements are added to these to represent selection and cursors.
   d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1")
   d.cursorDiv = elt("div", null, "CodeMirror-cursors")
@@ -306,10 +318,11 @@ function Display(place, doc, input) {
   // When lines outside of the viewport are measured, they are drawn in this.
   d.lineMeasure = elt("div", null, "CodeMirror-measure")
   // Wraps everything that needs to exist inside the vertically-padded coordinate system
-  d.lineSpace = elt("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
+  d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],
                     null, "position: relative; outline: none")
+  var lines = eltP("div", [d.lineSpace], "CodeMirror-lines")
   // Moved around its parent to cover visible view.
-  d.mover = elt("div", [elt("div", [d.lineSpace], "CodeMirror-lines")], null, "position: relative")
+  d.mover = elt("div", [lines], null, "position: relative")
   // Set to the height of the document, allowing scrolling.
   d.sizer = elt("div", [d.mover], "CodeMirror-sizer")
   d.sizerWidth = null
@@ -889,12 +902,12 @@ function findMaxLine(cm) {
 // BIDI HELPERS
 
 function iterateBidiSections(order, from, to, f) {
-  if (!order) { return f(from, to, "ltr") }
+  if (!order) { return f(from, to, "ltr", 0) }
   var found = false
   for (var i = 0; i < order.length; ++i) {
     var part = order[i]
     if (part.from < to && part.to > from || from == to && part.to == from) {
-      f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr")
+      f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i)
       found = true
     }
   }
@@ -960,16 +973,16 @@ var bidiOrdering = (function() {
 
   var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/
   var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/
-  // Browsers seem to always treat the boundaries of block elements as being L.
-  var outerType = "L"
 
   function BidiSpan(level, from, to) {
     this.level = level
     this.from = from; this.to = to
   }
 
-  return function(str) {
-    if (!bidiRE.test(str)) { return false }
+  return function(str, direction) {
+    var outerType = direction == "ltr" ? "L" : "R"
+
+    if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false }
     var len = str.length, types = []
     for (var i = 0; i < len; ++i)
       { types.push(charType(str.charCodeAt(i))) }
@@ -1043,7 +1056,7 @@ var bidiOrdering = (function() {
         for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {}
         var before = (i$6 ? types[i$6-1] : outerType) == "L"
         var after = (end$1 < len ? types[end$1] : outerType) == "L"
-        var replace$1 = before || after ? "L" : "R"
+        var replace$1 = before == after ? (before ? "L" : "R") : outerType
         for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1 }
         i$6 = end$1 - 1
       }
@@ -1075,133 +1088,30 @@ var bidiOrdering = (function() {
         if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)) }
       }
     }
-    if (order[0].level == 1 && (m = str.match(/^\s+/))) {
-      order[0].from = m[0].length
-      order.unshift(new BidiSpan(0, 0, m[0].length))
-    }
-    if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
-      lst(order).to -= m[0].length
-      order.push(new BidiSpan(0, len - m[0].length, len))
+    if (direction == "ltr") {
+      if (order[0].level == 1 && (m = str.match(/^\s+/))) {
+        order[0].from = m[0].length
+        order.unshift(new BidiSpan(0, 0, m[0].length))
+      }
+      if (lst(order).level == 1 && (m = str.match(/\s+$/))) {
+        lst(order).to -= m[0].length
+        order.push(new BidiSpan(0, len - m[0].length, len))
+      }
     }
 
-    return order
+    return direction == "rtl" ? order.reverse() : order
   }
 })()
 
 // Get the bidi ordering for the given line (and cache it). Returns
 // false for lines that are fully left-to-right, and an array of
 // BidiSpan objects otherwise.
-function getOrder(line) {
+function getOrder(line, direction) {
   var order = line.order
-  if (order == null) { order = line.order = bidiOrdering(line.text) }
+  if (order == null) { order = line.order = bidiOrdering(line.text, direction) }
   return order
 }
 
-function moveCharLogically(line, ch, dir) {
-  var target = skipExtendingChars(line.text, ch + dir, dir)
-  return target < 0 || target > line.text.length ? null : target
-}
-
-function moveLogically(line, start, dir) {
-  var ch = moveCharLogically(line, start.ch, dir)
-  return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before")
-}
-
-function endOfLine(visually, cm, lineObj, lineNo, dir) {
-  if (visually) {
-    var order = getOrder(lineObj)
-    if (order) {
-      var part = dir < 0 ? lst(order) : order[0]
-      var moveInStorageOrder = (dir < 0) == (part.level == 1)
-      var sticky = moveInStorageOrder ? "after" : "before"
-      var ch
-      // With a wrapped rtl chunk (possibly spanning multiple bidi parts),
-      // it could be that the last bidi part is not on the last visual line,
-      // since visual lines contain content order-consecutive chunks.
-      // Thus, in rtl, we are looking for the first (content-order) character
-      // in the rtl chunk that is on the last line (that is, the same line
-      // as the last (content-order) character).
-      if (part.level > 0) {
-        var prep = prepareMeasureForLine(cm, lineObj)
-        ch = dir < 0 ? lineObj.text.length - 1 : 0
-        var targetTop = measureCharPrepared(cm, prep, ch).top
-        ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch)
-        if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1, true) }
-      } else { ch = dir < 0 ? part.to : part.from }
-      return new Pos(lineNo, ch, sticky)
-    }
-  }
-  return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after")
-}
-
-function moveVisually(cm, line, start, dir) {
-  var bidi = getOrder(line)
-  if (!bidi) { return moveLogically(line, start, dir) }
-  if (start.ch >= line.text.length) {
-    start.ch = line.text.length
-    start.sticky = "before"
-  } else if (start.ch <= 0) {
-    start.ch = 0
-    start.sticky = "after"
-  }
-  var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]
-  if (part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {
-    // Case 1: We move within an ltr part. Even with wrapped lines,
-    // nothing interesting happens.
-    return moveLogically(line, start, dir)
-  }
-
-  var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }
-  var prep
-  var getWrappedLineExtent = function (ch) {
-    if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }
-    prep = prep || prepareMeasureForLine(cm, line)
-    return wrappedLineExtentChar(cm, line, prep, ch)
-  }
-  var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch)
-
-  if (part.level % 2 == 1) {
-    var ch = mv(start, -dir)
-    if (ch != null && (dir > 0 ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {
-      // Case 2: We move within an rtl part on the same visual line
-      var sticky = dir < 0 ? "before" : "after"
-      return new Pos(start.line, ch, sticky)
-    }
-  }
-
-  // Case 3: Could not move within this bidi part in this visual line, so leave
-  // the current bidi part
-
-  var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
-    var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
-      ? new Pos(start.line, mv(ch, 1), "before")
-      : new Pos(start.line, ch, "after"); }
-
-    for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
-      var part = bidi[partPos]
-      var moveInStorageOrder = (dir > 0) == (part.level != 1)
-      var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1)
-      if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
-      ch = moveInStorageOrder ? part.from : mv(part.to, -1)
-      if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
-    }
-  }
-
-  // Case 3a: Look for other bidi parts on the same visual line
-  var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent)
-  if (res) { return res }
-
-  // Case 3b: Look for other bidi parts on the next visual line
-  var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1)
-  if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {
-    res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh))
-    if (res) { return res }
-  }
-
-  // Case 4: Nowhere to move
-  return null
-}
-
 // EVENT HANDLING
 
 // Lightweight event framework. on/off also work on DOM nodes,
@@ -1484,12 +1394,13 @@ function startState(mode, a1, a2) {
 // Fed to the mode parsers, provides helper functions to make
 // parsers more succinct.
 
-var StringStream = function(string, tabSize) {
+var StringStream = function(string, tabSize, lineOracle) {
   this.pos = this.start = 0
   this.string = string
   this.tabSize = tabSize || 8
   this.lastColumnPos = this.lastColumnValue = 0
   this.lineStart = 0
+  this.lineOracle = lineOracle
 };
 
 StringStream.prototype.eol = function () {return this.pos >= this.string.length};
@@ -1556,23 +1467,83 @@ StringStream.prototype.hideFirstChars = function (n, inner) {
   try { return inner() }
   finally { this.lineStart -= n }
 };
+StringStream.prototype.lookAhead = function (n) {
+  var oracle = this.lineOracle
+  return oracle && oracle.lookAhead(n)
+};
+StringStream.prototype.baseToken = function () {
+  var oracle = this.lineOracle
+  return oracle && oracle.baseToken(this.pos)
+};
+
+var SavedContext = function(state, lookAhead) {
+  this.state = state
+  this.lookAhead = lookAhead
+};
+
+var Context = function(doc, state, line, lookAhead) {
+  this.state = state
+  this.doc = doc
+  this.line = line
+  this.maxLookAhead = lookAhead || 0
+  this.baseTokens = null
+  this.baseTokenPos = 1
+};
+
+Context.prototype.lookAhead = function (n) {
+  var line = this.doc.getLine(this.line + n)
+  if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n }
+  return line
+};
+
+Context.prototype.baseToken = function (n) {
+    var this$1 = this;
+
+  if (!this.baseTokens) { return null }
+  while (this.baseTokens[this.baseTokenPos] <= n)
+    { this$1.baseTokenPos += 2 }
+  var type = this.baseTokens[this.baseTokenPos + 1]
+  return {type: type && type.replace(/( |^)overlay .*/, ""),
+          size: this.baseTokens[this.baseTokenPos] - n}
+};
+
+Context.prototype.nextLine = function () {
+  this.line++
+  if (this.maxLookAhead > 0) { this.maxLookAhead-- }
+};
+
+Context.fromSaved = function (doc, saved, line) {
+  if (saved instanceof SavedContext)
+    { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) }
+  else
+    { return new Context(doc, copyState(doc.mode, saved), line) }
+};
+
+Context.prototype.save = function (copy) {
+  var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state
+  return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state
+};
+
 
 // Compute a style array (an array starting with a mode generation
 // -- for invalidation -- followed by pairs of end positions and
 // style strings), which is used to highlight the tokens on the
 // line.
-function highlightLine(cm, line, state, forceToEnd) {
+function highlightLine(cm, line, context, forceToEnd) {
   // A styles array always starts with a number identifying the
   // mode/overlays that it is based on (for easy invalidation).
   var st = [cm.state.modeGen], lineClasses = {}
   // Compute the base array of styles
-  runMode(cm, line.text, cm.doc.mode, state, function (end, style) { return st.push(end, style); },
-    lineClasses, forceToEnd)
+  runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); },
+          lineClasses, forceToEnd)
+  var state = context.state
 
   // Run overlays, adjust style array.
   var loop = function ( o ) {
+    context.baseTokens = st
     var overlay = cm.state.overlays[o], i = 1, at = 0
-    runMode(cm, line.text, overlay.mode, true, function (end, style) {
+    context.state = true
+    runMode(cm, line.text, overlay.mode, context, function (end, style) {
       var start = i
       // Ensure there's a token end at the current position, and that i points at it
       while (at < end) {
@@ -1593,6 +1564,9 @@ function highlightLine(cm, line, state, forceToEnd) {
         }
       }
     }, lineClasses)
+    context.state = state
+    context.baseTokens = null
+    context.baseTokenPos = 1
   };
 
   for (var o = 0; o < cm.state.overlays.length; ++o) loop( o );
@@ -1602,43 +1576,47 @@ function highlightLine(cm, line, state, forceToEnd) {
 
 function getLineStyles(cm, line, updateFrontier) {
   if (!line.styles || line.styles[0] != cm.state.modeGen) {
-    var state = getStateBefore(cm, lineNo(line))
-    var result = highlightLine(cm, line, line.text.length > cm.options.maxHighlightLength ? copyState(cm.doc.mode, state) : state)
-    line.stateAfter = state
+    var context = getContextBefore(cm, lineNo(line))
+    var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state)
+    var result = highlightLine(cm, line, context)
+    if (resetState) { context.state = resetState }
+    line.stateAfter = context.save(!resetState)
     line.styles = result.styles
     if (result.classes) { line.styleClasses = result.classes }
     else if (line.styleClasses) { line.styleClasses = null }
-    if (updateFrontier === cm.doc.frontier) { cm.doc.frontier++ }
+    if (updateFrontier === cm.doc.highlightFrontier)
+      { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier) }
   }
   return line.styles
 }
 
-function getStateBefore(cm, n, precise) {
+function getContextBefore(cm, n, precise) {
   var doc = cm.doc, display = cm.display
-  if (!doc.mode.startState) { return true }
-  var pos = findStartLine(cm, n, precise), state = pos > doc.first && getLine(doc, pos-1).stateAfter
-  if (!state) { state = startState(doc.mode) }
-  else { state = copyState(doc.mode, state) }
-  doc.iter(pos, n, function (line) {
-    processLine(cm, line.text, state)
-    var save = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo
-    line.stateAfter = save ? copyState(doc.mode, state) : null
-    ++pos
+  if (!doc.mode.startState) { return new Context(doc, true, n) }
+  var start = findStartLine(cm, n, precise)
+  var saved = start > doc.first && getLine(doc, start - 1).stateAfter
+  var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start)
+
+  doc.iter(start, n, function (line) {
+    processLine(cm, line.text, context)
+    var pos = context.line
+    line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null
+    context.nextLine()
   })
-  if (precise) { doc.frontier = pos }
-  return state
+  if (precise) { doc.modeFrontier = context.line }
+  return context
 }
 
 // Lightweight form of highlight -- proceed over this line and
 // update state, but don't save a style array. Used for lines that
 // aren't currently visible.
-function processLine(cm, text, state, startAt) {
+function processLine(cm, text, context, startAt) {
   var mode = cm.doc.mode
-  var stream = new StringStream(text, cm.options.tabSize)
+  var stream = new StringStream(text, cm.options.tabSize, context)
   stream.start = stream.pos = startAt || 0
-  if (text == "") { callBlankLine(mode, state) }
+  if (text == "") { callBlankLine(mode, context.state) }
   while (!stream.eol()) {
-    readToken(mode, stream, state)
+    readToken(mode, stream, context.state)
     stream.start = stream.pos
   }
 }
@@ -1659,26 +1637,26 @@ function readToken(mode, stream, state, inner) {
   throw new Error("Mode " + mode.name + " failed to advance stream.")
 }
 
+var Token = function(stream, type, state) {
+  this.start = stream.start; this.end = stream.pos
+  this.string = stream.current()
+  this.type = type || null
+  this.state = state
+};
+
 // Utility for getTokenAt and getLineTokens
 function takeToken(cm, pos, precise, asArray) {
-  var getObj = function (copy) { return ({
-    start: stream.start, end: stream.pos,
-    string: stream.current(),
-    type: style || null,
-    state: copy ? copyState(doc.mode, state) : state
-  }); }
-
   var doc = cm.doc, mode = doc.mode, style
   pos = clipPos(doc, pos)
-  var line = getLine(doc, pos.line), state = getStateBefore(cm, pos.line, precise)
-  var stream = new StringStream(line.text, cm.options.tabSize), tokens
+  var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise)
+  var stream = new StringStream(line.text, cm.options.tabSize, context), tokens
   if (asArray) { tokens = [] }
   while ((asArray || stream.pos < pos.ch) && !stream.eol()) {
     stream.start = stream.pos
-    style = readToken(mode, stream, state)
-    if (asArray) { tokens.push(getObj(true)) }
+    style = readToken(mode, stream, context.state)
+    if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))) }
   }
-  return asArray ? tokens : getObj()
+  return asArray ? tokens : new Token(stream, style, context.state)
 }
 
 function extractLineClasses(type, output) {
@@ -1696,21 +1674,21 @@ function extractLineClasses(type, output) {
 }
 
 // Run the given mode's parser over a line, calling f for each token.
-function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {
+function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) {
   var flattenSpans = mode.flattenSpans
   if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans }
   var curStart = 0, curStyle = null
-  var stream = new StringStream(text, cm.options.tabSize), style
+  var stream = new StringStream(text, cm.options.tabSize, context), style
   var inner = cm.options.addModeClass && [null]
-  if (text == "") { extractLineClasses(callBlankLine(mode, state), lineClasses) }
+  if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses) }
   while (!stream.eol()) {
     if (stream.pos > cm.options.maxHighlightLength) {
       flattenSpans = false
-      if (forceToEnd) { processLine(cm, text, state, stream.pos) }
+      if (forceToEnd) { processLine(cm, text, context, stream.pos) }
       stream.pos = text.length
       style = null
     } else {
-      style = extractLineClasses(readToken(mode, stream, state, inner), lineClasses)
+      style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses)
     }
     if (inner) {
       var mName = inner[0].name
@@ -1745,8 +1723,9 @@ function findStartLine(cm, n, precise) {
   var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100)
   for (var search = n; search > lim; --search) {
     if (search <= doc.first) { return doc.first }
-    var line = getLine(doc, search - 1)
-    if (line.stateAfter && (!precise || search <= doc.frontier)) { return search }
+    var line = getLine(doc, search - 1), after = line.stateAfter
+    if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier))
+      { return search }
     var indented = countColumn(line.text, null, cm.options.tabSize)
     if (minline == null || minindent > indented) {
       minline = search - 1
@@ -1756,6 +1735,23 @@ function findStartLine(cm, n, precise) {
   return minline
 }
 
+function retreatFrontier(doc, n) {
+  doc.modeFrontier = Math.min(doc.modeFrontier, n)
+  if (doc.highlightFrontier < n - 10) { return }
+  var start = doc.first
+  for (var line = n - 1; line > start; line--) {
+    var saved = getLine(doc, line).stateAfter
+    // change is on 3
+    // state on line 1 looked ahead 2 -- so saw 3
+    // test 1 + 2 < 3 should cover this
+    if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) {
+      start = line + 1
+      break
+    }
+  }
+  doc.highlightFrontier = Math.min(doc.highlightFrontier, start)
+}
+
 // LINE DATA STRUCTURE
 
 // Line objects. These hold state related to a line, including
@@ -1810,14 +1806,11 @@ function buildLineContent(cm, lineView) {
   // The padding-right forces the element to have a 'border', which
   // is needed on Webkit to be able to get line-level bounding
   // rectangles for it (in measureChar).
-  var content = elt("span", null, null, webkit ? "padding-right: .1px" : null)
-  var builder = {pre: elt("pre", [content], "CodeMirror-line"), content: content,
+  var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null)
+  var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content,
                  col: 0, pos: 0, cm: cm,
                  trailingSpace: false,
                  splitSpaces: (ie || webkit) && cm.getOption("lineWrapping")}
-  // hide from accessibility tree
-  content.setAttribute("role", "presentation")
-  builder.pre.setAttribute("role", "presentation")
   lineView.measure = {}
 
   // Iterate over the logical lines that make up this visual line.
@@ -1827,7 +1820,7 @@ function buildLineContent(cm, lineView) {
     builder.addToken = buildToken
     // Optionally wire in some hacks into the token-rendering
     // algorithm, to deal with browser quirks.
-    if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line)))
+    if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction)))
       { builder.addToken = buildTokenBadBidi(builder.addToken, order) }
     builder.map = []
     var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line)
@@ -2168,7 +2161,7 @@ function updateLineForChanges(cm, lineView, lineN, dims) {
     var type = lineView.changes[j]
     if (type == "text") { updateLineText(cm, lineView) }
     else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims) }
-    else if (type == "class") { updateLineClasses(lineView) }
+    else if (type == "class") { updateLineClasses(cm, lineView) }
     else if (type == "widget") { updateLineWidgets(cm, lineView, dims) }
   }
   lineView.changes = null
@@ -2187,7 +2180,7 @@ function ensureLineWrapped(lineView) {
   return lineView.node
 }
 
-function updateLineBackground(lineView) {
+function updateLineBackground(cm, lineView) {
   var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass
   if (cls) { cls += " CodeMirror-linebackground" }
   if (lineView.background) {
@@ -2196,6 +2189,7 @@ function updateLineBackground(lineView) {
   } else if (cls) {
     var wrap = ensureLineWrapped(lineView)
     lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild)
+    cm.display.input.setUneditable(lineView.background)
   }
 }
 
@@ -2223,14 +2217,14 @@ function updateLineText(cm, lineView) {
   if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) {
     lineView.bgClass = built.bgClass
     lineView.textClass = built.textClass
-    updateLineClasses(lineView)
+    updateLineClasses(cm, lineView)
   } else if (cls) {
     lineView.text.className = cls
   }
 }
 
-function updateLineClasses(lineView) {
-  updateLineBackground(lineView)
+function updateLineClasses(cm, lineView) {
+  updateLineBackground(cm, lineView)
   if (lineView.line.wrapClass)
     { ensureLineWrapped(lineView).className = lineView.line.wrapClass }
   else if (lineView.node != lineView.text)
@@ -2252,6 +2246,7 @@ function updateLineGutter(cm, lineView, lineN, dims) {
     var wrap = ensureLineWrapped(lineView)
     lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass,
                                     ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px"))
+    cm.display.input.setUneditable(lineView.gutterBackground)
     wrap.insertBefore(lineView.gutterBackground, lineView.text)
   }
   var markers = lineView.line.gutterMarkers
@@ -2293,7 +2288,7 @@ function buildLineElement(cm, lineView, lineN, dims) {
   if (built.bgClass) { lineView.bgClass = built.bgClass }
   if (built.textClass) { lineView.textClass = built.textClass }
 
-  updateLineClasses(lineView)
+  updateLineClasses(cm, lineView)
   updateLineGutter(cm, lineView, lineN, dims)
   insertLineWidgets(cm, lineView, dims)
   return lineView.node
@@ -2633,18 +2628,34 @@ function clearCaches(cm) {
   cm.display.lineNumChars = null
 }
 
-function pageScrollX() { return window.pageXOffset || (document.documentElement || document.body).scrollLeft }
-function pageScrollY() { return window.pageYOffset || (document.documentElement || document.body).scrollTop }
+function pageScrollX() {
+  // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206
+  // which causes page_Offset and bounding client rects to use
+  // different reference viewports and invalidate our calculations.
+  if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) }
+  return window.pageXOffset || (document.documentElement || document.body).scrollLeft
+}
+function pageScrollY() {
+  if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) }
+  return window.pageYOffset || (document.documentElement || document.body).scrollTop
+}
+
+function widgetTopHeight(lineObj) {
+  var height = 0
+  if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above)
+    { height += widgetHeight(lineObj.widgets[i]) } } }
+  return height
+}
 
 // Converts a {top, bottom, left, right} box from line-local
 // coordinates into another coordinate system. Context may be one of
 // "line", "div" (display.lineDiv), "local"./null (editor), "window",
 // or "page".
 function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) {
-  if (!includeWidgets && lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) {
-    var size = widgetHeight(lineObj.widgets[i])
-    rect.top += size; rect.bottom += size
-  } } }
+  if (!includeWidgets) {
+    var height = widgetTopHeight(lineObj)
+    rect.top += height; rect.bottom += height
+  }
   if (context == "line") { return rect }
   if (!context) { context = "local" }
   var yOff = heightAtLine(lineObj)
@@ -2708,7 +2719,7 @@ function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
     if (right) { m.left = m.right; } else { m.right = m.left }
     return intoCoordSystem(cm, lineObj, m, context)
   }
-  var order = getOrder(lineObj), ch = pos.ch, sticky = pos.sticky
+  var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky
   if (ch >= lineObj.text.length) {
     ch = lineObj.text.length
     sticky = "before"
@@ -2719,7 +2730,7 @@ function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
   if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") }
 
   function getBidi(ch, partPos, invert) {
-    var part = order[partPos], right = (part.level % 2) != 0
+    var part = order[partPos], right = part.level == 1
     return get(invert ? ch - 1 : ch, right != invert)
   }
   var partPos = getBidiPartAt(order, ch, sticky)
@@ -2777,67 +2788,147 @@ function coordsChar(cm, x, y) {
 }
 
 function wrappedLineExtent(cm, lineObj, preparedMeasure, y) {
-  var measure = function (ch) { return intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line"); }
+  y -= widgetTopHeight(lineObj)
   var end = lineObj.text.length
-  var begin = findFirst(function (ch) { return measure(ch - 1).bottom <= y; }, end, 0)
-  end = findFirst(function (ch) { return measure(ch).top > y; }, begin, end)
+  var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0)
+  end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end)
   return {begin: begin, end: end}
 }
 
 function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) {
+  if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj) }
   var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top
   return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop)
 }
 
+// Returns true if the given side of a box is after the given
+// coordinates, in top-to-bottom, left-to-right order.
+function boxIsAfter(box, x, y, left) {
+  return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x
+}
+
 function coordsCharInner(cm, lineObj, lineNo, x, y) {
+  // Move y into line-local coordinate space
   y -= heightAtLine(lineObj)
-  var begin = 0, end = lineObj.text.length
   var preparedMeasure = prepareMeasureForLine(cm, lineObj)
-  var pos
-  var order = getOrder(lineObj)
+  // When directly calling `measureCharPrepared`, we have to adjust
+  // for the widgets at this line.
+  var widgetHeight = widgetTopHeight(lineObj)
+  var begin = 0, end = lineObj.text.length, ltr = true
+
+  var order = getOrder(lineObj, cm.doc.direction)
+  // If the line isn't plain left-to-right text, first figure out
+  // which bidi section the coordinates fall into.
   if (order) {
-    if (cm.options.lineWrapping) {
-      ;var assign;
-      ((assign = wrappedLineExtent(cm, lineObj, preparedMeasure, y), begin = assign.begin, end = assign.end, assign))
-    }
-    pos = new Pos(lineNo, begin)
-    var beginLeft = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left
-    var dir = beginLeft < x ? 1 : -1
-    var prevDiff, diff = beginLeft - x, prevPos
-    do {
-      prevDiff = diff
-      prevPos = pos
-      pos = moveVisually(cm, lineObj, pos, dir)
-      if (pos == null || pos.ch < begin || end <= (pos.sticky == "before" ? pos.ch - 1 : pos.ch)) {
-        pos = prevPos
-        break
-      }
-      diff = cursorCoords(cm, pos, "line", lineObj, preparedMeasure).left - x
-    } while ((dir < 0) != (diff < 0) && (Math.abs(diff) <= Math.abs(prevDiff)))
-    if (Math.abs(diff) > Math.abs(prevDiff)) {
-      if ((diff < 0) == (prevDiff < 0)) { throw new Error("Broke out of infinite loop in coordsCharInner") }
-      pos = prevPos
+    var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart)
+                 (cm, lineObj, lineNo, preparedMeasure, order, x, y)
+    ltr = part.level != 1
+    // The awkward -1 offsets are needed because findFirst (called
+    // on these below) will treat its first bound as inclusive,
+    // second as exclusive, but we want to actually address the
+    // characters in the part's range
+    begin = ltr ? part.from : part.to - 1
+    end = ltr ? part.to : part.from - 1
+  }
+
+  // A binary search to find the first character whose bounding box
+  // starts after the coordinates. If we run across any whose box wrap
+  // the coordinates, store that.
+  var chAround = null, boxAround = null
+  var ch = findFirst(function (ch) {
+    var box = measureCharPrepared(cm, preparedMeasure, ch)
+    box.top += widgetHeight; box.bottom += widgetHeight
+    if (!boxIsAfter(box, x, y, false)) { return false }
+    if (box.top <= y && box.left <= x) {
+      chAround = ch
+      boxAround = box
     }
+    return true
+  }, begin, end)
+
+  var baseX, sticky, outside = false
+  // If a box around the coordinates was found, use that
+  if (boxAround) {
+    // Distinguish coordinates nearer to the left or right side of the box
+    var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr
+    ch = chAround + (atStart ? 0 : 1)
+    sticky = atStart ? "after" : "before"
+    baseX = atLeft ? boxAround.left : boxAround.right
   } else {
-    var ch = findFirst(function (ch) {
-      var box = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, ch), "line")
-      if (box.top > y) {
-        // For the cursor stickiness
-        end = Math.min(ch, end)
-        return true
-      }
-      else if (box.bottom <= y) { return false }
-      else if (box.left > x) { return true }
-      else if (box.right < x) { return false }
-      else { return (x - box.left < box.right - x) }
-    }, begin, end)
-    ch = skipExtendingChars(lineObj.text, ch, 1)
-    pos = new Pos(lineNo, ch, ch == end ? "before" : "after")
-  }
-  var coords = cursorCoords(cm, pos, "line", lineObj, preparedMeasure)
-  if (y < coords.top || coords.bottom < y) { pos.outside = true }
-  pos.xRel = x < coords.left ? -1 : (x > coords.right ? 1 : 0)
-  return pos
+    // (Adjust for extended bound, if necessary.)
+    if (!ltr && (ch == end || ch == begin)) { ch++ }
+    // To determine which side to associate with, get the box to the
+    // left of the character and compare it's vertical position to the
+    // coordinates
+    sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" :
+      (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight <= y) == ltr ?
+      "after" : "before"
+    // Now get accurate coordinates for this place, in order to get a
+    // base X position
+    var coords = cursorCoords(cm, Pos(lineNo, ch, sticky), "line", lineObj, preparedMeasure)
+    baseX = coords.left
+    outside = y < coords.top || y >= coords.bottom
+  }
+
+  ch = skipExtendingChars(lineObj.text, ch, 1)
+  return PosWithInfo(lineNo, ch, sticky, outside, x - baseX)
+}
+
+function coordsBidiPart(cm, lineObj, lineNo, preparedMeasure, order, x, y) {
+  // Bidi parts are sorted left-to-right, and in a non-line-wrapping
+  // situation, we can take this ordering to correspond to the visual
+  // ordering. This finds the first part whose end is after the given
+  // coordinates.
+  var index = findFirst(function (i) {
+    var part = order[i], ltr = part.level != 1
+    return boxIsAfter(cursorCoords(cm, Pos(lineNo, ltr ? part.to : part.from, ltr ? "before" : "after"),
+                                   "line", lineObj, preparedMeasure), x, y, true)
+  }, 0, order.length - 1)
+  var part = order[index]
+  // If this isn't the first part, the part's start is also after
+  // the coordinates, and the coordinates aren't on the same line as
+  // that start, move one part back.
+  if (index > 0) {
+    var ltr = part.level != 1
+    var start = cursorCoords(cm, Pos(lineNo, ltr ? part.from : part.to, ltr ? "after" : "before"),
+                             "line", lineObj, preparedMeasure)
+    if (boxIsAfter(start, x, y, true) && start.top > y)
+      { part = order[index - 1] }
+  }
+  return part
+}
+
+function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) {
+  // In a wrapped line, rtl text on wrapping boundaries can do things
+  // that don't correspond to the ordering in our `order` array at
+  // all, so a binary search doesn't work, and we want to return a
+  // part that only spans one line so that the binary search in
+  // coordsCharInner is safe. As such, we first find the extent of the
+  // wrapped line, and then do a flat search in which we discard any
+  // spans that aren't on the line.
+  var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y);
+  var begin = ref.begin;
+  var end = ref.end;
+  if (/\s/.test(lineObj.text.charAt(end - 1))) { end-- }
+  var part = null, closestDist = null
+  for (var i = 0; i < order.length; i++) {
+    var p = order[i]
+    if (p.from >= end || p.to <= begin) { continue }
+    var ltr = p.level != 1
+    var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right
+    // Weigh against spans ending before this, so that they are only
+    // picked if nothing ends after
+    var dist = endX < x ? x - endX + 1e9 : endX - x
+    if (!part || closestDist > dist) {
+      part = p
+      closestDist = dist
+    }
+  }
+  if (!part) { part = order[order.length - 1] }
+  // Clip the part to the wrapped line.
+  if (part.from < begin) { part = {from: begin, to: part.to, level: part.level} }
+  if (part.to > end) { part = {from: part.from, to: end, level: part.level} }
+  return part
 }
 
 var measureText
@@ -2963,12 +3054,14 @@ function updateSelection(cm) {
 }
 
 function prepareSelection(cm, primary) {
+  if ( primary === void 0 ) primary = true;
+
   var doc = cm.doc, result = {}
   var curFragment = result.cursors = document.createDocumentFragment()
   var selFragment = result.selection = document.createDocumentFragment()
 
   for (var i = 0; i < doc.sel.ranges.length; i++) {
-    if (primary === false && i == doc.sel.primIndex) { continue }
+    if (!primary && i == doc.sel.primIndex) { continue }
     var range = doc.sel.ranges[i]
     if (range.from().line >= cm.display.viewTo || range.to().line < cm.display.viewFrom) { continue }
     var collapsed = range.empty()
@@ -2999,12 +3092,15 @@ function drawSelectionCursor(cm, head, output) {
   }
 }
 
+function cmpCoords(a, b) { return a.top - b.top || a.left - b.left }
+
 // Draws the given range as a highlighted selection
 function drawSelectionRange(cm, range, output) {
   var display = cm.display, doc = cm.doc
   var fragment = document.createDocumentFragment()
   var padding = paddingH(cm.display), leftSide = padding.left
   var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right
+  var docLTR = doc.direction == "ltr"
 
   function add(left, top, width, bottom) {
     if (top < 0) { top = 0 }
@@ -3021,30 +3117,49 @@ function drawSelectionRange(cm, range, output) {
       return charCoords(cm, Pos(line, ch), "div", lineObj, bias)
     }
 
-    iterateBidiSections(getOrder(lineObj), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {
-      var leftPos = coords(from, "left"), rightPos, left, right
-      if (from == to) {
-        rightPos = leftPos
-        left = right = leftPos.left
-      } else {
-        rightPos = coords(to - 1, "right")
-        if (dir == "rtl") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp }
-        left = leftPos.left
-        right = rightPos.right
-      }
-      if (fromArg == null && from == 0) { left = leftSide }
-      if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part
-        add(left, leftPos.top, null, leftPos.bottom)
-        left = leftSide
-        if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top) }
+    function wrapX(pos, dir, side) {
+      var extent = wrappedLineExtentChar(cm, lineObj, null, pos)
+      var prop = (dir == "ltr") == (side == "after") ? "left" : "right"
+      var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1)
+      return coords(ch, prop)[prop]
+    }
+
+    var order = getOrder(lineObj, doc.direction)
+    iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {
+      var ltr = dir == "ltr"
+      var fromPos = coords(from, ltr ? "left" : "right")
+      var toPos = coords(to - 1, ltr ? "right" : "left")
+
+      var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen
+      var first = i == 0, last = !order || i == order.length - 1
+      if (toPos.top - fromPos.top <= 3) { // Single line
+        var openLeft = (docLTR ? openStart : openEnd) && first
+        var openRight = (docLTR ? openEnd : openStart) && last
+        var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left
+        var right = openRight ? rightSide : (ltr ? toPos : fromPos).right
+        add(left, fromPos.top, right - left, fromPos.bottom)
+      } else { // Multiple lines
+        var topLeft, topRight, botLeft, botRight
+        if (ltr) {
+          topLeft = docLTR && openStart && first ? leftSide : fromPos.left
+          topRight = docLTR ? rightSide : wrapX(from, dir, "before")
+          botLeft = docLTR ? leftSide : wrapX(to, dir, "after")
+          botRight = docLTR && openEnd && last ? rightSide : toPos.right
+        } else {
+          topLeft = !docLTR ? leftSide : wrapX(from, dir, "before")
+          topRight = !docLTR && openStart && first ? rightSide : fromPos.right
+          botLeft = !docLTR && openEnd && last ? leftSide : toPos.left
+          botRight = !docLTR ? rightSide : wrapX(to, dir, "after")
+        }
+        add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom)
+        if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top) }
+        add(botLeft, toPos.top, botRight - botLeft, toPos.bottom)
       }
-      if (toArg == null && to == lineLen) { right = rightSide }
-      if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
-        { start = leftPos }
-      if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
-        { end = rightPos }
-      if (left < leftSide + 1) { left = leftSide }
-      add(left, rightPos.top, right - left, rightPos.bottom)
+
+      if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos }
+      if (cmpCoords(toPos, start) < 0) { start = toPos }
+      if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos }
+      if (cmpCoords(toPos, end) < 0) { end = toPos }
     })
     return {start: start, end: end}
   }
@@ -3129,49 +3244,6 @@ function onBlur(cm, e) {
   setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false } }, 150)
 }
 
-// Re-align line numbers and gutter marks to compensate for
-// horizontal scrolling.
-function alignHorizontally(cm) {
-  var display = cm.display, view = display.view
-  if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
-  var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft
-  var gutterW = display.gutters.offsetWidth, left = comp + "px"
-  for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
-    if (cm.options.fixedGutter) {
-      if (view[i].gutter)
-        { view[i].gutter.style.left = left }
-      if (view[i].gutterBackground)
-        { view[i].gutterBackground.style.left = left }
-    }
-    var align = view[i].alignable
-    if (align) { for (var j = 0; j < align.length; j++)
-      { align[j].style.left = left } }
-  } }
-  if (cm.options.fixedGutter)
-    { display.gutters.style.left = (comp + gutterW) + "px" }
-}
-
-// Used to ensure that the line number gutter is still the right
-// size for the current document size. Returns true when an update
-// is needed.
-function maybeUpdateLineNumberWidth(cm) {
-  if (!cm.options.lineNumbers) { return false }
-  var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display
-  if (last.length != display.lineNumChars) {
-    var test = display.measure.appendChild(elt("div", [elt("div", last)],
-                                               "CodeMirror-linenumber CodeMirror-gutter-elt"))
-    var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW
-    display.lineGutter.style.width = ""
-    display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1
-    display.lineNumWidth = display.lineNumInnerWidth + padding
-    display.lineNumChars = display.lineNumInnerWidth ? last.length : -1
-    display.lineGutter.style.width = display.lineNumWidth + "px"
-    updateGutterSpace(cm)
-    return true
-  }
-  return false
-}
-
 // Read the actual heights of the rendered lines, and update their
 // stored heights to match.
 function updateHeightsInViewport(cm) {
@@ -3190,7 +3262,7 @@ function updateHeightsInViewport(cm) {
     }
     var diff = cur.line.height - height
     if (height < 2) { height = textHeight(display) }
-    if (diff > .001 || diff < -.001) {
+    if (diff > .005 || diff < -.005) {
       updateLineHeight(cur.line, height)
       updateWidgetHeight(cur.line)
       if (cur.rest) { for (var j = 0; j < cur.rest.length; j++)
@@ -3202,8 +3274,10 @@ function updateHeightsInViewport(cm) {
 // Read and store the height of line widgets associated with the
 // given line.
 function updateWidgetHeight(line) {
-  if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i)
-    { line.widgets[i].height = line.widgets[i].node.parentNode.offsetHeight } }
+  if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) {
+    var w = line.widgets[i], parent = w.node.parentNode
+    if (parent) { w.height = parent.offsetHeight }
+  } }
 }
 
 // Compute the lines that are visible in a given viewport (defaults
@@ -3230,139 +3304,221 @@ function visibleLines(display, doc, viewport) {
   return {from: from, to: Math.max(to, from + 1)}
 }
 
-// Sync the scrollable area and scrollbars, ensure the viewport
-// covers the visible area.
-function setScrollTop(cm, val) {
-  if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
-  cm.doc.scrollTop = val
-  if (!gecko) { updateDisplaySimple(cm, {top: val}) }
-  if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }
-  cm.display.scrollbars.setScrollTop(val)
-  if (gecko) { updateDisplaySimple(cm) }
-  startWorker(cm, 100)
+// Re-align line numbers and gutter marks to compensate for
+// horizontal scrolling.
+function alignHorizontally(cm) {
+  var display = cm.display, view = display.view
+  if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return }
+  var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft
+  var gutterW = display.gutters.offsetWidth, left = comp + "px"
+  for (var i = 0; i < view.length; i++) { if (!view[i].hidden) {
+    if (cm.options.fixedGutter) {
+      if (view[i].gutter)
+        { view[i].gutter.style.left = left }
+      if (view[i].gutterBackground)
+        { view[i].gutterBackground.style.left = left }
+    }
+    var align = view[i].alignable
+    if (align) { for (var j = 0; j < align.length; j++)
+      { align[j].style.left = left } }
+  } }
+  if (cm.options.fixedGutter)
+    { display.gutters.style.left = (comp + gutterW) + "px" }
 }
-// Sync scroller and scrollbar, ensure the gutter elements are
-// aligned.
-function setScrollLeft(cm, val, isScroller) {
-  if (isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) { return }
-  val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)
-  cm.doc.scrollLeft = val
-  alignHorizontally(cm)
-  if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }
-  cm.display.scrollbars.setScrollLeft(val)
+
+// Used to ensure that the line number gutter is still the right
+// size for the current document size. Returns true when an update
+// is needed.
+function maybeUpdateLineNumberWidth(cm) {
+  if (!cm.options.lineNumbers) { return false }
+  var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display
+  if (last.length != display.lineNumChars) {
+    var test = display.measure.appendChild(elt("div", [elt("div", last)],
+                                               "CodeMirror-linenumber CodeMirror-gutter-elt"))
+    var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW
+    display.lineGutter.style.width = ""
+    display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1
+    display.lineNumWidth = display.lineNumInnerWidth + padding
+    display.lineNumChars = display.lineNumInnerWidth ? last.length : -1
+    display.lineGutter.style.width = display.lineNumWidth + "px"
+    updateGutterSpace(cm)
+    return true
+  }
+  return false
 }
 
-// Since the delta values reported on mouse wheel events are
-// unstandardized between browsers and even browser versions, and
-// generally horribly unpredictable, this code starts by measuring
-// the scroll effect that the first few mouse wheel events have,
-// and, from that, detects the way it can convert deltas to pixel
-// offsets afterwards.
-//
-// The reason we want to know the amount a wheel event will scroll
-// is that it gives us a chance to update the display before the
-// actual scrolling happens, reducing flickering.
+// SCROLLING THINGS INTO VIEW
 
-var wheelSamples = 0;
-var wheelPixelsPerUnit = null;
-// Fill in a browser-detected starting value on browsers where we
-// know one. These don't have to be accurate -- the result of them
-// being wrong would just be a slight flicker on the first wheel
-// scroll (if it is large enough).
-if (ie) { wheelPixelsPerUnit = -.53 }
-else if (gecko) { wheelPixelsPerUnit = 15 }
-else if (chrome) { wheelPixelsPerUnit = -.7 }
-else if (safari) { wheelPixelsPerUnit = -1/3 }
+// If an editor sits on the top or bottom of the window, partially
+// scrolled out of view, this ensures that the cursor is visible.
+function maybeScrollWindow(cm, rect) {
+  if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
 
-function wheelEventDelta(e) {
-  var dx = e.wheelDeltaX, dy = e.wheelDeltaY
-  if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }
-  if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }
-  else if (dy == null) { dy = e.wheelDelta }
-  return {x: dx, y: dy}
-}
-function wheelEventPixels(e) {
-  var delta = wheelEventDelta(e)
-  delta.x *= wheelPixelsPerUnit
-  delta.y *= wheelPixelsPerUnit
-  return delta
+  var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null
+  if (rect.top + box.top < 0) { doScroll = true }
+  else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }
+  if (doScroll != null && !phantom) {
+    var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n                         top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n                         height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n                         left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;"))
+    cm.display.lineSpace.appendChild(scrollNode)
+    scrollNode.scrollIntoView(doScroll)
+    cm.display.lineSpace.removeChild(scrollNode)
+  }
 }
 
-function onScrollWheel(cm, e) {
-  var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y
-
-  var display = cm.display, scroll = display.scroller
-  // Quit if there's nothing to scroll here
-  var canScrollX = scroll.scrollWidth > scroll.clientWidth
-  var canScrollY = scroll.scrollHeight > scroll.clientHeight
-  if (!(dx && canScrollX || dy && canScrollY)) { return }
-
-  // Webkit browsers on OS X abort momentum scrolls when the target
-  // of the scroll event is removed from the scrollable element.
-  // This hack (see related code in patchDisplay) makes sure the
-  // element is kept around.
-  if (dy && mac && webkit) {
-    outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
-      for (var i = 0; i < view.length; i++) {
-        if (view[i].node == cur) {
-          cm.display.currentWheelTarget = cur
-          break outer
-        }
-      }
+// Scroll a given position into view (immediately), verifying that
+// it actually became visible (as line heights are accurately
+// measured, the position of something may 'drift' during drawing).
+function scrollPosIntoView(cm, pos, end, margin) {
+  if (margin == null) { margin = 0 }
+  var rect
+  if (!cm.options.lineWrapping && pos == end) {
+    // Set pos and end to the cursor positions around the character pos sticks to
+    // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch
+    // If pos == Pos(_, 0, "before"), pos and end are unchanged
+    pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos
+    end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos
+  }
+  for (var limit = 0; limit < 5; limit++) {
+    var changed = false
+    var coords = cursorCoords(cm, pos)
+    var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)
+    rect = {left: Math.min(coords.left, endCoords.left),
+            top: Math.min(coords.top, endCoords.top) - margin,
+            right: Math.max(coords.left, endCoords.left),
+            bottom: Math.max(coords.bottom, endCoords.bottom) + margin}
+    var scrollPos = calculateScrollPos(cm, rect)
+    var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft
+    if (scrollPos.scrollTop != null) {
+      updateScrollTop(cm, scrollPos.scrollTop)
+      if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }
     }
+    if (scrollPos.scrollLeft != null) {
+      setScrollLeft(cm, scrollPos.scrollLeft)
+      if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }
+    }
+    if (!changed) { break }
   }
+  return rect
+}
 
-  // On some browsers, horizontal scrolling will cause redraws to
-  // happen before the gutter has been realigned, causing it to
-  // wriggle around in a most unseemly way. When we have an
-  // estimated pixels/delta value, we just handle horizontal
-  // scrolling entirely here. It'll be slightly off from native, but
-  // better than glitching out.
-  if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
-    if (dy && canScrollY)
-      { setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight))) }
-    setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)))
-    // Only prevent default scrolling if vertical scrolling is
-    // actually possible. Otherwise, it causes vertical scroll
-    // jitter on OSX trackpads when deltaX is small and deltaY
-    // is large (issue #3579)
-    if (!dy || (dy && canScrollY))
-      { e_preventDefault(e) }
-    display.wheelStartX = null // Abort measurement, if in progress
-    return
-  }
+// Scroll a given set of coordinates into view (immediately).
+function scrollIntoView(cm, rect) {
+  var scrollPos = calculateScrollPos(cm, rect)
+  if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop) }
+  if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }
+}
 
-  // 'Project' the visible viewport to cover the area that is being
-  // scrolled into view (if we know enough to estimate it).
-  if (dy && wheelPixelsPerUnit != null) {
-    var pixels = dy * wheelPixelsPerUnit
-    var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight
-    if (pixels < 0) { top = Math.max(0, top + pixels - 50) }
-    else { bot = Math.min(cm.doc.height, bot + pixels + 50) }
-    updateDisplaySimple(cm, {top: top, bottom: bot})
+// Calculate a new scroll position needed to scroll the given
+// rectangle into view. Returns an object with scrollTop and
+// scrollLeft properties. When these are undefined, the
+// vertical/horizontal position does not need to be adjusted.
+function calculateScrollPos(cm, rect) {
+  var display = cm.display, snapMargin = textHeight(cm.display)
+  if (rect.top < 0) { rect.top = 0 }
+  var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop
+  var screen = displayHeight(cm), result = {}
+  if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen }
+  var docBottom = cm.doc.height + paddingVert(display)
+  var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin
+  if (rect.top < screentop) {
+    result.scrollTop = atTop ? 0 : rect.top
+  } else if (rect.bottom > screentop + screen) {
+    var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen)
+    if (newTop != screentop) { result.scrollTop = newTop }
   }
 
-  if (wheelSamples < 20) {
-    if (display.wheelStartX == null) {
-      display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop
-      display.wheelDX = dx; display.wheelDY = dy
-      setTimeout(function () {
-        if (display.wheelStartX == null) { return }
-        var movedX = scroll.scrollLeft - display.wheelStartX
-        var movedY = scroll.scrollTop - display.wheelStartY
-        var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
-          (movedX && display.wheelDX && movedX / display.wheelDX)
-        display.wheelStartX = display.wheelStartY = null
-        if (!sample) { return }
-        wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)
-        ++wheelSamples
-      }, 200)
-    } else {
-      display.wheelDX += dx; display.wheelDY += dy
-    }
+  var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft
+  var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)
+  var tooWide = rect.right - rect.left > screenw
+  if (tooWide) { rect.right = rect.left + screenw }
+  if (rect.left < 10)
+    { result.scrollLeft = 0 }
+  else if (rect.left < screenleft)
+    { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)) }
+  else if (rect.right > screenw + screenleft - 3)
+    { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw }
+  return result
+}
+
+// Store a relative adjustment to the scroll position in the current
+// operation (to be applied when the operation finishes).
+function addToScrollTop(cm, top) {
+  if (top == null) { return }
+  resolveScrollToPos(cm)
+  cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top
+}
+
+// Make sure that at the end of the operation the current cursor is
+// shown.
+function ensureCursorVisible(cm) {
+  resolveScrollToPos(cm)
+  var cur = cm.getCursor()
+  cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}
+}
+
+function scrollToCoords(cm, x, y) {
+  if (x != null || y != null) { resolveScrollToPos(cm) }
+  if (x != null) { cm.curOp.scrollLeft = x }
+  if (y != null) { cm.curOp.scrollTop = y }
+}
+
+function scrollToRange(cm, range) {
+  resolveScrollToPos(cm)
+  cm.curOp.scrollToPos = range
+}
+
+// When an operation has its scrollToPos property set, and another
+// scroll action is applied before the end of the operation, this
+// 'simulates' scrolling that position into view in a cheap way, so
+// that the effect of intermediate scroll commands is not ignored.
+function resolveScrollToPos(cm) {
+  var range = cm.curOp.scrollToPos
+  if (range) {
+    cm.curOp.scrollToPos = null
+    var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)
+    scrollToCoordsRange(cm, from, to, range.margin)
   }
 }
 
+function scrollToCoordsRange(cm, from, to, margin) {
+  var sPos = calculateScrollPos(cm, {
+    left: Math.min(from.left, to.left),
+    top: Math.min(from.top, to.top) - margin,
+    right: Math.max(from.right, to.right),
+    bottom: Math.max(from.bottom, to.bottom) + margin
+  })
+  scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop)
+}
+
+// Sync the scrollable area and scrollbars, ensure the viewport
+// covers the visible area.
+function updateScrollTop(cm, val) {
+  if (Math.abs(cm.doc.scrollTop - val) < 2) { return }
+  if (!gecko) { updateDisplaySimple(cm, {top: val}) }
+  setScrollTop(cm, val, true)
+  if (gecko) { updateDisplaySimple(cm) }
+  startWorker(cm, 100)
+}
+
+function setScrollTop(cm, val, forceScroll) {
+  val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val)
+  if (cm.display.scroller.scrollTop == val && !forceScroll) { return }
+  cm.doc.scrollTop = val
+  cm.display.scrollbars.setScrollTop(val)
+  if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val }
+}
+
+// Sync scroller and scrollbar, ensure the gutter elements are
+// aligned.
+function setScrollLeft(cm, val, isScroller, forceScroll) {
+  val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth)
+  if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return }
+  cm.doc.scrollLeft = val
+  alignHorizontally(cm)
+  if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val }
+  cm.display.scrollbars.setScrollLeft(val)
+}
+
 // SCROLLBARS
 
 // Prepare DOM reads needed to update the scrollbars. Done in one
@@ -3440,12 +3596,12 @@ NativeScrollbars.prototype.update = function (measure) {
 
 NativeScrollbars.prototype.setScrollLeft = function (pos) {
   if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos }
-  if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz) }
+  if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz") }
 };
 
 NativeScrollbars.prototype.setScrollTop = function (pos) {
   if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos }
-  if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert) }
+  if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert") }
 };
 
 NativeScrollbars.prototype.zeroWidthHack = function () {
@@ -3456,17 +3612,18 @@ NativeScrollbars.prototype.zeroWidthHack = function () {
   this.disableVert = new Delayed
 };
 
-NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay) {
+NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) {
   bar.style.pointerEvents = "auto"
   function maybeDisable() {
     // To find out whether the scrollbar is still visible, we
     // check whether the element under the pixel in the bottom
-    // left corner of the scrollbar box is the scrollbar box
+    // right corner of the scrollbar box is the scrollbar box
     // itself (when the bar is still visible) or its filler child
     // (when the bar is hidden). If it is still visible, we keep
     // it enabled, if it's hidden, we disable pointer events.
     var box = bar.getBoundingClientRect()
-    var elt = document.elementFromPoint(box.left + 1, box.bottom - 1)
+    var elt = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2)
+        : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1)
     if (elt != bar) { bar.style.pointerEvents = "none" }
     else { delay.set(1000, maybeDisable) }
   }
@@ -3538,136 +3695,12 @@ function initScrollbars(cm) {
     node.setAttribute("cm-not-content", "true")
   }, function (pos, axis) {
     if (axis == "horizontal") { setScrollLeft(cm, pos) }
-    else { setScrollTop(cm, pos) }
+    else { updateScrollTop(cm, pos) }
   }, cm)
   if (cm.display.scrollbars.addClass)
     { addClass(cm.display.wrapper, cm.display.scrollbars.addClass) }
 }
 
-// SCROLLING THINGS INTO VIEW
-
-// If an editor sits on the top or bottom of the window, partially
-// scrolled out of view, this ensures that the cursor is visible.
-function maybeScrollWindow(cm, coords) {
-  if (signalDOMEvent(cm, "scrollCursorIntoView")) { return }
-
-  var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null
-  if (coords.top + box.top < 0) { doScroll = true }
-  else if (coords.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false }
-  if (doScroll != null && !phantom) {
-    var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n                         top: " + (coords.top - display.viewOffset - paddingTop(cm.display)) + "px;\n                         height: " + (coords.bottom - coords.top + scrollGap(cm) + display.barHeight) + "px;\n                         left: " + (coords.left) + "px; width: 2px;"))
-    cm.display.lineSpace.appendChild(scrollNode)
-    scrollNode.scrollIntoView(doScroll)
-    cm.display.lineSpace.removeChild(scrollNode)
-  }
-}
-
-// Scroll a given position into view (immediately), verifying that
-// it actually became visible (as line heights are accurately
-// measured, the position of something may 'drift' during drawing).
-function scrollPosIntoView(cm, pos, end, margin) {
-  if (margin == null) { margin = 0 }
-  var coords
-  for (var limit = 0; limit < 5; limit++) {
-    var changed = false
-    coords = cursorCoords(cm, pos)
-    var endCoords = !end || end == pos ? coords : cursorCoords(cm, end)
-    var scrollPos = calculateScrollPos(cm, Math.min(coords.left, endCoords.left),
-                                       Math.min(coords.top, endCoords.top) - margin,
-                                       Math.max(coords.left, endCoords.left),
-                                       Math.max(coords.bottom, endCoords.bottom) + margin)
-    var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft
-    if (scrollPos.scrollTop != null) {
-      setScrollTop(cm, scrollPos.scrollTop)
-      if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true }
-    }
-    if (scrollPos.scrollLeft != null) {
-      setScrollLeft(cm, scrollPos.scrollLeft)
-      if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true }
-    }
-    if (!changed) { break }
-  }
-  return coords
-}
-
-// Scroll a given set of coordinates into view (immediately).
-function scrollIntoView(cm, x1, y1, x2, y2) {
-  var scrollPos = calculateScrollPos(cm, x1, y1, x2, y2)
-  if (scrollPos.scrollTop != null) { setScrollTop(cm, scrollPos.scrollTop) }
-  if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft) }
-}
-
-// Calculate a new scroll position needed to scroll the given
-// rectangle into view. Returns an object with scrollTop and
-// scrollLeft properties. When these are undefined, the
-// vertical/horizontal position does not need to be adjusted.
-function calculateScrollPos(cm, x1, y1, x2, y2) {
-  var display = cm.display, snapMargin = textHeight(cm.display)
-  if (y1 < 0) { y1 = 0 }
-  var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop
-  var screen = displayHeight(cm), result = {}
-  if (y2 - y1 > screen) { y2 = y1 + screen }
-  var docBottom = cm.doc.height + paddingVert(display)
-  var atTop = y1 < snapMargin, atBottom = y2 > docBottom - snapMargin
-  if (y1 < screentop) {
-    result.scrollTop = atTop ? 0 : y1
-  } else if (y2 > screentop + screen) {
-    var newTop = Math.min(y1, (atBottom ? docBottom : y2) - screen)
-    if (newTop != screentop) { result.scrollTop = newTop }
-  }
-
-  var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft
-  var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0)
-  var tooWide = x2 - x1 > screenw
-  if (tooWide) { x2 = x1 + screenw }
-  if (x1 < 10)
-    { result.scrollLeft = 0 }
-  else if (x1 < screenleft)
-    { result.scrollLeft = Math.max(0, x1 - (tooWide ? 0 : 10)) }
-  else if (x2 > screenw + screenleft - 3)
-    { result.scrollLeft = x2 + (tooWide ? 0 : 10) - screenw }
-  return result
-}
-
-// Store a relative adjustment to the scroll position in the current
-// operation (to be applied when the operation finishes).
-function addToScrollPos(cm, left, top) {
-  if (left != null || top != null) { resolveScrollToPos(cm) }
-  if (left != null)
-    { cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left }
-  if (top != null)
-    { cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top }
-}
-
-// Make sure that at the end of the operation the current cursor is
-// shown.
-function ensureCursorVisible(cm) {
-  resolveScrollToPos(cm)
-  var cur = cm.getCursor(), from = cur, to = cur
-  if (!cm.options.lineWrapping) {
-    from = cur.ch ? Pos(cur.line, cur.ch - 1) : cur
-    to = Pos(cur.line, cur.ch + 1)
-  }
-  cm.curOp.scrollToPos = {from: from, to: to, margin: cm.options.cursorScrollMargin, isCursor: true}
-}
-
-// When an operation has its scrollToPos property set, and another
-// scroll action is applied before the end of the operation, this
-// 'simulates' scrolling that position into view in a cheap way, so
-// that the effect of intermediate scroll commands is not ignored.
-function resolveScrollToPos(cm) {
-  var range = cm.curOp.scrollToPos
-  if (range) {
-    cm.curOp.scrollToPos = null
-    var from = estimateCoords(cm, range.from), to = estimateCoords(cm, range.to)
-    var sPos = calculateScrollPos(cm, Math.min(from.left, to.left),
-                                  Math.min(from.top, to.top) - range.margin,
-                                  Math.max(from.right, to.right),
-                                  Math.max(from.bottom, to.bottom) + range.margin)
-    cm.scrollTo(sPos.scrollLeft, sPos.scrollTop)
-  }
-}
-
 // Operations are used to wrap a series of changes to the editor
 // state in such a way that each change won't have to update the
 // cursor and display (which would be awkward, slow, and
@@ -3758,7 +3791,7 @@ function endOperation_R2(op) {
   }
 
   if (op.updatedDisplay || op.selectionChanged)
-    { op.preparedSelection = display.input.prepareSelection(op.focus) }
+    { op.preparedSelection = display.input.prepareSelection() }
 }
 
 function endOperation_W2(op) {
@@ -3771,7 +3804,7 @@ function endOperation_W2(op) {
     cm.display.maxLineChanged = false
   }
 
-  var takeFocus = op.focus && op.focus == activeElt() && (!document.hasFocus || document.hasFocus())
+  var takeFocus = op.focus && op.focus == activeElt()
   if (op.preparedSelection)
     { cm.display.input.showSelection(op.preparedSelection, takeFocus) }
   if (op.updatedDisplay || op.startHeight != cm.doc.height)
@@ -3796,22 +3829,14 @@ function endOperation_finish(op) {
     { display.wheelStartX = display.wheelStartY = null }
 
   // Propagate the scroll position to the actual DOM scroller
-  if (op.scrollTop != null && (display.scroller.scrollTop != op.scrollTop || op.forceScroll)) {
-    doc.scrollTop = Math.max(0, Math.min(display.scroller.scrollHeight - display.scroller.clientHeight, op.scrollTop))
-    display.scrollbars.setScrollTop(doc.scrollTop)
-    display.scroller.scrollTop = doc.scrollTop
-  }
-  if (op.scrollLeft != null && (display.scroller.scrollLeft != op.scrollLeft || op.forceScroll)) {
-    doc.scrollLeft = Math.max(0, Math.min(display.scroller.scrollWidth - display.scroller.clientWidth, op.scrollLeft))
-    display.scrollbars.setScrollLeft(doc.scrollLeft)
-    display.scroller.scrollLeft = doc.scrollLeft
-    alignHorizontally(cm)
-  }
+  if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll) }
+
+  if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true) }
   // If we need to scroll a specific position into view, do so.
   if (op.scrollToPos) {
-    var coords = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
-                                   clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)
-    if (op.scrollToPos.isCursor && cm.state.focused) { maybeScrollWindow(cm, coords) }
+    var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from),
+                                 clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin)
+    maybeScrollWindow(cm, rect)
   }
 
   // Fire events for markers that are hidden/unidden by editing or
@@ -4019,22 +4044,23 @@ function countDirtyView(cm) {
 // HIGHLIGHT WORKER
 
 function startWorker(cm, time) {
-  if (cm.doc.mode.startState && cm.doc.frontier < cm.display.viewTo)
+  if (cm.doc.highlightFrontier < cm.display.viewTo)
     { cm.state.highlight.set(time, bind(highlightWorker, cm)) }
 }
 
 function highlightWorker(cm) {
   var doc = cm.doc
-  if (doc.frontier < doc.first) { doc.frontier = doc.first }
-  if (doc.frontier >= cm.display.viewTo) { return }
+  if (doc.highlightFrontier >= cm.display.viewTo) { return }
   var end = +new Date + cm.options.workTime
-  var state = copyState(doc.mode, getStateBefore(cm, doc.frontier))
+  var context = getContextBefore(cm, doc.highlightFrontier)
   var changedLines = []
 
-  doc.iter(doc.frontier, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
-    if (doc.frontier >= cm.display.viewFrom) { // Visible
-      var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength
-      var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true)
+  doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) {
+    if (context.line >= cm.display.viewFrom) { // Visible
+      var oldStyles = line.styles
+      var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null
+      var highlighted = highlightLine(cm, line, context, true)
+      if (resetState) { context.state = resetState }
       line.styles = highlighted.styles
       var oldCls = line.styleClasses, newCls = highlighted.classes
       if (newCls) { line.styleClasses = newCls }
@@ -4042,19 +4068,22 @@ function highlightWorker(cm) {
       var ischange = !oldStyles || oldStyles.length != line.styles.length ||
         oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass)
       for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i] }
-      if (ischange) { changedLines.push(doc.frontier) }
-      line.stateAfter = tooLong ? state : copyState(doc.mode, state)
+      if (ischange) { changedLines.push(context.line) }
+      line.stateAfter = context.save()
+      context.nextLine()
     } else {
       if (line.text.length <= cm.options.maxHighlightLength)
-        { processLine(cm, line.text, state) }
-      line.stateAfter = doc.frontier % 5 == 0 ? copyState(doc.mode, state) : null
+        { processLine(cm, line.text, context) }
+      line.stateAfter = context.line % 5 == 0 ? context.save() : null
+      context.nextLine()
     }
-    ++doc.frontier
     if (+new Date > end) {
       startWorker(cm, cm.options.workDelay)
       return true
     }
   })
+  doc.highlightFrontier = context.line
+  doc.modeFrontier = Math.max(doc.modeFrontier, context.line)
   if (changedLines.length) { runInOp(cm, function () {
     for (var i = 0; i < changedLines.length; i++)
       { regLineChange(cm, changedLines[i], "text") }
@@ -4100,6 +4129,36 @@ function maybeClipScrollbars(cm) {
   }
 }
 
+function selectionSnapshot(cm) {
+  if (cm.hasFocus()) { return null }
+  var active = activeElt()
+  if (!active || !contains(cm.display.lineDiv, active)) { return null }
+  var result = {activeElt: active}
+  if (window.getSelection) {
+    var sel = window.getSelection()
+    if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) {
+      result.anchorNode = sel.anchorNode
+      result.anchorOffset = sel.anchorOffset
+      result.focusNode = sel.focusNode
+      result.focusOffset = sel.focusOffset
+    }
+  }
+  return result
+}
+
+function restoreSelection(snapshot) {
+  if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return }
+  snapshot.activeElt.focus()
+  if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) {
+    var sel = window.getSelection(), range = document.createRange()
+    range.setEnd(snapshot.anchorNode, snapshot.anchorOffset)
+    range.collapse(false)
+    sel.removeAllRanges()
+    sel.addRange(range)
+    sel.extend(snapshot.focusNode, snapshot.focusOffset)
+  }
+}
+
 // Does the actual updating of the line display. Bails out
 // (returning false) when there is nothing to be done and forced is
 // false.
@@ -4149,14 +4208,14 @@ function updateDisplayIfNeeded(cm, update) {
 
   // For big changes, we hide the enclosing element during the
   // update, since that speeds up the operations on most browsers.
-  var focused = activeElt()
+  var selSnapshot = selectionSnapshot(cm)
   if (toUpdate > 4) { display.lineDiv.style.display = "none" }
   patchDisplay(cm, display.updateLineNumbers, update.dims)
   if (toUpdate > 4) { display.lineDiv.style.display = "" }
   display.renderedView = display.view
   // There might have been a widget with a focused element that got
   // hidden or updated, if so re-focus it.
-  if (focused && activeElt() != focused && focused.offsetHeight) { focused.focus() }
+  restoreSelection(selSnapshot)
 
   // Prevent selection and cursors from interfering with the scroll
   // width and height.
@@ -4195,6 +4254,7 @@ function postUpdateDisplay(cm, update) {
     updateSelection(cm)
     updateScrollbars(cm, barMeasure)
     setDocumentHeight(cm, barMeasure)
+    update.force = false
   }
 
   update.signal(cm, "update", cm)
@@ -4304,6 +4364,106 @@ function setGuttersForLineNumbers(options) {
   }
 }
 
+var wheelSamples = 0;
+var wheelPixelsPerUnit = null;
+// Fill in a browser-detected starting value on browsers where we
+// know one. These don't have to be accurate -- the result of them
+// being wrong would just be a slight flicker on the first wheel
+// scroll (if it is large enough).
+if (ie) { wheelPixelsPerUnit = -.53 }
+else if (gecko) { wheelPixelsPerUnit = 15 }
+else if (chrome) { wheelPixelsPerUnit = -.7 }
+else if (safari) { wheelPixelsPerUnit = -1/3 }
+
+function wheelEventDelta(e) {
+  var dx = e.wheelDeltaX, dy = e.wheelDeltaY
+  if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail }
+  if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail }
+  else if (dy == null) { dy = e.wheelDelta }
+  return {x: dx, y: dy}
+}
+function wheelEventPixels(e) {
+  var delta = wheelEventDelta(e)
+  delta.x *= wheelPixelsPerUnit
+  delta.y *= wheelPixelsPerUnit
+  return delta
+}
+
+function onScrollWheel(cm, e) {
+  var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y
+
+  var display = cm.display, scroll = display.scroller
+  // Quit if there's nothing to scroll here
+  var canScrollX = scroll.scrollWidth > scroll.clientWidth
+  var canScrollY = scroll.scrollHeight > scroll.clientHeight
+  if (!(dx && canScrollX || dy && canScrollY)) { return }
+
+  // Webkit browsers on OS X abort momentum scrolls when the target
+  // of the scroll event is removed from the scrollable element.
+  // This hack (see related code in patchDisplay) makes sure the
+  // element is kept around.
+  if (dy && mac && webkit) {
+    outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) {
+      for (var i = 0; i < view.length; i++) {
+        if (view[i].node == cur) {
+          cm.display.currentWheelTarget = cur
+          break outer
+        }
+      }
+    }
+  }
+
+  // On some browsers, horizontal scrolling will cause redraws to
+  // happen before the gutter has been realigned, causing it to
+  // wriggle around in a most unseemly way. When we have an
+  // estimated pixels/delta value, we just handle horizontal
+  // scrolling entirely here. It'll be slightly off from native, but
+  // better than glitching out.
+  if (dx && !gecko && !presto && wheelPixelsPerUnit != null) {
+    if (dy && canScrollY)
+      { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)) }
+    setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit))
+    // Only prevent default scrolling if vertical scrolling is
+    // actually possible. Otherwise, it causes vertical scroll
+    // jitter on OSX trackpads when deltaX is small and deltaY
+    // is large (issue #3579)
+    if (!dy || (dy && canScrollY))
+      { e_preventDefault(e) }
+    display.wheelStartX = null // Abort measurement, if in progress
+    return
+  }
+
+  // 'Project' the visible viewport to cover the area that is being
+  // scrolled into view (if we know enough to estimate it).
+  if (dy && wheelPixelsPerUnit != null) {
+    var pixels = dy * wheelPixelsPerUnit
+    var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight
+    if (pixels < 0) { top = Math.max(0, top + pixels - 50) }
+    else { bot = Math.min(cm.doc.height, bot + pixels + 50) }
+    updateDisplaySimple(cm, {top: top, bottom: bot})
+  }
+
+  if (wheelSamples < 20) {
+    if (display.wheelStartX == null) {
+      display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop
+      display.wheelDX = dx; display.wheelDY = dy
+      setTimeout(function () {
+        if (display.wheelStartX == null) { return }
+        var movedX = scroll.scrollLeft - display.wheelStartX
+        var movedY = scroll.scrollTop - display.wheelStartY
+        var sample = (movedY && display.wheelDY && movedY / display.wheelDY) ||
+          (movedX && display.wheelDX && movedX / display.wheelDX)
+        display.wheelStartX = display.wheelStartY = null
+        if (!sample) { return }
+        wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1)
+        ++wheelSamples
+      }, 200)
+    } else {
+      display.wheelDX += dx; display.wheelDY += dy
+    }
+  }
+}
+
 // Selection objects are immutable. A new one is created every time
 // the selection changes. A selection is one or more non-overlapping
 // (and non-touching) ranges, sorted, and an integer that indicates
@@ -4457,7 +4617,7 @@ function resetModeState(cm) {
     if (line.stateAfter) { line.stateAfter = null }
     if (line.styles) { line.styles = null }
   })
-  cm.doc.frontier = cm.doc.first
+  cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first
   startWorker(cm, 100)
   cm.state.modeGen++
   if (cm.curOp) { regChange(cm) }
@@ -4547,11 +4707,23 @@ function attachDoc(cm, doc) {
   doc.cm = cm
   estimateLineHeights(cm)
   loadMode(cm)
+  setDirectionClass(cm)
   if (!cm.options.lineWrapping) { findMaxLine(cm) }
   cm.options.mode = doc.modeOption
   regChange(cm)
 }
 
+function setDirectionClass(cm) {
+  ;(cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl")
+}
+
+function directionChanged(cm) {
+  runInOp(cm, function () {
+    setDirectionClass(cm)
+    regChange(cm)
+  })
+}
+
 function History(startGen) {
   // Arrays of change events and selections. Doing something adds an
   // event to done and clears undo. Undoing moves events from done
@@ -4611,7 +4783,7 @@ function addChangeToHistory(doc, change, selAfter, opId) {
 
   if ((hist.lastOp == opId ||
        hist.lastOrigin == change.origin && change.origin &&
-       ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||
+       ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) ||
         change.origin.charAt(0) == "*")) &&
       (cur = lastChangeEvent(hist, hist.lastOp == opId))) {
     // Merge this change into the last event
@@ -4779,8 +4951,8 @@ function copyHistoryArray(events, newGroup, instantiateSel) {
 // include a given position (and optionally a second position).
 // Otherwise, simply returns the range between the given positions.
 // Used for cursor motion and such.
-function extendRange(doc, range, head, other) {
-  if (doc.cm && doc.cm.display.shift || doc.extend) {
+function extendRange(range, head, other, extend) {
+  if (extend) {
     var anchor = range.anchor
     if (other) {
       var posBefore = cmp(head, anchor) < 0
@@ -4798,16 +4970,18 @@ function extendRange(doc, range, head, other) {
 }
 
 // Extend the primary selection range, discard the rest.
-function extendSelection(doc, head, other, options) {
-  setSelection(doc, new Selection([extendRange(doc, doc.sel.primary(), head, other)], 0), options)
+function extendSelection(doc, head, other, options, extend) {
+  if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend) }
+  setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options)
 }
 
 // Extend all selections (pos is an array of selections with length
 // equal the number of selections)
 function extendSelections(doc, heads, options) {
   var out = []
+  var extend = doc.cm && (doc.cm.display.shift || doc.extend)
   for (var i = 0; i < doc.sel.ranges.length; i++)
-    { out[i] = extendRange(doc, doc.sel.ranges[i], heads[i], null) }
+    { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend) }
   var newSel = normalizeSelection(out, doc.sel.primIndex)
   setSelection(doc, newSel, options)
 }
@@ -4888,7 +5062,7 @@ function setSelectionInner(doc, sel) {
 // Verify that the selection does not partially select any atomic
 // marked ranges.
 function reCheckSelection(doc) {
-  setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false), sel_dontScroll)
+  setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false))
 }
 
 // Return a selection that does not partially select any atomic
@@ -5013,7 +5187,7 @@ function makeChange(doc, change, ignoreReadOnly) {
   var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to)
   if (split) {
     for (var i = split.length - 1; i >= 0; --i)
-      { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text}) }
+      { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}) }
   } else {
     makeChangeInner(doc, change)
   }
@@ -5038,7 +5212,8 @@ function makeChangeInner(doc, change) {
 
 // Revert a change stored in a document's history.
 function makeChangeFromHistory(doc, type, allowSelectionOnly) {
-  if (doc.cm && doc.cm.state.suppressEdits && !allowSelectionOnly) { return }
+  var suppress = doc.cm && doc.cm.state.suppressEdits
+  if (suppress && !allowSelectionOnly) { return }
 
   var hist = doc.history, event, selAfter = doc.sel
   var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done
@@ -5063,8 +5238,10 @@ function makeChangeFromHistory(doc, type, allowSelectionOnly) {
         return
       }
       selAfter = event
-    }
-    else { break }
+    } else if (suppress) {
+      source.push(event)
+      return
+    } else { break }
   }
 
   // Build up a reverse change object to add to the opposite history
@@ -5191,8 +5368,7 @@ function makeChangeSingleDocInEditor(cm, change, spans) {
     if (recomputeMaxLength) { cm.curOp.updateMaxLine = true }
   }
 
-  // Adjust frontier, schedule worker
-  doc.frontier = Math.min(doc.frontier, from.line)
+  retreatFrontier(doc, from.line)
   startWorker(cm, 400)
 
   var lendiff = change.text.length - (to.line - from.line) - 1
@@ -5220,7 +5396,8 @@ function makeChangeSingleDocInEditor(cm, change, spans) {
 
 function replaceRange(doc, code, from, to, origin) {
   if (!to) { to = from }
-  if (cmp(to, from) < 0) { var tmp = to; to = from; from = tmp }
+  if (cmp(to, from) < 0) { var assign;
+    (assign = [to, from], from = assign[0], to = assign[1], assign) }
   if (typeof code == "string") { code = doc.splitLines(code) }
   makeChange(doc, {from: from, to: to, text: code, origin: origin})
 }
@@ -5302,7 +5479,7 @@ function changeLine(doc, handle, changeType, op) {
 //
 // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html
 
-var LeafChunk = function(lines) {
+function LeafChunk(lines) {
   var this$1 = this;
 
   this.lines = lines
@@ -5313,47 +5490,49 @@ var LeafChunk = function(lines) {
     height += lines[i].height
   }
   this.height = height
-};
+}
 
-LeafChunk.prototype.chunkSize = function () { return this.lines.length };
+LeafChunk.prototype = {
+  chunkSize: function chunkSize() { return this.lines.length },
 
-// Remove the n lines at offset 'at'.
-LeafChunk.prototype.removeInner = function (at, n) {
+  // Remove the n lines at offset 'at'.
+  removeInner: function removeInner(at, n) {
     var this$1 = this;
 
-  for (var i = at, e = at + n; i < e; ++i) {
-    var line = this$1.lines[i]
-    this$1.height -= line.height
-    cleanUpLine(line)
-    signalLater(line, "delete")
-  }
-  this.lines.splice(at, n)
-};
+    for (var i = at, e = at + n; i < e; ++i) {
+      var line = this$1.lines[i]
+      this$1.height -= line.height
+      cleanUpLine(line)
+      signalLater(line, "delete")
+    }
+    this.lines.splice(at, n)
+  },
 
-// Helper used to collapse a small branch into a single leaf.
-LeafChunk.prototype.collapse = function (lines) {
-  lines.push.apply(lines, this.lines)
-};
+  // Helper used to collapse a small branch into a single leaf.
+  collapse: function collapse(lines) {
+    lines.push.apply(lines, this.lines)
+  },
 
-// Insert the given array of lines at offset 'at', count them as
-// having the given height.
-LeafChunk.prototype.insertInner = function (at, lines, height) {
+  // Insert the given array of lines at offset 'at', count them as
+  // having the given height.
+  insertInner: function insertInner(at, lines, height) {
     var this$1 = this;
 
-  this.height += height
-  this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))
-  for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }
-};
+    this.height += height
+    this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at))
+    for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1 }
+  },
 
-// Used to iterate over a part of the tree.
-LeafChunk.prototype.iterN = function (at, n, op) {
+  // Used to iterate over a part of the tree.
+  iterN: function iterN(at, n, op) {
     var this$1 = this;
 
-  for (var e = at + n; at < e; ++at)
-    { if (op(this$1.lines[at])) { return true } }
-};
+    for (var e = at + n; at < e; ++at)
+      { if (op(this$1.lines[at])) { return true } }
+  }
+}
 
-var BranchChunk = function(children) {
+function BranchChunk(children) {
   var this$1 = this;
 
   this.children = children
@@ -5366,106 +5545,108 @@ var BranchChunk = function(children) {
   this.size = size
   this.height = height
   this.parent = null
-};
+}
 
-BranchChunk.prototype.chunkSize = function () { return this.size };
+BranchChunk.prototype = {
+  chunkSize: function chunkSize() { return this.size },
 
-BranchChunk.prototype.removeInner = function (at, n) {
+  removeInner: function removeInner(at, n) {
     var this$1 = this;
 
-  this.size -= n
-  for (var i = 0; i < this.children.length; ++i) {
-    var child = this$1.children[i], sz = child.chunkSize()
-    if (at < sz) {
-      var rm = Math.min(n, sz - at), oldHeight = child.height
-      child.removeInner(at, rm)
-      this$1.height -= oldHeight - child.height
-      if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }
-      if ((n -= rm) == 0) { break }
-      at = 0
-    } else { at -= sz }
-  }
-  // If the result is smaller than 25 lines, ensure that it is a
-  // single leaf node.
-  if (this.size - n < 25 &&
-      (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
-    var lines = []
-    this.collapse(lines)
-    this.children = [new LeafChunk(lines)]
-    this.children[0].parent = this
-  }
-};
+    this.size -= n
+    for (var i = 0; i < this.children.length; ++i) {
+      var child = this$1.children[i], sz = child.chunkSize()
+      if (at < sz) {
+        var rm = Math.min(n, sz - at), oldHeight = child.height
+        child.removeInner(at, rm)
+        this$1.height -= oldHeight - child.height
+        if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null }
+        if ((n -= rm) == 0) { break }
+        at = 0
+      } else { at -= sz }
+    }
+    // If the result is smaller than 25 lines, ensure that it is a
+    // single leaf node.
+    if (this.size - n < 25 &&
+        (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) {
+      var lines = []
+      this.collapse(lines)
+      this.children = [new LeafChunk(lines)]
+      this.children[0].parent = this
+    }
+  },
 
-BranchChunk.prototype.collapse = function (lines) {
+  collapse: function collapse(lines) {
     var this$1 = this;
 
-  for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }
-};
+    for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines) }
+  },
 
-BranchChunk.prototype.insertInner = function (at, lines, height) {
+  insertInner: function insertInner(at, lines, height) {
     var this$1 = this;
 
-  this.size += lines.length
-  this.height += height
-  for (var i = 0; i < this.children.length; ++i) {
-    var child = this$1.children[i], sz = child.chunkSize()
-    if (at <= sz) {
-      child.insertInner(at, lines, height)
-      if (child.lines && child.lines.length > 50) {
-        // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
-        // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
-        var remaining = child.lines.length % 25 + 25
-        for (var pos = remaining; pos < child.lines.length;) {
-          var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))
-          child.height -= leaf.height
-          this$1.children.splice(++i, 0, leaf)
-          leaf.parent = this$1
+    this.size += lines.length
+    this.height += height
+    for (var i = 0; i < this.children.length; ++i) {
+      var child = this$1.children[i], sz = child.chunkSize()
+      if (at <= sz) {
+        child.insertInner(at, lines, height)
+        if (child.lines && child.lines.length > 50) {
+          // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced.
+          // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest.
+          var remaining = child.lines.length % 25 + 25
+          for (var pos = remaining; pos < child.lines.length;) {
+            var leaf = new LeafChunk(child.lines.slice(pos, pos += 25))
+            child.height -= leaf.height
+            this$1.children.splice(++i, 0, leaf)
+            leaf.parent = this$1
+          }
+          child.lines = child.lines.slice(0, remaining)
+          this$1.maybeSpill()
         }
-        child.lines = child.lines.slice(0, remaining)
-        this$1.maybeSpill()
+        break
       }
-      break
+      at -= sz
     }
-    at -= sz
-  }
-};
+  },
 
-// When a node has grown, check whether it should be split.
-BranchChunk.prototype.maybeSpill = function () {
-  if (this.children.length <= 10) { return }
-  var me = this
-  do {
-    var spilled = me.children.splice(me.children.length - 5, 5)
-    var sibling = new BranchChunk(spilled)
-    if (!me.parent) { // Become the parent node
-      var copy = new BranchChunk(me.children)
-      copy.parent = me
-      me.children = [copy, sibling]
-      me = copy
-   } else {
-      me.size -= sibling.size
-      me.height -= sibling.height
-      var myIndex = indexOf(me.parent.children, me)
-      me.parent.children.splice(myIndex + 1, 0, sibling)
-    }
-    sibling.parent = me.parent
-  } while (me.children.length > 10)
-  me.parent.maybeSpill()
-};
+  // When a node has grown, check whether it should be split.
+  maybeSpill: function maybeSpill() {
+    if (this.children.length <= 10) { return }
+    var me = this
+    do {
+      var spilled = me.children.splice(me.children.length - 5, 5)
+      var sibling = new BranchChunk(spilled)
+      if (!me.parent) { // Become the parent node
+        var copy = new BranchChunk(me.children)
+        copy.parent = me
+        me.children = [copy, sibling]
+        me = copy
+     } else {
+        me.size -= sibling.size
+        me.height -= sibling.height
+        var myIndex = indexOf(me.parent.children, me)
+        me.parent.children.splice(myIndex + 1, 0, sibling)
+      }
+      sibling.parent = me.parent
+    } while (me.children.length > 10)
+    me.parent.maybeSpill()
+  },
 
-BranchChunk.prototype.iterN = function (at, n, op) {
+  iterN: function iterN(at, n, op) {
     var this$1 = this;
 
-  for (var i = 0; i < this.children.length; ++i) {
-    var child = this$1.children[i], sz = child.chunkSize()
-    if (at < sz) {
-      var used = Math.min(n, sz - at)
-      if (child.iterN(at, used, op)) { return true }
-      if ((n -= used) == 0) { break }
-      at = 0
-    } else { at -= sz }
+    for (var i = 0; i < this.children.length; ++i) {
+      var child = this$1.children[i], sz = child.chunkSize()
+      if (at < sz) {
+        var used = Math.min(n, sz - at)
+        if (child.iterN(at, used, op)) { return true }
+        if ((n -= used) == 0) { break }
+        at = 0
+      } else { at -= sz }
+    }
   }
-};
+}
 
 // Line widgets are block elements displayed above or below a line.
 
@@ -5516,7 +5697,7 @@ eventMixin(LineWidget)
 
 function adjustScrollWhenAboveVisible(cm, line, diff) {
   if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop))
-    { addToScrollPos(cm, null, diff) }
+    { addToScrollTop(cm, diff) }
 }
 
 function addLineWidget(doc, handle, node, options) {
@@ -5531,12 +5712,12 @@ function addLineWidget(doc, handle, node, options) {
     if (cm && !lineIsHidden(doc, line)) {
       var aboveVisible = heightAtLine(line) < doc.scrollTop
       updateLineHeight(line, line.height + widgetHeight(widget))
-      if (aboveVisible) { addToScrollPos(cm, null, widget.height) }
+      if (aboveVisible) { addToScrollTop(cm, widget.height) }
       cm.curOp.forceUpdate = true
     }
     return true
   })
-  signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle))
+  if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)) }
   return widget
 }
 
@@ -5695,8 +5876,7 @@ function markText(doc, from, to, options, type) {
   if (marker.replacedWith) {
     // Showing up as a widget implies collapsed (widget replaces text)
     marker.collapsed = true
-    marker.widgetNode = elt("span", [marker.replacedWith], "CodeMirror-widget")
-    marker.widgetNode.setAttribute("role", "presentation") // hide from accessibility tree
+    marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget")
     if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true") }
     if (options.insertLeft) { marker.widgetNode.insertLeft = true }
   }
@@ -5826,8 +6006,8 @@ function detachSharedMarkers(markers) {
 }
 
 var nextDocId = 0
-var Doc = function(text, mode, firstLine, lineSep) {
-  if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep) }
+var Doc = function(text, mode, firstLine, lineSep, direction) {
+  if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) }
   if (firstLine == null) { firstLine = 0 }
 
   BranchChunk.call(this, [new LeafChunk([new Line("", null)])])
@@ -5835,13 +6015,14 @@ var Doc = function(text, mode, firstLine, lineSep) {
   this.scrollTop = this.scrollLeft = 0
   this.cantEdit = false
   this.cleanGeneration = 1
-  this.frontier = firstLine
+  this.modeFrontier = this.highlightFrontier = firstLine
   var start = Pos(firstLine, 0)
   this.sel = simpleSelection(start)
   this.history = new History(null)
   this.id = ++nextDocId
   this.modeOption = mode
   this.lineSep = lineSep
+  this.direction = (direction == "rtl") ? "rtl" : "ltr"
   this.extend = false
 
   if (typeof text == "string") { text = this.splitLines(text) }
@@ -5880,7 +6061,8 @@ Doc.prototype = createObj(BranchChunk.prototype, {
     var top = Pos(this.first, 0), last = this.first + this.size - 1
     makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length),
                       text: this.splitLines(code), origin: "setValue", full: true}, true)
-    setSelection(this, simpleSelection(top))
+    if (this.cm) { scrollToCoords(this.cm, 0, 0) }
+    setSelection(this, simpleSelection(top), sel_dontScroll)
   }),
   replaceRange: function(code, from, to, origin) {
     from = clipPos(this, from)
@@ -6178,7 +6360,7 @@ Doc.prototype = createObj(BranchChunk.prototype, {
 
   copy: function(copyHistory) {
     var doc = new Doc(getLines(this, this.first, this.first + this.size),
-                      this.modeOption, this.first, this.lineSep)
+                      this.modeOption, this.first, this.lineSep, this.direction)
     doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft
     doc.sel = this.sel
     doc.extend = false
@@ -6194,7 +6376,7 @@ Doc.prototype = createObj(BranchChunk.prototype, {
     var from = this.first, to = this.first + this.size
     if (options.from != null && options.from > from) { from = options.from }
     if (options.to != null && options.to < to) { to = options.to }
-    var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep)
+    var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction)
     if (options.sharedHist) { copy.history = this.history
     ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist})
     copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]
@@ -6231,7 +6413,15 @@ Doc.prototype = createObj(BranchChunk.prototype, {
     if (this.lineSep) { return str.split(this.lineSep) }
     return splitLinesAuto(str)
   },
-  lineSeparator: function() { return this.lineSep || "\n" }
+  lineSeparator: function() { return this.lineSep || "\n" },
+
+  setDirection: docMethodOp(function (dir) {
+    if (dir != "rtl") { dir = "ltr" }
+    if (dir == this.direction) { return }
+    this.direction = dir
+    this.iter(function (line) { return line.order = null; })
+    if (this.cm) { directionChanged(this.cm) }
+  })
 })
 
 // Public alias.
@@ -6348,8 +6538,8 @@ function clearDragCursor(cm) {
 // garbage collected.
 
 function forEachCodeMirror(f) {
-  if (!document.body.getElementsByClassName) { return }
-  var byClass = document.body.getElementsByClassName("CodeMirror")
+  if (!document.getElementsByClassName) { return }
+  var byClass = document.getElementsByClassName("CodeMirror")
   for (var i = 0; i < byClass.length; i++) {
     var cm = byClass[i].CodeMirror
     if (cm) { f(cm) }
@@ -6386,11 +6576,11 @@ function onResize(cm) {
 }
 
 var keyNames = {
-  3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
+  3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt",
   19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End",
   36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert",
   46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod",
-  106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete",
+  106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 127: "Delete", 145: "ScrollLock",
   173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\",
   221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete",
   63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert"
@@ -6523,11 +6713,8 @@ function isModifierKey(value) {
   return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod"
 }
 
-// Look up the name of a key as indicated by an event object.
-function keyName(event, noShift) {
-  if (presto && event.keyCode == 34 && event["char"]) { return false }
-  var base = keyNames[event.keyCode], name = base
-  if (name == null || event.altGraphKey) { return false }
+function addModifierNames(name, event, noShift) {
+  var base = name
   if (event.altKey && base != "Alt") { name = "Alt-" + name }
   if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name }
   if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name }
@@ -6535,6 +6722,17 @@ function keyName(event, noShift) {
   return name
 }
 
+// Look up the name of a key as indicated by an event object.
+function keyName(event, noShift) {
+  if (presto && event.keyCode == 34 && event["char"]) { return false }
+  var name = keyNames[event.keyCode]
+  if (name == null || event.altGraphKey) { return false }
+  // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause,
+  // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+)
+  if (event.keyCode == 3 && event.code) { name = event.code }
+  return addModifierNames(name, event, noShift)
+}
+
 function getKeyMap(val) {
   return typeof val == "string" ? keyMap[val] : val
 }
@@ -6564,6 +6762,112 @@ function deleteNearSelection(cm, compute) {
   })
 }
 
+function moveCharLogically(line, ch, dir) {
+  var target = skipExtendingChars(line.text, ch + dir, dir)
+  return target < 0 || target > line.text.length ? null : target
+}
+
+function moveLogically(line, start, dir) {
+  var ch = moveCharLogically(line, start.ch, dir)
+  return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before")
+}
+
+function endOfLine(visually, cm, lineObj, lineNo, dir) {
+  if (visually) {
+    var order = getOrder(lineObj, cm.doc.direction)
+    if (order) {
+      var part = dir < 0 ? lst(order) : order[0]
+      var moveInStorageOrder = (dir < 0) == (part.level == 1)
+      var sticky = moveInStorageOrder ? "after" : "before"
+      var ch
+      // With a wrapped rtl chunk (possibly spanning multiple bidi parts),
+      // it could be that the last bidi part is not on the last visual line,
+      // since visual lines contain content order-consecutive chunks.
+      // Thus, in rtl, we are looking for the first (content-order) character
+      // in the rtl chunk that is on the last line (that is, the same line
+      // as the last (content-order) character).
+      if (part.level > 0 || cm.doc.direction == "rtl") {
+        var prep = prepareMeasureForLine(cm, lineObj)
+        ch = dir < 0 ? lineObj.text.length - 1 : 0
+        var targetTop = measureCharPrepared(cm, prep, ch).top
+        ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch)
+        if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1) }
+      } else { ch = dir < 0 ? part.to : part.from }
+      return new Pos(lineNo, ch, sticky)
+    }
+  }
+  return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after")
+}
+
+function moveVisually(cm, line, start, dir) {
+  var bidi = getOrder(line, cm.doc.direction)
+  if (!bidi) { return moveLogically(line, start, dir) }
+  if (start.ch >= line.text.length) {
+    start.ch = line.text.length
+    start.sticky = "before"
+  } else if (start.ch <= 0) {
+    start.ch = 0
+    start.sticky = "after"
+  }
+  var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]
+  if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) {
+    // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines,
+    // nothing interesting happens.
+    return moveLogically(line, start, dir)
+  }
+
+  var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }
+  var prep
+  var getWrappedLineExtent = function (ch) {
+    if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} }
+    prep = prep || prepareMeasureForLine(cm, line)
+    return wrappedLineExtentChar(cm, line, prep, ch)
+  }
+  var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch)
+
+  if (cm.doc.direction == "rtl" || part.level == 1) {
+    var moveInStorageOrder = (part.level == 1) == (dir < 0)
+    var ch = mv(start, moveInStorageOrder ? 1 : -1)
+    if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) {
+      // Case 2: We move within an rtl part or in an rtl editor on the same visual line
+      var sticky = moveInStorageOrder ? "before" : "after"
+      return new Pos(start.line, ch, sticky)
+    }
+  }
+
+  // Case 3: Could not move within this bidi part in this visual line, so leave
+  // the current bidi part
+
+  var searchInVisualLine = function (partPos, dir, wrappedLineExtent) {
+    var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder
+      ? new Pos(start.line, mv(ch, 1), "before")
+      : new Pos(start.line, ch, "after"); }
+
+    for (; partPos >= 0 && partPos < bidi.length; partPos += dir) {
+      var part = bidi[partPos]
+      var moveInStorageOrder = (dir > 0) == (part.level != 1)
+      var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1)
+      if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) }
+      ch = moveInStorageOrder ? part.from : mv(part.to, -1)
+      if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) }
+    }
+  }
+
+  // Case 3a: Look for other bidi parts on the same visual line
+  var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent)
+  if (res) { return res }
+
+  // Case 3b: Look for other bidi parts on the next visual line
+  var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1)
+  if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) {
+    res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh))
+    if (res) { return res }
+  }
+
+  // Case 4: Nowhere to move
+  return null
+}
+
 // Commands are parameter-less actions that can be performed on an
 // editor, mostly used for keybindings.
 var commands = {
@@ -6613,15 +6917,15 @@ var commands = {
     {origin: "+move", bias: -1}
   ); },
   goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) {
-    var top = cm.charCoords(range.head, "div").top + 5
+    var top = cm.cursorCoords(range.head, "div").top + 5
     return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div")
   }, sel_move); },
   goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) {
-    var top = cm.charCoords(range.head, "div").top + 5
+    var top = cm.cursorCoords(range.head, "div").top + 5
     return cm.coordsChar({left: 0, top: top}, "div")
   }, sel_move); },
   goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) {
-    var top = cm.charCoords(range.head, "div").top + 5
+    var top = cm.cursorCoords(range.head, "div").top + 5
     var pos = cm.coordsChar({left: 0, top: top}, "div")
     if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) }
     return pos
@@ -6722,7 +7026,7 @@ function lineEnd(cm, lineN) {
 function lineStartSmart(cm, pos) {
   var start = lineStart(cm, pos.line)
   var line = getLine(cm.doc, start.line)
-  var order = getOrder(line)
+  var order = getOrder(line, cm.doc.direction)
   if (!order || order[0].level == 0) {
     var firstNonWS = Math.max(0, line.text.search(/\S/))
     var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch
@@ -6761,19 +7065,30 @@ function lookupKeyForEditor(cm, name, handle) {
     || lookupKey(name, cm.options.keyMap, handle, cm)
 }
 
+// Note that, despite the name, this function is also used to check
+// for bound mouse clicks.
+
 var stopSeq = new Delayed
+
 function dispatchKey(cm, name, e, handle) {
   var seq = cm.state.keySeq
   if (seq) {
     if (isModifierKey(name)) { return "handled" }
-    stopSeq.set(50, function () {
-      if (cm.state.keySeq == seq) {
-        cm.state.keySeq = null
-        cm.display.input.reset()
-      }
-    })
-    name = seq + " " + name
+    if (/\'$/.test(name))
+      { cm.state.keySeq = null }
+    else
+      { stopSeq.set(50, function () {
+        if (cm.state.keySeq == seq) {
+          cm.state.keySeq = null
+          cm.display.input.reset()
+        }
+      }) }
+    if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true }
   }
+  return dispatchKeyInner(cm, name, e, handle)
+}
+
+function dispatchKeyInner(cm, name, e, handle) {
   var result = lookupKeyForEditor(cm, name, handle)
 
   if (result == "multi")
@@ -6786,10 +7101,6 @@ function dispatchKey(cm, name, e, handle) {
     restartBlink(cm)
   }
 
-  if (seq && !result && /\'$/.test(name)) {
-    e_preventDefault(e)
-    return true
-  }
   return !!result
 }
 
@@ -6872,6 +7183,37 @@ function onKeyPress(e) {
   cm.display.input.onKeyPress(e)
 }
 
+var DOUBLECLICK_DELAY = 400
+
+var PastClick = function(time, pos, button) {
+  this.time = time
+  this.pos = pos
+  this.button = button
+};
+
+PastClick.prototype.compare = function (time, pos, button) {
+  return this.time + DOUBLECLICK_DELAY > time &&
+    cmp(pos, this.pos) == 0 && button == this.button
+};
+
+var lastClick;
+var lastDoubleClick;
+function clickRepeat(pos, button) {
+  var now = +new Date
+  if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {
+    lastClick = lastDoubleClick = null
+    return "triple"
+  } else if (lastClick && lastClick.compare(now, pos, button)) {
+    lastDoubleClick = new PastClick(now, pos, button)
+    lastClick = null
+    return "double"
+  } else {
+    lastClick = new PastClick(now, pos, button)
+    lastDoubleClick = null
+    return "single"
+  }
+}
+
 // A mouse down can be a single click, double click, triple click,
 // start of selection drag, start of text drag, new cursor
 // (ctrl-click), rectangle drag (alt-drag), or xwin
@@ -6893,96 +7235,132 @@ function onMouseDown(e) {
     return
   }
   if (clickInGutter(cm, e)) { return }
-  var start = posFromMouse(cm, e)
+  var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"
   window.focus()
 
-  switch (e_button(e)) {
-  case 1:
-    // #3261: make sure, that we're not starting a second selection
-    if (cm.state.selectingText)
-      { cm.state.selectingText(e) }
-    else if (start)
-      { leftButtonDown(cm, e, start) }
-    else if (e_target(e) == display.scroller)
-      { e_preventDefault(e) }
-    break
-  case 2:
-    if (webkit) { cm.state.lastMiddleDown = +new Date }
-    if (start) { extendSelection(cm.doc, start) }
+  // #3261: make sure, that we're not starting a second selection
+  if (button == 1 && cm.state.selectingText)
+    { cm.state.selectingText(e) }
+
+  if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return }
+
+  if (button == 1) {
+    if (pos) { leftButtonDown(cm, pos, repeat, e) }
+    else if (e_target(e) == display.scroller) { e_preventDefault(e) }
+  } else if (button == 2) {
+    if (pos) { extendSelection(cm.doc, pos) }
     setTimeout(function () { return display.input.focus(); }, 20)
-    e_preventDefault(e)
-    break
-  case 3:
+  } else if (button == 3) {
     if (captureRightClick) { onContextMenu(cm, e) }
     else { delayBlurEvent(cm) }
-    break
   }
 }
 
-var lastClick;
-var lastDoubleClick;
-function leftButtonDown(cm, e, start) {
+function handleMappedButton(cm, button, pos, repeat, event) {
+  var name = "Click"
+  if (repeat == "double") { name = "Double" + name }
+  else if (repeat == "triple") { name = "Triple" + name }
+  name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name
+
+  return dispatchKey(cm,  addModifierNames(name, event), event, function (bound) {
+    if (typeof bound == "string") { bound = commands[bound] }
+    if (!bound) { return false }
+    var done = false
+    try {
+      if (cm.isReadOnly()) { cm.state.suppressEdits = true }
+      done = bound(cm, pos) != Pass
+    } finally {
+      cm.state.suppressEdits = false
+    }
+    return done
+  })
+}
+
+function configureMouse(cm, repeat, event) {
+  var option = cm.getOption("configureMouse")
+  var value = option ? option(cm, repeat, event) : {}
+  if (value.unit == null) {
+    var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey
+    value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"
+  }
+  if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey }
+  if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey }
+  if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey) }
+  return value
+}
+
+function leftButtonDown(cm, pos, repeat, event) {
   if (ie) { setTimeout(bind(ensureFocus, cm), 0) }
   else { cm.curOp.focus = activeElt() }
 
-  var now = +new Date, type
-  if (lastDoubleClick && lastDoubleClick.time > now - 400 && cmp(lastDoubleClick.pos, start) == 0) {
-    type = "triple"
-  } else if (lastClick && lastClick.time > now - 400 && cmp(lastClick.pos, start) == 0) {
-    type = "double"
-    lastDoubleClick = {time: now, pos: start}
-  } else {
-    type = "single"
-    lastClick = {time: now, pos: start}
-  }
+  var behavior = configureMouse(cm, repeat, event)
 
-  var sel = cm.doc.sel, modifier = mac ? e.metaKey : e.ctrlKey, contained
+  var sel = cm.doc.sel, contained
   if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() &&
-      type == "single" && (contained = sel.contains(start)) > -1 &&
-      (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
-      (cmp(contained.to(), start) > 0 || start.xRel < 0))
-    { leftButtonStartDrag(cm, e, start, modifier) }
+      repeat == "single" && (contained = sel.contains(pos)) > -1 &&
+      (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) &&
+      (cmp(contained.to(), pos) > 0 || pos.xRel < 0))
+    { leftButtonStartDrag(cm, event, pos, behavior) }
   else
-    { leftButtonSelect(cm, e, start, type, modifier) }
+    { leftButtonSelect(cm, event, pos, behavior) }
 }
 
 // Start a text drag. When it ends, see if any dragging actually
 // happen, and treat as a click if it didn't.
-function leftButtonStartDrag(cm, e, start, modifier) {
-  var display = cm.display, startTime = +new Date
-  var dragEnd = operation(cm, function (e2) {
+function leftButtonStartDrag(cm, event, pos, behavior) {
+  var display = cm.display, moved = false
+  var dragEnd = operation(cm, function (e) {
     if (webkit) { display.scroller.draggable = false }
     cm.state.draggingText = false
-    off(document, "mouseup", dragEnd)
+    off(display.wrapper.ownerDocument, "mouseup", dragEnd)
+    off(display.wrapper.ownerDocument, "mousemove", mouseMove)
+    off(display.scroller, "dragstart", dragStart)
     off(display.scroller, "drop", dragEnd)
-    if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
-      e_preventDefault(e2)
-      if (!modifier && +new Date - 200 < startTime)
-        { extendSelection(cm.doc, start) }
+    if (!moved) {
+      e_preventDefault(e)
+      if (!behavior.addNew)
+        { extendSelection(cm.doc, pos, null, null, behavior.extend) }
       // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081)
       if (webkit || ie && ie_version == 9)
-        { setTimeout(function () {document.body.focus(); display.input.focus()}, 20) }
+        { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus()}, 20) }
       else
         { display.input.focus() }
     }
   })
+  var mouseMove = function(e2) {
+    moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10
+  }
+  var dragStart = function () { return moved = true; }
   // Let the drag handler handle this.
   if (webkit) { display.scroller.draggable = true }
   cm.state.draggingText = dragEnd
-  dragEnd.copy = mac ? e.altKey : e.ctrlKey
+  dragEnd.copy = !behavior.moveOnDrag
   // IE's approach to draggable
   if (display.scroller.dragDrop) { display.scroller.dragDrop() }
-  on(document, "mouseup", dragEnd)
+  on(display.wrapper.ownerDocument, "mouseup", dragEnd)
+  on(display.wrapper.ownerDocument, "mousemove", mouseMove)
+  on(display.scroller, "dragstart", dragStart)
   on(display.scroller, "drop", dragEnd)
+
+  delayBlurEvent(cm)
+  setTimeout(function () { return display.input.focus(); }, 20)
+}
+
+function rangeForUnit(cm, pos, unit) {
+  if (unit == "char") { return new Range(pos, pos) }
+  if (unit == "word") { return cm.findWordAt(pos) }
+  if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) }
+  var result = unit(cm, pos)
+  return new Range(result.from, result.to)
 }
 
 // Normal selection, as opposed to text dragging.
-function leftButtonSelect(cm, e, start, type, addNew) {
+function leftButtonSelect(cm, event, start, behavior) {
   var display = cm.display, doc = cm.doc
-  e_preventDefault(e)
+  e_preventDefault(event)
 
   var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges
-  if (addNew && !e.shiftKey) {
+  if (behavior.addNew && !behavior.extend) {
     ourIndex = doc.sel.contains(start)
     if (ourIndex > -1)
       { ourRange = ranges[ourIndex] }
@@ -6993,28 +7371,19 @@ function leftButtonSelect(cm, e, start, type, addNew) {
     ourIndex = doc.sel.primIndex
   }
 
-  if (chromeOS ? e.shiftKey && e.metaKey : e.altKey) {
-    type = "rect"
-    if (!addNew) { ourRange = new Range(start, start) }
-    start = posFromMouse(cm, e, true, true)
+  if (behavior.unit == "rectangle") {
+    if (!behavior.addNew) { ourRange = new Range(start, start) }
+    start = posFromMouse(cm, event, true, true)
     ourIndex = -1
-  } else if (type == "double") {
-    var word = cm.findWordAt(start)
-    if (cm.display.shift || doc.extend)
-      { ourRange = extendRange(doc, ourRange, word.anchor, word.head) }
-    else
-      { ourRange = word }
-  } else if (type == "triple") {
-    var line = new Range(Pos(start.line, 0), clipPos(doc, Pos(start.line + 1, 0)))
-    if (cm.display.shift || doc.extend)
-      { ourRange = extendRange(doc, ourRange, line.anchor, line.head) }
-    else
-      { ourRange = line }
   } else {
-    ourRange = extendRange(doc, ourRange, start)
+    var range = rangeForUnit(cm, start, behavior.unit)
+    if (behavior.extend)
+      { ourRange = extendRange(ourRange, range.anchor, range.head, behavior.extend) }
+    else
+      { ourRange = range }
   }
 
-  if (!addNew) {
+  if (!behavior.addNew) {
     ourIndex = 0
     setSelection(doc, new Selection([ourRange], 0), sel_mouse)
     startSel = doc.sel
@@ -7022,7 +7391,7 @@ function leftButtonSelect(cm, e, start, type, addNew) {
     ourIndex = ranges.length
     setSelection(doc, normalizeSelection(ranges.concat([ourRange]), ourIndex),
                  {scroll: false, origin: "*mouse"})
-  } else if (ranges.length > 1 && ranges[ourIndex].empty() && type == "single" && !e.shiftKey) {
+  } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) {
     setSelection(doc, normalizeSelection(ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0),
                  {scroll: false, origin: "*mouse"})
     startSel = doc.sel
@@ -7035,7 +7404,7 @@ function leftButtonSelect(cm, e, start, type, addNew) {
     if (cmp(lastPos, pos) == 0) { return }
     lastPos = pos
 
-    if (type == "rect") {
+    if (behavior.unit == "rectangle") {
       var ranges = [], tabSize = cm.options.tabSize
       var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize)
       var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize)
@@ -7054,23 +7423,17 @@ function leftButtonSelect(cm, e, start, type, addNew) {
       cm.scrollIntoView(pos)
     } else {
       var oldRange = ourRange
-      var anchor = oldRange.anchor, head = pos
-      if (type != "single") {
-        var range
-        if (type == "double")
-          { range = cm.findWordAt(pos) }
-        else
-          { range = new Range(Pos(pos.line, 0), clipPos(doc, Pos(pos.line + 1, 0))) }
-        if (cmp(range.anchor, anchor) > 0) {
-          head = range.head
-          anchor = minPos(oldRange.from(), range.anchor)
-        } else {
-          head = range.anchor
-          anchor = maxPos(oldRange.to(), range.head)
-        }
+      var range = rangeForUnit(cm, pos, behavior.unit)
+      var anchor = oldRange.anchor, head
+      if (cmp(range.anchor, anchor) > 0) {
+        head = range.head
+        anchor = minPos(oldRange.from(), range.anchor)
+      } else {
+        head = range.anchor
+        anchor = maxPos(oldRange.to(), range.head)
       }
       var ranges$1 = startSel.ranges.slice(0)
-      ranges$1[ourIndex] = new Range(clipPos(doc, anchor), head)
+      ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head))
       setSelection(doc, normalizeSelection(ranges$1, ourIndex), sel_mouse)
     }
   }
@@ -7084,7 +7447,7 @@ function leftButtonSelect(cm, e, start, type, addNew) {
 
   function extend(e) {
     var curCount = ++counter
-    var cur = posFromMouse(cm, e, true, type == "rect")
+    var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle")
     if (!cur) { return }
     if (cmp(cur, lastPos) != 0) {
       cm.curOp.focus = activeElt()
@@ -7107,8 +7470,8 @@ function leftButtonSelect(cm, e, start, type, addNew) {
     counter = Infinity
     e_preventDefault(e)
     display.input.focus()
-    off(document, "mousemove", move)
-    off(document, "mouseup", up)
+    off(display.wrapper.ownerDocument, "mousemove", move)
+    off(display.wrapper.ownerDocument, "mouseup", up)
     doc.history.lastSelOrigin = null
   }
 
@@ -7118,8 +7481,42 @@ function leftButtonSelect(cm, e, start, type, addNew) {
   })
   var up = operation(cm, done)
   cm.state.selectingText = up
-  on(document, "mousemove", move)
-  on(document, "mouseup", up)
+  on(display.wrapper.ownerDocument, "mousemove", move)
+  on(display.wrapper.ownerDocument, "mouseup", up)
+}
+
+// Used when mouse-selecting to adjust the anchor to the proper side
+// of a bidi jump depending on the visual position of the head.
+function bidiSimplify(cm, range) {
+  var anchor = range.anchor;
+  var head = range.head;
+  var anchorLine = getLine(cm.doc, anchor.line)
+  if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range }
+  var order = getOrder(anchorLine)
+  if (!order) { return range }
+  var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index]
+  if (part.from != anchor.ch && part.to != anchor.ch) { return range }
+  var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1)
+  if (boundary == 0 || boundary == order.length) { return range }
+
+  // Compute the relative visual position of the head compared to the
+  // anchor (<0 is to the left, >0 to the right)
+  var leftSide
+  if (head.line != anchor.line) {
+    leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0
+  } else {
+    var headIndex = getBidiPartAt(order, head.ch, head.sticky)
+    var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1)
+    if (headIndex == boundary - 1 || headIndex == boundary)
+      { leftSide = dir < 0 }
+    else
+      { leftSide = dir > 0 }
+  }
+
+  var usePart = order[boundary + (leftSide ? -1 : 0)]
+  var from = leftSide == (usePart.level == 1)
+  var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before"
+  return anchor.ch == ch && anchor.sticky == sticky ? range : new Range(new Pos(anchor.line, ch, sticky), head)
 }
 
 
@@ -7127,8 +7524,13 @@ function leftButtonSelect(cm, e, start, type, addNew) {
 // handlers for the corresponding event.
 function gutterEvent(cm, e, type, prevent) {
   var mX, mY
-  try { mX = e.clientX; mY = e.clientY }
-  catch(e) { return false }
+  if (e.touches) {
+    mX = e.touches[0].clientX
+    mY = e.touches[0].clientY
+  } else {
+    try { mX = e.clientX; mY = e.clientY }
+    catch(e) { return false }
+  }
   if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false }
   if (prevent) { e_preventDefault(e) }
 
@@ -7210,6 +7612,7 @@ function defineOptions(CodeMirror) {
     clearCaches(cm)
     regChange(cm)
   }, true)
+
   option("lineSeparator", null, function (cm, val) {
     cm.doc.lineSep = val
     if (!val) { return }
@@ -7226,7 +7629,7 @@ function defineOptions(CodeMirror) {
     for (var i = newBreaks.length - 1; i >= 0; i--)
       { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)) }
   })
-  option("specialChars", /[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) {
+  option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g, function (cm, val, old) {
     cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g")
     if (old != Init) { cm.refresh() }
   })
@@ -7250,6 +7653,7 @@ function defineOptions(CodeMirror) {
     if (next.attach) { next.attach(cm, prev || null) }
   })
   option("extraKeys", null)
+  option("configureMouse", null)
 
   option("lineWrapping", false, wrappingChanged, true)
   option("gutters", [], function (cm) {
@@ -7277,14 +7681,12 @@ function defineOptions(CodeMirror) {
 
   option("resetSelectionOnContextMenu", true)
   option("lineWiseCopyCut", true)
+  option("pasteLinesPerSelection", true)
 
   option("readOnly", false, function (cm, val) {
     if (val == "nocursor") {
       onBlur(cm)
       cm.display.input.blur()
-      cm.display.disabled = true
-    } else {
-      cm.display.disabled = false
     }
     cm.display.input.readOnlyChanged(val)
   })
@@ -7311,6 +7713,7 @@ function defineOptions(CodeMirror) {
 
   option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; })
   option("autofocus", null)
+  option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true)
 }
 
 function guttersChanged(cm) {
@@ -7361,7 +7764,7 @@ function CodeMirror(place, options) {
   setGuttersForLineNumbers(options)
 
   var doc = options.value
-  if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator) }
+  if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction) }
   this.doc = doc
 
   var input = new CodeMirror.inputStyles[options.inputStyle](this)
@@ -7466,7 +7869,7 @@ function registerEventHandlers(cm) {
     return dx * dx + dy * dy > 20 * 20
   }
   on(d.scroller, "touchstart", function (e) {
-    if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e)) {
+    if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) {
       d.input.ensurePolled()
       clearTimeout(touchFinished)
       var now = +new Date
@@ -7504,7 +7907,7 @@ function registerEventHandlers(cm) {
   // area, ensure viewport is updated when scrolling.
   on(d.scroller, "scroll", function () {
     if (d.scroller.clientHeight) {
-      setScrollTop(cm, d.scroller.scrollTop)
+      updateScrollTop(cm, d.scroller.scrollTop)
       setScrollLeft(cm, d.scroller.scrollLeft, true)
       signal(cm, "scroll", cm)
     }
@@ -7548,7 +7951,7 @@ function indentLine(cm, n, how, aggressive) {
     // Fall back to "prev" when the mode doesn't have an indentation
     // method.
     if (!doc.mode.indent) { how = "prev" }
-    else { state = getStateBefore(cm, n) }
+    else { state = getContextBefore(cm, n).state }
   }
 
   var tabSize = cm.options.tabSize
@@ -7616,7 +8019,7 @@ function applyTextInput(cm, inserted, deleted, sel, origin) {
 
   var paste = cm.state.pasteIncoming || origin == "paste"
   var textLines = splitLinesAuto(inserted), multiPaste = null
-  // When pasing N lines into N selections, insert one line per selection
+  // When pasting N lines into N selections, insert one line per selection
   if (paste && sel.ranges.length > 1) {
     if (lastCopied && lastCopied.text.join("\n") == inserted) {
       if (sel.ranges.length % lastCopied.text.length == 0) {
@@ -7624,7 +8027,7 @@ function applyTextInput(cm, inserted, deleted, sel, origin) {
         for (var i = 0; i < lastCopied.text.length; i++)
           { multiPaste.push(doc.splitLines(lastCopied.text[i])) }
       }
-    } else if (textLines.length == sel.ranges.length) {
+    } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) {
       multiPaste = map(textLines, function (l) { return [l]; })
     }
   }
@@ -7884,7 +8287,7 @@ function addEditorMethods(CodeMirror) {
     getStateAfter: function(line, precise) {
       var doc = this.doc
       line = clipLine(doc, line == null ? doc.first + doc.size - 1: line)
-      return getStateBefore(this, line + 1, precise)
+      return getContextBefore(this, line + 1, precise).state
     },
 
     cursorCoords: function(start, mode) {
@@ -7959,12 +8362,13 @@ function addEditorMethods(CodeMirror) {
         node.style.left = left + "px"
       }
       if (scroll)
-        { scrollIntoView(this, left, top, left + node.offsetWidth, top + node.offsetHeight) }
+        { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}) }
     },
 
     triggerOnKeyDown: methodOp(onKeyDown),
     triggerOnKeyPress: methodOp(onKeyPress),
     triggerOnKeyUp: onKeyUp,
+    triggerOnMouseDown: methodOp(onMouseDown),
 
     execCommand: function(cmd) {
       if (commands.hasOwnProperty(cmd))
@@ -8037,7 +8441,7 @@ function addEditorMethods(CodeMirror) {
         goals.push(headPos.left)
         var pos = findPosV(this$1, headPos, dir, unit)
         if (unit == "page" && range == doc.sel.primary())
-          { addToScrollPos(this$1, null, charCoords(this$1, pos, "div").top - headPos.top) }
+          { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top) }
         return pos
       }, sel_move)
       if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++)
@@ -8074,11 +8478,7 @@ function addEditorMethods(CodeMirror) {
     hasFocus: function() { return this.display.input.getField() == activeElt() },
     isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) },
 
-    scrollTo: methodOp(function(x, y) {
-      if (x != null || y != null) { resolveScrollToPos(this) }
-      if (x != null) { this.curOp.scrollLeft = x }
-      if (y != null) { this.curOp.scrollTop = y }
-    }),
+    scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y) }),
     getScrollInfo: function() {
       var scroller = this.display.scroller
       return {left: scroller.scrollLeft, top: scroller.scrollTop,
@@ -8100,14 +8500,9 @@ function addEditorMethods(CodeMirror) {
       range.margin = margin || 0
 
       if (range.from.line != null) {
-        resolveScrollToPos(this)
-        this.curOp.scrollToPos = range
+        scrollToRange(this, range)
       } else {
-        var sPos = calculateScrollPos(this, Math.min(range.from.left, range.to.left),
-                                      Math.min(range.from.top, range.to.top) - range.margin,
-                                      Math.max(range.from.right, range.to.right),
-                                      Math.max(range.from.bottom, range.to.bottom) + range.margin)
-        this.scrollTo(sPos.scrollLeft, sPos.scrollTop)
+        scrollToCoordsRange(this, range.from, range.to, range.margin)
       }
     }),
 
@@ -8129,13 +8524,15 @@ function addEditorMethods(CodeMirror) {
     }),
 
     operation: function(f){return runInOp(this, f)},
+    startOperation: function(){return startOperation(this)},
+    endOperation: function(){return endOperation(this)},
 
     refresh: methodOp(function() {
       var oldHeight = this.display.cachedTextHeight
       regChange(this)
       this.curOp.forceUpdate = true
       clearCaches(this)
-      this.scrollTo(this.doc.scrollLeft, this.doc.scrollTop)
+      scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop)
       updateGutterSpace(this)
       if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5)
         { estimateLineHeights(this) }
@@ -8148,7 +8545,7 @@ function addEditorMethods(CodeMirror) {
       attachDoc(this, doc)
       clearCaches(this)
       this.display.input.reset()
-      this.scrollTo(doc.scrollLeft, doc.scrollTop)
+      scrollToCoords(this, doc.scrollLeft, doc.scrollTop)
       this.curOp.forceScroll = true
       signalLater(this, "swapDoc", this, old)
       return old
@@ -8281,9 +8678,7 @@ ContentEditableInput.prototype.init = function (display) {
   on(div, "paste", function (e) {
     if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return }
     // IE doesn't fire input events, so we schedule a read for the pasted content in this way
-    if (ie_version <= 11) { setTimeout(operation(cm, function () {
-      if (!input.pollContent()) { regChange(cm) }
-    }), 20) }
+    if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20) }
   })
 
   on(div, "compositionstart", function (e) {
@@ -8361,33 +8756,41 @@ ContentEditableInput.prototype.showSelection = function (info, takeFocus) {
 };
 
 ContentEditableInput.prototype.showPrimarySelection = function () {
-  var sel = window.getSelection(), prim = this.cm.doc.sel.primary()
-  var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset)
-  var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset)
+  var sel = window.getSelection(), cm = this.cm, prim = cm.doc.sel.primary()
+  var from = prim.from(), to = prim.to()
+
+  if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) {
+    sel.removeAllRanges()
+    return
+  }
+
+  var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
+  var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset)
   if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
-      cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&
-      cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)
+      cmp(minPos(curAnchor, curFocus), from) == 0 &&
+      cmp(maxPos(curAnchor, curFocus), to) == 0)
     { return }
 
-  var start = posToDOM(this.cm, prim.from())
-  var end = posToDOM(this.cm, prim.to())
-  if (!start && !end) { return }
-
-  var view = this.cm.display.view
-  var old = sel.rangeCount && sel.getRangeAt(0)
-  if (!start) {
-    start = {node: view[0].measure.map[2], offset: 0}
-  } else if (!end) { // FIXME dangerously hacky
+  var view = cm.display.view
+  var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) ||
+      {node: view[0].measure.map[2], offset: 0}
+  var end = to.line < cm.display.viewTo && posToDOM(cm, to)
+  if (!end) {
     var measure = view[view.length - 1].measure
     var map = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map
     end = {node: map[map.length - 1], offset: map[map.length - 2] - map[map.length - 3]}
   }
 
-  var rng
+  if (!start || !end) {
+    sel.removeAllRanges()
+    return
+  }
+
+  var old = sel.rangeCount && sel.getRangeAt(0), rng
   try { rng = range(start.node, start.offset, end.offset, end.node) }
   catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible
   if (rng) {
-    if (!gecko && this.cm.state.focused) {
+    if (!gecko && cm.state.focused) {
       sel.collapse(start.node, start.offset)
       if (!rng.collapsed) {
         sel.removeAllRanges()
@@ -8467,16 +8870,28 @@ ContentEditableInput.prototype.selectionChanged = function () {
 };
 
 ContentEditableInput.prototype.pollSelection = function () {
-  if (!this.composing && this.readDOMTimeout == null && !this.gracePeriod && this.selectionChanged()) {
-    var sel = window.getSelection(), cm = this.cm
-    this.rememberSelection()
-    var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
-    var head = domToPos(cm, sel.focusNode, sel.focusOffset)
-    if (anchor && head) { runInOp(cm, function () {
-      setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)
-      if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }
-    }) }
+  if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return }
+  var sel = window.getSelection(), cm = this.cm
+  // On Android Chrome (version 56, at least), backspacing into an
+  // uneditable block element will put the cursor in that element,
+  // and then, because it's not editable, hide the virtual keyboard.
+  // Because Android doesn't allow us to actually detect backspace
+  // presses in a sane way, this code checks for when that happens
+  // and simulates a backspace press in this case.
+  if (android && chrome && this.cm.options.gutters.length && isInGutter(sel.anchorNode)) {
+    this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs})
+    this.blur()
+    this.focus()
+    return
   }
+  if (this.composing) { return }
+  this.rememberSelection()
+  var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset)
+  var head = domToPos(cm, sel.focusNode, sel.focusOffset)
+  if (anchor && head) { runInOp(cm, function () {
+    setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll)
+    if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true }
+  }) }
 };
 
 ContentEditableInput.prototype.pollContent = function () {
@@ -8530,6 +8945,14 @@ ContentEditableInput.prototype.pollContent = function () {
   while (cutEnd < maxCutEnd &&
          newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1))
     { ++cutEnd }
+  // Try to move start of change to start of selection if ambiguous
+  if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) {
+    while (cutFront && cutFront > from.ch &&
+           newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) {
+      cutFront--
+      cutEnd++
+    }
+  }
 
   newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, "")
   newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, "")
@@ -8552,7 +8975,7 @@ ContentEditableInput.prototype.forceCompositionEnd = function () {
   if (!this.composing) { return }
   clearTimeout(this.readDOMTimeout)
   this.composing = null
-  if (!this.pollContent()) { regChange(this.cm) }
+  this.updateFromDOM()
   this.div.blur()
   this.div.focus()
 };
@@ -8566,11 +8989,17 @@ ContentEditableInput.prototype.readFromDOMSoon = function () {
       if (this$1.composing.done) { this$1.composing = null }
       else { return }
     }
-    if (this$1.cm.isReadOnly() || !this$1.pollContent())
-      { runInOp(this$1.cm, function () { return regChange(this$1.cm); }) }
+    this$1.updateFromDOM()
   }, 80)
 };
 
+ContentEditableInput.prototype.updateFromDOM = function () {
+    var this$1 = this;
+
+  if (this.cm.isReadOnly() || !this.pollContent())
+    { runInOp(this.cm, function () { return regChange(this$1.cm); }) }
+};
+
 ContentEditableInput.prototype.setUneditable = function (node) {
   node.contentEditable = "false"
 };
@@ -8597,7 +9026,7 @@ function posToDOM(cm, pos) {
   var line = getLine(cm.doc, pos.line)
   var info = mapFromLineView(view, line, pos.line)
 
-  var order = getOrder(line), side = "left"
+  var order = getOrder(line, cm.doc.direction), side = "left"
   if (order) {
     var partPos = getBidiPartAt(order, pos.ch)
     side = partPos % 2 ? "right" : "left"
@@ -8607,39 +9036,51 @@ function posToDOM(cm, pos) {
   return result
 }
 
+function isInGutter(node) {
+  for (var scan = node; scan; scan = scan.parentNode)
+    { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } }
+  return false
+}
+
 function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos }
 
 function domTextBetween(cm, from, to, fromLine, toLine) {
   var text = "", closing = false, lineSep = cm.doc.lineSeparator()
   function recognizeMarker(id) { return function (marker) { return marker.id == id; } }
+  function close() {
+    if (closing) {
+      text += lineSep
+      closing = false
+    }
+  }
+  function addText(str) {
+    if (str) {
+      close()
+      text += str
+    }
+  }
   function walk(node) {
     if (node.nodeType == 1) {
       var cmText = node.getAttribute("cm-text")
       if (cmText != null) {
-        if (cmText == "") { text += node.textContent.replace(/\u200b/g, "") }
-        else { text += cmText }
+        addText(cmText || node.textContent.replace(/\u200b/g, ""))
         return
       }
       var markerID = node.getAttribute("cm-marker"), range
       if (markerID) {
         var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID))
-        if (found.length && (range = found[0].find()))
-          { text += getBetween(cm.doc, range.from, range.to).join(lineSep) }
+        if (found.length && (range = found[0].find(0)))
+          { addText(getBetween(cm.doc, range.from, range.to).join(lineSep)) }
         return
       }
       if (node.getAttribute("contenteditable") == "false") { return }
+      var isBlock = /^(pre|div|p)$/i.test(node.nodeName)
+      if (isBlock) { close() }
       for (var i = 0; i < node.childNodes.length; i++)
         { walk(node.childNodes[i]) }
-      if (/^(pre|div|p)$/i.test(node.nodeName))
-        { closing = true }
+      if (isBlock) { closing = true }
     } else if (node.nodeType == 3) {
-      var val = node.nodeValue
-      if (!val) { return }
-      if (closing) {
-        text += lineSep
-        closing = false
-      }
-      text += val
+      addText(node.nodeValue)
     }
   }
   for (;;) {
@@ -8737,9 +9178,6 @@ var TextareaInput = function(cm) {
   this.pollingFast = false
   // Self-resetting timeout for the poller
   this.polling = new Delayed()
-  // Tracks when input.reset has punted to just putting a short
-  // string into the textarea instead of the full selection.
-  this.inaccurateSelection = false
   // Used to work around IE issue with selection being forgotten when focus moves away from textarea
   this.hasSelection = false
   this.composing = null
@@ -8749,13 +9187,10 @@ TextareaInput.prototype.init = function (display) {
     var this$1 = this;
 
   var input = this, cm = this.cm
+  this.createField(display)
+  var te = this.textarea
 
-  // Wraps and hides input textarea
-  var div = this.wrapper = hiddenTextarea()
-  // The semihidden textarea that is focused when the editor is
-  // focused, and receives input.
-  var te = this.textarea = div.firstChild
-  display.wrapper.insertBefore(div, display.wrapper.firstChild)
+  display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild)
 
   // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore)
   if (ios) { te.style.width = "0px" }
@@ -8776,12 +9211,6 @@ TextareaInput.prototype.init = function (display) {
     if (signalDOMEvent(cm, e)) { return }
     if (cm.somethingSelected()) {
       setLastCopied({lineWise: false, text: cm.getSelections()})
-      if (input.inaccurateSelection) {
-        input.prevInput = ""
-        input.inaccurateSelection = false
-        te.value = lastCopied.text.join("\n")
-        selectInput(te)
-      }
     } else if (!cm.options.lineWiseCopyCut) {
       return
     } else {
@@ -8828,6 +9257,14 @@ TextareaInput.prototype.init = function (display) {
   })
 };
 
+TextareaInput.prototype.createField = function (_display) {
+  // Wraps and hides input textarea
+  this.wrapper = hiddenTextarea()
+  // The semihidden textarea that is focused when the editor is
+  // focused, and receives input.
+  this.textarea = this.wrapper.firstChild
+};
+
 TextareaInput.prototype.prepareSelection = function () {
   // Redraw the selection and/or cursor
   var cm = this.cm, display = cm.display, doc = cm.doc
@@ -8859,14 +9296,11 @@ TextareaInput.prototype.showSelection = function (drawn) {
 // Reset the input to correspond to the selection (or to be empty,
 // when not typing and nothing is selected)
 TextareaInput.prototype.reset = function (typing) {
-  if (this.contextMenuPending) { return }
-  var minimal, selected, cm = this.cm, doc = cm.doc
+  if (this.contextMenuPending || this.composing) { return }
+  var cm = this.cm
   if (cm.somethingSelected()) {
     this.prevInput = ""
-    var range = doc.sel.primary()
-    minimal = hasCopyEvent &&
-      (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000)
-    var content = minimal ? "-" : selected || cm.getSelection()
+    var content = cm.getSelection()
     this.textarea.value = content
     if (cm.state.focused) { selectInput(this.textarea) }
     if (ie && ie_version >= 9) { this.hasSelection = content }
@@ -8874,7 +9308,6 @@ TextareaInput.prototype.reset = function (typing) {
     this.prevInput = this.textarea.value = ""
     if (ie && ie_version >= 9) { this.hasSelection = null }
   }
-  this.inaccurateSelection = minimal
 };
 
 TextareaInput.prototype.getField = function () { return this.textarea };
@@ -9069,6 +9502,7 @@ TextareaInput.prototype.onContextMenu = function (e) {
 
 TextareaInput.prototype.readOnlyChanged = function (val) {
   if (!val) { this.reset() }
+  this.textarea.disabled = val == "nocursor"
 };
 
 TextareaInput.prototype.setUneditable = function () {};
@@ -9224,7 +9658,7 @@ CodeMirror.fromTextArea = fromTextArea
 
 addLegacyProps(CodeMirror)
 
-CodeMirror.version = "5.24.2"
+CodeMirror.version = "5.36.0"
 
 return CodeMirror;
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/apl/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/apl/index.html.html
deleted file mode 100644
index 53dda6b58695c68766f960633529a1c4be80ef7a..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/apl/index.html.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: APL mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="./apl.js"></script>
-<style>
-	.CodeMirror { border: 2px inset #dee; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">APL</a>
-  </ul>
-</div>
-
-<article>
-<h2>APL mode</h2>
-<form><textarea id="code" name="code">
-鈲� Conway's game of life
-
-鈲� This example was inspired by the impressive demo at
-鈲� http://www.youtube.com/watch?v=a9xAKttWgP4
-
-鈲� Create a matrix:
-鈲�     0 1 1
-鈲�     1 1 0
-鈲�     0 1 0
-creature 鈫� (3 3 鈲� 鈲� 9) 鈭� 1 2 3 4 7   鈲� Original creature from demo
-creature 鈫� (3 3 鈲� 鈲� 9) 鈭� 1 3 6 7 8   鈲� Glider
-
-鈲� Place the creature on a larger board, near the centre
-board 鈫� 炉1 鈯� 炉2 鈱� 5 7 鈫� creature
-
-鈲� A function to move from one generation to the next
-life 鈫� {鈭�/ 1 鈲� 鈭� 3 4 = 鈯�+/ +鈱� 1 0 炉1 鈭�.鈯� 1 0 炉1 鈱铰� 鈯傗嵉}
-
-鈲� Compute n-th generation and format it as a
-鈲� character matrix
-gen 鈫� {' #'[(life 鈲� 鈲�) board]}
-
-鈲� Show first three generations
-(gen 1) (gen 2) (gen 3)
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/apl"
-      });
-    </script>
-
-    <p>Simple mode that tries to handle APL as well as it can.</p>
-    <p>It attempts to label functions/operators based upon
-    monadic/dyadic usage (but this is far from fully fleshed out).
-    This means there are meaningful classnames so hover states can
-    have popups etc.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/apl</code> (APL code)</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/apl/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/apl/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/apl/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/asciiarmor.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/asciiarmor.js.js
index d830903767c91e5d500253c495d21baf1aed8863..fa1b0f8c61b656e91a8c589de5716f131eaaa10e 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/asciiarmor.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/asciiarmor.js.js
@@ -68,6 +68,7 @@
   });
 
   CodeMirror.defineMIME("application/pgp", "asciiarmor");
+  CodeMirror.defineMIME("application/pgp-encrypted", "asciiarmor");
   CodeMirror.defineMIME("application/pgp-keys", "asciiarmor");
   CodeMirror.defineMIME("application/pgp-signature", "asciiarmor");
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/index.html.html
deleted file mode 100644
index 8ba1b5c76c292c0b8903493205a756fd76e12bc8..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/index.html.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: ASCII Armor (PGP) mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="asciiarmor.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">ASCII Armor</a>
-  </ul>
-</div>
-
-<article>
-<h2>ASCII Armor (PGP) mode</h2>
-<form><textarea id="code" name="code">
------BEGIN PGP MESSAGE-----
-Version: OpenPrivacy 0.99
-
-yDgBO22WxBHv7O8X7O/jygAEzol56iUKiXmV+XmpCtmpqQUKiQrFqclFqUDBovzS
-vBSFjNSiVHsuAA==
-=njUN
------END PGP MESSAGE-----
-</textarea></form>
-
-<script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true
-});
-</script>
-
-<p><strong>MIME types
-defined:</strong> <code>application/pgp</code>, <code>application/pgp-keys</code>, <code>application/pgp-signature</code></p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asciiarmor/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asn.1/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asn.1/index.html.html
deleted file mode 100644
index 699fd4473d4b86f0402db44f647e79b63133d40f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asn.1/index.html.html
+++ /dev/null
@@ -1,77 +0,0 @@
-锘�<!doctype html>
-
-<title>CodeMirror: ASN.1 mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="asn.1.js"></script>
-<style type="text/css">
-    .CodeMirror {
-        border-top: 1px solid black;
-        border-bottom: 1px solid black;
-    }
-</style>
-<div id=nav>
-    <a href="http://codemirror.net"><h1>CodeMirror</h1>
-        <img id=logo src="../../doc/logo.png">
-    </a>
-
-    <ul>
-        <li><a href="../../index.html">Home</a>
-        <li><a href="../../doc/manual.html">Manual</a>
-        <li><a href="https://github.com/codemirror/codemirror">Code</a>
-    </ul>
-    <ul>
-        <li><a href="../index.html">Language modes</a>
-        <li><a class=active href="http://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One">ASN.1</a>
-    </ul>
-</div>
-<article>
-    <h2>ASN.1 example</h2>
-    <div>
-        <textarea id="ttcn-asn-code">
- --
- -- Sample ASN.1 Code
- --
- MyModule DEFINITIONS ::=
- BEGIN
-
- MyTypes ::= SEQUENCE {
-     myObjectId   OBJECT IDENTIFIER,
-     mySeqOf      SEQUENCE OF MyInt,
-     myBitString  BIT STRING {
-                         muxToken(0),
-                         modemToken(1)
-                  }
- }
-
- MyInt ::= INTEGER (0..65535)
-
- END
-        </textarea>
-    </div>
-
-    <script>
-        var ttcnEditor = CodeMirror.fromTextArea(document.getElementById("ttcn-asn-code"), {
-            lineNumbers: true,
-            matchBrackets: true,
-            mode: "text/x-ttcn-asn"
-        });
-        ttcnEditor.setSize(400, 400);
-        var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
-        CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
-    </script>
-    <br/>
-    <p><strong>Language:</strong> Abstract Syntax Notation One
-        (<a href="http://www.itu.int/en/ITU-T/asn1/Pages/introduction.aspx">ASN.1</a>)
-    </p>
-    <p><strong>MIME types defined:</strong> <code>text/x-ttcn-asn</code></p>
-
-    <br/>
-    <p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
-    </a>.</p>
-    <p>Coded by Asmelash Tsegay Gebretsadkan </p>
-</article>
-
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asn.1/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asn.1/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asn.1/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asterisk/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asterisk/index.html.html
deleted file mode 100644
index 257bd398751adeae24bd8fa647a862b16da60773..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asterisk/index.html.html
+++ /dev/null
@@ -1,154 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Asterisk dialplan mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="asterisk.js"></script>
-<style>
-      .CodeMirror {border: 1px solid #999;}
-      .cm-s-default span.cm-arrow { color: red; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Asterisk dialplan</a>
-  </ul>
-</div>
-
-<article>
-<h2>Asterisk dialplan mode</h2>
-<form><textarea id="code" name="code">
-; extensions.conf - the Asterisk dial plan
-;
-
-[general]
-;
-; If static is set to no, or omitted, then the pbx_config will rewrite
-; this file when extensions are modified.  Remember that all comments
-; made in the file will be lost when that happens.
-static=yes
-
-#include "/etc/asterisk/additional_general.conf
-
-[iaxprovider]
-switch => IAX2/user:[key]@myserver/mycontext
-
-[dynamic]
-#exec /usr/bin/dynamic-peers.pl
-
-[trunkint]
-;
-; International long distance through trunk
-;
-exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
-exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})
-
-[local]
-;
-; Master context for local, toll-free, and iaxtel calls only
-;
-ignorepat => 9
-include => default
-
-[demo]
-include => stdexten
-;
-; We start with what to do when a call first comes in.
-;
-exten => s,1,Wait(1)			; Wait a second, just for fun
-same  => n,Answer			; Answer the line
-same  => n,Set(TIMEOUT(digit)=5)	; Set Digit Timeout to 5 seconds
-same  => n,Set(TIMEOUT(response)=10)	; Set Response Timeout to 10 seconds
-same  => n(restart),BackGround(demo-congrats)	; Play a congratulatory message
-same  => n(instruct),BackGround(demo-instruct)	; Play some instructions
-same  => n,WaitExten			; Wait for an extension to be dialed.
-
-exten => 2,1,BackGround(demo-moreinfo)	; Give some more information.
-exten => 2,n,Goto(s,instruct)
-
-exten => 3,1,Set(LANGUAGE()=fr)		; Set language to french
-exten => 3,n,Goto(s,restart)		; Start with the congratulations
-
-exten => 1000,1,Goto(default,s,1)
-;
-; We also create an example user, 1234, who is on the console and has
-; voicemail, etc.
-;
-exten => 1234,1,Playback(transfer,skip)		; "Please hold while..."
-					; (but skip if channel is not up)
-exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
-exten => 1234,n,Goto(default,s,1)		; exited Voicemail
-
-exten => 1235,1,Voicemail(1234,u)		; Right to voicemail
-
-exten => 1236,1,Dial(Console/dsp)		; Ring forever
-exten => 1236,n,Voicemail(1234,b)		; Unless busy
-
-;
-; # for when they're done with the demo
-;
-exten => #,1,Playback(demo-thanks)	; "Thanks for trying the demo"
-exten => #,n,Hangup			; Hang them up.
-
-;
-; A timeout and "invalid extension rule"
-;
-exten => t,1,Goto(#,1)			; If they take too long, give up
-exten => i,1,Playback(invalid)		; "That's not valid, try again"
-
-;
-; Create an extension, 500, for dialing the
-; Asterisk demo.
-;
-exten => 500,1,Playback(demo-abouttotry); Let them know what's going on
-exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default)	; Call the Asterisk demo
-exten => 500,n,Playback(demo-nogo)	; Couldn't connect to the demo site
-exten => 500,n,Goto(s,6)		; Return to the start over message.
-
-;
-; Create an extension, 600, for evaluating echo latency.
-;
-exten => 600,1,Playback(demo-echotest)	; Let them know what's going on
-exten => 600,n,Echo			; Do the echo test
-exten => 600,n,Playback(demo-echodone)	; Let them know it's over
-exten => 600,n,Goto(s,6)		; Start over
-
-;
-;	You can use the Macro Page to intercom a individual user
-exten => 76245,1,Macro(page,SIP/Grandstream1)
-; or if your peernames are the same as extensions
-exten => _7XXX,1,Macro(page,SIP/${EXTEN})
-;
-;
-; System Wide Page at extension 7999
-;
-exten => 7999,1,Set(TIMEOUT(absolute)=60)
-exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)
-
-; Give voicemail at extension 8500
-;
-exten => 8500,1,VoicemailMain
-exten => 8500,n,Goto(s,6)
-
-    </textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "text/x-asterisk",
-        matchBrackets: true,
-        lineNumber: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-asterisk</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asterisk/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asterisk/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/asterisk/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/brainfuck/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/brainfuck/index.html.html
deleted file mode 100644
index 6048fc24128f08950287361440d328baa6e50a7e..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/brainfuck/index.html.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Brainfuck mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="./brainfuck.js"></script>
-<style>
-	.CodeMirror { border: 2px inset #dee; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#"></a>
-  </ul>
-</div>
-
-<article>
-<h2>Brainfuck mode</h2>
-<form><textarea id="code" name="code">
-[ This program prints "Hello World!" and a newline to the screen, its
-  length is 106 active command characters [it is not the shortest.]
-
-  This loop is a "comment loop", it's a simple way of adding a comment
-  to a BF program such that you don't have to worry about any command
-  characters. Any ".", ",", "+", "-", "&lt;" and "&gt;" characters are simply
-  ignored, the "[" and "]" characters just have to be balanced.
-]
-+++++ +++               Set Cell #0 to 8
-[
-    &gt;++++               Add 4 to Cell #1; this will always set Cell #1 to 4
-    [                   as the cell will be cleared by the loop
-        &gt;++             Add 2 to Cell #2
-        &gt;+++            Add 3 to Cell #3
-        &gt;+++            Add 3 to Cell #4
-        &gt;+              Add 1 to Cell #5
-        &lt;&lt;&lt;&lt;-           Decrement the loop counter in Cell #1
-    ]                   Loop till Cell #1 is zero; number of iterations is 4
-    &gt;+                  Add 1 to Cell #2
-    &gt;+                  Add 1 to Cell #3
-    &gt;-                  Subtract 1 from Cell #4
-    &gt;&gt;+                 Add 1 to Cell #6
-    [&lt;]                 Move back to the first zero cell you find; this will
-                        be Cell #1 which was cleared by the previous loop
-    &lt;-                  Decrement the loop Counter in Cell #0
-]                       Loop till Cell #0 is zero; number of iterations is 8
-
-The result of this is:
-Cell No :   0   1   2   3   4   5   6
-Contents:   0   0  72 104  88  32   8
-Pointer :   ^
-
-&gt;&gt;.                     Cell #2 has value 72 which is 'H'
-&gt;---.                   Subtract 3 from Cell #3 to get 101 which is 'e'
-+++++++..+++.           Likewise for 'llo' from Cell #3
-&gt;&gt;.                     Cell #5 is 32 for the space
-&lt;-.                     Subtract 1 from Cell #4 for 87 to give a 'W'
-&lt;.                      Cell #3 was set to 'o' from the end of 'Hello'
-+++.------.--------.    Cell #3 for 'rl' and 'd'
-&gt;&gt;+.                    Add 1 to Cell #5 gives us an exclamation point
-&gt;++.                    And finally a newline from Cell #6
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-brainfuck"
-      });
-    </script>
-
-    <p>A mode for Brainfuck</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-brainfuck</code></p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/brainfuck/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/brainfuck/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/brainfuck/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/clike.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/clike.js.js
index 7424c9a051859681c1008e329cd684e19f7457f3..da7a6bf5b6697024df598c44c52dcb5851d38067 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/clike.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/clike.js.js
@@ -33,7 +33,7 @@ function popContext(state) {
 }
 
 function typeBefore(stream, state, pos) {
-  if (state.prevToken == "variable" || state.prevToken == "variable-3") return true;
+  if (state.prevToken == "variable" || state.prevToken == "type") return true;
   if (/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(stream.string.slice(0, pos))) return true;
   if (state.typeAtEndOfLine && stream.column() == stream.indentation()) return true;
 }
@@ -64,7 +64,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
       isPunctuationChar = parserConfig.isPunctuationChar || /[\[\]{}\(\),;\:\.]/,
       numberStart = parserConfig.numberStart || /[\d\.]/,
       number = parserConfig.number || /^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,
-      isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/;
+      isOperatorChar = parserConfig.isOperatorChar || /[+\-*&%=<>!?|\/]/,
+      isIdentifierChar = parserConfig.isIdentifierChar || /[\w\$_\xa1-\uffff]/;
 
   var curPunc, isDefKeyword;
 
@@ -101,9 +102,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
       while (!stream.match(/^\/[\/*]/, false) && stream.eat(isOperatorChar)) {}
       return "operator";
     }
-    stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+    stream.eatWhile(isIdentifierChar);
     if (namespaceSeparator) while (stream.match(namespaceSeparator))
-      stream.eatWhile(/[\w\$_\xa1-\uffff]/);
+      stream.eatWhile(isIdentifierChar);
 
     var cur = stream.current();
     if (contains(keywords, cur)) {
@@ -111,7 +112,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
       if (contains(defKeywords, cur)) isDefKeyword = true;
       return "keyword";
     }
-    if (contains(types, cur)) return "variable-3";
+    if (contains(types, cur)) return "type";
     if (contains(builtin, cur)) {
       if (contains(blockKeywords, cur)) curPunc = "newstatement";
       return "builtin";
@@ -243,6 +244,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
     electricInput: indentSwitch ? /^\s*(?:case .*?:|default:|\{\}?|\})$/ : /^\s*[{}]$/,
     blockCommentStart: "/*",
     blockCommentEnd: "*/",
+    blockCommentContinue: " * ",
     lineComment: "//",
     fold: "brace"
   };
@@ -280,7 +282,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
   }
 
   function pointerHook(_stream, state) {
-    if (state.prevToken == "variable-3") return "variable-3";
+    if (state.prevToken == "type") return "type";
     return false;
   }
 
@@ -314,7 +316,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
   }
 
   function cppLooksLikeConstructor(word) {
-    var lastTwo = /(\w+)::(\w+)$/.exec(word);
+    var lastTwo = /(\w+)::~?(\w+)$/.exec(word);
     return lastTwo && lastTwo[1] == lastTwo[2];
   }
 
@@ -372,7 +374,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
     blockKeywords: words("case do else for if switch while struct"),
     defKeywords: words("struct"),
     typeFirstDefinitions: true,
-    atoms: words("null true false"),
+    atoms: words("NULL true false"),
     hooks: {"#": cppHook, "*": pointerHook},
     modeProps: {fold: ["brace", "include"]}
   });
@@ -388,8 +390,9 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
     blockKeywords: words("catch class do else finally for if struct switch try while"),
     defKeywords: words("class namespace struct enum union"),
     typeFirstDefinitions: true,
-    atoms: words("true false null"),
+    atoms: words("true false NULL"),
     dontIndentStatements: /^template$/,
+    isIdentifierChar: /[\w\$_~\xa1-\uffff]/,
     hooks: {
       "#": cppHook,
       "*": pointerHook,
@@ -429,7 +432,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
     types: words("byte short int long float double boolean char void Boolean Byte Character Double Float " +
                  "Integer Long Number Object Short String StringBuffer StringBuilder Void"),
     blockKeywords: words("catch class do else finally for if switch try while"),
-    defKeywords: words("class interface package enum @interface"),
+    defKeywords: words("class interface enum @interface"),
     typeFirstDefinitions: true,
     atoms: words("true false null"),
     number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
@@ -486,6 +489,27 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
     return "string";
   }
 
+  function tokenNestedComment(depth) {
+    return function (stream, state) {
+      var ch
+      while (ch = stream.next()) {
+        if (ch == "*" && stream.eat("/")) {
+          if (depth == 1) {
+            state.tokenize = null
+            break
+          } else {
+            state.tokenize = tokenNestedComment(depth - 1)
+            return state.tokenize(stream, state)
+          }
+        } else if (ch == "/" && stream.eat("*")) {
+          state.tokenize = tokenNestedComment(depth + 1)
+          return state.tokenize(stream, state)
+        }
+      }
+      return "comment"
+    }
+  }
+
   def("text/x-scala", {
     name: "clike",
     keywords: words(
@@ -513,8 +537,8 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
       "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
     ),
     multiLineStrings: true,
-    blockKeywords: words("catch class do else finally for forSome if match switch try while"),
-    defKeywords: words("class def object package trait type val var"),
+    blockKeywords: words("catch class enum do else finally for forSome if match switch try while"),
+    defKeywords: words("class enum def object package trait type val var"),
     atoms: words("true false null"),
     indentStatements: false,
     indentSwitch: false,
@@ -541,6 +565,12 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
         } else {
           return false
         }
+      },
+
+      "/": function(stream, state) {
+        if (!stream.eat("*")) return false
+        state.tokenize = tokenNestedComment(1)
+        return state.tokenize(stream, state)
       }
     },
     modeProps: {closeBrackets: {triples: '"'}}
@@ -567,28 +597,31 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
     name: "clike",
     keywords: words(
       /*keywords*/
-      "package as typealias class interface this super val " +
-      "var fun for is in This throw return " +
+      "package as typealias class interface this super val operator " +
+      "var fun for is in This throw return annotation " +
       "break continue object if else while do try when !in !is as? " +
 
       /*soft keywords*/
       "file import where by get set abstract enum open inner override private public internal " +
       "protected catch finally out final vararg reified dynamic companion constructor init " +
       "sealed field property receiver param sparam lateinit data inline noinline tailrec " +
-      "external annotation crossinline const operator infix"
+      "external annotation crossinline const operator infix suspend actual expect setparam"
     ),
     types: words(
       /* package java.lang */
       "Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable " +
       "Compiler Double Exception Float Integer Long Math Number Object Package Pair Process " +
       "Runtime Runnable SecurityManager Short StackTraceElement StrictMath String " +
-      "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"
+      "StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray " +
+      "ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy " +
+      "LazyThreadSafetyMode LongArray Nothing ShortArray Unit"
     ),
     intendSwitch: false,
     indentStatements: false,
     multiLineStrings: true,
+    number: /^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,
     blockKeywords: words("catch class do else finally for if where try while enum"),
-    defKeywords: words("class val var object package interface fun"),
+    defKeywords: words("class val var object interface fun"),
     atoms: words("true false null this"),
     hooks: {
       '"': function(stream, state) {
@@ -771,7 +804,7 @@ CodeMirror.defineMode("clike", function(config, parserConfig) {
         return "atom";
       },
       token: function(_stream, state, style) {
-          if ((style == "variable" || style == "variable-3") &&
+          if ((style == "variable" || style == "type") &&
               state.prevToken == ".") {
             return "variable-2";
           }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/index.html.html
deleted file mode 100644
index 45c670ae5805710f305d7cf7c53d9890c5a92526..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/index.html.html
+++ /dev/null
@@ -1,360 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: C-like mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<link rel="stylesheet" href="../../addon/hint/show-hint.css">
-<script src="../../addon/hint/show-hint.js"></script>
-<script src="clike.js"></script>
-<style>.CodeMirror {border: 2px inset #dee;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">C-like</a>
-  </ul>
-</div>
-
-<article>
-<h2>C-like mode</h2>
-
-<div><textarea id="c-code">
-/* C demo code */
-
-#include <zmq.h>
-#include <pthread.h>
-#include <semaphore.h>
-#include <time.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <malloc.h>
-
-typedef struct {
-  void* arg_socket;
-  zmq_msg_t* arg_msg;
-  char* arg_string;
-  unsigned long arg_len;
-  int arg_int, arg_command;
-
-  int signal_fd;
-  int pad;
-  void* context;
-  sem_t sem;
-} acl_zmq_context;
-
-#define p(X) (context->arg_##X)
-
-void* zmq_thread(void* context_pointer) {
-  acl_zmq_context* context = (acl_zmq_context*)context_pointer;
-  char ok = 'K', err = 'X';
-  int res;
-
-  while (1) {
-    while ((res = sem_wait(&amp;context->sem)) == EINTR);
-    if (res) {write(context->signal_fd, &amp;err, 1); goto cleanup;}
-    switch(p(command)) {
-    case 0: goto cleanup;
-    case 1: p(socket) = zmq_socket(context->context, p(int)); break;
-    case 2: p(int) = zmq_close(p(socket)); break;
-    case 3: p(int) = zmq_bind(p(socket), p(string)); break;
-    case 4: p(int) = zmq_connect(p(socket), p(string)); break;
-    case 5: p(int) = zmq_getsockopt(p(socket), p(int), (void*)p(string), &amp;p(len)); break;
-    case 6: p(int) = zmq_setsockopt(p(socket), p(int), (void*)p(string), p(len)); break;
-    case 7: p(int) = zmq_send(p(socket), p(msg), p(int)); break;
-    case 8: p(int) = zmq_recv(p(socket), p(msg), p(int)); break;
-    case 9: p(int) = zmq_poll(p(socket), p(int), p(len)); break;
-    }
-    p(command) = errno;
-    write(context->signal_fd, &amp;ok, 1);
-  }
- cleanup:
-  close(context->signal_fd);
-  free(context_pointer);
-  return 0;
-}
-
-void* zmq_thread_init(void* zmq_context, int signal_fd) {
-  acl_zmq_context* context = malloc(sizeof(acl_zmq_context));
-  pthread_t thread;
-
-  context->context = zmq_context;
-  context->signal_fd = signal_fd;
-  sem_init(&amp;context->sem, 1, 0);
-  pthread_create(&amp;thread, 0, &amp;zmq_thread, context);
-  pthread_detach(thread);
-  return context;
-}
-</textarea></div>
-
-<h2>C++ example</h2>
-
-<div><textarea id="cpp-code">
-#include <iostream>
-#include "mystuff/util.h"
-
-namespace {
-enum Enum {
-  VAL1, VAL2, VAL3
-};
-
-char32_t unicode_string = U"\U0010FFFF";
-string raw_string = R"delim(anything
-you
-want)delim";
-
-int Helper(const MyType& param) {
-  return 0;
-}
-} // namespace
-
-class ForwardDec;
-
-template <class T, class V>
-class Class : public BaseClass {
-  const MyType<T, V> member_;
-
- public:
-  const MyType<T, V>& Method() const {
-    return member_;
-  }
-
-  void Method2(MyType<T, V>* value);
-}
-
-template <class T, class V>
-void Class::Method2(MyType<T, V>* value) {
-  std::out << 1 >> method();
-  value->Method3(member_);
-  member_ = value;
-}
-</textarea></div>
-
-<h2>Objective-C example</h2>
-
-<div><textarea id="objectivec-code">
-/*
-This is a longer comment
-That spans two lines
-*/
-
-#import <Test/Test.h>
-@implementation YourAppDelegate
-
-// This is a one-line comment
-
-- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
-  char myString[] = "This is a C character array";
-  int test = 5;
-  return YES;
-}
-</textarea></div>
-
-<h2>Java example</h2>
-
-<div><textarea id="java-code">
-import com.demo.util.MyType;
-import com.demo.util.MyInterface;
-
-public enum Enum {
-  VAL1, VAL2, VAL3
-}
-
-public class Class<T, V> implements MyInterface {
-  public static final MyType<T, V> member;
-  
-  private class InnerClass {
-    public int zero() {
-      return 0;
-    }
-  }
-
-  @Override
-  public MyType method() {
-    return member;
-  }
-
-  public void method2(MyType<T, V> value) {
-    method();
-    value.method3();
-    member = value;
-  }
-}
-</textarea></div>
-
-<h2>Scala example</h2>
-
-<div><textarea id="scala-code">
-object FilterTest extends App {
-  def filter(xs: List[Int], threshold: Int) = {
-    def process(ys: List[Int]): List[Int] =
-      if (ys.isEmpty) ys
-      else if (ys.head < threshold) ys.head :: process(ys.tail)
-      else process(ys.tail)
-    process(xs)
-  }
-  println(filter(List(1, 9, 2, 8, 3, 7, 4), 5))
-}
-</textarea></div>
-
-<h2>Kotlin mode</h2>
-
-<div><textarea id="kotlin-code">
-package org.wasabi.http
-
-import java.util.concurrent.Executors
-import java.net.InetSocketAddress
-import org.wasabi.app.AppConfiguration
-import io.netty.bootstrap.ServerBootstrap
-import io.netty.channel.nio.NioEventLoopGroup
-import io.netty.channel.socket.nio.NioServerSocketChannel
-import org.wasabi.app.AppServer
-
-public class HttpServer(private val appServer: AppServer) {
-
-    val bootstrap: ServerBootstrap
-    val primaryGroup: NioEventLoopGroup
-    val workerGroup:  NioEventLoopGroup
-
-    init {
-        // Define worker groups
-        primaryGroup = NioEventLoopGroup()
-        workerGroup = NioEventLoopGroup()
-
-        // Initialize bootstrap of server
-        bootstrap = ServerBootstrap()
-
-        bootstrap.group(primaryGroup, workerGroup)
-        bootstrap.channel(javaClass<NioServerSocketChannel>())
-        bootstrap.childHandler(NettyPipelineInitializer(appServer))
-    }
-
-    public fun start(wait: Boolean = true) {
-        val channel = bootstrap.bind(appServer.configuration.port)?.sync()?.channel()
-
-        if (wait) {
-            channel?.closeFuture()?.sync()
-        }
-    }
-
-    public fun stop() {
-        // Shutdown all event loops
-        primaryGroup.shutdownGracefully()
-        workerGroup.shutdownGracefully()
-
-        // Wait till all threads are terminated
-        primaryGroup.terminationFuture().sync()
-        workerGroup.terminationFuture().sync()
-    }
-}
-</textarea></div>
-
-<h2>Ceylon mode</h2>
-
-<div><textarea id="ceylon-code">
-"Produces the [[stream|Iterable]] that results from repeated
- application of the given [[function|next]] to the given
- [[first]] element of the stream, until the function first
- returns [[finished]]. If the given function never returns 
- `finished`, the resulting stream is infinite.
-
- For example:
-
-     loop(0)(2.plus).takeWhile(10.largerThan)
-
- produces the stream `{ 0, 2, 4, 6, 8 }`."
-tagged("Streams")
-shared {Element+} loop&lt;Element&gt;(
-        "The first element of the resulting stream."
-        Element first)(
-        "The function that produces the next element of the
-         stream, given the current element. The function may
-         return [[finished]] to indicate the end of the 
-         stream."
-        Element|Finished next(Element element))
-    =&gt; let (start = first)
-    object satisfies {Element+} {
-        first =&gt; start;
-        empty =&gt; false;
-        function nextElement(Element element)
-                =&gt; next(element);
-        iterator()
-                =&gt; object satisfies Iterator&lt;Element&gt; {
-            variable Element|Finished current = start;
-            shared actual Element|Finished next() {
-                if (!is Finished result = current) {
-                    current = nextElement(result);
-                    return result;
-                }
-                else {
-                    return finished;
-                }
-            }
-        };
-    };
-</textarea></div>
-
-    <script>
-      var cEditor = CodeMirror.fromTextArea(document.getElementById("c-code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-csrc"
-      });
-      var cppEditor = CodeMirror.fromTextArea(document.getElementById("cpp-code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-c++src"
-      });
-      var javaEditor = CodeMirror.fromTextArea(document.getElementById("java-code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-java"
-      });
-      var objectivecEditor = CodeMirror.fromTextArea(document.getElementById("objectivec-code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-objectivec"
-      });
-      var scalaEditor = CodeMirror.fromTextArea(document.getElementById("scala-code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-scala"
-      });
-      var kotlinEditor = CodeMirror.fromTextArea(document.getElementById("kotlin-code"), {
-          lineNumbers: true,
-          matchBrackets: true,
-          mode: "text/x-kotlin"
-      });
-      var ceylonEditor = CodeMirror.fromTextArea(document.getElementById("ceylon-code"), {
-          lineNumbers: true,
-          matchBrackets: true,
-          mode: "text/x-ceylon"
-      });
-      var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
-      CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
-    </script>
-
-    <p>Simple mode that tries to handle C-like languages as well as it
-    can. Takes two configuration parameters: <code>keywords</code>, an
-    object whose property names are the keywords in the language,
-    and <code>useCPP</code>, which determines whether C preprocessor
-    directives are recognized.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-csrc</code>
-    (C), <code>text/x-c++src</code> (C++), <code>text/x-java</code>
-    (Java), <code>text/x-csharp</code> (C#),
-    <code>text/x-objectivec</code> (Objective-C),
-    <code>text/x-scala</code> (Scala), <code>text/x-vertex</code>
-    <code>x-shader/x-fragment</code> (shader programs),
-    <code>text/x-squirrel</code> (Squirrel) and
-    <code>text/x-ceylon</code> (Ceylon)</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.xml
index 7fcbb1360a51277879fa314770699659ac7319f3..ff55a8d72438c0873842563cc1713cbfdb298a26 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.xml
@@ -2,29 +2,51 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>scala.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
+            <key> <string>_bind_names</string> </key>
             <value>
-              <dictionary/>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
             </value>
         </item>
         <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>scala.html</string> </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>iso-8859-15</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.zpt
similarity index 97%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.html
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.zpt
index aa04cf0f04af5a0056af7949ed6cd06288f1d085..180c0f895cd3a03ea2df0b860f6adcf563143a3e 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.html
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/scala.html.zpt
@@ -1,767 +1,767 @@
-<!doctype html>
-
-<title>CodeMirror: Scala mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/ambiance.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="clike.js"></script>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Scala</a>
-  </ul>
-</div>
-
-<article>
-<h2>Scala mode</h2>
-<form>
-<textarea id="code" name="code">
-
-  /*                     __                                               *\
-  **     ________ ___   / /  ___     Scala API                            **
-  **    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
-  **  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
-  ** /____/\___/_/ |_/____/_/ | |                                         **
-  **                          |/                                          **
-  \*                                                                      */
-
-  package scala.collection
-
-  import generic._
-  import mutable.{ Builder, ListBuffer }
-  import annotation.{tailrec, migration, bridge}
-  import annotation.unchecked.{ uncheckedVariance => uV }
-  import parallel.ParIterable
-
-  /** A template trait for traversable collections of type `Traversable[A]`.
-   *  
-   *  $traversableInfo
-   *  @define mutability
-   *  @define traversableInfo
-   *  This is a base trait of all kinds of $mutability Scala collections. It
-   *  implements the behavior common to all collections, in terms of a method
-   *  `foreach` with signature:
-   * {{{
-   *     def foreach[U](f: Elem => U): Unit
-   * }}}
-   *  Collection classes mixing in this trait provide a concrete 
-   *  `foreach` method which traverses all the
-   *  elements contained in the collection, applying a given function to each.
-   *  They also need to provide a method `newBuilder`
-   *  which creates a builder for collections of the same kind.
-   *  
-   *  A traversable class might or might not have two properties: strictness
-   *  and orderedness. Neither is represented as a type.
-   *  
-   *  The instances of a strict collection class have all their elements
-   *  computed before they can be used as values. By contrast, instances of
-   *  a non-strict collection class may defer computation of some of their
-   *  elements until after the instance is available as a value.
-   *  A typical example of a non-strict collection class is a
-   *  <a href="../immutable/Stream.html" target="ContentFrame">
-   *  `scala.collection.immutable.Stream`</a>.
-   *  A more general class of examples are `TraversableViews`.
-   *  
-   *  If a collection is an instance of an ordered collection class, traversing
-   *  its elements with `foreach` will always visit elements in the
-   *  same order, even for different runs of the program. If the class is not
-   *  ordered, `foreach` can visit elements in different orders for
-   *  different runs (but it will keep the same order in the same run).'
-   * 
-   *  A typical example of a collection class which is not ordered is a
-   *  `HashMap` of objects. The traversal order for hash maps will
-   *  depend on the hash codes of its elements, and these hash codes might
-   *  differ from one run to the next. By contrast, a `LinkedHashMap`
-   *  is ordered because it's `foreach` method visits elements in the
-   *  order they were inserted into the `HashMap`.
-   *
-   *  @author Martin Odersky
-   *  @version 2.8
-   *  @since   2.8
-   *  @tparam A    the element type of the collection
-   *  @tparam Repr the type of the actual collection containing the elements.
-   *
-   *  @define Coll Traversable
-   *  @define coll traversable collection
-   */
-  trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr] 
-                                      with FilterMonadic[A, Repr]
-                                      with TraversableOnce[A]
-                                      with GenTraversableLike[A, Repr]
-                                      with Parallelizable[A, ParIterable[A]]
-  {
-    self =>
-
-    import Traversable.breaks._
-
-    /** The type implementing this traversable */
-    protected type Self = Repr
-
-    /** The collection of type $coll underlying this `TraversableLike` object.
-     *  By default this is implemented as the `TraversableLike` object itself,
-     *  but this can be overridden.
-     */
-    def repr: Repr = this.asInstanceOf[Repr]
-
-    /** The underlying collection seen as an instance of `$Coll`.
-     *  By default this is implemented as the current collection object itself,
-     *  but this can be overridden.
-     */
-    protected[this] def thisCollection: Traversable[A] = this.asInstanceOf[Traversable[A]]
-
-    /** A conversion from collections of type `Repr` to `$Coll` objects.
-     *  By default this is implemented as just a cast, but this can be overridden.
-     */
-    protected[this] def toCollection(repr: Repr): Traversable[A] = repr.asInstanceOf[Traversable[A]]
-
-    /** Creates a new builder for this collection type.
-     */
-    protected[this] def newBuilder: Builder[A, Repr]
-
-    protected[this] def parCombiner = ParIterable.newCombiner[A]
-
-    /** Applies a function `f` to all elements of this $coll.
-     *  
-     *    Note: this method underlies the implementation of most other bulk operations.
-     *    It's important to implement this method in an efficient way.
-     *  
-     *
-     *  @param  f   the function that is applied for its side-effect to every element.
-     *              The result of function `f` is discarded.
-     *              
-     *  @tparam  U  the type parameter describing the result of function `f`. 
-     *              This result will always be ignored. Typically `U` is `Unit`,
-     *              but this is not necessary.
-     *
-     *  @usecase def foreach(f: A => Unit): Unit
-     */
-    def foreach[U](f: A => U): Unit
-
-    /** Tests whether this $coll is empty.
-     *
-     *  @return    `true` if the $coll contain no elements, `false` otherwise.
-     */
-    def isEmpty: Boolean = {
-      var result = true
-      breakable {
-        for (x <- this) {
-          result = false
-          break
-        }
-      }
-      result
-    }
-
-    /** Tests whether this $coll is known to have a finite size.
-     *  All strict collections are known to have finite size. For a non-strict collection
-     *  such as `Stream`, the predicate returns `true` if all elements have been computed.
-     *  It returns `false` if the stream is not yet evaluated to the end.
-     *
-     *  Note: many collection methods will not work on collections of infinite sizes. 
-     *
-     *  @return  `true` if this collection is known to have finite size, `false` otherwise.
-     */
-    def hasDefiniteSize = true
-
-    def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-      val b = bf(repr)
-      if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.seq.size)
-      b ++= thisCollection
-      b ++= that.seq
-      b.result
-    }
-
-    @bridge
-    def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
-      ++(that: GenTraversableOnce[B])(bf)
-
-    /** Concatenates this $coll with the elements of a traversable collection.
-     *  It differs from ++ in that the right operand determines the type of the
-     *  resulting collection rather than the left one.
-     * 
-     *  @param that   the traversable to append.
-     *  @tparam B     the element type of the returned collection. 
-     *  @tparam That  $thatinfo
-     *  @param bf     $bfinfo
-     *  @return       a new collection of type `That` which contains all elements
-     *                of this $coll followed by all elements of `that`.
-     * 
-     *  @usecase def ++:[B](that: TraversableOnce[B]): $Coll[B]
-     *  
-     *  @return       a new $coll which contains all elements of this $coll
-     *                followed by all elements of `that`.
-     */
-    def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-      val b = bf(repr)
-      if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.size)
-      b ++= that
-      b ++= thisCollection
-      b.result
-    }
-
-    /** This overload exists because: for the implementation of ++: we should reuse
-     *  that of ++ because many collections override it with more efficient versions.
-     *  Since TraversableOnce has no '++' method, we have to implement that directly,
-     *  but Traversable and down can use the overload.
-     */
-    def ++:[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
-      (that ++ seq)(breakOut)
-
-    def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-      val b = bf(repr)
-      b.sizeHint(this) 
-      for (x <- this) b += f(x)
-      b.result
-    }
-
-    def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-      val b = bf(repr)
-      for (x <- this) b ++= f(x).seq
-      b.result
-    }
-
-    /** Selects all elements of this $coll which satisfy a predicate.
-     *
-     *  @param p     the predicate used to test elements.
-     *  @return      a new $coll consisting of all elements of this $coll that satisfy the given
-     *               predicate `p`. The order of the elements is preserved.
-     */
-    def filter(p: A => Boolean): Repr = {
-      val b = newBuilder
-      for (x <- this) 
-        if (p(x)) b += x
-      b.result
-    }
-
-    /** Selects all elements of this $coll which do not satisfy a predicate.
-     *
-     *  @param p     the predicate used to test elements.
-     *  @return      a new $coll consisting of all elements of this $coll that do not satisfy the given
-     *               predicate `p`. The order of the elements is preserved.
-     */
-    def filterNot(p: A => Boolean): Repr = filter(!p(_))
-
-    def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-      val b = bf(repr)
-      for (x <- this) if (pf.isDefinedAt(x)) b += pf(x)
-      b.result
-    }
-
-    /** Builds a new collection by applying an option-valued function to all
-     *  elements of this $coll on which the function is defined.
-     *
-     *  @param f      the option-valued function which filters and maps the $coll.
-     *  @tparam B     the element type of the returned collection.
-     *  @tparam That  $thatinfo
-     *  @param bf     $bfinfo
-     *  @return       a new collection of type `That` resulting from applying the option-valued function
-     *                `f` to each element and collecting all defined results.
-     *                The order of the elements is preserved.
-     *
-     *  @usecase def filterMap[B](f: A => Option[B]): $Coll[B]
-     *  
-     *  @param pf     the partial function which filters and maps the $coll.
-     *  @return       a new $coll resulting from applying the given option-valued function
-     *                `f` to each element and collecting all defined results.
-     *                The order of the elements is preserved.
-    def filterMap[B, That](f: A => Option[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-      val b = bf(repr)
-      for (x <- this) 
-        f(x) match {
-          case Some(y) => b += y
-          case _ =>
-        }
-      b.result
-    }
-     */
-
-    /** Partitions this $coll in two ${coll}s according to a predicate.
-     *
-     *  @param p the predicate on which to partition.
-     *  @return  a pair of ${coll}s: the first $coll consists of all elements that 
-     *           satisfy the predicate `p` and the second $coll consists of all elements
-     *           that don't. The relative order of the elements in the resulting ${coll}s
-     *           is the same as in the original $coll.
-     */
-    def partition(p: A => Boolean): (Repr, Repr) = {
-      val l, r = newBuilder
-      for (x <- this) (if (p(x)) l else r) += x
-      (l.result, r.result)
-    }
-
-    def groupBy[K](f: A => K): immutable.Map[K, Repr] = {
-      val m = mutable.Map.empty[K, Builder[A, Repr]]
-      for (elem <- this) {
-        val key = f(elem)
-        val bldr = m.getOrElseUpdate(key, newBuilder)
-        bldr += elem
-      }
-      val b = immutable.Map.newBuilder[K, Repr]
-      for ((k, v) <- m)
-        b += ((k, v.result))
-
-      b.result
-    }
-
-    /** Tests whether a predicate holds for all elements of this $coll.
-     *
-     *  $mayNotTerminateInf
-     *
-     *  @param   p     the predicate used to test elements.
-     *  @return        `true` if the given predicate `p` holds for all elements
-     *                 of this $coll, otherwise `false`.
-     */
-    def forall(p: A => Boolean): Boolean = {
-      var result = true
-      breakable {
-        for (x <- this)
-          if (!p(x)) { result = false; break }
-      }
-      result
-    }
-
-    /** Tests whether a predicate holds for some of the elements of this $coll.
-     *
-     *  $mayNotTerminateInf
-     *
-     *  @param   p     the predicate used to test elements.
-     *  @return        `true` if the given predicate `p` holds for some of the
-     *                 elements of this $coll, otherwise `false`.
-     */
-    def exists(p: A => Boolean): Boolean = {
-      var result = false
-      breakable {
-        for (x <- this)
-          if (p(x)) { result = true; break }
-      }
-      result
-    }
-
-    /** Finds the first element of the $coll satisfying a predicate, if any.
-     * 
-     *  $mayNotTerminateInf
-     *  $orderDependent
-     *
-     *  @param p    the predicate used to test elements.
-     *  @return     an option value containing the first element in the $coll
-     *              that satisfies `p`, or `None` if none exists.
-     */
-    def find(p: A => Boolean): Option[A] = {
-      var result: Option[A] = None
-      breakable {
-        for (x <- this)
-          if (p(x)) { result = Some(x); break }
-      }
-      result
-    }
-
-    def scan[B >: A, That](z: B)(op: (B, B) => B)(implicit cbf: CanBuildFrom[Repr, B, That]): That = scanLeft(z)(op)
-
-    def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-      val b = bf(repr)
-      b.sizeHint(this, 1)
-      var acc = z
-      b += acc
-      for (x <- this) { acc = op(acc, x); b += acc }
-      b.result
-    }
-
-    @migration(2, 9,
-      "This scanRight definition has changed in 2.9.\n" +
-      "The previous behavior can be reproduced with scanRight.reverse."
-    )
-    def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-      var scanned = List(z)
-      var acc = z
-      for (x <- reversed) {
-        acc = op(x, acc)
-        scanned ::= acc
-      }
-      val b = bf(repr)
-      for (elem <- scanned) b += elem
-      b.result
-    }
-
-    /** Selects the first element of this $coll.
-     *  $orderDependent
-     *  @return  the first element of this $coll.
-     *  @throws `NoSuchElementException` if the $coll is empty.
-     */
-    def head: A = {
-      var result: () => A = () => throw new NoSuchElementException
-      breakable {
-        for (x <- this) {
-          result = () => x
-          break
-        }
-      }
-      result()
-    }
-
-    /** Optionally selects the first element.
-     *  $orderDependent
-     *  @return  the first element of this $coll if it is nonempty, `None` if it is empty.
-     */
-    def headOption: Option[A] = if (isEmpty) None else Some(head)
-
-    /** Selects all elements except the first.
-     *  $orderDependent
-     *  @return  a $coll consisting of all elements of this $coll
-     *           except the first one.
-     *  @throws `UnsupportedOperationException` if the $coll is empty.
-     */ 
-    override def tail: Repr = {
-      if (isEmpty) throw new UnsupportedOperationException("empty.tail")
-      drop(1)
-    }
-
-    /** Selects the last element.
-      * $orderDependent
-      * @return The last element of this $coll.
-      * @throws NoSuchElementException If the $coll is empty.
-      */
-    def last: A = {
-      var lst = head
-      for (x <- this)
-        lst = x
-      lst
-    }
-
-    /** Optionally selects the last element.
-     *  $orderDependent
-     *  @return  the last element of this $coll$ if it is nonempty, `None` if it is empty.
-     */
-    def lastOption: Option[A] = if (isEmpty) None else Some(last)
-
-    /** Selects all elements except the last.
-     *  $orderDependent
-     *  @return  a $coll consisting of all elements of this $coll
-     *           except the last one.
-     *  @throws `UnsupportedOperationException` if the $coll is empty.
-     */
-    def init: Repr = {
-      if (isEmpty) throw new UnsupportedOperationException("empty.init")
-      var lst = head
-      var follow = false
-      val b = newBuilder
-      b.sizeHint(this, -1)
-      for (x <- this.seq) {
-        if (follow) b += lst
-        else follow = true
-        lst = x
-      }
-      b.result
-    }
-
-    def take(n: Int): Repr = slice(0, n)
-
-    def drop(n: Int): Repr = 
-      if (n <= 0) {
-        val b = newBuilder
-        b.sizeHint(this)
-        b ++= thisCollection result
-      }
-      else sliceWithKnownDelta(n, Int.MaxValue, -n)
-
-    def slice(from: Int, until: Int): Repr = sliceWithKnownBound(math.max(from, 0), until)
-
-    // Precondition: from >= 0, until > 0, builder already configured for building.
-    private[this] def sliceInternal(from: Int, until: Int, b: Builder[A, Repr]): Repr = {
-      var i = 0
-      breakable {
-        for (x <- this.seq) {
-          if (i >= from) b += x
-          i += 1
-          if (i >= until) break
-        }
-      }
-      b.result
-    }
-    // Precondition: from >= 0
-    private[scala] def sliceWithKnownDelta(from: Int, until: Int, delta: Int): Repr = {
-      val b = newBuilder
-      if (until <= from) b.result
-      else {
-        b.sizeHint(this, delta)
-        sliceInternal(from, until, b)
-      }
-    }
-    // Precondition: from >= 0
-    private[scala] def sliceWithKnownBound(from: Int, until: Int): Repr = {
-      val b = newBuilder
-      if (until <= from) b.result
-      else {
-        b.sizeHintBounded(until - from, this)      
-        sliceInternal(from, until, b)
-      }
-    }
-
-    def takeWhile(p: A => Boolean): Repr = {
-      val b = newBuilder
-      breakable {
-        for (x <- this) {
-          if (!p(x)) break
-          b += x
-        }
-      }
-      b.result
-    }
-
-    def dropWhile(p: A => Boolean): Repr = {
-      val b = newBuilder
-      var go = false
-      for (x <- this) {
-        if (!p(x)) go = true
-        if (go) b += x
-      }
-      b.result
-    }
-
-    def span(p: A => Boolean): (Repr, Repr) = {
-      val l, r = newBuilder
-      var toLeft = true
-      for (x <- this) {
-        toLeft = toLeft && p(x)
-        (if (toLeft) l else r) += x
-      }
-      (l.result, r.result)
-    }
-
-    def splitAt(n: Int): (Repr, Repr) = {
-      val l, r = newBuilder
-      l.sizeHintBounded(n, this)
-      if (n >= 0) r.sizeHint(this, -n)
-      var i = 0
-      for (x <- this) {
-        (if (i < n) l else r) += x
-        i += 1
-      }
-      (l.result, r.result)
-    }
-
-    /** Iterates over the tails of this $coll. The first value will be this
-     *  $coll and the final one will be an empty $coll, with the intervening
-     *  values the results of successive applications of `tail`.
-     *
-     *  @return   an iterator over all the tails of this $coll
-     *  @example  `List(1,2,3).tails = Iterator(List(1,2,3), List(2,3), List(3), Nil)`
-     */  
-    def tails: Iterator[Repr] = iterateUntilEmpty(_.tail)
-
-    /** Iterates over the inits of this $coll. The first value will be this
-     *  $coll and the final one will be an empty $coll, with the intervening
-     *  values the results of successive applications of `init`.
-     *
-     *  @return  an iterator over all the inits of this $coll
-     *  @example  `List(1,2,3).inits = Iterator(List(1,2,3), List(1,2), List(1), Nil)`
-     */
-    def inits: Iterator[Repr] = iterateUntilEmpty(_.init)
-
-    /** Copies elements of this $coll to an array.
-     *  Fills the given array `xs` with at most `len` elements of
-     *  this $coll, starting at position `start`.
-     *  Copying will stop once either the end of the current $coll is reached,
-     *  or the end of the array is reached, or `len` elements have been copied.
-     *
-     *  $willNotTerminateInf
-     * 
-     *  @param  xs     the array to fill.
-     *  @param  start  the starting index.
-     *  @param  len    the maximal number of elements to copy.
-     *  @tparam B      the type of the elements of the array. 
-     * 
-     *
-     *  @usecase def copyToArray(xs: Array[A], start: Int, len: Int): Unit
-     */
-    def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
-      var i = start
-      val end = (start + len) min xs.length
-      breakable {
-        for (x <- this) {
-          if (i >= end) break
-          xs(i) = x
-          i += 1
-        }
-      }
-    }
-
-    def toTraversable: Traversable[A] = thisCollection
-    def toIterator: Iterator[A] = toStream.iterator
-    def toStream: Stream[A] = toBuffer.toStream
-
-    /** Converts this $coll to a string.
-     *
-     *  @return   a string representation of this collection. By default this
-     *            string consists of the `stringPrefix` of this $coll,
-     *            followed by all elements separated by commas and enclosed in parentheses.
-     */
-    override def toString = mkString(stringPrefix + "(", ", ", ")")
-
-    /** Defines the prefix of this object's `toString` representation.
-     *
-     *  @return  a string representation which starts the result of `toString`
-     *           applied to this $coll. By default the string prefix is the
-     *           simple name of the collection class $coll.
-     */
-    def stringPrefix : String = {
-      var string = repr.asInstanceOf[AnyRef].getClass.getName
-      val idx1 = string.lastIndexOf('.' : Int)
-      if (idx1 != -1) string = string.substring(idx1 + 1)
-      val idx2 = string.indexOf('$')
-      if (idx2 != -1) string = string.substring(0, idx2)
-      string
-    }
-
-    /** Creates a non-strict view of this $coll.
-     * 
-     *  @return a non-strict view of this $coll.
-     */
-    def view = new TraversableView[A, Repr] {
-      protected lazy val underlying = self.repr
-      override def foreach[U](f: A => U) = self foreach f
-    }
-
-    /** Creates a non-strict view of a slice of this $coll.
-     *
-     *  Note: the difference between `view` and `slice` is that `view` produces
-     *        a view of the current $coll, whereas `slice` produces a new $coll.
-     * 
-     *  Note: `view(from, to)` is equivalent to `view.slice(from, to)`
-     *  $orderDependent
-     * 
-     *  @param from   the index of the first element of the view
-     *  @param until  the index of the element following the view
-     *  @return a non-strict view of a slice of this $coll, starting at index `from`
-     *  and extending up to (but not including) index `until`.
-     */
-    def view(from: Int, until: Int): TraversableView[A, Repr] = view.slice(from, until)
-
-    /** Creates a non-strict filter of this $coll.
-     *
-     *  Note: the difference between `c filter p` and `c withFilter p` is that
-     *        the former creates a new collection, whereas the latter only
-     *        restricts the domain of subsequent `map`, `flatMap`, `foreach`,
-     *        and `withFilter` operations.
-     *  $orderDependent
-     * 
-     *  @param p   the predicate used to test elements.
-     *  @return    an object of class `WithFilter`, which supports
-     *             `map`, `flatMap`, `foreach`, and `withFilter` operations.
-     *             All these operations apply to those elements of this $coll which
-     *             satisfy the predicate `p`.
-     */
-    def withFilter(p: A => Boolean): FilterMonadic[A, Repr] = new WithFilter(p)
-
-    /** A class supporting filtered operations. Instances of this class are
-     *  returned by method `withFilter`.
-     */
-    class WithFilter(p: A => Boolean) extends FilterMonadic[A, Repr] {
-
-      /** Builds a new collection by applying a function to all elements of the
-       *  outer $coll containing this `WithFilter` instance that satisfy predicate `p`.
-       *
-       *  @param f      the function to apply to each element.
-       *  @tparam B     the element type of the returned collection.
-       *  @tparam That  $thatinfo
-       *  @param bf     $bfinfo
-       *  @return       a new collection of type `That` resulting from applying
-       *                the given function `f` to each element of the outer $coll
-       *                that satisfies predicate `p` and collecting the results.
-       *
-       *  @usecase def map[B](f: A => B): $Coll[B] 
-       *  
-       *  @return       a new $coll resulting from applying the given function
-       *                `f` to each element of the outer $coll that satisfies
-       *                predicate `p` and collecting the results.
-       */
-      def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-        val b = bf(repr)
-        for (x <- self) 
-          if (p(x)) b += f(x)
-        b.result
-      }
-
-      /** Builds a new collection by applying a function to all elements of the
-       *  outer $coll containing this `WithFilter` instance that satisfy
-       *  predicate `p` and concatenating the results. 
-       *
-       *  @param f      the function to apply to each element.
-       *  @tparam B     the element type of the returned collection.
-       *  @tparam That  $thatinfo
-       *  @param bf     $bfinfo
-       *  @return       a new collection of type `That` resulting from applying
-       *                the given collection-valued function `f` to each element
-       *                of the outer $coll that satisfies predicate `p` and
-       *                concatenating the results.
-       *
-       *  @usecase def flatMap[B](f: A => TraversableOnce[B]): $Coll[B]
-       * 
-       *  @return       a new $coll resulting from applying the given collection-valued function
-       *                `f` to each element of the outer $coll that satisfies predicate `p` and concatenating the results.
-       */
-      def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
-        val b = bf(repr)
-        for (x <- self) 
-          if (p(x)) b ++= f(x).seq
-        b.result
-      }
-
-      /** Applies a function `f` to all elements of the outer $coll containing
-       *  this `WithFilter` instance that satisfy predicate `p`.
-       *
-       *  @param  f   the function that is applied for its side-effect to every element.
-       *              The result of function `f` is discarded.
-       *              
-       *  @tparam  U  the type parameter describing the result of function `f`. 
-       *              This result will always be ignored. Typically `U` is `Unit`,
-       *              but this is not necessary.
-       *
-       *  @usecase def foreach(f: A => Unit): Unit
-       */   
-      def foreach[U](f: A => U): Unit = 
-        for (x <- self) 
-          if (p(x)) f(x)
-
-      /** Further refines the filter for this $coll.
-       *
-       *  @param q   the predicate used to test elements.
-       *  @return    an object of class `WithFilter`, which supports
-       *             `map`, `flatMap`, `foreach`, and `withFilter` operations.
-       *             All these operations apply to those elements of this $coll which
-       *             satisfy the predicate `q` in addition to the predicate `p`.
-       */
-      def withFilter(q: A => Boolean): WithFilter = 
-        new WithFilter(x => p(x) && q(x))
-    }
-
-    // A helper for tails and inits.
-    private def iterateUntilEmpty(f: Traversable[A @uV] => Traversable[A @uV]): Iterator[Repr] = {
-      val it = Iterator.iterate(thisCollection)(f) takeWhile (x => !x.isEmpty)
-      it ++ Iterator(Nil) map (newBuilder ++= _ result)
-    }
-  }
-
-
-</textarea>
-</form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        theme: "ambiance",
-        mode: "text/x-scala"
-      });
-    </script>
-  </article>
+<!doctype html>
+
+<title>CodeMirror: Scala mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<link rel="stylesheet" href="../../theme/ambiance.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/cm_edit/matchbrackets.js"></script>
+<script src="clike.js"></script>
+<div id=nav>
+  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+  <ul>
+    <li><a href="../../index.html">Home</a>
+    <li><a href="../../doc/manual.html">Manual</a>
+    <li><a href="https://github.com/codemirror/codemirror">Code</a>
+  </ul>
+  <ul>
+    <li><a href="../index.html">Language modes</a>
+    <li><a class=active href="#">Scala</a>
+  </ul>
+</div>
+
+<article>
+<h2>Scala mode</h2>
+<form>
+<textarea id="code" name="code">
+
+  /*                     __                                               *\
+  **     ________ ___   / /  ___     Scala API                            **
+  **    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
+  **  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
+  ** /____/\___/_/ |_/____/_/ | |                                         **
+  **                          |/                                          **
+  \*                                                                      */
+
+  package scala.collection
+
+  import generic._
+  import mutable.{ Builder, ListBuffer }
+  import annotation.{tailrec, migration, bridge}
+  import annotation.unchecked.{ uncheckedVariance => uV }
+  import parallel.ParIterable
+
+  /** A template trait for traversable collections of type `Traversable[A]`.
+   *  
+   *  $traversableInfo
+   *  @define mutability
+   *  @define traversableInfo
+   *  This is a base trait of all kinds of $mutability Scala collections. It
+   *  implements the behavior common to all collections, in terms of a method
+   *  `foreach` with signature:
+   * {{{
+   *     def foreach[U](f: Elem => U): Unit
+   * }}}
+   *  Collection classes mixing in this trait provide a concrete 
+   *  `foreach` method which traverses all the
+   *  elements contained in the collection, applying a given function to each.
+   *  They also need to provide a method `newBuilder`
+   *  which creates a builder for collections of the same kind.
+   *  
+   *  A traversable class might or might not have two properties: strictness
+   *  and orderedness. Neither is represented as a type.
+   *  
+   *  The instances of a strict collection class have all their elements
+   *  computed before they can be used as values. By contrast, instances of
+   *  a non-strict collection class may defer computation of some of their
+   *  elements until after the instance is available as a value.
+   *  A typical example of a non-strict collection class is a
+   *  <a href="../immutable/Stream.html" target="ContentFrame">
+   *  `scala.collection.immutable.Stream`</a>.
+   *  A more general class of examples are `TraversableViews`.
+   *  
+   *  If a collection is an instance of an ordered collection class, traversing
+   *  its elements with `foreach` will always visit elements in the
+   *  same order, even for different runs of the program. If the class is not
+   *  ordered, `foreach` can visit elements in different orders for
+   *  different runs (but it will keep the same order in the same run).'
+   * 
+   *  A typical example of a collection class which is not ordered is a
+   *  `HashMap` of objects. The traversal order for hash maps will
+   *  depend on the hash codes of its elements, and these hash codes might
+   *  differ from one run to the next. By contrast, a `LinkedHashMap`
+   *  is ordered because it's `foreach` method visits elements in the
+   *  order they were inserted into the `HashMap`.
+   *
+   *  @author Martin Odersky
+   *  @version 2.8
+   *  @since   2.8
+   *  @tparam A    the element type of the collection
+   *  @tparam Repr the type of the actual collection containing the elements.
+   *
+   *  @define Coll Traversable
+   *  @define coll traversable collection
+   */
+  trait TraversableLike[+A, +Repr] extends HasNewBuilder[A, Repr] 
+                                      with FilterMonadic[A, Repr]
+                                      with TraversableOnce[A]
+                                      with GenTraversableLike[A, Repr]
+                                      with Parallelizable[A, ParIterable[A]]
+  {
+    self =>
+
+    import Traversable.breaks._
+
+    /** The type implementing this traversable */
+    protected type Self = Repr
+
+    /** The collection of type $coll underlying this `TraversableLike` object.
+     *  By default this is implemented as the `TraversableLike` object itself,
+     *  but this can be overridden.
+     */
+    def repr: Repr = this.asInstanceOf[Repr]
+
+    /** The underlying collection seen as an instance of `$Coll`.
+     *  By default this is implemented as the current collection object itself,
+     *  but this can be overridden.
+     */
+    protected[this] def thisCollection: Traversable[A] = this.asInstanceOf[Traversable[A]]
+
+    /** A conversion from collections of type `Repr` to `$Coll` objects.
+     *  By default this is implemented as just a cast, but this can be overridden.
+     */
+    protected[this] def toCollection(repr: Repr): Traversable[A] = repr.asInstanceOf[Traversable[A]]
+
+    /** Creates a new builder for this collection type.
+     */
+    protected[this] def newBuilder: Builder[A, Repr]
+
+    protected[this] def parCombiner = ParIterable.newCombiner[A]
+
+    /** Applies a function `f` to all elements of this $coll.
+     *  
+     *    Note: this method underlies the implementation of most other bulk operations.
+     *    It's important to implement this method in an efficient way.
+     *  
+     *
+     *  @param  f   the function that is applied for its side-effect to every element.
+     *              The result of function `f` is discarded.
+     *              
+     *  @tparam  U  the type parameter describing the result of function `f`. 
+     *              This result will always be ignored. Typically `U` is `Unit`,
+     *              but this is not necessary.
+     *
+     *  @usecase def foreach(f: A => Unit): Unit
+     */
+    def foreach[U](f: A => U): Unit
+
+    /** Tests whether this $coll is empty.
+     *
+     *  @return    `true` if the $coll contain no elements, `false` otherwise.
+     */
+    def isEmpty: Boolean = {
+      var result = true
+      breakable {
+        for (x <- this) {
+          result = false
+          break
+        }
+      }
+      result
+    }
+
+    /** Tests whether this $coll is known to have a finite size.
+     *  All strict collections are known to have finite size. For a non-strict collection
+     *  such as `Stream`, the predicate returns `true` if all elements have been computed.
+     *  It returns `false` if the stream is not yet evaluated to the end.
+     *
+     *  Note: many collection methods will not work on collections of infinite sizes. 
+     *
+     *  @return  `true` if this collection is known to have finite size, `false` otherwise.
+     */
+    def hasDefiniteSize = true
+
+    def ++[B >: A, That](that: GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+      val b = bf(repr)
+      if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.seq.size)
+      b ++= thisCollection
+      b ++= that.seq
+      b.result
+    }
+
+    @bridge
+    def ++[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
+      ++(that: GenTraversableOnce[B])(bf)
+
+    /** Concatenates this $coll with the elements of a traversable collection.
+     *  It differs from ++ in that the right operand determines the type of the
+     *  resulting collection rather than the left one.
+     * 
+     *  @param that   the traversable to append.
+     *  @tparam B     the element type of the returned collection. 
+     *  @tparam That  $thatinfo
+     *  @param bf     $bfinfo
+     *  @return       a new collection of type `That` which contains all elements
+     *                of this $coll followed by all elements of `that`.
+     * 
+     *  @usecase def ++:[B](that: TraversableOnce[B]): $Coll[B]
+     *  
+     *  @return       a new $coll which contains all elements of this $coll
+     *                followed by all elements of `that`.
+     */
+    def ++:[B >: A, That](that: TraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+      val b = bf(repr)
+      if (that.isInstanceOf[IndexedSeqLike[_, _]]) b.sizeHint(this, that.size)
+      b ++= that
+      b ++= thisCollection
+      b.result
+    }
+
+    /** This overload exists because: for the implementation of ++: we should reuse
+     *  that of ++ because many collections override it with more efficient versions.
+     *  Since TraversableOnce has no '++' method, we have to implement that directly,
+     *  but Traversable and down can use the overload.
+     */
+    def ++:[B >: A, That](that: Traversable[B])(implicit bf: CanBuildFrom[Repr, B, That]): That =
+      (that ++ seq)(breakOut)
+
+    def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+      val b = bf(repr)
+      b.sizeHint(this) 
+      for (x <- this) b += f(x)
+      b.result
+    }
+
+    def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+      val b = bf(repr)
+      for (x <- this) b ++= f(x).seq
+      b.result
+    }
+
+    /** Selects all elements of this $coll which satisfy a predicate.
+     *
+     *  @param p     the predicate used to test elements.
+     *  @return      a new $coll consisting of all elements of this $coll that satisfy the given
+     *               predicate `p`. The order of the elements is preserved.
+     */
+    def filter(p: A => Boolean): Repr = {
+      val b = newBuilder
+      for (x <- this) 
+        if (p(x)) b += x
+      b.result
+    }
+
+    /** Selects all elements of this $coll which do not satisfy a predicate.
+     *
+     *  @param p     the predicate used to test elements.
+     *  @return      a new $coll consisting of all elements of this $coll that do not satisfy the given
+     *               predicate `p`. The order of the elements is preserved.
+     */
+    def filterNot(p: A => Boolean): Repr = filter(!p(_))
+
+    def collect[B, That](pf: PartialFunction[A, B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+      val b = bf(repr)
+      for (x <- this) if (pf.isDefinedAt(x)) b += pf(x)
+      b.result
+    }
+
+    /** Builds a new collection by applying an option-valued function to all
+     *  elements of this $coll on which the function is defined.
+     *
+     *  @param f      the option-valued function which filters and maps the $coll.
+     *  @tparam B     the element type of the returned collection.
+     *  @tparam That  $thatinfo
+     *  @param bf     $bfinfo
+     *  @return       a new collection of type `That` resulting from applying the option-valued function
+     *                `f` to each element and collecting all defined results.
+     *                The order of the elements is preserved.
+     *
+     *  @usecase def filterMap[B](f: A => Option[B]): $Coll[B]
+     *  
+     *  @param pf     the partial function which filters and maps the $coll.
+     *  @return       a new $coll resulting from applying the given option-valued function
+     *                `f` to each element and collecting all defined results.
+     *                The order of the elements is preserved.
+    def filterMap[B, That](f: A => Option[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+      val b = bf(repr)
+      for (x <- this) 
+        f(x) match {
+          case Some(y) => b += y
+          case _ =>
+        }
+      b.result
+    }
+     */
+
+    /** Partitions this $coll in two ${coll}s according to a predicate.
+     *
+     *  @param p the predicate on which to partition.
+     *  @return  a pair of ${coll}s: the first $coll consists of all elements that 
+     *           satisfy the predicate `p` and the second $coll consists of all elements
+     *           that don't. The relative order of the elements in the resulting ${coll}s
+     *           is the same as in the original $coll.
+     */
+    def partition(p: A => Boolean): (Repr, Repr) = {
+      val l, r = newBuilder
+      for (x <- this) (if (p(x)) l else r) += x
+      (l.result, r.result)
+    }
+
+    def groupBy[K](f: A => K): immutable.Map[K, Repr] = {
+      val m = mutable.Map.empty[K, Builder[A, Repr]]
+      for (elem <- this) {
+        val key = f(elem)
+        val bldr = m.getOrElseUpdate(key, newBuilder)
+        bldr += elem
+      }
+      val b = immutable.Map.newBuilder[K, Repr]
+      for ((k, v) <- m)
+        b += ((k, v.result))
+
+      b.result
+    }
+
+    /** Tests whether a predicate holds for all elements of this $coll.
+     *
+     *  $mayNotTerminateInf
+     *
+     *  @param   p     the predicate used to test elements.
+     *  @return        `true` if the given predicate `p` holds for all elements
+     *                 of this $coll, otherwise `false`.
+     */
+    def forall(p: A => Boolean): Boolean = {
+      var result = true
+      breakable {
+        for (x <- this)
+          if (!p(x)) { result = false; break }
+      }
+      result
+    }
+
+    /** Tests whether a predicate holds for some of the elements of this $coll.
+     *
+     *  $mayNotTerminateInf
+     *
+     *  @param   p     the predicate used to test elements.
+     *  @return        `true` if the given predicate `p` holds for some of the
+     *                 elements of this $coll, otherwise `false`.
+     */
+    def exists(p: A => Boolean): Boolean = {
+      var result = false
+      breakable {
+        for (x <- this)
+          if (p(x)) { result = true; break }
+      }
+      result
+    }
+
+    /** Finds the first element of the $coll satisfying a predicate, if any.
+     * 
+     *  $mayNotTerminateInf
+     *  $orderDependent
+     *
+     *  @param p    the predicate used to test elements.
+     *  @return     an option value containing the first element in the $coll
+     *              that satisfies `p`, or `None` if none exists.
+     */
+    def find(p: A => Boolean): Option[A] = {
+      var result: Option[A] = None
+      breakable {
+        for (x <- this)
+          if (p(x)) { result = Some(x); break }
+      }
+      result
+    }
+
+    def scan[B >: A, That](z: B)(op: (B, B) => B)(implicit cbf: CanBuildFrom[Repr, B, That]): That = scanLeft(z)(op)
+
+    def scanLeft[B, That](z: B)(op: (B, A) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+      val b = bf(repr)
+      b.sizeHint(this, 1)
+      var acc = z
+      b += acc
+      for (x <- this) { acc = op(acc, x); b += acc }
+      b.result
+    }
+
+    @migration(2, 9,
+      "This scanRight definition has changed in 2.9.\n" +
+      "The previous behavior can be reproduced with scanRight.reverse."
+    )
+    def scanRight[B, That](z: B)(op: (A, B) => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+      var scanned = List(z)
+      var acc = z
+      for (x <- reversed) {
+        acc = op(x, acc)
+        scanned ::= acc
+      }
+      val b = bf(repr)
+      for (elem <- scanned) b += elem
+      b.result
+    }
+
+    /** Selects the first element of this $coll.
+     *  $orderDependent
+     *  @return  the first element of this $coll.
+     *  @throws `NoSuchElementException` if the $coll is empty.
+     */
+    def head: A = {
+      var result: () => A = () => throw new NoSuchElementException
+      breakable {
+        for (x <- this) {
+          result = () => x
+          break
+        }
+      }
+      result()
+    }
+
+    /** Optionally selects the first element.
+     *  $orderDependent
+     *  @return  the first element of this $coll if it is nonempty, `None` if it is empty.
+     */
+    def headOption: Option[A] = if (isEmpty) None else Some(head)
+
+    /** Selects all elements except the first.
+     *  $orderDependent
+     *  @return  a $coll consisting of all elements of this $coll
+     *           except the first one.
+     *  @throws `UnsupportedOperationException` if the $coll is empty.
+     */ 
+    override def tail: Repr = {
+      if (isEmpty) throw new UnsupportedOperationException("empty.tail")
+      drop(1)
+    }
+
+    /** Selects the last element.
+      * $orderDependent
+      * @return The last element of this $coll.
+      * @throws NoSuchElementException If the $coll is empty.
+      */
+    def last: A = {
+      var lst = head
+      for (x <- this)
+        lst = x
+      lst
+    }
+
+    /** Optionally selects the last element.
+     *  $orderDependent
+     *  @return  the last element of this $coll$ if it is nonempty, `None` if it is empty.
+     */
+    def lastOption: Option[A] = if (isEmpty) None else Some(last)
+
+    /** Selects all elements except the last.
+     *  $orderDependent
+     *  @return  a $coll consisting of all elements of this $coll
+     *           except the last one.
+     *  @throws `UnsupportedOperationException` if the $coll is empty.
+     */
+    def init: Repr = {
+      if (isEmpty) throw new UnsupportedOperationException("empty.init")
+      var lst = head
+      var follow = false
+      val b = newBuilder
+      b.sizeHint(this, -1)
+      for (x <- this.seq) {
+        if (follow) b += lst
+        else follow = true
+        lst = x
+      }
+      b.result
+    }
+
+    def take(n: Int): Repr = slice(0, n)
+
+    def drop(n: Int): Repr = 
+      if (n <= 0) {
+        val b = newBuilder
+        b.sizeHint(this)
+        b ++= thisCollection result
+      }
+      else sliceWithKnownDelta(n, Int.MaxValue, -n)
+
+    def slice(from: Int, until: Int): Repr = sliceWithKnownBound(math.max(from, 0), until)
+
+    // Precondition: from >= 0, until > 0, builder already configured for building.
+    private[this] def sliceInternal(from: Int, until: Int, b: Builder[A, Repr]): Repr = {
+      var i = 0
+      breakable {
+        for (x <- this.seq) {
+          if (i >= from) b += x
+          i += 1
+          if (i >= until) break
+        }
+      }
+      b.result
+    }
+    // Precondition: from >= 0
+    private[scala] def sliceWithKnownDelta(from: Int, until: Int, delta: Int): Repr = {
+      val b = newBuilder
+      if (until <= from) b.result
+      else {
+        b.sizeHint(this, delta)
+        sliceInternal(from, until, b)
+      }
+    }
+    // Precondition: from >= 0
+    private[scala] def sliceWithKnownBound(from: Int, until: Int): Repr = {
+      val b = newBuilder
+      if (until <= from) b.result
+      else {
+        b.sizeHintBounded(until - from, this)      
+        sliceInternal(from, until, b)
+      }
+    }
+
+    def takeWhile(p: A => Boolean): Repr = {
+      val b = newBuilder
+      breakable {
+        for (x <- this) {
+          if (!p(x)) break
+          b += x
+        }
+      }
+      b.result
+    }
+
+    def dropWhile(p: A => Boolean): Repr = {
+      val b = newBuilder
+      var go = false
+      for (x <- this) {
+        if (!p(x)) go = true
+        if (go) b += x
+      }
+      b.result
+    }
+
+    def span(p: A => Boolean): (Repr, Repr) = {
+      val l, r = newBuilder
+      var toLeft = true
+      for (x <- this) {
+        toLeft = toLeft && p(x)
+        (if (toLeft) l else r) += x
+      }
+      (l.result, r.result)
+    }
+
+    def splitAt(n: Int): (Repr, Repr) = {
+      val l, r = newBuilder
+      l.sizeHintBounded(n, this)
+      if (n >= 0) r.sizeHint(this, -n)
+      var i = 0
+      for (x <- this) {
+        (if (i < n) l else r) += x
+        i += 1
+      }
+      (l.result, r.result)
+    }
+
+    /** Iterates over the tails of this $coll. The first value will be this
+     *  $coll and the final one will be an empty $coll, with the intervening
+     *  values the results of successive applications of `tail`.
+     *
+     *  @return   an iterator over all the tails of this $coll
+     *  @example  `List(1,2,3).tails = Iterator(List(1,2,3), List(2,3), List(3), Nil)`
+     */  
+    def tails: Iterator[Repr] = iterateUntilEmpty(_.tail)
+
+    /** Iterates over the inits of this $coll. The first value will be this
+     *  $coll and the final one will be an empty $coll, with the intervening
+     *  values the results of successive applications of `init`.
+     *
+     *  @return  an iterator over all the inits of this $coll
+     *  @example  `List(1,2,3).inits = Iterator(List(1,2,3), List(1,2), List(1), Nil)`
+     */
+    def inits: Iterator[Repr] = iterateUntilEmpty(_.init)
+
+    /** Copies elements of this $coll to an array.
+     *  Fills the given array `xs` with at most `len` elements of
+     *  this $coll, starting at position `start`.
+     *  Copying will stop once either the end of the current $coll is reached,
+     *  or the end of the array is reached, or `len` elements have been copied.
+     *
+     *  $willNotTerminateInf
+     * 
+     *  @param  xs     the array to fill.
+     *  @param  start  the starting index.
+     *  @param  len    the maximal number of elements to copy.
+     *  @tparam B      the type of the elements of the array. 
+     * 
+     *
+     *  @usecase def copyToArray(xs: Array[A], start: Int, len: Int): Unit
+     */
+    def copyToArray[B >: A](xs: Array[B], start: Int, len: Int) {
+      var i = start
+      val end = (start + len) min xs.length
+      breakable {
+        for (x <- this) {
+          if (i >= end) break
+          xs(i) = x
+          i += 1
+        }
+      }
+    }
+
+    def toTraversable: Traversable[A] = thisCollection
+    def toIterator: Iterator[A] = toStream.iterator
+    def toStream: Stream[A] = toBuffer.toStream
+
+    /** Converts this $coll to a string.
+     *
+     *  @return   a string representation of this collection. By default this
+     *            string consists of the `stringPrefix` of this $coll,
+     *            followed by all elements separated by commas and enclosed in parentheses.
+     */
+    override def toString = mkString(stringPrefix + "(", ", ", ")")
+
+    /** Defines the prefix of this object's `toString` representation.
+     *
+     *  @return  a string representation which starts the result of `toString`
+     *           applied to this $coll. By default the string prefix is the
+     *           simple name of the collection class $coll.
+     */
+    def stringPrefix : String = {
+      var string = repr.asInstanceOf[AnyRef].getClass.getName
+      val idx1 = string.lastIndexOf('.' : Int)
+      if (idx1 != -1) string = string.substring(idx1 + 1)
+      val idx2 = string.indexOf('$')
+      if (idx2 != -1) string = string.substring(0, idx2)
+      string
+    }
+
+    /** Creates a non-strict view of this $coll.
+     * 
+     *  @return a non-strict view of this $coll.
+     */
+    def view = new TraversableView[A, Repr] {
+      protected lazy val underlying = self.repr
+      override def foreach[U](f: A => U) = self foreach f
+    }
+
+    /** Creates a non-strict view of a slice of this $coll.
+     *
+     *  Note: the difference between `view` and `slice` is that `view` produces
+     *        a view of the current $coll, whereas `slice` produces a new $coll.
+     * 
+     *  Note: `view(from, to)` is equivalent to `view.slice(from, to)`
+     *  $orderDependent
+     * 
+     *  @param from   the index of the first element of the view
+     *  @param until  the index of the element following the view
+     *  @return a non-strict view of a slice of this $coll, starting at index `from`
+     *  and extending up to (but not including) index `until`.
+     */
+    def view(from: Int, until: Int): TraversableView[A, Repr] = view.slice(from, until)
+
+    /** Creates a non-strict filter of this $coll.
+     *
+     *  Note: the difference between `c filter p` and `c withFilter p` is that
+     *        the former creates a new collection, whereas the latter only
+     *        restricts the domain of subsequent `map`, `flatMap`, `foreach`,
+     *        and `withFilter` operations.
+     *  $orderDependent
+     * 
+     *  @param p   the predicate used to test elements.
+     *  @return    an object of class `WithFilter`, which supports
+     *             `map`, `flatMap`, `foreach`, and `withFilter` operations.
+     *             All these operations apply to those elements of this $coll which
+     *             satisfy the predicate `p`.
+     */
+    def withFilter(p: A => Boolean): FilterMonadic[A, Repr] = new WithFilter(p)
+
+    /** A class supporting filtered operations. Instances of this class are
+     *  returned by method `withFilter`.
+     */
+    class WithFilter(p: A => Boolean) extends FilterMonadic[A, Repr] {
+
+      /** Builds a new collection by applying a function to all elements of the
+       *  outer $coll containing this `WithFilter` instance that satisfy predicate `p`.
+       *
+       *  @param f      the function to apply to each element.
+       *  @tparam B     the element type of the returned collection.
+       *  @tparam That  $thatinfo
+       *  @param bf     $bfinfo
+       *  @return       a new collection of type `That` resulting from applying
+       *                the given function `f` to each element of the outer $coll
+       *                that satisfies predicate `p` and collecting the results.
+       *
+       *  @usecase def map[B](f: A => B): $Coll[B] 
+       *  
+       *  @return       a new $coll resulting from applying the given function
+       *                `f` to each element of the outer $coll that satisfies
+       *                predicate `p` and collecting the results.
+       */
+      def map[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+        val b = bf(repr)
+        for (x <- self) 
+          if (p(x)) b += f(x)
+        b.result
+      }
+
+      /** Builds a new collection by applying a function to all elements of the
+       *  outer $coll containing this `WithFilter` instance that satisfy
+       *  predicate `p` and concatenating the results. 
+       *
+       *  @param f      the function to apply to each element.
+       *  @tparam B     the element type of the returned collection.
+       *  @tparam That  $thatinfo
+       *  @param bf     $bfinfo
+       *  @return       a new collection of type `That` resulting from applying
+       *                the given collection-valued function `f` to each element
+       *                of the outer $coll that satisfies predicate `p` and
+       *                concatenating the results.
+       *
+       *  @usecase def flatMap[B](f: A => TraversableOnce[B]): $Coll[B]
+       * 
+       *  @return       a new $coll resulting from applying the given collection-valued function
+       *                `f` to each element of the outer $coll that satisfies predicate `p` and concatenating the results.
+       */
+      def flatMap[B, That](f: A => GenTraversableOnce[B])(implicit bf: CanBuildFrom[Repr, B, That]): That = {
+        val b = bf(repr)
+        for (x <- self) 
+          if (p(x)) b ++= f(x).seq
+        b.result
+      }
+
+      /** Applies a function `f` to all elements of the outer $coll containing
+       *  this `WithFilter` instance that satisfy predicate `p`.
+       *
+       *  @param  f   the function that is applied for its side-effect to every element.
+       *              The result of function `f` is discarded.
+       *              
+       *  @tparam  U  the type parameter describing the result of function `f`. 
+       *              This result will always be ignored. Typically `U` is `Unit`,
+       *              but this is not necessary.
+       *
+       *  @usecase def foreach(f: A => Unit): Unit
+       */   
+      def foreach[U](f: A => U): Unit = 
+        for (x <- self) 
+          if (p(x)) f(x)
+
+      /** Further refines the filter for this $coll.
+       *
+       *  @param q   the predicate used to test elements.
+       *  @return    an object of class `WithFilter`, which supports
+       *             `map`, `flatMap`, `foreach`, and `withFilter` operations.
+       *             All these operations apply to those elements of this $coll which
+       *             satisfy the predicate `q` in addition to the predicate `p`.
+       */
+      def withFilter(q: A => Boolean): WithFilter = 
+        new WithFilter(x => p(x) && q(x))
+    }
+
+    // A helper for tails and inits.
+    private def iterateUntilEmpty(f: Traversable[A @uV] => Traversable[A @uV]): Iterator[Repr] = {
+      val it = Iterator.iterate(thisCollection)(f) takeWhile (x => !x.isEmpty)
+      it ++ Iterator(Nil) map (newBuilder ++= _ result)
+    }
+  }
+
+
+</textarea>
+</form>
+
+    <script>
+      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+        lineNumbers: true,
+        matchBrackets: true,
+        theme: "ambiance",
+        mode: "text/x-scala"
+      });
+    </script>
+  </article>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/test.js.js
index bea85b8693be31e494f3f7791840efd2663c0cda..e3bde772a51b6de65cac1f63a869390e4824dbf7 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clike/test.js.js
@@ -6,8 +6,8 @@
   function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
 
   MT("indent",
-     "[variable-3 void] [def foo]([variable-3 void*] [variable a], [variable-3 int] [variable b]) {",
-     "  [variable-3 int] [variable c] [operator =] [variable b] [operator +]",
+     "[type void] [def foo]([type void*] [variable a], [type int] [variable b]) {",
+     "  [type int] [variable c] [operator =] [variable b] [operator +]",
      "    [number 1];",
      "  [keyword return] [operator *][variable a];",
      "}");
@@ -21,9 +21,9 @@
      "}");
 
   MT("def",
-     "[variable-3 void] [def foo]() {}",
+     "[type void] [def foo]() {}",
      "[keyword struct] [def bar]{}",
-     "[variable-3 int] [variable-3 *][def baz]() {}");
+     "[type int] [type *][def baz]() {}");
 
   MT("def_new_line",
      "::[variable std]::[variable SomeTerribleType][operator <][variable T][operator >]",
@@ -37,10 +37,10 @@
 
   MT("preprocessor",
      "[meta #define FOO 3]",
-     "[variable-3 int] [variable foo];",
+     "[type int] [variable foo];",
      "[meta #define BAR\\]",
      "[meta 4]",
-     "[variable-3 unsigned] [variable-3 int] [variable bar] [operator =] [number 8];",
+     "[type unsigned] [type int] [variable bar] [operator =] [number 8];",
      "[meta #include <baz> ][comment // comment]")
 
 
@@ -52,4 +52,18 @@
     "[number 0b10'000];",
     "[number 0x10'000];",
     "[string '100000'];");
+
+  MTCPP("ctor_dtor",
+     "[def Foo::Foo]() {}",
+     "[def Foo::~Foo]() {}");
+
+  var mode_scala = CodeMirror.getMode({indentUnit: 2}, "text/x-scala");
+  function MTSCALA(name) { test.mode("scala_" + name, mode_scala, Array.prototype.slice.call(arguments, 1)); }
+  MTSCALA("nested_comments",
+     "[comment /*]",
+     "[comment But wait /* this is a nested comment */ for real]",
+     "[comment /**** let * me * show * you ****/]",
+     "[comment ///// let / me / show / you /////]",
+     "[comment */]");
+
 })();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clojure/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clojure/index.html.html
deleted file mode 100644
index 81294bc14affebe0e0ceef78ed626357337555dc..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clojure/index.html.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Clojure mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="clojure.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Clojure</a>
-  </ul>
-</div>
-
-<article>
-<h2>Clojure mode</h2>
-<form><textarea id="code" name="code">
-; Conway's Game of Life, based on the work of:
-;; Laurent Petit https://gist.github.com/1200343
-;; Christophe Grand http://clj-me.cgrand.net/2011/08/19/conways-game-of-life
-
-(ns ^{:doc "Conway's Game of Life."}
- game-of-life)
-
-;; Core game of life's algorithm functions
-
-(defn neighbours
-  "Given a cell's coordinates, returns the coordinates of its neighbours."
-  [[x y]]
-  (for [dx [-1 0 1] dy (if (zero? dx) [-1 1] [-1 0 1])]
-    [(+ dx x) (+ dy y)]))
-
-(defn step
-  "Given a set of living cells, computes the new set of living cells."
-  [cells]
-  (set (for [[cell n] (frequencies (mapcat neighbours cells))
-             :when (or (= n 3) (and (= n 2) (cells cell)))]
-         cell)))
-
-;; Utility methods for displaying game on a text terminal
-
-(defn print-board
-  "Prints a board on *out*, representing a step in the game."
-  [board w h]
-  (doseq [x (range (inc w)) y (range (inc h))]
-    (if (= y 0) (print "\n"))
-    (print (if (board [x y]) "[X]" " . "))))
-
-(defn display-grids
-  "Prints a squence of boards on *out*, representing several steps."
-  [grids w h]
-  (doseq [board grids]
-    (print-board board w h)
-    (print "\n")))
-
-;; Launches an example board
-
-(def
-  ^{:doc "board represents the initial set of living cells"}
-   board #{[2 1] [2 2] [2 3]})
-
-(display-grids (take 3 (iterate step board)) 5 5)
-
-;; Let's play with characters
-(println \1 \a \# \\
-         \" \( \newline
-         \} \" \space
-         \tab \return \backspace
-         \u1000 \uAaAa \u9F9F)
-
-;; Let's play with numbers
-(+ 1 -1 1/2 -1/2 -0.5 0.5)
-
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-clojure</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clojure/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clojure/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/clojure/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cmake/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cmake/index.html.html
deleted file mode 100644
index ed114fece58baad3859095ffebef23928a225431..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cmake/index.html.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: CMake mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="cmake.js"></script>
-<style>
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .cm-s-default span.cm-arrow { color: red; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">CMake</a>
-  </ul>
-</div>
-
-<article>
-<h2>CMake mode</h2>
-<form><textarea id="code" name="code">
-# vim: syntax=cmake
-if(NOT CMAKE_BUILD_TYPE)
-    # default to Release build for GCC builds
-    set(CMAKE_BUILD_TYPE Release CACHE STRING
-        "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel."
-        FORCE)
-endif()
-message(STATUS "cmake version ${CMAKE_VERSION}")
-if(POLICY CMP0025)
-    cmake_policy(SET CMP0025 OLD) # report Apple's Clang as just Clang
-endif()
-if(POLICY CMP0042)
-    cmake_policy(SET CMP0042 NEW) # MACOSX_RPATH
-endif()
-
-project (x265)
-cmake_minimum_required (VERSION 2.8.8) # OBJECT libraries require 2.8.8
-include(CheckIncludeFiles)
-include(CheckFunctionExists)
-include(CheckSymbolExists)
-include(CheckCXXCompilerFlag)
-
-# X265_BUILD must be incremented each time the public API is changed
-set(X265_BUILD 48)
-configure_file("${PROJECT_SOURCE_DIR}/x265.def.in"
-               "${PROJECT_BINARY_DIR}/x265.def")
-configure_file("${PROJECT_SOURCE_DIR}/x265_config.h.in"
-               "${PROJECT_BINARY_DIR}/x265_config.h")
-
-SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
-
-# System architecture detection
-string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
-set(X86_ALIASES x86 i386 i686 x86_64 amd64)
-list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
-if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
-    message(STATUS "Detected x86 target processor")
-    set(X86 1)
-    add_definitions(-DX265_ARCH_X86=1)
-    if("${CMAKE_SIZEOF_VOID_P}" MATCHES 8)
-        set(X64 1)
-        add_definitions(-DX86_64=1)
-    endif()
-elseif(${SYSPROC} STREQUAL "armv6l")
-    message(STATUS "Detected ARM target processor")
-    set(ARM 1)
-    add_definitions(-DX265_ARCH_ARM=1 -DHAVE_ARMV6=1)
-else()
-    message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
-    message(STATUS "Please add this value near ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE}")
-endif()
-
-if(UNIX)
-    list(APPEND PLATFORM_LIBS pthread)
-    find_library(LIBRT rt)
-    if(LIBRT)
-        list(APPEND PLATFORM_LIBS rt)
-    endif()
-    find_package(Numa)
-    if(NUMA_FOUND)
-        list(APPEND CMAKE_REQUIRED_LIBRARIES ${NUMA_LIBRARY})
-        check_symbol_exists(numa_node_of_cpu numa.h NUMA_V2)
-        if(NUMA_V2)
-            add_definitions(-DHAVE_LIBNUMA)
-            message(STATUS "libnuma found, building with support for NUMA nodes")
-            list(APPEND PLATFORM_LIBS ${NUMA_LIBRARY})
-            link_directories(${NUMA_LIBRARY_DIR})
-            include_directories(${NUMA_INCLUDE_DIR})
-        endif()
-    endif()
-    mark_as_advanced(LIBRT NUMA_FOUND)
-endif(UNIX)
-
-if(X64 AND NOT WIN32)
-    option(ENABLE_PIC "Enable Position Independent Code" ON)
-else()
-    option(ENABLE_PIC "Enable Position Independent Code" OFF)
-endif(X64 AND NOT WIN32)
-
-# Compiler detection
-if(CMAKE_GENERATOR STREQUAL "Xcode")
-  set(XCODE 1)
-endif()
-if (APPLE)
-  add_definitions(-DMACOS)
-endif()
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "text/x-cmake",
-        matchBrackets: true,
-        indentUnit: 4
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-cmake</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cmake/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cmake/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cmake/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cobol/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cobol/index.html.html
deleted file mode 100644
index 4352419a0c810c6fa826d1e9e6cab1dc5c98e816..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cobol/index.html.html
+++ /dev/null
@@ -1,210 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: COBOL mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/neat.css">
-<link rel="stylesheet" href="../../theme/elegant.css">
-<link rel="stylesheet" href="../../theme/erlang-dark.css">
-<link rel="stylesheet" href="../../theme/night.css">
-<link rel="stylesheet" href="../../theme/monokai.css">
-<link rel="stylesheet" href="../../theme/cobalt.css">
-<link rel="stylesheet" href="../../theme/eclipse.css">
-<link rel="stylesheet" href="../../theme/rubyblue.css">
-<link rel="stylesheet" href="../../theme/lesser-dark.css">
-<link rel="stylesheet" href="../../theme/xq-dark.css">
-<link rel="stylesheet" href="../../theme/xq-light.css">
-<link rel="stylesheet" href="../../theme/ambiance.css">
-<link rel="stylesheet" href="../../theme/blackboard.css">
-<link rel="stylesheet" href="../../theme/vibrant-ink.css">
-<link rel="stylesheet" href="../../theme/solarized.css">
-<link rel="stylesheet" href="../../theme/twilight.css">
-<link rel="stylesheet" href="../../theme/midnight.css">
-<link rel="stylesheet" href="../../addon/dialog/dialog.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="cobol.js"></script>
-<script src="../../addon/selection/active-line.js"></script>
-<script src="../../addon/search/search.js"></script>
-<script src="../../addon/dialog/dialog.js"></script>
-<script src="../../addon/search/searchcursor.js"></script>
-<style>
-        .CodeMirror {
-          border: 1px solid #eee;
-          font-size : 20px;
-          height : auto !important;
-        }
-        .CodeMirror-activeline-background {background: #555555 !important;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">COBOL</a>
-  </ul>
-</div>
-
-<article>
-<h2>COBOL mode</h2>
-
-    <p> Select Theme <select onchange="selectTheme()" id="selectTheme">
-        <option>default</option>
-        <option>ambiance</option>
-        <option>blackboard</option>
-        <option>cobalt</option>
-        <option>eclipse</option>
-        <option>elegant</option>
-        <option>erlang-dark</option>
-        <option>lesser-dark</option>
-        <option>midnight</option>
-        <option>monokai</option>
-        <option>neat</option>
-        <option>night</option>
-        <option>rubyblue</option>
-        <option>solarized dark</option>
-        <option>solarized light</option>
-        <option selected>twilight</option>
-        <option>vibrant-ink</option>
-        <option>xq-dark</option>
-        <option>xq-light</option>
-    </select>    Select Font Size <select onchange="selectFontsize()" id="selectFontSize">
-          <option value="13px">13px</option>
-          <option value="14px">14px</option>
-          <option value="16px">16px</option>
-          <option value="18px">18px</option>
-          <option value="20px" selected="selected">20px</option>
-          <option value="24px">24px</option>
-          <option value="26px">26px</option>
-          <option value="28px">28px</option>
-          <option value="30px">30px</option>
-          <option value="32px">32px</option>
-          <option value="34px">34px</option>
-          <option value="36px">36px</option>
-        </select>
-<label for="checkBoxReadOnly">Read-only</label>
-<input type="checkbox" id="checkBoxReadOnly" onchange="selectReadOnly()">
-<label for="id_tabToIndentSpace">Insert Spaces on Tab</label>
-<input type="checkbox" id="id_tabToIndentSpace" onchange="tabToIndentSpace()">
-</p>
-<textarea id="code" name="code">
----------1---------2---------3---------4---------5---------6---------7---------8
-12345678911234567892123456789312345678941234567895123456789612345678971234567898
-000010 IDENTIFICATION DIVISION.                                        MODTGHERE
-000020 PROGRAM-ID.       SAMPLE.
-000030 AUTHOR.           TEST SAM. 
-000040 DATE-WRITTEN.     5 February 2013
-000041
-000042* A sample program just to show the form.
-000043* The program copies its input to the output,
-000044* and counts the number of records.
-000045* At the end this number is printed.
-000046
-000050 ENVIRONMENT DIVISION.
-000060 INPUT-OUTPUT SECTION.
-000070 FILE-CONTROL.
-000080     SELECT STUDENT-FILE     ASSIGN TO SYSIN
-000090         ORGANIZATION IS LINE SEQUENTIAL.
-000100     SELECT PRINT-FILE       ASSIGN TO SYSOUT
-000110         ORGANIZATION IS LINE SEQUENTIAL.
-000120
-000130 DATA DIVISION.
-000140 FILE SECTION.
-000150 FD  STUDENT-FILE
-000160     RECORD CONTAINS 43 CHARACTERS
-000170     DATA RECORD IS STUDENT-IN.
-000180 01  STUDENT-IN              PIC X(43).
-000190
-000200 FD  PRINT-FILE
-000210     RECORD CONTAINS 80 CHARACTERS
-000220     DATA RECORD IS PRINT-LINE.
-000230 01  PRINT-LINE              PIC X(80).
-000240
-000250 WORKING-STORAGE SECTION.
-000260 01  DATA-REMAINS-SWITCH     PIC X(2)      VALUE SPACES.
-000261 01  RECORDS-WRITTEN         PIC 99.
-000270
-000280 01  DETAIL-LINE.
-000290     05  FILLER              PIC X(7)      VALUE SPACES.
-000300     05  RECORD-IMAGE        PIC X(43).
-000310     05  FILLER              PIC X(30)     VALUE SPACES.
-000311 
-000312 01  SUMMARY-LINE.
-000313     05  FILLER              PIC X(7)      VALUE SPACES.
-000314     05  TOTAL-READ          PIC 99.
-000315     05  FILLER              PIC X         VALUE SPACE.
-000316     05  FILLER              PIC X(17)     
-000317                 VALUE  'Records were read'.
-000318     05  FILLER              PIC X(53)     VALUE SPACES.
-000319
-000320 PROCEDURE DIVISION.
-000321
-000330 PREPARE-SENIOR-REPORT.
-000340     OPEN INPUT  STUDENT-FILE
-000350          OUTPUT PRINT-FILE.
-000351     MOVE ZERO TO RECORDS-WRITTEN.
-000360     READ STUDENT-FILE
-000370         AT END MOVE 'NO' TO DATA-REMAINS-SWITCH
-000380     END-READ.
-000390     PERFORM PROCESS-RECORDS
-000410         UNTIL DATA-REMAINS-SWITCH = 'NO'.
-000411     PERFORM PRINT-SUMMARY.
-000420     CLOSE STUDENT-FILE
-000430           PRINT-FILE.
-000440     STOP RUN.
-000450
-000460 PROCESS-RECORDS.
-000470     MOVE STUDENT-IN TO RECORD-IMAGE.
-000480     MOVE DETAIL-LINE TO PRINT-LINE.
-000490     WRITE PRINT-LINE.
-000500     ADD 1 TO RECORDS-WRITTEN.
-000510     READ STUDENT-FILE
-000520         AT END MOVE 'NO' TO DATA-REMAINS-SWITCH
-000530     END-READ. 
-000540
-000550 PRINT-SUMMARY.
-000560     MOVE RECORDS-WRITTEN TO TOTAL-READ.
-000570     MOVE SUMMARY-LINE TO PRINT-LINE.
-000571     WRITE PRINT-LINE. 
-000572
-000580
-</textarea>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-cobol",
-        theme : "twilight",
-        styleActiveLine: true,
-        showCursorWhenSelecting : true,  
-      });
-      function selectTheme() {
-        var themeInput = document.getElementById("selectTheme");
-        var theme = themeInput.options[themeInput.selectedIndex].innerHTML;
-        editor.setOption("theme", theme);
-      }
-      function selectFontsize() {
-        var fontSizeInput = document.getElementById("selectFontSize");
-        var fontSize = fontSizeInput.options[fontSizeInput.selectedIndex].innerHTML;
-        editor.getWrapperElement().style.fontSize = fontSize;
-        editor.refresh();
-      }
-      function selectReadOnly() {
-        editor.setOption("readOnly", document.getElementById("checkBoxReadOnly").checked);
-      }
-      function tabToIndentSpace() {
-        if (document.getElementById("id_tabToIndentSpace").checked) {
-            editor.setOption("extraKeys", {Tab: function(cm) { cm.replaceSelection("    ", "end"); }});
-        } else {
-            editor.setOption("extraKeys", {Tab: function(cm) { cm.replaceSelection("    ", "end"); }});
-        }
-      }
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cobol/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cobol/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cobol/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/coffeescript.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/coffeescript.js.js
index adf2184fd7da5cc8463cfecb0843ce245f0e89bf..ae955db344ae82e38b12138196363b59e6a8405b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/coffeescript.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/coffeescript.js.js
@@ -349,6 +349,10 @@ CodeMirror.defineMode("coffeescript", function(conf, parserConf) {
   return external;
 });
 
+// IANA registered media type
+// https://www.iana.org/assignments/media-types/
+CodeMirror.defineMIME("application/vnd.coffeescript", "coffeescript");
+
 CodeMirror.defineMIME("text/x-coffeescript", "coffeescript");
 CodeMirror.defineMIME("text/coffeescript", "coffeescript");
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/index.html.html
deleted file mode 100644
index 93a5f4f30998ff43578e504110e2962a10a7c8d5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/index.html.html
+++ /dev/null
@@ -1,740 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: CoffeeScript mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="coffeescript.js"></script>
-<style>.CodeMirror {border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">CoffeeScript</a>
-  </ul>
-</div>
-
-<article>
-<h2>CoffeeScript mode</h2>
-<form><textarea id="code" name="code">
-# CoffeeScript mode for CodeMirror
-# Copyright (c) 2011 Jeff Pickhardt, released under
-# the MIT License.
-#
-# Modified from the Python CodeMirror mode, which also is 
-# under the MIT License Copyright (c) 2010 Timothy Farrell.
-#
-# The following script, Underscore.coffee, is used to 
-# demonstrate CoffeeScript mode for CodeMirror.
-#
-# To download CoffeeScript mode for CodeMirror, go to:
-# https://github.com/pickhardt/coffeescript-codemirror-mode
-
-# **Underscore.coffee
-# (c) 2011 Jeremy Ashkenas, DocumentCloud Inc.**
-# Underscore is freely distributable under the terms of the
-# [MIT license](http://en.wikipedia.org/wiki/MIT_License).
-# Portions of Underscore are inspired by or borrowed from
-# [Prototype.js](http://prototypejs.org/api), Oliver Steele's
-# [Functional](http://osteele.com), and John Resig's
-# [Micro-Templating](http://ejohn.org).
-# For all details and documentation:
-# http://documentcloud.github.com/underscore/
-
-
-# Baseline setup
-# --------------
-
-# Establish the root object, `window` in the browser, or `global` on the server.
-root = this
-
-
-# Save the previous value of the `_` variable.
-previousUnderscore = root._
-
-### Multiline
-    comment
-###
-
-# Establish the object that gets thrown to break out of a loop iteration.
-# `StopIteration` is SOP on Mozilla.
-breaker = if typeof(StopIteration) is 'undefined' then '__break__' else StopIteration
-
-
-#### Docco style single line comment (title)
-
-
-# Helper function to escape **RegExp** contents, because JS doesn't have one.
-escapeRegExp = (string) -> string.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1')
-
-
-# Save bytes in the minified (but not gzipped) version:
-ArrayProto = Array.prototype
-ObjProto = Object.prototype
-
-
-# Create quick reference variables for speed access to core prototypes.
-slice = ArrayProto.slice
-unshift = ArrayProto.unshift
-toString = ObjProto.toString
-hasOwnProperty = ObjProto.hasOwnProperty
-propertyIsEnumerable = ObjProto.propertyIsEnumerable
-
-
-# All **ECMA5** native implementations we hope to use are declared here.
-nativeForEach = ArrayProto.forEach
-nativeMap = ArrayProto.map
-nativeReduce = ArrayProto.reduce
-nativeReduceRight = ArrayProto.reduceRight
-nativeFilter = ArrayProto.filter
-nativeEvery = ArrayProto.every
-nativeSome = ArrayProto.some
-nativeIndexOf = ArrayProto.indexOf
-nativeLastIndexOf = ArrayProto.lastIndexOf
-nativeIsArray = Array.isArray
-nativeKeys = Object.keys
-
-
-# Create a safe reference to the Underscore object for use below.
-_ = (obj) -> new wrapper(obj)
-
-
-# Export the Underscore object for **CommonJS**.
-if typeof(exports) != 'undefined' then exports._ = _
-
-
-# Export Underscore to global scope.
-root._ = _
-
-
-# Current version.
-_.VERSION = '1.1.0'
-
-
-# Collection Functions
-# --------------------
-
-# The cornerstone, an **each** implementation.
-# Handles objects implementing **forEach**, arrays, and raw objects.
-_.each = (obj, iterator, context) ->
-  try
-    if nativeForEach and obj.forEach is nativeForEach
-      obj.forEach iterator, context
-    else if _.isNumber obj.length
-      iterator.call context, obj[i], i, obj for i in [0...obj.length]
-    else
-      iterator.call context, val, key, obj for own key, val of obj
-  catch e
-    throw e if e isnt breaker
-  obj
-
-
-# Return the results of applying the iterator to each element. Use JavaScript
-# 1.6's version of **map**, if possible.
-_.map = (obj, iterator, context) ->
-  return obj.map(iterator, context) if nativeMap and obj.map is nativeMap
-  results = []
-  _.each obj, (value, index, list) ->
-    results.push iterator.call context, value, index, list
-  results
-
-
-# **Reduce** builds up a single result from a list of values. Also known as
-# **inject**, or **foldl**. Uses JavaScript 1.8's version of **reduce**, if possible.
-_.reduce = (obj, iterator, memo, context) ->
-  if nativeReduce and obj.reduce is nativeReduce
-    iterator = _.bind iterator, context if context
-    return obj.reduce iterator, memo
-  _.each obj, (value, index, list) ->
-    memo = iterator.call context, memo, value, index, list
-  memo
-
-
-# The right-associative version of **reduce**, also known as **foldr**. Uses
-# JavaScript 1.8's version of **reduceRight**, if available.
-_.reduceRight = (obj, iterator, memo, context) ->
-  if nativeReduceRight and obj.reduceRight is nativeReduceRight
-    iterator = _.bind iterator, context if context
-    return obj.reduceRight iterator, memo
-  reversed = _.clone(_.toArray(obj)).reverse()
-  _.reduce reversed, iterator, memo, context
-
-
-# Return the first value which passes a truth test.
-_.detect = (obj, iterator, context) ->
-  result = null
-  _.each obj, (value, index, list) ->
-    if iterator.call context, value, index, list
-      result = value
-      _.breakLoop()
-  result
-
-
-# Return all the elements that pass a truth test. Use JavaScript 1.6's
-# **filter**, if it exists.
-_.filter = (obj, iterator, context) ->
-  return obj.filter iterator, context if nativeFilter and obj.filter is nativeFilter
-  results = []
-  _.each obj, (value, index, list) ->
-    results.push value if iterator.call context, value, index, list
-  results
-
-
-# Return all the elements for which a truth test fails.
-_.reject = (obj, iterator, context) ->
-  results = []
-  _.each obj, (value, index, list) ->
-    results.push value if not iterator.call context, value, index, list
-  results
-
-
-# Determine whether all of the elements match a truth test. Delegate to
-# JavaScript 1.6's **every**, if it is present.
-_.every = (obj, iterator, context) ->
-  iterator ||= _.identity
-  return obj.every iterator, context if nativeEvery and obj.every is nativeEvery
-  result = true
-  _.each obj, (value, index, list) ->
-    _.breakLoop() unless (result = result and iterator.call(context, value, index, list))
-  result
-
-
-# Determine if at least one element in the object matches a truth test. Use
-# JavaScript 1.6's **some**, if it exists.
-_.some = (obj, iterator, context) ->
-  iterator ||= _.identity
-  return obj.some iterator, context if nativeSome and obj.some is nativeSome
-  result = false
-  _.each obj, (value, index, list) ->
-    _.breakLoop() if (result = iterator.call(context, value, index, list))
-  result
-
-
-# Determine if a given value is included in the array or object,
-# based on `===`.
-_.include = (obj, target) ->
-  return _.indexOf(obj, target) isnt -1 if nativeIndexOf and obj.indexOf is nativeIndexOf
-  return true for own key, val of obj when val is target
-  false
-
-
-# Invoke a method with arguments on every item in a collection.
-_.invoke = (obj, method) ->
-  args = _.rest arguments, 2
-  (if method then val[method] else val).apply(val, args) for val in obj
-
-
-# Convenience version of a common use case of **map**: fetching a property.
-_.pluck = (obj, key) ->
-  _.map(obj, (val) -> val[key])
-
-
-# Return the maximum item or (item-based computation).
-_.max = (obj, iterator, context) ->
-  return Math.max.apply(Math, obj) if not iterator and _.isArray(obj)
-  result = computed: -Infinity
-  _.each obj, (value, index, list) ->
-    computed = if iterator then iterator.call(context, value, index, list) else value
-    computed >= result.computed and (result = {value: value, computed: computed})
-  result.value
-
-
-# Return the minimum element (or element-based computation).
-_.min = (obj, iterator, context) ->
-  return Math.min.apply(Math, obj) if not iterator and _.isArray(obj)
-  result = computed: Infinity
-  _.each obj, (value, index, list) ->
-    computed = if iterator then iterator.call(context, value, index, list) else value
-    computed < result.computed and (result = {value: value, computed: computed})
-  result.value
-
-
-# Sort the object's values by a criterion produced by an iterator.
-_.sortBy = (obj, iterator, context) ->
-  _.pluck(((_.map obj, (value, index, list) ->
-    {value: value, criteria: iterator.call(context, value, index, list)}
-  ).sort((left, right) ->
-    a = left.criteria; b = right.criteria
-    if a < b then -1 else if a > b then 1 else 0
-  )), 'value')
-
-
-# Use a comparator function to figure out at what index an object should
-# be inserted so as to maintain order. Uses binary search.
-_.sortedIndex = (array, obj, iterator) ->
-  iterator ||= _.identity
-  low = 0
-  high = array.length
-  while low < high
-    mid = (low + high) >> 1
-    if iterator(array[mid]) < iterator(obj) then low = mid + 1 else high = mid
-  low
-
-
-# Convert anything iterable into a real, live array.
-_.toArray = (iterable) ->
-  return [] if (!iterable)
-  return iterable.toArray() if (iterable.toArray)
-  return iterable if (_.isArray(iterable))
-  return slice.call(iterable) if (_.isArguments(iterable))
-  _.values(iterable)
-
-
-# Return the number of elements in an object.
-_.size = (obj) -> _.toArray(obj).length
-
-
-# Array Functions
-# ---------------
-
-# Get the first element of an array. Passing `n` will return the first N
-# values in the array. Aliased as **head**. The `guard` check allows it to work
-# with **map**.
-_.first = (array, n, guard) ->
-  if n and not guard then slice.call(array, 0, n) else array[0]
-
-
-# Returns everything but the first entry of the array. Aliased as **tail**.
-# Especially useful on the arguments object. Passing an `index` will return
-# the rest of the values in the array from that index onward. The `guard`
-# check allows it to work with **map**.
-_.rest = (array, index, guard) ->
-  slice.call(array, if _.isUndefined(index) or guard then 1 else index)
-
-
-# Get the last element of an array.
-_.last = (array) -> array[array.length - 1]
-
-
-# Trim out all falsy values from an array.
-_.compact = (array) -> item for item in array when item
-
-
-# Return a completely flattened version of an array.
-_.flatten = (array) ->
-  _.reduce array, (memo, value) ->
-    return memo.concat(_.flatten(value)) if _.isArray value
-    memo.push value
-    memo
-  , []
-
-
-# Return a version of the array that does not contain the specified value(s).
-_.without = (array) ->
-  values = _.rest arguments
-  val for val in _.toArray(array) when not _.include values, val
-
-
-# Produce a duplicate-free version of the array. If the array has already
-# been sorted, you have the option of using a faster algorithm.
-_.uniq = (array, isSorted) ->
-  memo = []
-  for el, i in _.toArray array
-    memo.push el if i is 0 || (if isSorted is true then _.last(memo) isnt el else not _.include(memo, el))
-  memo
-
-
-# Produce an array that contains every item shared between all the
-# passed-in arrays.
-_.intersect = (array) ->
-  rest = _.rest arguments
-  _.select _.uniq(array), (item) ->
-    _.all rest, (other) ->
-      _.indexOf(other, item) >= 0
-
-
-# Zip together multiple lists into a single array -- elements that share
-# an index go together.
-_.zip = ->
-  length = _.max _.pluck arguments, 'length'
-  results = new Array length
-  for i in [0...length]
-    results[i] = _.pluck arguments, String i
-  results
-
-
-# If the browser doesn't supply us with **indexOf** (I'm looking at you, MSIE),
-# we need this function. Return the position of the first occurrence of an
-# item in an array, or -1 if the item is not included in the array.
-_.indexOf = (array, item) ->
-  return array.indexOf item if nativeIndexOf and array.indexOf is nativeIndexOf
-  i = 0; l = array.length
-  while l - i
-    if array[i] is item then return i else i++
-  -1
-
-
-# Provide JavaScript 1.6's **lastIndexOf**, delegating to the native function,
-# if possible.
-_.lastIndexOf = (array, item) ->
-  return array.lastIndexOf(item) if nativeLastIndexOf and array.lastIndexOf is nativeLastIndexOf
-  i = array.length
-  while i
-    if array[i] is item then return i else i--
-  -1
-
-
-# Generate an integer Array containing an arithmetic progression. A port of
-# [the native Python **range** function](http://docs.python.org/library/functions.html#range).
-_.range = (start, stop, step) ->
-  a = arguments
-  solo = a.length <= 1
-  i = start = if solo then 0 else a[0]
-  stop = if solo then a[0] else a[1]
-  step = a[2] or 1
-  len = Math.ceil((stop - start) / step)
-  return [] if len <= 0
-  range = new Array len
-  idx = 0
-  loop
-    return range if (if step > 0 then i - stop else stop - i) >= 0
-    range[idx] = i
-    idx++
-    i+= step
-
-
-# Function Functions
-# ------------------
-
-# Create a function bound to a given object (assigning `this`, and arguments,
-# optionally). Binding with arguments is also known as **curry**.
-_.bind = (func, obj) ->
-  args = _.rest arguments, 2
-  -> func.apply obj or root, args.concat arguments
-
-
-# Bind all of an object's methods to that object. Useful for ensuring that
-# all callbacks defined on an object belong to it.
-_.bindAll = (obj) ->
-  funcs = if arguments.length > 1 then _.rest(arguments) else _.functions(obj)
-  _.each funcs, (f) -> obj[f] = _.bind obj[f], obj
-  obj
-
-
-# Delays a function for the given number of milliseconds, and then calls
-# it with the arguments supplied.
-_.delay = (func, wait) ->
-  args = _.rest arguments, 2
-  setTimeout((-> func.apply(func, args)), wait)
-
-
-# Memoize an expensive function by storing its results.
-_.memoize = (func, hasher) ->
-  memo = {}
-  hasher or= _.identity
-  ->
-    key = hasher.apply this, arguments
-    return memo[key] if key of memo
-    memo[key] = func.apply this, arguments
-
-
-# Defers a function, scheduling it to run after the current call stack has
-# cleared.
-_.defer = (func) ->
-  _.delay.apply _, [func, 1].concat _.rest arguments
-
-
-# Returns the first function passed as an argument to the second,
-# allowing you to adjust arguments, run code before and after, and
-# conditionally execute the original function.
-_.wrap = (func, wrapper) ->
-  -> wrapper.apply wrapper, [func].concat arguments
-
-
-# Returns a function that is the composition of a list of functions, each
-# consuming the return value of the function that follows.
-_.compose = ->
-  funcs = arguments
-  ->
-    args = arguments
-    for i in [funcs.length - 1..0] by -1
-      args = [funcs[i].apply(this, args)]
-    args[0]
-
-
-# Object Functions
-# ----------------
-
-# Retrieve the names of an object's properties.
-_.keys = nativeKeys or (obj) ->
-  return _.range 0, obj.length if _.isArray(obj)
-  key for key, val of obj
-
-
-# Retrieve the values of an object's properties.
-_.values = (obj) ->
-  _.map obj, _.identity
-
-
-# Return a sorted list of the function names available in Underscore.
-_.functions = (obj) ->
-  _.filter(_.keys(obj), (key) -> _.isFunction(obj[key])).sort()
-
-
-# Extend a given object with all of the properties in a source object.
-_.extend = (obj) ->
-  for source in _.rest(arguments)
-    obj[key] = val for key, val of source
-  obj
-
-
-# Create a (shallow-cloned) duplicate of an object.
-_.clone = (obj) ->
-  return obj.slice 0 if _.isArray obj
-  _.extend {}, obj
-
-
-# Invokes interceptor with the obj, and then returns obj.
-# The primary purpose of this method is to "tap into" a method chain,
-# in order to perform operations on intermediate results within
- the chain.
-_.tap = (obj, interceptor) ->
-  interceptor obj
-  obj
-
-
-# Perform a deep comparison to check if two objects are equal.
-_.isEqual = (a, b) ->
-  # Check object identity.
-  return true if a is b
-  # Different types?
-  atype = typeof(a); btype = typeof(b)
-  return false if atype isnt btype
-  # Basic equality test (watch out for coercions).
-  return true if `a == b`
-  # One is falsy and the other truthy.
-  return false if (!a and b) or (a and !b)
-  # One of them implements an `isEqual()`?
-  return a.isEqual(b) if a.isEqual
-  # Check dates' integer values.
-  return a.getTime() is b.getTime() if _.isDate(a) and _.isDate(b)
-  # Both are NaN?
-  return false if _.isNaN(a) and _.isNaN(b)
-  # Compare regular expressions.
-  if _.isRegExp(a) and _.isRegExp(b)
-    return a.source is b.source and
-           a.global is b.global and
-           a.ignoreCase is b.ignoreCase and
-           a.multiline is b.multiline
-  # If a is not an object by this point, we can't handle it.
-  return false if atype isnt 'object'
-  # Check for different array lengths before comparing contents.
-  return false if a.length and (a.length isnt b.length)
-  # Nothing else worked, deep compare the contents.
-  aKeys = _.keys(a); bKeys = _.keys(b)
-  # Different object sizes?
-  return false if aKeys.length isnt bKeys.length
-  # Recursive comparison of contents.
-  return false for key, val of a when !(key of b) or !_.isEqual(val, b[key])
-  true
-
-
-# Is a given array or object empty?
-_.isEmpty = (obj) ->
-  return obj.length is 0 if _.isArray(obj) or _.isString(obj)
-  return false for own key of obj
-  true
-
-
-# Is a given value a DOM element?
-_.isElement = (obj) -> obj and obj.nodeType is 1
-
-
-# Is a given value an array?
-_.isArray = nativeIsArray or (obj) -> !!(obj and obj.concat and obj.unshift and not obj.callee)
-
-
-# Is a given variable an arguments object?
-_.isArguments = (obj) -> obj and obj.callee
-
-
-# Is the given value a function?
-_.isFunction = (obj) -> !!(obj and obj.constructor and obj.call and obj.apply)
-
-
-# Is the given value a string?
-_.isString = (obj) -> !!(obj is '' or (obj and obj.charCodeAt and obj.substr))
-
-
-# Is a given value a number?
-_.isNumber = (obj) -> (obj is +obj) or toString.call(obj) is '[object Number]'
-
-
-# Is a given value a boolean?
-_.isBoolean = (obj) -> obj is true or obj is false
-
-
-# Is a given value a Date?
-_.isDate = (obj) -> !!(obj and obj.getTimezoneOffset and obj.setUTCFullYear)
-
-
-# Is the given value a regular expression?
-_.isRegExp = (obj) -> !!(obj and obj.exec and (obj.ignoreCase or obj.ignoreCase is false))
-
-
-# Is the given value NaN -- this one is interesting. `NaN != NaN`, and
-# `isNaN(undefined) == true`, so we make sure it's a number first.
-_.isNaN = (obj) -> _.isNumber(obj) and window.isNaN(obj)
-
-
-# Is a given value equal to null?
-_.isNull = (obj) -> obj is null
-
-
-# Is a given variable undefined?
-_.isUndefined = (obj) -> typeof obj is 'undefined'
-
-
-# Utility Functions
-# -----------------
-
-# Run Underscore.js in noConflict mode, returning the `_` variable to its
-# previous owner. Returns a reference to the Underscore object.
-_.noConflict = ->
-  root._ = previousUnderscore
-  this
-
-
-# Keep the identity function around for default iterators.
-_.identity = (value) -> value
-
-
-# Run a function `n` times.
-_.times = (n, iterator, context) ->
-  iterator.call context, i for i in [0...n]
-
-
-# Break out of the middle of an iteration.
-_.breakLoop = -> throw breaker
-
-
-# Add your own custom functions to the Underscore object, ensuring that
-# they're correctly added to the OOP wrapper as well.
-_.mixin = (obj) ->
-  for name in _.functions(obj)
-    addToWrapper name, _[name] = obj[name]
-
-
-# Generate a unique integer id (unique within the entire client session).
-# Useful for temporary DOM ids.
-idCounter = 0
-_.uniqueId = (prefix) ->
-  (prefix or '') + idCounter++
-
-
-# By default, Underscore uses **ERB**-style template delimiters, change the
-# following template settings to use alternative delimiters.
-_.templateSettings = {
-  start: '<%'
-  end: '%>'
-  interpolate: /<%=(.+?)%>/g
-}
-
-
-# JavaScript templating a-la **ERB**, pilfered from John Resig's
-# *Secrets of the JavaScript Ninja*, page 83.
-# Single-quote fix from Rick Strahl.
-# With alterations for arbitrary delimiters, and to preserve whitespace.
-_.template = (str, data) ->
-  c = _.templateSettings
-  endMatch = new RegExp("'(?=[^"+c.end.substr(0, 1)+"]*"+escapeRegExp(c.end)+")","g")
-  fn = new Function 'obj',
-    'var p=[],print=function(){p.push.apply(p,arguments);};' +
-    'with(obj||{}){p.push(\'' +
-    str.replace(/\r/g, '\\r')
-       .replace(/\n/g, '\\n')
-       .replace(/\t/g, '\\t')
-       .replace(endMatch,"锟斤拷锟�")
-       .split("'").join("\\'")
-       .split("锟斤拷锟�").join("'")
-       .replace(c.interpolate, "',$1,'")
-       .split(c.start).join("');")
-       .split(c.end).join("p.push('") +
-       "');}return p.join('');"
-  if data then fn(data) else fn
-
-
-# Aliases
-# -------
-
-_.forEach = _.each
-_.foldl = _.inject = _.reduce
-_.foldr = _.reduceRight
-_.select = _.filter
-_.all = _.every
-_.any = _.some
-_.contains = _.include
-_.head = _.first
-_.tail = _.rest
-_.methods = _.functions
-
-
-# Setup the OOP Wrapper
-# ---------------------
-
-# If Underscore is called as a function, it returns a wrapped object that
-# can be used OO-style. This wrapper holds altered versions of all the
-# underscore functions. Wrapped objects may be chained.
-wrapper = (obj) ->
-  this._wrapped = obj
-  this
-
-
-# Helper function to continue chaining intermediate results.
-result = (obj, chain) ->
-  if chain then _(obj).chain() else obj
-
-
-# A method to easily add functions to the OOP wrapper.
-addToWrapper = (name, func) ->
-  wrapper.prototype[name] = ->
-    args = _.toArray arguments
-    unshift.call args, this._wrapped
-    result func.apply(_, args), this._chain
-
-
-# Add all ofthe Underscore functions to the wrapper object.
-_.mixin _
-
-
-# Add all mutator Array functions to the wrapper.
-_.each ['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], (name) ->
-  method = Array.prototype[name]
-  wrapper.prototype[name] = ->
-    method.apply(this._wrapped, arguments)
-    result(this._wrapped, this._chain)
-
-
-# Add all accessor Array functions to the wrapper.
-_.each ['concat', 'join', 'slice'], (name) ->
-  method = Array.prototype[name]
-  wrapper.prototype[name] = ->
-    result(method.apply(this._wrapped, arguments), this._chain)
-
-
-# Start chaining a wrapped Underscore object.
-wrapper::chain = ->
-  this._chain = true
-  this
-
-
-# Extracts the result from a wrapped and chained object.
-wrapper::value = -> this._wrapped
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-coffeescript</code>.</p>
-
-    <p>The CoffeeScript mode was written by Jeff Pickhardt.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/coffeescript/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/commonlisp/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/commonlisp/index.html.html
deleted file mode 100644
index f2bf4522d6a57b6f1d8377f90a4608f9d2fd1506..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/commonlisp/index.html.html
+++ /dev/null
@@ -1,177 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Common Lisp mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="commonlisp.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Common Lisp</a>
-  </ul>
-</div>
-
-<article>
-<h2>Common Lisp mode</h2>
-<form><textarea id="code" name="code">(in-package :cl-postgres)
-
-;; These are used to synthesize reader and writer names for integer
-;; reading/writing functions when the amount of bytes and the
-;; signedness is known. Both the macro that creates the functions and
-;; some macros that use them create names this way.
-(eval-when (:compile-toplevel :load-toplevel :execute)
-  (defun integer-reader-name (bytes signed)
-    (intern (with-standard-io-syntax
-              (format nil "~a~a~a~a" '#:read- (if signed "" '#:u) '#:int bytes))))
-  (defun integer-writer-name (bytes signed)
-    (intern (with-standard-io-syntax
-              (format nil "~a~a~a~a" '#:write- (if signed "" '#:u) '#:int bytes)))))
-
-(defmacro integer-reader (bytes)
-  "Create a function to read integers from a binary stream."
-  (let ((bits (* bytes 8)))
-    (labels ((return-form (signed)
-               (if signed
-                   `(if (logbitp ,(1- bits) result)
-                        (dpb result (byte ,(1- bits) 0) -1)
-                        result)
-                   `result))
-             (generate-reader (signed)
-               `(defun ,(integer-reader-name bytes signed) (socket)
-                  (declare (type stream socket)
-                           #.*optimize*)
-                  ,(if (= bytes 1)
-                       `(let ((result (the (unsigned-byte 8) (read-byte socket))))
-                          (declare (type (unsigned-byte 8) result))
-                          ,(return-form signed))
-                       `(let ((result 0))
-                          (declare (type (unsigned-byte ,bits) result))
-                          ,@(loop :for byte :from (1- bytes) :downto 0
-                                   :collect `(setf (ldb (byte 8 ,(* 8 byte)) result)
-                                                   (the (unsigned-byte 8) (read-byte socket))))
-                          ,(return-form signed))))))
-      `(progn
-;; This causes weird errors on SBCL in some circumstances. Disabled for now.
-;;         (declaim (inline ,(integer-reader-name bytes t)
-;;                          ,(integer-reader-name bytes nil)))
-         (declaim (ftype (function (t) (signed-byte ,bits))
-                         ,(integer-reader-name bytes t)))
-         ,(generate-reader t)
-         (declaim (ftype (function (t) (unsigned-byte ,bits))
-                         ,(integer-reader-name bytes nil)))
-         ,(generate-reader nil)))))
-
-(defmacro integer-writer (bytes)
-  "Create a function to write integers to a binary stream."
-  (let ((bits (* 8 bytes)))
-    `(progn
-      (declaim (inline ,(integer-writer-name bytes t)
-                       ,(integer-writer-name bytes nil)))
-      (defun ,(integer-writer-name bytes nil) (socket value)
-        (declare (type stream socket)
-                 (type (unsigned-byte ,bits) value)
-                 #.*optimize*)
-        ,@(if (= bytes 1)
-              `((write-byte value socket))
-              (loop :for byte :from (1- bytes) :downto 0
-                    :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value)
-                               socket)))
-        (values))
-      (defun ,(integer-writer-name bytes t) (socket value)
-        (declare (type stream socket)
-                 (type (signed-byte ,bits) value)
-                 #.*optimize*)
-        ,@(if (= bytes 1)
-              `((write-byte (ldb (byte 8 0) value) socket))
-              (loop :for byte :from (1- bytes) :downto 0
-                    :collect `(write-byte (ldb (byte 8 ,(* byte 8)) value)
-                               socket)))
-        (values)))))
-
-;; All the instances of the above that we need.
-
-(integer-reader 1)
-(integer-reader 2)
-(integer-reader 4)
-(integer-reader 8)
-
-(integer-writer 1)
-(integer-writer 2)
-(integer-writer 4)
-
-(defun write-bytes (socket bytes)
-  "Write a byte-array to a stream."
-  (declare (type stream socket)
-           (type (simple-array (unsigned-byte 8)) bytes)
-           #.*optimize*)
-  (write-sequence bytes socket))
-
-(defun write-str (socket string)
-  "Write a null-terminated string to a stream \(encoding it when UTF-8
-support is enabled.)."
-  (declare (type stream socket)
-           (type string string)
-           #.*optimize*)
-  (enc-write-string string socket)
-  (write-uint1 socket 0))
-
-(declaim (ftype (function (t unsigned-byte)
-                          (simple-array (unsigned-byte 8) (*)))
-                read-bytes))
-(defun read-bytes (socket length)
-  "Read a byte array of the given length from a stream."
-  (declare (type stream socket)
-           (type fixnum length)
-           #.*optimize*)
-  (let ((result (make-array length :element-type '(unsigned-byte 8))))
-    (read-sequence result socket)
-    result))
-
-(declaim (ftype (function (t) string) read-str))
-(defun read-str (socket)
-  "Read a null-terminated string from a stream. Takes care of encoding
-when UTF-8 support is enabled."
-  (declare (type stream socket)
-           #.*optimize*)
-  (enc-read-string socket :null-terminated t))
-
-(defun skip-bytes (socket length)
-  "Skip a given number of bytes in a binary stream."
-  (declare (type stream socket)
-           (type (unsigned-byte 32) length)
-           #.*optimize*)
-  (dotimes (i length)
-    (read-byte socket)))
-
-(defun skip-str (socket)
-  "Skip a null-terminated string."
-  (declare (type stream socket)
-           #.*optimize*)
-  (loop :for char :of-type fixnum = (read-byte socket)
-        :until (zerop char)))
-
-(defun ensure-socket-is-closed (socket &amp;key abort)
-  (when (open-stream-p socket)
-    (handler-case
-        (close socket :abort abort)
-      (error (error)
-        (warn "Ignoring the error which happened while trying to close PostgreSQL socket: ~A" error)))))
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {lineNumbers: true});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-common-lisp</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/commonlisp/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/commonlisp/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/commonlisp/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/crystal/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/crystal/index.html.html
deleted file mode 100644
index 95412579f253a2dc5391ef5509112295c8d4fbed..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/crystal/index.html.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Crystal mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="crystal.js"></script>
-<style>
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-  .cm-s-default span.cm-arrow { color: red; }
-</style>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Crystal</a>
-  </ul>
-</div>
-
-<article>
-<h2>Crystal mode</h2>
-<form><textarea id="code" name="code">
-# Features of Crystal
-# - Ruby-inspired syntax.
-# - Statically type-checked but without having to specify the type of variables or method arguments.
-# - Be able to call C code by writing bindings to it in Crystal.
-# - Have compile-time evaluation and generation of code, to avoid boilerplate code.
-# - Compile to efficient native code.
-
-# A very basic HTTP server
-require "http/server"
-
-server = HTTP::Server.new(8080) do |request|
-  HTTP::Response.ok "text/plain", "Hello world, got #{request.path}!"
-end
-
-puts "Listening on http://0.0.0.0:8080"
-server.listen
-
-module Foo
-  abstract def abstract_method : String
-
-  @[AlwaysInline]
-  def with_foofoo
-    with Foo.new(self) yield
-  end
-
-  struct Foo
-    def initialize(@foo : ::Foo)
-    end
-
-    def hello_world
-      @foo.abstract_method
-    end
-  end
-end
-
-class Bar
-  include Foo
-
-  @@foobar = 12345
-
-  def initialize(@bar : Int32)
-  end
-
-  macro alias_method(name, method)
-    def {{ name }}(*args)
-      {{ method }}(*args)
-    end
-  end
-
-  def a_method
-    "Hello, World"
-  end
-
-  alias_method abstract_method, a_method
-
-  def show_instance_vars : Nil
-    {% for var in @type.instance_vars %}
-      puts "@{{ var }} = #{ @{{ var }} }"
-    {% end %}
-  end
-end
-
-class Baz &lt; Bar; end
-
-lib LibC
-  fun c_puts = "puts"(str : Char*) : Int
-end
-
-baz = Baz.new(100)
-baz.show_instance_vars
-baz.with_foofoo do
-  LibC.c_puts hello_world
-end
-</textarea></form>
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    mode: "text/x-crystal",
-    matchBrackets: true,
-    indentUnit: 2
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>text/x-crystal</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/crystal/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/crystal/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/crystal/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/css.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/css.js.js
index 23d0b4db0c289ba069bb1badebce78c90500f99f..f5f3a41ba8a060200ae36352978aded3ff87c81d 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/css.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/css.js.js
@@ -77,9 +77,9 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
       return ret("qualifier", "qualifier");
     } else if (/[:;{}\[\]\(\)]/.test(ch)) {
       return ret(null, ch);
-    } else if ((ch == "u" && stream.match(/rl(-prefix)?\(/)) ||
-               (ch == "d" && stream.match("omain(")) ||
-               (ch == "r" && stream.match("egexp("))) {
+    } else if (((ch == "u" || ch == "U") && stream.match(/rl(-prefix)?\(/i)) ||
+               ((ch == "d" || ch == "D") && stream.match("omain(", true, true)) ||
+               ((ch == "r" || ch == "R") && stream.match("egexp(", true, true))) {
       stream.backUp(1);
       state.tokenize = tokenParenthesized;
       return ret("property", "word");
@@ -162,16 +162,16 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
       return pushContext(state, stream, "block");
     } else if (type == "}" && state.context.prev) {
       return popContext(state);
-    } else if (supportsAtComponent && /@component/.test(type)) {
+    } else if (supportsAtComponent && /@component/i.test(type)) {
       return pushContext(state, stream, "atComponentBlock");
-    } else if (/^@(-moz-)?document$/.test(type)) {
+    } else if (/^@(-moz-)?document$/i.test(type)) {
       return pushContext(state, stream, "documentTypes");
-    } else if (/^@(media|supports|(-moz-)?document|import)$/.test(type)) {
+    } else if (/^@(media|supports|(-moz-)?document|import)$/i.test(type)) {
       return pushContext(state, stream, "atBlock");
-    } else if (/^@(font-face|counter-style)/.test(type)) {
+    } else if (/^@(font-face|counter-style)/i.test(type)) {
       state.stateArg = type;
       return "restricted_atBlock_before";
-    } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(type)) {
+    } else if (/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(type)) {
       return "keyframes";
     } else if (type && type.charAt(0) == "@") {
       return pushContext(state, stream, "at");
@@ -383,7 +383,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
         style = style[0];
       }
       override = style;
-      state.state = states[state.state](type, stream, state);
+      if (type != "comment")
+        state.state = states[state.state](type, stream, state);
       return override;
     },
 
@@ -401,7 +402,6 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
             ch == "{" && (cx.type == "at" || cx.type == "atBlock")) {
           // Dedent relative to current context.
           indent = Math.max(0, cx.indent - indentUnit);
-          cx = cx.prev;
         }
       }
       return indent;
@@ -410,6 +410,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
     electricChars: "}",
     blockCommentStart: "/*",
     blockCommentEnd: "*/",
+    blockCommentContinue: " * ",
     lineComment: lineComment,
     fold: "brace"
   };
@@ -472,7 +473,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
     "border-top-left-radius", "border-top-right-radius", "border-top-style",
     "border-top-width", "border-width", "bottom", "box-decoration-break",
     "box-shadow", "box-sizing", "break-after", "break-before", "break-inside",
-    "caption-side", "clear", "clip", "color", "color-profile", "column-count",
+    "caption-side", "caret-color", "clear", "clip", "color", "color-profile", "column-count",
     "column-fill", "column-gap", "column-rule", "column-rule-color",
     "column-rule-style", "column-rule-width", "column-span", "column-width",
     "columns", "content", "counter-increment", "counter-reset", "crop", "cue",
@@ -493,7 +494,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
     "grid-row-start", "grid-template", "grid-template-areas", "grid-template-columns",
     "grid-template-rows", "hanging-punctuation", "height", "hyphens",
     "icon", "image-orientation", "image-rendering", "image-resolution",
-    "inline-box-align", "justify-content", "left", "letter-spacing",
+    "inline-box-align", "justify-content", "justify-items", "justify-self", "left", "letter-spacing",
     "line-break", "line-height", "line-stacking", "line-stacking-ruby",
     "line-stacking-shift", "line-stacking-strategy", "list-style",
     "list-style-image", "list-style-position", "list-style-type", "margin",
@@ -508,7 +509,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
     "padding", "padding-bottom", "padding-left", "padding-right", "padding-top",
     "page", "page-break-after", "page-break-before", "page-break-inside",
     "page-policy", "pause", "pause-after", "pause-before", "perspective",
-    "perspective-origin", "pitch", "pitch-range", "play-during", "position",
+    "perspective-origin", "pitch", "pitch-range", "place-content", "place-items", "place-self", "play-during", "position",
     "presentation-level", "punctuation-trim", "quotes", "region-break-after",
     "region-break-before", "region-break-inside", "region-fragment",
     "rendering-intent", "resize", "rest", "rest-after", "rest-before", "richness",
@@ -659,15 +660,15 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
     "s-resize", "sans-serif", "saturation", "scale", "scale3d", "scaleX", "scaleY", "scaleZ", "screen",
     "scroll", "scrollbar", "scroll-position", "se-resize", "searchfield",
     "searchfield-cancel-button", "searchfield-decoration",
-    "searchfield-results-button", "searchfield-results-decoration",
+    "searchfield-results-button", "searchfield-results-decoration", "self-start", "self-end",
     "semi-condensed", "semi-expanded", "separate", "serif", "show", "sidama",
     "simp-chinese-formal", "simp-chinese-informal", "single",
     "skew", "skewX", "skewY", "skip-white-space", "slide", "slider-horizontal",
     "slider-vertical", "sliderthumb-horizontal", "sliderthumb-vertical", "slow",
     "small", "small-caps", "small-caption", "smaller", "soft-light", "solid", "somali",
-    "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "spell-out", "square",
+    "source-atop", "source-in", "source-out", "source-over", "space", "space-around", "space-between", "space-evenly", "spell-out", "square",
     "square-button", "start", "static", "status-bar", "stretch", "stroke", "sub",
-    "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "table",
+    "subpixel-antialiased", "super", "sw-resize", "symbolic", "symbols", "system-ui", "table",
     "table-caption", "table-cell", "table-column", "table-column-group",
     "table-footer-group", "table-header-group", "table-row", "table-row-group",
     "tamil",
@@ -748,8 +749,8 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
         }
       },
       ":": function(stream) {
-        if (stream.match(/\s*\{/))
-          return [null, "{"];
+        if (stream.match(/\s*\{/, false))
+          return [null, null]
         return false;
       },
       "$": function(stream) {
@@ -792,7 +793,7 @@ CodeMirror.defineMode("css", function(config, parserConfig) {
       },
       "@": function(stream) {
         if (stream.eat("{")) return [null, "interpolation"];
-        if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/, false)) return false;
+        if (stream.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i, false)) return false;
         stream.eatWhile(/[\w\\\-]/);
         if (stream.match(/^\s*:/, false))
           return ["variable-2", "variable-definition"];
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.xml
index 947f5e2efc7bb8f442f8677eda4ca9e01cd74218..22c88468948922edb1b3d10dcfbbc0c6c5a76e52 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.xml
@@ -2,29 +2,51 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>gss.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
+            <key> <string>_bind_names</string> </key>
             <value>
-              <dictionary/>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
             </value>
         </item>
         <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>gss.html</string> </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>iso-8859-15</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.zpt
similarity index 96%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.html
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.zpt
index 232fe8c12b4f250f1e672feb5b4f6ee48041c732..37961d5a56ffd279271ade94c25cbb4fb5ba91ef 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.html
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/gss.html.zpt
@@ -1,103 +1,103 @@
-<!doctype html>
-
-<title>CodeMirror: Closure Stylesheets (GSS) mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../addon/hint/show-hint.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="css.js"></script>
-<script src="../../addon/hint/show-hint.js"></script>
-<script src="../../addon/hint/css-hint.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Closure Stylesheets (GSS)</a>
-  </ul>
-</div>
-
-<article>
-<h2>Closure Stylesheets (GSS) mode</h2>
-<form><textarea id="code" name="code">
-/* Some example Closure Stylesheets */
-
-@provide 'some.styles';
-
-@require 'other.styles';
-
-@component {
-
-@def FONT_FAMILY           "Times New Roman", Georgia, Serif;
-@def FONT_SIZE_NORMAL      15px;
-@def FONT_NORMAL           normal FONT_SIZE_NORMAL FONT_FAMILY;
-
-@def BG_COLOR              rgb(235, 239, 249);
-
-@def DIALOG_BORDER_COLOR   rgb(107, 144, 218);
-@def DIALOG_BG_COLOR       BG_COLOR;
-
-@def LEFT_HAND_NAV_WIDTH    180px;
-@def LEFT_HAND_NAV_PADDING  3px;
-
-@defmixin size(WIDTH, HEIGHT) {
-  width: WIDTH;
-  height: HEIGHT;
-}
-
-body {
-  background-color: BG_COLOR;
-  margin: 0;
-  padding: 3em 6em;
-  font: FONT_NORMAL;
-  color: #000;
-}
-
-#navigation a {
-  font-weight: bold;
-  text-decoration: none !important;
-}
-
-.dialog {
-  background-color: DIALOG_BG_COLOR;
-  border: 1px solid DIALOG_BORDER_COLOR;
-}
-
-.content {
-  position: absolute;
-  margin-left: add(LEFT_HAND_NAV_PADDING,  /* padding left */
-                   LEFT_HAND_NAV_WIDTH,
-                   LEFT_HAND_NAV_PADDING); /* padding right */
-
-}
-
-.logo {
-  @mixin size(150px, 55px);
-  background-image: url('http://www.google.com/images/logo_sm.gif');
-}
-
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        extraKeys: {"Ctrl-Space": "autocomplete"},
-        lineNumbers: true,
-        matchBrackets: "text/x-less",
-        mode: "text/x-gss"
-      });
-    </script>
-
-    <p>A mode for <a href="https://github.com/google/closure-stylesheets">Closure Stylesheets</a> (GSS).</p>
-    <p><strong>MIME type defined:</strong> <code>text/x-gss</code>.</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gss_*">normal</a>,  <a href="../../test/index.html#verbose,gss_*">verbose</a>.</p>
-
-  </article>
+<!doctype html>
+
+<title>CodeMirror: Closure Stylesheets (GSS) mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<link rel="stylesheet" href="../../addon/hint/show-hint.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="css.js"></script>
+<script src="../../addon/hint/show-hint.js"></script>
+<script src="../../addon/hint/css-hint.js"></script>
+<style>.CodeMirror {background: #f8f8f8;}</style>
+<div id=nav>
+  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+  <ul>
+    <li><a href="../../index.html">Home</a>
+    <li><a href="../../doc/manual.html">Manual</a>
+    <li><a href="https://github.com/codemirror/codemirror">Code</a>
+  </ul>
+  <ul>
+    <li><a href="../index.html">Language modes</a>
+    <li><a class=active href="#">Closure Stylesheets (GSS)</a>
+  </ul>
+</div>
+
+<article>
+<h2>Closure Stylesheets (GSS) mode</h2>
+<form><textarea id="code" name="code">
+/* Some example Closure Stylesheets */
+
+@provide 'some.styles';
+
+@require 'other.styles';
+
+@component {
+
+@def FONT_FAMILY           "Times New Roman", Georgia, Serif;
+@def FONT_SIZE_NORMAL      15px;
+@def FONT_NORMAL           normal FONT_SIZE_NORMAL FONT_FAMILY;
+
+@def BG_COLOR              rgb(235, 239, 249);
+
+@def DIALOG_BORDER_COLOR   rgb(107, 144, 218);
+@def DIALOG_BG_COLOR       BG_COLOR;
+
+@def LEFT_HAND_NAV_WIDTH    180px;
+@def LEFT_HAND_NAV_PADDING  3px;
+
+@defmixin size(WIDTH, HEIGHT) {
+  width: WIDTH;
+  height: HEIGHT;
+}
+
+body {
+  background-color: BG_COLOR;
+  margin: 0;
+  padding: 3em 6em;
+  font: FONT_NORMAL;
+  color: #000;
+}
+
+#navigation a {
+  font-weight: bold;
+  text-decoration: none !important;
+}
+
+.dialog {
+  background-color: DIALOG_BG_COLOR;
+  border: 1px solid DIALOG_BORDER_COLOR;
+}
+
+.content {
+  position: absolute;
+  margin-left: add(LEFT_HAND_NAV_PADDING,  /* padding left */
+                   LEFT_HAND_NAV_WIDTH,
+                   LEFT_HAND_NAV_PADDING); /* padding right */
+
+}
+
+.logo {
+  @mixin size(150px, 55px);
+  background-image: url('http://www.google.com/images/logo_sm.gif');
+}
+
+}
+</textarea></form>
+    <script>
+      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+        extraKeys: {"Ctrl-Space": "autocomplete"},
+        lineNumbers: true,
+        matchBrackets: "text/x-less",
+        mode: "text/x-gss"
+      });
+    </script>
+
+    <p>A mode for <a href="https://github.com/google/closure-stylesheets">Closure Stylesheets</a> (GSS).</p>
+    <p><strong>MIME type defined:</strong> <code>text/x-gss</code>.</p>
+
+    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gss_*">normal</a>,  <a href="../../test/index.html#verbose,gss_*">verbose</a>.</p>
+
+  </article>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/index.html.html
deleted file mode 100644
index 0d85311f1d92086acb46be20692d5ba48a390f65..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/index.html.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: CSS mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../addon/hint/show-hint.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="css.js"></script>
-<script src="../../addon/hint/show-hint.js"></script>
-<script src="../../addon/hint/css-hint.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">CSS</a>
-  </ul>
-</div>
-
-<article>
-<h2>CSS mode</h2>
-<form><textarea id="code" name="code">
-/* Some example CSS */
-
-@import url("something.css");
-
-body {
-  margin: 0;
-  padding: 3em 6em;
-  font-family: tahoma, arial, sans-serif;
-  color: #000;
-}
-
-#navigation a {
-  font-weight: bold;
-  text-decoration: none !important;
-}
-
-h1 {
-  font-size: 2.5em;
-}
-
-h2 {
-  font-size: 1.7em;
-}
-
-h1:before, h2:before {
-  content: "::";
-}
-
-code {
-  font-family: courier, monospace;
-  font-size: 80%;
-  color: #418A8A;
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        extraKeys: {"Ctrl-Space": "autocomplete"}
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/css</code>, <code>text/x-scss</code> (<a href="scss.html">demo</a>), <code>text/x-less</code> (<a href="less.html">demo</a>).</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#css_*">normal</a>,  <a href="../../test/index.html#verbose,css_*">verbose</a>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.xml
index c44a6f3f5555b303d26d91bf5835e3f3d3a170f7..fd5059754ce054c74afad5eb388b6947cfa1e8dc 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.xml
@@ -2,29 +2,51 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>less.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
+            <key> <string>_bind_names</string> </key>
             <value>
-              <dictionary/>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
             </value>
         </item>
         <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>less.html</string> </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>iso-8859-15</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.zpt
similarity index 94%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.html
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.zpt
index adf7427d3044b3a7049e92fc1e173022c9ef49c0..fb38d27929dcc53c1015e8d41dd48d4bbc3650f5 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.html
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/less.html.zpt
@@ -1,152 +1,152 @@
-<!doctype html>
-
-<title>CodeMirror: LESS mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="css.js"></script>
-<style>.CodeMirror {border: 1px solid #ddd; line-height: 1.2;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">LESS</a>
-  </ul>
-</div>
-
-<article>
-<h2>LESS mode</h2>
-<form><textarea id="code" name="code">@media screen and (device-aspect-ratio: 16/9) { 鈥� }
-@media screen and (device-aspect-ratio: 1280/720) { 鈥� }
-@media screen and (device-aspect-ratio: 2560/1440) { 鈥� }
-
-html:lang(fr-be)
-
-tr:nth-child(2n+1) /* represents every odd row of an HTML table */
-
-img:nth-of-type(2n+1) { float: right; }
-img:nth-of-type(2n) { float: left; }
-
-body > h2:not(:first-of-type):not(:last-of-type)
-
-html|*:not(:link):not(:visited)
-*|*:not(:hover)
-p::first-line { text-transform: uppercase }
-
-@namespace foo url(http://www.example.com);
-foo|h1 { color: blue }  /* first rule */
-
-span[hello="Ocean"][goodbye="Land"]
-
-E[foo]{
-  padding:65px;
-}
-
-input[type="search"]::-webkit-search-decoration,
-input[type="search"]::-webkit-search-cancel-button {
-  -webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5
-}
-button::-moz-focus-inner,
-input::-moz-focus-inner { // Inner padding and border oddities in FF3/4
-  padding: 0;
-  border: 0;
-}
-.btn {
-  // reset here as of 2.0.3 due to Recess property order
-  border-color: #ccc;
-  border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);
-}
-fieldset span button, fieldset span input[type="file"] {
-  font-size:12px;
-	font-family:Arial, Helvetica, sans-serif;
-}
-
-.rounded-corners (@radius: 5px) {
-  border-radius: @radius;
-  -webkit-border-radius: @radius;
-  -moz-border-radius: @radius;
-}
-
-@import url("something.css");
-
-@light-blue:   hsl(190, 50%, 65%);
-
-#menu {
-  position: absolute;
-  width: 100%;
-  z-index: 3;
-  clear: both;
-  display: block;
-  background-color: @blue;
-  height: 42px;
-  border-top: 2px solid lighten(@alpha-blue, 20%);
-  border-bottom: 2px solid darken(@alpha-blue, 25%);
-  .box-shadow(0, 1px, 8px, 0.6);
-  -moz-box-shadow: 0 0 0 #000; // Because firefox sucks.
-
-  &.docked {
-    background-color: hsla(210, 60%, 40%, 0.4);
-  }
-  &:hover {
-    background-color: @blue;
-  }
-
-  #dropdown {
-    margin: 0 0 0 117px;
-    padding: 0;
-    padding-top: 5px;
-    display: none;
-    width: 190px;
-    border-top: 2px solid @medium;
-    color: @highlight;
-    border: 2px solid darken(@medium, 25%);
-    border-left-color: darken(@medium, 15%);
-    border-right-color: darken(@medium, 15%);
-    border-top-width: 0;
-    background-color: darken(@medium, 10%);
-    ul {
-      padding: 0px;  
-    }
-    li {
-      font-size: 14px;
-      display: block;
-      text-align: left;
-      padding: 0;
-      border: 0;
-      a {
-        display: block;
-        padding: 0px 15px;  
-        text-decoration: none;
-        color: white;  
-        &:hover {
-          background-color: darken(@medium, 15%);
-          text-decoration: none;
-        }
-      }
-    }
-    .border-radius(5px, bottom);
-    .box-shadow(0, 6px, 8px, 0.5);
-  }
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers : true,
-        matchBrackets : true,
-        mode: "text/x-less"
-      });
-    </script>
-
-    <p>The LESS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#less_*">normal</a>,  <a href="../../test/index.html#verbose,less_*">verbose</a>.</p>
-  </article>
+<!doctype html>
+
+<title>CodeMirror: LESS mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/cm_edit/matchbrackets.js"></script>
+<script src="css.js"></script>
+<style>.CodeMirror {border: 1px solid #ddd; line-height: 1.2;}</style>
+<div id=nav>
+  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+  <ul>
+    <li><a href="../../index.html">Home</a>
+    <li><a href="../../doc/manual.html">Manual</a>
+    <li><a href="https://github.com/codemirror/codemirror">Code</a>
+  </ul>
+  <ul>
+    <li><a href="../index.html">Language modes</a>
+    <li><a class=active href="#">LESS</a>
+  </ul>
+</div>
+
+<article>
+<h2>LESS mode</h2>
+<form><textarea id="code" name="code">@media screen and (device-aspect-ratio: 16/9) { 鈥� }
+@media screen and (device-aspect-ratio: 1280/720) { 鈥� }
+@media screen and (device-aspect-ratio: 2560/1440) { 鈥� }
+
+html:lang(fr-be)
+
+tr:nth-child(2n+1) /* represents every odd row of an HTML table */
+
+img:nth-of-type(2n+1) { float: right; }
+img:nth-of-type(2n) { float: left; }
+
+body > h2:not(:first-of-type):not(:last-of-type)
+
+html|*:not(:link):not(:visited)
+*|*:not(:hover)
+p::first-line { text-transform: uppercase }
+
+@namespace foo url(http://www.example.com);
+foo|h1 { color: blue }  /* first rule */
+
+span[hello="Ocean"][goodbye="Land"]
+
+E[foo]{
+  padding:65px;
+}
+
+input[type="search"]::-webkit-search-decoration,
+input[type="search"]::-webkit-search-cancel-button {
+  -webkit-appearance: none; // Inner-padding issues in Chrome OSX, Safari 5
+}
+button::-moz-focus-inner,
+input::-moz-focus-inner { // Inner padding and border oddities in FF3/4
+  padding: 0;
+  border: 0;
+}
+.btn {
+  // reset here as of 2.0.3 due to Recess property order
+  border-color: #ccc;
+  border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);
+}
+fieldset span button, fieldset span input[type="file"] {
+  font-size:12px;
+	font-family:Arial, Helvetica, sans-serif;
+}
+
+.rounded-corners (@radius: 5px) {
+  border-radius: @radius;
+  -webkit-border-radius: @radius;
+  -moz-border-radius: @radius;
+}
+
+@import url("something.css");
+
+@light-blue:   hsl(190, 50%, 65%);
+
+#menu {
+  position: absolute;
+  width: 100%;
+  z-index: 3;
+  clear: both;
+  display: block;
+  background-color: @blue;
+  height: 42px;
+  border-top: 2px solid lighten(@alpha-blue, 20%);
+  border-bottom: 2px solid darken(@alpha-blue, 25%);
+  .box-shadow(0, 1px, 8px, 0.6);
+  -moz-box-shadow: 0 0 0 #000; // Because firefox sucks.
+
+  &.docked {
+    background-color: hsla(210, 60%, 40%, 0.4);
+  }
+  &:hover {
+    background-color: @blue;
+  }
+
+  #dropdown {
+    margin: 0 0 0 117px;
+    padding: 0;
+    padding-top: 5px;
+    display: none;
+    width: 190px;
+    border-top: 2px solid @medium;
+    color: @highlight;
+    border: 2px solid darken(@medium, 25%);
+    border-left-color: darken(@medium, 15%);
+    border-right-color: darken(@medium, 15%);
+    border-top-width: 0;
+    background-color: darken(@medium, 10%);
+    ul {
+      padding: 0px;  
+    }
+    li {
+      font-size: 14px;
+      display: block;
+      text-align: left;
+      padding: 0;
+      border: 0;
+      a {
+        display: block;
+        padding: 0px 15px;  
+        text-decoration: none;
+        color: white;  
+        &:hover {
+          background-color: darken(@medium, 15%);
+          text-decoration: none;
+        }
+      }
+    }
+    .border-radius(5px, bottom);
+    .box-shadow(0, 6px, 8px, 0.5);
+  }
+}
+</textarea></form>
+    <script>
+      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+        lineNumbers : true,
+        matchBrackets : true,
+        mode: "text/x-less"
+      });
+    </script>
+
+    <p>The LESS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
+
+    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#less_*">normal</a>,  <a href="../../test/index.html#verbose,less_*">verbose</a>.</p>
+  </article>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.xml
index 89e2af59e1e0926d7614ebde13f062fe35ec05b5..ed9acc84a705b5bb2e18c7220b99d3b6b14bd889 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.xml
@@ -2,29 +2,51 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>scss.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
+            <key> <string>_bind_names</string> </key>
             <value>
-              <dictionary/>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
             </value>
         </item>
         <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>scss.html</string> </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>iso-8859-15</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.zpt
similarity index 94%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.html
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.zpt
index f8e4d373689c3dc04d1917a96f7ea2530bdb9af5..186c098c83a84e60472e80617333ae9aa24760b8 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.html
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/scss.html.zpt
@@ -1,157 +1,157 @@
-<!doctype html>
-
-<title>CodeMirror: SCSS mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="css.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">SCSS</a>
-  </ul>
-</div>
-
-<article>
-<h2>SCSS mode</h2>
-<form><textarea id="code" name="code">
-/* Some example SCSS */
-
-@import "compass/css3";
-$variable: #333;
-
-$blue: #3bbfce;
-$margin: 16px;
-
-.content-navigation {
-  #nested {
-    background-color: black;
-  }
-  border-color: $blue;
-  color:
-    darken($blue, 9%);
-}
-
-.border {
-  padding: $margin / 2;
-  margin: $margin / 2;
-  border-color: $blue;
-}
-
-@mixin table-base {
-  th {
-    text-align: center;
-    font-weight: bold;
-  }
-  td, th {padding: 2px}
-}
-
-table.hl {
-  margin: 2em 0;
-  td.ln {
-    text-align: right;
-  }
-}
-
-li {
-  font: {
-    family: serif;
-    weight: bold;
-    size: 1.2em;
-  }
-}
-
-@mixin left($dist) {
-  float: left;
-  margin-left: $dist;
-}
-
-#data {
-  @include left(10px);
-  @include table-base;
-}
-
-.source {
-  @include flow-into(target);
-  border: 10px solid green;
-  margin: 20px;
-  width: 200px; }
-
-.new-container {
-  @include flow-from(target);
-  border: 10px solid red;
-  margin: 20px;
-  width: 200px; }
-
-body {
-  margin: 0;
-  padding: 3em 6em;
-  font-family: tahoma, arial, sans-serif;
-  color: #000;
-}
-
-@mixin yellow() {
-  background: yellow;
-}
-
-.big {
-  font-size: 14px;
-}
-
-.nested {
-  @include border-radius(3px);
-  @extend .big;
-  p {
-    background: whitesmoke;
-    a {
-      color: red;
-    }
-  }
-}
-
-#navigation a {
-  font-weight: bold;
-  text-decoration: none !important;
-}
-
-h1 {
-  font-size: 2.5em;
-}
-
-h2 {
-  font-size: 1.7em;
-}
-
-h1:before, h2:before {
-  content: "::";
-}
-
-code {
-  font-family: courier, monospace;
-  font-size: 80%;
-  color: #418A8A;
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-scss"
-      });
-    </script>
-
-    <p>The SCSS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#scss_*">normal</a>,  <a href="../../test/index.html#verbose,scss_*">verbose</a>.</p>
-
-  </article>
+<!doctype html>
+
+<title>CodeMirror: SCSS mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="css.js"></script>
+<style>.CodeMirror {background: #f8f8f8;}</style>
+<div id=nav>
+  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+  <ul>
+    <li><a href="../../index.html">Home</a>
+    <li><a href="../../doc/manual.html">Manual</a>
+    <li><a href="https://github.com/codemirror/codemirror">Code</a>
+  </ul>
+  <ul>
+    <li><a href="../index.html">Language modes</a>
+    <li><a class=active href="#">SCSS</a>
+  </ul>
+</div>
+
+<article>
+<h2>SCSS mode</h2>
+<form><textarea id="code" name="code">
+/* Some example SCSS */
+
+@import "compass/css3";
+$variable: #333;
+
+$blue: #3bbfce;
+$margin: 16px;
+
+.content-navigation {
+  #nested {
+    background-color: black;
+  }
+  border-color: $blue;
+  color:
+    darken($blue, 9%);
+}
+
+.border {
+  padding: $margin / 2;
+  margin: $margin / 2;
+  border-color: $blue;
+}
+
+@mixin table-base {
+  th {
+    text-align: center;
+    font-weight: bold;
+  }
+  td, th {padding: 2px}
+}
+
+table.hl {
+  margin: 2em 0;
+  td.ln {
+    text-align: right;
+  }
+}
+
+li {
+  font: {
+    family: serif;
+    weight: bold;
+    size: 1.2em;
+  }
+}
+
+@mixin left($dist) {
+  float: left;
+  margin-left: $dist;
+}
+
+#data {
+  @include left(10px);
+  @include table-base;
+}
+
+.source {
+  @include flow-into(target);
+  border: 10px solid green;
+  margin: 20px;
+  width: 200px; }
+
+.new-container {
+  @include flow-from(target);
+  border: 10px solid red;
+  margin: 20px;
+  width: 200px; }
+
+body {
+  margin: 0;
+  padding: 3em 6em;
+  font-family: tahoma, arial, sans-serif;
+  color: #000;
+}
+
+@mixin yellow() {
+  background: yellow;
+}
+
+.big {
+  font-size: 14px;
+}
+
+.nested {
+  @include border-radius(3px);
+  @extend .big;
+  p {
+    background: whitesmoke;
+    a {
+      color: red;
+    }
+  }
+}
+
+#navigation a {
+  font-weight: bold;
+  text-decoration: none !important;
+}
+
+h1 {
+  font-size: 2.5em;
+}
+
+h2 {
+  font-size: 1.7em;
+}
+
+h1:before, h2:before {
+  content: "::";
+}
+
+code {
+  font-family: courier, monospace;
+  font-size: 80%;
+  color: #418A8A;
+}
+</textarea></form>
+    <script>
+      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+        lineNumbers: true,
+        matchBrackets: true,
+        mode: "text/x-scss"
+      });
+    </script>
+
+    <p>The SCSS mode is a sub-mode of the <a href="index.html">CSS mode</a> (defined in <code>css.js</code>).</p>
+
+    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#scss_*">normal</a>,  <a href="../../test/index.html#verbose,scss_*">verbose</a>.</p>
+
+  </article>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/test.js.js
index 7a496fb09115373195500999e3e0245740d7ca1b..e5c55d39992d6c9463393f3bf1dee193864a1512 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/css/test.js.js
@@ -24,6 +24,9 @@
   MT("atMediaUnknownFeatureValueKeyword",
      "[def @media] ([property orientation]: [error upsidedown]) { }");
 
+  MT("atMediaUppercase",
+     "[def @MEDIA] ([property orienTAtion]: [keyword landScape]) { }");
+
   MT("tagSelector",
      "[tag foo] { }");
 
@@ -197,4 +200,10 @@
 
    MT("counter-style-symbols",
       "[tag ol] { [property list-style]: [atom symbols]([atom cyclic] [string \"*\"] [string \"\\2020\"] [string \"\\2021\"] [string \"\\A7\"]); }");
+
+  MT("comment-does-not-disrupt",
+     "[def @font-face] [comment /* foo */] {",
+     "  [property src]: [atom url]([string x]);",
+     "  [property font-family]: [variable One];",
+     "}")
 })();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cypher/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cypher/index.html.html
deleted file mode 100644
index b8bd75c8b340b8655d0cfe11777f47d14de6f70c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cypher/index.html.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Cypher Mode for CodeMirror</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css" />
-<link rel="stylesheet" href="../../theme/neo.css" />
-<script src="../../lib/codemirror.js"></script>
-<script src="cypher.js"></script>
-<style>
-.CodeMirror {
-    border-top: 1px solid black;
-    border-bottom: 1px solid black;
-}
-        </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Cypher Mode for CodeMirror</a>
-  </ul>
-</div>
-
-<article>
-<h2>Cypher Mode for CodeMirror</h2>
-<form>
-            <textarea id="code" name="code">// Cypher Mode for CodeMirror, using the neo theme
-MATCH (joe { name: 'Joe' })-[:knows*2..2]-(friend_of_friend)
-WHERE NOT (joe)-[:knows]-(friend_of_friend)
-RETURN friend_of_friend.name, COUNT(*)
-ORDER BY COUNT(*) DESC , friend_of_friend.name
-</textarea>
-            </form>
-            <p><strong>MIME types defined:</strong> 
-            <code><a href="?mime=application/x-cypher-query">application/x-cypher-query</a></code>
-        </p>
-<script>
-window.onload = function() {
-  var mime = 'application/x-cypher-query';
-  // get mime type
-  if (window.location.href.indexOf('mime=') > -1) {
-    mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5);
-  }
-  window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
-    mode: mime,
-    indentWithTabs: true,
-    smartIndent: true,
-    lineNumbers: true,
-    matchBrackets : true,
-    autofocus: true,
-    theme: 'neo'
-  });
-};
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cypher/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cypher/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/cypher/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/d.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/d.js.js
index c927a7e35861938bf8380937a329a1df69e107bc..77b09c224e552aa313d1d120f844261becb65eb4 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/d.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/d.js.js
@@ -44,7 +44,7 @@ CodeMirror.defineMode("d", function(config, parserConfig) {
     }
     if (ch == "/") {
       if (stream.eat("+")) {
-        state.tokenize = tokenComment;
+        state.tokenize = tokenNestedComment;
         return tokenNestedComment(stream, state);
       }
       if (stream.eat("*")) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/index.html.html
deleted file mode 100644
index 08cabd8a2e2c269ae5e694636b56f565c2fbc16c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/index.html.html
+++ /dev/null
@@ -1,273 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: D mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="d.js"></script>
-<style>.CodeMirror {border: 2px inset #dee;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">D</a>
-  </ul>
-</div>
-
-<article>
-<h2>D mode</h2>
-<form><textarea id="code" name="code">
-/* D demo code // copied from phobos/sd/metastrings.d */
-// Written in the D programming language.
-
-/**
-Templates with which to do compile-time manipulation of strings.
-
-Macros:
- WIKI = Phobos/StdMetastrings
-
-Copyright: Copyright Digital Mars 2007 - 2009.
-License:   <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
-Authors:   $(WEB digitalmars.com, Walter Bright),
-           Don Clugston
-Source:    $(PHOBOSSRC std/_metastrings.d)
-*/
-/*
-         Copyright Digital Mars 2007 - 2009.
-Distributed under the Boost Software License, Version 1.0.
-   (See accompanying file LICENSE_1_0.txt or copy at
-         http://www.boost.org/LICENSE_1_0.txt)
- */
-module std.metastrings;
-
-/**
-Formats constants into a string at compile time.  Analogous to $(XREF
-string,format).
-
-Parameters:
-
-A = tuple of constants, which can be strings, characters, or integral
-    values.
-
-Formats:
- *    The formats supported are %s for strings, and %%
- *    for the % character.
-Example:
----
-import std.metastrings;
-import std.stdio;
-
-void main()
-{
-  string s = Format!("Arg %s = %s", "foo", 27);
-  writefln(s); // "Arg foo = 27"
-}
- * ---
- */
-
-template Format(A...)
-{
-    static if (A.length == 0)
-        enum Format = "";
-    else static if (is(typeof(A[0]) : const(char)[]))
-        enum Format = FormatString!(A[0], A[1..$]);
-    else
-        enum Format = toStringNow!(A[0]) ~ Format!(A[1..$]);
-}
-
-template FormatString(const(char)[] F, A...)
-{
-    static if (F.length == 0)
-        enum FormatString = Format!(A);
-    else static if (F.length == 1)
-        enum FormatString = F[0] ~ Format!(A);
-    else static if (F[0..2] == "%s")
-        enum FormatString
-            = toStringNow!(A[0]) ~ FormatString!(F[2..$],A[1..$]);
-    else static if (F[0..2] == "%%")
-        enum FormatString = "%" ~ FormatString!(F[2..$],A);
-    else
-    {
-        static assert(F[0] != '%', "unrecognized format %" ~ F[1]);
-        enum FormatString = F[0] ~ FormatString!(F[1..$],A);
-    }
-}
-
-unittest
-{
-    auto s = Format!("hel%slo", "world", -138, 'c', true);
-    assert(s == "helworldlo-138ctrue", "[" ~ s ~ "]");
-}
-
-/**
- * Convert constant argument to a string.
- */
-
-template toStringNow(ulong v)
-{
-    static if (v < 10)
-        enum toStringNow = "" ~ cast(char)(v + '0');
-    else
-        enum toStringNow = toStringNow!(v / 10) ~ toStringNow!(v % 10);
-}
-
-unittest
-{
-    static assert(toStringNow!(1uL << 62) == "4611686018427387904");
-}
-
-/// ditto
-template toStringNow(long v)
-{
-    static if (v < 0)
-        enum toStringNow = "-" ~ toStringNow!(cast(ulong) -v);
-    else
-        enum toStringNow = toStringNow!(cast(ulong) v);
-}
-
-unittest
-{
-    static assert(toStringNow!(0x100000000) == "4294967296");
-    static assert(toStringNow!(-138L) == "-138");
-}
-
-/// ditto
-template toStringNow(uint U)
-{
-    enum toStringNow = toStringNow!(cast(ulong)U);
-}
-
-/// ditto
-template toStringNow(int I)
-{
-    enum toStringNow = toStringNow!(cast(long)I);
-}
-
-/// ditto
-template toStringNow(bool B)
-{
-    enum toStringNow = B ? "true" : "false";
-}
-
-/// ditto
-template toStringNow(string S)
-{
-    enum toStringNow = S;
-}
-
-/// ditto
-template toStringNow(char C)
-{
-    enum toStringNow = "" ~ C;
-}
-
-
-/********
- * Parse unsigned integer literal from the start of string s.
- * returns:
- *    .value = the integer literal as a string,
- *    .rest = the string following the integer literal
- * Otherwise:
- *    .value = null,
- *    .rest = s
- */
-
-template parseUinteger(const(char)[] s)
-{
-    static if (s.length == 0)
-    {
-        enum value = "";
-        enum rest = "";
-    }
-    else static if (s[0] >= '0' && s[0] <= '9')
-    {
-        enum value = s[0] ~ parseUinteger!(s[1..$]).value;
-        enum rest = parseUinteger!(s[1..$]).rest;
-    }
-    else
-    {
-        enum value = "";
-        enum rest = s;
-    }
-}
-
-/********
-Parse integer literal optionally preceded by $(D '-') from the start
-of string $(D s).
-
-Returns:
-   .value = the integer literal as a string,
-   .rest = the string following the integer literal
-
-Otherwise:
-   .value = null,
-   .rest = s
-*/
-
-template parseInteger(const(char)[] s)
-{
-    static if (s.length == 0)
-    {
-        enum value = "";
-        enum rest = "";
-    }
-    else static if (s[0] >= '0' && s[0] <= '9')
-    {
-        enum value = s[0] ~ parseUinteger!(s[1..$]).value;
-        enum rest = parseUinteger!(s[1..$]).rest;
-    }
-    else static if (s.length >= 2 &&
-            s[0] == '-' && s[1] >= '0' && s[1] <= '9')
-    {
-        enum value = s[0..2] ~ parseUinteger!(s[2..$]).value;
-        enum rest = parseUinteger!(s[2..$]).rest;
-    }
-    else
-    {
-        enum value = "";
-        enum rest = s;
-    }
-}
-
-unittest
-{
-    assert(parseUinteger!("1234abc").value == "1234");
-    assert(parseUinteger!("1234abc").rest == "abc");
-    assert(parseInteger!("-1234abc").value == "-1234");
-    assert(parseInteger!("-1234abc").rest == "abc");
-}
-
-/**
-Deprecated aliases held for backward compatibility.
-*/
-deprecated alias toStringNow ToString;
-/// Ditto
-deprecated alias parseUinteger ParseUinteger;
-/// Ditto
-deprecated alias parseUinteger ParseInteger;
-
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        indentUnit: 4,
-        mode: "text/x-d"
-      });
-    </script>
-
-    <p>Simple mode that handle D-Syntax (<a href="http://www.dlang.org">DLang Homepage</a>).</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-d</code>
-    .</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/test.js.js
new file mode 100644
index 0000000000000000000000000000000000000000..d8de4ad35f864903e754f48689111e0e74e93dee
--- /dev/null
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/test.js.js
@@ -0,0 +1,11 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+  var mode = CodeMirror.getMode({indentUnit: 2}, "d");
+  function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+  MT("nested_comments",
+     "[comment /+]","[comment comment]","[comment +/]","[variable void] [variable main](){}");
+
+})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/test.js.xml
similarity index 100%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/test.js.xml
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/d/test.js.xml
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/dart.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/dart.js.js
index 8d383a95efb8b2c0c495d71c274e121d5778ae25..4db0d37159a166bd0dedd86d210f58d6492df713 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/dart.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/dart.js.js
@@ -12,8 +12,8 @@
   "use strict";
 
   var keywords = ("this super static final const abstract class extends external factory " +
-    "implements get native operator set typedef with enum throw rethrow " +
-    "assert break case continue default in return new deferred async await " +
+    "implements get native set typedef with enum throw rethrow " +
+    "assert break case continue default in return new deferred async await covariant " +
     "try catch finally do else for if switch while import library export " +
     "part of show hide is as").split(" ");
   var blockKeywords = "try catch finally do else for if switch while".split(" ");
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/index.html.html
deleted file mode 100644
index e79da5a8b0ea462616a9c070c73140332f57473b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/index.html.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Dart mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../clike/clike.js"></script>
-<script src="dart.js"></script>
-<style>.CodeMirror {border: 1px solid #dee;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Dart</a>
-  </ul>
-</div>
-
-<article>
-<h2>Dart mode</h2>
-<form>
-<textarea id="code" name="code">
-import 'dart:math' show Random;
-
-void main() {
-  print(new Die(n: 12).roll());
-}
-
-// Define a class.
-class Die {
-  // Define a class variable.
-  static Random shaker = new Random();
-
-  // Define instance variables.
-  int sides, value;
-
-  // Define a method using shorthand syntax.
-  String toString() => '$value';
-
-  // Define a constructor.
-  Die({int n: 6}) {
-    if (4 <= n && n <= 20) {
-      sides = n;
-    } else {
-      // Support for errors and exceptions.
-      throw new ArgumentError(/* */);
-    }
-  }
-
-  // Define an instance method.
-  int roll() {
-    return value = shaker.nextInt(sides) + 1;
-  }
-}
-</textarea>
-</form>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    mode: "application/dart"
-  });
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dart/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/diff/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/diff/index.html.html
deleted file mode 100644
index 0af611fa483bd425c00fcde87be835177fe460c1..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/diff/index.html.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Diff mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="diff.js"></script>
-<style>
-      .CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}
-      span.cm-meta {color: #a0b !important;}
-      span.cm-error { background-color: black; opacity: 0.4;}
-      span.cm-error.cm-string { background-color: red; }
-      span.cm-error.cm-tag { background-color: #2b2; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Diff</a>
-  </ul>
-</div>
-
-<article>
-<h2>Diff mode</h2>
-<form><textarea id="code" name="code">
-diff --git a/index.html b/index.html
-index c1d9156..7764744 100644
---- a/index.html
-+++ b/index.html
-@@ -95,7 +95,8 @@ StringStream.prototype = {
-     <script>
-       var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-         lineNumbers: true,
--        autoMatchBrackets: true
-+        autoMatchBrackets: true,
-+      onGutterClick: function(x){console.log(x);}
-       });
-     </script>
-   </body>
-diff --git a/lib/codemirror.js b/lib/codemirror.js
-index 04646a9..9a39cc7 100644
---- a/lib/codemirror.js
-+++ b/lib/codemirror.js
-@@ -399,10 +399,16 @@ var CodeMirror = (function() {
-     }
- 
-     function onMouseDown(e) {
--      var start = posFromMouse(e), last = start;    
-+      var start = posFromMouse(e), last = start, target = e.target();
-       if (!start) return;
-       setCursor(start.line, start.ch, false);
-       if (e.button() != 1) return;
-+      if (target.parentNode == gutter) {    
-+        if (options.onGutterClick)
-+          options.onGutterClick(indexOf(gutter.childNodes, target) + showingFrom);
-+        return;
-+      }
-+
-       if (!focused) onFocus();
- 
-       e.stop();
-@@ -808,7 +814,7 @@ var CodeMirror = (function() {
-       for (var i = showingFrom; i < showingTo; ++i) {
-         var marker = lines[i].gutterMarker;
-         if (marker) html.push('<div class="' + marker.style + '">' + htmlEscape(marker.text) + '</div>');
--        else html.push("<div>" + (options.lineNumbers ? i + 1 : "\u00a0") + "</div>");
-+        else html.push("<div>" + (options.lineNumbers ? i + options.firstLineNumber : "\u00a0") + "</div>");
-       }
-       gutter.style.display = "none"; // TODO test whether this actually helps
-       gutter.innerHTML = html.join("");
-@@ -1371,10 +1377,8 @@ var CodeMirror = (function() {
-         if (option == "parser") setParser(value);
-         else if (option === "lineNumbers") setLineNumbers(value);
-         else if (option === "gutter") setGutter(value);
--        else if (option === "readOnly") options.readOnly = value;
--        else if (option === "indentUnit") {options.indentUnit = indentUnit = value; setParser(options.parser);}
--        else if (/^(?:enterMode|tabMode|indentWithTabs|readOnly|autoMatchBrackets|undoDepth)$/.test(option)) options[option] = value;
--        else throw new Error("Can't set option " + option);
-+        else if (option === "indentUnit") {options.indentUnit = value; setParser(options.parser);}
-+        else options[option] = value;
-       },
-       cursorCoords: cursorCoords,
-       undo: operation(undo),
-@@ -1402,7 +1406,8 @@ var CodeMirror = (function() {
-       replaceRange: operation(replaceRange),
- 
-       operation: function(f){return operation(f)();},
--      refresh: function(){updateDisplay([{from: 0, to: lines.length}]);}
-+      refresh: function(){updateDisplay([{from: 0, to: lines.length}]);},
-+      getInputField: function(){return input;}
-     };
-     return instance;
-   }
-@@ -1420,6 +1425,7 @@ var CodeMirror = (function() {
-     readOnly: false,
-     onChange: null,
-     onCursorActivity: null,
-+    onGutterClick: null,
-     autoMatchBrackets: false,
-     workTime: 200,
-     workDelay: 300,
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-diff</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/diff/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/diff/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/diff/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/django/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/django/index.html.html
deleted file mode 100644
index 41ea07c91b283079ab7ec7c1e82ac8e92c6d37b0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/django/index.html.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Django template mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/mdn-like.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/overlay.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="django.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Django</a>
-  </ul>
-</div>
-
-<article>
-<h2>Django template mode</h2>
-<form><textarea id="code" name="code">
-<!doctype html>
-<html>
-  <head>
-    <title>My Django web application</title>
-  </head>
-  <body>
-    <h1>
-      {{ page.title|capfirst }}
-    </h1>
-    <ul class="my-list">
-      {# traverse a list of items and produce links to their views. #}
-      {% for item in items %}
-      <li>
-        <a href="{% url 'item_view' item.name|slugify %}">
-          {{ item.name }}
-        </a>
-      </li>
-      {% empty %}
-      <li>You have no items in your list.</li>
-      {% endfor %}
-    </ul>
-    {% comment "this is a forgotten footer" %}
-    <footer></footer>
-    {% endcomment %}
-  </body>
-</html>
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "django",
-        indentUnit: 2,
-        indentWithTabs: true,
-        theme: "mdn-like"
-      });
-    </script>
-
-    <p>Mode for HTML with embedded Django template markup.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-django</code></p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/django/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/django/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/django/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/dockerfile.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/dockerfile.js.js
index 4419009afa8f71ec1888178ded82accc1211a917..769e787e4a869b56b649656815137db0452cd5e3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/dockerfile.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/dockerfile.js.js
@@ -11,30 +11,64 @@
 })(function(CodeMirror) {
   "use strict";
 
+  var from = "from";
+  var fromRegex = new RegExp("^(\\s*)\\b(" + from + ")\\b", "i");
+
+  var shells = ["run", "cmd", "entrypoint", "shell"];
+  var shellsAsArrayRegex = new RegExp("^(\\s*)(" + shells.join('|') + ")(\\s+\\[)", "i");
+
+  var expose = "expose";
+  var exposeRegex = new RegExp("^(\\s*)(" + expose + ")(\\s+)", "i");
+
+  var others = [
+    "arg", "from", "maintainer", "label", "env",
+    "add", "copy", "volume", "user",
+    "workdir", "onbuild", "stopsignal", "healthcheck", "shell"
+  ];
+
   // Collect all Dockerfile directives
-  var instructions = ["from", "maintainer", "run", "cmd", "expose", "env",
-                      "add", "copy", "entrypoint", "volume", "user",
-                      "workdir", "onbuild"],
+  var instructions = [from, expose].concat(shells).concat(others),
       instructionRegex = "(" + instructions.join('|') + ")",
-      instructionOnlyLine = new RegExp(instructionRegex + "\\s*$", "i"),
-      instructionWithArguments = new RegExp(instructionRegex + "(\\s+)", "i");
+      instructionOnlyLine = new RegExp("^(\\s*)" + instructionRegex + "(\\s*)(#.*)?$", "i"),
+      instructionWithArguments = new RegExp("^(\\s*)" + instructionRegex + "(\\s+)", "i");
 
   CodeMirror.defineSimpleMode("dockerfile", {
     start: [
       // Block comment: This is a line starting with a comment
       {
-        regex: /#.*$/,
+        regex: /^\s*#.*$/,
+        sol: true,
         token: "comment"
       },
+      {
+        regex: fromRegex,
+        token: [null, "keyword"],
+        sol: true,
+        next: "from"
+      },
       // Highlight an instruction without any arguments (for convenience)
       {
         regex: instructionOnlyLine,
-        token: "variable-2"
+        token: [null, "keyword", null, "error"],
+        sol: true
+      },
+      {
+        regex: shellsAsArrayRegex,
+        token: [null, "keyword", null],
+        sol: true,
+        next: "array"
+      },
+      {
+        regex: exposeRegex,
+        token: [null, "keyword", null],
+        sol: true,
+        next: "expose"
       },
       // Highlight an instruction followed by arguments
       {
         regex: instructionWithArguments,
-        token: ["variable-2", null],
+        token: [null, "keyword", null],
+        sol: true,
         next: "arguments"
       },
       {
@@ -42,37 +76,135 @@
         token: null
       }
     ],
-    arguments: [
+    from: [
+      {
+        regex: /\s*$/,
+        token: null,
+        next: "start"
+      },
       {
         // Line comment without instruction arguments is an error
-        regex: /#.*$/,
-        token: "error",
+        regex: /(\s*)(#.*)$/,
+        token: [null, "error"],
         next: "start"
       },
       {
-        regex: /[^#]+\\$/,
-        token: null
+        regex: /(\s*\S+\s+)(as)/i,
+        token: [null, "keyword"],
+        next: "start"
       },
+      // Fail safe return to start
       {
-        // Match everything except for the inline comment
-        regex: /[^#]+/,
         token: null,
         next: "start"
+      }
+    ],
+    single: [
+      {
+        regex: /(?:[^\\']|\\.)/,
+        token: "string"
       },
       {
-        regex: /$/,
+        regex: /'/,
+        token: "string",
+        pop: true
+      }
+    ],
+    double: [
+      {
+        regex: /(?:[^\\"]|\\.)/,
+        token: "string"
+      },
+      {
+        regex: /"/,
+        token: "string",
+        pop: true
+      }
+    ],
+    array: [
+      {
+        regex: /\]/,
         token: null,
         next: "start"
       },
+      {
+        regex: /"(?:[^\\"]|\\.)*"?/,
+        token: "string"
+      }
+    ],
+    expose: [
+      {
+        regex: /\d+$/,
+        token: "number",
+        next: "start"
+      },
+      {
+        regex: /[^\d]+$/,
+        token: null,
+        next: "start"
+      },
+      {
+        regex: /\d+/,
+        token: "number"
+      },
+      {
+        regex: /[^\d]+/,
+        token: null
+      },
       // Fail safe return to start
       {
         token: null,
         next: "start"
       }
     ],
-      meta: {
-          lineComment: "#"
+    arguments: [
+      {
+        regex: /^\s*#.*$/,
+        sol: true,
+        token: "comment"
+      },
+      {
+        regex: /"(?:[^\\"]|\\.)*"?$/,
+        token: "string",
+        next: "start"
+      },
+      {
+        regex: /"/,
+        token: "string",
+        push: "double"
+      },
+      {
+        regex: /'(?:[^\\']|\\.)*'?$/,
+        token: "string",
+        next: "start"
+      },
+      {
+        regex: /'/,
+        token: "string",
+        push: "single"
+      },
+      {
+        regex: /[^#"']+[\\`]$/,
+        token: null
+      },
+      {
+        regex: /[^#"']+$/,
+        token: null,
+        next: "start"
+      },
+      {
+        regex: /[^#"']+/,
+        token: null
+      },
+      // Fail safe return to start
+      {
+        token: null,
+        next: "start"
       }
+    ],
+    meta: {
+      lineComment: "#"
+    }
   });
 
   CodeMirror.defineMIME("text/x-dockerfile", "dockerfile");
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/index.html.html
deleted file mode 100644
index a31759bce15f3eb54aaafc0fde28f327a86d00bf..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/index.html.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Dockerfile mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/simple.js"></script>
-<script src="dockerfile.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Dockerfile</a>
-  </ul>
-</div>
-
-<article>
-<h2>Dockerfile mode</h2>
-<form><textarea id="code" name="code"># Install Ghost blogging platform and run development environment
-#
-# VERSION 1.0.0
-
-FROM ubuntu:12.10
-MAINTAINER Amer Grgic "amer@livebyt.es"
-WORKDIR /data/ghost
-
-# Install dependencies for nginx installation
-RUN apt-get update
-RUN apt-get install -y python g++ make software-properties-common --force-yes
-RUN add-apt-repository ppa:chris-lea/node.js
-RUN apt-get update
-# Install unzip
-RUN apt-get install -y unzip
-# Install curl
-RUN apt-get install -y curl
-# Install nodejs & npm
-RUN apt-get install -y rlwrap
-RUN apt-get install -y nodejs 
-# Download Ghost v0.4.1
-RUN curl -L https://ghost.org/zip/ghost-latest.zip -o /tmp/ghost.zip
-# Unzip Ghost zip to /data/ghost
-RUN unzip -uo /tmp/ghost.zip -d /data/ghost
-# Add custom config js to /data/ghost
-ADD ./config.example.js /data/ghost/config.js
-# Install Ghost with NPM
-RUN cd /data/ghost/ && npm install --production
-# Expose port 2368
-EXPOSE 2368
-# Run Ghost
-CMD ["npm","start"]
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "dockerfile"
-      });
-    </script>
-
-    <p>Dockerfile syntax highlighting for CodeMirror. Depends on
-    the <a href="../../demo/simplemode.html">simplemode</a> addon.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-dockerfile</code></p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/test.js.js
new file mode 100644
index 0000000000000000000000000000000000000000..9a2b89ad213bd45cfa797448b5abd99b36acec2c
--- /dev/null
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/test.js.js
@@ -0,0 +1,128 @@
+// CodeMirror, copyright (c) by Marijn Haverbeke and others
+// Distributed under an MIT license: http://codemirror.net/LICENSE
+
+(function() {
+  var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-dockerfile");
+  function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
+
+  MT("simple_nodejs_dockerfile",
+     "[keyword FROM] node:carbon",
+     "[comment # Create app directory]",
+     "[keyword WORKDIR] /usr/src/app",
+     "[comment # Install app dependencies]",
+     "[comment # A wildcard is used to ensure both package.json AND package-lock.json are copied]",
+     "[comment # where available (npm@5+)]",
+     "[keyword COPY] package*.json ./",
+     "[keyword RUN] npm install",
+     "[keyword COPY] . .",
+     "[keyword EXPOSE] [number 8080] [number 3000]",
+     "[keyword ENV] NODE_ENV development",
+     "[keyword CMD] [[ [string \"npm\"], [string \"start\"] ]]");
+
+  // Ideally the last space should not be highlighted.
+  MT("instruction_without_args_1",
+     "[keyword CMD] ");
+
+  MT("instruction_without_args_2",
+     "[comment # An instruction without args...]",
+     "[keyword ARG] [error #...is an error]");
+
+  MT("multiline",
+     "[keyword RUN] apt-get update && apt-get install -y \\",
+     "  mercurial \\",
+     "  subversion \\",
+     "  && apt-get clean \\",
+     "  && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*");
+
+  MT("from_comment",
+     "  [keyword FROM] debian:stretch # I tend to use stable as that is more stable",
+     "  [keyword FROM] debian:stretch [keyword AS] stable # I am even more stable",
+     " [keyword FROM] [error # this is an error]");
+
+  MT("from_as",
+     "[keyword FROM] golang:1.9.2-alpine3.6 [keyword AS] build",
+     "[keyword COPY] --from=build /bin/project /bin/project",
+     "[keyword ENTRYPOINT] [[ [string \"/bin/project\"] ]]",
+     "[keyword CMD] [[ [string \"--help\"] ]]");
+
+  MT("arg",
+     "[keyword ARG] VERSION=latest",
+     "[keyword FROM] busybox:$VERSION",
+     "[keyword ARG] VERSION",
+     "[keyword RUN] echo $VERSION > image_version");
+
+  MT("label",
+     "[keyword LABEL] com.example.label-with-value=[string \"foo\"]");
+
+  MT("label_multiline",
+     "[keyword LABEL] description=[string \"This text illustrates ]\\",
+     "[string that label-values can span multiple lines.\"]");
+
+  MT("maintainer",
+     "[keyword MAINTAINER] Foo Bar [string \"foo@bar.com\"] ",
+     "[keyword MAINTAINER] Bar Baz <bar@baz.com>");
+
+  MT("env",
+     "[keyword ENV] BUNDLE_PATH=[string \"$GEM_HOME\"] \\",
+     "  BUNDLE_APP_CONFIG=[string \"$GEM_HOME\"]");
+
+  MT("verify_keyword",
+     "[keyword RUN] add-apt-repository ppa:chris-lea/node.js");
+
+  MT("scripts",
+     "[comment # Set an entrypoint, to automatically install node modules]",
+     "[keyword ENTRYPOINT] [[ [string \"/bin/bash\"], [string \"-c\"], [string \"if [[ ! -d node_modules ]]; then npm install; fi; exec \\\"${@:0}\\\";\"] ]]",
+     "[keyword CMD] npm start",
+     "[keyword RUN] npm run build && \\",
+     "[comment # a comment between the shell commands]",
+     "  npm run test");
+
+  MT("strings_single",
+     "[keyword FROM] buildpack-deps:stretch",
+     "[keyword RUN] { \\",
+     "        echo [string 'install: --no-document']; \\",
+     "        echo [string 'update: --no-document']; \\",
+     "    } >> /usr/local/etc/gemrc");
+
+  MT("strings_single_multiline",
+     "[keyword RUN] set -ex \\",
+     "    \\",
+     "    && buildDeps=[string ' ]\\",
+     "[string        bison ]\\",
+     "[string        dpkg-dev ]\\",
+     "[string        libgdbm-dev ]\\",
+     "[string        ruby ]\\",
+     "[string    '] \\",
+     "    && apt-get update");
+
+  MT("strings_single_multiline_2",
+     "[keyword RUN] echo [string 'say \\' ]\\",
+     "[string   it works'] ");
+
+  MT("strings_double",
+     "[keyword RUN] apt-get install -y --no-install-recommends $buildDeps \\",
+     " \\",
+     " && wget -O ruby.tar.xz [string \"https://cache.ruby-lang.org/pub/ruby/${RUBY_MAJOR%-rc}/ruby-$RUBY_VERSION.tar.xz\"] \\",
+     " && echo [string \"$RUBY_DOWNLOAD_SHA256 *ruby.tar.xz\"] | sha256sum -c - ");
+
+  MT("strings_double_multiline",
+     "[keyword RUN] echo [string \"say \\\" ]\\",
+     "[string   it works\"] ");
+
+  MT("escape",
+     "[comment # escape=`]",
+     "[keyword FROM] microsoft/windowsservercore",
+     "[keyword RUN] powershell.exe -Command `",
+     "    $ErrorActionPreference = [string 'Stop']; `",
+     "    wget https://www.python.org/ftp/python/3.5.1/python-3.5.1.exe -OutFile c:\python-3.5.1.exe ; `",
+     "    Start-Process c:\python-3.5.1.exe -ArgumentList [string '/quiet InstallAllUsers=1 PrependPath=1'] -Wait ; `",
+     "    Remove-Item c:\python-3.5.1.exe -Force)");
+
+  MT("escape_strings",
+     "[comment # escape=`]",
+     "[keyword FROM] python:3.6-windowsservercore [keyword AS] python",
+     "[keyword RUN] $env:PATH = [string 'C:\\Python;C:\\Python\\Scripts;{0}'] -f $env:PATH ; `",
+     // It should not consider \' as escaped.
+     // "  Set-ItemProperty -Path [string 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\'] -Name Path -Value $env:PATH ;");
+     "  Set-ItemProperty -Path [string 'HKLM:\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\' -Name Path -Value $env:PATH ;]");
+})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/run.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/test.js.xml
similarity index 94%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/run.js.xml
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/test.js.xml
index c0e503613083dd3129631485789fe31a43aeecd1..22a701d7cb4b626ee0928c007d6e7f4efa714679 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/run.js.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dockerfile/test.js.xml
@@ -12,7 +12,7 @@
         </item>
         <item>
             <key> <string>__name__</string> </key>
-            <value> <string>run.js</string> </value>
+            <value> <string>test.js</string> </value>
         </item>
         <item>
             <key> <string>content_type</string> </key>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dtd/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dtd/index.html.html
deleted file mode 100644
index e6798a748add00351be1ca564d8f9df0bdd8fe83..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dtd/index.html.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: DTD mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="dtd.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">DTD</a>
-  </ul>
-</div>
-
-<article>
-<h2>DTD mode</h2>
-<form><textarea id="code" name="code"><?xml version="1.0" encoding="UTF-8"?>
-
-<!ATTLIST title
-  xmlns	CDATA	#FIXED	"http://docbook.org/ns/docbook"
-  role	CDATA	#IMPLIED
-  %db.common.attributes;
-  %db.common.linking.attributes;
->
-
-<!--
-  Try: http://docbook.org/xml/5.0/dtd/docbook.dtd
--->
-
-<!DOCTYPE xsl:stylesheet
-  [
-    <!ENTITY nbsp   "&amp;#160;">
-    <!ENTITY copy   "&amp;#169;">
-    <!ENTITY reg    "&amp;#174;">
-    <!ENTITY trade  "&amp;#8482;">
-    <!ENTITY mdash  "&amp;#8212;">
-    <!ENTITY ldquo  "&amp;#8220;">
-    <!ENTITY rdquo  "&amp;#8221;">
-    <!ENTITY pound  "&amp;#163;">
-    <!ENTITY yen    "&amp;#165;">
-    <!ENTITY euro   "&amp;#8364;">
-    <!ENTITY mathml "http://www.w3.org/1998/Math/MathML">
-  ]
->
-
-<!ELEMENT title (#PCDATA|inlinemediaobject|remark|superscript|subscript|xref|link|olink|anchor|biblioref|alt|annotation|indexterm|abbrev|acronym|date|emphasis|footnote|footnoteref|foreignphrase|phrase|quote|wordasword|firstterm|glossterm|coref|trademark|productnumber|productname|database|application|hardware|citation|citerefentry|citetitle|citebiblioid|author|person|personname|org|orgname|editor|jobtitle|replaceable|package|parameter|termdef|nonterminal|systemitem|option|optional|property|inlineequation|tag|markup|token|symbol|literal|code|constant|email|uri|guiicon|guibutton|guimenuitem|guimenu|guisubmenu|guilabel|menuchoice|mousebutton|keycombo|keycap|keycode|keysym|shortcut|accel|prompt|envar|filename|command|computeroutput|userinput|function|varname|returnvalue|type|classname|exceptionname|interfacename|methodname|modifier|initializer|ooclass|ooexception|oointerface|errorcode|errortext|errorname|errortype)*>
-
-<!ENTITY % db.common.attributes "
-  xml:id	ID	#IMPLIED
-  version	CDATA	#IMPLIED
-  xml:lang	CDATA	#IMPLIED
-  xml:base	CDATA	#IMPLIED
-  remap	CDATA	#IMPLIED
-  xreflabel	CDATA	#IMPLIED
-  revisionflag	(changed|added|deleted|off)	#IMPLIED
-  dir	(ltr|rtl|lro|rlo)	#IMPLIED
-  arch	CDATA	#IMPLIED
-  audience	CDATA	#IMPLIED
-  condition	CDATA	#IMPLIED
-  conformance	CDATA	#IMPLIED
-  os	CDATA	#IMPLIED
-  revision	CDATA	#IMPLIED
-  security	CDATA	#IMPLIED
-  userlevel	CDATA	#IMPLIED
-  vendor	CDATA	#IMPLIED
-  wordsize	CDATA	#IMPLIED
-  annotations	CDATA	#IMPLIED
-
-"></textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "dtd", alignCDATA: true},
-        lineNumbers: true,
-        lineWrapping: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>application/xml-dtd</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dtd/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dtd/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dtd/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dylan/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dylan/index.html.html
deleted file mode 100644
index ddf5ad067dfdc9e760e09cadcaa15f90ec57d929..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dylan/index.html.html
+++ /dev/null
@@ -1,407 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Dylan mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="../../addon/comment/continuecomment.js"></script>
-<script src="../../addon/comment/comment.js"></script>
-<script src="dylan.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Dylan</a>
-  </ul>
-</div>
-
-<article>
-<h2>Dylan mode</h2>
-
-
-<div><textarea id="code" name="code">
-Module:       locators-internals
-Synopsis:     Abstract modeling of locations
-Author:       Andy Armstrong
-Copyright:    Original Code is Copyright (c) 1995-2004 Functional Objects, Inc.
-              All rights reserved.
-License:      See License.txt in this distribution for details.
-Warranty:     Distributed WITHOUT WARRANTY OF ANY KIND
-
-define open generic locator-server
-    (locator :: <locator>) => (server :: false-or(<server-locator>));
-define open generic locator-host
-    (locator :: <locator>) => (host :: false-or(<string>));
-define open generic locator-volume
-    (locator :: <locator>) => (volume :: false-or(<string>));
-define open generic locator-directory
-    (locator :: <locator>) => (directory :: false-or(<directory-locator>));
-define open generic locator-relative?
-    (locator :: <locator>) => (relative? :: <boolean>);
-define open generic locator-path
-    (locator :: <locator>) => (path :: <sequence>);
-define open generic locator-base
-    (locator :: <locator>) => (base :: false-or(<string>));
-define open generic locator-extension
-    (locator :: <locator>) => (extension :: false-or(<string>));
-
-/// Locator classes
-
-define open abstract class <directory-locator> (<physical-locator>)
-end class <directory-locator>;
-
-define open abstract class <file-locator> (<physical-locator>)
-end class <file-locator>;
-
-define method as
-    (class == <directory-locator>, string :: <string>)
- => (locator :: <directory-locator>)
-  as(<native-directory-locator>, string)
-end method as;
-
-define method make
-    (class == <directory-locator>,
-     #key server :: false-or(<server-locator>) = #f,
-          path :: <sequence> = #[],
-          relative? :: <boolean> = #f,
-          name :: false-or(<string>) = #f)
- => (locator :: <directory-locator>)
-  make(<native-directory-locator>,
-       server:    server,
-       path:      path,
-       relative?: relative?,
-       name:      name)
-end method make;
-
-define method as
-    (class == <file-locator>, string :: <string>)
- => (locator :: <file-locator>)
-  as(<native-file-locator>, string)
-end method as;
-
-define method make
-    (class == <file-locator>,
-     #key directory :: false-or(<directory-locator>) = #f,
-          base :: false-or(<string>) = #f,
-          extension :: false-or(<string>) = #f,
-          name :: false-or(<string>) = #f)
- => (locator :: <file-locator>)
-  make(<native-file-locator>,
-       directory: directory,
-       base:      base,
-       extension: extension,
-       name:      name)
-end method make;
-
-/// Locator coercion
-
-//---*** andrewa: This caching scheme doesn't work yet, so disable it.
-define constant $cache-locators?        = #f;
-define constant $cache-locator-strings? = #f;
-
-define constant $locator-to-string-cache = make(<object-table>, weak: #"key");
-define constant $string-to-locator-cache = make(<string-table>, weak: #"value");
-
-define open generic locator-as-string
-    (class :: subclass(<string>), locator :: <locator>)
- => (string :: <string>);
-
-define open generic string-as-locator
-    (class :: subclass(<locator>), string :: <string>)
- => (locator :: <locator>);
-
-define sealed sideways method as
-    (class :: subclass(<string>), locator :: <locator>)
- => (string :: <string>)
-  let string = element($locator-to-string-cache, locator, default: #f);
-  if (string)
-    as(class, string)
-  else
-    let string = locator-as-string(class, locator);
-    if ($cache-locator-strings?)
-      element($locator-to-string-cache, locator) := string;
-    else
-      string
-    end
-  end
-end method as;
-
-define sealed sideways method as
-    (class :: subclass(<locator>), string :: <string>)
- => (locator :: <locator>)
-  let locator = element($string-to-locator-cache, string, default: #f);
-  if (instance?(locator, class))
-    locator
-  else
-    let locator = string-as-locator(class, string);
-    if ($cache-locators?)
-      element($string-to-locator-cache, string) := locator;
-    else
-      locator
-    end
-  end
-end method as;
-
-/// Locator conditions
-
-define class <locator-error> (<format-string-condition>, <error>)
-end class <locator-error>;
-
-define function locator-error
-    (format-string :: <string>, #rest format-arguments)
-  error(make(<locator-error>, 
-             format-string:    format-string,
-             format-arguments: format-arguments))
-end function locator-error;
-
-/// Useful locator protocols
-
-define open generic locator-test
-    (locator :: <directory-locator>) => (test :: <function>);
-
-define method locator-test
-    (locator :: <directory-locator>) => (test :: <function>)
-  \=
-end method locator-test;
-
-define open generic locator-might-have-links?
-    (locator :: <directory-locator>) => (links? :: <boolean>);
-
-define method locator-might-have-links?
-    (locator :: <directory-locator>) => (links? :: singleton(#f))
-  #f
-end method locator-might-have-links?;
-
-define method locator-relative?
-    (locator :: <file-locator>) => (relative? :: <boolean>)
-  let directory = locator.locator-directory;
-  ~directory | directory.locator-relative?
-end method locator-relative?;
-
-define method current-directory-locator?
-    (locator :: <directory-locator>) => (current-directory? :: <boolean>)
-  locator.locator-relative?
-    & locator.locator-path = #[#"self"]
-end method current-directory-locator?;
-
-define method locator-directory
-    (locator :: <directory-locator>) => (parent :: false-or(<directory-locator>))
-  let path = locator.locator-path;
-  unless (empty?(path))
-    make(object-class(locator),
-         server:    locator.locator-server,
-         path:      copy-sequence(path, end: path.size - 1),
-         relative?: locator.locator-relative?)
-  end
-end method locator-directory;
-
-/// Simplify locator
-
-define open generic simplify-locator
-    (locator :: <physical-locator>)
- => (simplified-locator :: <physical-locator>);
-
-define method simplify-locator
-    (locator :: <directory-locator>)
- => (simplified-locator :: <directory-locator>)
-  let path = locator.locator-path;
-  let relative? = locator.locator-relative?;
-  let resolve-parent? = ~locator.locator-might-have-links?;
-  let simplified-path
-    = simplify-path(path, 
-                    resolve-parent?: resolve-parent?,
-                    relative?: relative?);
-  if (path ~= simplified-path)
-    make(object-class(locator),
-         server:    locator.locator-server,
-         path:      simplified-path,
-         relative?: locator.locator-relative?)
-  else
-    locator
-  end
-end method simplify-locator;
-
-define method simplify-locator
-    (locator :: <file-locator>) => (simplified-locator :: <file-locator>)
-  let directory = locator.locator-directory;
-  let simplified-directory = directory & simplify-locator(directory);
-  if (directory ~= simplified-directory)
-    make(object-class(locator),
-         directory: simplified-directory,
-         base:      locator.locator-base,
-         extension: locator.locator-extension)
-  else
-    locator
-  end
-end method simplify-locator;
-
-/// Subdirectory locator
-
-define open generic subdirectory-locator
-    (locator :: <directory-locator>, #rest sub-path)
- => (subdirectory :: <directory-locator>);
-
-define method subdirectory-locator
-    (locator :: <directory-locator>, #rest sub-path)
- => (subdirectory :: <directory-locator>)
-  let old-path = locator.locator-path;
-  let new-path = concatenate-as(<simple-object-vector>, old-path, sub-path);
-  make(object-class(locator),
-       server:    locator.locator-server,
-       path:      new-path,
-       relative?: locator.locator-relative?)
-end method subdirectory-locator;
-
-/// Relative locator
-
-define open generic relative-locator
-    (locator :: <physical-locator>, from-locator :: <physical-locator>)
- => (relative-locator :: <physical-locator>);
-
-define method relative-locator
-    (locator :: <directory-locator>, from-locator :: <directory-locator>)
- => (relative-locator :: <directory-locator>)
-  let path = locator.locator-path;
-  let from-path = from-locator.locator-path;
-  case
-    ~locator.locator-relative? & from-locator.locator-relative? =>
-      locator-error
-        ("Cannot find relative path of absolute locator %= from relative locator %=",
-         locator, from-locator);
-    locator.locator-server ~= from-locator.locator-server =>
-      locator;
-    path = from-path =>
-      make(object-class(locator),
-           path: vector(#"self"),
-           relative?: #t);
-    otherwise =>
-      make(object-class(locator),
-           path: relative-path(path, from-path, test: locator.locator-test),
-           relative?: #t);
-  end
-end method relative-locator;
-
-define method relative-locator
-    (locator :: <file-locator>, from-directory :: <directory-locator>)
- => (relative-locator :: <file-locator>)
-  let directory = locator.locator-directory;
-  let relative-directory = directory & relative-locator(directory, from-directory);
-  if (relative-directory ~= directory)
-    simplify-locator
-      (make(object-class(locator),
-            directory: relative-directory,
-            base:      locator.locator-base,
-            extension: locator.locator-extension))
-  else
-    locator
-  end
-end method relative-locator;
-
-define method relative-locator
-    (locator :: <physical-locator>, from-locator :: <file-locator>)
- => (relative-locator :: <physical-locator>)
-  let from-directory = from-locator.locator-directory;
-  case
-    from-directory =>
-      relative-locator(locator, from-directory);
-    ~locator.locator-relative? =>
-      locator-error
-        ("Cannot find relative path of absolute locator %= from relative locator %=",
-         locator, from-locator);
-    otherwise =>
-      locator;
-  end
-end method relative-locator;
-
-/// Merge locators
-
-define open generic merge-locators
-    (locator :: <physical-locator>, from-locator :: <physical-locator>)
- => (merged-locator :: <physical-locator>);
-
-/// Merge locators
-
-define method merge-locators
-    (locator :: <directory-locator>, from-locator :: <directory-locator>)
- => (merged-locator :: <directory-locator>)
-  if (locator.locator-relative?)
-    let path = concatenate(from-locator.locator-path, locator.locator-path);
-    simplify-locator
-      (make(object-class(locator),
-            server:    from-locator.locator-server,
-            path:      path,
-            relative?: from-locator.locator-relative?))
-  else
-    locator
-  end
-end method merge-locators;
-
-define method merge-locators
-    (locator :: <file-locator>, from-locator :: <directory-locator>)
- => (merged-locator :: <file-locator>)
-  let directory = locator.locator-directory;
-  let merged-directory 
-    = if (directory)
-        merge-locators(directory, from-locator)
-      else
-        simplify-locator(from-locator)
-      end;
-  if (merged-directory ~= directory)
-    make(object-class(locator),
-         directory: merged-directory,
-         base:      locator.locator-base,
-         extension: locator.locator-extension)
-  else
-    locator
-  end
-end method merge-locators;
-
-define method merge-locators
-    (locator :: <physical-locator>, from-locator :: <file-locator>)
- => (merged-locator :: <physical-locator>)
-  let from-directory = from-locator.locator-directory;
-  if (from-directory)
-    merge-locators(locator, from-directory)
-  else
-    locator
-  end
-end method merge-locators;
-
-/// Locator protocols
-
-define sideways method supports-open-locator?
-    (locator :: <file-locator>) => (openable? :: <boolean>)
-  ~locator.locator-relative?
-end method supports-open-locator?;
-
-define sideways method open-locator
-    (locator :: <file-locator>, #rest keywords, #key, #all-keys)
- => (stream :: <stream>)
-  apply(open-file-stream, locator, keywords)
-end method open-locator;
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "text/x-dylan",
-        lineNumbers: true,
-        matchBrackets: true,
-        continueComments: "Enter",
-        extraKeys: {"Ctrl-Q": "toggleComment"},
-        tabMode: "indent",
-        indentUnit: 2
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-dylan</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dylan/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dylan/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/dylan/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ebnf/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ebnf/index.html.html
deleted file mode 100644
index 13845629b339ce00de191a37cc5518c3dee5e4d5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ebnf/index.html.html
+++ /dev/null
@@ -1,102 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <title>CodeMirror: EBNF Mode</title>
-    <meta charset="utf-8"/>
-    <link rel=stylesheet href="../../doc/docs.css">
-
-    <link rel="stylesheet" href="../../lib/codemirror.css">
-    <script src="../../lib/codemirror.js"></script>
-    <script src="../javascript/javascript.js"></script>
-    <script src="ebnf.js"></script>
-    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-  </head>
-  <body>
-    <div id=nav>
-      <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-      <ul>
-        <li><a href="../../index.html">Home</a>
-        <li><a href="../../doc/manual.html">Manual</a>
-        <li><a href="https://github.com/codemirror/codemirror">Code</a>
-      </ul>
-      <ul>
-        <li><a href="../index.html">Language modes</a>
-        <li><a class=active href="#">EBNF Mode</a>
-      </ul>
-    </div>
-
-    <article>
-      <h2>EBNF Mode (bracesMode setting = "javascript")</h2>
-      <form><textarea id="code" name="code">
-/* description: Parses end executes mathematical expressions. */
-
-/* lexical grammar */
-%lex
-
-%%
-\s+                   /* skip whitespace */
-[0-9]+("."[0-9]+)?\b  return 'NUMBER';
-"*"                   return '*';
-"/"                   return '/';
-"-"                   return '-';
-"+"                   return '+';
-"^"                   return '^';
-"("                   return '(';
-")"                   return ')';
-"PI"                  return 'PI';
-"E"                   return 'E';
-&lt;&lt;EOF&gt;&gt;               return 'EOF';
-
-/lex
-
-/* operator associations and precedence */
-
-%left '+' '-'
-%left '*' '/'
-%left '^'
-%left UMINUS
-
-%start expressions
-
-%% /* language grammar */
-
-expressions
-: e EOF
-{print($1); return $1;}
-;
-
-e
-: e '+' e
-{$$ = $1+$3;}
-| e '-' e
-{$$ = $1-$3;}
-| e '*' e
-{$$ = $1*$3;}
-| e '/' e
-{$$ = $1/$3;}
-| e '^' e
-{$$ = Math.pow($1, $3);}
-| '-' e %prec UMINUS
-{$$ = -$2;}
-| '(' e ')'
-{$$ = $2;}
-| NUMBER
-{$$ = Number(yytext);}
-| E
-{$$ = Math.E;}
-| PI
-{$$ = Math.PI;}
-;</textarea></form>
-      <script>
-        var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-          mode: {name: "ebnf"},
-          lineNumbers: true,
-          bracesMode: 'javascript'
-        });
-      </script>
-      <h3>The EBNF Mode</h3>
-      <p> Created by <a href="https://github.com/robertleeplummerjr">Robert Plummer</a></p>
-    </article>
-  </body>
-</html>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ebnf/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ebnf/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ebnf/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ecl/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ecl/index.html.html
deleted file mode 100644
index 2306860dcbdb2bd48dc9bdd2657a912a255de179..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ecl/index.html.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: ECL mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="ecl.js"></script>
-<style>.CodeMirror {border: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">ECL</a>
-  </ul>
-</div>
-
-<article>
-<h2>ECL mode</h2>
-<form><textarea id="code" name="code">
-/*
-sample useless code to demonstrate ecl syntax highlighting
-this is a multiline comment!
-*/
-
-//  this is a singleline comment!
-
-import ut;
-r := 
-  record
-   string22 s1 := '123';
-   integer4 i1 := 123;
-  end;
-#option('tmp', true);
-d := dataset('tmp::qb', r, thor);
-output(d);
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p>Based on CodeMirror's clike mode.  For more information see <a href="http://hpccsystems.com">HPCC Systems</a> web site.</p>
-    <p><strong>MIME types defined:</strong> <code>text/x-ecl</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ecl/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ecl/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ecl/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/eiffel/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/eiffel/index.html.html
deleted file mode 100644
index 108a71bec8e997dd90bac3e2158df670e5b4d7b4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/eiffel/index.html.html
+++ /dev/null
@@ -1,429 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Eiffel mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/neat.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="eiffel.js"></script>
-<style>
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .cm-s-default span.cm-arrow { color: red; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Eiffel</a>
-  </ul>
-</div>
-
-<article>
-<h2>Eiffel mode</h2>
-<form><textarea id="code" name="code">
-note
-    description: "[
-        Project-wide universal properties.
-        This class is an ancestor to all developer-written classes.
-        ANY may be customized for individual projects or teams.
-        ]"
-
-    library: "Free implementation of ELKS library"
-    status: "See notice at end of class."
-    legal: "See notice at end of class."
-    date: "$Date: 2013-01-25 11:49:00 -0800 (Fri, 25 Jan 2013) $"
-    revision: "$Revision: 712 $"
-
-class
-    ANY
-
-feature -- Customization
-
-feature -- Access
-
-    generator: STRING
-            -- Name of current object's generating class
-            -- (base class of the type of which it is a direct instance)
-        external
-            "built_in"
-        ensure
-            generator_not_void: Result /= Void
-            generator_not_empty: not Result.is_empty
-        end
-
-    generating_type: TYPE [detachable like Current]
-            -- Type of current object
-            -- (type of which it is a direct instance)
-        do
-            Result := {detachable like Current}
-        ensure
-            generating_type_not_void: Result /= Void
-        end
-
-feature -- Status report
-
-    conforms_to (other: ANY): BOOLEAN
-            -- Does type of current object conform to type
-            -- of `other' (as per Eiffel: The Language, chapter 13)?
-        require
-            other_not_void: other /= Void
-        external
-            "built_in"
-        end
-
-    same_type (other: ANY): BOOLEAN
-            -- Is type of current object identical to type of `other'?
-        require
-            other_not_void: other /= Void
-        external
-            "built_in"
-        ensure
-            definition: Result = (conforms_to (other) and
-                                        other.conforms_to (Current))
-        end
-
-feature -- Comparison
-
-    is_equal (other: like Current): BOOLEAN
-            -- Is `other' attached to an object considered
-            -- equal to current object?
-        require
-            other_not_void: other /= Void
-        external
-            "built_in"
-        ensure
-            symmetric: Result implies other ~ Current
-            consistent: standard_is_equal (other) implies Result
-        end
-
-    frozen standard_is_equal (other: like Current): BOOLEAN
-            -- Is `other' attached to an object of the same type
-            -- as current object, and field-by-field identical to it?
-        require
-            other_not_void: other /= Void
-        external
-            "built_in"
-        ensure
-            same_type: Result implies same_type (other)
-            symmetric: Result implies other.standard_is_equal (Current)
-        end
-
-    frozen equal (a: detachable ANY; b: like a): BOOLEAN
-            -- Are `a' and `b' either both void or attached
-            -- to objects considered equal?
-        do
-            if a = Void then
-                Result := b = Void
-            else
-                Result := b /= Void and then
-                            a.is_equal (b)
-            end
-        ensure
-            definition: Result = (a = Void and b = Void) or else
-                        ((a /= Void and b /= Void) and then
-                        a.is_equal (b))
-        end
-
-    frozen standard_equal (a: detachable ANY; b: like a): BOOLEAN
-            -- Are `a' and `b' either both void or attached to
-            -- field-by-field identical objects of the same type?
-            -- Always uses default object comparison criterion.
-        do
-            if a = Void then
-                Result := b = Void
-            else
-                Result := b /= Void and then
-                            a.standard_is_equal (b)
-            end
-        ensure
-            definition: Result = (a = Void and b = Void) or else
-                        ((a /= Void and b /= Void) and then
-                        a.standard_is_equal (b))
-        end
-
-    frozen is_deep_equal (other: like Current): BOOLEAN
-            -- Are `Current' and `other' attached to isomorphic object structures?
-        require
-            other_not_void: other /= Void
-        external
-            "built_in"
-        ensure
-            shallow_implies_deep: standard_is_equal (other) implies Result
-            same_type: Result implies same_type (other)
-            symmetric: Result implies other.is_deep_equal (Current)
-        end
-
-    frozen deep_equal (a: detachable ANY; b: like a): BOOLEAN
-            -- Are `a' and `b' either both void
-            -- or attached to isomorphic object structures?
-        do
-            if a = Void then
-                Result := b = Void
-            else
-                Result := b /= Void and then a.is_deep_equal (b)
-            end
-        ensure
-            shallow_implies_deep: standard_equal (a, b) implies Result
-            both_or_none_void: (a = Void) implies (Result = (b = Void))
-            same_type: (Result and (a /= Void)) implies (b /= Void and then a.same_type (b))
-            symmetric: Result implies deep_equal (b, a)
-        end
-
-feature -- Duplication
-
-    frozen twin: like Current
-            -- New object equal to `Current'
-            -- `twin' calls `copy'; to change copying/twinning semantics, redefine `copy'.
-        external
-            "built_in"
-        ensure
-            twin_not_void: Result /= Void
-            is_equal: Result ~ Current
-        end
-
-    copy (other: like Current)
-            -- Update current object using fields of object attached
-            -- to `other', so as to yield equal objects.
-        require
-            other_not_void: other /= Void
-            type_identity: same_type (other)
-        external
-            "built_in"
-        ensure
-            is_equal: Current ~ other
-        end
-
-    frozen standard_copy (other: like Current)
-            -- Copy every field of `other' onto corresponding field
-            -- of current object.
-        require
-            other_not_void: other /= Void
-            type_identity: same_type (other)
-        external
-            "built_in"
-        ensure
-            is_standard_equal: standard_is_equal (other)
-        end
-
-    frozen clone (other: detachable ANY): like other
-            -- Void if `other' is void; otherwise new object
-            -- equal to `other'
-            --
-            -- For non-void `other', `clone' calls `copy';
-            -- to change copying/cloning semantics, redefine `copy'.
-        obsolete
-            "Use `twin' instead."
-        do
-            if other /= Void then
-                Result := other.twin
-            end
-        ensure
-            equal: Result ~ other
-        end
-
-    frozen standard_clone (other: detachable ANY): like other
-            -- Void if `other' is void; otherwise new object
-            -- field-by-field identical to `other'.
-            -- Always uses default copying semantics.
-        obsolete
-            "Use `standard_twin' instead."
-        do
-            if other /= Void then
-                Result := other.standard_twin
-            end
-        ensure
-            equal: standard_equal (Result, other)
-        end
-
-    frozen standard_twin: like Current
-            -- New object field-by-field identical to `other'.
-            -- Always uses default copying semantics.
-        external
-            "built_in"
-        ensure
-            standard_twin_not_void: Result /= Void
-            equal: standard_equal (Result, Current)
-        end
-
-    frozen deep_twin: like Current
-            -- New object structure recursively duplicated from Current.
-        external
-            "built_in"
-        ensure
-            deep_twin_not_void: Result /= Void
-            deep_equal: deep_equal (Current, Result)
-        end
-
-    frozen deep_clone (other: detachable ANY): like other
-            -- Void if `other' is void: otherwise, new object structure
-            -- recursively duplicated from the one attached to `other'
-        obsolete
-            "Use `deep_twin' instead."
-        do
-            if other /= Void then
-                Result := other.deep_twin
-            end
-        ensure
-            deep_equal: deep_equal (other, Result)
-        end
-
-    frozen deep_copy (other: like Current)
-            -- Effect equivalent to that of:
-            --      `copy' (`other' . `deep_twin')
-        require
-            other_not_void: other /= Void
-        do
-            copy (other.deep_twin)
-        ensure
-            deep_equal: deep_equal (Current, other)
-        end
-
-feature {NONE} -- Retrieval
-
-    frozen internal_correct_mismatch
-            -- Called from runtime to perform a proper dynamic dispatch on `correct_mismatch'
-            -- from MISMATCH_CORRECTOR.
-        local
-            l_msg: STRING
-            l_exc: EXCEPTIONS
-        do
-            if attached {MISMATCH_CORRECTOR} Current as l_corrector then
-                l_corrector.correct_mismatch
-            else
-                create l_msg.make_from_string ("Mismatch: ")
-                create l_exc
-                l_msg.append (generating_type.name)
-                l_exc.raise_retrieval_exception (l_msg)
-            end
-        end
-
-feature -- Output
-
-    io: STD_FILES
-            -- Handle to standard file setup
-        once
-            create Result
-            Result.set_output_default
-        ensure
-            io_not_void: Result /= Void
-        end
-
-    out: STRING
-            -- New string containing terse printable representation
-            -- of current object
-        do
-            Result := tagged_out
-        ensure
-            out_not_void: Result /= Void
-        end
-
-    frozen tagged_out: STRING
-            -- New string containing terse printable representation
-            -- of current object
-        external
-            "built_in"
-        ensure
-            tagged_out_not_void: Result /= Void
-        end
-
-    print (o: detachable ANY)
-            -- Write terse external representation of `o'
-            -- on standard output.
-        do
-            if o /= Void then
-                io.put_string (o.out)
-            end
-        end
-
-feature -- Platform
-
-    Operating_environment: OPERATING_ENVIRONMENT
-            -- Objects available from the operating system
-        once
-            create Result
-        ensure
-            operating_environment_not_void: Result /= Void
-        end
-
-feature {NONE} -- Initialization
-
-    default_create
-            -- Process instances of classes with no creation clause.
-            -- (Default: do nothing.)
-        do
-        end
-
-feature -- Basic operations
-
-    default_rescue
-            -- Process exception for routines with no Rescue clause.
-            -- (Default: do nothing.)
-        do
-        end
-
-    frozen do_nothing
-            -- Execute a null action.
-        do
-        end
-
-    frozen default: detachable like Current
-            -- Default value of object's type
-        do
-        end
-
-    frozen default_pointer: POINTER
-            -- Default value of type `POINTER'
-            -- (Avoid the need to write `p'.`default' for
-            -- some `p' of type `POINTER'.)
-        do
-        ensure
-            -- Result = Result.default
-        end
-
-    frozen as_attached: attached like Current
-            -- Attached version of Current
-            -- (Can be used during transitional period to convert
-            -- non-void-safe classes to void-safe ones.)
-        do
-            Result := Current
-        end
-
-invariant
-    reflexive_equality: standard_is_equal (Current)
-    reflexive_conformance: conforms_to (Current)
-
-note
-    copyright: "Copyright (c) 1984-2012, Eiffel Software and others"
-    license:   "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
-    source: "[
-            Eiffel Software
-            5949 Hollister Ave., Goleta, CA 93117 USA
-            Telephone 805-685-1006, Fax 805-685-6869
-            Website http://www.eiffel.com
-            Customer support http://support.eiffel.com
-        ]"
-
-end
-
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "text/x-eiffel",
-        indentUnit: 4,
-        lineNumbers: true,
-        theme: "neat"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-eiffel</code>.</p>
- 
- <p> Created by <a href="https://github.com/ynh">YNH</a>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/eiffel/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/eiffel/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/eiffel/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/elm.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/elm.js.js
index b31e663757364f3f412dcd1efc8e13b4d2d72bd4..9fcfc883717ba6548a57b6f303a5fa1c127b1fdf 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/elm.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/elm.js.js
@@ -70,7 +70,7 @@
         if (smallRE.test(ch)) {
           var isDef = source.pos === 1;
           source.eatWhile(idRE);
-          return isDef ? "variable-3" : "variable";
+          return isDef ? "type" : "variable";
         }
 
         if (digitRE.test(ch)) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/index.html.html
deleted file mode 100644
index d5cb16abfbd4ab1edb48af3773c026e9a711442c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/index.html.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Elm mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="elm.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Elm</a>
-  </ul>
-</div>
-
-<article>
-<h2>Elm mode</h2>
-
-<div><textarea id="code" name="code">
-import Color exposing (..)
-import Graphics.Collage exposing (..)
-import Graphics.Element exposing (..)
-import Time exposing (..)
-
-main =
-  Signal.map clock (every second)
-
-clock t =
-  collage 400 400
-    [ filled    lightGrey   (ngon 12 110)
-    , outlined (solid grey) (ngon 12 110)
-    , hand orange   100  t
-    , hand charcoal 100 (t/60)
-    , hand charcoal 60  (t/720)
-    ]
-
-hand clr len time =
-  let angle = degrees (90 - 6 * inSeconds time)
-  in
-      segment (0,0) (fromPolar (len,angle))
-        |> traced (solid clr)
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "text/x-elm"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-elm</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/elm/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/erlang/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/erlang/index.html.html
deleted file mode 100644
index 6d06a890a2524f0d66231c926f4838fee016e854..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/erlang/index.html.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Erlang mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/erlang-dark.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="erlang.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Erlang</a>
-  </ul>
-</div>
-
-<article>
-<h2>Erlang mode</h2>
-<form><textarea id="code" name="code">
-%% -*- mode: erlang; erlang-indent-level: 2 -*-
-%%% Created :  7 May 2012 by mats cronqvist <masse@klarna.com>
-
-%% @doc
-%% Demonstrates how to print a record.
-%% @end
-
--module('ex').
--author('mats cronqvist').
--export([demo/0,
-         rec_info/1]).
-
--record(demo,{a="One",b="Two",c="Three",d="Four"}).
-
-rec_info(demo) -> record_info(fields,demo).
-
-demo() -> expand_recs(?MODULE,#demo{a="A",b="BB"}).
-
-expand_recs(M,List) when is_list(List) ->
-  [expand_recs(M,L)||L<-List];
-expand_recs(M,Tup) when is_tuple(Tup) ->
-  case tuple_size(Tup) of
-    L when L < 1 -> Tup;
-    L ->
-      try
-        Fields = M:rec_info(element(1,Tup)),
-        L = length(Fields)+1,
-        lists:zip(Fields,expand_recs(M,tl(tuple_to_list(Tup))))
-      catch
-        _:_ -> list_to_tuple(expand_recs(M,tuple_to_list(Tup)))
-      end
-  end;
-expand_recs(_,Term) ->
-  Term.
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        extraKeys: {"Tab":  "indentAuto"},
-        theme: "erlang-dark"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-erlang</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/erlang/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/erlang/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/erlang/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/factor.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/factor.js.js
index 86d7adf627c5a372adbc4534a5f980631ac38f7b..e238c5ea64ae070e05c2f57294b4e77ef4f39bd6 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/factor.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/factor.js.js
@@ -22,52 +22,54 @@
       {regex: /#?!.*/, token: "comment"},
       // strings """, multiline --> state
       {regex: /"""/, token: "string", next: "string3"},
-      {regex: /"/, token: "string", next: "string"},
+      {regex: /(STRING:)(\s)/, token: ["keyword", null], next: "string2"},
+      {regex: /\S*?"/, token: "string", next: "string"},
       // numbers: dec, hex, unicode, bin, fractional, complex
-      {regex: /(?:[+-]?)(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\d+.?\d*)/, token: "number"},
+      {regex: /(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\-?\d+.?\d*)(?=\s)/, token: "number"},
       //{regex: /[+-]?/} //fractional
       // definition: defining word, defined word, etc
-      {regex: /(\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "keyword"], next: "stack"},
+      {regex: /((?:GENERIC)|\:?\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "bracket"], next: "stack"},
+      // method definition: defining word, type, defined word, etc
+      {regex: /(M\:)(\s+)(\S+)(\s+)(\S+)/, token: ["keyword", null, "def", null, "tag"]},
       // vocabulary using --> state
       {regex: /USING\:/, token: "keyword", next: "vocabulary"},
       // vocabulary definition/use
-      {regex: /(USE\:|IN\:)(\s+)(\S+)/, token: ["keyword", null, "variable-2"]},
-      // <constructors>
-      {regex: /<\S+>/, token: "builtin"},
+      {regex: /(USE\:|IN\:)(\s+)(\S+)(?=\s|$)/, token: ["keyword", null, "tag"]},
+      // definition: a defining word, defined word
+      {regex: /(\S+\:)(\s+)(\S+)(?=\s|$)/, token: ["keyword", null, "def"]},
       // "keywords", incl. ; t f . [ ] { } defining words
-      {regex: /;|t|f|if|\.|\[|\]|\{|\}|MAIN:/, token: "keyword"},
+      {regex: /(?:;|\\|t|f|if|loop|while|until|do|PRIVATE>|<PRIVATE|\.|\S*\[|\]|\S*\{|\})(?=\s|$)/, token: "keyword"},
+      // <constructors> and the like
+      {regex: /\S+[\)>\.\*\?]+(?=\s|$)/, token: "builtin"},
+      {regex: /[\)><]+\S+(?=\s|$)/, token: "builtin"},
+      // operators
+      {regex: /(?:[\+\-\=\/\*<>])(?=\s|$)/, token: "keyword"},
       // any id (?)
       {regex: /\S+/, token: "variable"},
-
-      {
-        regex: /./,
-        token: null
-      }
+      {regex: /\s+|./, token: null}
     ],
     vocabulary: [
       {regex: /;/, token: "keyword", next: "start"},
-      {regex: /\S+/, token: "variable-2"},
-      {
-        regex: /./,
-        token: null
-      }
+      {regex: /\S+/, token: "tag"},
+      {regex: /\s+|./, token: null}
     ],
     string: [
       {regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"},
       {regex: /.*/, token: "string"}
     ],
+    string2: [
+      {regex: /^;/, token: "keyword", next: "start"},
+      {regex: /.*/, token: "string"}
+    ],
     string3: [
       {regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"},
       {regex: /.*/, token: "string"}
     ],
     stack: [
-      {regex: /\)/, token: "meta", next: "start"},
-      {regex: /--/, token: "meta"},
-      {regex: /\S+/, token: "variable-3"},
-      {
-        regex: /./,
-        token: null
-      }
+      {regex: /\)/, token: "bracket", next: "start"},
+      {regex: /--/, token: "bracket"},
+      {regex: /\S+/, token: "meta"},
+      {regex: /\s+|./, token: null}
     ],
     // The meta property contains global information about the mode. It
     // can contain properties like lineComment, which are supported by
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/index.html.html
deleted file mode 100644
index 9f15489140400f68f3f99653d11fb41f38e56ec7..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/index.html.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Factor mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/simple.js"></script>
-<script src="factor.js"></script>
-<style>
-.CodeMirror {
-    font-family: 'Droid Sans Mono', monospace;
-    font-size: 14px;
-}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Factor</a>
-  </ul>
-</div>
-
-<article>
-
-<h2>Factor mode</h2>
-
-<form><textarea id="code" name="code">
-! Copyright (C) 2008 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-
-! A simple time server
-
-USING: accessors calendar calendar.format io io.encodings.ascii
-io.servers kernel threads ;
-IN: time-server
-
-: handle-time-client ( -- )
-    now timestamp>rfc822 print ;
-
-: <time-server> ( -- threaded-server )
-    ascii <threaded-server>
-        "time-server" >>name
-        1234 >>insecure
-        [ handle-time-client ] >>handler ;
-
-: start-time-server ( -- )
-    <time-server> start-server drop ;
-
-MAIN: start-time-server
-</textarea>
-  </form>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    lineWrapping: true,
-    indentUnit: 2,
-    tabSize: 2,
-    autofocus: true,
-    mode: "text/x-factor"
-  });
-</script>
-<p/>
-<p>Simple mode that handles Factor Syntax (<a href="http://en.wikipedia.org/wiki/Factor_(programming_language)">Factor on WikiPedia</a>).</p>
-
-<p><strong>MIME types defined:</strong> <code>text/x-factor</code>.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/factor/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fcl/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fcl/index.html.html
deleted file mode 100644
index 3c18d0b3c76c83d682f9b5462465b25017b5c72d..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fcl/index.html.html
+++ /dev/null
@@ -1,108 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: FCL mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/elegant.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="fcl.js"></script>
-<style>.CodeMirror {border:1px solid #999; background:#ffc}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">FCL</a>
-  </ul>
-</div>
-
-<article>
-<h2>FCL mode</h2>
-<form><textarea id="code" name="code">
-  FUNCTION_BLOCK Fuzzy_FB
-      VAR_INPUT
-          TimeDay : REAL; (* RANGE(0 .. 23) *)
-          ApplicateHost: REAL;
-          TimeConfiguration: REAL;
-          TimeRequirements: REAL;
-      END_VAR
-
-      VAR_OUTPUT
-          ProbabilityDistribution: REAL;
-          ProbabilityAccess: REAL;
-      END_VAR
-
-      FUZZIFY TimeDay
-          TERM inside := (0, 0) (8, 1) (22,0);
-          TERM outside := (0, 1) (8, 0) (22, 1);
-      END_FUZZIFY
-
-      FUZZIFY ApplicateHost
-          TERM few := (0, 1) (100, 0) (200, 0);
-          TERM many := (0, 0) (100, 0) (200, 1);
-      END_FUZZIFY
-
-      FUZZIFY TimeConfiguration
-          TERM recently := (0, 1) (30, 1) (120, 0);
-          TERM long := (0, 0) (30, 0) (120, 1);
-      END_FUZZIFY
-
-      FUZZIFY TimeRequirements
-          TERM recently := (0, 1) (30, 1) (365, 0);
-          TERM long := (0, 0) (30, 0) (365, 1);
-      END_FUZZIFY
-
-      DEFUZZIFY ProbabilityAccess
-          TERM hight := 1;
-          TERM medium := 0.5;
-          TERM low := 0;
-          ACCU: MAX;
-          METHOD: COGS;
-          DEFAULT := 0;
-      END_DEFUZZIFY
-
-      DEFUZZIFY ProbabilityDistribution
-          TERM hight := 1;
-          TERM medium := 0.5;
-          TERM low := 0;
-          ACCU: MAX;
-          METHOD: COGS;
-          DEFAULT := 0;
-      END_DEFUZZIFY
-
-      RULEBLOCK No1
-          AND : MIN;
-          RULE 1 : IF TimeDay IS outside AND ApplicateHost IS few THEN ProbabilityAccess IS hight;
-          RULE 2 : IF ApplicateHost IS many THEN ProbabilityAccess IS hight;
-          RULE 3 : IF TimeDay IS inside AND ApplicateHost IS few THEN ProbabilityAccess IS low;
-      END_RULEBLOCK
-
-      RULEBLOCK No2
-          AND : MIN;
-          RULE 1 : IF ApplicateHost IS many THEN ProbabilityDistribution IS hight;
-      END_RULEBLOCK
-
-  END_FUNCTION_BLOCK
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        theme: "elegant",
-        matchBrackets: true,
-        indentUnit: 8,
-        tabSize: 8,
-        indentWithTabs: true,
-        mode: "text/x-fcl"
-      });
-    </script>
-
-    <p><strong>MIME type:</strong> <code>text/x-fcl</code></p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fcl/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fcl/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fcl/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/forth/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/forth/index.html.html
deleted file mode 100644
index ae8cd34584859e14fcfbfa8e9f5adec8cc45c77b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/forth/index.html.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Forth mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css'>
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel=stylesheet href="../../theme/colorforth.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="forth.js"></script>
-<style>
-.CodeMirror {
-    font-family: 'Droid Sans Mono', monospace;
-    font-size: 14px;
-}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Forth</a>
-  </ul>
-</div>
-
-<article>
-
-<h2>Forth mode</h2>
-
-<form><textarea id="code" name="code">
-\ Insertion sort
-
-: cell-  1 cells - ;
-
-: insert ( start end -- start )
-  dup @ >r ( r: v )
-  begin
-    2dup <
-  while
-    r@ over cell- @ <
-  while
-    cell-
-    dup @ over cell+ !
-  repeat then
-  r> swap ! ;
-
-: sort ( array len -- )
-  1 ?do
-    dup i cells + insert
-  loop drop ;</textarea>
-  </form>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    lineWrapping: true,
-    indentUnit: 2,
-    tabSize: 2,
-    autofocus: true,
-    theme: "colorforth",
-    mode: "text/x-forth"
-  });
-</script>
-
-<p>Simple mode that handle Forth-Syntax (<a href="http://en.wikipedia.org/wiki/Forth_%28programming_language%29">Forth on WikiPedia</a>).</p>
-
-<p><strong>MIME types defined:</strong> <code>text/x-forth</code>.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/forth/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/forth/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/forth/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fortran/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fortran/index.html.html
deleted file mode 100644
index 9aed0efccc4415c348b95680d5dc53aff6be367d..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fortran/index.html.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Fortran mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="fortran.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Fortran</a>
-  </ul>
-</div>
-
-<article>
-<h2>Fortran mode</h2>
-
-
-<div><textarea id="code" name="code">
-! Example Fortran code
-  program average
-
-  ! Read in some numbers and take the average
-  ! As written, if there are no data points, an average of zero is returned
-  ! While this may not be desired behavior, it keeps this example simple
-
-  implicit none
-
-  real, dimension(:), allocatable :: points
-  integer                         :: number_of_points
-  real                            :: average_points=0., positive_average=0., negative_average=0.
-
-  write (*,*) "Input number of points to average:"
-  read  (*,*) number_of_points
-
-  allocate (points(number_of_points))
-
-  write (*,*) "Enter the points to average:"
-  read  (*,*) points
-
-  ! Take the average by summing points and dividing by number_of_points
-  if (number_of_points > 0) average_points = sum(points) / number_of_points
-
-  ! Now form average over positive and negative points only
-  if (count(points > 0.) > 0) then
-     positive_average = sum(points, points > 0.) / count(points > 0.)
-  end if
-
-  if (count(points < 0.) > 0) then
-     negative_average = sum(points, points < 0.) / count(points < 0.)
-  end if
-
-  deallocate (points)
-
-  ! Print result to terminal
-  write (*,'(a,g12.4)') 'Average = ', average_points
-  write (*,'(a,g12.4)') 'Average of positive points = ', positive_average
-  write (*,'(a,g12.4)') 'Average of negative points = ', negative_average
-
-  end program average
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "text/x-fortran"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-fortran</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fortran/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fortran/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/fortran/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gas/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gas/index.html.html
deleted file mode 100644
index df75ca2db7f242b5be52857a21c62d35d0d751a8..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gas/index.html.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Gas mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="gas.js"></script>
-<style>.CodeMirror {border: 2px inset #dee;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Gas</a>
-  </ul>
-</div>
-
-<article>
-<h2>Gas mode</h2>
-<form>
-<textarea id="code" name="code">
-.syntax unified
-.global main
-
-/* 
- *  A
- *  multi-line
- *  comment.
- */
-
-@ A single line comment.
-
-main:
-        push    {sp, lr}
-        ldr     r0, =message
-        bl      puts
-        mov     r0, #0
-        pop     {sp, pc}
-
-message:
-        .asciz "Hello world!<br />"
-</textarea>
-        </form>
-
-        <script>
-            var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-                lineNumbers: true,
-                mode: {name: "gas", architecture: "ARMv6"},
-            });
-        </script>
-
-        <p>Handles AT&amp;T assembler syntax (more specifically this handles
-        the GNU Assembler (gas) syntax.)
-        It takes a single optional configuration parameter:
-        <code>architecture</code>, which can be one of <code>"ARM"</code>,
-        <code>"ARMv6"</code> or <code>"x86"</code>.
-        Including the parameter adds syntax for the registers and special
-        directives for the supplied architecture.
-
-        <p><strong>MIME types defined:</strong> <code>text/x-gas</code></p>
-    </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gas/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gas/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gas/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/gfm.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/gfm.js.js
index 6e74ad4fd67e0e65d2b5b3a94b4762042e60eaa0..471ae906b9b81324da4ee340f8286ab062ad8240 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/gfm.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/gfm.js.js
@@ -81,7 +81,7 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
       if (stream.sol() || state.ateSpace) {
         state.ateSpace = false;
         if (modeConfig.gitHubSpice !== false) {
-          if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) {
+          if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/)) {
             // User/Project@SHA
             // User@SHA
             // SHA
@@ -113,10 +113,9 @@ CodeMirror.defineMode("gfm", function(config, modeConfig) {
   };
 
   var markdownConfig = {
-    underscoresBreakWords: false,
     taskLists: true,
-    fencedCodeBlocks: '```',
-    strikethrough: true
+    strikethrough: true,
+    emoji: true
   };
   for (var attr in modeConfig) {
     markdownConfig[attr] = modeConfig[attr];
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/index.html.html
deleted file mode 100644
index 24c90c068eea44612b92199da1452d16861b8127..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/index.html.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: GFM mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/overlay.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../markdown/markdown.js"></script>
-<script src="gfm.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../css/css.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="../clike/clike.js"></script>
-<script src="../meta.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">GFM</a>
-  </ul>
-</div>
-
-<article>
-<h2>GFM mode</h2>
-<form><textarea id="code" name="code">
-GitHub Flavored Markdown
-========================
-
-Everything from markdown plus GFM features:
-
-## URL autolinking
-
-Underscores_are_allowed_between_words.
-
-## Strikethrough text
-
-GFM adds syntax to strikethrough text, which is missing from standard Markdown.
-
-~~Mistaken text.~~
-~~**works with other formatting**~~
-
-~~spans across
-lines~~
-
-## Fenced code blocks (and syntax highlighting)
-
-```javascript
-for (var i = 0; i &lt; items.length; i++) {
-    console.log(items[i], i); // log them
-}
-```
-
-## Task Lists
-
-- [ ] Incomplete task list item
-- [x] **Completed** task list item
-
-## A bit of GitHub spice
-
-* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
-* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
-* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
-* \#Num: #1
-* User/#Num: mojombo#1
-* User/Project#Num: mojombo/god#1
-
-See http://github.github.com/github-flavored-markdown/.
-
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: 'gfm',
-        lineNumbers: true,
-        theme: "default"
-      });
-    </script>
-
-    <p>Optionally depends on other modes for properly highlighted code blocks.</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#gfm_*">normal</a>,  <a href="../../test/index.html#verbose,gfm_*">verbose</a>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/test.js.js
index 7a1a4ccf21792abb4c4d330d1ed01622e7447877..e7135264c32394b71d85ec211b8a50323bd24e06 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gfm/test.js.js
@@ -2,9 +2,10 @@
 // Distributed under an MIT license: http://codemirror.net/LICENSE
 
 (function() {
-  var mode = CodeMirror.getMode({tabSize: 4}, "gfm");
+  var config = {tabSize: 4, indentUnit: 2}
+  var mode = CodeMirror.getMode(config, "gfm");
   function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
-  var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "gfm", highlightFormatting: true});
+  var modeHighlightFormatting = CodeMirror.getMode(config, {name: "gfm", highlightFormatting: true});
   function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }
 
   FT("codeBackticks",
@@ -13,11 +14,6 @@
   FT("doubleBackticks",
      "[comment&formatting&formatting-code ``][comment foo ` bar][comment&formatting&formatting-code ``]");
 
-  FT("codeBlock",
-     "[comment&formatting&formatting-code-block ```css]",
-     "[tag foo]",
-     "[comment&formatting&formatting-code-block ```]");
-
   FT("taskList",
      "[variable-2&formatting&formatting-list&formatting-list-ul - ][meta&formatting&formatting-task [ ]]][variable-2  foo]",
      "[variable-2&formatting&formatting-list&formatting-list-ul - ][property&formatting&formatting-task [x]]][variable-2  foo]");
@@ -28,6 +24,9 @@
   FT("formatting_strikethrough",
      "foo [strikethrough&formatting&formatting-strikethrough ~~][strikethrough bar][strikethrough&formatting&formatting-strikethrough ~~]");
 
+  FT("formatting_emoji",
+     "foo [builtin&formatting&formatting-emoji :smile:] foo");
+
   MT("emInWordAsterisk",
      "foo[em *bar*]hello");
 
@@ -35,59 +34,31 @@
      "foo_bar_hello");
 
   MT("emStrongUnderscore",
-     "[strong __][em&strong _foo__][em _] bar");
-
-  MT("fencedCodeBlocks",
-     "[comment ```]",
-     "[comment foo]",
-     "",
-     "[comment ```]",
-     "bar");
-
-  MT("fencedCodeBlockModeSwitching",
-     "[comment ```javascript]",
-     "[variable foo]",
-     "",
-     "[comment ```]",
-     "bar");
-
-  MT("fencedCodeBlockModeSwitchingObjc",
-     "[comment ```objective-c]",
-     "[keyword @property] [variable NSString] [operator *] [variable foo];",
-     "[comment ```]",
-     "bar");
-
-  MT("fencedCodeBlocksNoTildes",
-     "~~~",
-     "foo",
-     "~~~");
+     "[em&strong ___foo___] bar");
 
   MT("taskListAsterisk",
-     "[variable-2 * []] foo]", // Invalid; must have space or x between []
-     "[variable-2 * [ ]]bar]", // Invalid; must have space after ]
-     "[variable-2 * [x]]hello]", // Invalid; must have space after ]
-     "[variable-2 * ][meta [ ]]][variable-2  [world]]]", // Valid; tests reference style links
+     "[variable-2 * ][link&variable-2 [[]]][variable-2 foo]", // Invalid; must have space or x between []
+     "[variable-2 * ][link&variable-2 [[ ]]][variable-2 bar]", // Invalid; must have space after ]
+     "[variable-2 * ][link&variable-2 [[x]]][variable-2 hello]", // Invalid; must have space after ]
+     "[variable-2 * ][meta [ ]]][variable-2  ][link&variable-2 [[world]]]", // Valid; tests reference style links
      "    [variable-3 * ][property [x]]][variable-3  foo]"); // Valid; can be nested
 
   MT("taskListPlus",
-     "[variable-2 + []] foo]", // Invalid; must have space or x between []
-     "[variable-2 + [ ]]bar]", // Invalid; must have space after ]
-     "[variable-2 + [x]]hello]", // Invalid; must have space after ]
-     "[variable-2 + ][meta [ ]]][variable-2  [world]]]", // Valid; tests reference style links
+     "[variable-2 + ][link&variable-2 [[]]][variable-2 foo]", // Invalid; must have space or x between []
+     "[variable-2 + ][link&variable-2 [[x]]][variable-2 hello]", // Invalid; must have space after ]
+     "[variable-2 + ][meta [ ]]][variable-2  ][link&variable-2 [[world]]]", // Valid; tests reference style links
      "    [variable-3 + ][property [x]]][variable-3  foo]"); // Valid; can be nested
 
   MT("taskListDash",
-     "[variable-2 - []] foo]", // Invalid; must have space or x between []
-     "[variable-2 - [ ]]bar]", // Invalid; must have space after ]
-     "[variable-2 - [x]]hello]", // Invalid; must have space after ]
-     "[variable-2 - ][meta [ ]]][variable-2  [world]]]", // Valid; tests reference style links
+     "[variable-2 - ][link&variable-2 [[]]][variable-2 foo]", // Invalid; must have space or x between []
+     "[variable-2 - ][link&variable-2 [[x]]][variable-2 hello]", // Invalid; must have space after ]
+     "[variable-2 - ][meta [ ]]][variable-2  world]", // Valid; tests reference style links
      "    [variable-3 - ][property [x]]][variable-3  foo]"); // Valid; can be nested
 
   MT("taskListNumber",
-     "[variable-2 1. []] foo]", // Invalid; must have space or x between []
-     "[variable-2 2. [ ]]bar]", // Invalid; must have space after ]
-     "[variable-2 3. [x]]hello]", // Invalid; must have space after ]
-     "[variable-2 4. ][meta [ ]]][variable-2  [world]]]", // Valid; tests reference style links
+     "[variable-2 1. ][link&variable-2 [[]]][variable-2 foo]", // Invalid; must have space or x between []
+     "[variable-2 2. ][link&variable-2 [[ ]]][variable-2 bar]", // Invalid; must have space after ]
+     "[variable-2 3. ][meta [ ]]][variable-2  world]", // Valid; tests reference style links
      "    [variable-3 1. ][property [x]]][variable-3  foo]"); // Valid; can be nested
 
   MT("SHA",
@@ -120,6 +91,9 @@
   MT("userProjectSHAEmphasis",
      "[em *foo ][em&link bar/hello@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2][em *]");
 
+  MT("wordSHA",
+     "ask for feedbac")
+
   MT("num",
      "foo [link #1] bar");
 
@@ -165,11 +139,6 @@
   MT("notALink",
      "foo asfd:asdf bar");
 
-  MT("notALink",
-     "[comment ```css]",
-     "[tag foo] {[property color]:[keyword black];}",
-     "[comment ```][link http://www.example.com/]");
-
   MT("notALink",
      "[comment ``foo `bar` http://www.example.com/``] hello");
 
@@ -180,17 +149,6 @@
      "",
      "[link http://www.example.com/]");
 
-  MT("headerCodeBlockGithub",
-     "[header&header-1 # heading]",
-     "",
-     "[comment ```]",
-     "[comment code]",
-     "[comment ```]",
-     "",
-     "Commit: [link be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2]",
-     "Issue: [link #1]",
-     "Link: [link http://www.example.com/]");
-
   MT("strikethrough",
      "[strikethrough ~~foo~~]");
 
@@ -233,4 +191,8 @@
   MT("strikethroughStrong",
      "[strong **][strong&strikethrough ~~foo~~][strong **]");
 
+  MT("emoji",
+     "text [builtin :blush:] text [builtin :v:] text [builtin :+1:] text",
+     ":text text: [builtin :smiley_cat:]");
+
 })();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gherkin/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gherkin/index.html.html
deleted file mode 100644
index af8184c9810a8b80f72571c32815671bfcda8dcf..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gherkin/index.html.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Gherkin mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="gherkin.js"></script>
-<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Gherkin</a>
-  </ul>
-</div>
-
-<article>
-<h2>Gherkin mode</h2>
-<form><textarea id="code" name="code">
-Feature: Using Google
-  Background: 
-    Something something
-    Something else
-  Scenario: Has a homepage
-    When I navigate to the google home page
-    Then the home page should contain the menu and the search form
-  Scenario: Searching for a term 
-    When I navigate to the google home page
-    When I search for Tofu
-    Then the search results page is displayed
-    Then the search results page contains 10 individual search results
-    Then the search results contain a link to the wikipedia tofu page
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-feature</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gherkin/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gherkin/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/gherkin/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/go.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/go.js.js
index 8896b57fb99b49f04774b080e95c37349833d1ab..36131f10fe91c93375305cd86cd504fbcb13e786 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/go.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/go.js.js
@@ -155,14 +155,14 @@ CodeMirror.defineMode("go", function(config) {
       else if (curPunc == "[") pushContext(state, stream.column(), "]");
       else if (curPunc == "(") pushContext(state, stream.column(), ")");
       else if (curPunc == "case") ctx.type = "case";
-      else if (curPunc == "}" && ctx.type == "}") ctx = popContext(state);
+      else if (curPunc == "}" && ctx.type == "}") popContext(state);
       else if (curPunc == ctx.type) popContext(state);
       state.startOfLine = false;
       return style;
     },
 
     indent: function(state, textAfter) {
-      if (state.tokenize != tokenBase && state.tokenize != null) return 0;
+      if (state.tokenize != tokenBase && state.tokenize != null) return CodeMirror.Pass;
       var ctx = state.context, firstChar = textAfter && textAfter.charAt(0);
       if (ctx.type == "case" && /^(?:case|default)\b/.test(textAfter)) {
         state.context.type = "}";
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/index.html.html
deleted file mode 100644
index 72e3b364c6fd662b3ca1d19cfe100f425a0f5e5f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/index.html.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Go mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/elegant.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="go.js"></script>
-<style>.CodeMirror {border:1px solid #999; background:#ffc}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Go</a>
-  </ul>
-</div>
-
-<article>
-<h2>Go mode</h2>
-<form><textarea id="code" name="code">
-// Prime Sieve in Go.
-// Taken from the Go specification.
-// Copyright 漏 The Go Authors.
-
-package main
-
-import "fmt"
-
-// Send the sequence 2, 3, 4, ... to channel 'ch'.
-func generate(ch chan&lt;- int) {
-	for i := 2; ; i++ {
-		ch &lt;- i  // Send 'i' to channel 'ch'
-	}
-}
-
-// Copy the values from channel 'src' to channel 'dst',
-// removing those divisible by 'prime'.
-func filter(src &lt;-chan int, dst chan&lt;- int, prime int) {
-	for i := range src {    // Loop over values received from 'src'.
-		if i%prime != 0 {
-			dst &lt;- i  // Send 'i' to channel 'dst'.
-		}
-	}
-}
-
-// The prime sieve: Daisy-chain filter processes together.
-func sieve() {
-	ch := make(chan int)  // Create a new channel.
-	go generate(ch)       // Start generate() as a subprocess.
-	for {
-		prime := &lt;-ch
-		fmt.Print(prime, "\n")
-		ch1 := make(chan int)
-		go filter(ch, ch1, prime)
-		ch = ch1
-	}
-}
-
-func main() {
-	sieve()
-}
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        theme: "elegant",
-        matchBrackets: true,
-        indentUnit: 8,
-        tabSize: 8,
-        indentWithTabs: true,
-        mode: "text/x-go"
-      });
-    </script>
-
-    <p><strong>MIME type:</strong> <code>text/x-go</code></p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/go/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/groovy.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/groovy.js.js
index daa798722ea6dc2de1216de7f6a4f168f0999474..0df97dd0b7f4b6f1488a0bd0a919a82620df0d5c 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/groovy.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/groovy.js.js
@@ -21,9 +21,9 @@ CodeMirror.defineMode("groovy", function(config) {
     "abstract as assert boolean break byte case catch char class const continue def default " +
     "do double else enum extends final finally float for goto if implements import in " +
     "instanceof int interface long native new package private protected public return " +
-    "short static strictfp super switch synchronized threadsafe throw throws transient " +
+    "short static strictfp super switch synchronized threadsafe throw throws trait transient " +
     "try void volatile while");
-  var blockKeywords = words("catch class do else finally for if switch try while enum interface def");
+  var blockKeywords = words("catch class def do else enum finally for if interface switch trait try while");
   var standaloneKeywords = words("return break continue");
   var atoms = words("null true false this");
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/index.html.html
deleted file mode 100644
index bb0df078c34dc8cddb5d1b6937c92b3a061881b7..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/index.html.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Groovy mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="groovy.js"></script>
-<style>.CodeMirror {border-top: 1px solid #500; border-bottom: 1px solid #500;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Groovy</a>
-  </ul>
-</div>
-
-<article>
-<h2>Groovy mode</h2>
-<form><textarea id="code" name="code">
-//Pattern for groovy script
-def p = ~/.*\.groovy/
-new File( 'd:\\scripts' ).eachFileMatch(p) {f ->
-  // imports list
-  def imports = []
-  f.eachLine {
-    // condition to detect an import instruction
-    ln -> if ( ln =~ '^import .*' ) {
-      imports << "${ln - 'import '}"
-    }
-  }
-  // print thmen
-  if ( ! imports.empty ) {
-    println f
-    imports.each{ println "   $it" }
-  }
-}
-
-/* Coin changer demo code from http://groovy.codehaus.org */
-
-enum UsCoin {
-  quarter(25), dime(10), nickel(5), penny(1)
-  UsCoin(v) { value = v }
-  final value
-}
-
-enum OzzieCoin {
-  fifty(50), twenty(20), ten(10), five(5)
-  OzzieCoin(v) { value = v }
-  final value
-}
-
-def plural(word, count) {
-  if (count == 1) return word
-  word[-1] == 'y' ? word[0..-2] + "ies" : word + "s"
-}
-
-def change(currency, amount) {
-  currency.values().inject([]){ list, coin ->
-     int count = amount / coin.value
-     amount = amount % coin.value
-     list += "$count ${plural(coin.toString(), count)}"
-  }
-}
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-groovy"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-groovy</code></p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/groovy/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haml/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haml/index.html.html
deleted file mode 100644
index 2894a938e83487a9d6ae00839a574a3de39a64c2..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haml/index.html.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: HAML mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../ruby/ruby.js"></script>
-<script src="haml.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">HAML</a>
-  </ul>
-</div>
-
-<article>
-<h2>HAML mode</h2>
-<form><textarea id="code" name="code">
-!!!
-#content
-.left.column(title="title"){:href => "/hello", :test => "#{hello}_#{world}"}
-    <!-- This is a comment -->
-    %h2 Welcome to our site!
-    %p= puts "HAML MODE"
-  .right.column
-    = render :partial => "sidebar"
-
-.container
-  .row
-    .span8
-      %h1.title= @page_title
-%p.title= @page_title
-%p
-  /
-    The same as HTML comment
-    Hello multiline comment
-
-  -# haml comment
-      This wont be displayed
-      nor will this
-  Date/Time:
-  - now = DateTime.now
-  %strong= now
-  - if now > DateTime.parse("December 31, 2006")
-    = "Happy new " + "year!"
-
-%title
-  = @title
-  \= @title
-  <h1>Title</h1>
-  <h1 title="HELLO">
-    Title
-  </h1>
-    </textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "text/x-haml"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-haml</code>.</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#haml_*">normal</a>,  <a href="../../test/index.html#verbose,haml_*">verbose</a>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haml/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haml/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haml/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/handlebars/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/handlebars/index.html.html
deleted file mode 100644
index b1bfad1ca342019d60d504e3258ec4dc39ff916c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/handlebars/index.html.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Handlebars mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/simple.js"></script>
-<script src="../../addon/mode/multiplex.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="handlebars.js"></script>
-<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">HTML mixed</a>
-  </ul>
-</div>
-
-<article>
-<h2>Handlebars</h2>
-<form><textarea id="code" name="code">
-{{> breadcrumbs}}
-
-{{!--
-  You can use the t function to get
-  content translated to the current locale, es:
-  {{t 'article_list'}}
---}}
-
-<h1>{{t 'article_list'}}</h1>
-
-{{! one line comment }}
-
-{{#each articles}}
-  {{~title}}
-  <p>{{excerpt body size=120 ellipsis=true}}</p>
-
-  {{#with author}}
-    written by {{first_name}} {{last_name}}
-    from category: {{../category.title}}
-    {{#if @../last}}foobar!{{/if}}
-  {{/with~}}
-
-  {{#if promoted.latest}}Read this one! {{else}} This is ok! {{/if}}
-
-  {{#if @last}}<hr>{{/if}}
-{{/each}}
-
-{{#form new_comment}}
-  <input type="text" name="body">
-{{/form}}
-
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: {name: "handlebars", base: "text/html"}
-      });
-    </script>
-    
-    <p>Handlebars syntax highlighting for CodeMirror.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-handlebars-template</code></p>
-
-    <p>Supported options: <code>base</code> to set the mode to
-    wrap. For example, use</p>
-    <pre>mode: {name: "handlebars", base: "text/html"}</pre>
-    <p>to highlight an HTML template.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/handlebars/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/handlebars/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/handlebars/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell-literate/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell-literate/index.html.html
deleted file mode 100644
index 8c9bc60d151f34108c63517a22616dad9e22f365..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell-literate/index.html.html
+++ /dev/null
@@ -1,282 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Haskell-literate mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="haskell-literate.js"></script>
-<script src="../haskell/haskell.js"></script>
-<style>.CodeMirror {
-  border-top    : 1px solid #DDDDDD;
-  border-bottom : 1px solid #DDDDDD;
-}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo
-                                                          src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Haskell-literate</a>
-  </ul>
-</div>
-
-<article>
-  <h2>Haskell literate mode</h2>
-  <form>
-    <textarea id="code" name="code">
-> {-# LANGUAGE OverloadedStrings #-}
-> {-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
-> import Control.Applicative ((<$>), (<*>))
-> import Data.Maybe (isJust)
-
-> import Data.Text (Text)
-> import Text.Blaze ((!))
-> import qualified Data.Text as T
-> import qualified Happstack.Server as Happstack
-> import qualified Text.Blaze.Html5 as H
-> import qualified Text.Blaze.Html5.Attributes as A
-
-> import Text.Digestive
-> import Text.Digestive.Blaze.Html5
-> import Text.Digestive.Happstack
-> import Text.Digestive.Util
-
-Simple forms and validation
----------------------------
-
-Let's start by creating a very simple datatype to represent a user:
-
-> data User = User
->     { userName :: Text
->     , userMail :: Text
->     } deriving (Show)
-
-And dive in immediately to create a `Form` for a user. The `Form v m a` type
-has three parameters:
-
-- `v`: the type for messages and errors (usually a `String`-like type, `Text` in
-  this case);
-- `m`: the monad we are operating in, not specified here;
-- `a`: the return type of the `Form`, in this case, this is obviously `User`.
-
-> userForm :: Monad m => Form Text m User
-
-We create forms by using the `Applicative` interface. A few form types are
-provided in the `Text.Digestive.Form` module, such as `text`, `string`,
-`bool`...
-
-In the `digestive-functors` library, the developer is required to label each
-field using the `.:` operator. This might look like a bit of a burden, but it
-allows you to do some really useful stuff, like separating the `Form` from the
-actual HTML layout.
-
-> userForm = User
->     <$> "name" .: text Nothing
->     <*> "mail" .: check "Not a valid email address" checkEmail (text Nothing)
-
-The `check` function enables you to validate the result of a form. For example,
-we can validate the email address with a really naive `checkEmail` function.
-
-> checkEmail :: Text -> Bool
-> checkEmail = isJust . T.find (== '@')
-
-More validation
----------------
-
-For our example, we also want descriptions of Haskell libraries, and in order to
-do that, we need package versions...
-
-> type Version = [Int]
-
-We want to let the user input a version number such as `0.1.0.0`. This means we
-need to validate if the input `Text` is of this form, and then we need to parse
-it to a `Version` type. Fortunately, we can do this in a single function:
-`validate` allows conversion between values, which can optionally fail.
-
-`readMaybe :: Read a => String -> Maybe a` is a utility function imported from
-`Text.Digestive.Util`.
-
-> validateVersion :: Text -> Result Text Version
-> validateVersion = maybe (Error "Cannot parse version") Success .
->     mapM (readMaybe . T.unpack) . T.split (== '.')
-
-A quick test in GHCi:
-
-    ghci> validateVersion (T.pack "0.3.2.1")
-    Success [0,3,2,1]
-    ghci> validateVersion (T.pack "0.oops")
-    Error "Cannot parse version"
-
-It works! This means we can now easily add a `Package` type and a `Form` for it:
-
-> data Category = Web | Text | Math
->     deriving (Bounded, Enum, Eq, Show)
-
-> data Package = Package Text Version Category
->     deriving (Show)
-
-> packageForm :: Monad m => Form Text m Package
-> packageForm = Package
->     <$> "name"     .: text Nothing
->     <*> "version"  .: validate validateVersion (text (Just "0.0.0.1"))
->     <*> "category" .: choice categories Nothing
->   where
->     categories = [(x, T.pack (show x)) | x <- [minBound .. maxBound]]
-
-Composing forms
----------------
-
-A release has an author and a package. Let's use this to illustrate the
-composability of the digestive-functors library: we can reuse the forms we have
-written earlier on.
-
-> data Release = Release User Package
->     deriving (Show)
-
-> releaseForm :: Monad m => Form Text m Release
-> releaseForm = Release
->     <$> "author"  .: userForm
->     <*> "package" .: packageForm
-
-Views
------
-
-As mentioned before, one of the advantages of using digestive-functors is
-separation of forms and their actual HTML layout. In order to do this, we have
-another type, `View`.
-
-We can get a `View` from a `Form` by supplying input. A `View` contains more
-information than a `Form`, it has:
-
-- the original form;
-- the input given by the user;
-- any errors that have occurred.
-
-It is this view that we convert to HTML. For this tutorial, we use the
-[blaze-html] library, and some helpers from the `digestive-functors-blaze`
-library.
-
-[blaze-html]: http://jaspervdj.be/blaze/
-
-Let's write a view for the `User` form. As you can see, we here refer to the
-different fields in the `userForm`. The `errorList` will generate a list of
-errors for the `"mail"` field.
-
-> userView :: View H.Html -> H.Html
-> userView view = do
->     label     "name" view "Name: "
->     inputText "name" view
->     H.br
->
->     errorList "mail" view
->     label     "mail" view "Email address: "
->     inputText "mail" view
->     H.br
-
-Like forms, views are also composable: let's illustrate that by adding a view
-for the `releaseForm`, in which we reuse `userView`. In order to do this, we
-take only the parts relevant to the author from the view by using `subView`. We
-can then pass the resulting view to our own `userView`.
-We have no special view code for `Package`, so we can just add that to
-`releaseView` as well. `childErrorList` will generate a list of errors for each
-child of the specified form. In this case, this means a list of errors from
-`"package.name"` and `"package.version"`. Note how we use `foo.bar` to refer to
-nested forms.
-
-> releaseView :: View H.Html -> H.Html
-> releaseView view = do
->     H.h2 "Author"
->     userView $ subView "author" view
->
->     H.h2 "Package"
->     childErrorList "package" view
->
->     label     "package.name" view "Name: "
->     inputText "package.name" view
->     H.br
->
->     label     "package.version" view "Version: "
->     inputText "package.version" view
->     H.br
->
->     label       "package.category" view "Category: "
->     inputSelect "package.category" view
->     H.br
-
-The attentive reader might have wondered what the type parameter for `View` is:
-it is the `String`-like type used for e.g. error messages.
-But wait! We have
-    releaseForm :: Monad m => Form Text m Release
-    releaseView :: View H.Html -> H.Html
-... doesn't this mean that we need a `View Text` rather than a `View Html`?  The
-answer is yes -- but having `View Html` allows us to write these views more
-easily with the `digestive-functors-blaze` library. Fortunately, we will be able
-to fix this using the `Functor` instance of `View`.
-    fmap :: Monad m => (v -> w) -> View v -> View w
-A backend
----------
-To finish this tutorial, we need to be able to actually run this code. We need
-an HTTP server for that, and we use [Happstack] for this tutorial. The
-`digestive-functors-happstack` library gives about everything we need for this.
-[Happstack]: http://happstack.com/
-
-> site :: Happstack.ServerPart Happstack.Response
-> site = do
->     Happstack.decodeBody $ Happstack.defaultBodyPolicy "/tmp" 4096 4096 4096
->     r <- runForm "test" releaseForm
->     case r of
->         (view, Nothing) -> do
->             let view' = fmap H.toHtml view
->             Happstack.ok $ Happstack.toResponse $
->                 template $
->                     form view' "/" $ do
->                         releaseView view'
->                         H.br
->                         inputSubmit "Submit"
->         (_, Just release) -> Happstack.ok $ Happstack.toResponse $
->             template $ do
->                 css
->                 H.h1 "Release received"
->                 H.p $ H.toHtml $ show release
->
-> main :: IO ()
-> main = Happstack.simpleHTTP Happstack.nullConf site
-
-Utilities
----------
-
-> template :: H.Html -> H.Html
-> template body = H.docTypeHtml $ do
->     H.head $ do
->         H.title "digestive-functors tutorial"
->         css
->     H.body body
-> css :: H.Html
-> css = H.style ! A.type_ "text/css" $ do
->     "label {width: 130px; float: left; clear: both}"
->     "ul.digestive-functors-error-list {"
->     "    color: red;"
->     "    list-style-type: none;"
->     "    padding-left: 0px;"
->     "}"
-    </textarea>
-  </form>
-
-  <p><strong>MIME types
-  defined:</strong> <code>text/x-literate-haskell</code>.</p>
-
-  <p>Parser configuration parameters recognized: <code>base</code> to
-  set the base mode (defaults to <code>"haskell"</code>).</p>
-
-  <script>
-    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "haskell-literate"});
-  </script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell-literate/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell-literate/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell-literate/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/haskell.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/haskell.js.js
index 4197666a44f4561f1621cd13dafd3b478b36ea2a..acc52b5c3b9ef7c5d21320a9ce9efb6bb0bc628a 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/haskell.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/haskell.js.js
@@ -197,13 +197,14 @@ CodeMirror.defineMode("haskell", function(_config, modeConfig) {
       "\.\.", ":", "::", "=", "\\", "<-", "->", "@", "~", "=>");
 
     setType("builtin")(
-      "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<=", "=<<",
-      "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*", "**");
+      "!!", "$!", "$", "&&", "+", "++", "-", ".", "/", "/=", "<", "<*", "<=",
+      "<$>", "<*>", "=<<", "==", ">", ">=", ">>", ">>=", "^", "^^", "||", "*",
+      "*>", "**");
 
     setType("builtin")(
-      "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum", "Eq",
-      "False", "FilePath", "Float", "Floating", "Fractional", "Functor", "GT",
-      "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left",
+      "Applicative", "Bool", "Bounded", "Char", "Double", "EQ", "Either", "Enum",
+      "Eq", "False", "FilePath", "Float", "Floating", "Fractional", "Functor",
+      "GT", "IO", "IOError", "Int", "Integer", "Integral", "Just", "LT", "Left",
       "Maybe", "Monad", "Nothing", "Num", "Ord", "Ordering", "Rational", "Read",
       "ReadS", "Real", "RealFloat", "RealFrac", "Right", "Show", "ShowS",
       "String", "True");
@@ -223,7 +224,7 @@ CodeMirror.defineMode("haskell", function(_config, modeConfig) {
       "lcm", "length", "lex", "lines", "log", "logBase", "lookup", "map",
       "mapM", "mapM_", "max", "maxBound", "maximum", "maybe", "min", "minBound",
       "minimum", "mod", "negate", "not", "notElem", "null", "odd", "or",
-      "otherwise", "pi", "pred", "print", "product", "properFraction",
+      "otherwise", "pi", "pred", "print", "product", "properFraction", "pure",
       "putChar", "putStr", "putStrLn", "quot", "quotRem", "read", "readFile",
       "readIO", "readList", "readLn", "readParen", "reads", "readsPrec",
       "realToFrac", "recip", "rem", "repeat", "replicate", "return", "reverse",
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/index.html.html
deleted file mode 100644
index 42240b0f2fb008d6149f5f292b128afda6e71a43..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/index.html.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Haskell mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/elegant.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="haskell.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Haskell</a>
-  </ul>
-</div>
-
-<article>
-<h2>Haskell mode</h2>
-<form><textarea id="code" name="code">
-module UniquePerms (
-    uniquePerms
-    )
-where
-
--- | Find all unique permutations of a list where there might be duplicates.
-uniquePerms :: (Eq a) => [a] -> [[a]]
-uniquePerms = permBag . makeBag
-
--- | An unordered collection where duplicate values are allowed,
--- but represented with a single value and a count.
-type Bag a = [(a, Int)]
-
-makeBag :: (Eq a) => [a] -> Bag a
-makeBag [] = []
-makeBag (a:as) = mix a $ makeBag as
-  where
-    mix a []                        = [(a,1)]
-    mix a (bn@(b,n):bs) | a == b    = (b,n+1):bs
-                        | otherwise = bn : mix a bs
-
-permBag :: Bag a -> [[a]]
-permBag [] = [[]]
-permBag bs = concatMap (\(f,cs) -> map (f:) $ permBag cs) . oneOfEach $ bs
-  where
-    oneOfEach [] = []
-    oneOfEach (an@(a,n):bs) =
-        let bs' = if n == 1 then bs else (a,n-1):bs
-        in (a,bs') : mapSnd (an:) (oneOfEach bs)
-    
-    apSnd f (a,b) = (a, f b)
-    mapSnd = map . apSnd
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        theme: "elegant"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-haskell</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haskell/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/haxe.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/haxe.js.js
index a9573dd71b5981cf8814649a79b5d8ea0e27d66d..d159d082e96b815bf3d151fc7070feedd245855b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/haxe.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/haxe.js.js
@@ -485,7 +485,7 @@ CodeMirror.defineMode("hxml", function () {
 
       if (state.inString == false && ch == "'") {
         state.inString = true;
-        ch = stream.next();
+        stream.next();
       }
 
       if (state.inString == true) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/index.html.html
deleted file mode 100644
index d415b5e1090325ea0ab2ca59b48ed323a605c98b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/index.html.html
+++ /dev/null
@@ -1,124 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Haxe mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="haxe.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Haxe</a>
-  </ul>
-</div>
-
-<article>
-<h2>Haxe mode</h2>
-
-
-<div><p><textarea id="code-haxe" name="code">
-import one.two.Three;
-
-@attr("test")
-class Foo&lt;T&gt; extends Three
-{
-	public function new()
-	{
-		noFoo = 12;
-	}
-	
-	public static inline function doFoo(obj:{k:Int, l:Float}):Int
-	{
-		for(i in 0...10)
-		{
-			obj.k++;
-			trace(i);
-			var var1 = new Array();
-			if(var1.length > 1)
-				throw "Error";
-		}
-		// The following line should not be colored, the variable is scoped out
-		var1;
-		/* Multi line
-		 * Comment test
-		 */
-		return obj.k;
-	}
-	private function bar():Void
-	{
-		#if flash
-		var t1:String = "1.21";
-		#end
-		try {
-			doFoo({k:3, l:1.2});
-		}
-		catch (e : String) {
-			trace(e);
-		}
-		var t2:Float = cast(3.2);
-		var t3:haxe.Timer = new haxe.Timer();
-		var t4 = {k:Std.int(t2), l:Std.parseFloat(t1)};
-		var t5 = ~/123+.*$/i;
-		doFoo(t4);
-		untyped t1 = 4;
-		bob = new Foo&lt;Int&gt;
-	}
-	public var okFoo(default, never):Float;
-	var noFoo(getFoo, null):Int;
-	function getFoo():Int {
-		return noFoo;
-	}
-	
-	public var three:Int;
-}
-enum Color
-{
-	red;
-	green;
-	blue;
-	grey( v : Int );
-	rgb (r:Int,g:Int,b:Int);
-}
-</textarea></p>
-
-<p>Hxml mode:</p>
-
-<p><textarea id="code-hxml">
--cp test
--js path/to/file.js
-#-remap nme:flash
---next
--D source-map-content
--cmd 'test'
--lib lime
-</textarea></p>
-</div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code-haxe"), {
-      	mode: "haxe",
-        lineNumbers: true,
-        indentUnit: 4,
-        indentWithTabs: true
-      });
-      
-      editor = CodeMirror.fromTextArea(document.getElementById("code-hxml"), {
-      	mode: "hxml",
-        lineNumbers: true,
-        indentUnit: 4,
-        indentWithTabs: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-haxe, text/x-hxml</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/haxe/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/htmlembedded.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/htmlembedded.js.js
index 464dc57f83870244ac3dca6382d7ad64c6d09fe3..8099d370be0bd079fd1d9478a74f4ca21417e169 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/htmlembedded.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/htmlembedded.js.js
@@ -14,7 +14,16 @@
   "use strict";
 
   CodeMirror.defineMode("htmlembedded", function(config, parserConfig) {
+    var closeComment = parserConfig.closeComment || "--%>"
     return CodeMirror.multiplexingMode(CodeMirror.getMode(config, "htmlmixed"), {
+      open: parserConfig.openComment || "<%--",
+      close: closeComment,
+      delimStyle: "comment",
+      mode: {token: function(stream) {
+        stream.skipTo(closeComment) || stream.skipToEnd()
+        return "comment"
+      }}
+    }, {
       open: parserConfig.open || parserConfig.scriptStartRegex || "<%",
       close: parserConfig.close || parserConfig.scriptEndRegex || "%>",
       mode: CodeMirror.getMode(config, parserConfig.scriptingModeSpec)
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/index.html.html
deleted file mode 100644
index 9ed33cffef87c6ea5149989162b5ac2384a3a51c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/index.html.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Html Embedded Scripts mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../css/css.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="../../addon/mode/multiplex.js"></script>
-<script src="htmlembedded.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Html Embedded Scripts</a>
-  </ul>
-</div>
-
-<article>
-<h2>Html Embedded Scripts mode</h2>
-<form><textarea id="code" name="code">
-<%
-function hello(who) {
-	return "Hello " + who;
-}
-%>
-This is an example of EJS (embedded javascript)
-<p>The program says <%= hello("world") %>.</p>
-<script>
-	alert("And here is some normal JS code"); // also colored
-</script>
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "application/x-ejs",
-        indentUnit: 4,
-        indentWithTabs: true
-      });
-    </script>
-
-    <p>Mode for html embedded scripts like JSP and ASP.NET. Depends on multiplex and HtmlMixed which in turn depends on
-    JavaScript, CSS and XML.<br />Other dependencies include those of the scripting language chosen.</p>
-
-    <p><strong>MIME types defined:</strong> <code>application/x-aspx</code> (ASP.NET),
-    <code>application/x-ejs</code> (Embedded Javascript), <code>application/x-jsp</code> (JavaServer Pages)
-    and <code>application/x-erb</code></p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlembedded/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/htmlmixed.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/htmlmixed.js.js
index 16b4f139fd400cee86d5e10dda864881cf8b20a3..33398ec5c0bb1aea8649d5d9543a3ebb5da6e4d2 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/htmlmixed.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/htmlmixed.js.js
@@ -133,11 +133,11 @@
         return state.token(stream, state);
       },
 
-      indent: function (state, textAfter) {
+      indent: function (state, textAfter, line) {
         if (!state.localMode || /^\s*<\//.test(textAfter))
           return htmlMode.indent(state.htmlState, textAfter);
         else if (state.localMode.indent)
-          return state.localMode.indent(state.localState, textAfter);
+          return state.localMode.indent(state.localState, textAfter, line);
         else
           return CodeMirror.Pass;
       },
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/index.html.html
deleted file mode 100644
index caa7546c1e090e3e8d8a0e4233901d5c5c24c552..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/index.html.html
+++ /dev/null
@@ -1,100 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: HTML mixed mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/selection/selection-pointer.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../css/css.js"></script>
-<script src="../vbscript/vbscript.js"></script>
-<script src="htmlmixed.js"></script>
-<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">HTML mixed</a>
-  </ul>
-</div>
-
-<article>
-<h2>HTML mixed mode</h2>
-<form><textarea id="code" name="code">
-<html style="color: green">
-  <!-- this is a comment -->
-  <head>
-    <title>Mixed HTML Example</title>
-    <style type="text/css">
-      h1 {font-family: comic sans; color: #f0f;}
-      div {background: yellow !important;}
-      body {
-        max-width: 50em;
-        margin: 1em 2em 1em 5em;
-      }
-    </style>
-  </head>
-  <body>
-    <h1>Mixed HTML Example</h1>
-    <script>
-      function jsFunc(arg1, arg2) {
-        if (arg1 && arg2) document.body.innerHTML = "achoo";
-      }
-    </script>
-  </body>
-</html>
-</textarea></form>
-    <script>
-      // Define an extended mixed-mode that understands vbscript and
-      // leaves mustache/handlebars embedded templates in html mode
-      var mixedMode = {
-        name: "htmlmixed",
-        scriptTypes: [{matches: /\/x-handlebars-template|\/x-mustache/i,
-                       mode: null},
-                      {matches: /(text|application)\/(x-)?vb(a|script)/i,
-                       mode: "vbscript"}]
-      };
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: mixedMode,
-        selectionPointer: true
-      });
-    </script>
-
-    <p>The HTML mixed mode depends on the XML, JavaScript, and CSS modes.</p>
-
-    <p>It takes an optional mode configuration
-    option, <code>tags</code>, which can be used to add custom
-    behavior for specific tags. When given, it should be an object
-    mapping tag names (for example <code>script</code>) to arrays or
-    three-element arrays. Those inner arrays indicate [attributeName,
-    valueRegexp, <a href="../../doc/manual.html#option_mode">modeSpec</a>]
-    specifications. For example, you could use <code>["type", /^foo$/,
-    "foo"]</code> to map the attribute <code>type="foo"</code> to
-    the <code>foo</code> mode. When the first two fields are null
-    (<code>[null, null, "mode"]</code>), the given mode is used for
-    any such tag that doesn't match any of the previously given
-    attributes. For example:</p>
-
-    <pre>var myModeSpec = {
-  name: "htmlmixed",
-  tags: {
-    style: [["type", /^text/(x-)?scss$/, "text/x-scss"],
-            [null, null, "css"]],
-    custom: [[null, null, "customMode"]]
-  }
-}</pre>
-
-    <p><strong>MIME types defined:</strong> <code>text/html</code>
-    (redefined, only takes effect if you load this parser after the
-    XML parser).</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/htmlmixed/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/http/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/http/index.html.html
deleted file mode 100644
index 0b8d5315da62594e494c3ba567a7ae0355482418..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/http/index.html.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: HTTP mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="http.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">HTTP</a>
-  </ul>
-</div>
-
-<article>
-<h2>HTTP mode</h2>
-
-
-<div><textarea id="code" name="code">
-POST /somewhere HTTP/1.1
-Host: example.com
-If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT
-Content-Type: application/x-www-form-urlencoded;
-	charset=utf-8
-User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Ubuntu/12.04 Chromium/20.0.1132.47 Chrome/20.0.1132.47 Safari/536.11
-
-This is the request body!
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>message/http</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/http/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/http/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/http/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/idl/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/idl/index.html.html
deleted file mode 100644
index 4c169e2d69a5ebeea10cdc1bbad245dfc1c38197..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/idl/index.html.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: IDL mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="idl.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">IDL</a>
-  </ul>
-</div>
-
-<article>
-<h2>IDL mode</h2>
-
-    <div><textarea id="code" name="code">
-;; Example IDL code
-FUNCTION mean_and_stddev,array
-  ;; This program reads in an array of numbers
-  ;; and returns a structure containing the
-  ;; average and standard deviation
-
-  ave = 0.0
-  count = 0.0
-
-  for i=0,N_ELEMENTS(array)-1 do begin
-      ave = ave + array[i]
-      count = count + 1
-  endfor
-  
-  ave = ave/count
-
-  std = stddev(array)  
-
-  return, {average:ave,std:std}
-
-END
-
-    </textarea></div>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "idl",
-               version: 1,
-               singleLineStringErrors: false},
-        lineNumbers: true,
-        indentUnit: 4,
-        matchBrackets: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-idl</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/idl/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/idl/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/idl/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/index.html.html
deleted file mode 100644
index c0001a53eefd2ac5fb445e41d0c5c60282880f28..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/index.html.html
+++ /dev/null
@@ -1,165 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Language Modes</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../doc/docs.css">
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Language modes</a>
-  </ul>
-</div>
-
-<article>
-
-  <h2>Language modes</h2>
-
-  <p>This is a list of every mode in the distribution. Each mode lives
-in a subdirectory of the <code>mode/</code> directory, and typically
-defines a single JavaScript file that implements the mode. Loading
-such file will make the language available to CodeMirror, through
-the <a href="../doc/manual.html#option_mode"><code>mode</code></a>
-option.</p>
-
-  <div style="-webkit-columns: 100px 2; -moz-columns: 100px 2; columns: 100px 2;">
-    <ul style="margin-top: 0">
-      <li><a href="apl/index.html">APL</a></li>
-      <li><a href="asn.1/index.html">ASN.1</a></li>
-      <li><a href="asterisk/index.html">Asterisk dialplan</a></li>
-      <li><a href="brainfuck/index.html">Brainfuck</a></li>
-      <li><a href="clike/index.html">C, C++, C#</a></li>
-      <li><a href="clike/index.html">Ceylon</a></li>
-      <li><a href="clojure/index.html">Clojure</a></li>
-      <li><a href="css/gss.html">Closure Stylesheets (GSS)</a></li>
-      <li><a href="cmake/index.html">CMake</a></li>
-      <li><a href="cobol/index.html">COBOL</a></li>
-      <li><a href="coffeescript/index.html">CoffeeScript</a></li>
-      <li><a href="commonlisp/index.html">Common Lisp</a></li>
-      <li><a href="crystal/index.html">Crystal</a></li>
-      <li><a href="css/index.html">CSS</a></li>
-      <li><a href="cypher/index.html">Cypher</a></li>
-      <li><a href="python/index.html">Cython</a></li>
-      <li><a href="d/index.html">D</a></li>
-      <li><a href="dart/index.html">Dart</a></li>
-      <li><a href="django/index.html">Django</a> (templating language)</li>
-      <li><a href="dockerfile/index.html">Dockerfile</a></li>
-      <li><a href="diff/index.html">diff</a></li>
-      <li><a href="dtd/index.html">DTD</a></li>
-      <li><a href="dylan/index.html">Dylan</a></li>
-      <li><a href="ebnf/index.html">EBNF</a></li>
-      <li><a href="ecl/index.html">ECL</a></li>
-      <li><a href="eiffel/index.html">Eiffel</a></li>
-      <li><a href="https://github.com/optick/codemirror-mode-elixir">Elixir</a></li>
-      <li><a href="elm/index.html">Elm</a></li>
-      <li><a href="erlang/index.html">Erlang</a></li>
-      <li><a href="factor/index.html">Factor</a></li>
-      <li><a href="fcl/index.html">FCL</a></li>
-      <li><a href="forth/index.html">Forth</a></li>
-      <li><a href="fortran/index.html">Fortran</a></li>
-      <li><a href="mllike/index.html">F#</a></li>
-      <li><a href="gas/index.html">Gas</a> (AT&amp;T-style assembly)</li>
-      <li><a href="gherkin/index.html">Gherkin</a></li>
-      <li><a href="go/index.html">Go</a></li>
-      <li><a href="groovy/index.html">Groovy</a></li>
-      <li><a href="haml/index.html">HAML</a></li>
-      <li><a href="handlebars/index.html">Handlebars</a></li>
-      <li><a href="haskell/index.html">Haskell</a> (<a href="haskell-literate/index.html">Literate</a>)</li>
-      <li><a href="haxe/index.html">Haxe</a></li>
-      <li><a href="htmlembedded/index.html">HTML embedded</a> (JSP, ASP.NET)</li>
-      <li><a href="htmlmixed/index.html">HTML mixed-mode</a></li>
-      <li><a href="http/index.html">HTTP</a></li>
-      <li><a href="idl/index.html">IDL</a></li>
-      <li><a href="clike/index.html">Java</a></li>
-      <li><a href="javascript/index.html">JavaScript</a> (<a href="jsx/index.html">JSX</a>)</li>
-      <li><a href="jinja2/index.html">Jinja2</a></li>
-      <li><a href="julia/index.html">Julia</a></li>
-      <li><a href="kotlin/index.html">Kotlin</a></li>
-      <li><a href="css/less.html">LESS</a></li>
-      <li><a href="livescript/index.html">LiveScript</a></li>
-      <li><a href="lua/index.html">Lua</a></li>
-      <li><a href="markdown/index.html">Markdown</a> (<a href="gfm/index.html">GitHub-flavour</a>)</li>
-      <li><a href="mathematica/index.html">Mathematica</a></li>
-      <li><a href="mbox/index.html">mbox</a></li>
-      <li><a href="mirc/index.html">mIRC</a></li>
-      <li><a href="modelica/index.html">Modelica</a></li>
-      <li><a href="mscgen/index.html">MscGen</a></li>
-      <li><a href="mumps/index.html">MUMPS</a></li>
-      <li><a href="nginx/index.html">Nginx</a></li>
-      <li><a href="nsis/index.html">NSIS</a></li>
-      <li><a href="ntriples/index.html">NTriples</a></li>
-      <li><a href="clike/index.html">Objective C</a></li>
-      <li><a href="mllike/index.html">OCaml</a></li>
-      <li><a href="octave/index.html">Octave</a> (MATLAB)</li>
-      <li><a href="oz/index.html">Oz</a></li>
-      <li><a href="pascal/index.html">Pascal</a></li>
-      <li><a href="pegjs/index.html">PEG.js</a></li>
-      <li><a href="perl/index.html">Perl</a></li>
-      <li><a href="asciiarmor/index.html">PGP (ASCII armor)</a></li>
-      <li><a href="php/index.html">PHP</a></li>
-      <li><a href="pig/index.html">Pig Latin</a></li>
-      <li><a href="powershell/index.html">PowerShell</a></li>
-      <li><a href="properties/index.html">Properties files</a></li>
-      <li><a href="protobuf/index.html">ProtoBuf</a></li>
-      <li><a href="pug/index.html">Pug</a></li>
-      <li><a href="puppet/index.html">Puppet</a></li>
-      <li><a href="python/index.html">Python</a></li>
-      <li><a href="q/index.html">Q</a></li>
-      <li><a href="r/index.html">R</a></li>
-      <li><a href="rpm/index.html">RPM</a></li>
-      <li><a href="rst/index.html">reStructuredText</a></li>
-      <li><a href="ruby/index.html">Ruby</a></li>
-      <li><a href="rust/index.html">Rust</a></li>
-      <li><a href="sas/index.html">SAS</a></li>
-      <li><a href="sass/index.html">Sass</a></li>
-      <li><a href="spreadsheet/index.html">Spreadsheet</a></li>
-      <li><a href="clike/scala.html">Scala</a></li>
-      <li><a href="scheme/index.html">Scheme</a></li>
-      <li><a href="css/scss.html">SCSS</a></li>
-      <li><a href="shell/index.html">Shell</a></li>
-      <li><a href="sieve/index.html">Sieve</a></li>
-      <li><a href="slim/index.html">Slim</a></li>
-      <li><a href="smalltalk/index.html">Smalltalk</a></li>
-      <li><a href="smarty/index.html">Smarty</a></li>
-      <li><a href="solr/index.html">Solr</a></li>
-      <li><a href="soy/index.html">Soy</a></li>
-      <li><a href="stylus/index.html">Stylus</a></li>
-      <li><a href="sql/index.html">SQL</a> (several dialects)</li>
-      <li><a href="sparql/index.html">SPARQL</a></li>
-      <li><a href="clike/index.html">Squirrel</a></li>
-      <li><a href="swift/index.html">Swift</a></li>
-      <li><a href="stex/index.html">sTeX, LaTeX</a></li>
-      <li><a href="tcl/index.html">Tcl</a></li>
-      <li><a href="textile/index.html">Textile</a></li>
-      <li><a href="tiddlywiki/index.html">Tiddlywiki</a></li>
-      <li><a href="tiki/index.html">Tiki wiki</a></li>
-      <li><a href="toml/index.html">TOML</a></li>
-      <li><a href="tornado/index.html">Tornado</a> (templating language)</li>
-      <li><a href="troff/index.html">troff</a> (for manpages)</li>
-      <li><a href="ttcn/index.html">TTCN</a></li>
-      <li><a href="ttcn-cfg/index.html">TTCN Configuration</a></li>
-      <li><a href="turtle/index.html">Turtle</a></li>
-      <li><a href="twig/index.html">Twig</a></li>
-      <li><a href="vb/index.html">VB.NET</a></li>
-      <li><a href="vbscript/index.html">VBScript</a></li>
-      <li><a href="velocity/index.html">Velocity</a></li>
-      <li><a href="verilog/index.html">Verilog/SystemVerilog</a></li>
-      <li><a href="vhdl/index.html">VHDL</a></li>
-      <li><a href="vue/index.html">Vue.js app</a></li>
-      <li><a href="webidl/index.html">Web IDL</a></li>
-      <li><a href="xml/index.html">XML/HTML</a></li>
-      <li><a href="xquery/index.html">XQuery</a></li>
-      <li><a href="yacas/index.html">Yacas</a></li>
-      <li><a href="yaml/index.html">YAML</a></li>
-      <li><a href="yaml-frontmatter/index.html">YAML frontmatter</a></li>
-      <li><a href="z80/index.html">Z80</a></li>
-    </ul>
-  </div>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/index.html.html
deleted file mode 100644
index 592a133d85a5f277bc415dbfdb6a56a9bb37ca26..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/index.html.html
+++ /dev/null
@@ -1,114 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: JavaScript mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="../../addon/comment/continuecomment.js"></script>
-<script src="../../addon/comment/comment.js"></script>
-<script src="javascript.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">JavaScript</a>
-  </ul>
-</div>
-
-<article>
-<h2>JavaScript mode</h2>
-
-
-<div><textarea id="code" name="code">
-// Demo code (the actual new parser character stream implementation)
-
-function StringStream(string) {
-  this.pos = 0;
-  this.string = string;
-}
-
-StringStream.prototype = {
-  done: function() {return this.pos >= this.string.length;},
-  peek: function() {return this.string.charAt(this.pos);},
-  next: function() {
-    if (this.pos &lt; this.string.length)
-      return this.string.charAt(this.pos++);
-  },
-  eat: function(match) {
-    var ch = this.string.charAt(this.pos);
-    if (typeof match == "string") var ok = ch == match;
-    else var ok = ch &amp;&amp; match.test ? match.test(ch) : match(ch);
-    if (ok) {this.pos++; return ch;}
-  },
-  eatWhile: function(match) {
-    var start = this.pos;
-    while (this.eat(match));
-    if (this.pos > start) return this.string.slice(start, this.pos);
-  },
-  backUp: function(n) {this.pos -= n;},
-  column: function() {return this.pos;},
-  eatSpace: function() {
-    var start = this.pos;
-    while (/\s/.test(this.string.charAt(this.pos))) this.pos++;
-    return this.pos - start;
-  },
-  match: function(pattern, consume, caseInsensitive) {
-    if (typeof pattern == "string") {
-      function cased(str) {return caseInsensitive ? str.toLowerCase() : str;}
-      if (cased(this.string).indexOf(cased(pattern), this.pos) == this.pos) {
-        if (consume !== false) this.pos += str.length;
-        return true;
-      }
-    }
-    else {
-      var match = this.string.slice(this.pos).match(pattern);
-      if (match &amp;&amp; consume !== false) this.pos += match[0].length;
-      return match;
-    }
-  }
-};
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        continueComments: "Enter",
-        extraKeys: {"Ctrl-Q": "toggleComment"}
-      });
-    </script>
-
-    <p>
-      JavaScript mode supports several configuration options:
-      <ul>
-        <li><code>json</code> which will set the mode to expect JSON
-        data rather than a JavaScript program.</li>
-        <li><code>jsonld</code> which will set the mode to expect
-        <a href="http://json-ld.org">JSON-LD</a> linked data rather
-        than a JavaScript program (<a href="json-ld.html">demo</a>).</li>
-        <li><code>typescript</code> which will activate additional
-        syntax highlighting and some other things for TypeScript code
-        (<a href="typescript.html">demo</a>).</li>
-        <li><code>statementIndent</code> which (given a number) will
-        determine the amount of indentation to use for statements
-        continued on a new line.</li>
-        <li><code>wordCharacters</code>, a regexp that indicates which
-        characters should be considered part of an identifier.
-        Defaults to <code>/[\w$]/</code>, which does not handle
-        non-ASCII identifiers. Can be set to something more elaborate
-        to improve Unicode support.</li>
-      </ul>
-    </p>
-
-    <p><strong>MIME types defined:</strong> <code>text/javascript</code>, <code>application/json</code>, <code>application/ld+json</code>, <code>text/typescript</code>, <code>application/typescript</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/javascript.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/javascript.js.js
index e1a19ce817dd1341e42c7ed5ffa81ea9f838f1c5..fe39eb1440e9e34be5da0c92be38f4ae139539eb 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/javascript.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/javascript.js.js
@@ -11,11 +11,6 @@
 })(function(CodeMirror) {
 "use strict";
 
-function expressionAllowed(stream, state, backUp) {
-  return /^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
-    (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
-}
-
 CodeMirror.defineMode("javascript", function(config, parserConfig) {
   var indentUnit = config.indentUnit;
   var statementIndent = parserConfig.statementIndent;
@@ -28,56 +23,24 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
 
   var keywords = function(){
     function kw(type) {return {type: type, style: "keyword"};}
-    var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c");
+    var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d");
     var operator = kw("operator"), atom = {type: "atom", style: "atom"};
 
-    var jsKeywords = {
+    return {
       "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B,
-      "return": C, "break": C, "continue": C, "new": kw("new"), "delete": C, "throw": C, "debugger": C,
-      "var": kw("var"), "const": kw("var"), "let": kw("var"),
+      "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C,
+      "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"),
       "function": kw("function"), "catch": kw("catch"),
       "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"),
       "in": operator, "typeof": operator, "instanceof": operator,
       "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom,
       "this": kw("this"), "class": kw("class"), "super": kw("atom"),
       "yield": C, "export": kw("export"), "import": kw("import"), "extends": C,
-      "await": C, "async": kw("async")
+      "await": C
     };
-
-    // Extend the 'normal' keywords with the TypeScript language extensions
-    if (isTS) {
-      var type = {type: "variable", style: "variable-3"};
-      var tsKeywords = {
-        // object-like things
-        "interface": kw("class"),
-        "implements": C,
-        "namespace": C,
-        "module": kw("module"),
-        "enum": kw("module"),
-        "type": kw("type"),
-
-        // scope modifiers
-        "public": kw("modifier"),
-        "private": kw("modifier"),
-        "protected": kw("modifier"),
-        "abstract": kw("modifier"),
-
-        // operators
-        "as": operator,
-
-        // types
-        "string": type, "number": type, "boolean": type, "any": type
-      };
-
-      for (var attr in tsKeywords) {
-        jsKeywords[attr] = tsKeywords[attr];
-      }
-    }
-
-    return jsKeywords;
   }();
 
-  var isOperatorChar = /[+\-*&%=<>!?|~^]/;
+  var isOperatorChar = /[+\-*&%=<>!?|~^@]/;
   var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;
 
   function readRegexp(stream) {
@@ -136,7 +99,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
         stream.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/);
         return ret("regexp", "string-2");
       } else {
-        stream.eatWhile(isOperatorChar);
+        stream.eat("=");
         return ret("operator", "operator", stream.current());
       }
     } else if (ch == "`") {
@@ -146,14 +109,27 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       stream.skipToEnd();
       return ret("error", "error");
     } else if (isOperatorChar.test(ch)) {
-      if (ch != ">" || !state.lexical || state.lexical.type != ">")
-        stream.eatWhile(isOperatorChar);
+      if (ch != ">" || !state.lexical || state.lexical.type != ">") {
+        if (stream.eat("=")) {
+          if (ch == "!" || ch == "=") stream.eat("=")
+        } else if (/[<>*+\-]/.test(ch)) {
+          stream.eat(ch)
+          if (ch == ">") stream.eat(ch)
+        }
+      }
       return ret("operator", "operator", stream.current());
     } else if (wordRE.test(ch)) {
       stream.eatWhile(wordRE);
-      var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word];
-      return (known && state.lastType != ".") ? ret(known.type, known.style, word) :
-                     ret("variable", "variable", word);
+      var word = stream.current()
+      if (state.lastType != ".") {
+        if (keywords.propertyIsEnumerable(word)) {
+          var kw = keywords[word]
+          return ret(kw.type, kw.style, word)
+        }
+        if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\(\w]/, false))
+          return ret("async", "keyword", word)
+      }
+      return ret("variable", "variable", word)
     }
   }
 
@@ -307,6 +283,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     }
   }
 
+  function isModifier(name) {
+    return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly"
+  }
+
   // Combinators
 
   var defaultVars = {name: "this", next: {name: "arguments"}};
@@ -352,6 +332,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex);
     if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex);
     if (type == "keyword b") return cont(pushlex("form"), statement, poplex);
+    if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex);
+    if (type == "debugger") return cont(expect(";"));
     if (type == "{") return cont(pushlex("}"), block, poplex);
     if (type == ";") return cont();
     if (type == "if") {
@@ -361,59 +343,70 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     }
     if (type == "function") return cont(functiondef);
     if (type == "for") return cont(pushlex("form"), forspec, statement, poplex);
-    if (type == "variable") return cont(pushlex("stat"), maybelabel);
-    if (type == "switch") return cont(pushlex("form"), parenExpr, pushlex("}", "switch"), expect("{"),
+    if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), className, poplex); }
+    if (type == "variable") {
+      if (isTS && value == "declare") {
+        cx.marked = "keyword"
+        return cont(statement)
+      } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) {
+        cx.marked = "keyword"
+        if (value == "enum") return cont(enumdef);
+        else if (value == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
+        else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex)
+      } else if (isTS && value == "namespace") {
+        cx.marked = "keyword"
+        return cont(pushlex("form"), expression, block, poplex)
+      } else {
+        return cont(pushlex("stat"), maybelabel);
+      }
+    }
+    if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"),
                                       block, poplex, poplex);
     if (type == "case") return cont(expression, expect(":"));
     if (type == "default") return cont(expect(":"));
     if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
                                      statement, poplex, popcontext);
-    if (type == "class") return cont(pushlex("form"), className, poplex);
     if (type == "export") return cont(pushlex("stat"), afterExport, poplex);
     if (type == "import") return cont(pushlex("stat"), afterImport, poplex);
-    if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex)
-    if (type == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";"));
     if (type == "async") return cont(statement)
+    if (value == "@") return cont(expression, statement)
     return pass(pushlex("stat"), expression, expect(";"), poplex);
   }
-  function expression(type) {
-    return expressionInner(type, false);
+  function expression(type, value) {
+    return expressionInner(type, value, false);
   }
-  function expressionNoComma(type) {
-    return expressionInner(type, true);
+  function expressionNoComma(type, value) {
+    return expressionInner(type, value, true);
   }
   function parenExpr(type) {
     if (type != "(") return pass()
     return cont(pushlex(")"), expression, expect(")"), poplex)
   }
-  function expressionInner(type, noComma) {
+  function expressionInner(type, value, noComma) {
     if (cx.state.fatArrowAt == cx.stream.start) {
       var body = noComma ? arrowBodyNoComma : arrowBody;
-      if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext);
+      if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext);
       else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext);
     }
 
     var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma;
     if (atomicTypes.hasOwnProperty(type)) return cont(maybeop);
     if (type == "function") return cont(functiondef, maybeop);
-    if (type == "class") return cont(pushlex("form"), classExpression, poplex);
-    if (type == "keyword c" || type == "async") return cont(noComma ? maybeexpressionNoComma : maybeexpression);
+    if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); }
+    if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression);
     if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop);
     if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression);
     if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop);
     if (type == "{") return contCommasep(objprop, "}", null, maybeop);
     if (type == "quasi") return pass(quasi, maybeop);
     if (type == "new") return cont(maybeTarget(noComma));
+    if (type == "import") return cont(expression);
     return cont();
   }
   function maybeexpression(type) {
     if (type.match(/[;\}\)\],]/)) return pass();
     return pass(expression);
   }
-  function maybeexpressionNoComma(type) {
-    if (type.match(/[;\}\)\],]/)) return pass();
-    return pass(expressionNoComma);
-  }
 
   function maybeoperatorComma(type, value) {
     if (type == ",") return cont(expression);
@@ -424,7 +417,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     var expr = noComma == false ? expression : expressionNoComma;
     if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext);
     if (type == "operator") {
-      if (/\+\+|--/.test(value)) return cont(me);
+      if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me);
+      if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false))
+        return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me);
       if (value == "?") return cont(expression, expect(":"), expr);
       return cont(expr);
     }
@@ -433,6 +428,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     if (type == "(") return contCommasep(expressionNoComma, ")", "call", me);
     if (type == ".") return cont(property, me);
     if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me);
+    if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) }
+    if (type == "regexp") {
+      cx.state.lastType = cx.marked = "operator"
+      cx.stream.backUp(cx.stream.pos - cx.stream.start - 1)
+      return cont(expr)
+    }
   }
   function quasi(type, value) {
     if (type != "quasi") return pass();
@@ -457,6 +458,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   function maybeTarget(noComma) {
     return function(type) {
       if (type == ".") return cont(noComma ? targetNoComma : target);
+      else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma)
       else return pass(noComma ? expressionNoComma : expression);
     };
   }
@@ -480,18 +482,25 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     } else if (type == "variable" || cx.style == "keyword") {
       cx.marked = "property";
       if (value == "get" || value == "set") return cont(getterSetter);
+      var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params
+      if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false)))
+        cx.state.fatArrowAt = cx.stream.pos + m[0].length
       return cont(afterprop);
     } else if (type == "number" || type == "string") {
       cx.marked = jsonldMode ? "property" : (cx.style + " property");
       return cont(afterprop);
     } else if (type == "jsonld-keyword") {
       return cont(afterprop);
-    } else if (type == "modifier") {
+    } else if (isTS && isModifier(value)) {
+      cx.marked = "keyword"
       return cont(objprop)
     } else if (type == "[") {
-      return cont(expression, expect("]"), afterprop);
+      return cont(expression, maybetype, expect("]"), afterprop);
     } else if (type == "spread") {
-      return cont(expression);
+      return cont(expressionNoComma, afterprop);
+    } else if (value == "*") {
+      cx.marked = "keyword";
+      return cont(objprop);
     } else if (type == ":") {
       return pass(afterprop)
     }
@@ -538,10 +547,30 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       if (value == "?") return cont(maybetype);
     }
   }
-  function typeexpr(type) {
-    if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);}
+  function mayberettype(type) {
+    if (isTS && type == ":") {
+      if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr)
+      else return cont(typeexpr)
+    }
+  }
+  function isKW(_, value) {
+    if (value == "is") {
+      cx.marked = "keyword"
+      return cont()
+    }
+  }
+  function typeexpr(type, value) {
+    if (value == "keyof" || value == "typeof") {
+      cx.marked = "keyword"
+      return cont(value == "keyof" ? typeexpr : expression)
+    }
+    if (type == "variable" || value == "void") {
+      cx.marked = "type"
+      return cont(afterType)
+    }
     if (type == "string" || type == "number" || type == "atom") return cont(afterType);
-    if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex)
+    if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType)
+    if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType)
     if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
   }
   function maybeReturnType(type) {
@@ -555,6 +584,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       return cont(typeprop)
     } else if (type == ":") {
       return cont(typeexpr)
+    } else if (type == "[") {
+      return cont(expression, maybetype, expect("]"), typeprop)
     }
   }
   function typearg(type) {
@@ -563,14 +594,25 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   }
   function afterType(type, value) {
     if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
-    if (value == "|" || type == ".") return cont(typeexpr)
+    if (value == "|" || type == "." || value == "&") return cont(typeexpr)
     if (type == "[") return cont(expect("]"), afterType)
+    if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) }
+  }
+  function maybeTypeArgs(_, value) {
+    if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
+  }
+  function typeparam() {
+    return pass(typeexpr, maybeTypeDefault)
+  }
+  function maybeTypeDefault(_, value) {
+    if (value == "=") return cont(typeexpr)
   }
-  function vardef() {
+  function vardef(_, value) {
+    if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)}
     return pass(pattern, maybetype, maybeAssign, vardefCont);
   }
   function pattern(type, value) {
-    if (type == "modifier") return cont(pattern)
+    if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) }
     if (type == "variable") { register(value); return cont(); }
     if (type == "spread") return cont(pattern);
     if (type == "[") return contCommasep(pattern, "]");
@@ -595,7 +637,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   function maybeelse(type, value) {
     if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex);
   }
-  function forspec(type) {
+  function forspec(type, value) {
+    if (value == "await") return cont(forspec);
     if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex);
   }
   function forspec1(type) {
@@ -619,10 +662,13 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   function functiondef(type, value) {
     if (value == "*") {cx.marked = "keyword"; return cont(functiondef);}
     if (type == "variable") {register(value); return cont(functiondef);}
-    if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, maybetype, statement, popcontext);
+    if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext);
+    if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef)
   }
-  function funarg(type) {
+  function funarg(type, value) {
+    if (value == "@") cont(expression, funarg)
     if (type == "spread") return cont(funarg);
+    if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); }
     return pass(pattern, maybetype, maybeAssign);
   }
   function classExpression(type, value) {
@@ -634,33 +680,39 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     if (type == "variable") {register(value); return cont(classNameAfter);}
   }
   function classNameAfter(type, value) {
-    if (value == "extends" || value == "implements" || (isTS && type == ","))
+    if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter)
+    if (value == "extends" || value == "implements" || (isTS && type == ",")) {
+      if (value == "implements") cx.marked = "keyword";
       return cont(isTS ? typeexpr : expression, classNameAfter);
+    }
     if (type == "{") return cont(pushlex("}"), classBody, poplex);
   }
   function classBody(type, value) {
+    if (type == "async" ||
+        (type == "variable" &&
+         (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) &&
+         cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) {
+      cx.marked = "keyword";
+      return cont(classBody);
+    }
     if (type == "variable" || cx.style == "keyword") {
-      if ((value == "async" || value == "static" || value == "get" || value == "set" ||
-           (isTS && (value == "public" || value == "private" || value == "protected" || value == "readonly" || value == "abstract"))) &&
-          cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) {
-        cx.marked = "keyword";
-        return cont(classBody);
-      }
       cx.marked = "property";
       return cont(isTS ? classfield : functiondef, classBody);
     }
     if (type == "[")
-      return cont(expression, expect("]"), isTS ? classfield : functiondef, classBody)
+      return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody)
     if (value == "*") {
       cx.marked = "keyword";
       return cont(classBody);
     }
     if (type == ";") return cont(classBody);
     if (type == "}") return cont();
+    if (value == "@") return cont(expression, classBody)
   }
   function classfield(type, value) {
     if (value == "?") return cont(classfield)
     if (type == ":") return cont(typeexpr, maybeAssign)
+    if (value == "=") return cont(expressionNoComma)
     return pass(functiondef)
   }
   function afterExport(type, value) {
@@ -675,6 +727,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
   }
   function afterImport(type) {
     if (type == "string") return cont();
+    if (type == "(") return pass(expression);
     return pass(importSpec, maybeMoreImports, maybeFrom);
   }
   function importSpec(type, value) {
@@ -696,6 +749,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     if (type == "]") return cont();
     return pass(commasep(expressionNoComma, "]"));
   }
+  function enumdef() {
+    return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex)
+  }
+  function enummember() {
+    return pass(pattern, maybeAssign);
+  }
 
   function isContinuedStatement(state, textAfter) {
     return state.lastType == "operator" || state.lastType == "," ||
@@ -703,6 +762,12 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
       /[,.]/.test(textAfter.charAt(0));
   }
 
+  function expressionAllowed(stream, state, backUp) {
+    return state.tokenize == tokenBase &&
+      /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
+      (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
+  }
+
   // Interface
 
   return {
@@ -768,6 +833,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     electricInput: /^\s*(?:case .*?:|default:|\{|\})$/,
     blockCommentStart: jsonMode ? null : "/*",
     blockCommentEnd: jsonMode ? null : "*/",
+    blockCommentContinue: jsonMode ? null : " * ",
     lineComment: jsonMode ? null : "//",
     fold: "brace",
     closeBrackets: "()[]{}''\"\"``",
@@ -777,6 +843,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
     jsonMode: jsonMode,
 
     expressionAllowed: expressionAllowed,
+
     skipExpression: function(state) {
       var top = state.cc[state.cc.length - 1]
       if (top == expression || top == expressionNoComma) state.cc.pop()
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.xml
index 00c89c6dfde854579659d1ff7d42def3d8b1130c..4616f35a8c8fd6a2e0638322a98639e666653e7c 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.xml
@@ -2,29 +2,51 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>json-ld.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
+            <key> <string>_bind_names</string> </key>
             <value>
-              <dictionary/>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
             </value>
         </item>
         <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>json-ld.html</string> </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>iso-8859-15</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.zpt
similarity index 93%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.html
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.zpt
index 3a37f0bce60ddf79b1eb49d0823e2ec78d7b9eeb..183da96159ac22d8bc98e389e820752f41608299 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.html
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/json-ld.html.zpt
@@ -1,72 +1,72 @@
-<!doctype html>
-
-<title>CodeMirror: JSON-LD mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="../../addon/comment/continuecomment.js"></script>
-<script src="../../addon/comment/comment.js"></script>
-<script src="javascript.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id="nav">
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"/></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">JSON-LD</a>
-  </ul>
-</div>
-
-<article>
-<h2>JSON-LD mode</h2>
-
-
-<div><textarea id="code" name="code">
-{
-  "@context": {
-    "name": "http://schema.org/name",
-    "description": "http://schema.org/description",
-    "image": {
-      "@id": "http://schema.org/image",
-      "@type": "@id"
-    },
-    "geo": "http://schema.org/geo",
-    "latitude": {
-      "@id": "http://schema.org/latitude",
-      "@type": "xsd:float"
-    },
-    "longitude": {
-      "@id": "http://schema.org/longitude",
-      "@type": "xsd:float"
-    },
-    "xsd": "http://www.w3.org/2001/XMLSchema#"
-  },
-  "name": "The Empire State Building",
-  "description": "The Empire State Building is a 102-story landmark in New York City.",
-  "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
-  "geo": {
-    "latitude": "40.75",
-    "longitude": "73.98"
-  }
-}
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        matchBrackets: true,
-        autoCloseBrackets: true,
-        mode: "application/ld+json",
-        lineWrapping: true
-      });
-    </script>
-    
-    <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
-  </article>
+<!doctype html>
+
+<title>CodeMirror: JSON-LD mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="../../addon/cm_edit/matchbrackets.js"></script>
+<script src="../../addon/comment/continuecomment.js"></script>
+<script src="../../addon/comment/comment.js"></script>
+<script src="javascript.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id="nav">
+  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"/></a>
+
+  <ul>
+    <li><a href="../../index.html">Home</a>
+    <li><a href="../../doc/manual.html">Manual</a>
+    <li><a href="https://github.com/codemirror/codemirror">Code</a>
+  </ul>
+  <ul>
+    <li><a href="../index.html">Language modes</a>
+    <li><a class=active href="#">JSON-LD</a>
+  </ul>
+</div>
+
+<article>
+<h2>JSON-LD mode</h2>
+
+
+<div><textarea id="code" name="code">
+{
+  "@context": {
+    "name": "http://schema.org/name",
+    "description": "http://schema.org/description",
+    "image": {
+      "@id": "http://schema.org/image",
+      "@type": "@id"
+    },
+    "geo": "http://schema.org/geo",
+    "latitude": {
+      "@id": "http://schema.org/latitude",
+      "@type": "xsd:float"
+    },
+    "longitude": {
+      "@id": "http://schema.org/longitude",
+      "@type": "xsd:float"
+    },
+    "xsd": "http://www.w3.org/2001/XMLSchema#"
+  },
+  "name": "The Empire State Building",
+  "description": "The Empire State Building is a 102-story landmark in New York City.",
+  "image": "http://www.civil.usherbrooke.ca/cours/gci215a/empire-state-building.jpg",
+  "geo": {
+    "latitude": "40.75",
+    "longitude": "73.98"
+  }
+}
+</textarea></div>
+
+    <script>
+      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+        matchBrackets: true,
+        autoCloseBrackets: true,
+        mode: "application/ld+json",
+        lineWrapping: true
+      });
+    </script>
+    
+    <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
+  </article>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/test.js.js
index 336c18747cbbcbb9b3c9327222392d0ea87258ad..f770bd77f6b1ed48cd3d80c68ce030e8a7d16cca 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/test.js.js
@@ -63,6 +63,12 @@
   MT("import_trailing_comma",
      "[keyword import] {[def foo], [def bar],} [keyword from] [string 'baz']")
 
+  MT("import_dynamic",
+     "[keyword import]([string 'baz']).[property then]")
+
+  MT("import_dynamic",
+     "[keyword const] [def t] [operator =] [keyword import]([string 'baz']).[property then]")
+
   MT("const",
      "[keyword function] [def f]() {",
      "  [keyword const] [[ [def a], [def b] ]] [operator =] [[ [number 1], [number 2] ]];",
@@ -71,6 +77,9 @@
   MT("for/of",
      "[keyword for]([keyword let] [def of] [keyword of] [variable something]) {}");
 
+  MT("for await",
+     "[keyword for] [keyword await]([keyword let] [def of] [keyword of] [variable something]) {}");
+
   MT("generator",
      "[keyword function*] [def repeat]([def n]) {",
      "  [keyword for]([keyword var] [def i] [operator =] [number 0]; [variable-2 i] [operator <] [variable-2 n]; [operator ++][variable-2 i])",
@@ -226,21 +235,47 @@
      "  [property method]: [string 'GET']",
      "});");
 
+  MT("async_variable",
+     "[keyword const] [def async] [operator =] {[property a]: [number 1]};",
+     "[keyword const] [def foo] [operator =] [string-2 `bar ${][variable async].[property a][string-2 }`];")
+
+  MT("async_comment",
+     "[keyword async] [comment /**/] [keyword function] [def foo]([def args]) { [keyword return] [atom true]; }");
+
+  MT("indent_switch",
+     "[keyword switch] ([variable x]) {",
+     "  [keyword default]:",
+     "    [keyword return] [number 2]",
+     "}")
+
+  MT("regexp_corner_case",
+     "[operator +]{} [operator /] [atom undefined];",
+     "[[[meta ...][string-2 /\\//] ]];",
+     "[keyword void] [string-2 /\\//];",
+     "[keyword do] [string-2 /\\//]; [keyword while] ([number 0]);",
+     "[keyword if] ([number 0]) {} [keyword else] [string-2 /\\//];",
+     "[string-2 `${][variable async][operator ++][string-2 }//`];",
+     "[string-2 `${]{} [operator /] [string-2 /\\//}`];")
+
+  MT("return_eol",
+     "[keyword return]",
+     "{} [string-2 /5/]")
+
   var ts_mode = CodeMirror.getMode({indentUnit: 2}, "application/typescript")
   function TS(name) {
     test.mode(name, ts_mode, Array.prototype.slice.call(arguments, 1))
   }
 
-  TS("extend_type",
-     "[keyword class] [def Foo] [keyword extends] [variable-3 Some][operator <][variable-3 Type][operator >] {}")
+  TS("typescript_extend_type",
+     "[keyword class] [def Foo] [keyword extends] [type Some][operator <][type Type][operator >] {}")
 
-  TS("arrow_type",
-     "[keyword let] [def x]: ([variable arg]: [variable-3 Type]) [operator =>] [variable-3 ReturnType]")
+  TS("typescript_arrow_type",
+     "[keyword let] [def x]: ([variable arg]: [type Type]) [operator =>] [type ReturnType]")
 
   TS("typescript_class",
      "[keyword class] [def Foo] {",
      "  [keyword public] [keyword static] [property main]() {}",
-     "  [keyword private] [property _foo]: [variable-3 string];",
+     "  [keyword private] [property _foo]: [type string];",
      "}")
 
   TS("typescript_literal_types",
@@ -249,46 +284,124 @@
      "  [property truthy]: [string 'true'] [operator |] [number 1] [operator |] [atom true];",
      "  [property falsy]: [string 'false'] [operator |] [number 0] [operator |] [atom false];",
      "}",
-     "[keyword interface] [def MyInstance] [keyword extends] [variable-3 Sequelize].[variable-3 Instance] [operator <] [variable-3 MyAttributes] [operator >] {",
-     "  [property rawAttributes]: [variable-3 MyAttributes];",
+     "[keyword interface] [def MyInstance] [keyword extends] [type Sequelize].[type Instance] [operator <] [type MyAttributes] [operator >] {",
+     "  [property rawAttributes]: [type MyAttributes];",
      "  [property truthy]: [string 'true'] [operator |] [number 1] [operator |] [atom true];",
      "  [property falsy]: [string 'false'] [operator |] [number 0] [operator |] [atom false];",
      "}")
 
   TS("typescript_extend_operators",
      "[keyword export] [keyword interface] [def UserModel] [keyword extends]",
-     "  [variable-3 Sequelize].[variable-3 Model] [operator <] [variable-3 UserInstance], [variable-3 UserAttributes] [operator >] {",
+     "  [type Sequelize].[type Model] [operator <] [type UserInstance], [type UserAttributes] [operator >] {",
      "    [property findById]: (",
-     "    [variable userId]: [variable-3 number]",
-     "    ) [operator =>] [variable-3 Promise] [operator <] [variable-3 Array] [operator <] { [property id], [property name] } [operator >>];",
+     "    [variable userId]: [type number]",
+     "    ) [operator =>] [type Promise] [operator <] [type Array] [operator <] { [property id], [property name] } [operator >>];",
      "    [property updateById]: (",
-     "    [variable userId]: [variable-3 number],",
-     "    [variable isActive]: [variable-3 boolean]",
-     "    ) [operator =>] [variable-3 Promise] [operator <] [variable-3 AccountHolderNotificationPreferenceInstance] [operator >];",
+     "    [variable userId]: [type number],",
+     "    [variable isActive]: [type boolean]",
+     "    ) [operator =>] [type Promise] [operator <] [type AccountHolderNotificationPreferenceInstance] [operator >];",
      "  }")
 
   TS("typescript_interface_with_const",
      "[keyword const] [def hello]: {",
-     "  [property prop1][operator ?]: [variable-3 string];",
-     "  [property prop2][operator ?]: [variable-3 string];",
+     "  [property prop1][operator ?]: [type string];",
+     "  [property prop2][operator ?]: [type string];",
      "} [operator =] {};")
 
   TS("typescript_double_extend",
      "[keyword export] [keyword interface] [def UserAttributes] {",
-     "  [property id][operator ?]: [variable-3 number];",
-     "  [property createdAt][operator ?]: [variable-3 Date];",
+     "  [property id][operator ?]: [type number];",
+     "  [property createdAt][operator ?]: [type Date];",
      "}",
-     "[keyword export] [keyword interface] [def UserInstance] [keyword extends] [variable-3 Sequelize].[variable-3 Instance][operator <][variable-3 UserAttributes][operator >], [variable-3 UserAttributes] {",
-     "  [property id]: [variable-3 number];",
-     "  [property createdAt]: [variable-3 Date];",
+     "[keyword export] [keyword interface] [def UserInstance] [keyword extends] [type Sequelize].[type Instance][operator <][type UserAttributes][operator >], [type UserAttributes] {",
+     "  [property id]: [type number];",
+     "  [property createdAt]: [type Date];",
      "}");
 
   TS("typescript_index_signature",
      "[keyword interface] [def A] {",
-     "  [[ [variable prop]: [variable-3 string] ]]: [variable-3 any];",
-     "  [property prop1]: [variable-3 any];",
+     "  [[ [variable prop]: [type string] ]]: [type any];",
+     "  [property prop1]: [type any];",
      "}");
 
+  TS("typescript_generic_class",
+     "[keyword class] [def Foo][operator <][type T][operator >] {",
+     "  [property bar]() {}",
+     "  [property foo](): [type Foo] {}",
+     "}")
+
+  TS("typescript_type_when_keyword",
+     "[keyword export] [keyword type] [type AB] [operator =] [type A] [operator |] [type B];",
+     "[keyword type] [type Flags] [operator =] {",
+     "  [property p1]: [type string];",
+     "  [property p2]: [type boolean];",
+     "};")
+
+  TS("typescript_type_when_not_keyword",
+     "[keyword class] [def HasType] {",
+     "  [property type]: [type string];",
+     "  [property constructor]([def type]: [type string]) {",
+     "    [keyword this].[property type] [operator =] [variable-2 type];",
+     "  }",
+     "  [property setType]({ [def type] }: { [property type]: [type string]; }) {",
+     "    [keyword this].[property type] [operator =] [variable-2 type];",
+     "  }",
+     "}")
+
+  TS("typescript_function_generics",
+     "[keyword function] [def a]() {}",
+     "[keyword function] [def b][operator <][type IA] [keyword extends] [type object], [type IB] [keyword extends] [type object][operator >]() {}",
+     "[keyword function] [def c]() {}")
+
+  TS("typescript_complex_return_type",
+     "[keyword function] [def A]() {",
+     "  [keyword return] [keyword this].[property property];",
+     "}",
+     "[keyword function] [def B](): [type Promise][operator <]{ [[ [variable key]: [type string] ]]: [type any] } [operator |] [atom null][operator >] {",
+     "  [keyword return] [keyword this].[property property];",
+     "}")
+
+  TS("typescript_complex_type_casting",
+     "[keyword const] [def giftpay] [operator =] [variable config].[property get]([string 'giftpay']) [keyword as] { [[ [variable platformUuid]: [type string] ]]: { [property version]: [type number]; [property apiCode]: [type string]; } };")
+
+  TS("typescript_keyof",
+     "[keyword function] [def x][operator <][type T] [keyword extends] [keyword keyof] [type X][operator >]([def a]: [type T]) {",
+     "  [keyword return]")
+
+  TS("typescript_new_typeargs",
+     "[keyword let] [def x] [operator =] [keyword new] [variable Map][operator <][type string], [type Date][operator >]([string-2 `foo${][variable bar][string-2 }`])")
+
+  TS("modifiers",
+     "[keyword class] [def Foo] {",
+     "  [keyword public] [keyword abstract] [property bar]() {}",
+     "  [property constructor]([keyword readonly] [keyword private] [def x]) {}",
+     "}")
+
+  TS("arrow prop",
+     "({[property a]: [def p] [operator =>] [variable-2 p]})")
+
+  TS("generic in function call",
+     "[keyword this].[property a][operator <][type Type][operator >]([variable foo]);",
+     "[keyword this].[property a][operator <][variable Type][operator >][variable foo];")
+
+  TS("type guard",
+     "[keyword class] [def Appler] {",
+     "  [keyword static] [property assertApple]([def fruit]: [type Fruit]): [variable-2 fruit] [keyword is] [type Apple] {",
+     "    [keyword if] ([operator !]([variable-2 fruit] [keyword instanceof] [variable Apple]))",
+     "      [keyword throw] [keyword new] [variable Error]();",
+     "  }",
+     "}")
+
+  TS("type as variable",
+     "[variable type] [operator =] [variable x] [keyword as] [type Bar];");
+
+  TS("enum body",
+     "[keyword export] [keyword const] [keyword enum] [def CodeInspectionResultType] {",
+     "  [def ERROR] [operator =] [string 'problem_type_error'],",
+     "  [def WARNING] [operator =] [string 'problem_type_warning'],",
+     "  [def META],",
+     "}")
+
   var jsonld_mode = CodeMirror.getMode(
     {indentUnit: 2},
     {name: "javascript", jsonld: true}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.xml
index e9fe2893881f867abcd13fe9fede45453b01475e..e30c0aa2ea9121efedde71e32a71ccee3fcd72d5 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.xml
@@ -2,29 +2,51 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>typescript.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
+            <key> <string>_bind_names</string> </key>
             <value>
-              <dictionary/>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
             </value>
         </item>
         <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>typescript.html</string> </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>iso-8859-15</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.zpt
similarity index 95%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.html
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.zpt
index 1f26d7fe1b8824c46e19b1aa256e4417aafd3850..de3a6611bf37920e367604a1e2f3ca0b605267b9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.html
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/javascript/typescript.html.zpt
@@ -1,61 +1,61 @@
-<!doctype html>
-
-<title>CodeMirror: TypeScript mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="javascript.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">TypeScript</a>
-  </ul>
-</div>
-
-<article>
-<h2>TypeScript mode</h2>
-
-
-<div><textarea id="code" name="code">
-class Greeter {
-  greeting: string;
-  constructor (message: string) {
-    this.greeting = message;
-  }
-  greet() {
-    return "Hello, " + this.greeting;
-  }
-}   
-
-var greeter = new Greeter("world");
-
-var button = document.createElement('button')
-button.innerText = "Say Hello"
-button.onclick = function() {
-  alert(greeter.greet())
-}
-
-document.body.appendChild(button)
-
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/typescript"
-      });
-    </script>
-
-    <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
-  </article>
+<!doctype html>
+
+<title>CodeMirror: TypeScript mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+<link rel="stylesheet" href="../../lib/codemirror.css">
+<script src="../../lib/codemirror.js"></script>
+<script src="javascript.js"></script>
+<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+<div id=nav>
+  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
+
+  <ul>
+    <li><a href="../../index.html">Home</a>
+    <li><a href="../../doc/manual.html">Manual</a>
+    <li><a href="https://github.com/codemirror/codemirror">Code</a>
+  </ul>
+  <ul>
+    <li><a href="../index.html">Language modes</a>
+    <li><a class=active href="#">TypeScript</a>
+  </ul>
+</div>
+
+<article>
+<h2>TypeScript mode</h2>
+
+
+<div><textarea id="code" name="code">
+class Greeter {
+  greeting: string;
+  constructor (message: string) {
+    this.greeting = message;
+  }
+  greet() {
+    return "Hello, " + this.greeting;
+  }
+}   
+
+var greeter = new Greeter("world");
+
+var button = document.createElement('button')
+button.innerText = "Say Hello"
+button.onclick = function() {
+  alert(greeter.greet())
+}
+
+document.body.appendChild(button)
+
+</textarea></div>
+
+    <script>
+      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+        lineNumbers: true,
+        matchBrackets: true,
+        mode: "text/typescript"
+      });
+    </script>
+
+    <p>This is a specialization of the <a href="index.html">JavaScript mode</a>.</p>
+  </article>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/index.html.html
deleted file mode 100644
index 5a70e9153bbcdf97e2afb819e88a525f5096a8be..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/index.html.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Jinja2 mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="jinja2.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Jinja2</a>
-  </ul>
-</div>
-
-<article>
-<h2>Jinja2 mode</h2>
-<form><textarea id="code" name="code">
-{# this is a comment #}
-{%- for item in li -%}
-  &lt;li&gt;{{ item.label }}&lt;/li&gt;
-{% endfor -%}
-{{ item.sand == true and item.keyword == false ? 1 : 0 }}
-{{ app.get(55, 1.2, true) }}
-{% if app.get(&#39;_route&#39;) == (&#39;_home&#39;) %}home{% endif %}
-{% if app.session.flashbag.has(&#39;message&#39;) %}
-  {% for message in app.session.flashbag.get(&#39;message&#39;) %}
-    {{ message.content }}
-  {% endfor %}
-{% endif %}
-{{ path(&#39;_home&#39;, {&#39;section&#39;: app.request.get(&#39;section&#39;)}) }}
-{{ path(&#39;_home&#39;, {
-    &#39;section&#39;: app.request.get(&#39;section&#39;),
-    &#39;boolean&#39;: true,
-    &#39;number&#39;: 55.33
-  })
-}}
-{% include (&#39;test.incl.html.twig&#39;) %}
-</textarea></form>
-    <script>
-      var editor =
-      CodeMirror.fromTextArea(document.getElementById("code"), {mode:
-        {name: "jinja2", htmlMode: true}});
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/jinja2.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/jinja2.js.js
index ed195581cfb3d66f239c8edbf06849ead6a32445..5d57d134488f7babd33fd6cf672a5ce8ee053100 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/jinja2.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jinja2/jinja2.js.js
@@ -107,7 +107,7 @@
         }
         return "variable";
       } else if (stream.eat("{")) {
-        if (ch = stream.eat("#")) {
+        if (stream.eat("#")) {
           state.incomment = true;
           if(!stream.skipTo("#}")) {
             stream.skipToEnd();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/index.html.html
deleted file mode 100644
index 1054bbcc0a39f970c9a08557fa7881eb437f64bb..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/index.html.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: JSX mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="jsx.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">JSX</a>
-  </ul>
-</div>
-
-<article>
-<h2>JSX mode</h2>
-
-<div><textarea id="code" name="code">// Code snippets from http://facebook.github.io/react/docs/jsx-in-depth.html
-
-// Rendering HTML tags
-var myDivElement = <div className="foo" />;
-ReactDOM.render(myDivElement, document.getElementById('example'));
-
-// Rendering React components
-var MyComponent = React.createClass({/*...*/});
-var myElement = <MyComponent someProperty={true} />;
-ReactDOM.render(myElement, document.getElementById('example'));
-
-// Namespaced components
-var Form = MyFormComponent;
-
-var App = (
-  <Form>
-    <Form.Row>
-      <Form.Label />
-      <Form.Input />
-    </Form.Row>
-  </Form>
-);
-
-// Attribute JavaScript expressions
-var person = <Person name={window.isLoggedIn ? window.name : ''} />;
-
-// Boolean attributes
-<input type="button" disabled />;
-<input type="button" disabled={true} />;
-
-// Child JavaScript expressions
-var content = <Container>{window.isLoggedIn ? <Nav /> : <Login />}</Container>;
-
-// Comments
-var content = (
-  <Nav>
-    {/* child comment, put {} around */}
-    <Person
-      /* multi
-         line
-         comment */
-      name={window.isLoggedIn ? window.name : ''} // end of line comment
-    />
-  </Nav>
-);
-</textarea></div>
-
-<script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true,
-  mode: "jsx"
-})
-</script>
-
-<p>JSX Mode for <a href="http://facebook.github.io/react">React</a>'s
-JavaScript syntax extension.</p>
-
-<p><strong>MIME types defined:</strong> <code>text/jsx</code>, <code>text/typescript-jsx</code>.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/jsx.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/jsx.js.js
index 45c3024aba3038ad2e172f6641d0cc26b4c1c870..039e37bb5e1523d4b97a41f67c72672a93f772de 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/jsx.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/jsx.js.js
@@ -26,7 +26,7 @@
   }
 
   CodeMirror.defineMode("jsx", function(config, modeConfig) {
-    var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false})
+    var xmlMode = CodeMirror.getMode(config, {name: "xml", allowMissing: true, multilineTagIndentPastTag: false, allowMissingTagName: true})
     var jsMode = CodeMirror.getMode(config, modeConfig && modeConfig.base || "javascript")
 
     function flatXMLIndent(state) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/test.js.js
index c54a8b24c9fe692de92dbc24a14557826a06644a..891f98830d889e3a38d1ec91602d0d7168c38b19 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/jsx/test.js.js
@@ -11,6 +11,9 @@
   MT("openclose",
      "([bracket&tag <][tag foo][bracket&tag >]hello [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
 
+  MT("openclosefragment",
+     "([bracket&tag <><][tag foo][bracket&tag >]hello [atom &amp;][bracket&tag </][tag foo][bracket&tag ></>][operator ++])")
+
   MT("attr",
      "([bracket&tag <][tag foo] [attribute abc]=[string 'value'][bracket&tag >]hello [atom &amp;][bracket&tag </][tag foo][bracket&tag >][operator ++])")
 
@@ -33,6 +36,9 @@
   MT("preserve_js_context",
      "[variable x] [operator =] [string-2 `quasi${][bracket&tag <][tag foo][bracket&tag />][string-2 }quoted`]")
 
+  MT("string_interpolation",
+    "[variable x] [operator =] [string-2 `quasi<code>${] [number 10] [string-2 }</code>`]")
+
   MT("line_comment",
      "([bracket&tag <][tag foo] [comment // hello]",
      "   [bracket&tag ></][tag foo][bracket&tag >][operator ++])")
@@ -66,4 +72,20 @@
 
   MT("tag_attribute",
      "([bracket&tag <][tag foo] [attribute bar]=[bracket&tag <][tag foo][bracket&tag />/>][operator ++])")
+
+  var ts_mode = CodeMirror.getMode({indentUnit: 2}, "text/typescript-jsx")
+  function TS(name) { test.mode(name, ts_mode, Array.prototype.slice.call(arguments, 1)) }
+
+  TS("tsx_react_integration",
+     "[keyword interface] [def Props] {",
+     "  [property foo]: [type string];",
+     "}",
+     "[keyword class] [def MyComponent] [keyword extends] [type React].[type Component] [operator <] [type Props], [type any] [operator >] {",
+     "  [property render]() {",
+     "    [keyword return] [bracket&tag <][tag span][bracket&tag >]{[keyword this].[property props].[property foo]}[bracket&tag </][tag span][bracket&tag >]",
+     "  }",
+     "}",
+     "[bracket&tag <][tag MyComponent] [attribute foo]=[string \"bar\"] [bracket&tag />]; [comment //ok]",
+     "[bracket&tag <][tag MyComponent] [attribute foo]={[number 0]} [bracket&tag />]; [comment //error]")
+
 })()
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/index.html.html
deleted file mode 100644
index e1492c210fb6c77c62cc8302735b0ad196fa11b1..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/index.html.html
+++ /dev/null
@@ -1,195 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Julia mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="julia.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Julia</a>
-  </ul>
-</div>
-
-<article>
-<h2>Julia mode</h2>
-
-    <div><textarea id="code" name="code">
-#numbers
-1234
-1234im
-.234
-.234im
-2.23im
-2.3f3
-23e2
-0x234
-
-#strings
-'a'
-"asdf"
-r"regex"
-b"bytestring"
-
-"""
-multiline string
-"""
-
-#identifiers
-a
-as123
-function_name!
-
-#unicode identifiers
-# a = x\ddot
-a鈨� = x虉
-# a = v\dot
-a鈨� = v虈
-#F\vec = m \cdotp a\vec
-F鈨� = m路a鈨�
-
-#literal identifier multiples
-3x
-4[1, 2, 3]
-
-#dicts and indexing
-x=[1, 2, 3]
-x[end-1]
-x={"julia"=>"language of technical computing"}
-
-
-#exception handling
-try
-  f()
-catch
-  @printf "Error"
-finally
-  g()
-end
-
-#types
-immutable Color{T<:Number}
-  r::T
-  g::T
-  b::T
-end
-
-#functions
-function change!(x::Vector{Float64})
-  for i = 1:length(x)
-    x[i] *= 2
-  end
-end
-
-#function invocation
-f('b', (2, 3)...)
-
-#operators
-|=
-&=
-^=
-\-
-%=
-*=
-+=
--=
-<=
->=
-!=
-==
-%
-*
-+
--
-<
->
-!
-=
-|
-&
-^
-\
-?
-~
-:
-$
-<:
-.<
-.>
-<<
-<<=
->>
->>>>
->>=
->>>=
-<<=
-<<<=
-.<=
-.>=
-.==
-->
-//
-in
-...
-//
-:=
-.//=
-.*=
-./=
-.^=
-.%=
-.+=
-.-=
-\=
-\\=
-||
-===
-&&
-|=
-.|=
-<:
->:
-|>
-<|
-::
-x ? y : z
-
-#macros
-@spawnat 2 1+1
-@eval(:x)
-
-#keywords and operators
-if else elseif while for
- begin let end do
-try catch finally return break continue
-global local const 
-export import importall using
-function macro module baremodule 
-type immutable quote
-true false enumerate
-
-
-    </textarea></div>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "julia",
-               },
-        lineNumbers: true,
-        indentUnit: 4,
-        matchBrackets: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-julia</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/julia.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/julia.js.js
index 8fc999f5f91a43cdc0ac632d1bc60a42c0720526..9a36fd05a04f537c83612cee77efd83c23e44c8a 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/julia.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/julia/julia.js.js
@@ -23,29 +23,32 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
   var uChar = "([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";
 
   var operators = parserConf.operators || wordRegexp([
-      "\\.?[\\\\%*+\\-<>!=\\/^]=?", "\\.?[|&\\u00F7\\u2260\\u2264\\u2265]",
-      "\\u00D7", "\\u2208", "\\u2209", "\\u220B", "\\u220C", "\\u2229",
-      "\\u222A", "\\u2286", "\\u2288", "\\u228A", "\\u22c5", "\\?", "~", ":",
-      "\\$", "\\.[<>]", "<<=?", ">>>?=?", "\\.[<>=]=", "->?", "\\/\\/", "=>",
-      "<:", "\\bin\\b(?!\\()"], "");
+      "[<>]:", "[<>=]=", "<<=?", ">>>?=?", "=>", "->", "\\/\\/",
+      "[\\\\%*+\\-<>!=\\/^|&\\u00F7\\u22BB]=?", "\\?", "\\$", "~", ":",
+      "\\u00D7", "\\u2208", "\\u2209", "\\u220B", "\\u220C", "\\u2218",
+      "\\u221A", "\\u221B", "\\u2229", "\\u222A", "\\u2260", "\\u2264",
+      "\\u2265", "\\u2286", "\\u2288", "\\u228A", "\\u22C5",
+      "\\b(in|isa)\\b(?!\.?\\()"], "");
   var delimiters = parserConf.delimiters || /^[;,()[\]{}]/;
-  var identifiers = parserConf.identifiers || /^[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
+  var identifiers = parserConf.identifiers ||
+      /^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/;
 
   var chars = wordRegexp([octChar, hexChar, sChar, uChar], "'");
-  var openers = wordRegexp(["begin", "function", "type", "immutable", "let",
-      "macro", "for", "while", "quote", "if", "else", "elseif", "try",
+  var openers = wordRegexp(["begin", "function", "type", "struct", "immutable",
+      "let", "macro", "for", "while", "quote", "if", "else", "elseif", "try",
       "finally", "catch", "do"]);
   var closers = wordRegexp(["end", "else", "elseif", "catch", "finally"]);
   var keywords = wordRegexp(["if", "else", "elseif", "while", "for", "begin",
       "let", "end", "do", "try", "catch", "finally", "return", "break",
       "continue", "global", "local", "const", "export", "import", "importall",
-      "using", "function", "macro", "module", "baremodule", "type",
-      "immutable", "quote", "typealias", "abstract", "bitstype"]);
+      "using", "function", "where", "macro", "module", "baremodule", "struct",
+      "type", "mutable", "immutable", "quote", "typealias", "abstract",
+      "primitive", "bitstype"]);
   var builtins = wordRegexp(["true", "false", "nothing", "NaN", "Inf"]);
 
   var macro = /^@[_A-Za-z][\w]*/;
   var symbol = /^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;
-  var stringPrefixes = /^(`|"{3}|([_A-Za-z\u00A1-\uFFFF]*"))/;
+  var stringPrefixes = /^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;
 
   function inArray(state) {
     return inGenerator(state, '[')
@@ -90,7 +93,9 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
       }
     }
 
-    if (stream.match(/^\.{2,3}/)) {
+    if (stream.match(/\.{4,}/)) {
+      return "error";
+    } else if (stream.match(/\.{1,3}/)) {
       return "operator";
     }
 
@@ -128,15 +133,6 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
       state.leavingExpr = true;
     }
 
-    var match;
-    if (match = stream.match(openers, false)) {
-      state.scopes.push(match[0]);
-    }
-
-    if (stream.match(closers, false)) {
-      state.scopes.pop();
-    }
-
     if (inArray(state)) {
       if (state.lastToken == "end" && stream.match(/^:/)) {
         return "operator";
@@ -146,6 +142,15 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
       }
     }
 
+    var match;
+    if (match = stream.match(openers, false)) {
+      state.scopes.push(match[0]);
+    }
+
+    if (stream.match(closers, false)) {
+      state.scopes.pop();
+    }
+
     // Handle type annotations
     if (stream.match(/^::(?![:\$])/)) {
       state.tokenize = tokenAnnotation;
@@ -153,14 +158,15 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
     }
 
     // Handle symbols
-    if (!leavingExpr && stream.match(symbol) || stream.match(/:\./)) {
+    if (!leavingExpr && stream.match(symbol) ||
+        stream.match(/:([<>]:|<<=?|>>>?=?|->|\/\/|\.{2,3}|[\.\\%*+\-<>!\/^|&]=?|[~\?\$])/)) {
       return "builtin";
     }
 
     // Handle parametric types
-    if (stream.match(/^{[^}]*}(?=\()/)) {
-      return "builtin";
-    }
+    //if (stream.match(/^{[^}]*}(?=\()/)) {
+    //  return "builtin";
+    //}
 
     // Handle operators and Delimiters
     if (stream.match(operators)) {
@@ -168,7 +174,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
     }
 
     // Handle Number Literals
-    if (stream.match(/^[0-9\.]/, false)) {
+    if (stream.match(/^\.?\d/, false)) {
       var imMatcher = RegExp(/^im\b/);
       var numberLiteral = false;
       // Floats
@@ -221,7 +227,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
 
     var isDefinition = state.isDefinition || state.lastToken == "function" ||
                        state.lastToken == "macro" || state.lastToken == "type" ||
-                       state.lastToken == "immutable";
+                       state.lastToken == "struct" || state.lastToken == "immutable";
 
     if (stream.match(identifiers)) {
       if (isDefinition) {
@@ -233,7 +239,8 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
         return "def";
       }
       if (stream.match(/^({[^}]*})*\(/, false)) {
-        return callOrDef(stream, state);
+        state.tokenize = tokenCallOrDef;
+        return state.tokenize(stream, state);
       }
       state.leavingExpr = true;
       return "variable";
@@ -244,7 +251,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
     return "error";
   }
 
-  function callOrDef(stream, state) {
+  function tokenCallOrDef(stream, state) {
     var match = stream.match(/^(\(\s*)/);
     if (match) {
       if (state.firstParenPos < 0)
@@ -256,10 +263,11 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
       state.scopes.pop();
       state.charsAdvanced += 1;
       if (state.scopes.length <= state.firstParenPos) {
-        var isDefinition = stream.match(/^\s*?=(?!=)/, false);
+        var isDefinition = stream.match(/^(\s*where\s+[^\s=]+)*\s*?=(?!=)/, false);
         stream.backUp(state.charsAdvanced);
         state.firstParenPos = -1;
         state.charsAdvanced = 0;
+        state.tokenize = tokenBase;
         if (isDefinition)
           return "def";
         return "builtin";
@@ -274,10 +282,11 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
         state.scopes.pop();
       state.firstParenPos = -1;
       state.charsAdvanced = 0;
+      state.tokenize = tokenBase;
       return "builtin";
     }
     state.charsAdvanced += stream.match(/^([^()]*)/)[1].length;
-    return callOrDef(stream, state);
+    return state.tokenize(stream, state);
   }
 
   function tokenAnnotation(stream, state) {
@@ -288,7 +297,7 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
       state.nestedLevels--;
     }
     if (state.nestedLevels > 0) {
-      stream.match(/.*?(?={|})/);
+      stream.match(/.*?(?={|})/) || stream.next();
     } else if (state.nestedLevels == 0) {
       state.tokenize = tokenBase;
     }
@@ -338,7 +347,11 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
   }
 
   function tokenStringFactory(delimiter) {
-    delimiter = (delimiter === '`' || delimiter === '"""') ? delimiter : '"';
+    if (delimiter.substr(-3) === '"""') {
+      delimiter = '"""';
+    } else if (delimiter.substr(-1) === '"') {
+      delimiter = '"';
+    }
     function tokenString(stream, state) {
       if (stream.eat('\\')) {
         stream.next();
@@ -377,11 +390,6 @@ CodeMirror.defineMode("julia", function(config, parserConf) {
         state.lastToken = current;
       }
 
-      // Handle '.' connected identifiers
-      if (current === '.') {
-        style = stream.match(identifiers, false) || stream.match(macro, false) ||
-                stream.match(/\(/, false) ? "operator" : "error";
-      }
       return style;
     },
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/livescript/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/livescript/index.html.html
deleted file mode 100644
index f415479876a5878ff0dfb22a1f81ca89b1f94a99..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/livescript/index.html.html
+++ /dev/null
@@ -1,459 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: LiveScript mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/solarized.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="livescript.js"></script>
-<style>.CodeMirror {font-size: 80%;border-top: 1px solid silver; border-bottom: 1px solid silver;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">LiveScript</a>
-  </ul>
-</div>
-
-<article>
-<h2>LiveScript mode</h2>
-<form><textarea id="code" name="code">
-# LiveScript mode for CodeMirror
-# The following script, prelude.ls, is used to
-# demonstrate LiveScript mode for CodeMirror.
-#   https://github.com/gkz/prelude-ls
-
-export objToFunc = objToFunc = (obj) ->
-  (key) -> obj[key]
-
-export each = (f, xs) -->
-  if typeof! xs is \Object
-    for , x of xs then f x
-  else
-    for x in xs then f x
-  xs
-
-export map = (f, xs) -->
-  f = objToFunc f if typeof! f isnt \Function
-  type = typeof! xs
-  if type is \Object
-    {[key, f x] for key, x of xs}
-  else
-    result = [f x for x in xs]
-    if type is \String then result * '' else result
-
-export filter = (f, xs) -->
-  f = objToFunc f if typeof! f isnt \Function
-  type = typeof! xs
-  if type is \Object
-    {[key, x] for key, x of xs when f x}
-  else
-    result = [x for x in xs when f x]
-    if type is \String then result * '' else result
-
-export reject = (f, xs) -->
-  f = objToFunc f if typeof! f isnt \Function
-  type = typeof! xs
-  if type is \Object
-    {[key, x] for key, x of xs when not f x}
-  else
-    result = [x for x in xs when not f x]
-    if type is \String then result * '' else result
-
-export partition = (f, xs) -->
-  f = objToFunc f if typeof! f isnt \Function
-  type = typeof! xs
-  if type is \Object
-    passed = {}
-    failed = {}
-    for key, x of xs
-      (if f x then passed else failed)[key] = x
-  else
-    passed = []
-    failed = []
-    for x in xs
-      (if f x then passed else failed)push x
-    if type is \String
-      passed *= ''
-      failed *= ''
-  [passed, failed]
-
-export find = (f, xs) -->
-  f = objToFunc f if typeof! f isnt \Function
-  if typeof! xs is \Object
-    for , x of xs when f x then return x
-  else
-    for x in xs when f x then return x
-  void
-
-export head = export first = (xs) ->
-  return void if not xs.length
-  xs.0
-
-export tail = (xs) ->
-  return void if not xs.length
-  xs.slice 1
-
-export last = (xs) ->
-  return void if not xs.length
-  xs[*-1]
-
-export initial = (xs) ->
-  return void if not xs.length
-  xs.slice 0 xs.length - 1
-
-export empty = (xs) ->
-  if typeof! xs is \Object
-    for x of xs then return false
-    return yes
-  not xs.length
-
-export values = (obj) ->
-  [x for , x of obj]
-
-export keys = (obj) ->
-  [x for x of obj]
-
-export len = (xs) ->
-  xs = values xs if typeof! xs is \Object
-  xs.length
-
-export cons = (x, xs) -->
-  if typeof! xs is \String then x + xs else [x] ++ xs
-
-export append = (xs, ys) -->
-  if typeof! ys is \String then xs + ys else xs ++ ys
-
-export join = (sep, xs) -->
-  xs = values xs if typeof! xs is \Object
-  xs.join sep
-
-export reverse = (xs) ->
-  if typeof! xs is \String
-  then (xs / '')reverse! * ''
-  else xs.slice!reverse!
-
-export fold = export foldl = (f, memo, xs) -->
-  if typeof! xs is \Object
-    for , x of xs then memo = f memo, x
-  else
-    for x in xs then memo = f memo, x
-  memo
-
-export fold1 = export foldl1 = (f, xs) --> fold f, xs.0, xs.slice 1
-
-export foldr = (f, memo, xs) --> fold f, memo, xs.slice!reverse!
-
-export foldr1 = (f, xs) -->
-  xs.=slice!reverse!
-  fold f, xs.0, xs.slice 1
-
-export unfoldr = export unfold = (f, b) -->
-  if (f b)?
-    [that.0] ++ unfoldr f, that.1
-  else
-    []
-
-export andList = (xs) ->
-  for x in xs when not x
-    return false
-  true
-
-export orList = (xs) ->
-  for x in xs when x
-    return true
-  false
-
-export any = (f, xs) -->
-  f = objToFunc f if typeof! f isnt \Function
-  for x in xs when f x
-    return yes
-  no
-
-export all = (f, xs) -->
-  f = objToFunc f if typeof! f isnt \Function
-  for x in xs when not f x
-    return no
-  yes
-
-export unique = (xs) ->
-  result = []
-  if typeof! xs is \Object
-    for , x of xs when x not in result then result.push x
-  else
-    for x   in xs when x not in result then result.push x
-  if typeof! xs is \String then result * '' else result
-
-export sort = (xs) ->
-  xs.concat!sort (x, y) ->
-    | x > y =>  1
-    | x < y => -1
-    | _     =>  0
-
-export sortBy = (f, xs) -->
-  return [] unless xs.length
-  xs.concat!sort f
-
-export compare = (f, x, y) -->
-  | (f x) > (f y) =>  1
-  | (f x) < (f y) => -1
-  | otherwise     =>  0
-
-export sum = (xs) ->
-  result = 0
-  if typeof! xs is \Object
-    for , x of xs then result += x
-  else
-    for x   in xs then result += x
-  result
-
-export product = (xs) ->
-  result = 1
-  if typeof! xs is \Object
-    for , x of xs then result *= x
-  else
-    for x   in xs then result *= x
-  result
-
-export mean = export average = (xs) -> (sum xs) / len xs
-
-export concat = (xss) -> fold append, [], xss
-
-export concatMap = (f, xs) --> fold ((memo, x) -> append memo, f x), [], xs
-
-export listToObj = (xs) ->
-  {[x.0, x.1] for x in xs}
-
-export maximum = (xs) -> fold1 (>?), xs
-
-export minimum = (xs) -> fold1 (<?), xs
-
-export scan = export scanl = (f, memo, xs) -->
-  last = memo
-  if typeof! xs is \Object
-  then [memo] ++ [last = f last, x for , x of xs]
-  else [memo] ++ [last = f last, x for x in xs]
-
-export scan1 = export scanl1 = (f, xs) --> scan f, xs.0, xs.slice 1
-
-export scanr = (f, memo, xs) -->
-  xs.=slice!reverse!
-  scan f, memo, xs .reverse!
-
-export scanr1 = (f, xs) -->
-  xs.=slice!reverse!
-  scan f, xs.0, xs.slice 1 .reverse!
-
-export replicate = (n, x) -->
-  result = []
-  i = 0
-  while i < n, ++i then result.push x
-  result
-
-export take = (n, xs) -->
-  | n <= 0
-    if typeof! xs is \String then '' else []
-  | not xs.length => xs
-  | otherwise     => xs.slice 0, n
-
-export drop = (n, xs) -->
-  | n <= 0        => xs
-  | not xs.length => xs
-  | otherwise     => xs.slice n
-
-export splitAt = (n, xs) --> [(take n, xs), (drop n, xs)]
-
-export takeWhile = (p, xs) -->
-  return xs if not xs.length
-  p = objToFunc p if typeof! p isnt \Function
-  result = []
-  for x in xs
-    break if not p x
-    result.push x
-  if typeof! xs is \String then result * '' else result
-
-export dropWhile = (p, xs) -->
-  return xs if not xs.length
-  p = objToFunc p if typeof! p isnt \Function
-  i = 0
-  for x in xs
-    break if not p x
-    ++i
-  drop i, xs
-
-export span = (p, xs) --> [(takeWhile p, xs), (dropWhile p, xs)]
-
-export breakIt = (p, xs) --> span (not) << p, xs
-
-export zip = (xs, ys) -->
-  result = []
-  for zs, i in [xs, ys]
-    for z, j in zs
-      result.push [] if i is 0
-      result[j]?push z
-  result
-
-export zipWith = (f,xs, ys) -->
-  f = objToFunc f if typeof! f isnt \Function
-  if not xs.length or not ys.length
-    []
-  else
-    [f.apply this, zs for zs in zip.call this, xs, ys]
-
-export zipAll = (...xss) ->
-  result = []
-  for xs, i in xss
-    for x, j in xs
-      result.push [] if i is 0
-      result[j]?push x
-  result
-
-export zipAllWith = (f, ...xss) ->
-  f = objToFunc f if typeof! f isnt \Function
-  if not xss.0.length or not xss.1.length
-    []
-  else
-    [f.apply this, xs for xs in zipAll.apply this, xss]
-
-export compose = (...funcs) ->
-  ->
-    args = arguments
-    for f in funcs
-      args = [f.apply this, args]
-    args.0
-
-export curry = (f) ->
-  curry$ f # using util method curry$ from livescript
-
-export id = (x) -> x
-
-export flip = (f, x, y) --> f y, x
-
-export fix = (f) ->
-  ( (g, x) -> -> f(g g) ...arguments ) do
-    (g, x) -> -> f(g g) ...arguments
-
-export lines = (str) ->
-  return [] if not str.length
-  str / \\n
-
-export unlines = (strs) -> strs * \\n
-
-export words = (str) ->
-  return [] if not str.length
-  str / /[ ]+/
-
-export unwords = (strs) -> strs * ' '
-
-export max = (>?)
-
-export min = (<?)
-
-export negate = (x) -> -x
-
-export abs = Math.abs
-
-export signum = (x) ->
-  | x < 0     => -1
-  | x > 0     =>  1
-  | otherwise =>  0
-
-export quot = (x, y) --> ~~(x / y)
-
-export rem = (%)
-
-export div = (x, y) --> Math.floor x / y
-
-export mod = (%%)
-
-export recip = (1 /)
-
-export pi = Math.PI
-
-export tau = pi * 2
-
-export exp = Math.exp
-
-export sqrt = Math.sqrt
-
-# changed from log as log is a
-# common function for logging things
-export ln = Math.log
-
-export pow = (^)
-
-export sin = Math.sin
-
-export tan = Math.tan
-
-export cos = Math.cos
-
-export asin = Math.asin
-
-export acos = Math.acos
-
-export atan = Math.atan
-
-export atan2 = (x, y) --> Math.atan2 x, y
-
-# sinh
-# tanh
-# cosh
-# asinh
-# atanh
-# acosh
-
-export truncate = (x) -> ~~x
-
-export round = Math.round
-
-export ceiling = Math.ceil
-
-export floor = Math.floor
-
-export isItNaN = (x) -> x isnt x
-
-export even = (x) -> x % 2 == 0
-
-export odd = (x) -> x % 2 != 0
-
-export gcd = (x, y) -->
-  x = Math.abs x
-  y = Math.abs y
-  until y is 0
-    z = x % y
-    x = y
-    y = z
-  x
-
-export lcm = (x, y) -->
-  Math.abs Math.floor (x / (gcd x, y) * y)
-
-# meta
-export installPrelude = !(target) ->
-  unless target.prelude?isInstalled
-    target <<< out$ # using out$ generated by livescript
-    target <<< target.prelude.isInstalled = true
-
-export prelude = out$
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        theme: "solarized light",
-        lineNumbers: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-livescript</code>.</p>
-
-    <p>The LiveScript mode was written by Kenneth Bentley.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/livescript/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/livescript/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/livescript/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/lua/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/lua/index.html.html
deleted file mode 100644
index fc98b9446819e89752e94583a452c59022a95016..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/lua/index.html.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Lua mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/neat.css">
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="../../lib/codemirror.js"></script>
-<script src="lua.js"></script>
-<style>.CodeMirror {border: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Lua</a>
-  </ul>
-</div>
-
-<article>
-<h2>Lua mode</h2>
-<form><textarea id="code" name="code">
---[[
-example useless code to show lua syntax highlighting
-this is multiline comment
-]]
-
-function blahblahblah(x)
-
-  local table = {
-    "asd" = 123,
-    "x" = 0.34,  
-  }
-  if x ~= 3 then
-    print( x )
-  elseif x == "string"
-    my_custom_function( 0x34 )
-  else
-    unknown_function( "some string" )
-  end
-
-  --single line comment
-  
-end
-
-function blablabla3()
-
-  for k,v in ipairs( table ) do
-    --abcde..
-    y=[=[
-  x=[[
-      x is a multi line string
-   ]]
-  but its definition is iside a highest level string!
-  ]=]
-    print(" \"\" ")
-
-    s = math.sin( x )
-  end
-
-end
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        matchBrackets: true,
-        theme: "neat"
-      });
-    </script>
-
-    <p>Loosely based on Franciszek
-    Wawrzak's <a href="http://codemirror.net/1/contrib/lua">CodeMirror
-    1 mode</a>. One configuration parameter is
-    supported, <code>specials</code>, to which you can provide an
-    array of strings to have those identifiers highlighted with
-    the <code>lua-special</code> style.</p>
-    <p><strong>MIME types defined:</strong> <code>text/x-lua</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/lua/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/lua/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/lua/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/index.html.html
deleted file mode 100644
index 15660c2618955971846febdf77948675bffb6053..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/index.html.html
+++ /dev/null
@@ -1,361 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Markdown mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/continuelist.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="markdown.js"></script>
-<style type="text/css">
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .cm-s-default .cm-trailing-space-a:before,
-      .cm-s-default .cm-trailing-space-b:before {position: absolute; content: "\00B7"; color: #777;}
-      .cm-s-default .cm-trailing-space-new-line:before {position: absolute; content: "\21B5"; color: #777;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Markdown</a>
-  </ul>
-</div>
-
-<article>
-<h2>Markdown mode</h2>
-<form><textarea id="code" name="code">
-Markdown: Basics
-================
-
-&lt;ul id="ProjectSubmenu"&gt;
-    &lt;li&gt;&lt;a href="/projects/markdown/" title="Markdown Project Page"&gt;Main&lt;/a&gt;&lt;/li&gt;
-    &lt;li&gt;&lt;a class="selected" title="Markdown Basics"&gt;Basics&lt;/a&gt;&lt;/li&gt;
-    &lt;li&gt;&lt;a href="/projects/markdown/syntax" title="Markdown Syntax Documentation"&gt;Syntax&lt;/a&gt;&lt;/li&gt;
-    &lt;li&gt;&lt;a href="/projects/markdown/license" title="Pricing and License Information"&gt;License&lt;/a&gt;&lt;/li&gt;
-    &lt;li&gt;&lt;a href="/projects/markdown/dingus" title="Online Markdown Web Form"&gt;Dingus&lt;/a&gt;&lt;/li&gt;
-&lt;/ul&gt;
-
-
-Getting the Gist of Markdown's Formatting Syntax
-------------------------------------------------
-
-This page offers a brief overview of what it's like to use Markdown.
-The [syntax page] [s] provides complete, detailed documentation for
-every feature, but Markdown should be very easy to pick up simply by
-looking at a few examples of it in action. The examples on this page
-are written in a before/after style, showing example syntax and the
-HTML output produced by Markdown.
-
-It's also helpful to simply try Markdown out; the [Dingus] [d] is a
-web application that allows you type your own Markdown-formatted text
-and translate it to XHTML.
-
-**Note:** This document is itself written using Markdown; you
-can [see the source for it by adding '.text' to the URL] [src].
-
-  [s]: /projects/markdown/syntax  "Markdown Syntax"
-  [d]: /projects/markdown/dingus  "Markdown Dingus"
-  [src]: /projects/markdown/basics.text
-
-
-## Paragraphs, Headers, Blockquotes ##
-
-A paragraph is simply one or more consecutive lines of text, separated
-by one or more blank lines. (A blank line is any line that looks like
-a blank line -- a line containing nothing but spaces or tabs is
-considered blank.) Normal paragraphs should not be indented with
-spaces or tabs.
-
-Markdown offers two styles of headers: *Setext* and *atx*.
-Setext-style headers for `&lt;h1&gt;` and `&lt;h2&gt;` are created by
-"underlining" with equal signs (`=`) and hyphens (`-`), respectively.
-To create an atx-style header, you put 1-6 hash marks (`#`) at the
-beginning of the line -- the number of hashes equals the resulting
-HTML header level.
-
-Blockquotes are indicated using email-style '`&gt;`' angle brackets.
-
-Markdown:
-
-    A First Level Header
-    ====================
-    
-    A Second Level Header
-    ---------------------
-
-    Now is the time for all good men to come to
-    the aid of their country. This is just a
-    regular paragraph.
-
-    The quick brown fox jumped over the lazy
-    dog's back.
-    
-    ### Header 3
-
-    &gt; This is a blockquote.
-    &gt; 
-    &gt; This is the second paragraph in the blockquote.
-    &gt;
-    &gt; ## This is an H2 in a blockquote
-
-
-Output:
-
-    &lt;h1&gt;A First Level Header&lt;/h1&gt;
-    
-    &lt;h2&gt;A Second Level Header&lt;/h2&gt;
-    
-    &lt;p&gt;Now is the time for all good men to come to
-    the aid of their country. This is just a
-    regular paragraph.&lt;/p&gt;
-    
-    &lt;p&gt;The quick brown fox jumped over the lazy
-    dog's back.&lt;/p&gt;
-    
-    &lt;h3&gt;Header 3&lt;/h3&gt;
-    
-    &lt;blockquote&gt;
-        &lt;p&gt;This is a blockquote.&lt;/p&gt;
-        
-        &lt;p&gt;This is the second paragraph in the blockquote.&lt;/p&gt;
-        
-        &lt;h2&gt;This is an H2 in a blockquote&lt;/h2&gt;
-    &lt;/blockquote&gt;
-
-
-
-### Phrase Emphasis ###
-
-Markdown uses asterisks and underscores to indicate spans of emphasis.
-
-Markdown:
-
-    Some of these words *are emphasized*.
-    Some of these words _are emphasized also_.
-    
-    Use two asterisks for **strong emphasis**.
-    Or, if you prefer, __use two underscores instead__.
-
-Output:
-
-    &lt;p&gt;Some of these words &lt;em&gt;are emphasized&lt;/em&gt;.
-    Some of these words &lt;em&gt;are emphasized also&lt;/em&gt;.&lt;/p&gt;
-    
-    &lt;p&gt;Use two asterisks for &lt;strong&gt;strong emphasis&lt;/strong&gt;.
-    Or, if you prefer, &lt;strong&gt;use two underscores instead&lt;/strong&gt;.&lt;/p&gt;
-   
-
-
-## Lists ##
-
-Unordered (bulleted) lists use asterisks, pluses, and hyphens (`*`,
-`+`, and `-`) as list markers. These three markers are
-interchangable; this:
-
-    *   Candy.
-    *   Gum.
-    *   Booze.
-
-this:
-
-    +   Candy.
-    +   Gum.
-    +   Booze.
-
-and this:
-
-    -   Candy.
-    -   Gum.
-    -   Booze.
-
-all produce the same output:
-
-    &lt;ul&gt;
-    &lt;li&gt;Candy.&lt;/li&gt;
-    &lt;li&gt;Gum.&lt;/li&gt;
-    &lt;li&gt;Booze.&lt;/li&gt;
-    &lt;/ul&gt;
-
-Ordered (numbered) lists use regular numbers, followed by periods, as
-list markers:
-
-    1.  Red
-    2.  Green
-    3.  Blue
-
-Output:
-
-    &lt;ol&gt;
-    &lt;li&gt;Red&lt;/li&gt;
-    &lt;li&gt;Green&lt;/li&gt;
-    &lt;li&gt;Blue&lt;/li&gt;
-    &lt;/ol&gt;
-
-If you put blank lines between items, you'll get `&lt;p&gt;` tags for the
-list item text. You can create multi-paragraph list items by indenting
-the paragraphs by 4 spaces or 1 tab:
-
-    *   A list item.
-    
-        With multiple paragraphs.
-
-    *   Another item in the list.
-
-Output:
-
-    &lt;ul&gt;
-    &lt;li&gt;&lt;p&gt;A list item.&lt;/p&gt;
-    &lt;p&gt;With multiple paragraphs.&lt;/p&gt;&lt;/li&gt;
-    &lt;li&gt;&lt;p&gt;Another item in the list.&lt;/p&gt;&lt;/li&gt;
-    &lt;/ul&gt;
-    
-
-
-### Links ###
-
-Markdown supports two styles for creating links: *inline* and
-*reference*. With both styles, you use square brackets to delimit the
-text you want to turn into a link.
-
-Inline-style links use parentheses immediately after the link text.
-For example:
-
-    This is an [example link](http://example.com/).
-
-Output:
-
-    &lt;p&gt;This is an &lt;a href="http://example.com/"&gt;
-    example link&lt;/a&gt;.&lt;/p&gt;
-
-Optionally, you may include a title attribute in the parentheses:
-
-    This is an [example link](http://example.com/ "With a Title").
-
-Output:
-
-    &lt;p&gt;This is an &lt;a href="http://example.com/" title="With a Title"&gt;
-    example link&lt;/a&gt;.&lt;/p&gt;
-
-Reference-style links allow you to refer to your links by names, which
-you define elsewhere in your document:
-
-    I get 10 times more traffic from [Google][1] than from
-    [Yahoo][2] or [MSN][3].
-
-    [1]: http://google.com/        "Google"
-    [2]: http://search.yahoo.com/  "Yahoo Search"
-    [3]: http://search.msn.com/    "MSN Search"
-
-Output:
-
-    &lt;p&gt;I get 10 times more traffic from &lt;a href="http://google.com/"
-    title="Google"&gt;Google&lt;/a&gt; than from &lt;a href="http://search.yahoo.com/"
-    title="Yahoo Search"&gt;Yahoo&lt;/a&gt; or &lt;a href="http://search.msn.com/"
-    title="MSN Search"&gt;MSN&lt;/a&gt;.&lt;/p&gt;
-
-The title attribute is optional. Link names may contain letters,
-numbers and spaces, but are *not* case sensitive:
-
-    I start my morning with a cup of coffee and
-    [The New York Times][NY Times].
-
-    [ny times]: http://www.nytimes.com/
-
-Output:
-
-    &lt;p&gt;I start my morning with a cup of coffee and
-    &lt;a href="http://www.nytimes.com/"&gt;The New York Times&lt;/a&gt;.&lt;/p&gt;
-
-
-### Images ###
-
-Image syntax is very much like link syntax.
-
-Inline (titles are optional):
-
-    ![alt text](/path/to/img.jpg "Title")
-
-Reference-style:
-
-    ![alt text][id]
-
-    [id]: /path/to/img.jpg "Title"
-
-Both of the above examples produce the same output:
-
-    &lt;img src="/path/to/img.jpg" alt="alt text" title="Title" /&gt;
-
-
-
-### Code ###
-
-In a regular paragraph, you can create code span by wrapping text in
-backtick quotes. Any ampersands (`&amp;`) and angle brackets (`&lt;` or
-`&gt;`) will automatically be translated into HTML entities. This makes
-it easy to use Markdown to write about HTML example code:
-
-    I strongly recommend against using any `&lt;blink&gt;` tags.
-
-    I wish SmartyPants used named entities like `&amp;mdash;`
-    instead of decimal-encoded entites like `&amp;#8212;`.
-
-Output:
-
-    &lt;p&gt;I strongly recommend against using any
-    &lt;code&gt;&amp;lt;blink&amp;gt;&lt;/code&gt; tags.&lt;/p&gt;
-    
-    &lt;p&gt;I wish SmartyPants used named entities like
-    &lt;code&gt;&amp;amp;mdash;&lt;/code&gt; instead of decimal-encoded
-    entites like &lt;code&gt;&amp;amp;#8212;&lt;/code&gt;.&lt;/p&gt;
-
-
-To specify an entire block of pre-formatted code, indent every line of
-the block by 4 spaces or 1 tab. Just like with code spans, `&amp;`, `&lt;`,
-and `&gt;` characters will be escaped automatically.
-
-Markdown:
-
-    If you want your page to validate under XHTML 1.0 Strict,
-    you've got to put paragraph tags in your blockquotes:
-
-        &lt;blockquote&gt;
-            &lt;p&gt;For example.&lt;/p&gt;
-        &lt;/blockquote&gt;
-
-Output:
-
-    &lt;p&gt;If you want your page to validate under XHTML 1.0 Strict,
-    you've got to put paragraph tags in your blockquotes:&lt;/p&gt;
-    
-    &lt;pre&gt;&lt;code&gt;&amp;lt;blockquote&amp;gt;
-        &amp;lt;p&amp;gt;For example.&amp;lt;/p&amp;gt;
-    &amp;lt;/blockquote&amp;gt;
-    &lt;/code&gt;&lt;/pre&gt;
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: 'markdown',
-        lineNumbers: true,
-        theme: "default",
-        extraKeys: {"Enter": "newlineAndIndentContinueMarkdownList"}
-      });
-    </script>
-
-    <p>You might want to use the <a href="../gfm/index.html">Github-Flavored Markdown mode</a> instead, which adds support for fenced code blocks and a few other things.</p>
-
-    <p>Optionally depends on the XML mode for properly highlighted inline XML blocks.</p>
-    
-    <p><strong>MIME types defined:</strong> <code>text/x-markdown</code>.</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#markdown_*">normal</a>,  <a href="../../test/index.html#verbose,markdown_*">verbose</a>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/markdown.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/markdown.js.js
index 4ba57e44cadb0d112b3aa06c4321cecde13d4bca..d252fb89831a23e46ef19c6947f44f7c30ff93bd 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/markdown.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/markdown.js.js
@@ -35,15 +35,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
   if (modeCfg.maxBlockquoteDepth === undefined)
     modeCfg.maxBlockquoteDepth = 0;
 
-  // Should underscores in words open/close em/strong?
-  if (modeCfg.underscoresBreakWords === undefined)
-    modeCfg.underscoresBreakWords = true;
-
-  // Use `fencedCodeBlocks` to configure fenced code blocks. false to
-  // disable, string to specify a precise regexp that the fence should
-  // match, and true to allow three or more backticks or tildes (as
-  // per CommonMark).
-
   // Turn on task lists? ("- [ ] " and "- [x] ")
   if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;
 
@@ -51,6 +42,15 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
   if (modeCfg.strikethrough === undefined)
     modeCfg.strikethrough = false;
 
+  if (modeCfg.emoji === undefined)
+    modeCfg.emoji = false;
+
+  if (modeCfg.fencedCodeBlockHighlighting === undefined)
+    modeCfg.fencedCodeBlockHighlighting = true;
+
+  if (modeCfg.xml === undefined)
+    modeCfg.xml = true;
+
   // Allow token types to be overridden by user-provided token types.
   if (modeCfg.tokenTypeOverrides === undefined)
     modeCfg.tokenTypeOverrides = {};
@@ -73,7 +73,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
     linkHref: "string",
     em: "em",
     strong: "strong",
-    strikethrough: "strikethrough"
+    strikethrough: "strikethrough",
+    emoji: "builtin"
   };
 
   for (var tokenType in tokenTypes) {
@@ -84,12 +85,14 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
 
   var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
   ,   listRE = /^(?:[*\-+]|^[0-9]+([.)]))\s+/
-  ,   taskListRE = /^\[(x| )\](?=\s)/ // Must follow listRE
+  ,   taskListRE = /^\[(x| )\](?=\s)/i // Must follow listRE
   ,   atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/
   ,   setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
-  ,   textRE = /^[^#!\[\]*_\\<>` "'(~]+/
-  ,   fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) +
-                                ")[ \\t]*([\\w+#\-]*)");
+  ,   textRE = /^[^#!\[\]*_\\<>` "'(~:]+/
+  ,   fencedCodeRE = /^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/
+  ,   linkDefRE = /^\s*\[[^\]]+?\]:.*$/ // naive link-definition
+  ,   punctuation = /[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~鈥擼/
+  ,   expandedTab = "    " // CommonMark specifies tab as 4 spaces
 
   function switchInline(stream, state, f) {
     state.f = state.inline = f;
@@ -110,6 +113,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
   function blankLine(state) {
     // Reset linkTitle state
     state.linkTitle = false;
+    state.linkHref = false;
+    state.linkText = false;
     // Reset EM state
     state.em = false;
     // Reset STRONG state
@@ -120,7 +125,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
     state.quote = 0;
     // Reset state.indentedCode
     state.indentedCode = false;
-    if (htmlModeMissing && state.f == htmlBlock) {
+    if (state.f == htmlBlock) {
       state.f = inlineNormal;
       state.block = blockNormal;
     }
@@ -129,76 +134,86 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
     state.trailingSpaceNewLine = false;
     // Mark this line as blank
     state.prevLine = state.thisLine
-    state.thisLine = null
+    state.thisLine = {stream: null}
     return null;
   }
 
   function blockNormal(stream, state) {
-
-    var sol = stream.sol();
-
-    var prevLineIsList = state.list !== false,
-        prevLineIsIndentedCode = state.indentedCode;
+    var firstTokenOnLine = stream.column() === state.indentation;
+    var prevLineLineIsEmpty = lineIsEmpty(state.prevLine.stream);
+    var prevLineIsIndentedCode = state.indentedCode;
+    var prevLineIsHr = state.prevLine.hr;
+    var prevLineIsList = state.list !== false;
+    var maxNonCodeIndentation = (state.listStack[state.listStack.length - 1] || 0) + 3;
 
     state.indentedCode = false;
 
-    if (prevLineIsList) {
-      if (state.indentationDiff >= 0) { // Continued list
-        if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block
-          state.indentation -= state.indentationDiff;
-        }
-        state.list = null;
-      } else if (state.indentation > 0) {
+    var lineIndentation = state.indentation;
+    // compute once per line (on first token)
+    if (state.indentationDiff === null) {
+      state.indentationDiff = state.indentation;
+      if (prevLineIsList) {
+        // Reset inline styles which shouldn't propagate aross list items
+        state.em = false;
+        state.strong = false;
+        state.code = false;
+        state.strikethrough = false;
+
         state.list = null;
-      } else { // No longer a list
-        state.list = false;
+        // While this list item's marker's indentation is less than the deepest
+        //  list item's content's indentation,pop the deepest list item
+        //  indentation off the stack, and update block indentation state
+        while (lineIndentation < state.listStack[state.listStack.length - 1]) {
+          state.listStack.pop();
+          if (state.listStack.length) {
+            state.indentation = state.listStack[state.listStack.length - 1];
+          // less than the first list's indent -> the line is no longer a list
+          } else {
+            state.list = false;
+          }
+        }
+        if (state.list !== false) {
+          state.indentationDiff = lineIndentation - state.listStack[state.listStack.length - 1]
+        }
       }
     }
 
+    // not comprehensive (currently only for setext detection purposes)
+    var allowsInlineContinuation = (
+        !prevLineLineIsEmpty && !prevLineIsHr && !state.prevLine.header &&
+        (!prevLineIsList || !prevLineIsIndentedCode) &&
+        !state.prevLine.fencedCodeEnd
+    );
+
+    var isHr = (state.list === false || prevLineIsHr || prevLineLineIsEmpty) &&
+      state.indentation <= maxNonCodeIndentation && stream.match(hrRE);
+
     var match = null;
-    if (state.indentationDiff >= 4) {
+    if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || state.prevLine.fencedCodeEnd ||
+         state.prevLine.header || prevLineLineIsEmpty)) {
       stream.skipToEnd();
-      if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) {
-        state.indentation -= 4;
-        state.indentedCode = true;
-        return tokenTypes.code;
-      } else {
-        return null;
-      }
+      state.indentedCode = true;
+      return tokenTypes.code;
     } else if (stream.eatSpace()) {
       return null;
-    } else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
+    } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
+      state.quote = 0;
       state.header = match[1].length;
+      state.thisLine.header = true;
       if (modeCfg.highlightFormatting) state.formatting = "header";
       state.f = state.inline;
       return getType(state);
-    } else if (!lineIsEmpty(state.prevLine) && !state.quote && !prevLineIsList &&
-               !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) {
-      state.header = match[0].charAt(0) == '=' ? 1 : 2;
-      if (modeCfg.highlightFormatting) state.formatting = "header";
-      state.f = state.inline;
-      return getType(state);
-    } else if (stream.eat('>')) {
-      state.quote = sol ? 1 : state.quote + 1;
+    } else if (state.indentation <= maxNonCodeIndentation && stream.eat('>')) {
+      state.quote = firstTokenOnLine ? 1 : state.quote + 1;
       if (modeCfg.highlightFormatting) state.formatting = "quote";
       stream.eatSpace();
       return getType(state);
-    } else if (stream.peek() === '[') {
-      return switchInline(stream, state, footnoteLink);
-    } else if (stream.match(hrRE, true)) {
-      state.hr = true;
-      return tokenTypes.hr;
-    } else if (match = stream.match(listRE)) {
+    } else if (!isHr && !state.setext && firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(listRE))) {
       var listType = match[1] ? "ol" : "ul";
-      state.indentation = stream.column() + stream.current().length;
-      state.list = true;
 
-      // While this list item's marker's indentation
-      // is less than the deepest list item's content's indentation,
-      // pop the deepest list item indentation off the stack.
-      while (state.listStack && stream.column() < state.listStack[state.listStack.length - 1]) {
-        state.listStack.pop();
-      }
+      state.indentation = lineIndentation + stream.current().length;
+      state.list = true;
+      state.quote = 0;
 
       // Add this list item's content's indentation to the stack
       state.listStack.push(state.indentation);
@@ -209,15 +224,47 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       state.f = state.inline;
       if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];
       return getType(state);
-    } else if (modeCfg.fencedCodeBlocks && (match = stream.match(fencedCodeRE, true))) {
-      state.fencedChars = match[1]
+    } else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(fencedCodeRE, true))) {
+      state.quote = 0;
+      state.fencedEndRE = new RegExp(match[1] + "+ *$");
       // try switching mode
-      state.localMode = getMode(match[2]);
+      state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2]);
       if (state.localMode) state.localState = CodeMirror.startState(state.localMode);
       state.f = state.block = local;
       if (modeCfg.highlightFormatting) state.formatting = "code-block";
       state.code = -1
       return getType(state);
+    // SETEXT has lowest block-scope precedence after HR, so check it after
+    //  the others (code, blockquote, list...)
+    } else if (
+      // if setext set, indicates line after ---/===
+      state.setext || (
+        // line before ---/===
+        (!allowsInlineContinuation || !prevLineIsList) && !state.quote && state.list === false &&
+        !state.code && !isHr && !linkDefRE.test(stream.string) &&
+        (match = stream.lookAhead(1)) && (match = match.match(setextHeaderRE))
+      )
+    ) {
+      if ( !state.setext ) {
+        state.header = match[0].charAt(0) == '=' ? 1 : 2;
+        state.setext = state.header;
+      } else {
+        state.header = state.setext;
+        // has no effect on type so we can reset it now
+        state.setext = 0;
+        stream.skipToEnd();
+        if (modeCfg.highlightFormatting) state.formatting = "header";
+      }
+      state.thisLine.header = true;
+      state.f = state.inline;
+      return getType(state);
+    } else if (isHr) {
+      stream.skipToEnd();
+      state.hr = true;
+      state.thisLine.hr = true;
+      return tokenTypes.hr;
+    } else if (stream.peek() === '[') {
+      return switchInline(stream, state, footnoteLink);
     }
 
     return switchInline(stream, state, state.inline);
@@ -239,13 +286,21 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
   }
 
   function local(stream, state) {
-    if (state.fencedChars && stream.match(state.fencedChars)) {
+    var currListInd = state.listStack[state.listStack.length - 1] || 0;
+    var hasExitedList = state.indentation < currListInd;
+    var maxFencedEndInd = currListInd + 3;
+    if (state.fencedEndRE && state.indentation <= maxFencedEndInd && (hasExitedList || stream.match(state.fencedEndRE))) {
       if (modeCfg.highlightFormatting) state.formatting = "code-block";
+      var returnType;
+      if (!hasExitedList) returnType = getType(state)
       state.localMode = state.localState = null;
-      state.f = state.block = leavingLocal;
-      return getType(state)
-    } else if (state.fencedChars && stream.skipTo(state.fencedChars)) {
-      return "comment"
+      state.block = blockNormal;
+      state.f = inlineNormal;
+      state.fencedEndRE = null;
+      state.code = 0
+      state.thisLine.fencedCodeEnd = true;
+      if (hasExitedList) return switchBlock(stream, state, state.block);
+      return returnType;
     } else if (state.localMode) {
       return state.localMode.token(stream, state.localState);
     } else {
@@ -254,18 +309,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
     }
   }
 
-  function leavingLocal(stream, state) {
-    stream.match(state.fencedChars);
-    state.block = blockNormal;
-    state.f = inlineNormal;
-    state.fencedChars = null;
-    if (modeCfg.highlightFormatting) state.formatting = "code-block";
-    state.code = 1
-    var returnType = getType(state);
-    state.code = 0
-    return returnType;
-  }
-
   // Inline
   function getType(state) {
     var styles = [];
@@ -309,6 +352,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       if (state.strong) { styles.push(tokenTypes.strong); }
       if (state.em) { styles.push(tokenTypes.em); }
       if (state.strikethrough) { styles.push(tokenTypes.strikethrough); }
+      if (state.emoji) { styles.push(tokenTypes.emoji); }
       if (state.linkText) { styles.push(tokenTypes.linkText); }
       if (state.code) { styles.push(tokenTypes.code); }
       if (state.image) { styles.push(tokenTypes.image); }
@@ -367,7 +411,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
     }
 
     if (state.taskList) {
-      var taskOpen = stream.match(taskListRE, true)[1] !== "x";
+      var taskOpen = stream.match(taskListRE, true)[1] === " ";
       if (taskOpen) state.taskOpen = true;
       else state.taskClosed = true;
       if (modeCfg.highlightFormatting) state.formatting = "task";
@@ -383,9 +427,6 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       return getType(state);
     }
 
-    // Get sol() value now, before character is consumed
-    var sol = stream.sol();
-
     var ch = stream.next();
 
     // Matches link titles present on next line
@@ -395,7 +436,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       if (ch === '(') {
         matchCh = ')';
       }
-      matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1");
+      matchCh = (matchCh+'').replace(/([.?*+^\[\]\\(){}|-])/g, "\\$1");
       var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
       if (stream.match(new RegExp(regex), true)) {
         return tokenTypes.linkHref;
@@ -408,7 +449,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       if (modeCfg.highlightFormatting) state.formatting = "code";
       stream.eatWhile('`');
       var count = stream.current().length
-      if (state.code == 0) {
+      if (state.code == 0 && (!state.quote || count == 1)) {
         state.code = count
         return getType(state)
       } else if (count == state.code) { // Must be exact
@@ -455,17 +496,17 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       return type;
     }
 
-    if (ch === '[' && stream.match(/[^\]]*\](\(.*\)| ?\[.*?\])/, false) && !state.image) {
+    if (ch === '[' && !state.image) {
       state.linkText = true;
       if (modeCfg.highlightFormatting) state.formatting = "link";
       return getType(state);
     }
 
-    if (ch === ']' && state.linkText && stream.match(/\(.*?\)| ?\[.*?\]/, false)) {
+    if (ch === ']' && state.linkText) {
       if (modeCfg.highlightFormatting) state.formatting = "link";
       var type = getType(state);
       state.linkText = false;
-      state.inline = state.f = linkHref;
+      state.inline = state.f = stream.match(/\(.*?\)| ?\[.*?\]/, false) ? linkHref : inlineNormal
       return type;
     }
 
@@ -493,7 +534,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       return type + tokenTypes.linkEmail;
     }
 
-    if (ch === '<' && stream.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i, false)) {
+    if (modeCfg.xml && ch === '<' && stream.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*>)/i, false)) {
       var end = stream.string.indexOf(">", stream.pos);
       if (end != -1) {
         var atts = stream.string.substring(stream.start, end);
@@ -504,44 +545,37 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       return switchBlock(stream, state, htmlBlock);
     }
 
-    if (ch === '<' && stream.match(/^\/\w*?>/)) {
+    if (modeCfg.xml && ch === '<' && stream.match(/^\/\w*?>/)) {
       state.md_inside = false;
       return "tag";
-    }
-
-    var ignoreUnderscore = false;
-    if (!modeCfg.underscoresBreakWords) {
-      if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) {
-        var prevPos = stream.pos - 2;
-        if (prevPos >= 0) {
-          var prevCh = stream.string.charAt(prevPos);
-          if (prevCh !== '_' && prevCh.match(/(\w)/, false)) {
-            ignoreUnderscore = true;
-          }
-        }
+    } else if (ch === "*" || ch === "_") {
+      var len = 1, before = stream.pos == 1 ? " " : stream.string.charAt(stream.pos - 2)
+      while (len < 3 && stream.eat(ch)) len++
+      var after = stream.peek() || " "
+      // See http://spec.commonmark.org/0.27/#emphasis-and-strong-emphasis
+      var leftFlanking = !/\s/.test(after) && (!punctuation.test(after) || /\s/.test(before) || punctuation.test(before))
+      var rightFlanking = !/\s/.test(before) && (!punctuation.test(before) || /\s/.test(after) || punctuation.test(after))
+      var setEm = null, setStrong = null
+      if (len % 2) { // Em
+        if (!state.em && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
+          setEm = true
+        else if (state.em == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
+          setEm = false
       }
-    }
-    if (ch === '*' || (ch === '_' && !ignoreUnderscore)) {
-      if (sol && stream.peek() === ' ') {
-        // Do nothing, surrounded by newline and space
-      } else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG
-        if (modeCfg.highlightFormatting) state.formatting = "strong";
-        var t = getType(state);
-        state.strong = false;
-        return t;
-      } else if (!state.strong && stream.eat(ch)) { // Add STRONG
-        state.strong = ch;
-        if (modeCfg.highlightFormatting) state.formatting = "strong";
-        return getType(state);
-      } else if (state.em === ch) { // Remove EM
-        if (modeCfg.highlightFormatting) state.formatting = "em";
-        var t = getType(state);
-        state.em = false;
-        return t;
-      } else if (!state.em) { // Add EM
-        state.em = ch;
-        if (modeCfg.highlightFormatting) state.formatting = "em";
-        return getType(state);
+      if (len > 1) { // Strong
+        if (!state.strong && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
+          setStrong = true
+        else if (state.strong == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
+          setStrong = false
+      }
+      if (setStrong != null || setEm != null) {
+        if (modeCfg.highlightFormatting) state.formatting = setEm == null ? "strong" : setStrong == null ? "em" : "strong em"
+        if (setEm === true) state.em = ch
+        if (setStrong === true) state.strong = ch
+        var t = getType(state)
+        if (setEm === false) state.em = false
+        if (setStrong === false) state.strong = false
+        return t
       }
     } else if (ch === ' ') {
       if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
@@ -576,6 +610,14 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       }
     }
 
+    if (modeCfg.emoji && ch === ":" && stream.match(/^[a-z_\d+-]+:/)) {
+      state.emoji = true;
+      if (modeCfg.highlightFormatting) state.formatting = "emoji";
+      var retType = getType(state);
+      state.emoji = false;
+      return retType;
+    }
+
     if (ch === ' ') {
       if (stream.match(/ +$/, false)) {
         state.trailingSpace++;
@@ -614,7 +656,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
     }
     var ch = stream.next();
     if (ch === '(' || ch === '[') {
-      state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]", 0);
+      state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");
       if (modeCfg.highlightFormatting) state.formatting = "link-string";
       state.linkHref = true;
       return getType(state);
@@ -624,7 +666,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
 
   var linkRE = {
     ")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,
-    "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/
+    "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/
   }
 
   function getLinkHrefInside(endChar) {
@@ -692,8 +734,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       return {
         f: blockNormal,
 
-        prevLine: null,
-        thisLine: null,
+        prevLine: {stream: null},
+        thisLine: {stream: null},
 
         block: blockNormal,
         htmlState: null,
@@ -710,6 +752,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
         em: false,
         strong: false,
         header: 0,
+        setext: 0,
         hr: false,
         taskList: false,
         list: false,
@@ -718,7 +761,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
         trailingSpace: 0,
         trailingSpaceNewLine: false,
         strikethrough: false,
-        fencedChars: null
+        emoji: false,
+        fencedEndRE: null
       };
     },
 
@@ -739,12 +783,16 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
         inline: s.inline,
         text: s.text,
         formatting: false,
+        linkText: s.linkText,
         linkTitle: s.linkTitle,
+        linkHref: s.linkHref,
         code: s.code,
         em: s.em,
         strong: s.strong,
         strikethrough: s.strikethrough,
+        emoji: s.emoji,
         header: s.header,
+        setext: s.setext,
         hr: s.hr,
         taskList: s.taskList,
         list: s.list,
@@ -754,7 +802,7 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
         trailingSpace: s.trailingSpace,
         trailingSpaceNewLine: s.trailingSpaceNewLine,
         md_inside: s.md_inside,
-        fencedChars: s.fencedChars
+        fencedEndRE: s.fencedEndRE
       };
     },
 
@@ -763,21 +811,17 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       // Reset state.formatting
       state.formatting = false;
 
-      if (stream != state.thisLine) {
-        var forceBlankLine = state.header || state.hr;
-
-        // Reset state.header and state.hr
+      if (stream != state.thisLine.stream) {
         state.header = 0;
         state.hr = false;
 
-        if (stream.match(/^\s*$/, true) || forceBlankLine) {
+        if (stream.match(/^\s*$/, true)) {
           blankLine(state);
-          if (!forceBlankLine) return null
-          state.prevLine = null
+          return null;
         }
 
         state.prevLine = state.thisLine
-        state.thisLine = stream
+        state.thisLine = {stream: stream}
 
         // Reset state.taskList
         state.taskList = false;
@@ -786,11 +830,15 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
         state.trailingSpace = 0;
         state.trailingSpaceNewLine = false;
 
-        state.f = state.block;
-        var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, '    ').length;
-        state.indentationDiff = Math.min(indentation - state.indentation, 4);
-        state.indentation = state.indentation + state.indentationDiff;
-        if (indentation > 0) return null;
+        if (!state.localState) {
+          state.f = state.block;
+          if (state.f != htmlBlock) {
+            var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, expandedTab).length;
+            state.indentation = indentation;
+            state.indentationDiff = null;
+            if (indentation > 0) return null;
+          }
+        }
       }
       return state.f(stream, state);
     },
@@ -801,6 +849,12 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
       return {state: state, mode: mode};
     },
 
+    indent: function(state, textAfter, line) {
+      if (state.block == htmlBlock && htmlMode.indent) return htmlMode.indent(state.htmlState, textAfter, line)
+      if (state.localState && state.localMode.indent) return state.localMode.indent(state.localState, textAfter, line)
+      return CodeMirror.Pass
+    },
+
     blankLine: blankLine,
 
     getType: getType,
@@ -811,6 +865,8 @@ CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
   return mode;
 }, "xml");
 
+CodeMirror.defineMIME("text/markdown", "markdown");
+
 CodeMirror.defineMIME("text/x-markdown", "markdown");
 
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/test.js.js
index 37ecb4bbfe6f2ed09a2888212124aa2b175f0a95..a89fbca60884cd4c88e32729e310b436246d8564 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/markdown/test.js.js
@@ -2,17 +2,21 @@
 // Distributed under an MIT license: http://codemirror.net/LICENSE
 
 (function() {
-  var mode = CodeMirror.getMode({tabSize: 4}, "markdown");
+  var config = {tabSize: 4, indentUnit: 2}
+  var mode = CodeMirror.getMode(config, "markdown");
   function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
-  var modeHighlightFormatting = CodeMirror.getMode({tabSize: 4}, {name: "markdown", highlightFormatting: true});
+  var modeHighlightFormatting = CodeMirror.getMode(config, {name: "markdown", highlightFormatting: true});
   function FT(name) { test.mode(name, modeHighlightFormatting, Array.prototype.slice.call(arguments, 1)); }
-  var modeAtxNoSpace = CodeMirror.getMode({tabSize: 4}, {name: "markdown", allowAtxHeaderWithoutSpace: true});
+  var modeMT_noXml = CodeMirror.getMode(config, {name: "markdown", xml: false});
+  function MT_noXml(name) { test.mode(name, modeMT_noXml, Array.prototype.slice.call(arguments, 1)); }
+  var modeMT_noFencedHighlight = CodeMirror.getMode(config, {name: "markdown", fencedCodeBlockHighlighting: false});
+  function MT_noFencedHighlight(name) { test.mode(name, modeMT_noFencedHighlight, Array.prototype.slice.call(arguments, 1)); }
+  var modeAtxNoSpace = CodeMirror.getMode(config, {name: "markdown", allowAtxHeaderWithoutSpace: true});
   function AtxNoSpaceTest(name) { test.mode(name, modeAtxNoSpace, Array.prototype.slice.call(arguments, 1)); }
-  var modeFenced = CodeMirror.getMode({tabSize: 4}, {name: "markdown", fencedCodeBlocks: true});
-  function FencedTest(name) { test.mode(name, modeFenced, Array.prototype.slice.call(arguments, 1)); }
-  var modeOverrideClasses = CodeMirror.getMode({tabsize: 4}, {
+  var modeOverrideClasses = CodeMirror.getMode(config, {
     name: "markdown",
     strikethrough: true,
+    emoji: true,
     tokenTypeOverrides: {
       "header" : "override-header",
       "code" : "override-code",
@@ -30,10 +34,11 @@
       "linkHref" : "override-link-href",
       "em" : "override-em",
       "strong" : "override-strong",
-      "strikethrough" : "override-strikethrough"
+      "strikethrough" : "override-strikethrough",
+      "emoji" : "override-emoji"
   }});
   function TokenTypeOverrideTest(name) { test.mode(name, modeOverrideClasses, Array.prototype.slice.call(arguments, 1)); }
-  var modeFormattingOverride = CodeMirror.getMode({tabsize: 4}, {
+  var modeFormattingOverride = CodeMirror.getMode(config, {
     name: "markdown",
     highlightFormatting: true,
     tokenTypeOverrides: {
@@ -64,7 +69,7 @@
      "[header&header-1&formatting&formatting-header&formatting-header-1 # ][header&header-1 foo # bar ][header&header-1&formatting&formatting-header&formatting-header-1 #]");
 
   FT("formatting_setextHeader",
-     "foo",
+     "[header&header-1 foo]",
      "[header&header-1&formatting&formatting-header&formatting-header-1 =]");
 
   FT("formatting_blockquote",
@@ -94,6 +99,11 @@
   FT("formatting_image",
      "[formatting&formatting-image&image&image-marker !][formatting&formatting-image&image&image-alt-text&link [[][image&image-alt-text&link alt text][formatting&formatting-image&image&image-alt-text&link ]]][formatting&formatting-link-string&string&url (][url&string http://link.to/image.jpg][formatting&formatting-link-string&string&url )]");
 
+  FT("codeBlock",
+     "[comment&formatting&formatting-code-block ```css]",
+     "[tag foo]",
+     "[comment&formatting&formatting-code-block ```]");
+
   MT("plainText",
      "foo");
 
@@ -141,6 +151,21 @@
      "Foo",
      "    Bar");
 
+  MT("codeBlocksAfterATX",
+     "[header&header-1 # foo]",
+     "    [comment code]");
+
+  MT("codeBlocksAfterSetext",
+     "[header&header-2 foo]",
+     "[header&header-2 ---]",
+     "    [comment code]");
+
+  MT("codeBlocksAfterFencedCode",
+     "[comment ```]",
+     "[comment foo]",
+     "[comment ```]",
+     "    [comment code]");
+
   // Inline code using backticks
   MT("inlineCodeUsingBackticks",
      "foo [comment `bar`]");
@@ -182,6 +207,10 @@
   MT("closedBackticks",
      "[comment ``foo ``` bar` hello``] world");
 
+  // info string cannot contain backtick, thus should result in inline code
+  MT("closingFencedMarksOnSameLine",
+     "[comment ``` code ```] foo");
+
   // atx headers
   // http://daringfireball.net/projects/markdown/syntax#header
 
@@ -225,6 +254,19 @@
   MT("atxH1inline",
      "[header&header-1 # foo ][header&header-1&em *bar*]");
 
+  MT("atxIndentedTooMuch",
+     "[header&header-1 # foo]",
+     "    [comment # bar]");
+
+  // disable atx inside blockquote until we implement proper blockquote inner mode
+  // TODO: fix to be CommonMark-compliant
+  MT("atxNestedInsideBlockquote",
+     "[quote&quote-1 > # foo]");
+
+  MT("atxAfterBlockquote",
+     "[quote&quote-1 > foo]",
+     "[header&header-1 # bar]");
+
   // Setext headers - H1, H2
   // Per documentation, "Any number of underlining =鈥檚 or -鈥檚 will work."
   // http://daringfireball.net/projects/markdown/syntax#header
@@ -234,27 +276,27 @@
   //
   // Check if single underlining = works
   MT("setextH1",
-     "foo",
+     "[header&header-1 foo]",
      "[header&header-1 =]");
 
   // Check if 3+ ='s work
   MT("setextH1",
-     "foo",
+     "[header&header-1 foo]",
      "[header&header-1 ===]");
 
   // Check if single underlining - works
   MT("setextH2",
-     "foo",
+     "[header&header-2 foo]",
      "[header&header-2 -]");
 
   // Check if 3+ -'s work
   MT("setextH2",
-     "foo",
+     "[header&header-2 foo]",
      "[header&header-2 ---]");
 
   // http://spec.commonmark.org/0.19/#example-45
   MT("setextH2AllowSpaces",
-     "foo",
+     "[header&header-2 foo]",
      "   [header&header-2 ----      ]");
 
   // http://spec.commonmark.org/0.19/#example-44
@@ -262,15 +304,86 @@
      "     [comment foo]",
      "[hr ---]");
 
+  MT("setextAfterFencedCode",
+     "[comment ```]",
+     "[comment foo]",
+     "[comment ```]",
+     "[header&header-2 bar]",
+     "[header&header-2 ---]");
+
+  MT("setextAferATX",
+     "[header&header-1 # foo]",
+     "[header&header-2 bar]",
+     "[header&header-2 ---]");
+
   // http://spec.commonmark.org/0.19/#example-51
   MT("noSetextAfterQuote",
      "[quote&quote-1 > foo]",
+     "[hr ---]",
+     "",
+     "[quote&quote-1 > foo]",
+     "[quote&quote-1 bar]",
      "[hr ---]");
 
   MT("noSetextAfterList",
      "[variable-2 - foo]",
      "[hr ---]");
 
+  MT("noSetextAfterList_listContinuation",
+     "[variable-2 - foo]",
+     "bar",
+     "[hr ---]");
+
+  MT("setextAfterList_afterIndentedCode",
+     "[variable-2 - foo]",
+     "",
+     "      [comment bar]",
+     "[header&header-2 baz]",
+     "[header&header-2 ---]");
+
+  MT("setextAfterList_afterFencedCodeBlocks",
+     "[variable-2 - foo]",
+     "",
+     "      [comment ```]",
+     "      [comment bar]",
+     "      [comment ```]",
+     "[header&header-2 baz]",
+     "[header&header-2 ---]");
+
+  MT("setextAfterList_afterHeader",
+     "[variable-2 - foo]",
+     "  [variable-2&header&header-1 # bar]",
+     "[header&header-2 baz]",
+     "[header&header-2 ---]");
+
+  MT("setextAfterList_afterHr",
+     "[variable-2 - foo]",
+     "",
+     "  [hr ---]",
+     "[header&header-2 bar]",
+     "[header&header-2 ---]");
+
+  MT("setext_nestedInlineMarkup",
+     "[header&header-1 foo ][em&header&header-1 *bar*]",
+     "[header&header-1 =]");
+
+  MT("setext_linkDef",
+     "[link [[aaa]]:] [string&url http://google.com 'title']",
+     "[hr ---]");
+
+  // currently, looks max one line ahead, thus won't catch valid CommonMark
+  //  markup
+  MT("setext_oneLineLookahead",
+     "foo",
+     "[header&header-1 bar]",
+     "[header&header-1 =]");
+
+  // ensure we don't regard space after dash as a list
+  MT("setext_emptyList",
+     "[header&header-2 foo]",
+     "[header&header-2 - ]",
+     "foo");
+
   // Single-line blockquote with trailing space
   MT("blockquoteSpace",
      "[quote&quote-1 > foo]");
@@ -284,12 +397,22 @@
      "foo",
      "[quote&quote-1 > bar]");
 
-  // Nested blockquote
-  MT("blockquoteSpace",
+  MT("blockquoteNested",
      "[quote&quote-1 > foo]",
      "[quote&quote-1 >][quote&quote-2 > foo]",
      "[quote&quote-1 >][quote&quote-2 >][quote&quote-3 > foo]");
 
+  // ensure quote-level is inferred correctly even if indented
+  MT("blockquoteNestedIndented",
+     " [quote&quote-1 > foo]",
+     " [quote&quote-1 >][quote&quote-2 > foo]",
+     " [quote&quote-1 >][quote&quote-2 >][quote&quote-3 > foo]");
+
+  // ensure quote-level is inferred correctly even if indented
+  MT("blockquoteIndentedTooMuch",
+     "foo",
+     "    > bar");
+
   // Single-line blockquote followed by normal paragraph
   MT("blockquoteThenParagraph",
      "[quote&quote-1 >foo]",
@@ -320,6 +443,20 @@
      "",
      "hello");
 
+  // disallow lists inside blockquote for now because it causes problems outside blockquote
+  // TODO: fix to be CommonMark-compliant
+  MT("listNestedInBlockquote",
+     "[quote&quote-1 > - foo]");
+
+  // disallow fenced blocks inside blockquote because it causes problems outside blockquote
+  // TODO: fix to be CommonMark-compliant
+  MT("fencedBlockNestedInBlockquote",
+     "[quote&quote-1 > ```]",
+     "[quote&quote-1 > code]",
+     "[quote&quote-1 > ```]",
+     // ensure we still allow inline code
+     "[quote&quote-1 > ][quote&quote-1&comment `code`]");
+
   // Header with leading space after continued blockquote (#3287, negative indentation)
   MT("headerAfterContinuedBlockquote",
      "[quote&quote-1 > foo]",
@@ -377,32 +514,53 @@
      "[variable-2 - foo]",
      "[hr -----]");
 
+  MT("hrAfterFencedCode",
+     "[comment ```]",
+     "[comment code]",
+     "[comment ```]",
+     "[hr ---]");
+
+  // allow hr inside lists
+  // (require prev line to be empty or hr, TODO: non-CommonMark-compliant)
+  MT("hrInsideList",
+     "[variable-2 - foo]",
+     "",
+     "  [hr ---]",
+     "     [hr ---]",
+     "",
+     "      [comment ---]");
+
+  MT("consecutiveHr",
+     "[hr ---]",
+     "[hr ---]",
+     "[hr ---]");
+
   // Formatting in lists (*)
   MT("listAsteriskFormatting",
      "[variable-2 * ][variable-2&em *foo*][variable-2  bar]",
      "[variable-2 * ][variable-2&strong **foo**][variable-2  bar]",
-     "[variable-2 * ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2  bar]",
+     "[variable-2 * ][variable-2&em&strong ***foo***][variable-2  bar]",
      "[variable-2 * ][variable-2&comment `foo`][variable-2  bar]");
 
   // Formatting in lists (+)
   MT("listPlusFormatting",
      "[variable-2 + ][variable-2&em *foo*][variable-2  bar]",
      "[variable-2 + ][variable-2&strong **foo**][variable-2  bar]",
-     "[variable-2 + ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2  bar]",
+     "[variable-2 + ][variable-2&em&strong ***foo***][variable-2  bar]",
      "[variable-2 + ][variable-2&comment `foo`][variable-2  bar]");
 
   // Formatting in lists (-)
   MT("listDashFormatting",
      "[variable-2 - ][variable-2&em *foo*][variable-2  bar]",
      "[variable-2 - ][variable-2&strong **foo**][variable-2  bar]",
-     "[variable-2 - ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2  bar]",
+     "[variable-2 - ][variable-2&em&strong ***foo***][variable-2  bar]",
      "[variable-2 - ][variable-2&comment `foo`][variable-2  bar]");
 
   // Formatting in lists (1.)
   MT("listNumberFormatting",
      "[variable-2 1. ][variable-2&em *foo*][variable-2  bar]",
      "[variable-2 2. ][variable-2&strong **foo**][variable-2  bar]",
-     "[variable-2 3. ][variable-2&strong **][variable-2&em&strong *foo**][variable-2&em *][variable-2  bar]",
+     "[variable-2 3. ][variable-2&em&strong ***foo***][variable-2  bar]",
      "[variable-2 4. ][variable-2&comment `foo`][variable-2  bar]");
 
   // Paragraph lists
@@ -468,6 +626,66 @@
      "   [variable-3 * Otherwise, it will be part of the level where it does meet this.]",
      " [variable-2 * World]");
 
+  // should handle nested and un-nested lists
+  MT("listCommonMark_MixedIndents",
+     "[variable-2 * list1]",
+     "    [variable-2 list1]",
+     "  [variable-2&header&header-1 # heading still part of list1]",
+     "  [variable-2 text after heading still part of list1]",
+     "",
+     "      [comment indented codeblock]",
+     "  [variable-2 list1 after code block]",
+     "  [variable-3 * list2]",
+     // amount of spaces on empty lines between lists doesn't matter
+     "              ",
+     // extra empty lines irrelevant
+     "",
+     "",
+     "    [variable-3 indented text part of list2]",
+     "    [keyword * list3]",
+     "",
+     "    [variable-3 text at level of list2]",
+     "",
+     "  [variable-2 de-indented text part of list1 again]",
+     "",
+     "  [variable-2&comment ```]",
+     "  [comment code]",
+     "  [variable-2&comment ```]",
+     "",
+     "  [variable-2 text after fenced code]");
+
+  // should correctly parse numbered list content indentation
+  MT("listCommonMark_NumeberedListIndent",
+     "[variable-2 1000. list with base indent of 6]",
+     "",
+     "      [variable-2 text must be indented 6 spaces at minimum]",
+     "",
+     "         [variable-2 9-spaces indented text still part of list]",
+     "",
+     "          [comment indented codeblock starts at 10 spaces]",
+     "",
+     "     [comment text indented by 5 spaces no longer belong to list]");
+
+  // should consider tab as 4 spaces
+  MT("listCommonMark_TabIndented",
+     "[variable-2 * list]",
+     "\t[variable-3 * list2]",
+     "",
+     "\t\t[variable-3 part of list2]");
+
+  MT("listAfterBlockquote",
+     "[quote&quote-1 > foo]",
+     "[variable-2 - bar]");
+
+  // shouldn't create sublist if it's indented more than allowed
+  MT("nestedListIndentedTooMuch",
+     "[variable-2 - foo]",
+     "          [variable-2 - bar]");
+
+  MT("listIndentedTooMuchAfterParagraph",
+     "foo",
+     "    - bar");
+
   // Blockquote
   MT("blockquote",
      "[variable-2 * foo]",
@@ -605,7 +823,7 @@
      "[image&image-marker !][image&image-alt-text&link [[][image-alt-text&strong&image&link **alt text**][image&image-alt-text&link ]]][string&url (http://link.to/image.jpg)]");
 
   MT("imageEmStrong",
-     "[image&image-marker !][image&image-alt-text&link [[][image-alt-text&image&strong&link **][image&image-alt-text&em&strong&link *alt text**][image&image-alt-text&em&link *][image&image-alt-text&link ]]][string&url (http://link.to/image.jpg)]");
+     "[image&image-marker !][image&image-alt-text&link [[][image&image-alt-text&em&strong&link ***alt text***][image&image-alt-text&link ]]][string&url (http://link.to/image.jpg)]");
 
   // Inline link with title
   MT("linkTitle",
@@ -629,7 +847,12 @@
 
   // Inline link with EmStrong
   MT("linkEmStrong",
-     "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url (http://example.com/)] bar");
+     "[link [[][link&em&strong ***foo***][link ]]][string&url (http://example.com/)] bar");
+
+  MT("multilineLink",
+     "[link [[foo]",
+     "[link bar]]][string&url (https://foo#_a)]",
+     "should not be italics")
 
   // Image with title
   MT("imageTitle",
@@ -647,7 +870,7 @@
   // regularly in text, especially in quoted material, and no space is allowed
   // between square brackets and parentheses (per Dingus).
   MT("notALink",
-     "[[foo]] (bar)");
+     "[link [[foo]]] (bar)");
 
   // Reference-style links
   MT("linkReference",
@@ -663,7 +886,7 @@
 
   // Reference-style links with EmStrong
   MT("linkReferenceEmStrong",
-     "[link [[][link&strong **][link&em&strong *foo**][link&em *][link ]]][string&url [[bar]]] hello");
+     "[link [[][link&em&strong ***foo***][link ]]][string&url [[bar]]] hello");
 
   // Reference-style links with optional space separator (per documentation)
   // "You can optionally use a space to separate the sets of brackets"
@@ -672,7 +895,7 @@
 
   // Should only allow a single space ("...use *a* space...")
   MT("linkReferenceDoubleSpace",
-     "[[foo]]  [[bar]] hello");
+     "[link [[foo]]]  [link [[bar]]] hello");
 
   // Reference-style links with implicit link name
   MT("linkImplicit",
@@ -733,7 +956,7 @@
      "[link [[foo \\]]: bar]]:] [string&url http://example.com/]");
 
   MT("labelEscapeEnd",
-     "[[foo\\]]: http://example.com/");
+     "\\[[foo\\]]: http://example.com/");
 
   MT("linkWeb",
      "[link <http://example.com/>] foo");
@@ -757,7 +980,7 @@
      "foo[em *bar*]hello");
 
   MT("emInWordUnderscore",
-     "foo[em _bar_]hello");
+     "foo_bar_hello");
 
   // Per documentation: "...surround an * or _ with spaces, it鈥檒l be
   // treated as a literal asterisk or underscore."
@@ -766,11 +989,11 @@
      "foo [em _bar _ hello_] world");
 
   MT("emEscapedBySpaceOut",
-     "foo _ bar[em _hello_]world");
+     "foo _ bar [em _hello_] world");
 
   MT("emEscapedByNewline",
      "foo",
-     "_ bar[em _hello_]world");
+     "_ bar [em _hello_] world");
 
   // Unclosed emphasis characters
   // Instead of simply marking as EM / STRONG, it would be nice to have an
@@ -791,14 +1014,14 @@
      "[em *foo][em&strong **bar*][strong hello**] world");
 
   MT("emStrongUnderscore",
-     "[em _foo][em&strong __bar_][strong hello__] world");
+     "[em _foo ][em&strong __bar_][strong  hello__] world");
 
   // "...same character must be used to open and close an emphasis span.""
   MT("emStrongMixed",
      "[em _foo][em&strong **bar*hello__ world]");
 
   MT("emStrongMixed",
-     "[em *foo][em&strong __bar_hello** world]");
+     "[em *foo ][em&strong __bar_hello** world]");
 
   MT("linkWithNestedParens",
      "[link [[foo]]][string&url (bar(baz))]")
@@ -913,26 +1136,77 @@
   TokenTypeOverrideTest("overrideStrikethrough",
     "[override-strikethrough ~~foo~~]");
 
+  TokenTypeOverrideTest("overrideEmoji",
+    "[override-emoji :foo:]");
+
   FormatTokenTypeOverrideTest("overrideFormatting",
     "[override-formatting-escape \\*]");
 
   // Tests to make sure GFM-specific things aren't getting through
 
   MT("taskList",
-     "[variable-2 * [ ]] bar]");
+     "[variable-2 * ][link&variable-2 [[ ]]][variable-2 bar]");
 
-  MT("noFencedCodeBlocks",
-     "~~~",
-     "foo",
-     "~~~");
+  MT("fencedCodeBlocks",
+     "[comment ```]",
+     "[comment foo]",
+     "",
+     "[comment bar]",
+     "[comment ```]",
+     "baz");
+
+  MT("fencedCodeBlocks_invalidClosingFence_trailingText",
+     "[comment ```]",
+     "[comment foo]",
+     "[comment ``` must not have trailing text]",
+     "[comment baz]");
+
+  MT("fencedCodeBlocks_invalidClosingFence_trailingTabs",
+     "[comment ```]",
+     "[comment foo]",
+     "[comment ```\t]",
+     "[comment baz]");
 
-  FencedTest("fencedCodeBlocks",
+  MT("fencedCodeBlocks_validClosingFence",
      "[comment ```]",
      "[comment foo]",
+     // may have trailing spaces
+     "[comment ```     ]",
+     "baz");
+
+  MT("fencedCodeBlocksInList_closingFenceIndented",
+     "[variable-2 - list]",
+     "    [variable-2&comment ```]",
+     "    [comment foo]",
+     "     [variable-2&comment ```]",
+     "    [variable-2 baz]");
+
+  MT("fencedCodeBlocksInList_closingFenceIndentedTooMuch",
+     "[variable-2 - list]",
+     "    [variable-2&comment ```]",
+     "    [comment foo]",
+     "      [comment ```]",
+     "    [comment baz]");
+
+  MT("fencedCodeBlockModeSwitching",
+     "[comment ```javascript]",
+     "[variable foo]",
+     "",
+     "[comment ```]",
+     "bar");
+
+  MT_noFencedHighlight("fencedCodeBlock_noHighlight",
+     "[comment ```javascript]",
+     "[comment foo]",
+     "[comment ```]");
+
+  MT("fencedCodeBlockModeSwitchingObjc",
+     "[comment ```objective-c]",
+     "[keyword @property] [variable NSString] [operator *] [variable foo];",
      "[comment ```]",
      "bar");
 
-  FencedTest("fencedCodeBlocksMultipleChars",
+  MT("fencedCodeBlocksMultipleChars",
      "[comment `````]",
      "[comment foo]",
      "[comment ```]",
@@ -940,20 +1214,20 @@
      "[comment `````]",
      "bar");
 
-  FencedTest("fencedCodeBlocksTildes",
+  MT("fencedCodeBlocksTildes",
      "[comment ~~~]",
      "[comment foo]",
      "[comment ~~~]",
      "bar");
 
-  FencedTest("fencedCodeBlocksTildesMultipleChars",
+  MT("fencedCodeBlocksTildesMultipleChars",
      "[comment ~~~~~]",
      "[comment ~~~]",
      "[comment foo]",
      "[comment ~~~~~]",
      "bar");
 
-  FencedTest("fencedCodeBlocksMultipleChars",
+  MT("fencedCodeBlocksMultipleChars",
      "[comment `````]",
      "[comment foo]",
      "[comment ```]",
@@ -961,19 +1235,42 @@
      "[comment `````]",
      "bar");
 
-  FencedTest("fencedCodeBlocksMixed",
+  MT("fencedCodeBlocksMixed",
      "[comment ~~~]",
      "[comment ```]",
      "[comment foo]",
      "[comment ~~~]",
      "bar");
 
+  MT("fencedCodeBlocksAfterBlockquote",
+     "[quote&quote-1 > foo]",
+     "[comment ```]",
+     "[comment bar]",
+     "[comment ```]");
+
+  // fencedCode indented too much should act as simple indentedCode
+  //  (hence has no highlight formatting)
+  FT("tooMuchIndentedFencedCode",
+     "    [comment ```]",
+     "    [comment code]",
+     "    [comment ```]");
+
+  MT("autoTerminateFencedCodeWhenLeavingList",
+     "[variable-2 - list1]",
+     "  [variable-3 - list2]",
+     "    [variable-3&comment ```]",
+     "    [comment code]",
+     "  [variable-3 - list2]",
+     "  [variable-2&comment ```]",
+     "  [comment code]",
+     "[quote&quote-1 > foo]");
+
   // Tests that require XML mode
 
   MT("xmlMode",
      "[tag&bracket <][tag div][tag&bracket >]",
-     "*foo*",
-     "[tag&bracket <][tag http://github.com][tag&bracket />]",
+     "  *foo*",
+     "  [tag&bracket <][tag http://github.com][tag&bracket />]",
      "[tag&bracket </][tag div][tag&bracket >]",
      "[link <http://github.com/>]");
 
@@ -986,4 +1283,7 @@
      "[tag&bracket <][tag div][tag&bracket >]",
      "[tag&bracket </][tag div][tag&bracket >]");
 
+  MT_noXml("xmlHighlightDisabled",
+     "<div>foo</div>");
+
 })();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/index.html.html
deleted file mode 100644
index 57c42985314a2b7f87dab277dcbbb12721795506..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/index.html.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Mathematica mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel=stylesheet href=../../lib/codemirror.css>
-<script src=../../lib/codemirror.js></script>
-<script src=../../addon/edit/matchbrackets.js></script>
-<script src=mathematica.js></script>
-<style type=text/css>
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Mathematica</a>
-  </ul>
-</div>
-
-<article>
-<h2>Mathematica mode</h2>
-
-
-<textarea id="mathematicaCode">
-(* example Mathematica code *)
-(* Dualisiert wird anhand einer Polarit盲t an einer
-   Quadrik $x^t Q x = 0$ mit regul盲rer Matrix $Q$ (also
-   mit $det(Q) \neq 0$), z.B. die Identit盲tsmatrix.
-   $p$ ist eine Liste von Polynomen - ein Ideal. *)
-dualize::"singular" = "Q must be regular: found Det[Q]==0.";
-dualize[ Q_, p_ ] := Block[
-    { m, n, xv, lv, uv, vars, polys, dual },
-    If[Det[Q] == 0,
-      Message[dualize::"singular"],
-      m = Length[p];
-      n = Length[Q] - 1;
-      xv = Table[Subscript[x, i], {i, 0, n}];
-      lv = Table[Subscript[l, i], {i, 1, m}];
-      uv = Table[Subscript[u, i], {i, 0, n}];
-      (* Konstruiere Ideal polys. *)
-      If[m == 0,
-        polys = Q.uv,
-        polys = Join[p, Q.uv - Transpose[Outer[D, p, xv]].lv]
-        ];
-      (* Eliminiere die ersten n + 1 + m Variablen xv und lv
-         aus dem Ideal polys. *)
-      vars = Join[xv, lv];
-      dual = GroebnerBasis[polys, uv, vars];
-      (* Ersetze u mit x im Ergebnis. *)
-      ReplaceAll[dual, Rule[u, x]]
-      ]
-    ]
-</textarea>
-
-<script>
-  var mathematicaEditor = CodeMirror.fromTextArea(document.getElementById('mathematicaCode'), {
-    mode: 'text/x-mathematica',
-    lineNumbers: true,
-    matchBrackets: true
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>text/x-mathematica</code> (Mathematica).</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/mathematica.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/mathematica.js.js
index d6977088ce1aff042b48586470e937140c67fe35..07e808b1e9386caeed29e9bec07b81b201a4d0d3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/mathematica.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mathematica/mathematica.js.js
@@ -71,12 +71,12 @@ CodeMirror.defineMode('mathematica', function(_config, _parserConfig) {
     }
 
     // usage
-    if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) {
+    if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::usage)/, true, false)) {
       return 'meta';
     }
 
     // message
-    if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
+    if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
       return 'string-2';
     }
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mbox/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mbox/index.html.html
deleted file mode 100644
index 248ea98e18a79580078c85af341e39276e77625c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mbox/index.html.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: mbox mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="mbox.js"></script>
-<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">mbox</a>
-  </ul>
-</div>
-
-<article>
-<h2>mbox mode</h2>
-<form><textarea id="code" name="code">
-From timothygu99@gmail.com Sun Apr 17 01:40:43 2016
-From: Timothy Gu &lt;timothygu99@gmail.com&gt;
-Date: Sat, 16 Apr 2016 18:40:43 -0700
-Subject: mbox mode
-Message-ID: &lt;Z8d+bTT50U/az94FZnyPkDjZmW0=@gmail.com&gt;
-
-mbox mode is working!
-
-Timothy
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>application/mbox</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mbox/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mbox/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mbox/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/meta.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/meta.js.js
index bb60502416a60640667488a326114b34c6d8f3fd..615b6a5883dd64873d3649ca92a43aff0e0ef6a3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/meta.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/meta.js.js
@@ -13,11 +13,11 @@
 
   CodeMirror.modeInfo = [
     {name: "APL", mime: "text/apl", mode: "apl", ext: ["dyalog", "apl"]},
-    {name: "PGP", mimes: ["application/pgp", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["pgp"]},
+    {name: "PGP", mimes: ["application/pgp", "application/pgp-encrypted", "application/pgp-keys", "application/pgp-signature"], mode: "asciiarmor", ext: ["asc", "pgp", "sig"]},
     {name: "ASN.1", mime: "text/x-ttcn-asn", mode: "asn.1", ext: ["asn", "asn1"]},
     {name: "Asterisk", mime: "text/x-asterisk", mode: "asterisk", file: /^extensions\.conf$/i},
     {name: "Brainfuck", mime: "text/x-brainfuck", mode: "brainfuck", ext: ["b", "bf"]},
-    {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h"]},
+    {name: "C", mime: "text/x-csrc", mode: "clike", ext: ["c", "h", "ino"]},
     {name: "C++", mime: "text/x-c++src", mode: "clike", ext: ["cpp", "c++", "cc", "cxx", "hpp", "h++", "hh", "hxx"], alias: ["cpp"]},
     {name: "Cobol", mime: "text/x-cobol", mode: "cobol", ext: ["cob", "cpy"]},
     {name: "C#", mime: "text/x-csharp", mode: "clike", ext: ["cs"], alias: ["csharp"]},
@@ -25,7 +25,7 @@
     {name: "ClojureScript", mime: "text/x-clojurescript", mode: "clojure", ext: ["cljs"]},
     {name: "Closure Stylesheets (GSS)", mime: "text/x-gss", mode: "css", ext: ["gss"]},
     {name: "CMake", mime: "text/x-cmake", mode: "cmake", ext: ["cmake", "cmake.in"], file: /^CMakeLists.txt$/},
-    {name: "CoffeeScript", mime: "text/x-coffeescript", mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
+    {name: "CoffeeScript", mimes: ["application/vnd.coffeescript", "text/coffeescript", "text/x-coffeescript"], mode: "coffeescript", ext: ["coffee"], alias: ["coffee", "coffee-script"]},
     {name: "Common Lisp", mime: "text/x-common-lisp", mode: "commonlisp", ext: ["cl", "lisp", "el"], alias: ["lisp"]},
     {name: "Cypher", mime: "application/x-cypher-query", mode: "cypher", ext: ["cyp", "cypher"]},
     {name: "Cython", mime: "text/x-cython", mode: "python", ext: ["pyx", "pxd", "pxi"]},
@@ -47,6 +47,7 @@
     {name: "Embedded Javascript", mime: "application/x-ejs", mode: "htmlembedded", ext: ["ejs"]},
     {name: "Embedded Ruby", mime: "application/x-erb", mode: "htmlembedded", ext: ["erb"]},
     {name: "Erlang", mime: "text/x-erlang", mode: "erlang", ext: ["erl"]},
+    {name: "Esper", mime: "text/x-esper", mode: "sql"},
     {name: "Factor", mime: "text/x-factor", mode: "factor", ext: ["factor"]},
     {name: "FCL", mime: "text/x-fcl", mode: "fcl"},
     {name: "Forth", mime: "text/x-forth", mode: "forth", ext: ["forth", "fth", "4th"]},
@@ -63,7 +64,7 @@
     {name: "Haxe", mime: "text/x-haxe", mode: "haxe", ext: ["hx"]},
     {name: "HXML", mime: "text/x-hxml", mode: "haxe", ext: ["hxml"]},
     {name: "ASP.NET", mime: "application/x-aspx", mode: "htmlembedded", ext: ["aspx"], alias: ["asp", "aspx"]},
-    {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]},
+    {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm", "handlebars", "hbs"], alias: ["xhtml"]},
     {name: "HTTP", mime: "message/http", mode: "http"},
     {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]},
     {name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"]},
@@ -91,15 +92,16 @@
     {name: "MySQL", mime: "text/x-mysql", mode: "sql"},
     {name: "Nginx", mime: "text/x-nginx-conf", mode: "nginx", file: /nginx.*\.conf$/i},
     {name: "NSIS", mime: "text/x-nsis", mode: "nsis", ext: ["nsh", "nsi"]},
-    {name: "NTriples", mime: "text/n-triples", mode: "ntriples", ext: ["nt"]},
-    {name: "Objective C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"], alias: ["objective-c", "objc"]},
+    {name: "NTriples", mimes: ["application/n-triples", "application/n-quads", "text/n-triples"],
+     mode: "ntriples", ext: ["nt", "nq"]},
+    {name: "Objective-C", mime: "text/x-objectivec", mode: "clike", ext: ["m", "mm"], alias: ["objective-c", "objc"]},
     {name: "OCaml", mime: "text/x-ocaml", mode: "mllike", ext: ["ml", "mli", "mll", "mly"]},
     {name: "Octave", mime: "text/x-octave", mode: "octave", ext: ["m"]},
     {name: "Oz", mime: "text/x-oz", mode: "oz", ext: ["oz"]},
     {name: "Pascal", mime: "text/x-pascal", mode: "pascal", ext: ["p", "pas"]},
     {name: "PEG.js", mime: "null", mode: "pegjs", ext: ["jsonld"]},
     {name: "Perl", mime: "text/x-perl", mode: "perl", ext: ["pl", "pm"]},
-    {name: "PHP", mime: "application/x-httpd-php", mode: "php", ext: ["php", "php3", "php4", "php5", "phtml"]},
+    {name: "PHP", mimes: ["text/x-php", "application/x-httpd-php", "application/x-httpd-php-open"], mode: "php", ext: ["php", "php3", "php4", "php5", "php7", "phtml"]},
     {name: "Pig", mime: "text/x-pig", mode: "pig", ext: ["pig"]},
     {name: "Plain Text", mime: "text/plain", mode: "null", ext: ["txt", "text", "conf", "def", "list", "log"]},
     {name: "PLSQL", mime: "text/x-plsql", mode: "sql", ext: ["pls"]},
@@ -120,22 +122,24 @@
     {name: "Scala", mime: "text/x-scala", mode: "clike", ext: ["scala"]},
     {name: "Scheme", mime: "text/x-scheme", mode: "scheme", ext: ["scm", "ss"]},
     {name: "SCSS", mime: "text/x-scss", mode: "css", ext: ["scss"]},
-    {name: "Shell", mime: "text/x-sh", mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
+    {name: "Shell", mimes: ["text/x-sh", "application/x-sh"], mode: "shell", ext: ["sh", "ksh", "bash"], alias: ["bash", "sh", "zsh"], file: /^PKGBUILD$/},
     {name: "Sieve", mime: "application/sieve", mode: "sieve", ext: ["siv", "sieve"]},
     {name: "Slim", mimes: ["text/x-slim", "application/x-slim"], mode: "slim", ext: ["slim"]},
     {name: "Smalltalk", mime: "text/x-stsrc", mode: "smalltalk", ext: ["st"]},
     {name: "Smarty", mime: "text/x-smarty", mode: "smarty", ext: ["tpl"]},
     {name: "Solr", mime: "text/x-solr", mode: "solr"},
+    {name: "SML", mime: "text/x-sml", mode: "mllike", ext: ["sml", "sig", "fun", "smackspec"]},
     {name: "Soy", mime: "text/x-soy", mode: "soy", ext: ["soy"], alias: ["closure template"]},
     {name: "SPARQL", mime: "application/sparql-query", mode: "sparql", ext: ["rq", "sparql"], alias: ["sparul"]},
     {name: "Spreadsheet", mime: "text/x-spreadsheet", mode: "spreadsheet", alias: ["excel", "formula"]},
     {name: "SQL", mime: "text/x-sql", mode: "sql", ext: ["sql"]},
+    {name: "SQLite", mime: "text/x-sqlite", mode: "sql"},
     {name: "Squirrel", mime: "text/x-squirrel", mode: "clike", ext: ["nut"]},
     {name: "Stylus", mime: "text/x-styl", mode: "stylus", ext: ["styl"]},
     {name: "Swift", mime: "text/x-swift", mode: "swift", ext: ["swift"]},
     {name: "sTeX", mime: "text/x-stex", mode: "stex"},
-    {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx"], alias: ["tex"]},
-    {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v"]},
+    {name: "LaTeX", mime: "text/x-latex", mode: "stex", ext: ["text", "ltx", "tex"], alias: ["tex"]},
+    {name: "SystemVerilog", mime: "text/x-systemverilog", mode: "verilog", ext: ["v", "sv", "svh"]},
     {name: "Tcl", mime: "text/x-tcl", mode: "tcl", ext: ["tcl"]},
     {name: "Textile", mime: "text/x-textile", mode: "textile", ext: ["textile"]},
     {name: "TiddlyWiki ", mime: "text/x-tiddlywiki", mode: "tiddlywiki"},
@@ -147,6 +151,7 @@
     {name: "TTCN_CFG", mime: "text/x-ttcn-cfg", mode: "ttcn-cfg", ext: ["cfg"]},
     {name: "Turtle", mime: "text/turtle", mode: "turtle", ext: ["ttl"]},
     {name: "TypeScript", mime: "application/typescript", mode: "javascript", ext: ["ts"], alias: ["ts"]},
+    {name: "TypeScript-JSX", mime: "text/typescript-jsx", mode: "jsx", ext: ["tsx"], alias: ["tsx"]},
     {name: "Twig", mime: "text/x-twig", mode: "twig"},
     {name: "Web IDL", mime: "text/x-webidl", mode: "webidl", ext: ["webidl"]},
     {name: "VB.NET", mime: "text/x-vb", mode: "vb", ext: ["vb"]},
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/index.html.html
deleted file mode 100644
index fd2f34e4baf4ad2ff79d7f8ed8577aee874be372..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/index.html.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: mIRC mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/twilight.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="mirc.js"></script>
-<style>.CodeMirror {border: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">mIRC</a>
-  </ul>
-</div>
-
-<article>
-<h2>mIRC mode</h2>
-<form><textarea id="code" name="code">
-;AKA Nick Tracker by Ford_Lawnmower irc.GeekShed.net #Script-Help
-;*****************************************************************************;
-;**Start Setup
-;Change JoinDisplay, below, for On Join AKA Display. On = 1 - Off = 0
-alias -l JoinDisplay { return 1 }
-;Change MaxNicks, below, to the number of nicknames you want to store for each hostmask. I wouldn't go over 400 with this ;/
-alias -l MaxNicks { return 20 }
-;Change AKALogo, below, To the text you want displayed before each AKA result.
-alias -l AKALogo { return 06 05A06K07A 06 }
-;**End Setup
-;*****************************************************************************;
-On *:Join:#: {
-  if ($nick == $me) { .timer 1 1 ialupdateCheck $chan }
-  NickNamesAdd $nick $+($network,$wildsite)
-  if ($JoinDisplay) { .timerNickNames $+ $nick 1 2 NickNames.display $nick $chan $network $wildsite }
-}
-on *:Nick: { NickNamesAdd $newnick $+($network,$wildsite) $nick }
-alias -l NickNames.display {
-  if ($gettok($hget(NickNames,$+($3,$4)),0,126) > 1) {
-    echo -g $2 $AKALogo $+(09,$1) $AKALogo 07 $mid($replace($hget(NickNames,$+($3,$4)),$chr(126),$chr(44)),2,-1)
-  }
-}
-alias -l NickNamesAdd {
-  if ($hget(NickNames,$2)) {
-    if (!$regex($hget(NickNames,$2),/~\Q $+ $replacecs($1,\E,\E\\E\Q) $+ \E~/i)) {
-      if ($gettok($hget(NickNames,$2),0,126) <= $MaxNicks) {
-        hadd NickNames $2 $+($hget(NickNames,$2),$1,~)
-      }
-      else {
-        hadd NickNames $2 $+($mid($hget(NickNames,$2),$pos($hget(NickNames,$2),~,2)),$1,~)
-      }
-    }
-  }
-  else {
-    hadd -m NickNames $2 $+(~,$1,~,$iif($3,$+($3,~)))
-  }
-}
-alias -l Fix.All.MindUser {
-  var %Fix.Count = $hfind(NickNames,/[^~]+[0-9]{4}~/,0,r).data
-  while (%Fix.Count) {
-    if ($Fix.MindUser($hget(NickNames,$hfind(NickNames,/[^~]+[0-9]{4}~/,%Fix.Count,r).data))) {
-      echo -ag Record %Fix.Count - $v1 - Was Cleaned
-      hadd NickNames $hfind(NickNames,/[^~]+[0-9]{4}~/,%Fix.Count,r).data $v1
-    }
-    dec %Fix.Count
-  }
-}
-alias -l Fix.MindUser { return $regsubex($1,/[^~]+[0-9]{4}~/g,$null) }
-menu nicklist,query {
-  -
-  .AKA
-  ..Check $$1: {
-    if ($gettok($hget(NickNames,$+($network,$address($1,2))),0,126) > 1) {
-      NickNames.display $1 $active $network $address($1,2)
-    }
-    else { echo -ag $AKALogo $+(09,$1) 07has not been known by any other nicknames while I have been watching. }
-  }
-  ..Cleanup $$1:hadd NickNames $+($network,$address($1,2)) $fix.minduser($hget(NickNames,$+($network,$address($1,2))))
-  ..Clear $$1:hadd NickNames $+($network,$address($1,2)) $+(~,$1,~)
-  ..AKA Search Dialog:dialog $iif($dialog(AKA_Search),-v,-m) AKA_Search AKA_Search
-  -
-}
-menu status,channel {
-  -
-  .AKA
-  ..AKA Search Dialog:dialog $iif($dialog(AKA_Search),-v,-m) AKA_Search AKA_Search
-  ..Clean All Records:Fix.All.Minduser
-  -
-}
-dialog AKA_Search {
-  title "AKA Search Engine"
-  size -1 -1 206 221
-  option dbu
-  edit "", 1, 8 5 149 10, autohs
-  button "Search", 2, 163 4 32 12
-  radio "Search HostMask", 4, 61 22 55 10
-  radio "Search Nicknames", 5, 123 22 56 10
-  list 6, 8 38 190 169, sort extsel vsbar
-  button "Check Selected", 7, 67 206 40 12
-  button "Close", 8, 160 206 38 12, cancel
-  box "Search Type", 3, 11 17 183 18
-  button "Copy to Clipboard", 9, 111 206 46 12
-}
-On *:Dialog:Aka_Search:init:*: { did -c $dname 5 }
-On *:Dialog:Aka_Search:Sclick:2,7,9: {
-  if ($did == 2) && ($did($dname,1)) {
-    did -r $dname 6
-    var %search $+(*,$v1,*), %type $iif($did($dname,5).state,data,item), %matches = $hfind(NickNames,%search,0,w). [ $+ [ %type ] ]
-    while (%matches) {
-      did -a $dname 6 $hfind(NickNames,%search,%matches,w). [ $+ [ %type ] ]
-      dec %matches
-    }
-    did -c $dname 6 1
-  }
-  elseif ($did == 7) && ($did($dname,6).seltext) { echo -ga $AKALogo 07 $mid($replace($hget(NickNames,$v1),$chr(126),$chr(44)),2,-1) }
-  elseif ($did == 9) && ($did($dname,6).seltext) { clipboard $mid($v1,$pos($v1,*,1)) }
-}
-On *:Start:{
-  if (!$hget(NickNames)) { hmake NickNames 10 }
-  if ($isfile(NickNames.hsh)) { hload  NickNames NickNames.hsh }
-}
-On *:Exit: { if ($hget(NickNames)) { hsave NickNames NickNames.hsh } }
-On *:Disconnect: { if ($hget(NickNames)) { hsave NickNames NickNames.hsh } }
-On *:Unload: { hfree NickNames }
-alias -l ialupdateCheck {
-  inc -z $+(%,ialupdateCheck,$network) $calc($nick($1,0) / 4)
-  ;If your ial is already being updated on join .who $1 out.
-  ;If you are using /names to update ial you will still need this line.
-  .who $1
-}
-Raw 352:*: {
-  if ($($+(%,ialupdateCheck,$network),2)) haltdef
-  NickNamesAdd $6 $+($network,$address($6,2))
-}
-Raw 315:*: {
-  if ($($+(%,ialupdateCheck,$network),2)) haltdef
-}
-
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        theme: "twilight",
-        lineNumbers: true,
-        matchBrackets: true,
-        indentUnit: 4,
-        mode: "text/mirc"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/mirc</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/mirc.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/mirc.js.js
index f0d5c6ad50e08c3e92562ef77f470ac9330d72d2..71ac4ddfd43561fe9872e5f2c4cdf02c3750546f 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/mirc.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mirc/mirc.js.js
@@ -130,7 +130,7 @@ CodeMirror.defineMode("mirc", function() {
       }
     }
     else if (ch == "%") {
-      stream.eatWhile(/[^,^\s^\(^\)]/);
+      stream.eatWhile(/[^,\s()]/);
       state.beforeParams = true;
       return "string";
     }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/index.html.html
deleted file mode 100644
index 5923af8f873a6ede18015df21684debf7c6ad746..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/index.html.html
+++ /dev/null
@@ -1,179 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: ML-like mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel=stylesheet href=../../lib/codemirror.css>
-<script src=../../lib/codemirror.js></script>
-<script src=../../addon/edit/matchbrackets.js></script>
-<script src=mllike.js></script>
-<style type=text/css>
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">ML-like</a>
-  </ul>
-</div>
-
-<article>
-<h2>OCaml mode</h2>
-
-
-<textarea id="ocamlCode">
-(* Summing a list of integers *)
-let rec sum xs =
-  match xs with
-    | []       -&gt; 0
-    | x :: xs' -&gt; x + sum xs'
-
-(* Quicksort *)
-let rec qsort = function
-   | [] -&gt; []
-   | pivot :: rest -&gt;
-       let is_less x = x &lt; pivot in
-       let left, right = List.partition is_less rest in
-       qsort left @ [pivot] @ qsort right
-
-(* Fibonacci Sequence *)
-let rec fib_aux n a b =
-  match n with
-  | 0 -&gt; a
-  | _ -&gt; fib_aux (n - 1) (a + b) a
-let fib n = fib_aux n 0 1
-
-(* Birthday paradox *)
-let year_size = 365.
-
-let rec birthday_paradox prob people =
-    let prob' = (year_size -. float people) /. year_size *. prob  in
-    if prob' &lt; 0.5 then
-        Printf.printf "answer = %d\n" (people+1)
-    else
-        birthday_paradox prob' (people+1) ;;
-
-birthday_paradox 1.0 1
-
-(* Church numerals *)
-let zero f x = x
-let succ n f x = f (n f x)
-let one = succ zero
-let two = succ (succ zero)
-let add n1 n2 f x = n1 f (n2 f x)
-let to_string n = n (fun k -&gt; "S" ^ k) "0"
-let _ = to_string (add (succ two) two)
-
-(* Elementary functions *)
-let square x = x * x;;
-let rec fact x =
-  if x &lt;= 1 then 1 else x * fact (x - 1);;
-
-(* Automatic memory management *)
-let l = 1 :: 2 :: 3 :: [];;
-[1; 2; 3];;
-5 :: l;;
-
-(* Polymorphism: sorting lists *)
-let rec sort = function
-  | [] -&gt; []
-  | x :: l -&gt; insert x (sort l)
-
-and insert elem = function
-  | [] -&gt; [elem]
-  | x :: l -&gt;
-      if elem &lt; x then elem :: x :: l else x :: insert elem l;;
-
-(* Imperative features *)
-let add_polynom p1 p2 =
-  let n1 = Array.length p1
-  and n2 = Array.length p2 in
-  let result = Array.create (max n1 n2) 0 in
-  for i = 0 to n1 - 1 do result.(i) &lt;- p1.(i) done;
-  for i = 0 to n2 - 1 do result.(i) &lt;- result.(i) + p2.(i) done;
-  result;;
-add_polynom [| 1; 2 |] [| 1; 2; 3 |];;
-
-(* We may redefine fact using a reference cell and a for loop *)
-let fact n =
-  let result = ref 1 in
-  for i = 2 to n do
-    result := i * !result
-   done;
-   !result;;
-fact 5;;
-
-(* Triangle (graphics) *)
-let () =
-  ignore( Glut.init Sys.argv );
-  Glut.initDisplayMode ~double_buffer:true ();
-  ignore (Glut.createWindow ~title:"OpenGL Demo");
-  let angle t = 10. *. t *. t in
-  let render () =
-    GlClear.clear [ `color ];
-    GlMat.load_identity ();
-    GlMat.rotate ~angle: (angle (Sys.time ())) ~z:1. ();
-    GlDraw.begins `triangles;
-    List.iter GlDraw.vertex2 [-1., -1.; 0., 1.; 1., -1.];
-    GlDraw.ends ();
-    Glut.swapBuffers () in
-  GlMat.mode `modelview;
-  Glut.displayFunc ~cb:render;
-  Glut.idleFunc ~cb:(Some Glut.postRedisplay);
-  Glut.mainLoop ()
-
-(* A Hundred Lines of Caml - http://caml.inria.fr/about/taste.en.html *)
-(* OCaml page on Wikipedia - http://en.wikipedia.org/wiki/OCaml *)
-</textarea>
-
-<h2>F# mode</h2>
-<textarea id="fsharpCode">
-module CodeMirror.FSharp
-
-let rec fib = function
-    | 0 -> 0
-    | 1 -> 1
-    | n -> fib (n - 1) + fib (n - 2)
-
-type Point =
-    {
-        x : int
-        y : int
-    }
-
-type Color =
-    | Red
-    | Green
-    | Blue
-
-[0 .. 10]
-|> List.map ((+) 2)
-|> List.fold (fun x y -> x + y) 0
-|> printf "%i"
-</textarea>
-
-
-<script>
-  var ocamlEditor = CodeMirror.fromTextArea(document.getElementById('ocamlCode'), {
-    mode: 'text/x-ocaml',
-    lineNumbers: true,
-    matchBrackets: true
-  });
-
-  var fsharpEditor = CodeMirror.fromTextArea(document.getElementById('fsharpCode'), {
-    mode: 'text/x-fsharp',
-    lineNumbers: true,
-    matchBrackets: true
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>text/x-ocaml</code> (OCaml) and <code>text/x-fsharp</code> (F#).</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/mllike.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/mllike.js.js
index 4d0be609c4dda4ff8cb08a3812fcf7c2b7ba8673..92b51cbc3417b4b3d53d49b87c8c296fcea48314 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/mllike.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mllike/mllike.js.js
@@ -13,31 +13,26 @@
 
 CodeMirror.defineMode('mllike', function(_config, parserConfig) {
   var words = {
-    'let': 'keyword',
-    'rec': 'keyword',
+    'as': 'keyword',
+    'do': 'keyword',
+    'else': 'keyword',
+    'end': 'keyword',
+    'exception': 'keyword',
+    'fun': 'keyword',
+    'functor': 'keyword',
+    'if': 'keyword',
     'in': 'keyword',
+    'include': 'keyword',
+    'let': 'keyword',
     'of': 'keyword',
-    'and': 'keyword',
-    'if': 'keyword',
+    'open': 'keyword',
+    'rec': 'keyword',
+    'struct': 'keyword',
     'then': 'keyword',
-    'else': 'keyword',
-    'for': 'keyword',
-    'to': 'keyword',
-    'while': 'keyword',
-    'do': 'keyword',
-    'done': 'keyword',
-    'fun': 'keyword',
-    'function': 'keyword',
-    'val': 'keyword',
     'type': 'keyword',
-    'mutable': 'keyword',
-    'match': 'keyword',
-    'with': 'keyword',
-    'try': 'keyword',
-    'open': 'builtin',
-    'ignore': 'builtin',
-    'begin': 'keyword',
-    'end': 'keyword'
+    'val': 'keyword',
+    'while': 'keyword',
+    'with': 'keyword'
   };
 
   var extraWords = parserConfig.extraWords || {};
@@ -54,6 +49,13 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
       state.tokenize = tokenString;
       return state.tokenize(stream, state);
     }
+    if (ch === '{') {
+      if (stream.eat('|')) {
+        state.longString = true;
+        state.tokenize = tokenLongString;
+        return state.tokenize(stream, state);
+      }
+    }
     if (ch === '(') {
       if (stream.eat('*')) {
         state.commentLevel++;
@@ -61,7 +63,7 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
         return state.tokenize(stream, state);
       }
     }
-    if (ch === '~') {
+    if (ch === '~' || ch === '?') {
       stream.eatWhile(/\w/);
       return 'variable-2';
     }
@@ -74,13 +76,24 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
       return 'comment';
     }
     if (/\d/.test(ch)) {
-      stream.eatWhile(/[\d]/);
-      if (stream.eat('.')) {
-        stream.eatWhile(/[\d]/);
+      if (ch === '0' && stream.eat(/[bB]/)) {
+        stream.eatWhile(/[01]/);
+      } if (ch === '0' && stream.eat(/[xX]/)) {
+        stream.eatWhile(/[0-9a-fA-F]/)
+      } if (ch === '0' && stream.eat(/[oO]/)) {
+        stream.eatWhile(/[0-7]/);
+      } else {
+        stream.eatWhile(/[\d_]/);
+        if (stream.eat('.')) {
+          stream.eatWhile(/[\d]/);
+        }
+        if (stream.eat(/[eE]/)) {
+          stream.eatWhile(/[\d\-+]/);
+        }
       }
       return 'number';
     }
-    if ( /[+\-*&%=<>!?|]/.test(ch)) {
+    if ( /[+\-*&%=<>!?|@\.~:]/.test(ch)) {
       return 'operator';
     }
     if (/[\w\xa1-\uffff]/.test(ch)) {
@@ -119,8 +132,20 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
     return 'comment';
   }
 
+  function tokenLongString(stream, state) {
+    var prev, next;
+    while (state.longString && (next = stream.next()) != null) {
+      if (prev === '|' && next === '}') state.longString = false;
+      prev = next;
+    }
+    if (!state.longString) {
+      state.tokenize = tokenBase;
+    }
+    return 'string';
+  }
+
   return {
-    startState: function() {return {tokenize: tokenBase, commentLevel: 0};},
+    startState: function() {return {tokenize: tokenBase, commentLevel: 0, longString: false};},
     token: function(stream, state) {
       if (stream.eatSpace()) return null;
       return state.tokenize(stream, state);
@@ -135,14 +160,64 @@ CodeMirror.defineMode('mllike', function(_config, parserConfig) {
 CodeMirror.defineMIME('text/x-ocaml', {
   name: 'mllike',
   extraWords: {
-    'succ': 'keyword',
+    'and': 'keyword',
+    'assert': 'keyword',
+    'begin': 'keyword',
+    'class': 'keyword',
+    'constraint': 'keyword',
+    'done': 'keyword',
+    'downto': 'keyword',
+    'external': 'keyword',
+    'function': 'keyword',
+    'initializer': 'keyword',
+    'lazy': 'keyword',
+    'match': 'keyword',
+    'method': 'keyword',
+    'module': 'keyword',
+    'mutable': 'keyword',
+    'new': 'keyword',
+    'nonrec': 'keyword',
+    'object': 'keyword',
+    'private': 'keyword',
+    'sig': 'keyword',
+    'to': 'keyword',
+    'try': 'keyword',
+    'value': 'keyword',
+    'virtual': 'keyword',
+    'when': 'keyword',
+
+    // builtins
+    'raise': 'builtin',
+    'failwith': 'builtin',
+    'true': 'builtin',
+    'false': 'builtin',
+
+    // Pervasives builtins
+    'asr': 'builtin',
+    'land': 'builtin',
+    'lor': 'builtin',
+    'lsl': 'builtin',
+    'lsr': 'builtin',
+    'lxor': 'builtin',
+    'mod': 'builtin',
+    'or': 'builtin',
+
+    // More Pervasives
+    'raise_notrace': 'builtin',
     'trace': 'builtin',
     'exit': 'builtin',
     'print_string': 'builtin',
     'print_endline': 'builtin',
-    'true': 'atom',
-    'false': 'atom',
-    'raise': 'keyword'
+
+     'int': 'type',
+     'float': 'type',
+     'bool': 'type',
+     'char': 'type',
+     'string': 'type',
+     'unit': 'type',
+
+     // Modules
+     'List': 'builtin'
   }
 });
 
@@ -150,18 +225,21 @@ CodeMirror.defineMIME('text/x-fsharp', {
   name: 'mllike',
   extraWords: {
     'abstract': 'keyword',
-    'as': 'keyword',
     'assert': 'keyword',
     'base': 'keyword',
+    'begin': 'keyword',
     'class': 'keyword',
     'default': 'keyword',
     'delegate': 'keyword',
+    'do!': 'keyword',
+    'done': 'keyword',
     'downcast': 'keyword',
     'downto': 'keyword',
     'elif': 'keyword',
-    'exception': 'keyword',
     'extern': 'keyword',
     'finally': 'keyword',
+    'for': 'keyword',
+    'function': 'keyword',
     'global': 'keyword',
     'inherit': 'keyword',
     'inline': 'keyword',
@@ -169,38 +247,108 @@ CodeMirror.defineMIME('text/x-fsharp', {
     'internal': 'keyword',
     'lazy': 'keyword',
     'let!': 'keyword',
-    'member' : 'keyword',
+    'match': 'keyword',
+    'member': 'keyword',
     'module': 'keyword',
+    'mutable': 'keyword',
     'namespace': 'keyword',
     'new': 'keyword',
     'null': 'keyword',
     'override': 'keyword',
     'private': 'keyword',
     'public': 'keyword',
-    'return': 'keyword',
     'return!': 'keyword',
+    'return': 'keyword',
     'select': 'keyword',
     'static': 'keyword',
-    'struct': 'keyword',
+    'to': 'keyword',
+    'try': 'keyword',
     'upcast': 'keyword',
-    'use': 'keyword',
     'use!': 'keyword',
-    'val': 'keyword',
+    'use': 'keyword',
+    'void': 'keyword',
     'when': 'keyword',
-    'yield': 'keyword',
     'yield!': 'keyword',
+    'yield': 'keyword',
+
+    // Reserved words
+    'atomic': 'keyword',
+    'break': 'keyword',
+    'checked': 'keyword',
+    'component': 'keyword',
+    'const': 'keyword',
+    'constraint': 'keyword',
+    'constructor': 'keyword',
+    'continue': 'keyword',
+    'eager': 'keyword',
+    'event': 'keyword',
+    'external': 'keyword',
+    'fixed': 'keyword',
+    'method': 'keyword',
+    'mixin': 'keyword',
+    'object': 'keyword',
+    'parallel': 'keyword',
+    'process': 'keyword',
+    'protected': 'keyword',
+    'pure': 'keyword',
+    'sealed': 'keyword',
+    'tailcall': 'keyword',
+    'trait': 'keyword',
+    'virtual': 'keyword',
+    'volatile': 'keyword',
 
+    // builtins
     'List': 'builtin',
     'Seq': 'builtin',
     'Map': 'builtin',
     'Set': 'builtin',
+    'Option': 'builtin',
     'int': 'builtin',
     'string': 'builtin',
-    'raise': 'builtin',
-    'failwith': 'builtin',
     'not': 'builtin',
     'true': 'builtin',
-    'false': 'builtin'
+    'false': 'builtin',
+
+    'raise': 'builtin',
+    'failwith': 'builtin'
+  },
+  slashComments: true
+});
+
+
+CodeMirror.defineMIME('text/x-sml', {
+  name: 'mllike',
+  extraWords: {
+    'abstype': 'keyword',
+    'and': 'keyword',
+    'andalso': 'keyword',
+    'case': 'keyword',
+    'datatype': 'keyword',
+    'fn': 'keyword',
+    'handle': 'keyword',
+    'infix': 'keyword',
+    'infixr': 'keyword',
+    'local': 'keyword',
+    'nonfix': 'keyword',
+    'op': 'keyword',
+    'orelse': 'keyword',
+    'raise': 'keyword',
+    'withtype': 'keyword',
+    'eqtype': 'keyword',
+    'sharing': 'keyword',
+    'sig': 'keyword',
+    'signature': 'keyword',
+    'structure': 'keyword',
+    'where': 'keyword',
+    'true': 'keyword',
+    'false': 'keyword',
+
+    // types
+    'int': 'builtin',
+    'real': 'builtin',
+    'string': 'builtin',
+    'char': 'builtin',
+    'bool': 'builtin'
   },
   slashComments: true
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/modelica/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/modelica/index.html.html
deleted file mode 100644
index 408c3b17e3b4f05acd8f2c51acda37bcba884c39..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/modelica/index.html.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Modelica mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<link rel="stylesheet" href="../../addon/hint/show-hint.css">
-<script src="../../addon/hint/show-hint.js"></script>
-<script src="modelica.js"></script>
-<style>.CodeMirror {border: 2px inset #dee;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Modelica</a>
-  </ul>
-</div>
-
-<article>
-<h2>Modelica mode</h2>
-
-<div><textarea id="modelica">
-model BouncingBall
-  parameter Real e = 0.7;
-  parameter Real g = 9.81;
-  Real h(start=1);
-  Real v;
-  Boolean flying(start=true);
-  Boolean impact;
-  Real v_new;
-equation
-  impact = h <= 0.0;
-  der(v) = if flying then -g else 0;
-  der(h) = v;
-  when {h <= 0.0 and v <= 0.0, impact} then
-    v_new = if edge(impact) then -e*pre(v) else 0;
-    flying = v_new > 0;
-    reinit(v, v_new);
-  end when;
-  annotation (uses(Modelica(version="3.2")));
-end BouncingBall;
-</textarea></div>
-
-    <script>
-      var modelicaEditor = CodeMirror.fromTextArea(document.getElementById("modelica"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-modelica"
-      });
-      var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
-      CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
-    </script>
-
-    <p>Simple mode that tries to handle Modelica as well as it can.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-modelica</code>
-    (Modlica code).</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/modelica/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/modelica/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/modelica/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mscgen/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mscgen/index.html.html
deleted file mode 100644
index b1d7e7c2e6efaab5f1644d1c2594dbf816c0ada6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mscgen/index.html.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: MscGen mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="mscgen.js"></script>
-<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">MscGen</a>
-  </ul>
-</div>
-
-<article>
-<h2>MscGen mode</h2>
-
-<div><textarea id="mscgen-code">
-# Sample mscgen program
-# See http://www.mcternan.me.uk/mscgen or
-# https://sverweij.github.io/mscgen_js for more samples
-msc {
-  # options
-  hscale="1.2";
-
-  # entities/ lifelines
-  a [label="Entity A"],
-  b [label="Entity B", linecolor="red", arclinecolor="red", textbgcolor="pink"],
-  c [label="Entity C"];
-
-  # arcs/ messages
-  a => c [label="doSomething(args)"];
-  b => c [label="doSomething(args)"];
-  c >> * [label="everyone asked me", arcskip="1"];
-  c =>> c [label="doing something"];
-  c -x * [label="report back", arcskip="1"];
-  |||;
-  --- [label="shows's over, however ..."];
-  b => a [label="did you see c doing something?"];
-  a -> b [label="nope"];
-  b :> a [label="shall we ask again?"];
-  a => b [label="naah"];
-  ...;
-}
-</textarea></div>
-
-<h2>X霉 mode</h2>
-
-<div><textarea id="xu-code">
-# X霉 - expansions to MscGen to support inline expressions
-#      https://github.com/sverweij/mscgen_js/blob/master/wikum/xu.md
-# More samples: https://sverweij.github.io/mscgen_js
-xu {
-  hscale="0.8",
-  width="700";
-
-  a,
-  b [label="change store"],
-  c,
-  d [label="necro queue"],
-  e [label="natalis queue"],
-  f;
-
-  a =>> b [label="get change list()"];
-  a alt f [label="changes found"] { /* alt is a xu specific keyword*/
-    b >> a [label="list of changes"];
-    a =>> c [label="cull old stuff (list of changes)"];
-    b loop e [label="for each change"] { // loop is xu specific as well...
-      /*
-       * Interesting stuff happens.
-       */
-      c =>> b [label="get change()"];
-      b >> c [label="change"];
-      c alt e [label="change too old"] {
-        c =>> d [label="queue(change)"];
-        --- [label="change newer than latest run"];
-        c =>> e [label="queue(change)"];
-        --- [label="all other cases"];
-        ||| [label="leave well alone"];
-      };
-    };
-
-    c >> a [label="done
-    processing"];
-
-    /* shucks! nothing found ...*/
-    --- [label="nothing found"];
-    b >> a [label="nothing"];
-    a note a [label="silent exit"];
-  };
-}
-</textarea></div>
-
-<h2>MsGenny mode</h2>
-<div><textarea id="msgenny-code">
-# MsGenny - simplified version of MscGen / X霉
-#           https://github.com/sverweij/mscgen_js/blob/master/wikum/msgenny.md
-# More samples: https://sverweij.github.io/mscgen_js
-a -> b   : a -> b  (signal);
-a => b   : a => b  (method);
-b >> a   : b >> a  (return value);
-a =>> b  : a =>> b (callback);
-a -x b   : a -x b  (lost);
-a :> b   : a :> b  (emphasis);
-a .. b   : a .. b  (dotted);
-a -- b   : "a -- b straight line";
-a note a : a note a\n(note),
-b box b  : b box b\n(action);
-a rbox a : a rbox a\n(reference),
-b abox b : b abox b\n(state/ condition);
-|||      : ||| (empty row);
-...      : ... (omitted row);
----      : --- (comment);
-</textarea></div>
-
-    <p>
-      Simple mode for highlighting MscGen and two derived sequence
-      chart languages.
-    </p>
-
-    <script>
-      var mscgenEditor = CodeMirror.fromTextArea(document.getElementById("mscgen-code"), {
-        lineNumbers: true,
-        mode: "text/x-mscgen",
-      });
-      var xuEditor = CodeMirror.fromTextArea(document.getElementById("xu-code"), {
-        lineNumbers: true,
-        mode: "text/x-xu",
-      });
-      var msgennyEditor = CodeMirror.fromTextArea(document.getElementById("msgenny-code"), {
-        lineNumbers: true,
-        mode: "text/x-msgenny",
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong>
-      <code>text/x-mscgen</code>
-      <code>text/x-xu</code>
-      <code>text/x-msgenny</code>
-    </p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mscgen/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mscgen/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mscgen/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mumps/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mumps/index.html.html
deleted file mode 100644
index b1f92c213f48ad3556f249957b0178c610b4c822..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mumps/index.html.html
+++ /dev/null
@@ -1,85 +0,0 @@
-锘�<!doctype html>
-
-<title>CodeMirror: MUMPS mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="mumps.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">MUMPS</a>
-  </ul>
-</div>
-
-<article>
-<h2>MUMPS mode</h2>
-
-
-<div><textarea id="code" name="code">
- ; Lloyd Milligan
- ; 03-30-2015
- ;
- ; MUMPS support for Code Mirror - Excerpts below from routine ^XUS
- ;
-CHECKAV(X1) ;Check A/V code return DUZ or Zero. (Called from XUSRB)
- N %,%1,X,Y,IEN,DA,DIK
- S IEN=0
- ;Start CCOW
- I $E(X1,1,7)="~~TOK~~" D  Q:IEN>0 IEN
- . I $E(X1,8,9)="~1" S IEN=$$CHKASH^XUSRB4($E(X1,8,255))
- . I $E(X1,8,9)="~2" S IEN=$$CHKCCOW^XUSRB4($E(X1,8,255))
- . Q
- ;End CCOW
- S X1=$$UP(X1) S:X1[":" XUTT=1,X1=$TR(X1,":")
- S X=$P(X1,";") Q:X="^" -1 S:XUF %1="Access: "_X
- Q:X'?1.20ANP 0
- S X=$$EN^XUSHSH(X) I '$D(^VA(200,"A",X)) D LBAV Q 0
- S %1="",IEN=$O(^VA(200,"A",X,0)),XUF(.3)=IEN D USER(IEN)
- S X=$P(X1,";",2) S:XUF %1="Verify: "_X S X=$$EN^XUSHSH(X)
- I $P(XUSER(1),"^",2)'=X D LBAV Q 0
- I $G(XUFAC(1)) S DIK="^XUSEC(4,",DA=XUFAC(1) D ^DIK
- Q IEN
- ;
- ; Spell out commands
- ;
-SET2() ;EF. Return error code (also called from XUSRB)
- NEW %,X
- SET XUNOW=$$HTFM^XLFDT($H),DT=$P(XUNOW,".")
- KILL DUZ,XUSER
- SET (DUZ,DUZ(2))=0,(DUZ(0),DUZ("AG"),XUSER(0),XUSER(1),XUTT,%UCI)=""
- SET %=$$INHIBIT^XUSRB() IF %>0 QUIT %
- SET X=$G(^%ZIS(1,XUDEV,"XUS")),XU1=$G(^(1))
- IF $L(X) FOR I=1:1:15 IF $L($P(X,U,I)) SET $P(XOPT,U,I)=$P(X,U,I)
- SET DTIME=600
- IF '$P(XOPT,U,11),$D(^%ZIS(1,XUDEV,90)),^(90)>2800000,^(90)'>DT QUIT 8
- QUIT 0
- ;
- ; Spell out commands and functions
- ;
- IF $PIECE(XUSER(0),U,11),$PIECE(XUSER(0),U,11)'>DT QUIT 11 ;Terminated
- IF $DATA(DUZ("ASH")) QUIT 0 ;If auto handle, Allow to sign-on p434
- IF $PIECE(XUSER(0),U,7) QUIT 5 ;Disuser flag set
- IF '$LENGTH($PIECE(XUSER(1),U,2)) QUIT 21 ;p419, p434
- Q 0
- ;
-  </textarea></div>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-         mode: "mumps",
-         lineNumbers: true,
-         lineWrapping: true
-      });
-    </script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mumps/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mumps/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/mumps/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nginx/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nginx/index.html.html
deleted file mode 100644
index 03cf671498878a43e3862e2701825fb118d92e92..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nginx/index.html.html
+++ /dev/null
@@ -1,181 +0,0 @@
-锘�<!doctype html>
-<head>
-<title>CodeMirror: NGINX mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="nginx.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-    <link rel="stylesheet" href="../../doc/docs.css">
-  </head>
-
-  <style>
-    body {
-      margin: 0em auto;
-    }
-
-    .CodeMirror, .CodeMirror-scroll {
-      height: 600px;
-    }
-  </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">NGINX</a>
-  </ul>
-</div>
-
-<article>
-<h2>NGINX mode</h2>
-<form><textarea id="code" name="code" style="height: 800px;">
-server {
-  listen 173.255.219.235:80;
-  server_name website.com.au;
-  rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
-}
-
-server {
-  listen 173.255.219.235:443;
-  server_name website.com.au;
-  rewrite / $scheme://www.$host$request_uri permanent; ## Forcibly prepend a www
-}
-
-server {
-
-  listen      173.255.219.235:80;
-  server_name www.website.com.au;
-
-
-
-  root        /data/www;
-  index       index.html index.php;
-
-  location / {
-    index index.html index.php;     ## Allow a static html file to be shown first
-    try_files $uri $uri/ @handler;  ## If missing pass the URI to Magento's front handler
-    expires 30d;                    ## Assume all files are cachable
-  }
-
-  ## These locations would be hidden by .htaccess normally
-  location /app/                { deny all; }
-  location /includes/           { deny all; }
-  location /lib/                { deny all; }
-  location /media/downloadable/ { deny all; }
-  location /pkginfo/            { deny all; }
-  location /report/config.xml   { deny all; }
-  location /var/                { deny all; }
-
-  location /var/export/ { ## Allow admins only to view export folder
-    auth_basic           "Restricted"; ## Message shown in login window
-    auth_basic_user_file /rs/passwords/testfile; ## See /etc/nginx/htpassword
-    autoindex            on;
-  }
-
-  location  /. { ## Disable .htaccess and other hidden files
-    return 404;
-  }
-
-  location @handler { ## Magento uses a common front handler
-    rewrite / /index.php;
-  }
-
-  location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
-    rewrite ^/(.*.php)/ /$1 last;
-  }
-
-  location ~ \.php$ {
-    if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
-
-    fastcgi_pass   127.0.0.1:9000;
-    fastcgi_index  index.php;
-    fastcgi_param PATH_INFO $fastcgi_script_name;
-    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
-    include        /rs/confs/nginx/fastcgi_params;
-  }
-
-}
-
-
-server {
-
-  listen              173.255.219.235:443;
-  server_name         website.com.au www.website.com.au;
-
-  root   /data/www;
-  index index.html index.php;
-
-  ssl                 on;
-  ssl_certificate     /rs/ssl/ssl.crt;
-  ssl_certificate_key /rs/ssl/ssl.key;
-
-  ssl_session_timeout  5m;
-
-  ssl_protocols  SSLv2 SSLv3 TLSv1;
-  ssl_ciphers  ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
-  ssl_prefer_server_ciphers   on;
-
-
-
-  location / {
-    index index.html index.php; ## Allow a static html file to be shown first
-    try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
-    expires 30d; ## Assume all files are cachable
-  }
-
-  ## These locations would be hidden by .htaccess normally
-  location /app/                { deny all; }
-  location /includes/           { deny all; }
-  location /lib/                { deny all; }
-  location /media/downloadable/ { deny all; }
-  location /pkginfo/            { deny all; }
-  location /report/config.xml   { deny all; }
-  location /var/                { deny all; }
-
-  location /var/export/ { ## Allow admins only to view export folder
-    auth_basic           "Restricted"; ## Message shown in login window
-    auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
-    autoindex            on;
-  }
-
-  location  /. { ## Disable .htaccess and other hidden files
-    return 404;
-  }
-
-  location @handler { ## Magento uses a common front handler
-    rewrite / /index.php;
-  }
-
-  location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
-    rewrite ^/(.*.php)/ /$1 last;
-  }
-
-  location ~ .php$ { ## Execute PHP scripts
-    if (!-e $request_filename) { rewrite  /index.php last; } ## Catch 404s that try_files miss
-
-    fastcgi_pass 127.0.0.1:9000;
-    fastcgi_index  index.php;
-    fastcgi_param PATH_INFO $fastcgi_script_name;
-    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
-    include        /rs/confs/nginx/fastcgi_params;
-
-    fastcgi_param HTTPS on;
-  }
-
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/nginx</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nginx/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nginx/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nginx/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/index.html.html
deleted file mode 100644
index 2afae87f0814d8cd0843ca5abab0eaae6689f3a2..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/index.html.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: NSIS mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel=stylesheet href=../../lib/codemirror.css>
-<script src=../../lib/codemirror.js></script>
-<script src="../../addon/mode/simple.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src=nsis.js></script>
-<style type=text/css>
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">NSIS</a>
-  </ul>
-</div>
-
-<article>
-<h2>NSIS mode</h2>
-
-
-<textarea id=code>
-; This is a comment
-!ifdef ERROR
-    !error "Something went wrong"
-!endif
-
-OutFile "demo.exe"
-RequestExecutionLevel user
-SetDetailsPrint listonly
-
-!include "LogicLib.nsh"
-!include "WinVer.nsh"
-
-Section -mandatory
-
-    Call logWinVer
-
-    ${If} 1 > 0
-      MessageBox MB_OK "Hello world"
-    ${EndIf}
-
-SectionEnd
-
-Function logWinVer
-
-    ${If} ${IsWin10}
-        DetailPrint "Windows 10!"
-    ${ElseIf} ${AtLeastWinVista}
-        DetailPrint "We're post-XP"
-    ${Else}
-        DetailPrint "Legacy system"
-    ${EndIf}
-
-FunctionEnd
-</textarea>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
-    mode: 'nsis',
-    indentWithTabs: true,
-    smartIndent: true,
-    lineNumbers: true,
-    matchBrackets: true
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>text/x-nsis</code>.</p>
-</article>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/nsis.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/nsis.js.js
index dc8c74cdf424b0c2707466750da1b3f1fb1db8c5..69bc95074f14280bfa38ec2adca7085156f4e88b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/nsis.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/nsis/nsis.js.js
@@ -24,20 +24,20 @@ CodeMirror.defineSimpleMode("nsis",{
     { regex: /`(?:[^\\`]|\\.)*`?/, token: "string" },
 
     // Compile Time Commands
-    {regex: /^\s*(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|finalize|getdllversion|system|tempfile|warning|verbose|define|undef|insertmacro|makensis|searchparse|searchreplace))\b/, token: "keyword"},
+    {regex: /^\s*(?:\!(include|addincludedir|addplugindir|appendfile|cd|delfile|echo|error|execute|packhdr|pragma|finalize|getdllversion|gettlbversion|system|tempfile|warning|verbose|define|undef|insertmacro|macro|macroend|makensis|searchparse|searchreplace))\b/, token: "keyword"},
 
     // Conditional Compilation
     {regex: /^\s*(?:\!(if(?:n?def)?|ifmacron?def|macro))\b/, token: "keyword", indent: true},
     {regex: /^\s*(?:\!(else|endif|macroend))\b/, token: "keyword", dedent: true},
 
     // Runtime Commands
-    {regex: /^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|IntCmp|IntCmpU|IntFmt|IntOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
+    {regex: /^\s*(?:Abort|AddBrandingImage|AddSize|AllowRootDirInstall|AllowSkipFiles|AutoCloseWindow|BGFont|BGGradient|BrandingText|BringToFront|Call|CallInstDLL|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|CRCCheck|CreateDirectory|CreateFont|CreateShortCut|Delete|DeleteINISec|DeleteINIStr|DeleteRegKey|DeleteRegValue|DetailPrint|DetailsButtonText|DirText|DirVar|DirVerify|EnableWindow|EnumRegKey|EnumRegValue|Exch|Exec|ExecShell|ExecShellWait|ExecWait|ExpandEnvStrings|File|FileBufSize|FileClose|FileErrorText|FileOpen|FileRead|FileReadByte|FileReadUTF16LE|FileReadWord|FileWriteUTF16LE|FileSeek|FileWrite|FileWriteByte|FileWriteWord|FindClose|FindFirst|FindNext|FindWindow|FlushINI|GetCurInstType|GetCurrentAddress|GetDlgItem|GetDLLVersion|GetDLLVersionLocal|GetErrorLevel|GetFileTime|GetFileTimeLocal|GetFullPathName|GetFunctionAddress|GetInstDirError|GetLabelAddress|GetTempFileName|Goto|HideWindow|Icon|IfAbort|IfErrors|IfFileExists|IfRebootFlag|IfSilent|InitPluginsDir|InstallButtonText|InstallColors|InstallDir|InstallDirRegKey|InstProgressFlags|InstType|InstTypeGetText|InstTypeSetText|Int64Cmp|Int64CmpU|Int64Fmt|IntCmp|IntCmpU|IntFmt|IntOp|IntPtrCmp|IntPtrCmpU|IntPtrOp|IsWindow|LangString|LicenseBkColor|LicenseData|LicenseForceSelection|LicenseLangString|LicenseText|LoadLanguageFile|LockWindow|LogSet|LogText|ManifestDPIAware|ManifestSupportedOS|MessageBox|MiscButtonText|Name|Nop|OutFile|Page|PageCallbacks|PEDllCharacteristics|PESubsysVer|Pop|Push|Quit|ReadEnvStr|ReadINIStr|ReadRegDWORD|ReadRegStr|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|RMDir|SearchPath|SectionGetFlags|SectionGetInstTypes|SectionGetSize|SectionGetText|SectionIn|SectionSetFlags|SectionSetInstTypes|SectionSetSize|SectionSetText|SendMessage|SetAutoClose|SetBrandingImage|SetCompress|SetCompressor|SetCompressorDictSize|SetCtlColors|SetCurInstType|SetDatablockOptimize|SetDateSave|SetDetailsPrint|SetDetailsView|SetErrorLevel|SetErrors|SetFileAttributes|SetFont|SetOutPath|SetOverwrite|SetRebootFlag|SetRegView|SetShellVarContext|SetSilent|ShowInstDetails|ShowUninstDetails|ShowWindow|SilentInstall|SilentUnInstall|Sleep|SpaceTexts|StrCmp|StrCmpS|StrCpy|StrLen|SubCaption|Unicode|UninstallButtonText|UninstallCaption|UninstallIcon|UninstallSubCaption|UninstallText|UninstPage|UnRegDLL|Var|VIAddVersionKey|VIFileVersion|VIProductVersion|WindowIcon|WriteINIStr|WriteRegBin|WriteRegDWORD|WriteRegExpandStr|WriteRegMultiStr|WriteRegNone|WriteRegStr|WriteUninstaller|XPStyle)\b/, token: "keyword"},
     {regex: /^\s*(?:Function|PageEx|Section(?:Group)?)\b/, token: "keyword", indent: true},
     {regex: /^\s*(?:(Function|PageEx|Section(?:Group)?)End)\b/, token: "keyword", dedent: true},
 
     // Command Options
-    {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR|HKCU|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
-    {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|right|show|silent|silentlog|textonly|top|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
+    {regex: /\b(?:ARCHIVE|FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_OFFLINE|FILE_ATTRIBUTE_READONLY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_TEMPORARY|HIDDEN|HKCC|HKCR(32|64)?|HKCU(32|64)?|HKDD|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_DYN_DATA|HKEY_LOCAL_MACHINE|HKEY_PERFORMANCE_DATA|HKEY_USERS|HKLM(32|64)?|HKPD|HKU|IDABORT|IDCANCEL|IDD_DIR|IDD_INST|IDD_INSTFILES|IDD_LICENSE|IDD_SELCOM|IDD_UNINST|IDD_VERIFY|IDIGNORE|IDNO|IDOK|IDRETRY|IDYES|MB_ABORTRETRYIGNORE|MB_DEFBUTTON1|MB_DEFBUTTON2|MB_DEFBUTTON3|MB_DEFBUTTON4|MB_ICONEXCLAMATION|MB_ICONINFORMATION|MB_ICONQUESTION|MB_ICONSTOP|MB_OK|MB_OKCANCEL|MB_RETRYCANCEL|MB_RIGHT|MB_RTLREADING|MB_SETFOREGROUND|MB_TOPMOST|MB_USERICON|MB_YESNO|MB_YESNOCANCEL|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SW_HIDE|SW_SHOWDEFAULT|SW_SHOWMAXIMIZED|SW_SHOWMINIMIZED|SW_SHOWNORMAL|SYSTEM|TEMPORARY)\b/, token: "atom"},
+    {regex: /\b(?:admin|all|auto|both|bottom|bzip2|components|current|custom|directory|false|force|hide|highest|ifdiff|ifnewer|instfiles|lastused|leave|left|license|listonly|lzma|nevershow|none|normal|notset|off|on|right|show|silent|silentlog|textonly|top|true|try|un\.components|un\.custom|un\.directory|un\.instfiles|un\.license|uninstConfirm|user|Win10|Win7|Win8|WinVista|zlib)\b/, token: "builtin"},
 
     // LogicLib.nsh
     {regex: /\$\{(?:And(?:If(?:Not)?|Unless)|Break|Case(?:Else)?|Continue|Default|Do(?:Until|While)?|Else(?:If(?:Not)?|Unless)?|End(?:If|Select|Switch)|Exit(?:Do|For|While)|For(?:Each)?|If(?:Cmd|Not(?:Then)?|Then)?|Loop(?:Until|While)?|Or(?:If(?:Not)?|Unless)|Select|Switch|Unless|While)\}/, token: "variable-2", indent: true},
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/index.html.html
deleted file mode 100644
index 1355e7189e53ac1a67e173db0a859612a3c2ea17..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/index.html.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: NTriples mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="ntriples.js"></script>
-<style type="text/css">
-      .CodeMirror {
-        border: 1px solid #eee;
-      }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">NTriples</a>
-  </ul>
-</div>
-
-<article>
-<h2>NTriples mode</h2>
-<form>
-<textarea id="ntriples" name="ntriples">    
-<http://Sub1>     <http://pred1>     <http://obj> .
-<http://Sub2>     <http://pred2#an2> "literal 1" .
-<http://Sub3#an3> <http://pred3>     _:bnode3 .
-_:bnode4          <http://pred4>     "literal 2"@lang .
-_:bnode5          <http://pred5>     "literal 3"^^<http://type> .
-</textarea>
-</form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("ntriples"), {});
-    </script>
-    <p><strong>MIME types defined:</strong> <code>text/n-triples</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/ntriples.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/ntriples.js.js
index 0524b1e8ab653bcec45190ab66d5228aecfbd24a..148272e1fd25a587647b7c0028ed03fdd4ce36cd 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/ntriples.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ntriples/ntriples.js.js
@@ -3,9 +3,9 @@
 
 /**********************************************************
 * This script provides syntax highlighting support for
-* the Ntriples format.
-* Ntriples format specification:
-*     http://www.w3.org/TR/rdf-testcases/#ntriples
+* the N-Triples format.
+* N-Triples format specification:
+*     https://www.w3.org/TR/n-triples/
 ***********************************************************/
 
 /*
@@ -181,6 +181,15 @@ CodeMirror.defineMode("ntriples", function() {
   };
 });
 
+// define the registered Media Type for n-triples:
+// https://www.w3.org/TR/n-triples/#n-triples-mediatype
+CodeMirror.defineMIME("application/n-triples", "ntriples");
+
+// N-Quads is based on the N-Triples format (so same highlighting works)
+// https://www.w3.org/TR/n-quads/
+CodeMirror.defineMIME("application/n-quads", "ntriples");
+
+// previously used, though technically incorrect media type for n-triples
 CodeMirror.defineMIME("text/n-triples", "ntriples");
 
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/index.html.html
deleted file mode 100644
index 3490ee63712d467540b79a5440bbec7c25140949..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/index.html.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Octave mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="octave.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Octave</a>
-  </ul>
-</div>
-
-<article>
-<h2>Octave mode</h2>
-
-    <div><textarea id="code" name="code">
-%numbers
-[1234 1234i 1234j]
-[.234 .234j 2.23i]
-[23e2 12E1j 123D-4 0x234]
-
-%strings
-'asda''a'
-"asda""a"
-
-%identifiers
-a + as123 - __asd__
-
-%operators
--
-+
-=
-==
->
-<
->=
-<=
-&
-~
-...
-break zeros default margin round ones rand
-ceil floor size clear zeros eye mean std cov
-error eval function
-abs acos atan asin cos cosh exp log prod sum
-log10 max min sign sin sinh sqrt tan reshape
-return
-case switch
-else elseif end if otherwise
-do for while
-try catch
-classdef properties events methods
-global persistent
-
-%one line comment
-%{ multi 
-line comment %}
-
-    </textarea></div>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "octave",
-               version: 2,
-               singleLineStringErrors: false},
-        lineNumbers: true,
-        indentUnit: 4,
-        matchBrackets: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-octave</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/octave.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/octave.js.js
index f38b751d1b5ddec310e5579101b131f8ce8b7bcf..b77ad682ed258ba38f6406448778c29ddb86baae 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/octave.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/octave/octave.js.js
@@ -90,8 +90,8 @@ CodeMirror.defineMode("octave", function() {
     if (stream.match(wordRegexp(['nan','NaN','inf','Inf']))) { return 'number'; };
 
     // Handle Strings
-    if (stream.match(/^"([^"]|(""))*"/)) { return 'string'; } ;
-    if (stream.match(/^'([^']|(''))*'/)) { return 'string'; } ;
+    var m = stream.match(/^"(?:[^"]|"")*("|$)/) || stream.match(/^'(?:[^']|'')*('|$)/)
+    if (m) { return m[1] ? 'string' : "string error"; }
 
     // Handle words
     if (stream.match(keywords)) { return 'keyword'; } ;
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/index.html.html
deleted file mode 100644
index febd82a59a3ec2a975cb3156e7cba0cdb43fef42..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/index.html.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Oz mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="oz.js"></script>
-<script type="text/javascript" src="../../addon/runmode/runmode.js"></script>
-<style>
-  .CodeMirror {border: 1px solid #aaa;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Oz</a>
-  </ul>
-</div>
-
-<article>
-<h2>Oz mode</h2>
-<textarea id="code" name="code">
-declare
-fun {Ints N Max}
-  if N == Max then nil
-  else
-    {Delay 1000}
-    N|{Ints N+1 Max}
-  end
-end
-
-fun {Sum S Stream}
-  case Stream of nil then S
-  [] H|T then S|{Sum H+S T} end
-end
-
-local X Y in
-  thread X = {Ints 0 1000} end
-  thread Y = {Sum 0 X} end
-  {Browse Y}
-end
-</textarea>
-<p>MIME type defined: <code>text/x-oz</code>.</p>
-
-<script type="text/javascript">
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    mode: "text/x-oz",
-    readOnly: false
-});
-</script>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/oz.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/oz.js.js
index ee8cb0ad1547b3ce50733c8e3eb08e29ed4f066e..50ffda37a656a529cf145b2cbb1ba4dbfd843c79 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/oz.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/oz/oz.js.js
@@ -27,7 +27,7 @@ CodeMirror.defineMode("oz", function (conf) {
 
   var atoms = wordRegexp(["true", "false", "nil", "unit"]);
   var commonKeywords = wordRegexp(["andthen", "at", "attr", "declare", "feat", "from", "lex",
-    "mod", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]);
+    "mod", "div", "mode", "orelse", "parser", "prod", "prop", "scanner", "self", "syn", "token"]);
   var openingKeywords = wordRegexp(["local", "proc", "fun", "case", "class", "if", "cond", "or", "dis",
     "choice", "not", "thread", "try", "raise", "lock", "for", "suchthat", "meth", "functor"]);
   var middleKeywords = wordRegexp(middle);
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pascal/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pascal/index.html.html
deleted file mode 100644
index f8a99ad01ecd2b12c49d0c7de93247aefccd0906..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pascal/index.html.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Pascal mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="pascal.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Pascal</a>
-  </ul>
-</div>
-
-<article>
-<h2>Pascal mode</h2>
-
-
-<div><textarea id="code" name="code">
-(* Example Pascal code *)
-
-while a <> b do writeln('Waiting');
- 
-if a > b then 
-  writeln('Condition met')
-else 
-  writeln('Condition not met');
- 
-for i := 1 to 10 do 
-  writeln('Iteration: ', i:1);
- 
-repeat
-  a := a + 1
-until a = 10;
- 
-case i of
-  0: write('zero');
-  1: write('one');
-  2: write('two')
-end;
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "text/x-pascal"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-pascal</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pascal/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pascal/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pascal/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pegjs/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pegjs/index.html.html
deleted file mode 100644
index 0c746048815127713ae9d7ad0da02e84c626f3d0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pegjs/index.html.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <title>CodeMirror: PEG.js Mode</title>
-    <meta charset="utf-8"/>
-    <link rel=stylesheet href="../../doc/docs.css">
-
-    <link rel="stylesheet" href="../../lib/codemirror.css">
-    <script src="../../lib/codemirror.js"></script>
-    <script src="../javascript/javascript.js"></script>
-    <script src="pegjs.js"></script>
-    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-  </head>
-  <body>
-    <div id=nav>
-      <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-      <ul>
-        <li><a href="../../index.html">Home</a>
-        <li><a href="../../doc/manual.html">Manual</a>
-        <li><a href="https://github.com/codemirror/codemirror">Code</a>
-      </ul>
-      <ul>
-        <li><a href="../index.html">Language modes</a>
-        <li><a class=active href="#">PEG.js Mode</a>
-      </ul>
-    </div>
-
-    <article>
-      <h2>PEG.js Mode</h2>
-      <form><textarea id="code" name="code">
-/*
- * Classic example grammar, which recognizes simple arithmetic expressions like
- * "2*(3+4)". The parser generated from this grammar then computes their value.
- */
-
-start
-  = additive
-
-additive
-  = left:multiplicative "+" right:additive { return left + right; }
-  / multiplicative
-
-multiplicative
-  = left:primary "*" right:multiplicative { return left * right; }
-  / primary
-
-primary
-  = integer
-  / "(" additive:additive ")" { return additive; }
-
-integer "integer"
-  = digits:[0-9]+ { return parseInt(digits.join(""), 10); }
-
-letter = [a-z]+</textarea></form>
-      <script>
-        var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-          mode: {name: "pegjs"},
-          lineNumbers: true
-        });
-      </script>
-      <h3>The PEG.js Mode</h3>
-      <p> Created by Forbes Lindesay.</p>
-    </article>
-  </body>
-</html>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pegjs/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pegjs/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pegjs/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/perl/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/perl/index.html.html
deleted file mode 100644
index 8c1021c42bff4296c86a6c75c743878941811673..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/perl/index.html.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Perl mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="perl.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Perl</a>
-  </ul>
-</div>
-
-<article>
-<h2>Perl mode</h2>
-
-
-<div><textarea id="code" name="code">
-#!/usr/bin/perl
-
-use Something qw(func1 func2);
-
-# strings
-my $s1 = qq'single line';
-our $s2 = q(multi-
-              line);
-
-=item Something
-	Example.
-=cut
-
-my $html=<<'HTML'
-<html>
-<title>hi!</title>
-</html>
-HTML
-
-print "first,".join(',', 'second', qq~third~);
-
-if($s1 =~ m[(?<!\s)(l.ne)\z]o) {
-	$h->{$1}=$$.' predefined variables';
-	$s2 =~ s/\-line//ox;
-	$s1 =~ s[
-		  line ]
-		[
-		  block
-		]ox;
-}
-
-1; # numbers and comments
-
-__END__
-something...
-
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-perl</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/perl/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/perl/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/perl/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/index.html.html
deleted file mode 100644
index adf6b1be22638fb21091ff9923014ed69185e57a..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/index.html.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: PHP mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../css/css.js"></script>
-<script src="../clike/clike.js"></script>
-<script src="php.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">PHP</a>
-  </ul>
-</div>
-
-<article>
-<h2>PHP mode</h2>
-<form><textarea id="code" name="code">
-<?php
-$a = array('a' => 1, 'b' => 2, 3 => 'c');
-
-echo "$a[a] ${a[3] /* } comment */} {$a[b]} \$a[a]";
-
-function hello($who) {
-	return "Hello $who!";
-}
-?>
-<p>The program says <?= hello("World") ?>.</p>
-<script>
-	alert("And here is some JS code"); // also colored
-</script>
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "application/x-httpd-php",
-        indentUnit: 4,
-        indentWithTabs: true
-      });
-    </script>
-
-    <p>Simple HTML/PHP mode based on
-    the <a href="../clike/">C-like</a> mode. Depends on XML,
-    JavaScript, CSS, HTMLMixed, and C-like modes.</p>
-
-    <p><strong>MIME types defined:</strong> <code>application/x-httpd-php</code> (HTML with PHP code), <code>text/x-php</code> (plain, non-wrapped PHP code).</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/php.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/php.js.js
index 57ba812d7268cb8a48b188fc9b039251dcf1a0d4..589c9a6639540da3a2bd9a0521475a167a6a3814 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/php.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/php/php.js.js
@@ -151,7 +151,7 @@
   };
 
   CodeMirror.defineMode("php", function(config, parserConfig) {
-    var htmlMode = CodeMirror.getMode(config, "text/html");
+    var htmlMode = CodeMirror.getMode(config, (parserConfig && parserConfig.htmlMode) || "text/html");
     var phpMode = CodeMirror.getMode(config, phpConfig);
 
     function dispatch(stream, state) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pig/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pig/index.html.html
deleted file mode 100644
index ea77f70441b2a877969063b1b64dbcad1b0edb0f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pig/index.html.html
+++ /dev/null
@@ -1,53 +0,0 @@
-锘�<!doctype html>
-<title>CodeMirror: Pig Latin mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="pig.js"></script>
-<style>.CodeMirror {border: 2px inset #dee;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Pig Latin</a>
-  </ul>
-</div>
-
-<article>
-<h2>Pig Latin mode</h2>
-<form><textarea id="code" name="code">
--- Apache Pig (Pig Latin Language) Demo
-/* 
-This is a multiline comment.
-*/
-a = LOAD "\path\to\input" USING PigStorage('\t') AS (x:long, y:chararray, z:bytearray);
-b = GROUP a BY (x,y,3+4);
-c = FOREACH b GENERATE flatten(group) as (x,y), SUM(group.$2) as z;
-STORE c INTO "\path\to\output";
-
---
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        indentUnit: 4,
-        mode: "text/x-pig"
-      });
-    </script>
-
-    <p>
-        Simple mode that handles Pig Latin language.
-    </p>
-
-    <p><strong>MIME type defined:</strong> <code>text/x-pig</code>
-    (PIG code)
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pig/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pig/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pig/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/index.html.html
deleted file mode 100644
index 6b235df8f1bcb19fab04bde54c3cc9d8f57c669a..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/index.html.html
+++ /dev/null
@@ -1,204 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-    <title>CodeMirror: Powershell mode</title>
-    <link rel="stylesheet" href="../../doc/docs.css">
-    <link rel="stylesheet" href="../../lib/codemirror.css">
-    <script src="../../lib/codemirror.js"></script>
-    <script src="powershell.js"></script>
-    <style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-  </head>
-  <body>
-    <div id=nav>
-      <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-      <ul>
-        <li><a href="../../index.html">Home</a>
-        <li><a href="../../doc/manual.html">Manual</a>
-        <li><a href="https://github.com/codemirror/codemirror">Code</a>
-      </ul>
-      <ul>
-        <li><a href="../index.html">Language modes</a>
-        <li><a class=active href="#">JavaScript</a>
-      </ul>
-    </div>
-    <article>
-      <h2>PowerShell mode</h2>
-
-      <div><textarea id="code" name="code">
-# Number Literals
-0 12345
-12kb 12mb 12gB 12Tb 12PB 12L 12D 12lkb 12dtb
-1.234 1.234e56 1. 1.e2 .2 .2e34
-1.2MB 1.kb .1dTb 1.e1gb
-0x1 0xabcdef 0x3tb 0xelmb
-
-# String Literals
-'Literal escaping'''
-'Literal $variable'
-"Escaping 1`""
-"Escaping 2"""
-"Escaped `$variable"
-"Text, $variable and more text"
-"Text, ${variable with spaces} and more text."
-"Text, $($expression + 3) and more text."
-"Text, $("interpolation $("inception")") and more text."
-
-@"
-Multiline
-string
-"@
-# --
-@"
-Multiline
-string with quotes "'
-"@
-# --
-@'
-Multiline literal
-string with quotes "'
-'@
-
-# Array and Hash literals
-@( 'a','b','c' )
-@{ 'key': 'value' }
-
-# Variables
-$Variable = 5
-$global:variable = 5
-${Variable with spaces} = 5
-
-# Operators
-= += -= *= /= %=
-++ -- .. -f * / % + -
--not ! -bnot
--split -isplit -csplit
--join
--is -isnot -as
--eq -ieq -ceq -ne -ine -cne
--gt -igt -cgt -ge -ige -cge
--lt -ilt -clt -le -ile -cle
--like -ilike -clike -notlike -inotlike -cnotlike
--match -imatch -cmatch -notmatch -inotmatch -cnotmatch
--contains -icontains -ccontains -notcontains -inotcontains -cnotcontains
--replace -ireplace -creplace
--band	-bor -bxor
--and -or -xor
-
-# Punctuation
-() [] {} , : ` = ; .
-
-# Keywords
-elseif begin function for foreach return else trap while do data dynamicparam
-until end break if throw param continue finally in switch exit filter from try
-process catch
-
-# Built-in variables
-$$ $? $^ $_
-$args $ConfirmPreference $ConsoleFileName $DebugPreference $Error
-$ErrorActionPreference $ErrorView $ExecutionContext $false $FormatEnumerationLimit
-$HOME $Host $input $MaximumAliasCount $MaximumDriveCount $MaximumErrorCount
-$MaximumFunctionCount $MaximumHistoryCount $MaximumVariableCount $MyInvocation
-$NestedPromptLevel $null $OutputEncoding $PID $PROFILE $ProgressPreference
-$PSBoundParameters $PSCommandPath $PSCulture $PSDefaultParameterValues
-$PSEmailServer $PSHOME $PSScriptRoot $PSSessionApplicationName
-$PSSessionConfigurationName $PSSessionOption $PSUICulture $PSVersionTable $PWD
-$ShellId $StackTrace $true $VerbosePreference $WarningPreference $WhatIfPreference
-$true $false $null
-
-# Built-in functions
-A:
-Add-Computer Add-Content Add-History Add-Member Add-PSSnapin Add-Type
-B:
-C:
-Checkpoint-Computer Clear-Content Clear-EventLog Clear-History Clear-Host Clear-Item
-Clear-ItemProperty Clear-Variable Compare-Object Complete-Transaction Connect-PSSession
-ConvertFrom-Csv ConvertFrom-Json ConvertFrom-SecureString ConvertFrom-StringData
-Convert-Path ConvertTo-Csv ConvertTo-Html ConvertTo-Json ConvertTo-SecureString
-ConvertTo-Xml Copy-Item Copy-ItemProperty
-D:
-Debug-Process Disable-ComputerRestore Disable-PSBreakpoint Disable-PSRemoting
-Disable-PSSessionConfiguration Disconnect-PSSession
-E:
-Enable-ComputerRestore Enable-PSBreakpoint Enable-PSRemoting Enable-PSSessionConfiguration
-Enter-PSSession Exit-PSSession Export-Alias Export-Clixml Export-Console Export-Counter
-Export-Csv Export-FormatData Export-ModuleMember Export-PSSession
-F:
-ForEach-Object Format-Custom Format-List Format-Table Format-Wide
-G:
-Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command Get-ComputerRestorePoint
-Get-Content Get-ControlPanelItem Get-Counter Get-Credential Get-Culture Get-Date
-Get-Event Get-EventLog Get-EventSubscriber Get-ExecutionPolicy Get-FormatData Get-Help
-Get-History Get-Host Get-HotFix Get-Item Get-ItemProperty Get-Job Get-Location Get-Member
-Get-Module Get-PfxCertificate Get-Process Get-PSBreakpoint Get-PSCallStack Get-PSDrive
-Get-PSProvider Get-PSSession Get-PSSessionConfiguration Get-PSSnapin Get-Random Get-Service
-Get-TraceSource Get-Transaction Get-TypeData Get-UICulture  Get-Unique Get-Variable Get-Verb
-Get-WinEvent Get-WmiObject Group-Object
-H:
-help
-I:
-Import-Alias Import-Clixml Import-Counter Import-Csv Import-LocalizedData Import-Module
-Import-PSSession ImportSystemModules Invoke-Command Invoke-Expression Invoke-History
-Invoke-Item Invoke-RestMethod Invoke-WebRequest Invoke-WmiMethod
-J:
-Join-Path
-K:
-L:
-Limit-EventLog
-M:
-Measure-Command Measure-Object mkdir more Move-Item Move-ItemProperty
-N:
-New-Alias New-Event New-EventLog New-Item New-ItemProperty New-Module New-ModuleManifest
-New-Object New-PSDrive New-PSSession New-PSSessionConfigurationFile New-PSSessionOption
-New-PSTransportOption New-Service New-TimeSpan New-Variable New-WebServiceProxy
-New-WinEvent
-O:
-oss Out-Default Out-File Out-GridView Out-Host Out-Null Out-Printer Out-String
-P:
-Pause Pop-Location prompt Push-Location
-Q:
-R:
-Read-Host Receive-Job Receive-PSSession Register-EngineEvent Register-ObjectEvent
-Register-PSSessionConfiguration Register-WmiEvent Remove-Computer Remove-Event
-Remove-EventLog Remove-Item Remove-ItemProperty Remove-Job Remove-Module
-Remove-PSBreakpoint Remove-PSDrive Remove-PSSession Remove-PSSnapin Remove-TypeData
-Remove-Variable Remove-WmiObject Rename-Computer Rename-Item Rename-ItemProperty
-Reset-ComputerMachinePassword Resolve-Path Restart-Computer Restart-Service
-Restore-Computer Resume-Job Resume-Service
-S:
-Save-Help Select-Object Select-String Select-Xml Send-MailMessage Set-Acl Set-Alias
-Set-AuthenticodeSignature Set-Content Set-Date Set-ExecutionPolicy Set-Item
-Set-ItemProperty Set-Location Set-PSBreakpoint Set-PSDebug
-Set-PSSessionConfiguration Set-Service Set-StrictMode Set-TraceSource Set-Variable
-Set-WmiInstance Show-Command Show-ControlPanelItem Show-EventLog Sort-Object
-Split-Path Start-Job Start-Process Start-Service Start-Sleep Start-Transaction
-Start-Transcript Stop-Computer Stop-Job Stop-Process Stop-Service Stop-Transcript
-Suspend-Job Suspend-Service
-T:
-TabExpansion2 Tee-Object Test-ComputerSecureChannel Test-Connection
-Test-ModuleManifest Test-Path Test-PSSessionConfigurationFile Trace-Command
-U:
-Unblock-File Undo-Transaction Unregister-Event Unregister-PSSessionConfiguration
-Update-FormatData Update-Help Update-List Update-TypeData Use-Transaction
-V:
-W:
-Wait-Event Wait-Job Wait-Process Where-Object Write-Debug Write-Error Write-EventLog
-Write-Host Write-Output Write-Progress Write-Verbose Write-Warning
-X:
-Y:
-Z:</textarea></div>
-      <script>
-        var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-          mode: "powershell",
-          lineNumbers: true,
-          indentUnit: 4,
-          tabMode: "shift",
-          matchBrackets: true
-        });
-      </script>
-
-      <p><strong>MIME types defined:</strong> <code>application/x-powershell</code>.</p>
-    </article>
-  </body>
-</html>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/powershell.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/powershell.js.js
index 5eae979488b5bd91ce73f89d2fa6c788548d57fd..2728ef9d9d1aa12ff5cdfee9b2f3ec5e34be13f8 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/powershell.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/powershell/powershell.js.js
@@ -4,9 +4,9 @@
 (function(mod) {
   'use strict';
   if (typeof exports == 'object' && typeof module == 'object') // CommonJS
-    mod(require('codemirror'));
+    mod(require('../../lib/codemirror'));
   else if (typeof define == 'function' && define.amd) // AMD
-    define(['codemirror'], mod);
+    define(['../../lib/codemirror'], mod);
   else // Plain browser env
     mod(window.CodeMirror);
 })(function(CodeMirror) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/properties/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/properties/index.html.html
deleted file mode 100644
index f885302de21ce059911880e0c71e84a2ec6e1cc4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/properties/index.html.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Properties files mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="properties.js"></script>
-<style>.CodeMirror {border-top: 1px solid #ddd; border-bottom: 1px solid #ddd;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Properties files</a>
-  </ul>
-</div>
-
-<article>
-<h2>Properties files mode</h2>
-<form><textarea id="code" name="code">
-# This is a properties file
-a.key = A value
-another.key = http://example.com
-! Exclamation mark as comment
-but.not=Within ! A value # indeed
-   # Spaces at the beginning of a line
-   spaces.before.key=value
-backslash=Used for multi\
-          line entries,\
-          that's convenient.
-# Unicode sequences
-unicode.key=This is \u0020 Unicode
-no.multiline=here
-# Colons
-colons : can be used too
-# Spaces
-spaces\ in\ keys=Not very common...
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-properties</code>,
-    <code>text/x-ini</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/properties/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/properties/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/properties/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/index.html.html
deleted file mode 100644
index cfe7b9dcd3dbaeac6b93d8d65b365d4c5ec19c85..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/index.html.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: ProtoBuf mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="protobuf.js"></script>
-<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">ProtoBuf</a>
-  </ul>
-</div>
-
-<article>
-<h2>ProtoBuf mode</h2>
-<form><textarea id="code" name="code">
-package addressbook;
-
-message Address {
-   required string street = 1;
-   required string postCode = 2;
-}
-
-message PhoneNumber {
-   required string number = 1;
-}
-
-message Person {
-   optional int32 id = 1;
-   required string name = 2;
-   required string surname = 3;
-   optional Address address = 4;
-   repeated PhoneNumber phoneNumbers = 5;
-   optional uint32 age = 6;
-   repeated uint32 favouriteNumbers = 7;
-   optional string license = 8;
-   enum Gender {
-      MALE = 0;
-      FEMALE = 1;
-   }
-   optional Gender gender = 9;
-   optional fixed64 lastUpdate = 10;
-   required bool deleted = 11 [default = false];
-}
-
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-protobuf</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/protobuf.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/protobuf.js.js
index bcae276e8d7dfd17f72e0fcaf044942a21004fa1..93cb3b0e05204d7bfdfe2afa239b9418e054dbe3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/protobuf.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/protobuf/protobuf.js.js
@@ -19,7 +19,8 @@
     "package", "message", "import", "syntax",
     "required", "optional", "repeated", "reserved", "default", "extensions", "packed",
     "bool", "bytes", "double", "enum", "float", "string",
-    "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64"
+    "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64",
+    "option", "service", "rpc", "returns"
   ];
   var keywords = wordRegexp(keywordArray);
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pug/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pug/index.html.html
deleted file mode 100644
index 1765853a1fe627d334de8ec62dcb4ce00b39be0e..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pug/index.html.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Pug Templating Mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../css/css.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="pug.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Pug Templating Mode</a>
-  </ul>
-</div>
-
-<article>
-<h2>Pug Templating Mode</h2>
-<form><textarea id="code" name="code">
-doctype html
-  html
-    head
-      title= "Pug Templating CodeMirror Mode Example"
-      link(rel='stylesheet', href='/css/bootstrap.min.css')
-      link(rel='stylesheet', href='/css/index.css')
-      script(type='text/javascript', src='/js/jquery-1.9.1.min.js')
-      script(type='text/javascript', src='/js/bootstrap.min.js')
-    body
-      div.header
-        h1 Welcome to this Example
-      div.spots
-        if locals.spots
-          each spot in spots
-            div.spot.well
-         div
-           if spot.logo
-             img.img-rounded.logo(src=spot.logo)
-           else
-             img.img-rounded.logo(src="img/placeholder.png")
-         h3
-           a(href=spot.hash) ##{spot.hash}
-           if spot.title
-             span.title #{spot.title}
-           if spot.desc
-             div #{spot.desc}
-        else
-          h3 There are no spots currently available.
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "pug", alignCDATA: true},
-        lineNumbers: true
-      });
-    </script>
-    <h3>The Pug Templating Mode</h3>
-      <p> Created by Forbes Lindesay. Managed as part of a Brackets extension at <a href="https://github.com/ForbesLindesay/jade-brackets">https://github.com/ForbesLindesay/jade-brackets</a>.</p>
-    <p><strong>MIME type defined:</strong> <code>text/x-pug</code>, <code>text/x-jade</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pug/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pug/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/pug/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/puppet/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/puppet/index.html.html
deleted file mode 100644
index 5614c3695ae6ea2e019319e7871ad7b5c53605cd..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/puppet/index.html.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Puppet mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="puppet.js"></script>
-<style>
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .cm-s-default span.cm-arrow { color: red; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Puppet</a>
-  </ul>
-</div>
-
-<article>
-<h2>Puppet mode</h2>
-<form><textarea id="code" name="code">
-# == Class: automysqlbackup
-#
-# Puppet module to install AutoMySQLBackup for periodic MySQL backups.
-#
-# class { 'automysqlbackup':
-#   backup_dir => '/mnt/backups',
-# }
-#
-
-class automysqlbackup (
-  $bin_dir = $automysqlbackup::params::bin_dir,
-  $etc_dir = $automysqlbackup::params::etc_dir,
-  $backup_dir = $automysqlbackup::params::backup_dir,
-  $install_multicore = undef,
-  $config = {},
-  $config_defaults = {},
-) inherits automysqlbackup::params {
-
-# Ensure valid paths are assigned
-  validate_absolute_path($bin_dir)
-  validate_absolute_path($etc_dir)
-  validate_absolute_path($backup_dir)
-
-# Create a subdirectory in /etc for config files
-  file { $etc_dir:
-    ensure => directory,
-    owner => 'root',
-    group => 'root',
-    mode => '0750',
-  }
-
-# Create an example backup file, useful for reference
-  file { "${etc_dir}/automysqlbackup.conf.example":
-    ensure => file,
-    owner => 'root',
-    group => 'root',
-    mode => '0660',
-    source => 'puppet:///modules/automysqlbackup/automysqlbackup.conf',
-  }
-
-# Add files from the developer
-  file { "${etc_dir}/AMB_README":
-    ensure => file,
-    source => 'puppet:///modules/automysqlbackup/AMB_README',
-  }
-  file { "${etc_dir}/AMB_LICENSE":
-    ensure => file,
-    source => 'puppet:///modules/automysqlbackup/AMB_LICENSE',
-  }
-
-# Install the actual binary file
-  file { "${bin_dir}/automysqlbackup":
-    ensure => file,
-    owner => 'root',
-    group => 'root',
-    mode => '0755',
-    source => 'puppet:///modules/automysqlbackup/automysqlbackup',
-  }
-
-# Create the base backup directory
-  file { $backup_dir:
-    ensure => directory,
-    owner => 'root',
-    group => 'root',
-    mode => '0755',
-  }
-
-# If you'd like to keep your config in hiera and pass it to this class
-  if !empty($config) {
-    create_resources('automysqlbackup::backup', $config, $config_defaults)
-  }
-
-# If using RedHat family, must have the RPMforge repo's enabled
-  if $install_multicore {
-    package { ['pigz', 'pbzip2']: ensure => installed }
-  }
-
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "text/x-puppet",
-        matchBrackets: true,
-        indentUnit: 4
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-puppet</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/puppet/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/puppet/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/puppet/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/index.html.html
deleted file mode 100644
index 0ac02a3333233e08af700ec0b72db72393f4e7a7..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/index.html.html
+++ /dev/null
@@ -1,198 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Python mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="python.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Python</a>
-  </ul>
-</div>
-
-<article>
-<h2>Python mode</h2>
-
-    <div><textarea id="code" name="code">
-# Literals
-1234
-0.0e101
-.123
-0b01010011100
-0o01234567
-0x0987654321abcdef
-7
-2147483647
-3L
-79228162514264337593543950336L
-0x100000000L
-79228162514264337593543950336
-0xdeadbeef
-3.14j
-10.j
-10j
-.001j
-1e100j
-3.14e-10j
-
-
-# String Literals
-'For\''
-"God\""
-"""so loved
-the world"""
-'''that he gave
-his only begotten\' '''
-'that whosoever believeth \
-in him'
-''
-
-# Identifiers
-__a__
-a.b
-a.b.c
-
-#Unicode identifiers on Python3
-# a = x\ddot
-a鈨� = x虉
-# a = v\dot
-a鈨� = v虈
-
-#F\vec = m \cdot a\vec
-F鈨� = m鈥鈨� 
-
-# Operators
-+ - * / % & | ^ ~ < >
-== != <= >= <> << >> // **
-and or not in is
-
-#infix matrix multiplication operator (PEP 465)
-A @ B
-
-# Delimiters
-() [] {} , : ` = ; @ .  # Note that @ and . require the proper context on Python 2.
-+= -= *= /= %= &= |= ^=
-//= >>= <<= **=
-
-# Keywords
-as assert break class continue def del elif else except
-finally for from global if import lambda pass raise
-return try while with yield
-
-# Python 2 Keywords (otherwise Identifiers)
-exec print
-
-# Python 3 Keywords (otherwise Identifiers)
-nonlocal
-
-# Types
-bool classmethod complex dict enumerate float frozenset int list object
-property reversed set slice staticmethod str super tuple type
-
-# Python 2 Types (otherwise Identifiers)
-basestring buffer file long unicode xrange
-
-# Python 3 Types (otherwise Identifiers)
-bytearray bytes filter map memoryview open range zip
-
-# Some Example code
-import os
-from package import ParentClass
-
-@nonsenseDecorator
-def doesNothing():
-    pass
-
-class ExampleClass(ParentClass):
-    @staticmethod
-    def example(inputStr):
-        a = list(inputStr)
-        a.reverse()
-        return ''.join(a)
-
-    def __init__(self, mixin = 'Hello'):
-        self.mixin = mixin
-
-</textarea></div>
-
-
-<h2>Cython mode</h2>
-
-<div><textarea id="code-cython" name="code-cython">
-
-import numpy as np
-cimport cython
-from libc.math cimport sqrt
-
-@cython.boundscheck(False)
-@cython.wraparound(False)
-def pairwise_cython(double[:, ::1] X):
-    cdef int M = X.shape[0]
-    cdef int N = X.shape[1]
-    cdef double tmp, d
-    cdef double[:, ::1] D = np.empty((M, M), dtype=np.float64)
-    for i in range(M):
-        for j in range(M):
-            d = 0.0
-            for k in range(N):
-                tmp = X[i, k] - X[j, k]
-                d += tmp * tmp
-            D[i, j] = sqrt(d)
-    return np.asarray(D)
-
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "python",
-               version: 3,
-               singleLineStringErrors: false},
-        lineNumbers: true,
-        indentUnit: 4,
-        matchBrackets: true
-    });
-
-    CodeMirror.fromTextArea(document.getElementById("code-cython"), {
-        mode: {name: "text/x-cython",
-               version: 2,
-               singleLineStringErrors: false},
-        lineNumbers: true,
-        indentUnit: 4,
-        matchBrackets: true
-      });
-    </script>
-    <h2>Configuration Options for Python mode:</h2>
-    <ul>
-      <li>version - 2/3 - The version of Python to recognize.  Default is 3.</li>
-      <li>singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.</li>
-      <li>hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.</li>
-    </ul>
-    <h2>Advanced Configuration Options:</h2>
-    <p>Usefull for superset of python syntax like Enthought enaml, IPython magics and  questionmark help</p>
-    <ul>
-      <li>singleOperators - RegEx - Regular Expression for single operator matching,  default : <pre>^[\\+\\-\\*/%&amp;|\\^~&lt;&gt;!]</pre> including <pre>@</pre> on Python 3</li>
-      <li>singleDelimiters - RegEx - Regular Expression for single delimiter matching, default :  <pre>^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]</pre></li>
-      <li>doubleOperators - RegEx - Regular Expression for double operators matching, default : <pre>^((==)|(!=)|(&lt;=)|(&gt;=)|(&lt;&gt;)|(&lt;&lt;)|(&gt;&gt;)|(//)|(\\*\\*))</pre></li>
-      <li>doubleDelimiters - RegEx - Regular Expression for double delimiters matching, default : <pre>^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&amp;=)|(\\|=)|(\\^=))</pre></li>
-      <li>tripleDelimiters - RegEx - Regular Expression for triple delimiters matching, default : <pre>^((//=)|(&gt;&gt;=)|(&lt;&lt;=)|(\\*\\*=))</pre></li>
-      <li>identifiers - RegEx - Regular Expression for identifier, default : <pre>^[_A-Za-z][_A-Za-z0-9]*</pre> on Python 2 and <pre>^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*</pre> on Python 3.</li>
-      <li>extra_keywords - list of string - List of extra words ton consider as keywords</li>
-      <li>extra_builtins - list of string - List of extra words ton consider as builtins</li>
-    </ul>
-
-
-    <p><strong>MIME types defined:</strong> <code>text/x-python</code> and <code>text/x-cython</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/python.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/python.js.js
index b539d84aa6a9229a4e1f8eecf2f01fa1f97a4015..4de1e75d5402c218ea4d071980e4d1312e982273 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/python.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/python.js.js
@@ -41,10 +41,11 @@
   CodeMirror.defineMode("python", function(conf, parserConf) {
     var ERRORCLASS = "error";
 
-    var singleDelimiters = parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.]/;
-    var doubleOperators = parserConf.doubleOperators || /^([!<>]==|<>|<<|>>|\/\/|\*\*)/;
-    var doubleDelimiters = parserConf.doubleDelimiters || /^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/;
-    var tripleDelimiters = parserConf.tripleDelimiters || /^(\/\/=|>>=|<<=|\*\*=)/;
+    var delimiters = parserConf.delimiters || parserConf.singleDelimiters || /^[\(\)\[\]\{\}@,:`=;\.\\]/;
+    //               (Backwards-compatiblity with old, cumbersome config system)
+    var operators = [parserConf.singleOperators, parserConf.doubleOperators, parserConf.doubleDelimiters, parserConf.tripleDelimiters,
+                     parserConf.operators || /^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@])/]
+    for (var i = 0; i < operators.length; i++) if (!operators[i]) operators.splice(i--, 1)
 
     var hangingIndent = parserConf.hangingIndent || conf.indentUnit;
 
@@ -58,13 +59,11 @@
     var py3 = !(parserConf.version && Number(parserConf.version) < 3)
     if (py3) {
       // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator
-      var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/;
       var identifiers = parserConf.identifiers|| /^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;
       myKeywords = myKeywords.concat(["nonlocal", "False", "True", "None", "async", "await"]);
       myBuiltins = myBuiltins.concat(["ascii", "bytes", "exec", "print"]);
       var stringPrefixes = new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))", "i");
     } else {
-      var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!]/;
       var identifiers = parserConf.identifiers|| /^[_A-Za-z][_A-Za-z0-9]*/;
       myKeywords = myKeywords.concat(["exec", "print"]);
       myBuiltins = myBuiltins.concat(["apply", "basestring", "buffer", "cmp", "coerce", "execfile",
@@ -77,9 +76,10 @@
 
     // tokenizers
     function tokenBase(stream, state) {
-      if (stream.sol()) state.indent = stream.indentation()
+      var sol = stream.sol() && state.lastToken != "\\"
+      if (sol) state.indent = stream.indentation()
       // Handle scope changes
-      if (stream.sol() && top(state).type == "py") {
+      if (sol && top(state).type == "py") {
         var scopeOffset = top(state).offset;
         if (stream.eatSpace()) {
           var lineOffset = stream.indentation();
@@ -101,13 +101,8 @@
     function tokenBaseInner(stream, state) {
       if (stream.eatSpace()) return null;
 
-      var ch = stream.peek();
-
       // Handle Comments
-      if (ch == "#") {
-        stream.skipToEnd();
-        return "comment";
-      }
+      if (stream.match(/^#.*/)) return "comment";
 
       // Handle Number Literals
       if (stream.match(/^[0-9\.]/, false)) {
@@ -151,15 +146,10 @@
         return state.tokenize(stream, state);
       }
 
-      // Handle operators and Delimiters
-      if (stream.match(tripleDelimiters) || stream.match(doubleDelimiters))
-        return "punctuation";
-
-      if (stream.match(doubleOperators) || stream.match(singleOperators))
-        return "operator";
+      for (var i = 0; i < operators.length; i++)
+        if (stream.match(operators[i])) return "operator"
 
-      if (stream.match(singleDelimiters))
-        return "punctuation";
+      if (stream.match(delimiters)) return "punctuation";
 
       if (state.lastToken == "." && stream.match(identifiers))
         return "property";
@@ -332,8 +322,8 @@
 
   CodeMirror.defineMIME("text/x-cython", {
     name: "python",
-    extra_keywords: words("by cdef cimport cpdef ctypedef enum except"+
-                          "extern gil include nogil property public"+
+    extra_keywords: words("by cdef cimport cpdef ctypedef enum except "+
+                          "extern gil include nogil property public "+
                           "readonly struct union DEF IF ELIF ELSE")
   });
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/test.js.js
index c1a9c6a99013ecd64cf66b9656d87b8ac272c4a0..950eed51e6780315184698ce4b32a29b7bde9ecb 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/python/test.js.js
@@ -24,6 +24,11 @@
   MT("matmulWithSpace:", "[variable a] [operator @] [variable b]");
   MT("matmulWithoutSpace:", "[variable a][operator @][variable b]");
   MT("matmulSpaceBefore:", "[variable a] [operator @][variable b]");
+  var before_equal_sign = ["+", "-", "*", "/", "=", "!", ">", "<"];
+  for (var i = 0; i < before_equal_sign.length; ++i) {
+    var c = before_equal_sign[i]
+    MT("before_equal_sign_" + c, "[variable a] [operator " + c + "=] [variable b]");
+  }
 
   MT("fValidStringPrefix", "[string f'this is a {formatted} string']");
   MT("uValidStringPrefix", "[string u'this is an unicode string']");
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/index.html.html
deleted file mode 100644
index 72785ba3bf54d5f94d9400b29e65b453d56fd334..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/index.html.html
+++ /dev/null
@@ -1,144 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Q mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="q.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Q</a>
-  </ul>
-</div>
-
-<article>
-<h2>Q mode</h2>
-
-
-<div><textarea id="code" name="code">
-/ utilities to quickly load a csv file - for more exhaustive analysis of the csv contents see csvguess.q
-/ 2009.09.20 - updated to match latest csvguess.q 
-
-/ .csv.colhdrs[file] - return a list of colhdrs from file
-/ info:.csv.info[file] - return a table of information about the file
-/ columns are: 
-/	c - column name; ci - column index; t - load type; mw - max width; 
-/	dchar - distinct characters in values; rule - rule that caught the type
-/	maybe - needs checking, _could_ be say a date, but perhaps just a float?
-/ .csv.info0[file;onlycols] - like .csv.info except that it only analyses <onlycols>
-/ example:
-/	info:.csv.info0[file;(.csv.colhdrs file)like"*price"]
-/	info:.csv.infolike[file;"*price"]
-/	show delete from info where t=" "
-/ .csv.data[file;info] - use the info from .csv.info to read the data
-/ .csv.data10[file;info] - like .csv.data but only returns the first 10 rows
-/ bulkload[file;info] - bulk loads file into table DATA (which must be already defined :: DATA:() )
-/ .csv.read[file]/read10[file] - for when you don't care about checking/tweaking the <info> before reading 
-
-\d .csv
-DELIM:","
-ZAPHDRS:0b / lowercase and remove _ from colhdrs (junk characters are always removed)
-WIDTHHDR:25000 / number of characters read to get the header
-READLINES:222 / number of lines read and used to guess the types
-SYMMAXWIDTH:11 / character columns narrower than this are stored as symbols
-SYMMAXGR:10 / max symbol granularity% before we give up and keep as a * string
-FORCECHARWIDTH:30 / every field (of any type) with values this wide or more is forced to character "*"
-DISCARDEMPTY:0b / completely ignore empty columns if true else set them to "C"
-CHUNKSIZE:50000000 / used in fs2 (modified .Q.fs)
-
-k)nameltrim:{$[~@x;.z.s'x;~(*x)in aA:.Q.a,.Q.A;(+/&\~x in aA)_x;x]}
-k)fs2:{[f;s]((-7!s)>){[f;s;x]i:1+last@&0xa=r:1:(s;x;CHUNKSIZE);f@`\:i#r;x+i}[f;s]/0j}
-cleanhdrs:{{$[ZAPHDRS;lower x except"_";x]}x where x in DELIM,.Q.an}
-cancast:{nw:x$"";if[not x in"BXCS";nw:(min 0#;max 0#;::)@\:nw];$[not any nw in x$(11&count y)#y;$[11<count y;not any nw in x$y;1b];0b]}
-
-read:{[file]data[file;info[file]]}  
-read10:{[file]data10[file;info[file]]}  
-
-colhdrs:{[file]
-	`$nameltrim DELIM vs cleanhdrs first read0(file;0;1+first where 0xa=read1(file;0;WIDTHHDR))}
-data:{[file;info]
-	(exec c from info where not t=" ")xcol(exec t from info;enlist DELIM)0:file}
-data10:{[file;info]
-	data[;info](file;0;1+last 11#where 0xa=read1(file;0;15*WIDTHHDR))}
-info0:{[file;onlycols]
-	colhdrs:`$nameltrim DELIM vs cleanhdrs first head:read0(file;0;1+last where 0xa=read1(file;0;WIDTHHDR));
-	loadfmts:(count colhdrs)#"S";if[count onlycols;loadfmts[where not colhdrs in onlycols]:"C"];
-	breaks:where 0xa=read1(file;0;floor(10+READLINES)*WIDTHHDR%count head);
-	nas:count as:colhdrs xcol(loadfmts;enlist DELIM)0:(file;0;1+last((1+READLINES)&count breaks)#breaks);
-	info:([]c:key flip as;v:value flip as);as:();
-	reserved:key`.q;reserved,:.Q.res;reserved,:`i;
-	info:update res:c in reserved from info;
-	info:update ci:i,t:"?",ipa:0b,mdot:0,mw:0,rule:0,gr:0,ndv:0,maybe:0b,empty:0b,j10:0b,j12:0b from info;
-	info:update ci:`s#ci from info;
-	if[count onlycols;info:update t:" ",rule:10 from info where not c in onlycols];
-	info:update sdv:{string(distinct x)except`}peach v from info; 
-	info:update ndv:count each sdv from info;
-	info:update gr:floor 0.5+100*ndv%nas,mw:{max count each x}peach sdv from info where 0<ndv;
-	info:update t:"*",rule:20 from info where mw>.csv.FORCECHARWIDTH; / long values
-	info:update t:"C "[.csv.DISCARDEMPTY],rule:30,empty:1b from info where t="?",mw=0; / empty columns
-	info:update dchar:{asc distinct raze x}peach sdv from info where t="?";
-	info:update mdot:{max sum each"."=x}peach sdv from info where t="?",{"."in x}each dchar;
-	info:update t:"n",rule:40 from info where t="?",{any x in"0123456789"}each dchar; / vaguely numeric..
-	info:update t:"I",rule:50,ipa:1b from info where t="n",mw within 7 15,mdot=3,{all x in".0123456789"}each dchar,.csv.cancast["I"]peach sdv; / ip-address
-	info:update t:"J",rule:60 from info where t="n",mdot=0,{all x in"+-0123456789"}each dchar,.csv.cancast["J"]peach sdv;
-	info:update t:"I",rule:70 from info where t="J",mw<12,.csv.cancast["I"]peach sdv;
-	info:update t:"H",rule:80 from info where t="I",mw<7,.csv.cancast["H"]peach sdv;
-	info:update t:"F",rule:90 from info where t="n",mdot<2,mw>1,.csv.cancast["F"]peach sdv;
-	info:update t:"E",rule:100,maybe:1b from info where t="F",mw<9;
-	info:update t:"M",rule:110,maybe:1b from info where t in"nIHEF",mdot<2,mw within 4 7,.csv.cancast["M"]peach sdv; 
-	info:update t:"D",rule:120,maybe:1b from info where t in"nI",mdot in 0 2,mw within 6 11,.csv.cancast["D"]peach sdv; 
-	info:update t:"V",rule:130,maybe:1b from info where t="I",mw in 5 6,7<count each dchar,{all x like"*[0-9][0-5][0-9][0-5][0-9]"}peach sdv,.csv.cancast["V"]peach sdv; / 235959 12345        
-	info:update t:"U",rule:140,maybe:1b from info where t="H",mw in 3 4,7<count each dchar,{all x like"*[0-9][0-5][0-9]"}peach sdv,.csv.cancast["U"]peach sdv; /2359
-	info:update t:"U",rule:150,maybe:0b from info where t="n",mw in 4 5,mdot=0,{all x like"*[0-9]:[0-5][0-9]"}peach sdv,.csv.cancast["U"]peach sdv;
-	info:update t:"T",rule:160,maybe:0b from info where t="n",mw within 7 12,mdot<2,{all x like"*[0-9]:[0-5][0-9]:[0-5][0-9]*"}peach sdv,.csv.cancast["T"]peach sdv;
-	info:update t:"V",rule:170,maybe:0b from info where t="T",mw in 7 8,mdot=0,.csv.cancast["V"]peach sdv;
-	info:update t:"T",rule:180,maybe:1b from info where t in"EF",mw within 7 10,mdot=1,{all x like"*[0-9][0-5][0-9][0-5][0-9].*"}peach sdv,.csv.cancast["T"]peach sdv;
-	info:update t:"Z",rule:190,maybe:0b from info where t="n",mw within 11 24,mdot<4,.csv.cancast["Z"]peach sdv;
-	info:update t:"P",rule:200,maybe:1b from info where t="n",mw within 12 29,mdot<4,{all x like"[12]*"}peach sdv,.csv.cancast["P"]peach sdv;
-	info:update t:"N",rule:210,maybe:1b from info where t="n",mw within 3 28,mdot=1,.csv.cancast["N"]peach sdv;
-	info:update t:"?",rule:220,maybe:0b from info where t="n"; / reset remaining maybe numeric
-	info:update t:"C",rule:230,maybe:0b from info where t="?",mw=1; / char
-	info:update t:"B",rule:240,maybe:0b from info where t in"HC",mw=1,mdot=0,{$[all x in"01tTfFyYnN";(any"0fFnN"in x)and any"1tTyY"in x;0b]}each dchar; / boolean
-	info:update t:"B",rule:250,maybe:1b from info where t in"HC",mw=1,mdot=0,{all x in"01tTfFyYnN"}each dchar; / boolean
-	info:update t:"X",rule:260,maybe:0b from info where t="?",mw=2,{$[all x in"0123456789abcdefABCDEF";(any .Q.n in x)and any"abcdefABCDEF"in x;0b]}each dchar; /hex
-	info:update t:"S",rule:270,maybe:1b from info where t="?",mw<.csv.SYMMAXWIDTH,mw>1,gr<.csv.SYMMAXGR; / symbols (max width permitting)
-	info:update t:"*",rule:280,maybe:0b from info where t="?"; / the rest as strings
-	/ flag those S/* columns which could be encoded to integers (.Q.j10/x10/j12/x12) to avoid symbols
-	info:update j12:1b from info where t in"S*",mw<13,{all x in .Q.nA}each dchar;
-	info:update j10:1b from info where t in"S*",mw<11,{all x in .Q.b6}each dchar; 
-	select c,ci,t,maybe,empty,res,j10,j12,ipa,mw,mdot,rule,gr,ndv,dchar from info}
-info:info0[;()] / by default don't restrict columns
-infolike:{[file;pattern] info0[file;{x where x like y}[lower colhdrs[file];pattern]]} / .csv.infolike[file;"*time"]
-
-\d .
-/ DATA:()
-bulkload:{[file;info]
-	if[not`DATA in system"v";'`DATA.not.defined];
-	if[count DATA;'`DATA.not.empty];
-	loadhdrs:exec c from info where not t=" ";loadfmts:exec t from info;
-	.csv.fs2[{[file;loadhdrs;loadfmts] `DATA insert $[count DATA;flip loadhdrs!(loadfmts;.csv.DELIM)0:file;loadhdrs xcol(loadfmts;enlist .csv.DELIM)0:file]}[file;loadhdrs;loadfmts]];
-	count DATA}
-@[.:;"\\l csvutil.custom.q";::]; / save your custom settings in csvutil.custom.q to override those set at the beginning of the file 
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true
-      });
-    </script>
-
-    <p><strong>MIME type defined:</strong> <code>text/x-q</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/q.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/q.js.js
index a4af9383e7b3b4a759417e3bd1b0fe713dc28a8c..9aee18ab1e9128c4e9227aaf51e2d9cac7a04b53 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/q.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/q/q.js.js
@@ -25,7 +25,7 @@ CodeMirror.defineMode("q",function(config){
         return(state.tokenize=tokenLineComment)(stream,state);
       else if(c=="\\"){
         if(stream.eol()||/\s/.test(stream.peek()))
-          return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream, state):state.tokenize=tokenBase,"comment";
+          return stream.skipToEnd(),/^\\\s*$/.test(stream.current())?(state.tokenize=tokenCommentToEOF)(stream):state.tokenize=tokenBase,"comment";
         else
           return state.tokenize=tokenBase,"builtin";
       }
@@ -34,25 +34,25 @@ CodeMirror.defineMode("q",function(config){
     if(c=='"')
       return(state.tokenize=tokenString)(stream,state);
     if(c=='`')
-      return stream.eatWhile(/[A-Z|a-z|\d|_|:|\/|\.]/),"symbol";
+      return stream.eatWhile(/[A-Za-z\d_:\/.]/),"symbol";
     if(("."==c&&/\d/.test(stream.peek()))||/\d/.test(c)){
       var t=null;
       stream.backUp(1);
-      if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([D|T](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)
+      if(stream.match(/^\d{4}\.\d{2}(m|\.\d{2}([DT](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)
       || stream.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)
       || stream.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)
       || stream.match(/^\d+[ptuv]{1}/))
         t="temporal";
       else if(stream.match(/^0[NwW]{1}/)
-      || stream.match(/^0x[\d|a-f|A-F]*/)
-      || stream.match(/^[0|1]+[b]{1}/)
+      || stream.match(/^0x[\da-fA-F]*/)
+      || stream.match(/^[01]+[b]{1}/)
       || stream.match(/^\d+[chijn]{1}/)
       || stream.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))
         t="number";
       return(t&&(!(c=stream.peek())||E.test(c)))?t:(stream.next(),"error");
     }
-    if(/[A-Z|a-z]|\./.test(c))
-      return stream.eatWhile(/[A-Z|a-z|\.|_|\d]/),keywords.test(stream.current())?"keyword":"variable";
+    if(/[A-Za-z]|\./.test(c))
+      return stream.eatWhile(/[A-Za-z._\d]/),keywords.test(stream.current())?"keyword":"variable";
     if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(c))
       return null;
     if(/[{}\(\[\]\)]/.test(c))
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/index.html.html
deleted file mode 100644
index 01b6e664b7cfbac129e1be4aac0d5dbf719e25b4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/index.html.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: R mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="r.js"></script>
-<style>
-      .CodeMirror { border-top: 1px solid silver; border-bottom: 1px solid silver; }
-      .cm-s-default span.cm-semi { color: blue; font-weight: bold; }
-      .cm-s-default span.cm-dollar { color: orange; font-weight: bold; }
-      .cm-s-default span.cm-arrow { color: brown; }
-      .cm-s-default span.cm-arg-is { color: brown; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">R</a>
-  </ul>
-</div>
-
-<article>
-<h2>R mode</h2>
-<form><textarea id="code" name="code">
-X <- list(height = 5.4, weight = 54)
-cat("Printing objects: "); print(X)
-print("Accessing individual elements:")
-cat(sprintf("Your height is %s and your weight is %s\n", X$height, X$weight))
-
-# Functions:
-square <- function(x) {
-  return(x * x)
-}
-cat(sprintf("The square of 3 is %s\n", square(3)))
-
-# In R, the last expression in a function is, by default, what is
-# returned. The idiomatic way to write the function is:
-square <- function(x) {
-  x * x
-}
-# or, for functions with short content:
-square <- function(x) x * x
-
-# Function arguments with default values:
-cube <- function(x = 5) x * x * x
-cat(sprintf("Calling cube with 2 : %s\n", cube(2))  # will give 2^3
-cat(sprintf("Calling cube        : %s\n", cube())   # will default to 5^3.
-
-powers <- function(x) list(x2 = x*x, x3 = x*x*x, x4 = x*x*x*x)
-
-cat("Powers of 3: "); print(powers(3))
-
-# Data frames
-df <- data.frame(letters = letters[1:5], '#letter' = 1:5)
-print(df$letters)
-print(df$`#letter`)
-
-# Operators:
-m1 <- matrix(1:6, 2, 3)
-m2 <- m1 %*% t(m1)
-cat("Matrix product: "); print(m2)
-
-# Assignments:
-a <- 1
-b <<- 2
-c = 3
-4 -> d
-5 ->> e
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-rsrc</code>.</p>
-
-    <p>Development of the CodeMirror R mode was kindly sponsored
-    by <a href="https://twitter.com/ubalo">Ubalo</a>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/r.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/r.js.js
index 7e15beac629f74edfd6137be638907514eecf73c..be7db46b85aae603bdb0a5f1c2504946509e1541 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/r.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/r/r.js.js
@@ -108,13 +108,23 @@ CodeMirror.defineMode("r", function(config) {
     };
   }
 
+  var ALIGN_YES = 1, ALIGN_NO = 2, BRACELESS = 4
+
   function push(state, type, stream) {
     state.ctx = {type: type,
                  indent: state.indent,
-                 align: null,
+                 flags: 0,
                  column: stream.column(),
                  prev: state.ctx};
   }
+  function setFlag(state, flag) {
+    var ctx = state.ctx
+    state.ctx = {type: ctx.type,
+                 indent: ctx.indent,
+                 flags: ctx.flags | flag,
+                 column: ctx.column,
+                 prev: ctx.prev}
+  }
   function pop(state) {
     state.indent = state.ctx.indent;
     state.ctx = state.ctx.prev;
@@ -125,22 +135,22 @@ CodeMirror.defineMode("r", function(config) {
       return {tokenize: tokenBase,
               ctx: {type: "top",
                     indent: -config.indentUnit,
-                    align: false},
+                    flags: ALIGN_NO},
               indent: 0,
               afterIdent: false};
     },
 
     token: function(stream, state) {
       if (stream.sol()) {
-        if (state.ctx.align == null) state.ctx.align = false;
+        if ((state.ctx.flags & 3) == 0) state.ctx.flags |= ALIGN_NO
+        if (state.ctx.flags & BRACELESS) pop(state)
         state.indent = stream.indentation();
       }
       if (stream.eatSpace()) return null;
       var style = state.tokenize(stream, state);
-      if (style != "comment" && state.ctx.align == null) state.ctx.align = true;
+      if (style != "comment" && (state.ctx.flags & ALIGN_NO) == 0) setFlag(state, ALIGN_YES)
 
-      var ctype = state.ctx.type;
-      if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && ctype == "block") pop(state);
+      if ((curPunc == ";" || curPunc == "{" || curPunc == "}") && state.ctx.type == "block") pop(state);
       if (curPunc == "{") push(state, "}", stream);
       else if (curPunc == "(") {
         push(state, ")", stream);
@@ -148,7 +158,8 @@ CodeMirror.defineMode("r", function(config) {
       }
       else if (curPunc == "[") push(state, "]", stream);
       else if (curPunc == "block") push(state, "block", stream);
-      else if (curPunc == ctype) pop(state);
+      else if (curPunc == state.ctx.type) pop(state);
+      else if (state.ctx.type == "block" && style != "comment") setFlag(state, BRACELESS)
       state.afterIdent = style == "variable" || style == "keyword";
       return style;
     },
@@ -157,8 +168,9 @@ CodeMirror.defineMode("r", function(config) {
       if (state.tokenize != tokenBase) return 0;
       var firstChar = textAfter && textAfter.charAt(0), ctx = state.ctx,
           closing = firstChar == ctx.type;
+      if (ctx.flags & BRACELESS) ctx = ctx.prev
       if (ctx.type == "block") return ctx.indent + (firstChar == "{" ? 0 : config.indentUnit);
-      else if (ctx.align) return ctx.column + (closing ? 0 : 1);
+      else if (ctx.flags & ALIGN_YES) return ctx.column + (closing ? 0 : 1);
       else return ctx.indent + (closing ? 0 : config.indentUnit);
     },
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.xml
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..a25de7171212d7f1e53a54b627c1029087f00bca 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.xml
@@ -2,29 +2,51 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
     </pickle>
     <pickle>
       <dictionary>
         <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
+            <key> <string>_bind_names</string> </key>
             <value>
-              <dictionary/>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
             </value>
         </item>
         <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
+            <key> <string>content_type</string> </key>
+            <value> <string>text/html</string> </value>
+        </item>
+        <item>
+            <key> <string>expand</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>index.html</string> </value>
         </item>
         <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>output_encoding</string> </key>
+            <value> <string>iso-8859-15</string> </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.zpt
similarity index 96%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.html
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.zpt
index 6e5031bd1f55f5131753103eeaa39db765503450..fea27b6fd68f03eb0ce4056bb16f60c3a0d1d323 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.html
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/changes/index.html.zpt
@@ -1,66 +1,66 @@
-<!doctype html>
-
-<title>CodeMirror: RPM changes mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-    <link rel="stylesheet" href="../../../lib/codemirror.css">
-    <script src="../../../lib/codemirror.js"></script>
-    <script src="changes.js"></script>
-    <link rel="stylesheet" href="../../../doc/docs.css">
-    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../../index.html">Home</a>
-    <li><a href="../../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../../index.html">Language modes</a>
-    <li><a class=active href="#">RPM changes</a>
-  </ul>
-</div>
-
-<article>
-<h2>RPM changes mode</h2>
-
-    <div><textarea id="code" name="code">
--------------------------------------------------------------------
-Tue Oct 18 13:58:40 UTC 2011 - misterx@example.com
-
-- Update to r60.3
-- Fixes bug in the reflect package
-  * disallow Interface method on Value obtained via unexported name
-
--------------------------------------------------------------------
-Thu Oct  6 08:14:24 UTC 2011 - misterx@example.com
-
-- Update to r60.2
-- Fixes memory leak in certain map types
-
--------------------------------------------------------------------
-Wed Oct  5 14:34:10 UTC 2011 - misterx@example.com
-
-- Tweaks for gdb debugging
-- go.spec changes:
-  - move %go_arch definition to %prep section
-  - pass correct location of go specific gdb pretty printer and
-    functions to cpp as HOST_EXTRA_CFLAGS macro
-  - install go gdb functions & printer
-- gdb-printer.patch
-  - patch linker (src/cmd/ld/dwarf.c) to emit correct location of go
-    gdb functions and pretty printer
-</textarea></div>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "changes"},
-        lineNumbers: true,
-        indentUnit: 4
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-rpm-changes</code>.</p>
-</article>
+<!doctype html>
+
+<title>CodeMirror: RPM changes mode</title>
+<meta charset="utf-8"/>
+<link rel=stylesheet href="../../doc/docs.css">
+
+    <link rel="stylesheet" href="../../../lib/codemirror.css">
+    <script src="../../../lib/codemirror.js"></script>
+    <script src="changes.js"></script>
+    <link rel="stylesheet" href="../../../doc/docs.css">
+    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
+
+<div id=nav>
+  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../../doc/logo.png"></a>
+
+  <ul>
+    <li><a href="../../../index.html">Home</a>
+    <li><a href="../../../doc/manual.html">Manual</a>
+    <li><a href="https://github.com/codemirror/codemirror">Code</a>
+  </ul>
+  <ul>
+    <li><a href="../../index.html">Language modes</a>
+    <li><a class=active href="#">RPM changes</a>
+  </ul>
+</div>
+
+<article>
+<h2>RPM changes mode</h2>
+
+    <div><textarea id="code" name="code">
+-------------------------------------------------------------------
+Tue Oct 18 13:58:40 UTC 2011 - misterx@example.com
+
+- Update to r60.3
+- Fixes bug in the reflect package
+  * disallow Interface method on Value obtained via unexported name
+
+-------------------------------------------------------------------
+Thu Oct  6 08:14:24 UTC 2011 - misterx@example.com
+
+- Update to r60.2
+- Fixes memory leak in certain map types
+
+-------------------------------------------------------------------
+Wed Oct  5 14:34:10 UTC 2011 - misterx@example.com
+
+- Tweaks for gdb debugging
+- go.spec changes:
+  - move %go_arch definition to %prep section
+  - pass correct location of go specific gdb pretty printer and
+    functions to cpp as HOST_EXTRA_CFLAGS macro
+  - install go gdb functions & printer
+- gdb-printer.patch
+  - patch linker (src/cmd/ld/dwarf.c) to emit correct location of go
+    gdb functions and pretty printer
+</textarea></div>
+    <script>
+      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
+        mode: {name: "changes"},
+        lineNumbers: true,
+        indentUnit: 4
+      });
+    </script>
+
+    <p><strong>MIME types defined:</strong> <code>text/x-rpm-changes</code>.</p>
+</article>
\ No newline at end of file
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/index.html.html
deleted file mode 100644
index 9a34e6dfb8958f4820138571cd5c54a8acb9c3a3..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/index.html.html
+++ /dev/null
@@ -1,149 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: RPM changes mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-    <link rel="stylesheet" href="../../lib/codemirror.css">
-    <script src="../../lib/codemirror.js"></script>
-    <script src="rpm.js"></script>
-    <link rel="stylesheet" href="../../doc/docs.css">
-    <style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">RPM</a>
-  </ul>
-</div>
-
-<article>
-<h2>RPM changes mode</h2>
-
-    <div><textarea id="code" name="code">
--------------------------------------------------------------------
-Tue Oct 18 13:58:40 UTC 2011 - misterx@example.com
-
-- Update to r60.3
-- Fixes bug in the reflect package
-  * disallow Interface method on Value obtained via unexported name
-
--------------------------------------------------------------------
-Thu Oct  6 08:14:24 UTC 2011 - misterx@example.com
-
-- Update to r60.2
-- Fixes memory leak in certain map types
-
--------------------------------------------------------------------
-Wed Oct  5 14:34:10 UTC 2011 - misterx@example.com
-
-- Tweaks for gdb debugging
-- go.spec changes:
-  - move %go_arch definition to %prep section
-  - pass correct location of go specific gdb pretty printer and
-    functions to cpp as HOST_EXTRA_CFLAGS macro
-  - install go gdb functions & printer
-- gdb-printer.patch
-  - patch linker (src/cmd/ld/dwarf.c) to emit correct location of go
-    gdb functions and pretty printer
-</textarea></div>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "rpm-changes"},
-        lineNumbers: true,
-        indentUnit: 4
-      });
-    </script>
-
-<h2>RPM spec mode</h2>
-    
-    <div><textarea id="code2" name="code2">
-#
-# spec file for package minidlna
-#
-# Copyright (c) 2011, Sascha Peilicke <saschpe@gmx.de>
-#
-# All modifications and additions to the file contributed by third parties
-# remain the property of their copyright owners, unless otherwise agreed
-# upon. The license for this file, and modifications and additions to the
-# file, is the same license as for the pristine package itself (unless the
-# license for the pristine package is not an Open Source License, in which
-# case the license is the MIT License). An "Open Source License" is a
-# license that conforms to the Open Source Definition (Version 1.9)
-# published by the Open Source Initiative.
-
-
-Name:           libupnp6
-Version:        1.6.13
-Release:        0
-Summary:        Portable Universal Plug and Play (UPnP) SDK
-Group:          System/Libraries
-License:        BSD-3-Clause
-Url:            http://sourceforge.net/projects/pupnp/
-Source0:        http://downloads.sourceforge.net/pupnp/libupnp-%{version}.tar.bz2
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-
-%description
-The portable Universal Plug and Play (UPnP) SDK provides support for building
-UPnP-compliant control points, devices, and bridges on several operating
-systems.
-
-%package -n libupnp-devel
-Summary:        Portable Universal Plug and Play (UPnP) SDK
-Group:          Development/Libraries/C and C++
-Provides:       pkgconfig(libupnp)
-Requires:       %{name} = %{version}
-
-%description -n libupnp-devel
-The portable Universal Plug and Play (UPnP) SDK provides support for building
-UPnP-compliant control points, devices, and bridges on several operating
-systems.
-
-%prep
-%setup -n libupnp-%{version}
-
-%build
-%configure --disable-static
-make %{?_smp_mflags}
-
-%install
-%makeinstall
-find %{buildroot} -type f -name '*.la' -exec rm -f {} ';'
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-%files
-%defattr(-,root,root,-)
-%doc ChangeLog NEWS README TODO
-%{_libdir}/libixml.so.*
-%{_libdir}/libthreadutil.so.*
-%{_libdir}/libupnp.so.*
-
-%files -n libupnp-devel
-%defattr(-,root,root,-)
-%{_libdir}/pkgconfig/libupnp.pc
-%{_libdir}/libixml.so
-%{_libdir}/libthreadutil.so
-%{_libdir}/libupnp.so
-%{_includedir}/upnp/
-
-%changelog</textarea></div>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code2"), {
-        mode: {name: "rpm-spec"},
-        lineNumbers: true,
-        indentUnit: 4
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-rpm-spec</code>, <code>text/x-rpm-changes</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rpm/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rst/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rst/index.html.html
deleted file mode 100644
index 2902dea2312d7bf2b6de68d62df400e20198cd23..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rst/index.html.html
+++ /dev/null
@@ -1,535 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: reStructuredText mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/overlay.js"></script>
-<script src="rst.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">reStructuredText</a>
-  </ul>
-</div>
-
-<article>
-<h2>reStructuredText mode</h2>
-<form><textarea id="code" name="code">
-.. This is an excerpt from Sphinx documentation: http://sphinx.pocoo.org/_sources/rest.txt
-
-.. highlightlang:: rest
-
-.. _rst-primer:
-
-reStructuredText Primer
-=======================
-
-This section is a brief introduction to reStructuredText (reST) concepts and
-syntax, intended to provide authors with enough information to author documents
-productively.  Since reST was designed to be a simple, unobtrusive markup
-language, this will not take too long.
-
-.. seealso::
-
-   The authoritative `reStructuredText User Documentation
-   &lt;http://docutils.sourceforge.net/rst.html&gt;`_.  The "ref" links in this
-   document link to the description of the individual constructs in the reST
-   reference.
-
-
-Paragraphs
-----------
-
-The paragraph (:duref:`ref &lt;paragraphs&gt;`) is the most basic block in a reST
-document.  Paragraphs are simply chunks of text separated by one or more blank
-lines.  As in Python, indentation is significant in reST, so all lines of the
-same paragraph must be left-aligned to the same level of indentation.
-
-
-.. _inlinemarkup:
-
-Inline markup
--------------
-
-The standard reST inline markup is quite simple: use
-
-* one asterisk: ``*text*`` for emphasis (italics),
-* two asterisks: ``**text**`` for strong emphasis (boldface), and
-* backquotes: ````text```` for code samples.
-
-If asterisks or backquotes appear in running text and could be confused with
-inline markup delimiters, they have to be escaped with a backslash.
-
-Be aware of some restrictions of this markup:
-
-* it may not be nested,
-* content may not start or end with whitespace: ``* text*`` is wrong,
-* it must be separated from surrounding text by non-word characters.  Use a
-  backslash escaped space to work around that: ``thisis\ *one*\ word``.
-
-These restrictions may be lifted in future versions of the docutils.
-
-reST also allows for custom "interpreted text roles"', which signify that the
-enclosed text should be interpreted in a specific way.  Sphinx uses this to
-provide semantic markup and cross-referencing of identifiers, as described in
-the appropriate section.  The general syntax is ``:rolename:`content```.
-
-Standard reST provides the following roles:
-
-* :durole:`emphasis` -- alternate spelling for ``*emphasis*``
-* :durole:`strong` -- alternate spelling for ``**strong**``
-* :durole:`literal` -- alternate spelling for ````literal````
-* :durole:`subscript` -- subscript text
-* :durole:`superscript` -- superscript text
-* :durole:`title-reference` -- for titles of books, periodicals, and other
-  materials
-
-See :ref:`inline-markup` for roles added by Sphinx.
-
-
-Lists and Quote-like blocks
----------------------------
-
-List markup (:duref:`ref &lt;bullet-lists&gt;`) is natural: just place an asterisk at
-the start of a paragraph and indent properly.  The same goes for numbered lists;
-they can also be autonumbered using a ``#`` sign::
-
-   * This is a bulleted list.
-   * It has two items, the second
-     item uses two lines.
-
-   1. This is a numbered list.
-   2. It has two items too.
-
-   #. This is a numbered list.
-   #. It has two items too.
-
-
-Nested lists are possible, but be aware that they must be separated from the
-parent list items by blank lines::
-
-   * this is
-   * a list
-
-     * with a nested list
-     * and some subitems
-
-   * and here the parent list continues
-
-Definition lists (:duref:`ref &lt;definition-lists&gt;`) are created as follows::
-
-   term (up to a line of text)
-      Definition of the term, which must be indented
-
-      and can even consist of multiple paragraphs
-
-   next term
-      Description.
-
-Note that the term cannot have more than one line of text.
-
-Quoted paragraphs (:duref:`ref &lt;block-quotes&gt;`) are created by just indenting
-them more than the surrounding paragraphs.
-
-Line blocks (:duref:`ref &lt;line-blocks&gt;`) are a way of preserving line breaks::
-
-   | These lines are
-   | broken exactly like in
-   | the source file.
-
-There are also several more special blocks available:
-
-* field lists (:duref:`ref &lt;field-lists&gt;`)
-* option lists (:duref:`ref &lt;option-lists&gt;`)
-* quoted literal blocks (:duref:`ref &lt;quoted-literal-blocks&gt;`)
-* doctest blocks (:duref:`ref &lt;doctest-blocks&gt;`)
-
-
-Source Code
------------
-
-Literal code blocks (:duref:`ref &lt;literal-blocks&gt;`) are introduced by ending a
-paragraph with the special marker ``::``.  The literal block must be indented
-(and, like all paragraphs, separated from the surrounding ones by blank lines)::
-
-   This is a normal text paragraph. The next paragraph is a code sample::
-
-      It is not processed in any way, except
-      that the indentation is removed.
-
-      It can span multiple lines.
-
-   This is a normal text paragraph again.
-
-The handling of the ``::`` marker is smart:
-
-* If it occurs as a paragraph of its own, that paragraph is completely left
-  out of the document.
-* If it is preceded by whitespace, the marker is removed.
-* If it is preceded by non-whitespace, the marker is replaced by a single
-  colon.
-
-That way, the second sentence in the above example's first paragraph would be
-rendered as "The next paragraph is a code sample:".
-
-
-.. _rst-tables:
-
-Tables
-------
-
-Two forms of tables are supported.  For *grid tables* (:duref:`ref
-&lt;grid-tables&gt;`), you have to "paint" the cell grid yourself.  They look like
-this::
-
-   +------------------------+------------+----------+----------+
-   | Header row, column 1   | Header 2   | Header 3 | Header 4 |
-   | (header rows optional) |            |          |          |
-   +========================+============+==========+==========+
-   | body row 1, column 1   | column 2   | column 3 | column 4 |
-   +------------------------+------------+----------+----------+
-   | body row 2             | ...        | ...      |          |
-   +------------------------+------------+----------+----------+
-
-*Simple tables* (:duref:`ref &lt;simple-tables&gt;`) are easier to write, but
-limited: they must contain more than one row, and the first column cannot
-contain multiple lines.  They look like this::
-
-   =====  =====  =======
-   A      B      A and B
-   =====  =====  =======
-   False  False  False
-   True   False  False
-   False  True   False
-   True   True   True
-   =====  =====  =======
-
-
-Hyperlinks
-----------
-
-External links
-^^^^^^^^^^^^^^
-
-Use ```Link text &lt;http://example.com/&gt;`_`` for inline web links.  If the link
-text should be the web address, you don't need special markup at all, the parser
-finds links and mail addresses in ordinary text.
-
-You can also separate the link and the target definition (:duref:`ref
-&lt;hyperlink-targets&gt;`), like this::
-
-   This is a paragraph that contains `a link`_.
-
-   .. _a link: http://example.com/
-
-
-Internal links
-^^^^^^^^^^^^^^
-
-Internal linking is done via a special reST role provided by Sphinx, see the
-section on specific markup, :ref:`ref-role`.
-
-
-Sections
---------
-
-Section headers (:duref:`ref &lt;sections&gt;`) are created by underlining (and
-optionally overlining) the section title with a punctuation character, at least
-as long as the text::
-
-   =================
-   This is a heading
-   =================
-
-Normally, there are no heading levels assigned to certain characters as the
-structure is determined from the succession of headings.  However, for the
-Python documentation, this convention is used which you may follow:
-
-* ``#`` with overline, for parts
-* ``*`` with overline, for chapters
-* ``=``, for sections
-* ``-``, for subsections
-* ``^``, for subsubsections
-* ``"``, for paragraphs
-
-Of course, you are free to use your own marker characters (see the reST
-documentation), and use a deeper nesting level, but keep in mind that most
-target formats (HTML, LaTeX) have a limited supported nesting depth.
-
-
-Explicit Markup
----------------
-
-"Explicit markup" (:duref:`ref &lt;explicit-markup-blocks&gt;`) is used in reST for
-most constructs that need special handling, such as footnotes,
-specially-highlighted paragraphs, comments, and generic directives.
-
-An explicit markup block begins with a line starting with ``..`` followed by
-whitespace and is terminated by the next paragraph at the same level of
-indentation.  (There needs to be a blank line between explicit markup and normal
-paragraphs.  This may all sound a bit complicated, but it is intuitive enough
-when you write it.)
-
-
-.. _directives:
-
-Directives
-----------
-
-A directive (:duref:`ref &lt;directives&gt;`) is a generic block of explicit markup.
-Besides roles, it is one of the extension mechanisms of reST, and Sphinx makes
-heavy use of it.
-
-Docutils supports the following directives:
-
-* Admonitions: :dudir:`attention`, :dudir:`caution`, :dudir:`danger`,
-  :dudir:`error`, :dudir:`hint`, :dudir:`important`, :dudir:`note`,
-  :dudir:`tip`, :dudir:`warning` and the generic :dudir:`admonition`.
-  (Most themes style only "note" and "warning" specially.)
-
-* Images:
-
-  - :dudir:`image` (see also Images_ below)
-  - :dudir:`figure` (an image with caption and optional legend)
-
-* Additional body elements:
-
-  - :dudir:`contents` (a local, i.e. for the current file only, table of
-    contents)
-  - :dudir:`container` (a container with a custom class, useful to generate an
-    outer ``&lt;div&gt;`` in HTML)
-  - :dudir:`rubric` (a heading without relation to the document sectioning)
-  - :dudir:`topic`, :dudir:`sidebar` (special highlighted body elements)
-  - :dudir:`parsed-literal` (literal block that supports inline markup)
-  - :dudir:`epigraph` (a block quote with optional attribution line)
-  - :dudir:`highlights`, :dudir:`pull-quote` (block quotes with their own
-    class attribute)
-  - :dudir:`compound` (a compound paragraph)
-
-* Special tables:
-
-  - :dudir:`table` (a table with title)
-  - :dudir:`csv-table` (a table generated from comma-separated values)
-  - :dudir:`list-table` (a table generated from a list of lists)
-
-* Special directives:
-
-  - :dudir:`raw` (include raw target-format markup)
-  - :dudir:`include` (include reStructuredText from another file)
-    -- in Sphinx, when given an absolute include file path, this directive takes
-    it as relative to the source directory
-  - :dudir:`class` (assign a class attribute to the next element) [1]_
-
-* HTML specifics:
-
-  - :dudir:`meta` (generation of HTML ``&lt;meta&gt;`` tags)
-  - :dudir:`title` (override document title)
-
-* Influencing markup:
-
-  - :dudir:`default-role` (set a new default role)
-  - :dudir:`role` (create a new role)
-
-  Since these are only per-file, better use Sphinx' facilities for setting the
-  :confval:`default_role`.
-
-Do *not* use the directives :dudir:`sectnum`, :dudir:`header` and
-:dudir:`footer`.
-
-Directives added by Sphinx are described in :ref:`sphinxmarkup`.
-
-Basically, a directive consists of a name, arguments, options and content. (Keep
-this terminology in mind, it is used in the next chapter describing custom
-directives.)  Looking at this example, ::
-
-   .. function:: foo(x)
-                 foo(y, z)
-      :module: some.module.name
-
-      Return a line of text input from the user.
-
-``function`` is the directive name.  It is given two arguments here, the
-remainder of the first line and the second line, as well as one option
-``module`` (as you can see, options are given in the lines immediately following
-the arguments and indicated by the colons).  Options must be indented to the
-same level as the directive content.
-
-The directive content follows after a blank line and is indented relative to the
-directive start.
-
-
-Images
-------
-
-reST supports an image directive (:dudir:`ref &lt;image&gt;`), used like so::
-
-   .. image:: gnu.png
-      (options)
-
-When used within Sphinx, the file name given (here ``gnu.png``) must either be
-relative to the source file, or absolute which means that they are relative to
-the top source directory.  For example, the file ``sketch/spam.rst`` could refer
-to the image ``images/spam.png`` as ``../images/spam.png`` or
-``/images/spam.png``.
-
-Sphinx will automatically copy image files over to a subdirectory of the output
-directory on building (e.g. the ``_static`` directory for HTML output.)
-
-Interpretation of image size options (``width`` and ``height``) is as follows:
-if the size has no unit or the unit is pixels, the given size will only be
-respected for output channels that support pixels (i.e. not in LaTeX output).
-Other units (like ``pt`` for points) will be used for HTML and LaTeX output.
-
-Sphinx extends the standard docutils behavior by allowing an asterisk for the
-extension::
-
-   .. image:: gnu.*
-
-Sphinx then searches for all images matching the provided pattern and determines
-their type.  Each builder then chooses the best image out of these candidates.
-For instance, if the file name ``gnu.*`` was given and two files :file:`gnu.pdf`
-and :file:`gnu.png` existed in the source tree, the LaTeX builder would choose
-the former, while the HTML builder would prefer the latter.
-
-.. versionchanged:: 0.4
-   Added the support for file names ending in an asterisk.
-
-.. versionchanged:: 0.6
-   Image paths can now be absolute.
-
-
-Footnotes
----------
-
-For footnotes (:duref:`ref &lt;footnotes&gt;`), use ``[#name]_`` to mark the footnote
-location, and add the footnote body at the bottom of the document after a
-"Footnotes" rubric heading, like so::
-
-   Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_
-
-   .. rubric:: Footnotes
-
-   .. [#f1] Text of the first footnote.
-   .. [#f2] Text of the second footnote.
-
-You can also explicitly number the footnotes (``[1]_``) or use auto-numbered
-footnotes without names (``[#]_``).
-
-
-Citations
----------
-
-Standard reST citations (:duref:`ref &lt;citations&gt;`) are supported, with the
-additional feature that they are "global", i.e. all citations can be referenced
-from all files.  Use them like so::
-
-   Lorem ipsum [Ref]_ dolor sit amet.
-
-   .. [Ref] Book or article reference, URL or whatever.
-
-Citation usage is similar to footnote usage, but with a label that is not
-numeric or begins with ``#``.
-
-
-Substitutions
--------------
-
-reST supports "substitutions" (:duref:`ref &lt;substitution-definitions&gt;`), which
-are pieces of text and/or markup referred to in the text by ``|name|``.  They
-are defined like footnotes with explicit markup blocks, like this::
-
-   .. |name| replace:: replacement *text*
-
-or this::
-
-   .. |caution| image:: warning.png
-                :alt: Warning!
-
-See the :duref:`reST reference for substitutions &lt;substitution-definitions&gt;`
-for details.
-
-If you want to use some substitutions for all documents, put them into
-:confval:`rst_prolog` or put them into a separate file and include it into all
-documents you want to use them in, using the :rst:dir:`include` directive.  (Be
-sure to give the include file a file name extension differing from that of other
-source files, to avoid Sphinx finding it as a standalone document.)
-
-Sphinx defines some default substitutions, see :ref:`default-substitutions`.
-
-
-Comments
---------
-
-Every explicit markup block which isn't a valid markup construct (like the
-footnotes above) is regarded as a comment (:duref:`ref &lt;comments&gt;`).  For
-example::
-
-   .. This is a comment.
-
-You can indent text after a comment start to form multiline comments::
-
-   ..
-      This whole indented block
-      is a comment.
-
-      Still in the comment.
-
-
-Source encoding
----------------
-
-Since the easiest way to include special characters like em dashes or copyright
-signs in reST is to directly write them as Unicode characters, one has to
-specify an encoding.  Sphinx assumes source files to be encoded in UTF-8 by
-default; you can change this with the :confval:`source_encoding` config value.
-
-
-Gotchas
--------
-
-There are some problems one commonly runs into while authoring reST documents:
-
-* **Separation of inline markup:** As said above, inline markup spans must be
-  separated from the surrounding text by non-word characters, you have to use a
-  backslash-escaped space to get around that.  See `the reference
-  &lt;http://docutils.sf.net/docs/ref/rst/restructuredtext.html#inline-markup&gt;`_
-  for the details.
-
-* **No nested inline markup:** Something like ``*see :func:`foo`*`` is not
-  possible.
-
-
-.. rubric:: Footnotes
-
-.. [1] When the default domain contains a :rst:dir:`class` directive, this directive
-       will be shadowed.  Therefore, Sphinx re-exports it as :rst:dir:`rst-class`.
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-      });
-    </script>
-    <p>
-        The <code>python</code> mode will be used for highlighting blocks
-        containing Python/IPython terminal sessions: blocks starting with
-        <code>&gt;&gt;&gt;</code> (for Python) or <code>In [num]:</code> (for
-        IPython).
-
-        Further, the <code>stex</code> mode will be used for highlighting
-        blocks containing LaTex code.
-    </p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-rst</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rst/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rst/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rst/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/index.html.html
deleted file mode 100644
index 97544babc3abd69a4ff360c3b6a40a3700dec696..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/index.html.html
+++ /dev/null
@@ -1,183 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Ruby mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="ruby.js"></script>
-<style>
-      .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-      .cm-s-default span.cm-arrow { color: red; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Ruby</a>
-  </ul>
-</div>
-
-<article>
-<h2>Ruby mode</h2>
-<form><textarea id="code" name="code">
-# Code from http://sandbox.mc.edu/~bennet/ruby/code/poly_rb.html
-#
-# This program evaluates polynomials.  It first asks for the coefficients
-# of a polynomial, which must be entered on one line, highest-order first.
-# It then requests values of x and will compute the value of the poly for
-# each x.  It will repeatly ask for x values, unless you the user enters
-# a blank line.  It that case, it will ask for another polynomial.  If the
-# user types quit for either input, the program immediately exits.
-#
-
-#
-# Function to evaluate a polynomial at x.  The polynomial is given
-# as a list of coefficients, from the greatest to the least.
-def polyval(x, coef)
-    sum = 0
-    coef = coef.clone           # Don't want to destroy the original
-    while true
-        sum += coef.shift       # Add and remove the next coef
-        break if coef.empty?    # If no more, done entirely.
-        sum *= x                # This happens the right number of times.
-    end
-    return sum
-end
-
-#
-# Function to read a line containing a list of integers and return
-# them as an array of integers.  If the string conversion fails, it
-# throws TypeError.  If the input line is the word 'quit', then it
-# converts it to an end-of-file exception
-def readints(prompt)
-    # Read a line
-    print prompt
-    line = readline.chomp
-    raise EOFError.new if line == 'quit' # You can also use a real EOF.
-            
-    # Go through each item on the line, converting each one and adding it
-    # to retval.
-    retval = [ ]
-    for str in line.split(/\s+/)
-        if str =~ /^\-?\d+$/
-            retval.push(str.to_i)
-        else
-            raise TypeError.new
-        end
-    end
-
-    return retval
-end
-
-#
-# Take a coeff and an exponent and return the string representation, ignoring
-# the sign of the coefficient.
-def term_to_str(coef, exp)
-    ret = ""
-
-    # Show coeff, unless it's 1 or at the right
-    coef = coef.abs
-    ret = coef.to_s     unless coef == 1 && exp > 0
-    ret += "x" if exp > 0                               # x if exponent not 0
-    ret += "^" + exp.to_s if exp > 1                    # ^exponent, if > 1.
-
-    return ret
-end
-
-#
-# Create a string of the polynomial in sort-of-readable form.
-def polystr(p)
-    # Get the exponent of first coefficient, plus 1.
-    exp = p.length
-
-    # Assign exponents to each term, making pairs of coeff and exponent,
-    # Then get rid of the zero terms.
-    p = (p.map { |c| exp -= 1; [ c, exp ] }).select { |p| p[0] != 0 }
-
-    # If there's nothing left, it's a zero
-    return "0" if p.empty?
-
-    # *** Now p is a non-empty list of [ coef, exponent ] pairs. ***
-
-    # Convert the first term, preceded by a "-" if it's negative.
-    result = (if p[0][0] < 0 then "-" else "" end) + term_to_str(*p[0])
-
-    # Convert the rest of the terms, in each case adding the appropriate
-    # + or - separating them.  
-    for term in p[1...p.length]
-        # Add the separator then the rep. of the term.
-        result += (if term[0] < 0 then " - " else " + " end) + 
-                term_to_str(*term)
-    end
-
-    return result
-end
-        
-#
-# Run until some kind of endfile.
-begin
-    # Repeat until an exception or quit gets us out.
-    while true
-        # Read a poly until it works.  An EOF will except out of the
-        # program.
-        print "\n"
-        begin
-            poly = readints("Enter a polynomial coefficients: ")
-        rescue TypeError
-            print "Try again.\n"
-            retry
-        end
-        break if poly.empty?
-
-        # Read and evaluate x values until the user types a blank line.
-        # Again, an EOF will except out of the pgm.
-        while true
-            # Request an integer.
-            print "Enter x value or blank line: "
-            x = readline.chomp
-            break if x == ''
-            raise EOFError.new if x == 'quit'
-
-            # If it looks bad, let's try again.
-            if x !~ /^\-?\d+$/
-                print "That doesn't look like an integer.  Please try again.\n"
-                next
-            end
-
-            # Convert to an integer and print the result.
-            x = x.to_i
-            print "p(x) = ", polystr(poly), "\n"
-            print "p(", x, ") = ", polyval(x, poly), "\n"
-        end
-    end
-rescue EOFError
-    print "\n=== EOF ===\n"
-rescue Interrupt, SignalException
-    print "\n=== Interrupted ===\n"
-else
-    print "--- Bye ---\n"
-end
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "text/x-ruby",
-        matchBrackets: true,
-        indentUnit: 4
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-ruby</code>.</p>
-
-    <p>Development of the CodeMirror Ruby mode was kindly sponsored
-    by <a href="http://ubalo.com/">Ubalo</a>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/ruby.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/ruby.js.js
index 085f909f5f9c21da8bcd1bca744f8c59c137bf27..874c1830e7e32aac5da60ba8bd00049741343d4c 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/ruby.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/ruby.js.js
@@ -46,22 +46,10 @@ CodeMirror.defineMode("ruby", function(config) {
     if (ch == "`" || ch == "'" || ch == '"') {
       return chain(readQuoted(ch, "string", ch == '"' || ch == "`"), stream, state);
     } else if (ch == "/") {
-      var currentIndex = stream.current().length;
-      if (stream.skipTo("/")) {
-        var search_till = stream.current().length;
-        stream.backUp(stream.current().length - currentIndex);
-        var balance = 0;  // balance brackets
-        while (stream.current().length < search_till) {
-          var chchr = stream.next();
-          if (chchr == "(") balance += 1;
-          else if (chchr == ")") balance -= 1;
-          if (balance < 0) break;
-        }
-        stream.backUp(stream.current().length - currentIndex);
-        if (balance == 0)
-          return chain(readQuoted(ch, "string-2", true), stream, state);
-      }
-      return "operator";
+      if (regexpAhead(stream))
+        return chain(readQuoted(ch, "string-2", true), stream, state);
+      else
+        return "operator";
     } else if (ch == "%") {
       var style = "string", embed = true;
       if (stream.eat("s")) style = "atom";
@@ -148,6 +136,28 @@ CodeMirror.defineMode("ruby", function(config) {
     }
   }
 
+  function regexpAhead(stream) {
+    var start = stream.pos, depth = 0, next, found = false, escaped = false
+    while ((next = stream.next()) != null) {
+      if (!escaped) {
+        if ("[{(".indexOf(next) > -1) {
+          depth++
+        } else if ("]})".indexOf(next) > -1) {
+          depth--
+          if (depth < 0) break
+        } else if (next == "/" && depth == 0) {
+          found = true
+          break
+        }
+        escaped = next == "\\"
+      } else {
+        escaped = false
+      }
+    }
+    stream.backUp(stream.pos - start)
+    return found
+  }
+
   function tokenBaseUntilBrace(depth) {
     if (!depth) depth = 1;
     return function(stream, state) {
@@ -276,7 +286,8 @@ CodeMirror.defineMode("ruby", function(config) {
     },
 
     electricInput: /^\s*(?:end|rescue|elsif|else|\})$/,
-    lineComment: "#"
+    lineComment: "#",
+    fold: "indent"
   };
 });
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/test.js.js
index cade864ff9668b733c61a92d6f45b0a0ae4c966d..3133bd63f46715f030148cb0a1612a683e8a1721 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ruby/test.js.js
@@ -11,4 +11,6 @@
   MT("divide_equal_operator_no_spacing",
      "[variable foo][operator /=][number 42]");
 
+  MT("complex_regexp",
+     "[keyword if] [variable cr] [operator =~] [string-2 /(?: \\( #{][tag RE_NOT][string-2 }\\( | #{][tag RE_NOT_PAR_OR][string-2 }* #{][tag RE_OPA_OR][string-2 } )/][variable x]")
 })();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/index.html.html
deleted file mode 100644
index 1fe0ad1e66e254c427850454637954f497dcd88f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/index.html.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Rust mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/simple.js"></script>
-<script src="rust.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Rust</a>
-  </ul>
-</div>
-
-<article>
-<h2>Rust mode</h2>
-
-
-<div><textarea id="code" name="code">
-// Demo code.
-
-type foo<T> = int;
-enum bar {
-    some(int, foo<float>),
-    none
-}
-
-fn check_crate(x: int) {
-    let v = 10;
-    match foo {
-        1 ... 3 {
-            print_foo();
-            if x {
-                blah().to_string();
-            }
-        }
-        (x, y) { "bye" }
-        _ { "hi" }
-    }
-}
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        lineWrapping: true,
-        indentUnit: 4,
-        mode: "rust"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-rustsrc</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/rust.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/rust.js.js
index 8558b53fe4c669d688eb6d21704fcf8dc014d0b6..b635563ae64fae81a365e64ad019e81c9495892a 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/rust.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/rust/rust.js.js
@@ -68,4 +68,5 @@ CodeMirror.defineSimpleMode("rust",{
 
 
 CodeMirror.defineMIME("text/x-rustsrc", "rust");
+CodeMirror.defineMIME("text/rust", "rust");
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/index.html.html
deleted file mode 100644
index 636e06594b6708b9ee045b8af85132096915946b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/index.html.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: SAS mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="sas.js"></script>
-<style type="text/css">
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-  .cm-s-default .cm-trailing-space-a:before,
-  .cm-s-default .cm-trailing-space-b:before {position: absolute; content: "\00B7"; color: #777;}
-  .cm-s-default .cm-trailing-space-new-line:before {position: absolute; content: "\21B5"; color: #777;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">SAS</a>
-  </ul>
-</div>
-
-<article>
-<h2>SAS mode</h2>
-<form><textarea id="code" name="code">
-libname foo "/tmp/foobar";
-%let count=1;
-
-/* Multi line
-Comment
-*/
-data _null_;
-    x=ranuni();
-    * single comment;
-    x2=x**2;
-    sx=sqrt(x);
-    if x=x2 then put "x must be 1";
-    else do;
-        put x=;
-    end;
-run;
-
-/* embedded comment
-* comment;
-*/
-
-proc glm data=sashelp.class;
-    class sex;
-    model weight = height sex;
-run;
-
-proc sql;
-    select count(*)
-    from sashelp.class;
-
-    create table foo as
-    select * from sashelp.class;
-
-    select *
-    from foo;
-quit;
-</textarea></form>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    mode: 'sas',
-    lineNumbers: true
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>text/x-sas</code>.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/sas.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/sas.js.js
index a6109eb11c98f147df2b7a96c49b82fd5a3c7899..d85b33534c654e223bfc6149ff4e53904af00700 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/sas.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sas/sas.js.js
@@ -11,7 +11,7 @@
 
 
 //Definitions
-//  comment -- text withing * ; or /* */
+//  comment -- text within * ; or /* */
 //  keyword -- SAS language variable
 //  variable -- macro variables starts with '&' or variable formats
 //  variable-2 -- DATA Step, proc, or macro names
@@ -116,28 +116,15 @@
         return "comment";
       }
 
+      if (ch == "*" && stream.column() == stream.indentation()) {
+        stream.skipToEnd()
+        return "comment"
+      }
+
       // DoubleOperator match
       var doubleOperator = ch + stream.peek();
 
-      // Match all line comments.
-      var myString = stream.string;
-      var myRegexp = /(?:^\s*|[;]\s*)(\*.*?);/ig;
-      var match = myRegexp.exec(myString);
-      if (match !== null) {
-        if (match.index === 0 && (stream.column() !== (match.index + match[0].length - 1))) {
-          stream.backUp(stream.column());
-          stream.skipTo(';');
-          stream.next();
-          return 'comment';
-        } else if (match.index + 1 < stream.column() && stream.column() < match.index + match[0].length - 1) {
-          // the ';' triggers the match so move one past it to start
-          // the comment block that is why match.index+1
-          stream.backUp(stream.column() - match.index - 1);
-          stream.skipTo(';');
-          stream.next();
-          return 'comment';
-        }
-      } else if ((ch === '"' || ch === "'") && !state.continueString) {
+      if ((ch === '"' || ch === "'") && !state.continueString) {
         state.continueString = ch
         return "string"
       } else if (state.continueString) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/index.html.html
deleted file mode 100644
index 6305649e5cef3a8ea89dfc5657ce280aa5c717b3..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/index.html.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Sass mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="../css/css.js"></script>
-<script src="sass.js"></script>
-<style>.CodeMirror {border: 1px solid #ddd; font-size:12px; height: 400px}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Sass</a>
-  </ul>
-</div>
-
-<article>
-<h2>Sass mode</h2>
-<form><textarea id="code" name="code">// Variable Definitions
-
-$page-width:    800px
-$sidebar-width: 200px
-$primary-color: #eeeeee
-
-// Global Attributes
-
-body
-  font:
-    family: sans-serif
-    size: 30em
-    weight: bold
-
-// Scoped Styles
-
-#contents
-  width: $page-width
-  #sidebar
-    float: right
-    width: $sidebar-width
-  #main
-    width: $page-width - $sidebar-width
-    background: $primary-color
-    h2
-      color: blue
-
-#footer
-  height: 200px
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers : true,
-        matchBrackets : true,
-        mode: "sass"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-sass</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/sass.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/sass.js.js
index ba0e05626c90fac9881988d4c58bf3489b397031..7d8135bfe5195b8d3cef8514d02edc6df65bc880 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/sass.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sass/sass.js.js
@@ -447,7 +447,7 @@ CodeMirror.defineMode("sass", function(config) {
       return state.scopes[0].offset;
     }
   };
-});
+}, "css");
 
 CodeMirror.defineMIME("text/x-sass", "sass");
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/index.html.html
deleted file mode 100644
index 04d5c6a2a3435e502cf01c5de133b46be27e2195..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/index.html.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Scheme mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="scheme.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Scheme</a>
-  </ul>
-</div>
-
-<article>
-<h2>Scheme mode</h2>
-<form><textarea id="code" name="code">
-; See if the input starts with a given symbol.
-(define (match-symbol input pattern)
-  (cond ((null? (remain input)) #f)
-	((eqv? (car (remain input)) pattern) (r-cdr input))
-	(else #f)))
-
-; Allow the input to start with one of a list of patterns.
-(define (match-or input pattern)
-  (cond ((null? pattern) #f)
-	((match-pattern input (car pattern)))
-	(else (match-or input (cdr pattern)))))
-
-; Allow a sequence of patterns.
-(define (match-seq input pattern)
-  (if (null? pattern)
-      input
-      (let ((match (match-pattern input (car pattern))))
-	(if match (match-seq match (cdr pattern)) #f))))
-
-; Match with the pattern but no problem if it does not match.
-(define (match-opt input pattern)
-  (let ((match (match-pattern input (car pattern))))
-    (if match match input)))
-
-; Match anything (other than '()), until pattern is found. The rather
-; clumsy form of requiring an ending pattern is needed to decide where
-; the end of the match is. If none is given, this will match the rest
-; of the sentence.
-(define (match-any input pattern)
-  (cond ((null? (remain input)) #f)
-	((null? pattern) (f-cons (remain input) (clear-remain input)))
-	(else
-	 (let ((accum-any (collector)))
-	   (define (match-pattern-any input pattern)
-	     (cond ((null? (remain input)) #f)
-		   (else (accum-any (car (remain input)))
-			 (cond ((match-pattern (r-cdr input) pattern))
-			       (else (match-pattern-any (r-cdr input) pattern))))))
-	   (let ((retval (match-pattern-any input (car pattern))))
-	     (if retval
-		 (f-cons (accum-any) retval)
-		 #f))))))
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-scheme</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/scheme.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/scheme.js.js
index 22346459115d01de8adf4e6c84a3c706f2c63755..1d8f7d17f0b89f6ff81f5b7a4c1e69929e4bddb3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/scheme.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/scheme/scheme.js.js
@@ -224,7 +224,7 @@ CodeMirror.defineMode("scheme", function () {
                             }
                         }
                     } else {
-                        stream.eatWhile(/[\w\$_\-!$%&*+\.\/:<=>?@\^~]/);
+                        stream.eatWhile(/[\w_\-!$%&*+\.\/:<=>?@\^~]/);
 
                         if (keywords && keywords.propertyIsEnumerable(stream.current())) {
                             returnType = BUILTIN;
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/index.html.html
deleted file mode 100644
index 0b56300b12be2dcd3fad2d9c8b3cc7379db95b0c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/index.html.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Shell mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel=stylesheet href=../../lib/codemirror.css>
-<script src=../../lib/codemirror.js></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src=shell.js></script>
-<style type=text/css>
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Shell</a>
-  </ul>
-</div>
-
-<article>
-<h2>Shell mode</h2>
-
-
-<textarea id=code>
-#!/bin/bash
-
-# clone the repository
-git clone http://github.com/garden/tree
-
-# generate HTTPS credentials
-cd tree
-openssl genrsa -aes256 -out https.key 1024
-openssl req -new -nodes -key https.key -out https.csr
-openssl x509 -req -days 365 -in https.csr -signkey https.key -out https.crt
-cp https.key{,.orig}
-openssl rsa -in https.key.orig -out https.key
-
-# start the server in HTTPS mode
-cd web
-sudo node ../server.js 443 'yes' &gt;&gt; ../node.log &amp;
-
-# here is how to stop the server
-for pid in `ps aux | grep 'node ../server.js' | awk '{print $2}'` ; do
-  sudo kill -9 $pid 2&gt; /dev/null
-done
-
-exit 0</textarea>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
-    mode: 'shell',
-    lineNumbers: true,
-    matchBrackets: true
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>text/x-sh</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/shell.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/shell.js.js
index 944f64dc5273244cdb3e9334c4f5d6c6d7fb6d96..b806c2bcb55bfae3274a375bd9b7c2bacc13632b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/shell.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/shell.js.js
@@ -30,9 +30,9 @@ CodeMirror.defineMode('shell', function() {
 
   // Commands
   define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' +
-    'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' +
+    'curl cut diff echo find gawk gcc get git grep hg kill killall ln ls make ' +
     'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' +
-    'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' +
+    'shopt shred source sort sleep ssh start stop su sudo svn tee telnet top ' +
     'touch vi vim wall wc wget who write yes zsh');
 
   function tokenBase(stream, state) {
@@ -82,43 +82,48 @@ CodeMirror.defineMode('shell', function() {
   }
 
   function tokenString(quote, style) {
-    var close = quote == "(" ? ")" : quote
+    var close = quote == "(" ? ")" : quote == "{" ? "}" : quote
     return function(stream, state) {
-      var next, end = false, escaped = false;
+      var next, escaped = false;
       while ((next = stream.next()) != null) {
         if (next === close && !escaped) {
-          end = true;
+          state.tokens.shift();
           break;
-        }
-        if (next === '$' && !escaped && quote !== "'") {
+        } else if (next === '$' && !escaped && quote !== "'" && stream.peek() != close) {
           escaped = true;
           stream.backUp(1);
           state.tokens.unshift(tokenDollar);
           break;
-        }
-        if (next === "(" && quote === "(") {
+        } else if (!escaped && quote !== close && next === quote) {
           state.tokens.unshift(tokenString(quote, style))
           return tokenize(stream, state)
+        } else if (!escaped && /['"]/.test(next) && !/['"]/.test(quote)) {
+          state.tokens.unshift(tokenStringStart(next, "string"));
+          stream.backUp(1);
+          break;
         }
         escaped = !escaped && next === '\\';
       }
-      if (end || !escaped) state.tokens.shift();
       return style;
     };
   };
 
+  function tokenStringStart(quote, style) {
+    return function(stream, state) {
+      state.tokens[0] = tokenString(quote, style)
+      stream.next()
+      return tokenize(stream, state)
+    }
+  }
+
   var tokenDollar = function(stream, state) {
     if (state.tokens.length > 1) stream.eat('$');
-    var ch = stream.next(), hungry = /\w/;
-    if (ch === '{') hungry = /[^}]/;
-    if (/['"(]/.test(ch)) {
-      state.tokens[0] = tokenString(ch, ch == "(" ? "quote" : "string");
+    var ch = stream.next()
+    if (/['"({]/.test(ch)) {
+      state.tokens[0] = tokenString(ch, ch == "(" ? "quote" : ch == "{" ? "def" : "string");
       return tokenize(stream, state);
     }
-    if (!/\d/.test(ch)) {
-      stream.eatWhile(hungry);
-      stream.eat('}');
-    }
+    if (!/\d/.test(ch)) stream.eatWhile(/\w/);
     state.tokens.shift();
     return 'def';
   };
@@ -139,5 +144,8 @@ CodeMirror.defineMode('shell', function() {
 });
 
 CodeMirror.defineMIME('text/x-sh', 'shell');
+// Apache uses a slightly different Media Type for Shell scripts
+// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+CodeMirror.defineMIME('application/x-sh', 'shell');
 
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/test.js.js
index e42dd162871e8503286690b355f71c5571e21dab..4be557216f5b4daacf22b6f87ed12ee8f735a40e 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/shell/test.js.js
@@ -58,4 +58,16 @@
 
   MT("doubleParens",
      "foo [quote $((bar))]")
+
+  MT("nested braces",
+     "[builtin echo] [def ${A[${B}]]}]")
+
+  MT("strings in parens",
+     "[def FOO][operator =]([quote $(<][string \"][def $MYDIR][string \"][quote /myfile grep ][string 'hello$'][quote )])")
+
+  MT ("string ending in dollar",
+     '[def a][operator =][string "xyz$"]; [def b][operator =][string "y"]')
+
+  MT ("quote ending in dollar",
+     "[quote $(echo a$)]")
 })();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/index.html.html
deleted file mode 100644
index 6f029b623e81813f57e0cf9a98c5603d68f79a99..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/index.html.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Sieve (RFC5228) mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="sieve.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Sieve (RFC5228)</a>
-  </ul>
-</div>
-
-<article>
-<h2>Sieve (RFC5228) mode</h2>
-<form><textarea id="code" name="code">
-#
-# Example Sieve Filter
-# Declare any optional features or extension used by the script
-#
-
-require ["fileinto", "reject"];
-
-#
-# Reject any large messages (note that the four leading dots get
-# "stuffed" to three)
-#
-if size :over 1M
-{
-  reject text:
-Please do not send me large attachments.
-Put your file on a server and send me the URL.
-Thank you.
-.... Fred
-.
-;
-  stop;
-}
-
-#
-# Handle messages from known mailing lists
-# Move messages from IETF filter discussion list to filter folder
-#
-if header :is "Sender" "owner-ietf-mta-filters@imc.org"
-{
-  fileinto "filter";  # move to "filter" folder
-}
-#
-# Keep all messages to or from people in my company
-#
-elsif address :domain :is ["From", "To"] "example.com"
-{
-  keep;               # keep in "In" folder
-}
-
-#
-# Try and catch unsolicited email.  If a message is not to me,
-# or it contains a subject known to be spam, file it away.
-#
-elsif anyof (not address :all :contains
-               ["To", "Cc", "Bcc"] "me@example.com",
-             header :matches "subject"
-               ["*make*money*fast*", "*university*dipl*mas*"])
-{
-  # If message header does not contain my address,
-  # it's from a list.
-  fileinto "spam";   # move to "spam" folder
-}
-else
-{
-  # Move all other (non-company) mail to "personal"
-  # folder.
-  fileinto "personal";
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>application/sieve</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/sieve.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/sieve.js.js
index f67db2f5531b0c524fea1ab8e09ed8b86bcd6548..0920d0bab323bda6bf3af62569fd3e757b75069b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/sieve.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sieve/sieve.js.js
@@ -170,7 +170,7 @@ CodeMirror.defineMode("sieve", function(config) {
       if (stream.eatSpace())
         return null;
 
-      return (state.tokenize || tokenBase)(stream, state);;
+      return (state.tokenize || tokenBase)(stream, state);
     },
 
     indent: function(state, _textAfter) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/slim/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/slim/index.html.html
deleted file mode 100644
index 7fa4e50df3c51bea62529cc18a705438d6443d85..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/slim/index.html.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: SLIM mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/ambiance.css">
-<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
-<script src="https://code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
-<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../htmlembedded/htmlembedded.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="../coffeescript/coffeescript.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../ruby/ruby.js"></script>
-<script src="../markdown/markdown.js"></script>
-<script src="slim.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">SLIM</a>
-  </ul>
-</div>
-
-<article>
-  <h2>SLIM mode</h2>
-  <form><textarea id="code" name="code">
-body
-  table
-    - for user in users
-      td id="user_#{user.id}" class=user.role
-        a href=user_action(user, :edit) Edit #{user.name}
-        a href=(path_to_user user) = user.name
-body
-  h1(id="logo") = page_logo
-  h2[id="tagline" class="small tagline"] = page_tagline
-
-h2[id="tagline"
-   class="small tagline"] = page_tagline
-
-h1 id = "logo" = page_logo
-h2 [ id = "tagline" ] = page_tagline
-
-/ comment
-  second line
-/! html comment
-   second line
-<!-- html comment -->
-<a href="#{'hello' if set}">link</a>
-a.slim href="work" disabled=false running==:atom Text <b>bold</b>
-.clazz data-id="test" == 'hello' unless quark
- | Text mode #{12}
-   Second line
-= x ||= :ruby_atom
-#menu.left
-  - @env.each do |x|
-    li: a = x
-*@dyntag attr="val"
-.first *{:class => [:second, :third]} Text
-.second class=["text","more"]
-.third class=:text,:symbol
-
-  </textarea></form>
-  <script>
-    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-      lineNumbers: true,
-      theme: "ambiance",
-      mode: "application/x-slim"
-    });
-    $('.CodeMirror').resizable({
-      resize: function() {
-        editor.setSize($(this).width(), $(this).height());
-        //editor.refresh();
-      }
-    });
-  </script>
-
-  <p><strong>MIME types defined:</strong> <code>application/x-slim</code>.</p>
-
-  <p>
-    <strong>Parsing/Highlighting Tests:</strong>
-    <a href="../../test/index.html#slim_*">normal</a>,
-    <a href="../../test/index.html#verbose,slim_*">verbose</a>.
-  </p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/slim/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/slim/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/slim/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smalltalk/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smalltalk/index.html.html
deleted file mode 100644
index 2155ebc2a039b49da23607549e8eaf8f114f1481..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smalltalk/index.html.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Smalltalk mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="smalltalk.js"></script>
-<style>
-      .CodeMirror {border: 2px solid #dee; border-right-width: 10px;}
-      .CodeMirror-gutter {border: none; background: #dee;}
-      .CodeMirror-gutter pre {color: white; font-weight: bold;}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Smalltalk</a>
-  </ul>
-</div>
-
-<article>
-<h2>Smalltalk mode</h2>
-<form><textarea id="code" name="code">
-" 
-    This is a test of the Smalltalk code
-"
-Seaside.WAComponent subclass: #MyCounter [
-    | count |
-    MyCounter class &gt;&gt; canBeRoot [ ^true ]
-
-    initialize [
-        super initialize.
-        count := 0.
-    ]
-    states [ ^{ self } ]
-    renderContentOn: html [
-        html heading: count.
-        html anchor callback: [ count := count + 1 ]; with: '++'.
-        html space.
-        html anchor callback: [ count := count - 1 ]; with: '--'.
-    ]
-]
-
-MyCounter registerAsApplication: 'mycounter'
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-stsrc",
-        indentUnit: 4
-      });
-    </script>
-
-    <p>Simple Smalltalk mode.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-stsrc</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smalltalk/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smalltalk/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smalltalk/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smarty/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smarty/index.html.html
deleted file mode 100644
index b19c8f09b5ed79443a7ac492b8444998d5b8c92b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smarty/index.html.html
+++ /dev/null
@@ -1,138 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Smarty mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="smarty.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Smarty</a>
-  </ul>
-</div>
-
-<article>
-<h2>Smarty mode</h2>
-<form><textarea id="code" name="code">
-{extends file="parent.tpl"}
-{include file="template.tpl"}
-
-{* some example Smarty content *}
-{if isset($name) && $name == 'Blog'}
-  This is a {$var}.
-  {$integer = 451}, {$array[] = "a"}, {$stringvar = "string"}
-  {assign var='bob' value=$var.prop}
-{elseif $name == $foo}
-  {function name=menu level=0}
-    {foreach $data as $entry}
-      {if is_array($entry)}
-        - {$entry@key}
-        {menu data=$entry level=$level+1}
-      {else}
-        {$entry}
-      {/if}
-    {/foreach}
-  {/function}
-{/if}</textarea></form>
-
-<p>Mode for Smarty version 2 or 3, which allows for custom delimiter tags.</p>
-
-<p>Several configuration parameters are supported:</p>
-
-<ul>
-  <li><code>leftDelimiter</code> and <code>rightDelimiter</code>,
-  which should be strings that determine where the Smarty syntax
-  starts and ends.</li>
-  <li><code>version</code>, which should be 2 or 3.</li>
-  <li><code>baseMode</code>, which can be a mode spec
-  like <code>"text/html"</code> to set a different background mode.</li>
-</ul>
-
-<p><strong>MIME types defined:</strong> <code>text/x-smarty</code></p>
-
-<h3>Smarty 2, custom delimiters</h3>
-
-<form><textarea id="code2" name="code2">
-{--extends file="parent.tpl"--}
-{--include file="template.tpl"--}
-
-{--* some example Smarty content *--}
-{--if isset($name) && $name == 'Blog'--}
-  This is a {--$var--}.
-  {--$integer = 451--}, {--$array[] = "a"--}, {--$stringvar = "string"--}
-  {--assign var='bob' value=$var.prop--}
-{--elseif $name == $foo--}
-  {--function name=menu level=0--}
-    {--foreach $data as $entry--}
-      {--if is_array($entry)--}
-        - {--$entry@key--}
-        {--menu data=$entry level=$level+1--}
-      {--else--}
-        {--$entry--}
-      {--/if--}
-    {--/foreach--}
-  {--/function--}
-{--/if--}</textarea></form>
-
-<h3>Smarty 3</h3>
-
-<textarea id="code3" name="code3">
-Nested tags {$foo={counter one=1 two={inception}}+3} are now valid in Smarty 3.
-
-<script>
-function test() {
-  console.log("Smarty 3 permits single curly braces followed by whitespace to NOT slip into Smarty mode.");
-}
-</script>
-
-{assign var=foo value=[1,2,3]}
-{assign var=foo value=['y'=>'yellow','b'=>'blue']}
-{assign var=foo value=[1,[9,8],3]}
-
-{$foo=$bar+2} {* a comment *}
-{$foo.bar=1}  {* another comment *}
-{$foo = myfunct(($x+$y)*3)}
-{$foo = strlen($bar)}
-{$foo.bar.baz=1}, {$foo[]=1}
-
-Smarty "dot" syntax (note: embedded {} are used to address ambiguities):
-
-{$foo.a.b.c}      => $foo['a']['b']['c']
-{$foo.a.$b.c}     => $foo['a'][$b]['c']
-{$foo.a.{$b+4}.c} => $foo['a'][$b+4]['c']
-{$foo.a.{$b.c}}   => $foo['a'][$b['c']]
-
-{$object->method1($x)->method2($y)}</textarea>
-
-<script>
-var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-  lineNumbers: true,
-  mode: "smarty"
-});
-var editor = CodeMirror.fromTextArea(document.getElementById("code2"), {
-  lineNumbers: true,
-  mode: {
-    name: "smarty",
-    leftDelimiter: "{--",
-    rightDelimiter: "--}"
-  }
-});
-var editor = CodeMirror.fromTextArea(document.getElementById("code3"), {
-  lineNumbers: true,
-  mode: {name: "smarty", version: 3, baseMode: "text/html"}
-});
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smarty/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smarty/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/smarty/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/index.html.html
deleted file mode 100644
index 4b18c25b786843bc6522d553d712898d3eb432af..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/index.html.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Solr mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="solr.js"></script>
-<style type="text/css">
-  .CodeMirror {
-    border-top: 1px solid black;
-    border-bottom: 1px solid black;
-  }
-
-  .CodeMirror .cm-operator {
-    color: orange;
-  }
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Solr</a>
-  </ul>
-</div>
-
-<article>
-  <h2>Solr mode</h2>
-
-  <div>
-    <textarea id="code" name="code">author:Camus
-
-title:"The Rebel" and author:Camus
-
-philosophy:Existentialism -author:Kierkegaard
-
-hardToSpell:Dostoevsky~
-
-published:[194* TO 1960] and author:(Sartre or "Simone de Beauvoir")</textarea>
-  </div>
-
-  <script>
-    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-      mode: 'solr',
-      lineNumbers: true
-    });
-  </script>
-
-  <p><strong>MIME types defined:</strong> <code>text/x-solr</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/solr.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/solr.js.js
index f7f7087891694b345dfaaed3392fd83c5d460702..dc8b82501e8bd3323ae09abaabbcaef3a051549a 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/solr.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/solr/solr.js.js
@@ -14,12 +14,12 @@
 CodeMirror.defineMode("solr", function() {
   "use strict";
 
-  var isStringChar = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/;
+  var isStringChar = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\"\\]/;
   var isOperatorChar = /[\|\!\+\-\*\?\~\^\&]/;
   var isOperatorString = /^(OR|AND|NOT|TO)$/i;
 
   function isNumber(word) {
-    return parseFloat(word, 10).toString() === word;
+    return parseFloat(word).toString() === word;
   }
 
   function tokenString(quote) {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/index.html.html
deleted file mode 100644
index f0216f097dd1c7eb8506ba685dd6be8a7857fa9c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/index.html.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Soy (Closure Template) mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../css/css.js"></script>
-<script src="soy.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Soy (Closure Template)</a>
-  </ul>
-</div>
-
-<article>
-<h2>Soy (Closure Template) mode</h2>
-<form><textarea id="code" name="code">
-{namespace example}
-
-/**
- * Says hello to the world.
- */
-{template .helloWorld}
-  {@param name: string}
-  {@param? score: number}
-  Hello <b>{$name}</b>!
-  <div>
-    {if $score}
-      <em>{$score} points</em>
-    {else}
-      no score
-    {/if}
-  </div>
-{/template}
-
-{template .alertHelloWorld kind="js"}
-  alert('Hello World');
-{/template}
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-soy",
-        indentUnit: 2,
-        indentWithTabs: false
-      });
-    </script>
-
-    <p>A mode for <a href="https://developers.google.com/closure/templates/">Closure Templates</a> (Soy).</p>
-    <p><strong>MIME type defined:</strong> <code>text/x-soy</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/soy.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/soy.js.js
index 1c1f74d1dcedd1571ca168033e46b031a2261749..de54401500f4b8c97a269ff9c679319277e130c6 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/soy.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/soy.js.js
@@ -22,6 +22,7 @@
       attributes: textMode,
       text: textMode,
       uri: textMode,
+      trusted_resource_uri: textMode,
       css: CodeMirror.getMode(config, "text/css"),
       js: CodeMirror.getMode(config, {name: "text/javascript", statementIndent: 2 * config.indentUnit})
     };
@@ -31,6 +32,12 @@
     }
 
     function tokenUntil(stream, state, untilRegExp) {
+      if (stream.sol()) {
+        for (var indent = 0; indent < state.indent; indent++) {
+          if (!stream.eat(/\s/)) break;
+        }
+        if (indent) return null;
+      }
       var oldString = stream.string;
       var match = untilRegExp.exec(oldString.substr(stream.pos));
       if (match) {
@@ -39,7 +46,8 @@
         stream.string = oldString.substr(0, stream.pos + match.index);
       }
       var result = stream.hideFirstChars(state.indent, function() {
-        return state.localMode.token(stream, state.localState);
+        var localState = last(state.localStates);
+        return localState.mode.token(stream, localState.state);
       });
       stream.string = oldString;
       return result;
@@ -80,11 +88,14 @@
           kindTag: [],
           soyState: [],
           templates: null,
-          variables: null,
+          variables: prepend(null, 'ij'),
           scopes: null,
           indent: 0,
-          localMode: modes.html,
-          localState: CodeMirror.startState(modes.html)
+          quoteKind: null,
+          localStates: [{
+            mode: modes.html,
+            state: CodeMirror.startState(modes.html)
+          }]
         };
       },
 
@@ -98,8 +109,13 @@
           variables: state.variables,
           scopes: state.scopes,
           indent: state.indent, // Indentation of the following line.
-          localMode: state.localMode,
-          localState: CodeMirror.copyState(state.localMode, state.localState)
+          quoteKind: state.quoteKind,
+          localStates: state.localStates.map(function(localState) {
+            return {
+              mode: localState.mode,
+              state: CodeMirror.copyState(localState.mode, localState.state)
+            };
+          })
         };
       },
 
@@ -113,8 +129,34 @@
             } else {
               stream.skipToEnd();
             }
+            if (!state.scopes) {
+              var paramRe = /@param\??\s+(\S+)/g;
+              var current = stream.current();
+              for (var match; (match = paramRe.exec(current)); ) {
+                state.variables = prepend(state.variables, match[1]);
+              }
+            }
             return "comment";
 
+          case "string":
+            var match = stream.match(/^.*?(["']|\\[\s\S])/);
+            if (!match) {
+              stream.skipToEnd();
+            } else if (match[1] == state.quoteKind) {
+              state.quoteKind = null;
+              state.soyState.pop();
+            }
+            return "string";
+        }
+
+        if (stream.match(/^\/\*/)) {
+          state.soyState.push("comment");
+          return "comment";
+        } else if (stream.match(stream.sol() || (state.soyState.length && last(state.soyState) != "literal") ? /^\s*\/\/.*/ : /^\s+\/\/.*/)) {
+          return "comment";
+        }
+
+        switch (last(state.soyState)) {
           case "templ-def":
             if (match = stream.match(/^\.?([\w]+(?!\.[\w]+)*)/)) {
               state.templates = prepend(state.templates, match[1]);
@@ -139,8 +181,8 @@
             return null;
 
           case "param-def":
-            if (match = stream.match(/^([\w]+)(?=:)/)) {
-              state.variables = prepend(state.variables, match[1]);
+            if (match = stream.match(/^\w+/)) {
+              state.variables = prepend(state.variables, match[0]);
               state.soyState.pop();
               state.soyState.push("param-type");
               return "def";
@@ -172,6 +214,7 @@
             if (stream.match(/^\/?}/)) {
               if (state.tag == "/template" || state.tag == "/deltemplate") {
                 popscope(state);
+                state.variables = prepend(null, 'ij');
                 state.indent = 0;
               } else {
                 if (state.tag == "/for" || state.tag == "/foreach") {
@@ -187,12 +230,20 @@
                 var kind = match[1];
                 state.kind.push(kind);
                 state.kindTag.push(state.tag);
-                state.localMode = modes[kind] || modes.html;
-                state.localState = CodeMirror.startState(state.localMode);
+                var mode = modes[kind] || modes.html;
+                var localState = last(state.localStates);
+                if (localState.mode.indent) {
+                  state.indent += localState.mode.indent(localState.state, "");
+                }
+                state.localStates.push({
+                  mode: mode,
+                  state: CodeMirror.startState(mode)
+                });
               }
               return "attribute";
-            } else if (stream.match(/^"/)) {
+            } else if (match = stream.match(/^["']/)) {
               state.soyState.push("string");
+              state.quoteKind = match;
               return "string";
             }
             if (match = stream.match(/^\$([\w]+)/)) {
@@ -211,55 +262,53 @@
               return this.token(stream, state);
             }
             return tokenUntil(stream, state, /\{\/literal}/);
-
-          case "string":
-            var match = stream.match(/^.*?("|\\[\s\S])/);
-            if (!match) {
-              stream.skipToEnd();
-            } else if (match[1] == "\"") {
-              state.soyState.pop();
-            }
-            return "string";
         }
 
-        if (stream.match(/^\/\*/)) {
-          state.soyState.push("comment");
-          return "comment";
-        } else if (stream.match(stream.sol() ? /^\s*\/\/.*/ : /^\s+\/\/.*/)) {
-          return "comment";
-        } else if (stream.match(/^\{literal}/)) {
+        if (stream.match(/^\{literal}/)) {
           state.indent += config.indentUnit;
           state.soyState.push("literal");
           return "keyword";
-        } else if (match = stream.match(/^\{([\/@\\]?[\w?]*)/)) {
+
+        // A tag-keyword must be followed by whitespace, comment or a closing tag.
+        } else if (match = stream.match(/^\{([\/@\\]?\w+\??)(?=[\s\}]|\/[/*])/)) {
           if (match[1] != "/switch")
-            state.indent += (/^(\/|(else|elseif|ifempty|case|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit;
+            state.indent += (/^(\/|(else|elseif|ifempty|case|fallbackmsg|default)$)/.test(match[1]) && state.tag != "switch" ? 1 : 2) * config.indentUnit;
           state.tag = match[1];
           if (state.tag == "/" + last(state.kindTag)) {
             // We found the tag that opened the current kind="".
             state.kind.pop();
             state.kindTag.pop();
-            state.localMode = modes[last(state.kind)] || modes.html;
-            state.localState = CodeMirror.startState(state.localMode);
+            state.localStates.pop();
+            var localState = last(state.localStates);
+            if (localState.mode.indent) {
+              state.indent -= localState.mode.indent(localState.state, "");
+            }
           }
           state.soyState.push("tag");
           if (state.tag == "template" || state.tag == "deltemplate") {
             state.soyState.push("templ-def");
-          }
-          if (state.tag == "call" || state.tag == "delcall") {
+          } else if (state.tag == "call" || state.tag == "delcall") {
             state.soyState.push("templ-ref");
-          }
-          if (state.tag == "let") {
+          } else if (state.tag == "let") {
             state.soyState.push("var-def");
-          }
-          if (state.tag == "for" || state.tag == "foreach") {
+          } else if (state.tag == "for" || state.tag == "foreach") {
             state.scopes = prepend(state.scopes, state.variables);
             state.soyState.push("var-def");
-          }
-          if (state.tag.match(/^@param\??/)) {
+          } else if (state.tag == "namespace") {
+            if (!state.scopes) {
+              state.variables = prepend(null, 'ij');
+            }
+          } else if (state.tag.match(/^@(?:param\??|inject)/)) {
             state.soyState.push("param-def");
           }
           return "keyword";
+
+        // Not a tag-keyword; it's an implicit print tag.
+        } else if (stream.eat('{')) {
+          state.tag = "print";
+          state.indent += 2 * config.indentUnit;
+          state.soyState.push("tag");
+          return "keyword";
         }
 
         return tokenUntil(stream, state, /\{|\s+\/\/|\/\*/);
@@ -277,14 +326,16 @@
           if (state.tag != "switch" && /^\{(case|default)\b/.test(textAfter)) indent -= config.indentUnit;
           if (/^\{\/switch\b/.test(textAfter)) indent -= config.indentUnit;
         }
-        if (indent && state.localMode.indent)
-          indent += state.localMode.indent(state.localState, textAfter);
+        var localState = last(state.localStates);
+        if (indent && localState.mode.indent) {
+          indent += localState.mode.indent(localState.state, textAfter);
+        }
         return indent;
       },
 
       innerMode: function(state) {
         if (state.soyState.length && last(state.soyState) != "literal") return null;
-        else return {state: state.localState, mode: state.localMode};
+        else return last(state.localStates);
       },
 
       electricInput: /^\s*\{(\/|\/template|\/deltemplate|\/switch|fallbackmsg|elseif|else|case|default|ifempty|\/literal\})$/,
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/test.js.js
index 9e265c1b0ce3e579102a2c418f2e96024e2b35b7..7cd111f2f33532e2b014f48765432a03e7f91bfa 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/soy/test.js.js
@@ -80,4 +80,35 @@
      '  nothing',
      '[keyword {/foreach}]',
      '');
+
+  MT('nested-kind-test',
+     '[keyword {template] [def .foo] [attribute kind]=[string "html"][keyword }]',
+     '  [tag&bracket <][tag div][tag&bracket >]',
+     '    [keyword {call] [variable .bar][keyword }]',
+     '      [keyword {param] [attribute kind]=[string "js"][keyword }]',
+     '        [keyword var] [def bar] [operator =] [number 5];',
+     '      [keyword {/param}]',
+     '    [keyword {/call}]',
+     '  [tag&bracket </][tag div][tag&bracket >]',
+     '[keyword {/template}]',
+     '');
+
+  MT('tag-starting-with-function-call-is-not-a-keyword',
+     '[keyword {]index([variable-2&error $foo])[keyword }]',
+     '[keyword {css] [string "some-class"][keyword }]',
+     '[keyword {]css([string "some-class"])[keyword }]',
+     '');
+
+  MT('allow-missing-colon-in-@param',
+     '[keyword {template] [def .foo][keyword }]',
+     '  [keyword {@param] [def showThing] [variable-3 bool][keyword }]',
+     '  [keyword {if] [variable-2 $showThing][keyword }]',
+     '    Yo!',
+     '  [keyword {/if}]',
+     '[keyword {/template}]',
+     '');
+
+  MT('single-quote-strings',
+     '[keyword {][string "foo"] [string \'bar\'][keyword }]',
+     '');
 })();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sparql/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sparql/index.html.html
deleted file mode 100644
index 84ef4d36392c8eb937104b206e61e34768df6aef..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sparql/index.html.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: SPARQL mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="sparql.js"></script>
-<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">SPARQL</a>
-  </ul>
-</div>
-
-<article>
-<h2>SPARQL mode</h2>
-<form><textarea id="code" name="code">
-PREFIX a: &lt;http://www.w3.org/2000/10/annotation-ns#>
-PREFIX dc: &lt;http://purl.org/dc/elements/1.1/>
-PREFIX foaf: &lt;http://xmlns.com/foaf/0.1/>
-PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#>
-
-# Comment!
-
-SELECT ?given ?family
-WHERE {
-  {
-    ?annot a:annotates &lt;http://www.w3.org/TR/rdf-sparql-query/> .
-    ?annot dc:creator ?c .
-    OPTIONAL {?c foaf:givenName ?given ;
-                 foaf:familyName ?family }
-  } UNION {
-    ?c !foaf:knows/foaf:knows? ?thing.
-    ?thing rdfs
-  } MINUS {
-    ?thing rdfs:label "鍓涙煍娴�"@jp
-  }
-  FILTER isBlank(?c)
-}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "application/sparql-query",
-        matchBrackets: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>application/sparql-query</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sparql/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sparql/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sparql/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/spreadsheet/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/spreadsheet/index.html.html
deleted file mode 100644
index a52f76f050c1a825f3df461be8d54a56cc4f04cd..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/spreadsheet/index.html.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Spreadsheet mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="spreadsheet.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Spreadsheet</a>
-  </ul>
-</div>
-
-<article>
-  <h2>Spreadsheet mode</h2>
-  <form><textarea id="code" name="code">=IF(A1:B2, TRUE, FALSE) / 100</textarea></form>
-
-  <script>
-    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-      lineNumbers: true,
-      matchBrackets: true,
-      extraKeys: {"Tab":  "indentAuto"}
-    });
-  </script>
-
-  <p><strong>MIME types defined:</strong> <code>text/x-spreadsheet</code>.</p>
-  
-  <h3>The Spreadsheet Mode</h3>
-  <p> Created by <a href="https://github.com/robertleeplummerjr">Robert Plummer</a></p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/spreadsheet/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/spreadsheet/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/spreadsheet/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/index.html.html
deleted file mode 100644
index dba069dc8183a769da041e22fae8781c106f7150..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/index.html.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: SQL Mode for CodeMirror</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css" />
-<script src="../../lib/codemirror.js"></script>
-<script src="sql.js"></script>
-<link rel="stylesheet" href="../../addon/hint/show-hint.css" />
-<script src="../../addon/hint/show-hint.js"></script>
-<script src="../../addon/hint/sql-hint.js"></script>
-<style>
-.CodeMirror {
-    border-top: 1px solid black;
-    border-bottom: 1px solid black;
-}
-        </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">SQL Mode for CodeMirror</a>
-  </ul>
-</div>
-
-<article>
-<h2>SQL Mode for CodeMirror</h2>
-<form>
-            <textarea id="code" name="code">-- SQL Mode for CodeMirror
-SELECT SQL_NO_CACHE DISTINCT
-		@var1 AS `val1`, @'val2', @global.'sql_mode',
-		1.1 AS `float_val`, .14 AS `another_float`, 0.09e3 AS `int_with_esp`,
-		0xFA5 AS `hex`, x'fa5' AS `hex2`, 0b101 AS `bin`, b'101' AS `bin2`,
-		DATE '1994-01-01' AS `sql_date`, { T "1994-01-01" } AS `odbc_date`,
-		'my string', _utf8'your string', N'her string',
-        TRUE, FALSE, UNKNOWN
-	FROM DUAL
-	-- space needed after '--'
-	# 1 line comment
-	/* multiline
-	comment! */
-	LIMIT 1 OFFSET 0;
-</textarea>
-            </form>
-            <p><strong>MIME types defined:</strong> 
-            <code><a href="?mime=text/x-sql">text/x-sql</a></code>,
-            <code><a href="?mime=text/x-mysql">text/x-mysql</a></code>,
-            <code><a href="?mime=text/x-mariadb">text/x-mariadb</a></code>,
-            <code><a href="?mime=text/x-cassandra">text/x-cassandra</a></code>,
-            <code><a href="?mime=text/x-plsql">text/x-plsql</a></code>,
-            <code><a href="?mime=text/x-mssql">text/x-mssql</a></code>,
-            <code><a href="?mime=text/x-hive">text/x-hive</a></code>,
-            <code><a href="?mime=text/x-pgsql">text/x-pgsql</a></code>,
-            <code><a href="?mime=text/x-gql">text/x-gql</a></code>.
-        </p>
-<script>
-window.onload = function() {
-  var mime = 'text/x-mariadb';
-  // get mime type
-  if (window.location.href.indexOf('mime=') > -1) {
-    mime = window.location.href.substr(window.location.href.indexOf('mime=') + 5);
-  }
-  window.editor = CodeMirror.fromTextArea(document.getElementById('code'), {
-    mode: mime,
-    indentWithTabs: true,
-    smartIndent: true,
-    lineNumbers: true,
-    matchBrackets : true,
-    autofocus: true,
-    extraKeys: {"Ctrl-Space": "autocomplete"},
-    hintOptions: {tables: {
-      users: {name: null, score: null, birthDate: null},
-      countries: {name: null, population: null, size: null}
-    }}
-  });
-};
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/sql.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/sql.js.js
index 32ced3e9deddfa6b9dfe7b2b0b842f6a0350332f..2010b1c2505cca79f66fe1f53a5691a9ce28c369 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/sql.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/sql/sql.js.js
@@ -21,7 +21,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
       operatorChars  = parserConfig.operatorChars || /^[*+\-%<>!=&|~^]/,
       support        = parserConfig.support || {},
       hooks          = parserConfig.hooks || {},
-      dateSQL        = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true};
+      dateSQL        = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true},
+      backslashStringEscapes = parserConfig.backslashStringEscapes !== false
 
   function tokenBase(stream, state) {
     var ch = stream.next();
@@ -47,8 +48,8 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
     } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) {
       // numbers
       // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html
-          stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/);
-      support.decimallessFloat && stream.eat('.');
+      stream.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/);
+      support.decimallessFloat && stream.match(/^\.(?!\.)/);
       return "number";
     } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) {
       // placeholders
@@ -80,18 +81,18 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
     } else if (ch == "/" && stream.eat("*")) {
       // multi-line comments
       // ref: https://kb.askmonty.org/en/comment-syntax/
-      state.tokenize = tokenComment;
+      state.tokenize = tokenComment(1);
       return state.tokenize(stream, state);
     } else if (ch == ".") {
       // .1 for 0.1
-      if (support.zerolessFloat && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) {
+      if (support.zerolessFloat && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i))
         return "number";
-      }
+      if (stream.match(/^\.+/))
+        return null
       // .table_name (ODBC)
       // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html
-      if (support.ODBCdotTable && stream.match(/^[a-zA-Z_]+/)) {
+      if (support.ODBCdotTable && stream.match(/^[\w\d_]+/))
         return "variable-2";
-      }
     } else if (operatorChars.test(ch)) {
       // operators
       stream.eatWhile(operatorChars);
@@ -125,25 +126,20 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
           state.tokenize = tokenBase;
           break;
         }
-        escaped = !escaped && ch == "\\";
+        escaped = backslashStringEscapes && !escaped && ch == "\\";
       }
       return "string";
     };
   }
-  function tokenComment(stream, state) {
-    while (true) {
-      if (stream.skipTo("*")) {
-        stream.next();
-        if (stream.eat("/")) {
-          state.tokenize = tokenBase;
-          break;
-        }
-      } else {
-        stream.skipToEnd();
-        break;
-      }
+  function tokenComment(depth) {
+    return function(stream, state) {
+      var m = stream.match(/^.*?(\/\*|\*\/)/)
+      if (!m) stream.skipToEnd()
+      else if (m[1] == "/*") state.tokenize = tokenComment(depth + 1)
+      else if (depth > 1) state.tokenize = tokenComment(depth - 1)
+      else state.tokenize = tokenBase
+      return "comment"
     }
-    return "comment";
   }
 
   function pushContext(stream, state, type) {
@@ -170,7 +166,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
         if (state.context && state.context.align == null)
           state.context.align = false;
       }
-      if (stream.eatSpace()) return null;
+      if (state.tokenize == tokenBase && stream.eatSpace()) return null;
 
       var style = state.tokenize(stream, state);
       if (style == "comment") return style;
@@ -198,7 +194,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
 
     blockCommentStart: "/*",
     blockCommentEnd: "*/",
-    lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : null
+    lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : "--"
   };
 });
 
@@ -217,6 +213,19 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
     return stream.eatWhile(/\w/) ? "variable-2" : null;
   }
 
+  // "identifier"
+  function hookIdentifierDoublequote(stream) {
+    // Standard SQL /SQLite identifiers
+    // ref: http://web.archive.org/web/20160813185132/http://savage.net.au/SQL/sql-99.bnf.html#delimited%20identifier
+    // ref: http://sqlite.org/lang_keywords.html
+    var ch;
+    while ((ch = stream.next()) != null) {
+      if (ch == "\"" && !stream.eat("\"")) return "variable-2";
+    }
+    stream.backUp(stream.current().length - 1);
+    return stream.eatWhile(/\w/) ? "variable-2" : null;
+  }
+
   // variable token
   function hookVar(stream) {
     // variables
@@ -284,6 +293,7 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
     builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),
     atoms: set("false true null unknown"),
     operatorChars: /^[*+\-%<>!=]/,
+    backslashStringEscapes: false,
     dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"),
     hooks: {
       "@":   hookVar
@@ -322,6 +332,36 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
     }
   });
 
+  // provided by the phpLiteAdmin project - phpliteadmin.org
+  CodeMirror.defineMIME("text/x-sqlite", {
+    name: "sql",
+    // commands of the official SQLite client, ref: https://www.sqlite.org/cli.html#dotcmd
+    client: set("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"),
+    // ref: http://sqlite.org/lang_keywords.html
+    keywords: set(sqlKeywords + "abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"),
+    // SQLite is weakly typed, ref: http://sqlite.org/datatype3.html. This is just a list of some common types.
+    builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"),
+    // ref: http://sqlite.org/syntax/literal-value.html
+    atoms: set("null current_date current_time current_timestamp"),
+    // ref: http://sqlite.org/lang_expr.html#binaryops
+    operatorChars: /^[*+\-%<>!=&|/~]/,
+    // SQLite is weakly typed, ref: http://sqlite.org/datatype3.html. This is just a list of some common types.
+    dateSQL: set("date time timestamp datetime"),
+    support: set("decimallessFloat zerolessFloat"),
+    identifierQuote: "\"",  //ref: http://sqlite.org/lang_keywords.html
+    hooks: {
+      // bind-parameters ref:http://sqlite.org/lang_expr.html#varparam
+      "@":   hookVar,
+      ":":   hookVar,
+      "?":   hookVar,
+      "$":   hookVar,
+      // The preferred way to escape Identifiers is using double quotes, ref: http://sqlite.org/lang_keywords.html
+      "\"":   hookIdentifierDoublequote,
+      // there is also support for backtics, ref: http://sqlite.org/lang_keywords.html
+      "`":   hookIdentifier
+    }
+  });
+
   // the query language used by Apache Cassandra is called CQL, but this mime type
   // is called Cassandra to avoid confusion with Contextual Query Language
   CodeMirror.defineMIME("text/x-cassandra", {
@@ -361,10 +401,10 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
   CodeMirror.defineMIME("text/x-pgsql", {
     name: "sql",
     client: set("source"),
-    // http://www.postgresql.org/docs/9.5/static/sql-keywords-appendix.html
-    keywords: set(sqlKeywords + "a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat"),
-    // http://www.postgresql.org/docs/9.5/static/datatype.html
-    builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),
+    // https://www.postgresql.org/docs/10/static/sql-keywords-appendix.html
+    keywords: set(sqlKeywords + "a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lc_collate lc_ctype lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict restricted result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat attach path depends detach zone"),
+    // https://www.postgresql.org/docs/10/static/datatype.html
+    builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),
     atoms: set("false true null unknown"),
     operatorChars: /^[*+\-%<>!=&|^\/#@?~]/,
     dateSQL: set("date time timestamp"),
@@ -379,6 +419,43 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
     builtin: set("blob datetime first key __key__ string integer double boolean null"),
     operatorChars: /^[*+\-%<>!=]/
   });
+
+  // Greenplum
+  CodeMirror.defineMIME("text/x-gpsql", {
+    name: "sql",
+    client: set("source"),
+    //https://github.com/greenplum-db/gpdb/blob/master/src/include/parser/kwlist.h
+    keywords: set("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),
+    builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),
+    atoms: set("false true null unknown"),
+    operatorChars: /^[*+\-%<>!=&|^\/#@?~]/,
+    dateSQL: set("date time timestamp"),
+    support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")
+  });
+
+  // Spark SQL
+  CodeMirror.defineMIME("text/x-sparksql", {
+    name: "sql",
+    keywords: set("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"),
+    builtin: set("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"),
+    atoms: set("false true null"),
+    operatorChars: /^[*+\-%<>!=~&|^]/,
+    dateSQL: set("date time timestamp"),
+    support: set("ODBCdotTable doubleQuote zerolessFloat")
+  });
+
+  // Esper
+  CodeMirror.defineMIME("text/x-esper", {
+    name: "sql",
+    client: set("source"),
+    // http://www.espertech.com/esper/release-5.5.0/esper-reference/html/appendix_keywords.html
+    keywords: set("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"),
+    builtin: {},
+    atoms: set("false true null"),
+    operatorChars: /^[*+\-%<>!=&|^\/#@?~]/,
+    dateSQL: set("time"),
+    support: set("decimallessFloat zerolessFloat binaryNumber hexNumber")
+  });
 }());
 
 });
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/index.html.html
deleted file mode 100644
index 14679da4f337f72c6839bdb1b940fd2d16413f72..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/index.html.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: sTeX mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="stex.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">sTeX</a>
-  </ul>
-</div>
-
-<article>
-<h2>sTeX mode</h2>
-<form><textarea id="code" name="code">
-\begin{module}[id=bbt-size]
-\importmodule[balanced-binary-trees]{balanced-binary-trees}
-\importmodule[\KWARCslides{dmath/en/cardinality}]{cardinality}
-
-\begin{frame}
-  \frametitle{Size Lemma for Balanced Trees}
-  \begin{itemize}
-  \item
-    \begin{assertion}[id=size-lemma,type=lemma] 
-    Let $G=\tup{V,E}$ be a \termref[cd=binary-trees]{balanced binary tree} 
-    of \termref[cd=graph-depth,name=vertex-depth]{depth}$n>i$, then the set
-     $\defeq{\livar{V}i}{\setst{\inset{v}{V}}{\gdepth{v} = i}}$ of
-    \termref[cd=graphs-intro,name=node]{nodes} at 
-    \termref[cd=graph-depth,name=vertex-depth]{depth} $i$ has
-    \termref[cd=cardinality,name=cardinality]{cardinality} $\power2i$.
-   \end{assertion}
-  \item
-    \begin{sproof}[id=size-lemma-pf,proofend=,for=size-lemma]{via induction over the depth $i$.}
-      \begin{spfcases}{We have to consider two cases}
-        \begin{spfcase}{$i=0$}
-          \begin{spfstep}[display=flow]
-            then $\livar{V}i=\set{\livar{v}r}$, where $\livar{v}r$ is the root, so
-            $\eq{\card{\livar{V}0},\card{\set{\livar{v}r}},1,\power20}$.
-          \end{spfstep}
-        \end{spfcase}
-        \begin{spfcase}{$i>0$}
-          \begin{spfstep}[display=flow]
-           then $\livar{V}{i-1}$ contains $\power2{i-1}$ vertexes 
-           \begin{justification}[method=byIH](IH)\end{justification}
-          \end{spfstep}
-          \begin{spfstep}
-           By the \begin{justification}[method=byDef]definition of a binary
-              tree\end{justification}, each $\inset{v}{\livar{V}{i-1}}$ is a leaf or has
-            two children that are at depth $i$.
-          \end{spfstep}
-          \begin{spfstep}
-           As $G$ is \termref[cd=balanced-binary-trees,name=balanced-binary-tree]{balanced} and $\gdepth{G}=n>i$, $\livar{V}{i-1}$ cannot contain
-            leaves.
-          \end{spfstep}
-          \begin{spfstep}[type=conclusion]
-           Thus $\eq{\card{\livar{V}i},{\atimes[cdot]{2,\card{\livar{V}{i-1}}}},{\atimes[cdot]{2,\power2{i-1}}},\power2i}$.
-          \end{spfstep}
-        \end{spfcase}
-      \end{spfcases}
-    \end{sproof}
-  \item 
-    \begin{assertion}[id=fbbt,type=corollary]	
-      A fully balanced tree of depth $d$ has $\power2{d+1}-1$ nodes.
-    \end{assertion}
-  \item
-      \begin{sproof}[for=fbbt,id=fbbt-pf]{}
-        \begin{spfstep}
-          Let $\defeq{G}{\tup{V,E}}$ be a fully balanced tree
-        \end{spfstep}
-        \begin{spfstep}
-          Then $\card{V}=\Sumfromto{i}1d{\power2i}= \power2{d+1}-1$.
-        \end{spfstep}
-      \end{sproof}
-    \end{itemize}
-  \end{frame}
-\begin{note}
-  \begin{omtext}[type=conclusion,for=binary-tree]
-    This shows that balanced binary trees grow in breadth very quickly, a consequence of
-    this is that they are very shallow (and this compute very fast), which is the essence of
-    the next result.
-  \end{omtext}
-\end{note}
-\end{module}
-
-%%% Local Variables: 
-%%% mode: LaTeX
-%%% TeX-master: "all"
-%%% End: \end{document}
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-stex</code>.</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#stex_*">normal</a>,  <a href="../../test/index.html#verbose,stex_*">verbose</a>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/stex.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/stex.js.js
index 835ed46d1ec4c46f6a5d301327ef5c5a0b678c37..12e5750b19ad7d833b829cbc83a5396ed7c3b63a 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/stex.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/stex.js.js
@@ -78,6 +78,14 @@
     plugins["begin"] = addPluginPattern("begin", "tag", ["atom"]);
     plugins["end"] = addPluginPattern("end", "tag", ["atom"]);
 
+    plugins["label"    ] = addPluginPattern("label"    , "tag", ["atom"]);
+    plugins["ref"      ] = addPluginPattern("ref"      , "tag", ["atom"]);
+    plugins["eqref"    ] = addPluginPattern("eqref"    , "tag", ["atom"]);
+    plugins["cite"     ] = addPluginPattern("cite"     , "tag", ["atom"]);
+    plugins["bibitem"  ] = addPluginPattern("bibitem"  , "tag", ["atom"]);
+    plugins["Bibitem"  ] = addPluginPattern("Bibitem"  , "tag", ["atom"]);
+    plugins["RBibitem" ] = addPluginPattern("RBibitem" , "tag", ["atom"]);
+
     plugins["DEFAULT"] = function () {
       this.name = "DEFAULT";
       this.style = "tag";
@@ -117,6 +125,10 @@
         setState(state, function(source, state){ return inMathMode(source, state, "\\]"); });
         return "keyword";
       }
+      if (source.match("\\(")) {
+        setState(state, function(source, state){ return inMathMode(source, state, "\\)"); });
+        return "keyword";
+      }
       if (source.match("$$")) {
         setState(state, function(source, state){ return inMathMode(source, state, "$$"); });
         return "keyword";
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/test.js.js
index 22f027ec7b6b7259c9a6aa1866b41b17b8cdaffd..634dc49d9e5f3a56fa7f3869c6a510ba195446cb 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stex/test.js.js
@@ -111,9 +111,18 @@
   MT("inlineMath",
      "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text");
 
+  MT("inlineMathLatexStyle",
+     "[keyword \\(][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword \\)] other text");
+
   MT("displayMath",
      "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text");
 
+  MT("displayMath environment",
+     "[tag \\begin][bracket {][atom equation][bracket }] x [tag \\end][bracket {][atom equation][bracket }] other text");
+
+  MT("displayMath environment with label",
+     "[tag \\begin][bracket {][atom equation][bracket }][tag \\label][bracket {][atom eq1][bracket }] x [tag \\end][bracket {][atom equation][bracket }] other text~[tag \\ref][bracket {][atom eq1][bracket }]");
+
   MT("mathWithComment",
      "[keyword $][variable-2 x] [comment % $]",
      "[variable-2 y][keyword $] other text");
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/index.html.html
deleted file mode 100644
index 862c18f250137dcf458f682b8f3c190680a17a40..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/index.html.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Stylus mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../addon/hint/show-hint.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="stylus.js"></script>
-<script src="../../addon/hint/show-hint.js"></script>
-<script src="../../addon/hint/css-hint.js"></script>
-<style>.CodeMirror {background: #f8f8f8;} form{margin-bottom: .7em;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Stylus</a>
-  </ul>
-</div>
-
-<article>
-<h2>Stylus mode</h2>
-<form><textarea id="code" name="code">
-/* Stylus mode */
-
-#id,
-.class,
-article
-  font-family Arial, sans-serif
-
-#id,
-.class,
-article {
-  font-family: Arial, sans-serif;
-}
-
-// Variables
-font-size-base = 16px
-line-height-base = 1.5
-font-family-base = "Helvetica Neue", Helvetica, Arial, sans-serif
-text-color = lighten(#000, 20%)
-
-body
-  font font-size-base/line-height-base font-family-base
-  color text-color
-
-body {
-  font: 400 16px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
-  color: #333;
-}
-
-// Variables
-link-color = darken(#428bca, 6.5%)
-link-hover-color = darken(link-color, 15%)
-link-decoration = none
-link-hover-decoration = false
-
-// Mixin
-tab-focus()
-  outline thin dotted
-  outline 5px auto -webkit-focus-ring-color
-  outline-offset -2px
-
-a
-  color link-color
-  if link-decoration
-    text-decoration link-decoration
-  &:hover
-  &:focus
-    color link-hover-color
-    if link-hover-decoration
-      text-decoration link-hover-decoration
-  &:focus
-    tab-focus()
-
-a {
-  color: #3782c4;
-  text-decoration: none;
-}
-a:hover,
-a:focus {
-  color: #2f6ea7;
-}
-a:focus {
-  outline: thin dotted;
-  outline: 5px auto -webkit-focus-ring-color;
-  outline-offset: -2px;
-}
-</textarea>
-</form>
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    extraKeys: {"Ctrl-Space": "autocomplete"},
-    tabSize: 2
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>text/x-styl</code>.</p>
-<p>Created by <a href="https://github.com/dmitrykiselyov">Dmitry Kiselyov</a></p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/stylus.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/stylus.js.js
index 8d83a0180702cfbf460cd6a166a54b5fca4aed3b..a9f50c05d1f1e63d60dff3aaa3196625f82a7ba0 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/stylus.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/stylus/stylus.js.js
@@ -15,6 +15,7 @@
 
   CodeMirror.defineMode("stylus", function(config) {
     var indentUnit = config.indentUnit,
+        indentUnitString = '',
         tagKeywords = keySet(tagKeywords_),
         tagVariablesRegexp = /^(a|b|i|s|col|em)$/i,
         propertyKeywords = keySet(propertyKeywords_),
@@ -38,6 +39,8 @@
         type,
         override;
 
+    while (indentUnitString.length < indentUnit) indentUnitString += ' ';
+
     /**
      * Tokenizers
      */
@@ -73,7 +76,7 @@
       if (ch == "#") {
         stream.next();
         // Hex color
-        if (stream.match(/^[0-9a-f]{6}|[0-9a-f]{3}/i)) {
+        if (stream.match(/^[0-9a-f]{3}([0-9a-f]([0-9a-f]{2}){0,2})?\b/i)) {
           return ["atom", "atom"];
         }
         // ID selector
@@ -313,7 +316,7 @@
           return pushContext(state, stream, "block", 0);
         }
       }
-      if (typeIsBlock(type, stream, state)) {
+      if (typeIsBlock(type, stream)) {
         return pushContext(state, stream, "block");
       }
       if (type == "}" && endOfLine(stream)) {
@@ -513,7 +516,7 @@
      */
     states.atBlock = function(type, stream, state) {
       if (type == "(") return pushContext(state, stream, "atBlock_parens");
-      if (typeIsBlock(type, stream, state)) {
+      if (typeIsBlock(type, stream)) {
         return pushContext(state, stream, "block");
       }
       if (typeIsInterpolation(type, stream)) {
@@ -672,7 +675,7 @@
             ch = textAfter && textAfter.charAt(0),
             indent = cx.indent,
             lineFirstWord = firstWordOfLine(textAfter),
-            lineIndent = line.length - line.replace(/^\s*/, "").length,
+            lineIndent = line.match(/^\s*/)[0].replace(/\t/g, indentUnitString).length,
             prevLineFirstWord = state.context.prev ? state.context.prev.line.firstWord : "",
             prevLineIndent = state.context.prev ? state.context.prev.line.indent : lineIndent;
 
@@ -681,7 +684,6 @@
              ch == ")" && (cx.type == "parens" || cx.type == "atBlock_parens") ||
              ch == "{" && (cx.type == "at"))) {
           indent = cx.indent - indentUnit;
-          cx = cx.prev;
         } else if (!(/(\})/.test(ch))) {
           if (/@|\$|\d/.test(ch) ||
               /^\{/.test(textAfter) ||
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/index.html.html
deleted file mode 100644
index 109f3fdb07554a177a7b8c268a3b43e3b5e1a127..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/index.html.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Swift mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="./swift.js"></script>
-<style>
-	.CodeMirror { border: 2px inset #dee; }
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Swift</a>
-  </ul>
-</div>
-
-<article>
-<h2>Swift mode</h2>
-<form><textarea id="code" name="code">
-//
-//  TipCalculatorModel.swift
-//  TipCalculator
-//
-//  Created by Main Account on 12/18/14.
-//  Copyright (c) 2014 Razeware LLC. All rights reserved.
-//
-
-import Foundation
-
-class TipCalculatorModel {
-
-  var total: Double
-  var taxPct: Double
-  var subtotal: Double {
-    get {
-      return total / (taxPct + 1)
-    }
-  }
-
-  init(total: Double, taxPct: Double) {
-    self.total = total
-    self.taxPct = taxPct
-  }
-
-  func calcTipWithTipPct(tipPct: Double) -> Double {
-    return subtotal * tipPct
-  }
-
-  func returnPossibleTips() -> [Int: Double] {
-
-    let possibleTipsInferred = [0.15, 0.18, 0.20]
-    let possibleTipsExplicit:[Double] = [0.15, 0.18, 0.20]
-
-    var retval = [Int: Double]()
-    for possibleTip in possibleTipsInferred {
-      let intPct = Int(possibleTip*100)
-      retval[intPct] = calcTipWithTipPct(possibleTip)
-    }
-    return retval
-
-  }
-
-}
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-swift"
-      });
-    </script>
-
-    <p>A simple mode for Swift</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-swift</code> (Swift code)</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/swift.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/swift.js.js
index 43ab7c8fb4ef47b54eba6c81b9b78056538af25b..1795d86e94f79388f37fab989f9c8860ad605db4 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/swift.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/swift.js.js
@@ -138,8 +138,17 @@
   }
 
   function tokenComment(stream, state) {
-    stream.match(/^(?:[^*]|\*(?!\/))*/)
-    if (stream.match("*/")) state.tokenize.pop()
+    var ch
+    while (true) {
+      stream.match(/^[^/*]+/, true)
+      ch = stream.next()
+      if (!ch) break
+      if (ch === "/" && stream.eat("*")) {
+        state.tokenize.push(tokenComment)
+      } else if (ch === "*" && stream.eat("/")) {
+        state.tokenize.pop()
+      }
+    }
     return "comment"
   }
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/test.js.js
index 786b89e299bf2a543c0834a7bb92de81639aae93..4091ac6f4c07abd5c1d91c3eeb658e69d3c25ba9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/swift/test.js.js
@@ -142,6 +142,13 @@
      "[variable print][punctuation (][variable foo][property ._123][punctuation )]",
      "[variable print][punctuation (]")
 
+  MT("nested_comments",
+     "[comment /*]",
+     "[comment But wait /* this is a nested comment */ for real]",
+     "[comment /**** let * me * show * you ****/]",
+     "[comment ///// let / me / show / you /////]",
+     "[comment */]");
+
   // TODO: correctly identify when multiple variables are being declared
   // by use of a comma-separated list.
   // TODO: correctly identify when variables are being declared in a tuple.
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tcl/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tcl/index.html.html
deleted file mode 100644
index ce4ad3423edf8e083c5f5a182c114c55696e2652..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tcl/index.html.html
+++ /dev/null
@@ -1,142 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Tcl mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/night.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="tcl.js"></script>
-<script src="../../addon/scroll/scrollpastend.js"></script>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Tcl</a>
-  </ul>
-</div>
-
-<article>
-<h2>Tcl mode</h2>
-<form><textarea id="code" name="code">
-##############################################################################################
-##  ##     whois.tcl for eggdrop by Ford_Lawnmower irc.geekshed.net #Script-Help        ##  ##
-##############################################################################################
-## To use this script you must set channel flag +whois (ie .chanset #chan +whois)           ##
-##############################################################################################
-##      ____                __                 ###########################################  ##
-##     / __/___ _ ___ _ ___/ /____ ___   ___   ###########################################  ##
-##    / _/ / _ `// _ `// _  // __// _ \ / _ \  ###########################################  ##
-##   /___/ \_, / \_, / \_,_//_/   \___// .__/  ###########################################  ##
-##        /___/ /___/                 /_/      ###########################################  ##
-##                                             ###########################################  ##
-##############################################################################################
-##  ##                             Start Setup.                                         ##  ##
-##############################################################################################
-namespace eval whois {
-## change cmdchar to the trigger you want to use                                        ##  ##
-  variable cmdchar "!"
-## change command to the word trigger you would like to use.                            ##  ##
-## Keep in mind, This will also change the .chanset +/-command                          ##  ##
-  variable command "whois"
-## change textf to the colors you want for the text.                                    ##  ##
-  variable textf "\017\00304"
-## change tagf to the colors you want for tags:                                         ##  ##
-  variable tagf "\017\002"
-## Change logo to the logo you want at the start of the line.                           ##  ##
-  variable logo "\017\00304\002\[\00306W\003hois\00304\]\017"
-## Change lineout to the results you want. Valid results are channel users modes topic  ##  ##
-  variable lineout "channel users modes topic"
-##############################################################################################
-##  ##                           End Setup.                                              ## ##
-##############################################################################################
-  variable channel ""
-  setudef flag $whois::command
-  bind pub -|- [string trimleft $whois::cmdchar]${whois::command} whois::list
-  bind raw -|- "311" whois::311
-  bind raw -|- "312" whois::312
-  bind raw -|- "319" whois::319
-  bind raw -|- "317" whois::317
-  bind raw -|- "313" whois::multi
-  bind raw -|- "310" whois::multi
-  bind raw -|- "335" whois::multi
-  bind raw -|- "301" whois::301
-  bind raw -|- "671" whois::multi
-  bind raw -|- "320" whois::multi
-  bind raw -|- "401" whois::multi
-  bind raw -|- "318" whois::318
-  bind raw -|- "307" whois::307
-}
-proc whois::311 {from key text} {
-  if {[regexp -- {^[^\s]+\s(.+?)\s(.+?)\s(.+?)\s\*\s\:(.+)$} $text wholematch nick ident host realname]} {
-    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Host:${whois::textf} \
-        $nick \(${ident}@${host}\) ${whois::tagf}Realname:${whois::textf} $realname"
-  }
-}
-proc whois::multi {from key text} {
-  if {[regexp {\:(.*)$} $text match $key]} {
-    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Note:${whois::textf} [subst $$key]"
-        return 1
-  }
-}
-proc whois::312 {from key text} {
-  regexp {([^\s]+)\s\:} $text match server
-  putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Server:${whois::textf} $server"
-}
-proc whois::319 {from key text} {
-  if {[regexp {.+\:(.+)$} $text match channels]} {
-    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Channels:${whois::textf} $channels"
-  }
-}
-proc whois::317 {from key text} {
-  if {[regexp -- {.*\s(\d+)\s(\d+)\s\:} $text wholematch idle signon]} {
-    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Connected:${whois::textf} \
-        [ctime $signon] ${whois::tagf}Idle:${whois::textf} [duration $idle]"
-  }
-}
-proc whois::301 {from key text} {
-  if {[regexp {^.+\s[^\s]+\s\:(.*)$} $text match awaymsg]} {
-    putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Away:${whois::textf} $awaymsg"
-  }
-}
-proc whois::318 {from key text} {
-  namespace eval whois {
-        variable channel ""
-  }
-  variable whois::channel ""
-}
-proc whois::307 {from key text} {
-  putserv "PRIVMSG $whois::channel :${whois::logo} ${whois::tagf}Services:${whois::textf} Registered Nick"
-}
-proc whois::list {nick host hand chan text} {
-  if {[lsearch -exact [channel info $chan] "+${whois::command}"] != -1} {
-    namespace eval whois {
-          variable channel ""
-        }
-    variable whois::channel $chan
-    putserv "WHOIS $text"
-  }
-}
-putlog "\002*Loaded* \017\00304\002\[\00306W\003hois\00304\]\017 \002by \
-Ford_Lawnmower irc.GeekShed.net #Script-Help"
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        theme: "night",
-        lineNumbers: true,
-        indentUnit: 2,
-        scrollPastEnd: true,
-        mode: "text/x-tcl"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-tcl</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tcl/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tcl/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tcl/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/index.html.html
deleted file mode 100644
index 42b156b1e205fb323e8d17eebe31014a96c41fe7..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/index.html.html
+++ /dev/null
@@ -1,191 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Textile mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="textile.js"></script>
-<style>.CodeMirror {background: #f8f8f8;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/marijnh/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class="active" href="#">Textile</a>
-  </ul>
-</div>
-
-<article>
-    <h2>Textile mode</h2>
-    <form><textarea id="code" name="code">
-h1. Textile Mode
-
-A paragraph without formatting.
-
-p. A simple Paragraph.
-
-
-h2. Phrase Modifiers
-
-Here are some simple phrase modifiers: *strong*, _emphasis_, **bold**, and __italic__.
-
-A ??citation??, -deleted text-, +inserted text+, some ^superscript^, and some ~subscript~.
-
-A %span element% and @code element@
-
-A "link":http://example.com, a "link with (alt text)":urlAlias
-
-[urlAlias]http://example.com/
-
-An image: !http://example.com/image.png! and an image with a link: !http://example.com/image.png!:http://example.com
-
-A sentence with a footnote.[123]
-
-fn123. The footnote is defined here.
-
-Registered(r), Trademark(tm), and Copyright(c)
-
-
-h2. Headers
-
-h1. Top level
-h2. Second level
-h3. Third level
-h4. Fourth level
-h5. Fifth level
-h6. Lowest level
-
-
-h2.  Lists
-
-* An unordered list
-** foo bar
-*** foo bar
-**** foo bar
-** foo bar
-
-# An ordered list
-## foo bar
-### foo bar
-#### foo bar
-## foo bar
-
-- definition list := description
-- another item    := foo bar
-- spanning ines   :=
-                     foo bar
-
-                     foo bar =:
-
-
-h2. Attributes
-
-Layouts and phrase modifiers can be modified with various kinds of attributes: alignment, CSS ID, CSS class names, language, padding, and CSS styles.
-
-h3. Alignment
-
-div<. left align
-div>. right align
-
-h3. CSS ID and class name
-
-You are a %(my-id#my-classname) rad% person.
-
-h3. Language
-
-p[en_CA]. Strange weather, eh?
-
-h3. Horizontal Padding
-
-p(())). 2em left padding, 3em right padding
-
-h3. CSS styling
-
-p{background: red}. Fire!
-
-
-h2. Table
-
-|_.              Header 1               |_.      Header 2        |
-|{background:#ddd}. Cell with background|         Normal         |
-|\2.         Cell spanning 2 columns                             |
-|/2.         Cell spanning 2 rows       |(cell-class). one       |
-|                                                two             |
-|>.                  Right aligned cell |<. Left aligned cell    |
-
-
-h3. A table with attributes:
-
-table(#prices).
-|Adults|$5|
-|Children|$2|
-
-
-h2. Code blocks
-
-bc.
-function factorial(n) {
-    if (n === 0) {
-        return 1;
-    }
-    return n * factorial(n - 1);
-}
-
-pre..
-                ,,,,,,
-            o#'9MMHb':'-,o,
-         .oH":HH$' "' ' -*R&o,
-        dMMM*""'`'      .oM"HM?.
-       ,MMM'          "HLbd< ?&H\
-      .:MH ."\          ` MM  MM&b
-     . "*H    -        &MMMMMMMMMH:
-     .    dboo        MMMMMMMMMMMM.
-     .   dMMMMMMb      *MMMMMMMMMP.
-     .    MMMMMMMP        *MMMMMP .
-          `#MMMMM           MM6P ,
-       '    `MMMP"           HM*`,
-        '    :MM             .- ,
-         '.   `#?..  .       ..'
-            -.   .         .-
-              ''-.oo,oo.-''
-
-\. _(9>
- \==_)
-  -'=
-
-h2. Temporarily disabling textile markup
-
-notextile. Don't __touch this!__
-
-Surround text with double-equals to disable textile inline. Example: Use ==*asterisks*== for *strong* text.
-
-
-h2. HTML
-
-Some block layouts are simply textile versions of HTML tags with the same name, like @div@, @pre@, and @p@. HTML tags can also exist on their own line:
-
-<section>
-  <h1>Title</h1>
-  <p>Hello!</p>
-</section>
-
-</textarea></form>
-    <script>
-        var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-            lineNumbers: true,
-            mode: "text/x-textile"
-        });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-textile</code>.</p>
-
-    <p><strong>Parsing/Highlighting Tests:</strong> <a href="../../test/index.html#textile_*">normal</a>,  <a href="../../test/index.html#verbose,textile_*">verbose</a>.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/textile.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/textile.js.js
index a6f7576582e8c99740aae9c87f25ae547f575395..bc5a2f3692f36b156b1e2fae05db7950284218b6 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/textile.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/textile/textile.js.js
@@ -203,7 +203,7 @@
     single: {
       bc: "bc",
       bq: "bq",
-      definitionList: /- [^(?::=)]+:=+/,
+      definitionList: /- .*?:=+/,
       definitionListEnd: /.*=:\s*$/,
       div: "div",
       drawTable: /\|.*\|/,
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/index.html.html
deleted file mode 100644
index 77dd0457c1ff3a7e5a637c3dea70b9d381a47dde..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/index.html.html
+++ /dev/null
@@ -1,154 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: TiddlyWiki mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="tiddlywiki.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="tiddlywiki.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">TiddlyWiki</a>
-  </ul>
-</div>
-
-<article>
-<h2>TiddlyWiki mode</h2>
-
-
-<div><textarea id="code" name="code">
-!TiddlyWiki Formatting
-* Rendered versions can be found at: http://www.tiddlywiki.com/#Reference
-
-|!Option            | !Syntax            |
-|bold font          | ''bold''           |
-|italic type        | //italic//         |
-|underlined text    | __underlined__     |
-|strikethrough text | --strikethrough--  |
-|superscript text   | super^^script^^    |
-|subscript text     | sub~~script~~      |
-|highlighted text   | @@highlighted@@    |
-|preformatted text  | {{{preformatted}}} |
-
-!Block Elements
-<<<
-!Heading 1
-
-!!Heading 2
-
-!!!Heading 3
-
-!!!!Heading 4
-
-!!!!!Heading 5
-<<<
-
-!!Lists
-<<<
-* unordered list, level 1
-** unordered list, level 2
-*** unordered list, level 3
-
-# ordered list, level 1
-## ordered list, level 2
-### unordered list, level 3
-
-; definition list, term
-: definition list, description
-<<<
-
-!!Blockquotes
-<<<
-> blockquote, level 1
->> blockquote, level 2
->>> blockquote, level 3
-
-> blockquote
-<<<
-
-!!Preformatted Text
-<<<
-{{{
-preformatted (e.g. code)
-}}}
-<<<
-
-!!Code Sections
-<<<
-{{{
-Text style code
-}}}
-
-//{{{
-JS styled code. TiddlyWiki mixed mode should support highlighter switching in the future.
-//}}}
-
-<!--{{{-->
-XML styled code. TiddlyWiki mixed mode should support highlighter switching in the future.
-<!--}}}-->
-<<<
-
-!!Tables
-<<<
-|CssClass|k
-|!heading column 1|!heading column 2|
-|row 1, column 1|row 1, column 2|
-|row 2, column 1|row 2, column 2|
-|>|COLSPAN|
-|ROWSPAN| ... |
-|~| ... |
-|CssProperty:value;...| ... |
-|caption|c
-
-''Annotation:''
-* The {{{>}}} marker creates a "colspan", causing the current cell to merge with the one to the right.
-* The {{{~}}} marker creates a "rowspan", causing the current cell to merge with the one above.
-<<<
-!!Images /% TODO %/
-cf. [[TiddlyWiki.com|http://www.tiddlywiki.com/#EmbeddedImages]]
-
-!Hyperlinks
-* [[WikiWords|WikiWord]] are automatically transformed to hyperlinks to the respective tiddler
-** the automatic transformation can be suppressed by preceding the respective WikiWord with a tilde ({{{~}}}): {{{~WikiWord}}}
-* [[PrettyLinks]] are enclosed in square brackets and contain the desired tiddler name: {{{[[tiddler name]]}}}
-** optionally, a custom title or description can be added, separated by a pipe character ({{{|}}}): {{{[[title|target]]}}}<br>'''N.B.:''' In this case, the target can also be any website (i.e. URL).
-
-!Custom Styling
-* {{{@@CssProperty:value;CssProperty:value;...@@}}}<br>''N.B.:'' CSS color definitions should use lowercase letters to prevent the inadvertent creation of WikiWords.
-* <html><code>{{customCssClass{...}}}</code></html>
-* raw HTML can be inserted by enclosing the respective code in HTML tags: {{{<html> ... </html>}}}
-
-!Special Markers
-* {{{<br>}}} forces a manual line break
-* {{{----}}} creates a horizontal ruler
-* [[HTML entities|http://www.tiddlywiki.com/#HtmlEntities]]
-* [[HTML entities local|HtmlEntities]]
-* {{{<<macroName>>}}} calls the respective [[macro|Macros]]
-* To hide text within a tiddler so that it is not displayed, it can be wrapped in {{{/%}}} and {{{%/}}}.<br/>This can be a useful trick for hiding drafts or annotating complex markup.
-* To prevent wiki markup from taking effect for a particular section, that section can be enclosed in three double quotes: e.g. {{{"""WikiWord"""}}}.
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: 'tiddlywiki',      
-        lineNumbers: true,
-        matchBrackets: true
-      });
-    </script>
-
-    <p>TiddlyWiki mode supports a single configuration.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-tiddlywiki</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/tiddlywiki.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/tiddlywiki.css.xml
index 78b411c1ee8d9e9a1a4797ca905891d998ea4803..a7d4f1700734a69cd286eaf4773df3fd42a4bde9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/tiddlywiki.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiddlywiki/tiddlywiki.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>tiddlywiki.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/index.html.html
deleted file mode 100644
index 091c5fb2a6289eb76a6aaaec53744ec7348bcc01..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/index.html.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Tiki wiki mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="tiki.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="tiki.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Tiki wiki</a>
-  </ul>
-</div>
-
-<article>
-<h2>Tiki wiki mode</h2>
-
-
-<div><textarea id="code" name="code">
-Headings
-!Header 1
-!!Header 2
-!!!Header 3
-!!!!Header 4
-!!!!!Header 5
-!!!!!!Header 6
-
-Styling
--=titlebar=-
-^^ Box on multi
-lines
-of content^^
-__bold__
-''italic''
-===underline===
-::center::
---Line Through--
-
-Operators
-~np~No parse~/np~
-
-Link
-[link|desc|nocache]
-
-Wiki
-((Wiki))
-((Wiki|desc))
-((Wiki|desc|timeout))
-
-Table
-||row1 col1|row1 col2|row1 col3
-row2 col1|row2 col2|row2 col3
-row3 col1|row3 col2|row3 col3||
-
-Lists:
-*bla
-**bla-1
-++continue-bla-1
-***bla-2
-++continue-bla-1
-*bla
-+continue-bla
-#bla
-** tra-la-la
-+continue-bla
-#bla
-
-Plugin (standard):
-{PLUGIN(attr="my attr")}
-Plugin Body
-{PLUGIN}
-
-Plugin (inline):
-{plugin attr="my attr"}
-</textarea></div>
-
-<script type="text/javascript">
-	var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: 'tiki',      
-        lineNumbers: true
-    });
-</script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/tiki.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/tiki.css.xml
index 92981d23a8cb3c929c255a36f9ab9c05e065f417..da6b21de01cc9418ec6fe17c2bf652083ab70d0f 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/tiki.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/tiki.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>tiki.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/tiki.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/tiki.js.js
index 5e05b1ff0149b610374f1c777914fa0bd036cfba..b4794e4334ee65fd9feb01b4e0688f5aaac2b2ff 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/tiki.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tiki/tiki.js.js
@@ -144,7 +144,7 @@ CodeMirror.defineMode('tiki', function(config) {
       type = "equals";
 
       if (peek == ">") {
-        ch = stream.next();
+        stream.next();
         peek = stream.peek();
       }
 
@@ -298,13 +298,13 @@ return {
     if (context && context.noIndent) return 0;
     if (context && /^{\//.test(textAfter))
         context = context.prev;
-        while (context && !context.startOfLine)
-          context = context.prev;
-        if (context) return context.indent + indentUnit;
-        else return 0;
-       },
-    electricChars: "/"
-  };
+    while (context && !context.startOfLine)
+        context = context.prev;
+    if (context) return context.indent + indentUnit;
+    else return 0;
+  },
+  electricChars: "/"
+};
 });
 
 CodeMirror.defineMIME("text/tiki", "tiki");
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/toml/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/toml/index.html.html
deleted file mode 100644
index 90a2a0215b79a11c23d9a4aba6708e81f1fbd07a..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/toml/index.html.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: TOML Mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="toml.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">TOML Mode</a>
-  </ul>
-</div>
-
-<article>
-<h2>TOML Mode</h2>
-<form><textarea id="code" name="code">
-# This is a TOML document. Boom.
-
-title = "TOML Example"
-
-[owner]
-name = "Tom Preston-Werner"
-organization = "GitHub"
-bio = "GitHub Cofounder &amp; CEO\nLikes tater tots and beer."
-dob = 1979-05-27T07:32:00Z # First class dates? Why not?
-
-[database]
-server = "192.168.1.1"
-ports = [ 8001, 8001, 8002 ]
-connection_max = 5000
-enabled = true
-
-[servers]
-
-  # You can indent as you please. Tabs or spaces. TOML don't care.
-  [servers.alpha]
-  ip = "10.0.0.1"
-  dc = "eqdc10"
-  
-  [servers.beta]
-  ip = "10.0.0.2"
-  dc = "eqdc10"
-  
-[clients]
-data = [ ["gamma", "delta"], [1, 2] ]
-
-# Line breaks are OK when inside arrays
-hosts = [
-  "alpha",
-  "omega"
-]
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: {name: "toml"},
-        lineNumbers: true
-      });
-    </script>
-    <h3>The TOML Mode</h3>
-      <p> Created by Forbes Lindesay.</p>
-    <p><strong>MIME type defined:</strong> <code>text/x-toml</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/toml/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/toml/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/toml/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tornado/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tornado/index.html.html
deleted file mode 100644
index 8ee7ef56ccd9d3b2a9a16ec8fb339cb56cfa87cf..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tornado/index.html.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Tornado template mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/overlay.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="tornado.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/marijnh/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Tornado</a>
-  </ul>
-</div>
-
-<article>
-<h2>Tornado template mode</h2>
-<form><textarea id="code" name="code">
-<!doctype html>
-<html>
-    <head>
-        <title>My Tornado web application</title>
-    </head>
-    <body>
-        <h1>
-            {{ title }}
-        </h1>
-        <ul class="my-list">
-            {% for item in items %}
-                <li>{% item.name %}</li>
-            {% empty %}
-                <li>You have no items in your list.</li>
-            {% end %}
-        </ul>
-    </body>
-</html>
-</textarea></form>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        mode: "tornado",
-        indentUnit: 4,
-        indentWithTabs: true
-      });
-    </script>
-
-    <p>Mode for HTML with embedded Tornado template markup.</p>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-tornado</code></p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tornado/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tornado/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/tornado/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/troff/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/troff/index.html.html
deleted file mode 100644
index 7c5a54e54f57008a9fa0a05f34190ffd82058133..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/troff/index.html.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: troff mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel=stylesheet href=../../lib/codemirror.css>
-<script src=../../lib/codemirror.js></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src=troff.js></script>
-<style type=text/css>
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">troff</a>
-  </ul>
-</div>
-
-<article>
-<h2>troff</h2>
-
-
-<textarea id=code>
-'\" t
-.\"     Title: mkvextract
-.TH "MKVEXTRACT" "1" "2015\-02\-28" "MKVToolNix 7\&.7\&.0" "User Commands"
-.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-.ie \n(.g .ds Aq \(aq
-.el       .ds Aq '
-.\" -----------------------------------------------------------------
-.nh
-.\" disable justification (adjust text to left margin only)
-.ad l
-.\" -----------------------------------------------------------------
-.SH "NAME"
-mkvextract \- extract tracks from Matroska(TM) files into other files
-.SH "SYNOPSIS"
-.HP \w'\fBmkvextract\fR\ 'u
-\fBmkvextract\fR {mode} {source\-filename} [options] [extraction\-spec]
-.SH "DESCRIPTION"
-.PP
-.B mkvextract
-extracts specific parts from a
-.I Matroska(TM)
-file to other useful formats\&. The first argument,
-\fBmode\fR, tells
-\fBmkvextract\fR(1)
-what to extract\&. Currently supported is the extraction of
-tracks,
-tags,
-attachments,
-chapters,
-CUE sheets,
-timecodes
-and
-cues\&. The second argument is the name of the source file\&. It must be a
-Matroska(TM)
-file\&. All following arguments are options and extraction specifications; both of which depend on the selected mode\&.
-.SS "Common options"
-.PP
-The following options are available in all modes and only described once in this section\&.
-.PP
-\fB\-f\fR, \fB\-\-parse\-fully\fR
-.RS 4
-Sets the parse mode to \*(Aqfull\*(Aq\&. The default mode does not parse the whole file but uses the meta seek elements for locating the required elements of a source file\&. In 99% of all cases this is enough\&. But for files that do not contain meta seek elements or which are damaged the user might have to use this mode\&. A full scan of a file can take a couple of minutes while a fast scan only takes seconds\&.
-.RE
-.PP
-\fB\-\-command\-line\-charset\fR \fIcharacter\-set\fR
-.RS 4
-Sets the character set to convert strings given on the command line from\&. It defaults to the character set given by system\*(Aqs current locale\&.
-.RE
-.PP
-\fB\-\-output\-charset\fR \fIcharacter\-set\fR
-.RS 4
-Sets the character set to which strings are converted that are to be output\&. It defaults to the character set given by system\*(Aqs current locale\&.
-.RE
-.PP
-\fB\-r\fR, \fB\-\-redirect\-output\fR \fIfile\-name\fR
-.RS 4
-Writes all messages to the file
-\fIfile\-name\fR
-instead of to the console\&. While this can be done easily with output redirection there are cases in which this option is needed: when the terminal reinterprets the output before writing it to a file\&. The character set set with
-\fB\-\-output\-charset\fR
-is honored\&.
-.RE
-.PP
-\fB\-\-ui\-language\fR \fIcode\fR
-.RS 4
-Forces the translations for the language
-\fIcode\fR
-to be used (e\&.g\&. \*(Aqde_DE\*(Aq for the German translations)\&. It is preferable to use the environment variables
-\fILANG\fR,
-\fILC_MESSAGES\fR
-and
-\fILC_ALL\fR
-though\&. Entering \*(Aqlist\*(Aq as the
-\fIcode\fR
-will cause
-\fBmkvextract\fR(1)
-to output a list of available translations\&.
-
-.\" [...]
-
-.SH "SEE ALSO"
-.PP
-\fBmkvmerge\fR(1),
-\fBmkvinfo\fR(1),
-\fBmkvpropedit\fR(1),
-\fBmmg\fR(1)
-.SH "WWW"
-.PP
-The latest version can always be found at
-\m[blue]\fBthe MKVToolNix homepage\fR\m[]\&\s-2\u[1]\d\s+2\&.
-.SH "AUTHOR"
-.PP
-\(co \fBMoritz Bunkus\fR <\&moritz@bunkus\&.org\&>
-.RS 4
-Developer
-.RE
-.SH "NOTES"
-.IP " 1." 4
-the MKVToolNix homepage
-.RS 4
-\%https://www.bunkus.org/videotools/mkvtoolnix/
-.RE
-</textarea>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById('code'), {
-    mode: 'troff',
-    lineNumbers: true,
-    matchBrackets: false
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>troff</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/troff/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/troff/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/troff/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn-cfg/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn-cfg/index.html.html
deleted file mode 100644
index 4a4cd4571c42a97e4771d8ca893db9e545cbb0b4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn-cfg/index.html.html
+++ /dev/null
@@ -1,115 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: TTCN-CFG mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="ttcn-cfg.js"></script>
-<style type="text/css">
-    .CodeMirror {
-        border-top: 1px solid black;
-        border-bottom: 1px solid black;
-    }
-</style>
-<div id=nav>
-    <a href="http://codemirror.net"><h1>CodeMirror</h1>
-        <img id=logo src="../../doc/logo.png">
-    </a>
-
-    <ul>
-        <li><a href="../../index.html">Home</a>
-        <li><a href="../../doc/manual.html">Manual</a>
-        <li><a href="https://github.com/codemirror/codemirror">Code</a>
-    </ul>
-    <ul>
-        <li><a href="../index.html">Language modes</a>
-        <li><a class=active href="http://en.wikipedia.org/wiki/TTCN">TTCN-CFG</a>
-    </ul>
-</div>
-<article>
-    <h2>TTCN-CFG example</h2>
-    <div>
-        <textarea id="ttcn-cfg-code">
-[MODULE_PARAMETERS]
-# This section shall contain the values of all parameters that are defined in your TTCN-3 modules.
-
-[LOGGING]
-# In this section you can specify the name of the log file and the classes of events
-# you want to log into the file or display on console (standard error).
-
-LogFile := "logs/%e.%h-%r.%s"
-FileMask := LOG_ALL | DEBUG | MATCHING
-ConsoleMask := ERROR | WARNING | TESTCASE | STATISTICS | PORTEVENT
-
-LogSourceInfo := Yes
-AppendFile := No
-TimeStampFormat := DateTime
-LogEventTypes := Yes
-SourceInfoFormat := Single
-LogEntityName := Yes
-
-[TESTPORT_PARAMETERS]
-# In this section you can specify parameters that are passed to Test Ports.
-
-[DEFINE]
-# In this section you can create macro definitions,
-# that can be used in other configuration file sections except [INCLUDE].
-
-[INCLUDE]
-# To use configuration settings given in other configuration files,
-# the configuration files just need to be listed in this section, with their full or relative pathnames.
-
-[EXTERNAL_COMMANDS]
-# This section can define external commands (shell scripts) to be executed by the ETS
-# whenever a control part or test case is started or terminated.
-
-BeginTestCase := ""
-EndTestCase := ""
-BeginControlPart := ""
-EndControlPart := ""
-
-[EXECUTE]
-# In this section you can specify what parts of your test suite you want to execute.
-
-[GROUPS]
-# In this section you can specify groups of hosts. These groups can be used inside the
-# [COMPONENTS] section to restrict the creation of certain PTCs to a given set of hosts.
-
-[COMPONENTS]
-# This section consists of rules restricting the location of created PTCs.
-
-[MAIN_CONTROLLER]
-# The options herein control the behavior of MC.
-
-TCPPort := 0
-KillTimer := 10.0
-NumHCs := 0
-LocalAddress :=
-        </textarea>
-    </div>
-
-    <script> 
-      var ttcnEditor = CodeMirror.fromTextArea(document.getElementById("ttcn-cfg-code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-ttcn-cfg"
-      });
-      ttcnEditor.setSize(600, 860);
-      var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
-      CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
-    </script>
-    <br/>
-    <p><strong>Language:</strong> Testing and Test Control Notation -
-        Configuration files
-        (<a href="http://en.wikipedia.org/wiki/TTCN">TTCN-CFG</a>)
-    </p>
-    <p><strong>MIME types defined:</strong> <code>text/x-ttcn-cfg</code>.</p>
-
-    <br/>
-    <p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
-    </a>.</p>
-    <p>Coded by Asmelash Tsegay Gebretsadkan </p>
-</article>
-
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn-cfg/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn-cfg/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn-cfg/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn/index.html.html
deleted file mode 100644
index f1ef81131089b1684eb7fc1a1354685088483d04..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn/index.html.html
+++ /dev/null
@@ -1,118 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: TTCN mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="ttcn.js"></script>
-<style type="text/css">
-    .CodeMirror {
-        border-top: 1px solid black;
-        border-bottom: 1px solid black;
-    }
-</style>
-<div id=nav>
-    <a href="http://codemirror.net"><h1>CodeMirror</h1>
-        <img id=logo src="../../doc/logo.png">
-    </a>
-
-    <ul>
-        <li><a href="../../index.html">Home</a>
-        <li><a href="../../doc/manual.html">Manual</a>
-        <li><a href="https://github.com/codemirror/codemirror">Code</a>
-    </ul>
-    <ul>
-        <li><a href="../index.html">Language modes</a>
-        <li><a class=active href="http://en.wikipedia.org/wiki/TTCN">TTCN</a>
-    </ul>
-</div>
-<article>
-    <h2>TTCN example</h2>
-    <div>
-        <textarea id="ttcn-code">
-module Templates {
-  /* import types from ASN.1 */
-  import from Types language "ASN.1:1997" all;
-
-  /* During the conversion phase from ASN.1 to TTCN-3 */
-  /* - the minus sign (Message-Type) within the identifiers will be replaced by underscore (Message_Type)*/
-  /* - the ASN.1 identifiers matching a TTCN-3 keyword (objid) will be postfixed with an underscore (objid_)*/
-
-  // simple types
-
-  template SenderID localObjid := objid {itu_t(0) identified_organization(4) etsi(0)};
-
-  // complex types
-
-  /* ASN.1 Message-Type mapped to TTCN-3 Message_Type */
-  template Message receiveMsg(template (present) Message_Type p_messageType) := {
-    header := p_messageType,
-    body := ?
-  }
-
-  /* ASN.1 objid mapped to TTCN-3 objid_ */
-  template Message sendInviteMsg := {
-      header := inviteType,
-      body := {
-        /* optional fields may be assigned by omit or may be ignored/skipped */
-        description := "Invite Message",
-        data := 'FF'O,
-        objid_ := localObjid
-      }
-  }
-
-  template Message sendAcceptMsg modifies sendInviteMsg := {
-      header := acceptType,
-      body := {
-        description := "Accept Message"
-      }
-    };
-
-  template Message sendErrorMsg modifies sendInviteMsg := {
-      header := errorType,
-      body := {
-        description := "Error Message"
-      }
-    };
-
-  template Message expectedErrorMsg := {
-      header := errorType,
-      body := ?
-    };
-
-  template Message expectedInviteMsg modifies expectedErrorMsg := {
-      header := inviteType
-    };
-
-  template Message expectedAcceptMsg modifies expectedErrorMsg := {
-      header := acceptType
-    };
-
-} with { encode "BER:1997" }
-        </textarea>
-    </div>
-
-    <script> 
-      var ttcnEditor = CodeMirror.fromTextArea(document.getElementById("ttcn-code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        mode: "text/x-ttcn"
-      });
-      ttcnEditor.setSize(600, 860);
-      var mac = CodeMirror.keyMap.default == CodeMirror.keyMap.macDefault;
-      CodeMirror.keyMap.default[(mac ? "Cmd" : "Ctrl") + "-Space"] = "autocomplete";
-    </script>
-    <br/>
-    <p><strong>Language:</strong> Testing and Test Control Notation
-        (<a href="http://en.wikipedia.org/wiki/TTCN">TTCN</a>)
-    </p>
-    <p><strong>MIME types defined:</strong> <code>text/x-ttcn,
-        text/x-ttcn3, text/x-ttcnpp</code>.</p>
-    <br/>
-    <p>The development of this mode has been sponsored by <a href="http://www.ericsson.com/">Ericsson
-    </a>.</p>
-    <p>Coded by Asmelash Tsegay Gebretsadkan </p>
-</article>
-
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/ttcn/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/turtle/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/turtle/index.html.html
deleted file mode 100644
index a4962b61748355233c70efaabc18fd5e929846ec..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/turtle/index.html.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Turtle mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="turtle.js"></script>
-<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Turtle</a>
-  </ul>
-</div>
-
-<article>
-<h2>Turtle mode</h2>
-<form><textarea id="code" name="code">
-@prefix foaf: <http://xmlns.com/foaf/0.1/> .
-@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-
-<http://purl.org/net/bsletten> 
-    a foaf:Person;
-    foaf:interest <http://www.w3.org/2000/01/sw/>;
-    foaf:based_near [
-        geo:lat "34.0736111" ;
-        geo:lon "-118.3994444"
-   ]
-
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "text/turtle",
-        matchBrackets: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/turtle</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/turtle/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/turtle/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/turtle/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/index.html.html
deleted file mode 100644
index 02493a5cb86bdc0d7a160fc5c00963e0e2e0fced..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/index.html.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Twig mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="twig.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Twig</a>
-  </ul>
-</div>
-
-<article>
-<h2>Twig mode</h2>
-<form><textarea id="code" name="code">
-{% extends "layout.twig" %}
-{% block title %}CodeMirror: Twig mode{% endblock %}
-{# this is a comment #}
-{% block content %}
-  {% for foo in bar if foo.baz is divisible by(3) %}
-    Hello {{ foo.world }}
-  {% else %}
-    {% set msg = "Result not found" %}
-    {% include "empty.twig" with { message: msg } %}
-  {% endfor %}
-{% endblock %}
-</textarea></form>
-    <script>
-      var editor =
-      CodeMirror.fromTextArea(document.getElementById("code"), {mode:
-        {name: "twig", htmlMode: true}});
-    </script>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/twig.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/twig.js.js
index 1f2854bef21a2cb56dfb6e03e84d0f2abd935115..b4e98972bcf677929479525cf348b9ecb8e11d38 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/twig.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/twig/twig.js.js
@@ -95,7 +95,7 @@
         }
         return "variable";
       } else if (stream.eat("{")) {
-        if (ch = stream.eat("#")) {
+        if (stream.eat("#")) {
           state.incomment = true;
           if (!stream.skipTo("#}")) {
             stream.skipToEnd();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/index.html.html
deleted file mode 100644
index adcc44fd3921768158bfff62145d2c76688824eb..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/index.html.html
+++ /dev/null
@@ -1,102 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: VB.NET mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link href="http://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet" type="text/css">
-<script src="../../lib/codemirror.js"></script>
-<script src="vb.js"></script>
-<script type="text/javascript" src="../../addon/runmode/runmode.js"></script>
-<style>
-      .CodeMirror {border: 1px solid #aaa; height:210px; height: auto;}
-      .CodeMirror-scroll { overflow-x: auto; overflow-y: hidden;}
-      .CodeMirror pre { font-family: Inconsolata; font-size: 14px}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">VB.NET</a>
-  </ul>
-</div>
-
-<article>
-<h2>VB.NET mode</h2>
-
-<script type="text/javascript">
-function test(golden, text) {
-  var ok = true;
-  var i = 0;
-  function callback(token, style, lineNo, pos){
-		//console.log(String(token) + " " + String(style) + " " + String(lineNo) + " " + String(pos));
-    var result = [String(token), String(style)];
-    if (golden[i][0] != result[0] || golden[i][1] != result[1]){
-      return "Error, expected: " + String(golden[i]) + ", got: " + String(result);
-      ok = false;
-    }
-    i++;
-  }
-  CodeMirror.runMode(text, "text/x-vb",callback); 
-
-  if (ok) return "Tests OK";
-}
-function testTypes() {
-  var golden = [['Integer','keyword'],[' ','null'],['Float','keyword']]
-  var text =  "Integer Float";
-  return test(golden,text);
-}
-function testIf(){
-  var golden = [['If','keyword'],[' ','null'],['True','keyword'],[' ','null'],['End','keyword'],[' ','null'],['If','keyword']];
-  var text = 'If True End If';
-  return test(golden, text);
-}
-function testDecl(){
-   var golden = [['Dim','keyword'],[' ','null'],['x','variable'],[' ','null'],['as','keyword'],[' ','null'],['Integer','keyword']];
-   var text = 'Dim x as Integer';
-   return test(golden, text);
-}
-function testAll(){
-  var result = "";
-
-  result += testTypes() + "\n";
-  result += testIf() + "\n";
-  result += testDecl() + "\n";
-  return result;
-
-}
-function initText(editor) {
-  var content = 'Class rocket\nPrivate quality as Double\nPublic Sub launch() as String\nif quality > 0.8\nlaunch = "Successful"\nElse\nlaunch = "Failed"\nEnd If\nEnd sub\nEnd class\n';
-  editor.setValue(content);
-  for (var i =0; i< editor.lineCount(); i++) editor.indentLine(i);
-}
-function init() {
-    editor = CodeMirror.fromTextArea(document.getElementById("solution"), {
-        lineNumbers: true,
-        mode: "text/x-vb",
-        readOnly: false
-    });
-    runTest();
-}
-function runTest() {
-	document.getElementById('testresult').innerHTML = testAll();
-  initText(editor);
-	
-}
-document.body.onload = init;
-</script>
-
-  <div id="edit">
-  <textarea style="width:95%;height:200px;padding:5px;" name="solution" id="solution" ></textarea>
-  </div>
-  <pre id="testresult"></pre>
-  <p>MIME type defined: <code>text/x-vb</code>.</p>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/vb.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/vb.js.js
index d78f91f701c7b421cc38477bad388928d35aafc7..735eb7f7e81424dd1d6cede6e50e9121655e737b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/vb.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vb/vb.js.js
@@ -202,7 +202,6 @@ CodeMirror.defineMode("vb", function(conf, parserConf) {
         // Handle '.' connected identifiers
         if (current === '.') {
             style = state.tokenize(stream, state);
-            current = stream.current();
             if (style === 'variable') {
                 return 'variable';
             } else {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vbscript/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vbscript/index.html.html
deleted file mode 100644
index ad7532d7df14139e1b5060be56cf902d6ffbc632..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vbscript/index.html.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: VBScript mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="vbscript.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">VBScript</a>
-  </ul>
-</div>
-
-<article>
-<h2>VBScript mode</h2>
-
-
-<div><textarea id="code" name="code">
-' Pete Guhl
-' 03-04-2012
-'
-' Basic VBScript support for codemirror2
-
-Const ForReading = 1, ForWriting = 2, ForAppending = 8
-
-Call Sub020_PostBroadcastToUrbanAirship(strUserName, strPassword, intTransmitID, strResponse)
-
-If Not IsNull(strResponse) AND Len(strResponse) = 0 Then
-	boolTransmitOkYN = False
-Else
-	' WScript.Echo "Oh Happy Day! Oh Happy DAY!"
-	boolTransmitOkYN = True
-End If
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        indentUnit: 4
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/vbscript</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vbscript/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vbscript/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vbscript/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/index.html.html
deleted file mode 100644
index 7eba8f4185d6d59560b22c4ca7214623f2b77605..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/index.html.html
+++ /dev/null
@@ -1,120 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Velocity mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/night.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="velocity.js"></script>
-<style>.CodeMirror {border: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Velocity</a>
-  </ul>
-</div>
-
-<article>
-<h2>Velocity mode</h2>
-<form><textarea id="code" name="code">
-## Velocity Code Demo
-#*
-   based on PL/SQL mode by Peter Raganitsch, adapted to Velocity by Steve O'Hara ( http://www.pivotal-solutions.co.uk )
-   August 2011
-*#
-
-#*
-   This is a multiline comment.
-   This is the second line
-*#
-
-#[[ hello steve
-   This has invalid syntax that would normally need "poor man's escaping" like:
-
-   #define()
-
-   ${blah
-]]#
-
-#include( "disclaimer.txt" "opinion.txt" )
-#include( $foo $bar )
-
-#parse( "lecorbusier.vm" )
-#parse( $foo )
-
-#evaluate( 'string with VTL #if(true)will be displayed#end' )
-
-#define( $hello ) Hello $who #end #set( $who = "World!") $hello ## displays Hello World!
-
-#foreach( $customer in $customerList )
-
-    $foreach.count $customer.Name
-
-    #if( $foo == ${bar})
-        it's true!
-        #break
-    #{else}
-        it's not!
-        #stop
-    #end
-
-    #if ($foreach.parent.hasNext)
-        $velocityCount
-    #end
-#end
-
-$someObject.getValues("this is a string split
-        across lines")
-
-$someObject("This plus $something in the middle").method(7567).property
-
-#set($something = "Parseable string with '$quotes'!")
-
-#macro( tablerows $color $somelist )
-    #foreach( $something in $somelist )
-        <tr><td bgcolor=$color>$something</td></tr>
-        <tr><td bgcolor=$color>$bodyContent</td></tr>
-    #end
-#end
-
-#tablerows("red" ["dadsdf","dsa"])
-#@tablerows("red" ["dadsdf","dsa"]) some body content #end
-
-   Variable reference: #set( $monkey = $bill )
-   String literal: #set( $monkey.Friend = 'monica' )
-   Property reference: #set( $monkey.Blame = $whitehouse.Leak )
-   Method reference: #set( $monkey.Plan = $spindoctor.weave($web) )
-   Number literal: #set( $monkey.Number = 123 )
-   Range operator: #set( $monkey.Numbers = [1..3] )
-   Object list: #set( $monkey.Say = ["Not", $my, "fault"] )
-   Object map: #set( $monkey.Map = {"banana" : "good", "roast beef" : "bad"})
-
-The RHS can also be a simple arithmetic expression, such as:
-Addition: #set( $value = $foo + 1 )
-   Subtraction: #set( $value = $bar - 1 )
-   Multiplication: #set( $value = $foo * $bar )
-   Division: #set( $value = $foo / $bar )
-   Remainder: #set( $value = $foo % $bar )
-
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        theme: "night",
-        lineNumbers: true,
-        indentUnit: 4,
-        mode: "text/velocity"
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/velocity</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/velocity.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/velocity.js.js
index 12ee221249c8e88b51e0d3c48c57ff7ae8985214..2525fda5ca1212dc1c78cd9c6854a4565927d2b7 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/velocity.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/velocity/velocity.js.js
@@ -82,7 +82,7 @@ CodeMirror.defineMode("velocity", function() {
         }
         // variable?
         else if (ch == "$") {
-            stream.eatWhile(/[\w\d\$_\.{}]/);
+            stream.eatWhile(/[\w\d\$_\.{}-]/);
             // is it one of the specials?
             if (specials && specials.propertyIsEnumerable(stream.current())) {
                 return "keyword";
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/index.html.html
deleted file mode 100644
index 9c52722afbc39cf5924f8382e0391fbb9fa8a1b6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/index.html.html
+++ /dev/null
@@ -1,120 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Verilog/SystemVerilog mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="verilog.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Verilog/SystemVerilog</a>
-  </ul>
-</div>
-
-<article>
-<h2>SystemVerilog mode</h2>
-
-<div><textarea id="code" name="code">
-// Literals
-1'b0
-1'bx
-1'bz
-16'hDC78
-'hdeadbeef
-'b0011xxzz
-1234
-32'd5678
-3.4e6
--128.7
-
-// Macro definition
-`define BUS_WIDTH = 8;
-
-// Module definition
-module block(
-  input                   clk,
-  input                   rst_n,
-  input  [`BUS_WIDTH-1:0] data_in,
-  output [`BUS_WIDTH-1:0] data_out
-);
-  
-  always @(posedge clk or negedge rst_n) begin
-
-    if (~rst_n) begin
-      data_out <= 8'b0;
-    end else begin
-      data_out <= data_in;
-    end
-    
-    if (~rst_n)
-      data_out <= 8'b0;
-    else
-      data_out <= data_in;
-    
-    if (~rst_n)
-      begin
-        data_out <= 8'b0;
-      end
-    else
-      begin
-        data_out <= data_in;
-      end
-
-  end
-  
-endmodule
-
-// Class definition
-class test;
-
-  /**
-   * Sum two integers
-   */
-  function int sum(int a, int b);
-    int result = a + b;
-    string msg = $sformatf("%d + %d = %d", a, b, result);
-    $display(msg);
-    return result;
-  endfunction
-  
-  task delay(int num_cycles);
-    repeat(num_cycles) #1;
-  endtask
-  
-endclass
-
-</textarea></div>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    matchBrackets: true,
-    mode: {
-      name: "verilog",
-      noIndentKeywords: ["package"]
-    }
-  });
-</script>
-
-<p>
-Syntax highlighting and indentation for the Verilog and SystemVerilog languages (IEEE 1800).
-<h2>Configuration options:</h2>
-  <ul>
-    <li><strong>noIndentKeywords</strong> - List of keywords which should not cause indentation to increase. E.g. ["package", "module"]. Default: None</li>
-  </ul>
-</p>
-
-<p><strong>MIME types defined:</strong> <code>text/x-verilog</code> and <code>text/x-systemverilog</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/verilog.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/verilog.js.js
index 460cdb3b1c36a7d9fb73db2b1164b5044a548cb6..3404686097f1f68e719971e292cee8bd62906e23 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/verilog.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/verilog/verilog.js.js
@@ -81,7 +81,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
   // Block openings which are closed by a matching keyword in the form of ("end" + keyword)
   // E.g. "task" => "endtask"
   var blockKeywords = words(
-    "case checker class clocking config function generate interface module package" +
+    "case checker class clocking config function generate interface module package " +
     "primitive program property specify sequence table task"
   );
 
@@ -602,7 +602,7 @@ CodeMirror.defineMode("verilog", function(config, parserConfig) {
             var prefix = match[1];
             var mnemonic = match[2];
             if (// is identifier prefix
-                (prefix in tlvIdentifierStyle) &&
+                tlvIdentifierStyle.hasOwnProperty(prefix) &&
                 // has mnemonic or we're at the end of the line (maybe it hasn't been typed yet)
                 (mnemonic.length > 0 || stream.eol())) {
               style = tlvIdentifierStyle[prefix];
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vhdl/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vhdl/index.html.html
deleted file mode 100644
index 3051bc37e5e63c6183744e88d994b44d576362e4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vhdl/index.html.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: VHDL mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="vhdl.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">VHDL</a>
-  </ul>
-</div>
-
-<article>
-<h2>VHDL mode</h2>
-
-<div><textarea id="code" name="code">
-LIBRARY ieee;
-USE ieee.std_logic_1164.ALL;
-USE ieee.numeric_std.ALL;
-
-ENTITY tb IS
-END tb;
-
-ARCHITECTURE behavior OF tb IS
-   --Inputs
-   signal a : unsigned(2 downto 0) := (others => '0');
-   signal b : unsigned(2 downto 0) := (others => '0');
-    --Outputs
-   signal a_eq_b : std_logic;
-   signal a_le_b : std_logic;
-   signal a_gt_b : std_logic;
-
-    signal i,j : integer;
-
-BEGIN
-
-    -- Instantiate the Unit Under Test (UUT)
-   uut: entity work.comparator PORT MAP (
-          a => a,
-          b => b,
-          a_eq_b => a_eq_b,
-          a_le_b => a_le_b,
-          a_gt_b => a_gt_b
-        );
-
-   -- Stimulus process
-   stim_proc: process
-   begin
-        for i in 0 to 8 loop
-            for j in 0 to 8 loop
-                a <= to_unsigned(i,3); --integer to unsigned type conversion
-                b <= to_unsigned(j,3);
-                wait for 10 ns;
-            end loop;
-        end loop;
-   end process;
-
-END;
-</textarea></div>
-
-<script>
-  var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-    lineNumbers: true,
-    matchBrackets: true,
-    mode: {
-      name: "vhdl",
-    }
-  });
-</script>
-
-<p>
-Syntax highlighting and indentation for the VHDL language.
-<h2>Configuration options:</h2>
-  <ul>
-    <li><strong>atoms</strong> - List of atom words. Default: "null"</li>
-    <li><strong>hooks</strong> - List of meta hooks. Default: ["`", "$"]</li>
-    <li><strong>multiLineStrings</strong> - Whether multi-line strings are accepted. Default: false</li>
-  </ul>
-</p>
-
-<p><strong>MIME types defined:</strong> <code>text/x-vhdl</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vhdl/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vhdl/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vhdl/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/index.html.html
deleted file mode 100644
index e0b45b9452fe3ef3c4dfeeb58c71e76ea7e696f7..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/index.html.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Vue.js mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/overlay.js"></script>
-<script src="../../addon/mode/simple.js"></script>
-<script src="../../addon/selection/selection-pointer.js"></script>
-<script src="../xml/xml.js"></script>
-<script src="../javascript/javascript.js"></script>
-<script src="../css/css.js"></script>
-<script src="../coffeescript/coffeescript.js"></script>
-<script src="../sass/sass.js"></script>
-<script src="../pug/pug.js"></script>
-
-<script src="../handlebars/handlebars.js"></script>
-<script src="../htmlmixed/htmlmixed.js"></script>
-<script src="vue.js"></script>
-<style>.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Vue.js mode</a>
-  </ul>
-</div>
-
-<article>
-<h2>Vue.js mode</h2>
-<form><textarea id="code" name="code">
-<template>
-  <div class="sass">Im am a {{mustache-like}} template</div>
-</template>
-
-<script lang="coffee">
-  module.exports =
-    props: ['one', 'two', 'three']
-</script>
-
-<style lang="sass">
-.sass
-  font-size: 18px
-</style>
-
-</textarea></form>
-    <script>
-      // Define an extended mixed-mode that understands vbscript and
-      // leaves mustache/handlebars embedded templates in html mode
-      var mixedMode = {
-        name: "vue"
-      };
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: mixedMode,
-        selectionPointer: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-vue</code></p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/vue.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/vue.js.js
index c0eab6b82f6ed7b3b0ac3fb26dc78af85119823d..84cd07c9a44bc9c8effa072a624d2099c82bf976 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/vue.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/vue/vue.js.js
@@ -32,13 +32,20 @@
   var tagLanguages = {
     script: [
       ["lang", /coffee(script)?/, "coffeescript"],
-      ["type", /^(?:text|application)\/(?:x-)?coffee(?:script)?$/, "coffeescript"]
+      ["type", /^(?:text|application)\/(?:x-)?coffee(?:script)?$/, "coffeescript"],
+      ["lang", /^babel$/, "javascript"],
+      ["type", /^text\/babel$/, "javascript"],
+      ["type", /^text\/ecmascript-\d+$/, "javascript"]
     ],
     style: [
       ["lang", /^stylus$/i, "stylus"],
       ["lang", /^sass$/i, "sass"],
+      ["lang", /^less$/i, "text/x-less"],
+      ["lang", /^scss$/i, "text/x-scss"],
       ["type", /^(text\/)?(x-)?styl(us)?$/i, "stylus"],
-      ["type", /^text\/sass/i, "sass"]
+      ["type", /^text\/sass/i, "sass"],
+      ["type", /^(text\/)?(x-)?scss$/i, "text/x-scss"],
+      ["type", /^(text\/)?(x-)?less$/i, "text/x-less"]
     ],
     template: [
       ["lang", /^vue-template$/i, "vue"],
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/webidl/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/webidl/index.html.html
deleted file mode 100644
index 1d4112e1c3e8233fb2531a07a0416922e58903cf..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/webidl/index.html.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Web IDL mode</title>
-<meta charset="utf-8">
-<link rel="stylesheet" href="../../doc/docs.css">
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/edit/matchbrackets.js"></script>
-<script src="webidl.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-
-<div id="nav">
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id="logo" src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class="active" href="#">Web IDL</a>
-  </ul>
-</div>
-
-<article>
-  <h2>Web IDL mode</h2>
-
-  <div>
-<textarea id="code" name="code">
-[NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
-interface HTMLImageElement : HTMLElement {
-           attribute DOMString alt;
-           attribute DOMString src;
-           attribute DOMString srcset;
-           attribute DOMString sizes;
-           attribute DOMString? crossOrigin;
-           attribute DOMString useMap;
-           attribute boolean isMap;
-           attribute unsigned long width;
-           attribute unsigned long height;
-  readonly attribute unsigned long naturalWidth;
-  readonly attribute unsigned long naturalHeight;
-  readonly attribute boolean complete;
-  readonly attribute DOMString currentSrc;
-
-  // also has obsolete members
-};
-
-partial interface HTMLImageElement {
-  attribute DOMString name;
-  attribute DOMString lowsrc;
-  attribute DOMString align;
-  attribute unsigned long hspace;
-  attribute unsigned long vspace;
-  attribute DOMString longDesc;
-
-  [TreatNullAs=EmptyString] attribute DOMString border;
-};
-</textarea>
-  </div>
-
-  <script>
-    var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-      lineNumbers: true,
-      matchBrackets: true
-    });
-  </script>
-
-  <p><strong>MIME type defined:</strong> <code>text/x-webidl</code>.</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/webidl/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/webidl/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/webidl/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/index.html.html
deleted file mode 100644
index c56b8b6eb7ac39e418fc1feed5f2739ba5c0e5f3..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/index.html.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: XML mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="xml.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">XML</a>
-  </ul>
-</div>
-
-<article>
-<h2>XML mode</h2>
-<form><textarea id="code" name="code">
-&lt;html style="color: green"&gt;
-  &lt;!-- this is a comment --&gt;
-  &lt;head&gt;
-    &lt;title&gt;HTML Example&lt;/title&gt;
-  &lt;/head&gt;
-  &lt;body&gt;
-    The indentation tries to be &lt;em&gt;somewhat &amp;quot;do what
-    I mean&amp;quot;&lt;/em&gt;... but might not match your style.
-  &lt;/body&gt;
-&lt;/html&gt;
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        mode: "text/html",
-        lineNumbers: true
-      });
-    </script>
-    <p>The XML mode supports these configuration parameters:</p>
-    <dl>
-      <dt><code>htmlMode (boolean)</code></dt>
-      <dd>This switches the mode to parse HTML instead of XML. This
-      means attributes do not have to be quoted, and some elements
-      (such as <code>br</code>) do not require a closing tag.</dd>
-      <dt><code>matchClosing (boolean)</code></dt>
-      <dd>Controls whether the mode checks that close tags match the
-      corresponding opening tag, and highlights mismatches as errors.
-      Defaults to true.</dd>
-      <dt><code>alignCDATA (boolean)</code></dt>
-      <dd>Setting this to true will force the opening tag of CDATA
-      blocks to not be indented.</dd>
-    </dl>
-
-    <p><strong>MIME types defined:</strong> <code>application/xml</code>, <code>text/html</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/xml.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/xml.js.js
index f987a3a3ce9c16571801d27819d21d975119eeb5..0f1c9b175ef74cc1cb98d8b3412b1d9d80c8d622 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/xml.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xml/xml.js.js
@@ -52,6 +52,7 @@ var xmlConfig = {
   doNotIndent: {},
   allowUnquoted: false,
   allowMissing: false,
+  allowMissingTagName: false,
   caseFold: false
 }
 
@@ -226,6 +227,9 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
       state.tagName = stream.current();
       setStyle = "tag";
       return attrState;
+    } else if (config.allowMissingTagName && type == "endTag") {
+      setStyle = "tag bracket";
+      return attrState(type, stream, state);
     } else {
       setStyle = "error";
       return tagNameState;
@@ -244,6 +248,9 @@ CodeMirror.defineMode("xml", function(editorConf, config_) {
         setStyle = "tag error";
         return closeStateErr;
       }
+    } else if (config.allowMissingTagName && type == "endTag") {
+      setStyle = "tag bracket";
+      return closeState(type, stream, state);
     } else {
       setStyle = "error";
       return closeStateErr;
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/index.html.html
deleted file mode 100644
index 7ac5aaeff4453e1517e47143de231956ad49dbb3..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/index.html.html
+++ /dev/null
@@ -1,210 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: XQuery mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<link rel="stylesheet" href="../../theme/xq-dark.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="xquery.js"></script>
-<style type="text/css">
-	.CodeMirror {
-	  border-top: 1px solid black; border-bottom: 1px solid black;
-	  height:400px;
-	}
-    </style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">XQuery</a>
-  </ul>
-</div>
-
-<article>
-<h2>XQuery mode</h2>
- 
- 
-<div class="cm-s-default"> 
-	<textarea id="code" name="code"> 
-xquery version &quot;1.0-ml&quot;;
-(: this is
- : a 
-   "comment" :)
-let $let := &lt;x attr=&quot;value&quot;&gt;&quot;test&quot;&lt;func&gt;function() $var {function()} {$var}&lt;/func&gt;&lt;/x&gt;
-let $joe:=1
-return element element {
-	attribute attribute { 1 },
-	element test { &#39;a&#39; }, 
-	attribute foo { &quot;bar&quot; },
-	fn:doc()[ foo/@bar eq $let ],
-	//x }    
- 
-(: a more 'evil' test :)
-(: Modified Blakeley example (: with nested comment :) ... :)
-declare private function local:declare() {()};
-declare private function local:private() {()};
-declare private function local:function() {()};
-declare private function local:local() {()};
-let $let := &lt;let&gt;let $let := &quot;let&quot;&lt;/let&gt;
-return element element {
-	attribute attribute { try { xdmp:version() } catch($e) { xdmp:log($e) } },
-	attribute fn:doc { &quot;bar&quot; castable as xs:string },
-	element text { text { &quot;text&quot; } },
-	fn:doc()[ child::eq/(@bar | attribute::attribute) eq $let ],
-	//fn:doc
-}
-
-
-
-xquery version &quot;1.0-ml&quot;;
-
-(: Copyright 2006-2010 Mark Logic Corporation. :)
-
-(:
- : Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
- : you may not use this file except in compliance with the License.
- : You may obtain a copy of the License at
- :
- :     http://www.apache.org/licenses/LICENSE-2.0
- :
- : Unless required by applicable law or agreed to in writing, software
- : distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
- : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- : See the License for the specific language governing permissions and
- : limitations under the License.
- :)
-
-module namespace json = &quot;http://marklogic.com/json&quot;;
-declare default function namespace &quot;http://www.w3.org/2005/xpath-functions&quot;;
-
-(: Need to backslash escape any double quotes, backslashes, and newlines :)
-declare function json:escape($s as xs:string) as xs:string {
-  let $s := replace($s, &quot;\\&quot;, &quot;\\\\&quot;)
-  let $s := replace($s, &quot;&quot;&quot;&quot;, &quot;\\&quot;&quot;&quot;)
-  let $s := replace($s, codepoints-to-string((13, 10)), &quot;\\n&quot;)
-  let $s := replace($s, codepoints-to-string(13), &quot;\\n&quot;)
-  let $s := replace($s, codepoints-to-string(10), &quot;\\n&quot;)
-  return $s
-};
-
-declare function json:atomize($x as element()) as xs:string {
-  if (count($x/node()) = 0) then 'null'
-  else if ($x/@type = &quot;number&quot;) then
-    let $castable := $x castable as xs:float or
-                     $x castable as xs:double or
-                     $x castable as xs:decimal
-    return
-    if ($castable) then xs:string($x)
-    else error(concat(&quot;Not a number: &quot;, xdmp:describe($x)))
-  else if ($x/@type = &quot;boolean&quot;) then
-    let $castable := $x castable as xs:boolean
-    return
-    if ($castable) then xs:string(xs:boolean($x))
-    else error(concat(&quot;Not a boolean: &quot;, xdmp:describe($x)))
-  else concat('&quot;', json:escape($x), '&quot;')
-};
-
-(: Print the thing that comes after the colon :)
-declare function json:print-value($x as element()) as xs:string {
-  if (count($x/*) = 0) then
-    json:atomize($x)
-  else if ($x/@quote = &quot;true&quot;) then
-    concat('&quot;', json:escape(xdmp:quote($x/node())), '&quot;')
-  else
-    string-join(('{',
-      string-join(for $i in $x/* return json:print-name-value($i), &quot;,&quot;),
-    '}'), &quot;&quot;)
-};
-
-(: Print the name and value both :)
-declare function json:print-name-value($x as element()) as xs:string? {
-  let $name := name($x)
-  let $first-in-array :=
-    count($x/preceding-sibling::*[name(.) = $name]) = 0 and
-    (count($x/following-sibling::*[name(.) = $name]) &gt; 0 or $x/@array = &quot;true&quot;)
-  let $later-in-array := count($x/preceding-sibling::*[name(.) = $name]) &gt; 0
-  return
-
-  if ($later-in-array) then
-    ()  (: I was handled previously :)
-  else if ($first-in-array) then
-    string-join(('&quot;', json:escape($name), '&quot;:[',
-      string-join((for $i in ($x, $x/following-sibling::*[name(.) = $name]) return json:print-value($i)), &quot;,&quot;),
-    ']'), &quot;&quot;)
-   else
-     string-join(('&quot;', json:escape($name), '&quot;:', json:print-value($x)), &quot;&quot;)
-};
-
-(:~
-  Transforms an XML element into a JSON string representation.  See http://json.org.
-  &lt;p/&gt;
-  Sample usage:
-  &lt;pre&gt;
-    xquery version &quot;1.0-ml&quot;;
-    import module namespace json=&quot;http://marklogic.com/json&quot; at &quot;json.xqy&quot;;
-    json:serialize(&amp;lt;foo&amp;gt;&amp;lt;bar&amp;gt;kid&amp;lt;/bar&amp;gt;&amp;lt;/foo&amp;gt;)
-  &lt;/pre&gt;
-  Sample transformations:
-  &lt;pre&gt;
-  &amp;lt;e/&amp;gt; becomes {&quot;e&quot;:null}
-  &amp;lt;e&amp;gt;text&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:&quot;text&quot;}
-  &amp;lt;e&amp;gt;quote &quot; escaping&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:&quot;quote \&quot; escaping&quot;}
-  &amp;lt;e&amp;gt;backslash \ escaping&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:&quot;backslash \\ escaping&quot;}
-  &amp;lt;e&amp;gt;&amp;lt;a&amp;gt;text1&amp;lt;/a&amp;gt;&amp;lt;b&amp;gt;text2&amp;lt;/b&amp;gt;&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:{&quot;a&quot;:&quot;text1&quot;,&quot;b&quot;:&quot;text2&quot;}}
-  &amp;lt;e&amp;gt;&amp;lt;a&amp;gt;text1&amp;lt;/a&amp;gt;&amp;lt;a&amp;gt;text2&amp;lt;/a&amp;gt;&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:{&quot;a&quot;:[&quot;text1&quot;,&quot;text2&quot;]}}
-  &amp;lt;e&amp;gt;&amp;lt;a array=&quot;true&quot;&amp;gt;text1&amp;lt;/a&amp;gt;&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:{&quot;a&quot;:[&quot;text1&quot;]}}
-  &amp;lt;e&amp;gt;&amp;lt;a type=&quot;boolean&quot;&amp;gt;false&amp;lt;/a&amp;gt;&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:{&quot;a&quot;:false}}
-  &amp;lt;e&amp;gt;&amp;lt;a type=&quot;number&quot;&amp;gt;123.5&amp;lt;/a&amp;gt;&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:{&quot;a&quot;:123.5}}
-  &amp;lt;e quote=&quot;true&quot;&amp;gt;&amp;lt;div attrib=&quot;value&quot;/&amp;gt;&amp;lt;/e&amp;gt; becomes {&quot;e&quot;:&quot;&amp;lt;div attrib=\&quot;value\&quot;/&amp;gt;&quot;}
-  &lt;/pre&gt;
-  &lt;p/&gt;
-  Namespace URIs are ignored.  Namespace prefixes are included in the JSON name.
-  &lt;p/&gt;
-  Attributes are ignored, except for the special attribute @array=&quot;true&quot; that
-  indicates the JSON serialization should write the node, even if single, as an
-  array, and the attribute @type that can be set to &quot;boolean&quot; or &quot;number&quot; to
-  dictate the value should be written as that type (unquoted).  There's also
-  an @quote attribute that when set to true writes the inner content as text
-  rather than as structured JSON, useful for sending some XHTML over the
-  wire.
-  &lt;p/&gt;
-  Text nodes within mixed content are ignored.
-
-  @param $x Element node to convert
-  @return String holding JSON serialized representation of $x
-
-  @author Jason Hunter
-  @version 1.0.1
-  
-  Ported to xquery 1.0-ml; double escaped backslashes in json:escape
-:)
-declare function json:serialize($x as element())  as xs:string {
-  string-join(('{', json:print-name-value($x), '}'), &quot;&quot;)
-};
-  </textarea> 
-</div> 
- 
-    <script> 
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true,
-        matchBrackets: true,
-        theme: "xq-dark"
-      });
-    </script> 
- 
-    <p><strong>MIME types defined:</strong> <code>application/xquery</code>.</p> 
- 
-    <p>Development of the CodeMirror XQuery mode was sponsored by 
-      <a href="http://marklogic.com">MarkLogic</a> and developed by 
-      <a href="https://twitter.com/mbrevoort">Mike Brevoort</a>.
-    </p>
- 
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/test.js.js
index 1f148cdbbd8c056f8251b435b4da67aa99ca8283..9697f9b0acd29d9c7f0256118bfc43055c408561 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/test.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/test.js.js
@@ -20,14 +20,14 @@
      "          [def&variable fn:doc]()[[ [variable foo][keyword /][variable @bar] [keyword eq] [variable $let] ]],",
      "          [keyword //][variable x] }                 [comment (: a more 'evil' test :)]",
      "      [comment (: Modified Blakeley example (: with nested comment :) ... :)]",
-     "      [keyword declare] [keyword private] [keyword function] [def&variable local:declare]() {()}[variable ;]",
-     "      [keyword declare] [keyword private] [keyword function] [def&variable local:private]() {()}[variable ;]",
-     "      [keyword declare] [keyword private] [keyword function] [def&variable local:function]() {()}[variable ;]",
-     "      [keyword declare] [keyword private] [keyword function] [def&variable local:local]() {()}[variable ;]",
+     "      [keyword declare] [variable private] [keyword function] [def&variable local:declare]() {()}[variable ;]",
+     "      [keyword declare] [variable private] [keyword function] [def&variable local:private]() {()}[variable ;]",
+     "      [keyword declare] [variable private] [keyword function] [def&variable local:function]() {()}[variable ;]",
+     "      [keyword declare] [variable private] [keyword function] [def&variable local:local]() {()}[variable ;]",
      "      [keyword let] [variable $let] [keyword :=] [variable &lt;let&gt;let] [variable $let] [keyword :=] [variable &quot;let&quot;&lt;][keyword /let][variable &gt;]",
      "      [keyword return] [keyword element] [variable element] {",
      "          [keyword attribute] [variable attribute] { [keyword try] { [def&variable xdmp:version]() } [keyword catch]([variable $e]) { [def&variable xdmp:log]([variable $e]) } },",
-     "          [keyword attribute] [variable fn:doc] { [variable &quot;bar&quot;] [variable castable] [keyword as] [atom xs:string] },",
+     "          [keyword attribute] [variable fn:doc] { [variable &quot;bar&quot;] [keyword castable] [keyword as] [atom xs:string] },",
      "          [keyword element] [variable text] { [keyword text] { [variable &quot;text&quot;] } },",
      "          [def&variable fn:doc]()[[ [qualifier child::][variable eq][keyword /]([variable @bar] [keyword |] [qualifier attribute::][variable attribute]) [keyword eq] [variable $let] ]],",
      "          [keyword //][variable fn:doc]",
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/xquery.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/xquery.js.js
index 75dcbee3eae7bd8ef02e9a7721695bcc8ed12956..f5db831c1cb73bed4fb026666b18937bb8e0527d 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/xquery.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/xquery/xquery.js.js
@@ -19,41 +19,52 @@ CodeMirror.defineMode("xquery", function() {
   var keywords = function(){
     // convenience functions used to build keywords object
     function kw(type) {return {type: type, style: "keyword"};}
-    var A = kw("keyword a")
-      , B = kw("keyword b")
-      , C = kw("keyword c")
-      , operator = kw("operator")
+    var operator = kw("operator")
       , atom = {type: "atom", style: "atom"}
       , punctuation = {type: "punctuation", style: null}
       , qualifier = {type: "axis_specifier", style: "qualifier"};
 
     // kwObj is what is return from this function at the end
     var kwObj = {
-      'if': A, 'switch': A, 'while': A, 'for': A,
-      'else': B, 'then': B, 'try': B, 'finally': B, 'catch': B,
-      'element': C, 'attribute': C, 'let': C, 'implements': C, 'import': C, 'module': C, 'namespace': C,
-      'return': C, 'super': C, 'this': C, 'throws': C, 'where': C, 'private': C,
-      ',': punctuation,
-      'null': atom, 'fn:false()': atom, 'fn:true()': atom
+      ',': punctuation
     };
 
     // a list of 'basic' keywords. For each add a property to kwObj with the value of
     // {type: basic[i], style: "keyword"} e.g. 'after' --> {type: "after", style: "keyword"}
-    var basic = ['after','ancestor','ancestor-or-self','and','as','ascending','assert','attribute','before',
-    'by','case','cast','child','comment','declare','default','define','descendant','descendant-or-self',
-    'descending','document','document-node','element','else','eq','every','except','external','following',
-    'following-sibling','follows','for','function','if','import','in','instance','intersect','item',
-    'let','module','namespace','node','node','of','only','or','order','parent','precedes','preceding',
-    'preceding-sibling','processing-instruction','ref','return','returns','satisfies','schema','schema-element',
-    'self','some','sortby','stable','text','then','to','treat','typeswitch','union','variable','version','where',
-    'xquery', 'empty-sequence'];
+    var basic = ['after', 'all', 'allowing', 'ancestor', 'ancestor-or-self', 'any', 'array', 'as',
+    'ascending', 'at', 'attribute', 'base-uri', 'before', 'boundary-space', 'by', 'case', 'cast',
+    'castable', 'catch', 'child', 'collation', 'comment', 'construction', 'contains', 'content',
+    'context', 'copy', 'copy-namespaces', 'count', 'decimal-format', 'declare', 'default', 'delete',
+    'descendant', 'descendant-or-self', 'descending', 'diacritics', 'different', 'distance',
+    'document', 'document-node', 'element', 'else', 'empty', 'empty-sequence', 'encoding', 'end',
+    'entire', 'every', 'exactly', 'except', 'external', 'first', 'following', 'following-sibling',
+    'for', 'from', 'ftand', 'ftnot', 'ft-option', 'ftor', 'function', 'fuzzy', 'greatest', 'group',
+    'if', 'import', 'in', 'inherit', 'insensitive', 'insert', 'instance', 'intersect', 'into',
+    'invoke', 'is', 'item', 'language', 'last', 'lax', 'least', 'let', 'levels', 'lowercase', 'map',
+    'modify', 'module', 'most', 'namespace', 'next', 'no', 'node', 'nodes', 'no-inherit',
+    'no-preserve', 'not', 'occurs', 'of', 'only', 'option', 'order', 'ordered', 'ordering',
+    'paragraph', 'paragraphs', 'parent', 'phrase', 'preceding', 'preceding-sibling', 'preserve',
+    'previous', 'processing-instruction', 'relationship', 'rename', 'replace', 'return',
+    'revalidation', 'same', 'satisfies', 'schema', 'schema-attribute', 'schema-element', 'score',
+    'self', 'sensitive', 'sentence', 'sentences', 'sequence', 'skip', 'sliding', 'some', 'stable',
+    'start', 'stemming', 'stop', 'strict', 'strip', 'switch', 'text', 'then', 'thesaurus', 'times',
+    'to', 'transform', 'treat', 'try', 'tumbling', 'type', 'typeswitch', 'union', 'unordered',
+    'update', 'updating', 'uppercase', 'using', 'validate', 'value', 'variable', 'version',
+    'weight', 'when', 'where', 'wildcards', 'window', 'with', 'without', 'word', 'words', 'xquery'];
     for(var i=0, l=basic.length; i < l; i++) { kwObj[basic[i]] = kw(basic[i]);};
 
     // a list of types. For each add a property to kwObj with the value of
     // {type: "atom", style: "atom"}
-    var types = ['xs:string', 'xs:float', 'xs:decimal', 'xs:double', 'xs:integer', 'xs:boolean', 'xs:date', 'xs:dateTime',
-    'xs:time', 'xs:duration', 'xs:dayTimeDuration', 'xs:time', 'xs:yearMonthDuration', 'numeric', 'xs:hexBinary',
-    'xs:base64Binary', 'xs:anyURI', 'xs:QName', 'xs:byte','xs:boolean','xs:anyURI','xf:yearMonthDuration'];
+    var types = ['xs:anyAtomicType', 'xs:anySimpleType', 'xs:anyType', 'xs:anyURI',
+    'xs:base64Binary', 'xs:boolean', 'xs:byte', 'xs:date', 'xs:dateTime', 'xs:dateTimeStamp',
+    'xs:dayTimeDuration', 'xs:decimal', 'xs:double', 'xs:duration', 'xs:ENTITIES', 'xs:ENTITY',
+    'xs:float', 'xs:gDay', 'xs:gMonth', 'xs:gMonthDay', 'xs:gYear', 'xs:gYearMonth', 'xs:hexBinary',
+    'xs:ID', 'xs:IDREF', 'xs:IDREFS', 'xs:int', 'xs:integer', 'xs:item', 'xs:java', 'xs:language',
+    'xs:long', 'xs:Name', 'xs:NCName', 'xs:negativeInteger', 'xs:NMTOKEN', 'xs:NMTOKENS',
+    'xs:nonNegativeInteger', 'xs:nonPositiveInteger', 'xs:normalizedString', 'xs:NOTATION',
+    'xs:numeric', 'xs:positiveInteger', 'xs:precisionDecimal', 'xs:QName', 'xs:short', 'xs:string',
+    'xs:time', 'xs:token', 'xs:unsignedByte', 'xs:unsignedInt', 'xs:unsignedLong',
+    'xs:unsignedShort', 'xs:untyped', 'xs:untypedAtomic', 'xs:yearMonthDuration'];
     for(var i=0, l=types.length; i < l; i++) { kwObj[types[i]] = atom;};
 
     // each operator will add a property to kwObj with value of {type: "operator", style: "keyword"}
@@ -102,7 +113,7 @@ CodeMirror.defineMode("xquery", function() {
     }
     // start code block
     else if(ch == "{") {
-      pushStateStack(state,{ type: "codeblock"});
+      pushStateStack(state, { type: "codeblock"});
       return null;
     }
     // end code block
@@ -132,7 +143,7 @@ CodeMirror.defineMode("xquery", function() {
       return chain(stream, state, tokenComment);
     }
     // quoted string
-    else if (  !isEQName && (ch === '"' || ch === "'"))
+    else if (!isEQName && (ch === '"' || ch === "'"))
       return chain(stream, state, tokenString(ch));
     // variable
     else if(ch === "$") {
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/index.html.html
deleted file mode 100644
index 8e52cafb100091606603ed093dca5ad10956bae9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/index.html.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: yacas mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel=stylesheet href=../../lib/codemirror.css>
-<script src=../../lib/codemirror.js></script>
-<script src=../../addon/edit/matchbrackets.js></script>
-<script src=yacas.js></script>
-<style type=text/css>
-  .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
-</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">yacas</a>
-  </ul>
-</div>
-
-<article>
-<h2>yacas mode</h2>
-
-
-<textarea id="yacasCode">
-// example yacas code
-Graph(edges_IsList) <-- [
-    Local(v, e, f, t);
-
-    vertices := {};
-
-    ForEach (e, edges) [
-        If (IsList(e), e := Head(e));
-        {f, t} := Tail(Listify(e));
-
-        DestructiveAppend(vertices, f);
-        DestructiveAppend(vertices, t);
-    ];
-
-    Graph(RemoveDuplicates(vertices), edges);
-];
-
-10 # IsGraph(Graph(vertices_IsList, edges_IsList)) <-- True;
-20 # IsGraph(_x) <-- False;
-
-Edges(Graph(vertices_IsList, edges_IsList)) <-- edges;
-Vertices(Graph(vertices_IsList, edges_IsList)) <-- vertices;
-
-AdjacencyList(g_IsGraph) <-- [
-    Local(l, vertices, edges, e, op, f, t);
-
-    l := Association'Create();
-
-    vertices := Vertices(g);
-    ForEach (v, vertices)
-        Association'Set(l, v, {});
-
-    edges := Edges(g);
-
-    ForEach(e, edges) [
-        If (IsList(e), e := Head(e));
-        {op, f, t} := Listify(e);
-        DestructiveAppend(Association'Get(l, f), t);
-        If (String(op) = "<->", DestructiveAppend(Association'Get(l, t), f));
-    ];
-
-    l;
-];
-</textarea>
-
-<script>
-  var yacasEditor = CodeMirror.fromTextArea(document.getElementById('yacasCode'), {
-    mode: 'text/x-yacas',
-    lineNumbers: true,
-    matchBrackets: true
-  });
-</script>
-
-<p><strong>MIME types defined:</strong> <code>text/x-yacas</code> (yacas).</p>
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/yacas.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/yacas.js.js
index 30bd60b2ffadf340ac753a2406e7c38b1190947e..34c84fbd08b9320b88834b27e26fdb81d19f4751 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/yacas.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yacas/yacas.js.js
@@ -125,7 +125,7 @@ CodeMirror.defineMode('yacas', function(_config, _parserConfig) {
     }
 
     // operators; note that operators like @@ or /; are matched separately for each symbol.
-    if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%)/, true, false)) {
+    if (stream.match(/(?:\\|\+|\-|\*|\/|,|;|\.|:|@|~|=|>|<|&|\||_|`|'|\^|\?|!|%|#)/, true, false)) {
       return 'operator';
     }
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml-frontmatter/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml-frontmatter/index.html.html
deleted file mode 100644
index 30cb294e806c782c2bde781ff4b74d423e44602e..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml-frontmatter/index.html.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: YAML front matter mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="../../addon/mode/overlay.js"></script>
-<script src="../markdown/markdown.js"></script>
-<script src="../gfm/gfm.js"></script>
-<script src="../yaml/yaml.js"></script>
-<script src="yaml-frontmatter.js"></script>
-<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">YAML-Frontmatter</a>
-  </ul>
-</div>
-
-<article>
-<h2>YAML front matter mode</h2>
-<form><textarea id="code" name="code">
----
-receipt:     Oz-Ware Purchase Invoice
-date:        2007-08-06
-customer:
-    given:   Dorothy
-    family:  Gale
-
-items:
-    - part_no:   A4786
-      descrip:   Water Bucket (Filled)
-      price:     1.47
-      quantity:  4
-
-    - part_no:   E1628
-      descrip:   High Heeled "Ruby" Slippers
-      size:       8
-      price:     100.27
-      quantity:  1
-
-bill-to:  &id001
-    street: |
-            123 Tornado Alley
-            Suite 16
-    city:   East Centerville
-    state:  KS
-
-ship-to:  *id001
-
-specialDelivery:  >
-    Follow the Yellow Brick
-    Road to the Emerald City.
-    Pay no attention to the
-    man behind the curtain.
----
-
-GitHub Flavored Markdown
-========================
-
-Everything from markdown plus GFM features:
-
-## URL autolinking
-
-Underscores_are_allowed_between_words.
-
-## Strikethrough text
-
-GFM adds syntax to strikethrough text, which is missing from standard Markdown.
-
-~~Mistaken text.~~
-~~**works with other formatting**~~
-
-~~spans across
-lines~~
-
-## Fenced code blocks (and syntax highlighting)
-
-```javascript
-for (var i = 0; i &lt; items.length; i++) {
-    console.log(items[i], i); // log them
-}
-```
-
-## Task Lists
-
-- [ ] Incomplete task list item
-- [x] **Completed** task list item
-
-## A bit of GitHub spice
-
-* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
-* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
-* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
-* \#Num: #1
-* User/#Num: mojombo#1
-* User/Project#Num: mojombo/god#1
-
-See http://github.github.com/github-flavored-markdown/.
-</textarea></form>
-
-<p>Defines a mode that parses
-a <a href="http://jekyllrb.com/docs/frontmatter/">YAML frontmatter</a>
-at the start of a file, switching to a base mode at the end of that.
-Takes a mode configuration option <code>base</code> to configure the
-base mode, which defaults to <code>"gfm"</code>.</p>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {mode: "yaml-frontmatter"});
-    </script>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml-frontmatter/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml-frontmatter/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml-frontmatter/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/index.html.html
deleted file mode 100644
index be9b632368ffcf747ed4d50238dc514316183ebe..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/index.html.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: YAML mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="yaml.js"></script>
-<style>.CodeMirror { border-top: 1px solid #ddd; border-bottom: 1px solid #ddd; }</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">YAML</a>
-  </ul>
-</div>
-
-<article>
-<h2>YAML mode</h2>
-<form><textarea id="code" name="code">
---- # Favorite movies
-- Casablanca
-- North by Northwest
-- The Man Who Wasn't There
---- # Shopping list
-[milk, pumpkin pie, eggs, juice]
---- # Indented Blocks, common in YAML data files, use indentation and new lines to separate the key: value pairs
-  name: John Smith
-  age: 33
---- # Inline Blocks, common in YAML data streams, use commas to separate the key: value pairs between braces
-{name: John Smith, age: 33}
----
-receipt:     Oz-Ware Purchase Invoice
-date:        2007-08-06
-customer:
-    given:   Dorothy
-    family:  Gale
-
-items:
-    - part_no:   A4786
-      descrip:   Water Bucket (Filled)
-      price:     1.47
-      quantity:  4
-
-    - part_no:   E1628
-      descrip:   High Heeled "Ruby" Slippers
-      size:       8
-      price:     100.27
-      quantity:  1
-
-bill-to:  &id001
-    street: |
-            123 Tornado Alley
-            Suite 16
-    city:   East Centerville
-    state:  KS
-
-ship-to:  *id001
-
-specialDelivery:  >
-    Follow the Yellow Brick
-    Road to the Emerald City.
-    Pay no attention to the
-    man behind the curtain.
-...
-</textarea></form>
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {});
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-yaml</code>.</p>
-
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/yaml.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/yaml.js.js
index 59c0ecdbec9c7d0748f75e23f553f16d03667827..f35a40130aa2abc19f9b42ed0795c9971075f90e 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/yaml.js.js
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/yaml/yaml.js.js
@@ -108,7 +108,8 @@ CodeMirror.defineMode("yaml", function() {
         literal: false,
         escaped: false
       };
-    }
+    },
+    lineComment: "#"
   };
 });
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/z80/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/z80/index.html.html
deleted file mode 100644
index a41b7473e259777792b7f9fd9968720aa6799f85..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/z80/index.html.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!doctype html>
-
-<title>CodeMirror: Z80 assembly mode</title>
-<meta charset="utf-8"/>
-<link rel=stylesheet href="../../doc/docs.css">
-
-<link rel="stylesheet" href="../../lib/codemirror.css">
-<script src="../../lib/codemirror.js"></script>
-<script src="z80.js"></script>
-<style type="text/css">.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}</style>
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../../index.html">Home</a>
-    <li><a href="../../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a href="../index.html">Language modes</a>
-    <li><a class=active href="#">Z80 assembly</a>
-  </ul>
-</div>
-
-<article>
-<h2>Z80 assembly mode</h2>
-
-
-<div><textarea id="code" name="code">
-#include    "ti83plus.inc"
-#define     progStart   $9D95
-    .org progStart-2
-    .db $BB,$6D
-
-    bcall(_ClrLCDFull)
-    ld hl,0
-    ld (CurCol),hl
-    ld hl,Message
-    bcall(_PutS) ; Displays the string
-    bcall(_NewLine)
-    ret
-Message:
-    .db "Hello world!",0
-</textarea></div>
-
-    <script>
-      var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
-        lineNumbers: true
-      });
-    </script>
-
-    <p><strong>MIME types defined:</strong> <code>text/x-z80</code>, <code>text/x-ez80</code>.</p>
-  </article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/z80/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/z80/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/mode/z80/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/package.json.json b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/package.json.json
deleted file mode 100644
index 487b2ddb409a329c2d21743a4be3cebe675806d6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/package.json.json
+++ /dev/null
@@ -1,48 +0,0 @@
-{
-  "name": "codemirror",
-  "version": "5.24.2",
-  "main": "lib/codemirror.js",
-  "description": "Full-featured in-browser code editor",
-  "license": "MIT",
-  "directories": {
-    "lib": "./lib"
-  },
-  "scripts": {
-    "build": "rollup -c",
-    "watch": "rollup -w -c",
-    "prepublish": "npm run-script build",
-    "test": "node ./test/run.js",
-    "lint": "bin/lint"
-  },
-  "devDependencies": {
-    "blint": "^0.5.1",
-    "node-static": "0.6.0",
-    "phantomjs-prebuilt": "^2.1.12",
-    "rollup": "^0.34.10",
-    "rollup-plugin-buble": "^0.15.0",
-    "rollup-watch": "^2.5.0"
-  },
-  "bugs": "http://github.com/codemirror/CodeMirror/issues",
-  "keywords": [
-    "JavaScript",
-    "CodeMirror",
-    "Editor"
-  ],
-  "homepage": "http://codemirror.net",
-  "maintainers": [
-    {
-      "name": "Marijn Haverbeke",
-      "email": "marijnh@gmail.com",
-      "web": "http://marijnhaverbeke.nl"
-    }
-  ],
-  "repository": {
-    "type": "git",
-    "url": "https://github.com/codemirror/CodeMirror.git"
-  },
-  "jspm": {
-    "directories": {},
-    "dependencies": {},
-    "devDependencies": {}
-  }
-}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/package.json.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/package.json.xml
deleted file mode 100644
index c1e69234b1b946dd7b698d4f9d729e807e040d43..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/package.json.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>package.json</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/json</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/rollup.config.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/rollup.config.js.js
deleted file mode 100644
index 9a17b24ff74d57418c18173e91083a8cdab22c8b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/rollup.config.js.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import buble from 'rollup-plugin-buble';
-
-export default {
-  banner: `// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-// This is CodeMirror (http://codemirror.net), a code editor
-// implemented in JavaScript on top of the browser's DOM.
-//
-// You can find some technical background for some of the code below
-// at http://marijnhaverbeke.nl/blog/#cm-internals .
-`,
-  entry: "src/codemirror.js",
-  format: "umd",
-  dest: "lib/codemirror.js",
-  moduleName: "CodeMirror",
-  plugins: [ buble({namedFunctionExpressions: false}) ]
-};
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/rollup.config.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/rollup.config.js.xml
deleted file mode 100644
index 5f0a9e1a65f9ae98555c6d1ae4dd908a40451b52..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/rollup.config.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>rollup.config.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test.xml
deleted file mode 100644
index fe70bd656879a4db29376ce7e29c937357c36920..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="Folder" module="OFS.Folder"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_objects</string> </key>
-            <value>
-              <tuple/>
-            </value>
-        </item>
-        <item>
-            <key> <string>id</string> </key>
-            <value> <string>test</string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/comment_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/comment_test.js.js
deleted file mode 100644
index c6b9fe810960534b69be576d24835e38869541af..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/comment_test.js.js
+++ /dev/null
@@ -1,114 +0,0 @@
-namespace = "comment_";
-
-(function() {
-  function test(name, mode, run, before, after) {
-    return testCM(name, function(cm) {
-      run(cm);
-      eq(cm.getValue(), after);
-    }, {value: before, mode: mode});
-  }
-
-  var simpleProg = "function foo() {\n  return bar;\n}";
-  var inlineBlock = "foo(/* bar */ true);";
-  var inlineBlocks = "foo(/* bar */ true, /* baz */ false);";
-  var multiLineInlineBlock = ["above();", "foo(/* bar */ true);", "below();"];
-
-  test("block", "javascript", function(cm) {
-    cm.blockComment(Pos(0, 3), Pos(3, 0), {blockCommentLead: " *"});
-  }, simpleProg + "\n", "/* function foo() {\n *   return bar;\n * }\n */");
-
-  test("blockToggle", "javascript", function(cm) {
-    cm.blockComment(Pos(0, 3), Pos(2, 0), {blockCommentLead: " *"});
-    cm.uncomment(Pos(0, 3), Pos(2, 0), {blockCommentLead: " *"});
-  }, simpleProg, simpleProg);
-
-  test("blockToggle2", "javascript", function(cm) {
-    cm.setCursor({line: 0, ch: 7 /* inside the block comment */});
-    cm.execCommand("toggleComment");
-  }, inlineBlock, "foo(bar true);");
-
-  // This test should work but currently fails.
-  // test("blockToggle3", "javascript", function(cm) {
-  //   cm.setCursor({line: 0, ch: 7 /* inside the first block comment */});
-  //   cm.execCommand("toggleComment");
-  // }, inlineBlocks, "foo(bar true, /* baz */ false);");
-
-  test("line", "javascript", function(cm) {
-    cm.lineComment(Pos(1, 1), Pos(1, 1));
-  }, simpleProg, "function foo() {\n//   return bar;\n}");
-
-  test("lineToggle", "javascript", function(cm) {
-    cm.lineComment(Pos(0, 0), Pos(2, 1));
-    cm.uncomment(Pos(0, 0), Pos(2, 1));
-  }, simpleProg, simpleProg);
-
-  test("fallbackToBlock", "css", function(cm) {
-    cm.lineComment(Pos(0, 0), Pos(2, 1));
-  }, "html {\n  border: none;\n}", "/* html {\n  border: none;\n} */");
-
-  test("fallbackToLine", "ruby", function(cm) {
-    cm.blockComment(Pos(0, 0), Pos(1));
-  }, "def blah()\n  return hah\n", "# def blah()\n#   return hah\n");
-
-  test("ignoreExternalBlockComments", "javascript", function(cm) {
-    cm.execCommand("toggleComment");
-  }, inlineBlocks, "// " + inlineBlocks);
-
-  test("ignoreExternalBlockComments2", "javascript", function(cm) {
-    cm.setCursor({line: 0, ch: null /* eol */});
-    cm.execCommand("toggleComment");
-  }, inlineBlocks, "// " + inlineBlocks);
-
-  test("ignoreExternalBlockCommentsMultiLineAbove", "javascript", function(cm) {
-    cm.setSelection({line: 0, ch: 0}, {line: 1, ch: 1});
-    cm.execCommand("toggleComment");
-  }, multiLineInlineBlock.join("\n"), ["// " + multiLineInlineBlock[0],
-                                       "// " + multiLineInlineBlock[1],
-                                       multiLineInlineBlock[2]].join("\n"));
-
-  test("ignoreExternalBlockCommentsMultiLineBelow", "javascript", function(cm) {
-    cm.setSelection({line: 1, ch: 13 /* after end of block comment */}, {line: 2, ch: 1});
-    cm.execCommand("toggleComment");
-  }, multiLineInlineBlock.join("\n"), [multiLineInlineBlock[0],
-                                       "// " + multiLineInlineBlock[1],
-                                       "// " + multiLineInlineBlock[2]].join("\n"));
-
-  test("commentRange", "javascript", function(cm) {
-    cm.blockComment(Pos(1, 2), Pos(1, 13), {fullLines: false});
-  }, simpleProg, "function foo() {\n  /*return bar;*/\n}");
-
-  test("indented", "javascript", function(cm) {
-    cm.lineComment(Pos(1, 0), Pos(2), {indent: true});
-  }, simpleProg, "function foo() {\n//   return bar;\n// }");
-
-  test("singleEmptyLine", "javascript", function(cm) {
-    cm.setCursor(1);
-    cm.execCommand("toggleComment");
-  }, "a;\n\nb;", "a;\n// \nb;");
-
-  test("dontMessWithStrings", "javascript", function(cm) {
-    cm.execCommand("toggleComment");
-  }, "console.log(\"/*string*/\");", "// console.log(\"/*string*/\");");
-
-  test("dontMessWithStrings2", "javascript", function(cm) {
-    cm.execCommand("toggleComment");
-  }, "console.log(\"// string\");", "// console.log(\"// string\");");
-
-  test("dontMessWithStrings3", "javascript", function(cm) {
-    cm.execCommand("toggleComment");
-  }, "// console.log(\"// string\");", "console.log(\"// string\");");
-
-  test("includeLastLine", "javascript", function(cm) {
-    cm.execCommand("selectAll")
-    cm.execCommand("toggleComment")
-  }, "// foo\n// bar\nbaz", "// // foo\n// // bar\n// baz")
-
-  test("uncommentWithTrailingBlockEnd", "xml", function(cm) {
-    cm.execCommand("toggleComment")
-  }, "<!-- foo --> -->", "foo -->")
-
-  test("dontCommentInComment", "xml", function(cm) {
-    cm.setCursor(1, 0)
-    cm.execCommand("toggleComment")
-  }, "<!-- foo\nbar -->", "<!-- foo\nbar -->")
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/comment_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/comment_test.js.xml
deleted file mode 100644
index 8cf2d2f6f6a32d363bd65de49f9bfd8243727f5f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/comment_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>comment_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/doc_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/doc_test.js.js
deleted file mode 100644
index 3af20ff98d6cc12ca94833e5bb9b9ca5283a1748..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/doc_test.js.js
+++ /dev/null
@@ -1,371 +0,0 @@
-(function() {
-  // A minilanguage for instantiating linked CodeMirror instances and Docs
-  function instantiateSpec(spec, place, opts) {
-    var names = {}, pos = 0, l = spec.length, editors = [];
-    while (spec) {
-      var m = spec.match(/^(\w+)(\*?)(?:='([^\']*)'|<(~?)(\w+)(?:\/(\d+)-(\d+))?)\s*/);
-      var name = m[1], isDoc = m[2], cur;
-      if (m[3]) {
-        cur = isDoc ? CodeMirror.Doc(m[3]) : CodeMirror(place, clone(opts, {value: m[3]}));
-      } else {
-        var other = m[5];
-        if (!names.hasOwnProperty(other)) {
-          names[other] = editors.length;
-          editors.push(CodeMirror(place, opts));
-        }
-        var doc = editors[names[other]].linkedDoc({
-          sharedHist: !m[4],
-          from: m[6] ? Number(m[6]) : null,
-          to: m[7] ? Number(m[7]) : null
-        });
-        cur = isDoc ? doc : CodeMirror(place, clone(opts, {value: doc}));
-      }
-      names[name] = editors.length;
-      editors.push(cur);
-      spec = spec.slice(m[0].length);
-    }
-    return editors;
-  }
-
-  function clone(obj, props) {
-    if (!obj) return;
-    clone.prototype = obj;
-    var inst = new clone();
-    if (props) for (var n in props) if (props.hasOwnProperty(n))
-      inst[n] = props[n];
-    return inst;
-  }
-
-  function eqAll(val) {
-    var end = arguments.length, msg = null;
-    if (typeof arguments[end-1] == "string")
-      msg = arguments[--end];
-    if (i == end) throw new Error("No editors provided to eqAll");
-    for (var i = 1; i < end; ++i)
-      eq(arguments[i].getValue(), val, msg)
-  }
-
-  function testDoc(name, spec, run, opts, expectFail) {
-    if (!opts) opts = {};
-
-    return test("doc_" + name, function() {
-      var place = document.getElementById("testground");
-      var editors = instantiateSpec(spec, place, opts);
-      var successful = false;
-
-      try {
-        run.apply(null, editors);
-        successful = true;
-      } finally {
-        if (!successful || verbose) {
-          place.style.visibility = "visible";
-        } else {
-          for (var i = 0; i < editors.length; ++i)
-            if (editors[i] instanceof CodeMirror)
-              place.removeChild(editors[i].getWrapperElement());
-        }
-      }
-    }, expectFail);
-  }
-
-  var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent);
-
-  function testBasic(a, b) {
-    eqAll("x", a, b);
-    a.setValue("hey");
-    eqAll("hey", a, b);
-    b.setValue("wow");
-    eqAll("wow", a, b);
-    a.replaceRange("u\nv\nw", Pos(0, 3));
-    b.replaceRange("i", Pos(0, 4));
-    b.replaceRange("j", Pos(2, 1));
-    eqAll("wowui\nv\nwj", a, b);
-  }
-
-  testDoc("basic", "A='x' B<A", testBasic);
-  testDoc("basicSeparate", "A='x' B<~A", testBasic);
-
-  testDoc("sharedHist", "A='ab\ncd\nef' B<A", function(a, b) {
-    a.replaceRange("x", Pos(0));
-    b.replaceRange("y", Pos(1));
-    a.replaceRange("z", Pos(2));
-    eqAll("abx\ncdy\nefz", a, b);
-    a.undo();
-    a.undo();
-    eqAll("abx\ncd\nef", a, b);
-    a.redo();
-    eqAll("abx\ncdy\nef", a, b);
-    b.redo();
-    eqAll("abx\ncdy\nefz", a, b);
-    a.undo(); b.undo(); a.undo(); a.undo();
-    eqAll("ab\ncd\nef", a, b);
-  }, null, ie_lt8);
-
-  testDoc("undoIntact", "A='ab\ncd\nef' B<~A", function(a, b) {
-    a.replaceRange("x", Pos(0));
-    b.replaceRange("y", Pos(1));
-    a.replaceRange("z", Pos(2));
-    a.replaceRange("q", Pos(0));
-    eqAll("abxq\ncdy\nefz", a, b);
-    a.undo();
-    a.undo();
-    eqAll("abx\ncdy\nef", a, b);
-    b.undo();
-    eqAll("abx\ncd\nef", a, b);
-    a.redo();
-    eqAll("abx\ncd\nefz", a, b);
-    a.redo();
-    eqAll("abxq\ncd\nefz", a, b);
-    a.undo(); a.undo(); a.undo(); a.undo();
-    eqAll("ab\ncd\nef", a, b);
-    b.redo();
-    eqAll("ab\ncdy\nef", a, b);
-  });
-
-  testDoc("undoConflict", "A='ab\ncd\nef' B<~A", function(a, b) {
-    a.replaceRange("x", Pos(0));
-    a.replaceRange("z", Pos(2));
-    // This should clear the first undo event in a, but not the second
-    b.replaceRange("y", Pos(0));
-    a.undo(); a.undo();
-    eqAll("abxy\ncd\nef", a, b);
-    a.replaceRange("u", Pos(2));
-    a.replaceRange("v", Pos(0));
-    // This should clear both events in a
-    b.replaceRange("w", Pos(0));
-    a.undo(); a.undo();
-    eqAll("abxyvw\ncd\nefu", a, b);
-  });
-
-  testDoc("doubleRebase", "A='ab\ncd\nef\ng' B<~A C<B", function(a, b, c) {
-    c.replaceRange("u", Pos(3));
-    a.replaceRange("", Pos(0, 0), Pos(1, 0));
-    c.undo();
-    eqAll("cd\nef\ng", a, b, c);
-  });
-
-  testDoc("undoUpdate", "A='ab\ncd\nef' B<~A", function(a, b) {
-    a.replaceRange("x", Pos(2));
-    b.replaceRange("u\nv\nw\n", Pos(0, 0));
-    a.undo();
-    eqAll("u\nv\nw\nab\ncd\nef", a, b);
-    a.redo();
-    eqAll("u\nv\nw\nab\ncd\nefx", a, b);
-    a.undo();
-    eqAll("u\nv\nw\nab\ncd\nef", a, b);
-    b.undo();
-    a.redo();
-    eqAll("ab\ncd\nefx", a, b);
-    a.undo();
-    eqAll("ab\ncd\nef", a, b);
-  });
-
-  testDoc("undoKeepRanges", "A='abcdefg' B<A", function(a, b) {
-    var m = a.markText(Pos(0, 1), Pos(0, 3), {className: "foo"});
-    b.replaceRange("x", Pos(0, 0));
-    eqCharPos(m.find().from, Pos(0, 2));
-    b.replaceRange("yzzy", Pos(0, 1), Pos(0));
-    eq(m.find(), null);
-    b.undo();
-    eqCharPos(m.find().from, Pos(0, 2));
-    b.undo();
-    eqCharPos(m.find().from, Pos(0, 1));
-  });
-
-  testDoc("longChain", "A='uv' B<A C<B D<C", function(a, b, c, d) {
-    a.replaceSelection("X");
-    eqAll("Xuv", a, b, c, d);
-    d.replaceRange("Y", Pos(0));
-    eqAll("XuvY", a, b, c, d);
-  });
-
-  testDoc("broadCast", "B<A C<A D<A E<A", function(a, b, c, d, e) {
-    b.setValue("uu");
-    eqAll("uu", a, b, c, d, e);
-    a.replaceRange("v", Pos(0, 1));
-    eqAll("uvu", a, b, c, d, e);
-  });
-
-  // A and B share a history, C and D share a separate one
-  testDoc("islands", "A='x\ny\nz' B<A C<~A D<C", function(a, b, c, d) {
-    a.replaceRange("u", Pos(0));
-    d.replaceRange("v", Pos(2));
-    b.undo();
-    eqAll("x\ny\nzv", a, b, c, d);
-    c.undo();
-    eqAll("x\ny\nz", a, b, c, d);
-    a.redo();
-    eqAll("xu\ny\nz", a, b, c, d);
-    d.redo();
-    eqAll("xu\ny\nzv", a, b, c, d);
-  });
-
-  testDoc("unlink", "B<A C<A D<B", function(a, b, c, d) {
-    a.setValue("hi");
-    b.unlinkDoc(a);
-    d.setValue("aye");
-    eqAll("hi", a, c);
-    eqAll("aye", b, d);
-    a.setValue("oo");
-    eqAll("oo", a, c);
-    eqAll("aye", b, d);
-  });
-
-  testDoc("bareDoc", "A*='foo' B*<A C<B", function(a, b, c) {
-    is(a instanceof CodeMirror.Doc);
-    is(b instanceof CodeMirror.Doc);
-    is(c instanceof CodeMirror);
-    eqAll("foo", a, b, c);
-    a.replaceRange("hey", Pos(0, 0), Pos(0));
-    c.replaceRange("!", Pos(0));
-    eqAll("hey!", a, b, c);
-    b.unlinkDoc(a);
-    b.setValue("x");
-    eqAll("x", b, c);
-    eqAll("hey!", a);
-  });
-
-  testDoc("swapDoc", "A='a' B*='b' C<A", function(a, b, c) {
-    var d = a.swapDoc(b);
-    d.setValue("x");
-    eqAll("x", c, d);
-    eqAll("b", a, b);
-  });
-
-  testDoc("docKeepsScroll", "A='x' B*='y'", function(a, b) {
-    addDoc(a, 200, 200);
-    a.scrollIntoView(Pos(199, 200));
-    var c = a.swapDoc(b);
-    a.swapDoc(c);
-    var pos = a.getScrollInfo();
-    is(pos.left > 0, "not at left");
-    is(pos.top > 0, "not at top");
-  });
-
-  testDoc("copyDoc", "A='u'", function(a) {
-    var copy = a.getDoc().copy(true);
-    a.setValue("foo");
-    copy.setValue("bar");
-    var old = a.swapDoc(copy);
-    eq(a.getValue(), "bar");
-    a.undo();
-    eq(a.getValue(), "u");
-    a.swapDoc(old);
-    eq(a.getValue(), "foo");
-    eq(old.historySize().undo, 1);
-    eq(old.copy(false).historySize().undo, 0);
-  });
-
-  testDoc("docKeepsMode", "A='1+1'", function(a) {
-    var other = CodeMirror.Doc("hi", "text/x-markdown");
-    a.setOption("mode", "text/javascript");
-    var old = a.swapDoc(other);
-    eq(a.getOption("mode"), "text/x-markdown");
-    eq(a.getMode().name, "markdown");
-    a.swapDoc(old);
-    eq(a.getOption("mode"), "text/javascript");
-    eq(a.getMode().name, "javascript");
-  });
-
-  testDoc("subview", "A='1\n2\n3\n4\n5' B<~A/1-3", function(a, b) {
-    eq(b.getValue(), "2\n3");
-    eq(b.firstLine(), 1);
-    b.setCursor(Pos(4));
-    eqCharPos(b.getCursor(), Pos(2, 1));
-    a.replaceRange("-1\n0\n", Pos(0, 0));
-    eq(b.firstLine(), 3);
-    eqCharPos(b.getCursor(), Pos(4, 1));
-    a.undo();
-    eqCharPos(b.getCursor(), Pos(2, 1));
-    b.replaceRange("oyoy\n", Pos(2, 0));
-    eq(a.getValue(), "1\n2\noyoy\n3\n4\n5");
-    b.undo();
-    eq(a.getValue(), "1\n2\n3\n4\n5");
-  });
-
-  testDoc("subviewEditOnBoundary", "A='11\n22\n33\n44\n55' B<~A/1-4", function(a, b) {
-    a.replaceRange("x\nyy\nz", Pos(0, 1), Pos(2, 1));
-    eq(b.firstLine(), 2);
-    eq(b.lineCount(), 2);
-    eq(b.getValue(), "z3\n44");
-    a.replaceRange("q\nrr\ns", Pos(3, 1), Pos(4, 1));
-    eq(b.firstLine(), 2);
-    eq(b.getValue(), "z3\n4q");
-    eq(a.getValue(), "1x\nyy\nz3\n4q\nrr\ns5");
-    a.execCommand("selectAll");
-    a.replaceSelection("!");
-    eqAll("!", a, b);
-  });
-
-
-  testDoc("sharedMarker", "A='ab\ncd\nef\ngh' B<A C<~A/1-2", function(a, b, c) {
-    var mark = b.markText(Pos(0, 1), Pos(3, 1),
-                          {className: "cm-searching", shared: true});
-    var found = a.findMarksAt(Pos(0, 2));
-    eq(found.length, 1);
-    eq(found[0], mark);
-    eq(c.findMarksAt(Pos(1, 1)).length, 1);
-    eqCharPos(mark.find().from, Pos(0, 1));
-    eqCharPos(mark.find().to, Pos(3, 1));
-    b.replaceRange("x\ny\n", Pos(0, 0));
-    eqCharPos(mark.find().from, Pos(2, 1));
-    eqCharPos(mark.find().to, Pos(5, 1));
-    var cleared = 0;
-    CodeMirror.on(mark, "clear", function() {++cleared;});
-    b.operation(function(){mark.clear();});
-    eq(a.findMarksAt(Pos(3, 1)).length, 0);
-    eq(b.findMarksAt(Pos(3, 1)).length, 0);
-    eq(c.findMarksAt(Pos(3, 1)).length, 0);
-    eq(mark.find(), null);
-    eq(cleared, 1);
-  });
-
-  testDoc("sharedMarkerCopy", "A='abcde'", function(a) {
-    var shared = a.markText(Pos(0, 1), Pos(0, 3), {shared: true});
-    var b = a.linkedDoc();
-    var found = b.findMarksAt(Pos(0, 2));
-    eq(found.length, 1);
-    eq(found[0], shared);
-    shared.clear();
-    eq(b.findMarksAt(Pos(0, 2)), 0);
-  });
-
-  testDoc("sharedMarkerDetach", "A='abcde' B<A C<B", function(a, b, c) {
-    var shared = a.markText(Pos(0, 1), Pos(0, 3), {shared: true});
-    a.unlinkDoc(b);
-    var inB = b.findMarksAt(Pos(0, 2));
-    eq(inB.length, 1);
-    is(inB[0] != shared);
-    var inC = c.findMarksAt(Pos(0, 2));
-    eq(inC.length, 1);
-    is(inC[0] != shared);
-    inC[0].clear();
-    is(shared.find());
-  });
-
-  testDoc("sharedBookmark", "A='ab\ncd\nef\ngh' B<A C<~A/1-2", function(a, b, c) {
-    var mark = b.setBookmark(Pos(1, 1), {shared: true});
-    var found = a.findMarksAt(Pos(1, 1));
-    eq(found.length, 1);
-    eq(found[0], mark);
-    eq(c.findMarksAt(Pos(1, 1)).length, 1);
-    eqCharPos(mark.find(), Pos(1, 1));
-    b.replaceRange("x\ny\n", Pos(0, 0));
-    eqCharPos(mark.find(), Pos(3, 1));
-    var cleared = 0;
-    CodeMirror.on(mark, "clear", function() {++cleared;});
-    b.operation(function() {mark.clear();});
-    eq(a.findMarks(Pos(0, 0), Pos(5)).length, 0);
-    eq(b.findMarks(Pos(0, 0), Pos(5)).length, 0);
-    eq(c.findMarks(Pos(0, 0), Pos(5)).length, 0);
-    eq(mark.find(), null);
-    eq(cleared, 1);
-  });
-
-  testDoc("undoInSubview", "A='line 0\nline 1\nline 2\nline 3\nline 4' B<A/1-4", function(a, b) {
-    b.replaceRange("x", Pos(2, 0));
-    a.undo();
-    eq(a.getValue(), "line 0\nline 1\nline 2\nline 3\nline 4");
-    eq(b.getValue(), "line 1\nline 2\nline 3");
-  });
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/doc_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/doc_test.js.xml
deleted file mode 100644
index 569e38c7c82a098491c6f01ea2e98180bd025a9f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/doc_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>doc_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/driver.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/driver.js.js
deleted file mode 100644
index 8789f73be9cd4aeff1507980b1a817ffecc56b95..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/driver.js.js
+++ /dev/null
@@ -1,142 +0,0 @@
-var tests = [], filters = [], allNames = [];
-
-function Failure(why) {this.message = why;}
-Failure.prototype.toString = function() { return this.message; };
-
-function indexOf(collection, elt) {
-  if (collection.indexOf) return collection.indexOf(elt);
-  for (var i = 0, e = collection.length; i < e; ++i)
-    if (collection[i] == elt) return i;
-  return -1;
-}
-
-function test(name, run, expectedFail) {
-  // Force unique names
-  var originalName = name;
-  var i = 2; // Second function would be NAME_2
-  while (indexOf(allNames, name) !== -1){
-    name = originalName + "_" + i;
-    i++;
-  }
-  allNames.push(name);
-  // Add test
-  tests.push({name: name, func: run, expectedFail: expectedFail});
-  return name;
-}
-var namespace = "";
-function testCM(name, run, opts, expectedFail) {
-  return test(namespace + name, function() {
-    var place = document.getElementById("testground"), cm = window.cm = CodeMirror(place, opts);
-    var successful = false;
-    try {
-      run(cm);
-      successful = true;
-    } finally {
-      if (!successful || verbose) {
-        place.style.visibility = "visible";
-      } else {
-        place.removeChild(cm.getWrapperElement());
-      }
-    }
-  }, expectedFail);
-}
-
-function runTests(callback) {
-  var totalTime = 0;
-  function step(i) {
-    for (;;) {
-      if (i === tests.length) {
-        running = false;
-        return callback("done");
-      }
-      var test = tests[i], skip = false;
-      if (filters.length) {
-        skip = true;
-        for (var j = 0; j < filters.length; j++)
-          if (test.name.match(filters[j])) skip = false;
-      }
-      if (skip) {
-        callback("skipped", test.name, message);
-        i++;
-      } else {
-        break;
-      }
-    }
-    var expFail = test.expectedFail, startTime = +new Date, threw = false;
-    try {
-      var message = test.func();
-    } catch(e) {
-      threw = true;
-      if (expFail) callback("expected", test.name);
-      else if (e instanceof Failure) callback("fail", test.name, e.message);
-      else {
-        var pos = /(?:\bat |@).*?([^\/:]+):(\d+)/.exec(e.stack);
-        if (pos) console["log"](e.stack);
-        callback("error", test.name, e.toString() + (pos ? " (" + pos[1] + ":" + pos[2] + ")" : ""));
-      }
-    }
-    if (!threw) {
-      if (expFail) callback("fail", test.name, message || "expected failure, but passed");
-      else callback("ok", test.name, message);
-    }
-    if (!quit) { // Run next test
-      var delay = 0;
-      totalTime += (+new Date) - startTime;
-      if (totalTime > 500){
-        totalTime = 0;
-        delay = 50;
-      }
-      setTimeout(function(){step(i + 1);}, delay);
-    } else { // Quit tests
-      running = false;
-      return null;
-    }
-  }
-  step(0);
-}
-
-function label(str, msg) {
-  if (msg) return str + " (" + msg + ")";
-  return str;
-}
-function eq(a, b, msg) {
-  if (a != b) throw new Failure(label(a + " != " + b, msg));
-}
-function near(a, b, margin, msg) {
-  if (Math.abs(a - b) > margin)
-    throw new Failure(label(a + " is not close to " + b + " (" + margin + ")", msg));
-}
-function eqCharPos(a, b, msg) {
-  function str(p) { return "{line:" + p.line + ",ch:" + p.ch + ",sticky:" + p.sticky + "}"; }
-  if (a == b) return;
-  if (a == null) throw new Failure(label("comparing null to " + str(b), msg));
-  if (b == null) throw new Failure(label("comparing " + str(a) + " to null", msg));
-  if (a.line != b.line || a.ch != b.ch) throw new Failure(label(str(a) + " != " + str(b), msg));
-}
-function eqCursorPos(a, b, msg) {
-  eqCharPos(a, b, msg);
-  if (a) eq(a.sticky, b.sticky, msg ? msg + ' (sticky)' : 'sticky');
-}
-function is(a, msg) {
-  if (!a) throw new Failure(label("assertion failed", msg));
-}
-
-function countTests() {
-  if (!filters.length) return tests.length;
-  var sum = 0;
-  for (var i = 0; i < tests.length; ++i) {
-    var name = tests[i].name;
-    for (var j = 0; j < filters.length; j++) {
-      if (name.match(filters[j])) {
-        ++sum;
-        break;
-      }
-    }
-  }
-  return sum;
-}
-
-function parseTestFilter(s) {
-  if (/_\*$/.test(s)) return new RegExp("^" + s.slice(0, s.length - 2), "i");
-  else return new RegExp(s, "i");
-}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/driver.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/driver.js.xml
deleted file mode 100644
index 3f4683f2b40857610d997f81c4e4f153cf0a2d9c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/driver.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>driver.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/emacs_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/emacs_test.js.js
deleted file mode 100644
index b73eedaa6a47c97595a6aa356537a3ebe26afbb9..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/emacs_test.js.js
+++ /dev/null
@@ -1,147 +0,0 @@
-(function() {
-  "use strict";
-
-  var Pos = CodeMirror.Pos;
-  namespace = "emacs_";
-
-  var eventCache = {};
-  function fakeEvent(keyName) {
-    var event = eventCache[key];
-    if (event) return event;
-
-    var ctrl, shift, alt;
-    var key = keyName.replace(/\w+-/g, function(type) {
-      if (type == "Ctrl-") ctrl = true;
-      else if (type == "Alt-") alt = true;
-      else if (type == "Shift-") shift = true;
-      return "";
-    });
-    var code;
-    for (var c in CodeMirror.keyNames)
-      if (CodeMirror.keyNames[c] == key) { code = c; break; }
-    if (code == null) throw new Error("Unknown key: " + key);
-
-    return eventCache[keyName] = {
-      type: "keydown", keyCode: code, ctrlKey: ctrl, shiftKey: shift, altKey: alt,
-      preventDefault: function(){}, stopPropagation: function(){}
-    };
-  }
-
-  function sim(name, start /*, actions... */) {
-    var keys = Array.prototype.slice.call(arguments, 2);
-    testCM(name, function(cm) {
-      for (var i = 0; i < keys.length; ++i) {
-        var cur = keys[i];
-        if (cur instanceof Pos) cm.setCursor(cur);
-        else if (cur.call) cur(cm);
-        else cm.triggerOnKeyDown(fakeEvent(cur));
-      }
-    }, {keyMap: "emacs", value: start, mode: "javascript"});
-  }
-
-  function at(line, ch, sticky) { return function(cm) { eqCursorPos(cm.getCursor(), Pos(line, ch, sticky)); }; }
-  function txt(str) { return function(cm) { eq(cm.getValue(), str); }; }
-
-  sim("motionHSimple", "abc", "Ctrl-F", "Ctrl-F", "Ctrl-B", at(0, 1, "after"));
-  sim("motionHMulti", "abcde",
-      "Ctrl-4", "Ctrl-F", at(0, 4, "before"), "Ctrl--", "Ctrl-2", "Ctrl-F", at(0, 2, "after"),
-      "Ctrl-5", "Ctrl-B", at(0, 0, "after"));
-
-  sim("motionHWord", "abc. def ghi",
-      "Alt-F", at(0, 3, "before"), "Alt-F", at(0, 8, "before"),
-      "Ctrl-B", "Alt-B", at(0, 5, "after"), "Alt-B", at(0, 0, "after"));
-  sim("motionHWordMulti", "abc. def ghi ",
-      "Ctrl-3", "Alt-F", at(0, 12, "before"), "Ctrl-2", "Alt-B", at(0, 5, "after"),
-      "Ctrl--", "Alt-B", at(0, 8, "before"));
-
-  sim("motionVSimple", "a\nb\nc\n", "Ctrl-N", "Ctrl-N", "Ctrl-P", at(1, 0, "after"));
-  sim("motionVMulti", "a\nb\nc\nd\ne\n",
-      "Ctrl-2", "Ctrl-N", at(2, 0, "after"), "Ctrl-F", "Ctrl--", "Ctrl-N", at(1, 1, "before"),
-      "Ctrl--", "Ctrl-3", "Ctrl-P", at(4, 1, "before"));
-
-  sim("killYank", "abc\ndef\nghi",
-      "Ctrl-F", "Ctrl-Space", "Ctrl-N", "Ctrl-N", "Ctrl-W", "Ctrl-E", "Ctrl-Y",
-      txt("ahibc\ndef\ng"));
-  sim("killRing", "abcdef",
-      "Ctrl-Space", "Ctrl-F", "Ctrl-W", "Ctrl-Space", "Ctrl-F", "Ctrl-W",
-      "Ctrl-Y", "Alt-Y",
-      txt("acdef"));
-  sim("copyYank", "abcd",
-      "Ctrl-Space", "Ctrl-E", "Alt-W", "Ctrl-Y",
-      txt("abcdabcd"));
-
-  sim("killLineSimple", "foo\nbar", "Ctrl-F", "Ctrl-K", txt("f\nbar"));
-  sim("killLineEmptyLine", "foo\n  \nbar", "Ctrl-N", "Ctrl-K", txt("foo\nbar"));
-  sim("killLineMulti", "foo\nbar\nbaz",
-      "Ctrl-F", "Ctrl-F", "Ctrl-K", "Ctrl-K", "Ctrl-K", "Ctrl-A", "Ctrl-Y",
-      txt("o\nbarfo\nbaz"));
-
-  sim("moveByParagraph", "abc\ndef\n\n\nhij\nklm\n\n",
-      "Ctrl-F", "Ctrl-Down", at(2, 0), "Ctrl-Down", at(6, 0),
-      "Ctrl-N", "Ctrl-Up", at(3, 0), "Ctrl-Up", at(0, 0),
-      Pos(1, 2), "Ctrl-Down", at(2, 0), Pos(4, 2), "Ctrl-Up", at(3, 0));
-  sim("moveByParagraphMulti", "abc\n\ndef\n\nhij\n\nklm",
-      "Ctrl-U", "2", "Ctrl-Down", at(3, 0),
-      "Shift-Alt-.", "Ctrl-3", "Ctrl-Up", at(1, 0));
-
-  sim("moveBySentence", "sentence one! sentence\ntwo\n\nparagraph two",
-      "Alt-E", at(0, 13), "Alt-E", at(1, 3), "Ctrl-F", "Alt-A", at(0, 13));
-
-  sim("moveByExpr", "function foo(a, b) {}",
-      "Ctrl-Alt-F", at(0, 8), "Ctrl-Alt-F", at(0, 12), "Ctrl-Alt-F", at(0, 18),
-      "Ctrl-Alt-B", at(0, 12), "Ctrl-Alt-B", at(0, 9));
-  sim("moveByExprMulti", "foo bar baz bug",
-      "Ctrl-2", "Ctrl-Alt-F", at(0, 7),
-      "Ctrl--", "Ctrl-Alt-F", at(0, 4),
-      "Ctrl--", "Ctrl-2", "Ctrl-Alt-B", at(0, 11));
-  sim("delExpr", "var x = [\n  a,\n  b\n  c\n];",
-      Pos(0, 8), "Ctrl-Alt-K", txt("var x = ;"), "Ctrl-/",
-      Pos(4, 1), "Ctrl-Alt-Backspace", txt("var x = ;"));
-  sim("delExprMulti", "foo bar baz",
-      "Ctrl-2", "Ctrl-Alt-K", txt(" baz"),
-      "Ctrl-/", "Ctrl-E", "Ctrl-2", "Ctrl-Alt-Backspace", txt("foo "));
-
-  sim("justOneSpace", "hi      bye  ",
-      Pos(0, 4), "Alt-Space", txt("hi bye  "),
-      Pos(0, 4), "Alt-Space", txt("hi b ye  "),
-      "Ctrl-A", "Alt-Space", "Ctrl-E", "Alt-Space", txt(" hi b ye "));
-
-  sim("openLine", "foo bar", "Alt-F", "Ctrl-O", txt("foo\n bar"))
-
-  sim("transposeChar", "abcd\ne",
-      "Ctrl-F", "Ctrl-T", "Ctrl-T", txt("bcad\ne"), at(0, 3),
-      "Ctrl-F", "Ctrl-T", "Ctrl-T", "Ctrl-T", txt("bcda\ne"), at(0, 4),
-      "Ctrl-F", "Ctrl-T", txt("bcde\na"), at(1, 1));
-
-  sim("manipWordCase", "foo BAR bAZ",
-      "Alt-C", "Alt-L", "Alt-U", txt("Foo bar BAZ"),
-      "Ctrl-A", "Alt-U", "Alt-L", "Alt-C", txt("FOO bar Baz"));
-  sim("manipWordCaseMulti", "foo Bar bAz",
-      "Ctrl-2", "Alt-U", txt("FOO BAR bAz"),
-      "Ctrl-A", "Ctrl-3", "Alt-C", txt("Foo Bar Baz"));
-
-  sim("upExpr", "foo {\n  bar[];\n  baz(blah);\n}",
-      Pos(2, 7), "Ctrl-Alt-U", at(2, 5), "Ctrl-Alt-U", at(0, 4));
-  sim("transposeExpr", "do foo[bar] dah",
-      Pos(0, 6), "Ctrl-Alt-T", txt("do [bar]foo dah"));
-
-  sim("clearMark", "abcde", Pos(0, 2), "Ctrl-Space", "Ctrl-F", "Ctrl-F",
-      "Ctrl-G", "Ctrl-W", txt("abcde"));
-
-  sim("delRegion", "abcde", "Ctrl-Space", "Ctrl-F", "Ctrl-F", "Delete", txt("cde"));
-  sim("backspaceRegion", "abcde", "Ctrl-Space", "Ctrl-F", "Ctrl-F", "Backspace", txt("cde"));
-
-  testCM("save", function(cm) {
-    var saved = false;
-    CodeMirror.commands.save = function(cm) { saved = cm.getValue(); };
-    cm.triggerOnKeyDown(fakeEvent("Ctrl-X"));
-    cm.triggerOnKeyDown(fakeEvent("Ctrl-S"));
-    is(saved, "hi");
-  }, {value: "hi", keyMap: "emacs"});
-
-  testCM("gotoInvalidLineFloat", function(cm) {
-    cm.openDialog = function(_, cb) { cb("2.2"); };
-    cm.triggerOnKeyDown(fakeEvent("Alt-G"));
-    cm.triggerOnKeyDown(fakeEvent("G"));
-  }, {value: "1\n2\n3\n4", keyMap: "emacs"});
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/emacs_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/emacs_test.js.xml
deleted file mode 100644
index 29b4ef5efdb205e450a0ecb4b9027a03d334e679..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/emacs_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>emacs_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/index.html.html b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/index.html.html
deleted file mode 100644
index 5a0b3d68bf2584c0ba9abe2294b8d5aae1eb4bbb..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/index.html.html
+++ /dev/null
@@ -1,266 +0,0 @@
-<!doctype html>
-
-<meta charset="utf-8"/>
-<title>CodeMirror: Test Suite</title>
-<link rel=stylesheet href="../doc/docs.css">
-
-<link rel="stylesheet" href="../lib/codemirror.css">
-<link rel="stylesheet" href="mode_test.css">
-<script src="../doc/activebookmark.js"></script>
-<script src="../lib/codemirror.js"></script>
-<script src="../mode/meta.js"></script>
-<script src="../addon/mode/overlay.js"></script>
-<script src="../addon/mode/multiplex.js"></script>
-<script src="../addon/search/searchcursor.js"></script>
-<script src="../addon/dialog/dialog.js"></script>
-<script src="../addon/edit/matchbrackets.js"></script>
-<script src="../addon/hint/sql-hint.js"></script>
-<script src="../addon/comment/comment.js"></script>
-<script src="../addon/mode/simple.js"></script>
-<script src="../mode/css/css.js"></script>
-<script src="../mode/clike/clike.js"></script>
-<!-- clike must be after css or vim and sublime tests will fail -->
-<script src="../mode/cypher/cypher.js"></script>
-<script src="../mode/gfm/gfm.js"></script>
-<script src="../mode/haml/haml.js"></script>
-<script src="../mode/htmlmixed/htmlmixed.js"></script>
-<script src="../mode/javascript/javascript.js"></script>
-<script src="../mode/jsx/jsx.js"></script>
-<script src="../mode/markdown/markdown.js"></script>
-<script src="../mode/php/php.js"></script>
-<script src="../mode/python/python.js"></script>
-<script src="../mode/powershell/powershell.js"></script>
-<script src="../mode/ruby/ruby.js"></script>
-<script src="../mode/sass/sass.js"></script>
-<script src="../mode/shell/shell.js"></script>
-<script src="../mode/slim/slim.js"></script>
-<script src="../mode/soy/soy.js"></script>
-<script src="../mode/sql/sql.js"></script>
-<script src="../mode/stex/stex.js"></script>
-<script src="../mode/swift/swift.js"></script>
-<script src="../mode/textile/textile.js"></script>
-<script src="../mode/verilog/verilog.js"></script>
-<script src="../mode/xml/xml.js"></script>
-<script src="../mode/xquery/xquery.js"></script>
-<script src="../keymap/emacs.js"></script>
-<script src="../keymap/sublime.js"></script>
-<script src="../keymap/vim.js"></script>
-<script src="../mode/rust/rust.js"></script>
-<script src="../mode/mscgen/mscgen.js"></script>
-<script src="../mode/dylan/dylan.js"></script>
-
-<style type="text/css">
-  .ok {color: #090;}
-  .fail {color: #e00;}
-  .error {color: #c90;}
-  .done {font-weight: bold;}
-  #progress {
-  background: #45d;
-  color: white;
-  text-shadow: 0 0 1px #45d, 0 0 2px #45d, 0 0 3px #45d;
-  font-weight: bold;
-  white-space: pre;
-  }
-  #testground {
-  visibility: hidden;
-  }
-  #testground.offscreen {
-  visibility: visible;
-  position: absolute;
-  left: -10000px;
-  top: -10000px;
-  }
-  .CodeMirror { border: 1px solid black; }
-</style>
-
-<div id=nav>
-  <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
-
-  <ul>
-    <li><a href="../index.html">Home</a>
-    <li><a href="../doc/manual.html">Manual</a>
-    <li><a href="https://github.com/codemirror/codemirror">Code</a>
-  </ul>
-  <ul>
-    <li><a class=active href="#">Test suite</a>
-  </ul>
-</div>
-
-<article>
-  <h2>Test Suite</h2>
-
-    <p>A limited set of programmatic sanity tests for CodeMirror.</p>
-
-    <div style="border: 1px solid black; padding: 1px; max-width: 700px;">
-      <div style="width: 0px;" id=progress><div style="padding: 3px;">Ran <span id="progress_ran">0</span><span id="progress_total"> of 0</span> tests</div></div>
-    </div>
-    <p id=status>Please enable JavaScript...</p>
-    <div id=output></div>
-
-    <div id=testground></div>
-
-    <script src="driver.js"></script>
-    <script src="test.js"></script>
-    <script src="doc_test.js"></script>
-    <script src="multi_test.js"></script>
-    <script src="scroll_test.js"></script>
-    <script src="comment_test.js"></script>
-    <script src="search_test.js"></script>
-    <script src="mode_test.js"></script>
-
-    <script src="../mode/clike/test.js"></script>
-    <script src="../mode/css/test.js"></script>
-    <script src="../mode/css/gss_test.js"></script>
-    <script src="../mode/css/scss_test.js"></script>
-    <script src="../mode/css/less_test.js"></script>
-    <script src="../mode/cypher/test.js"></script>
-    <script src="../mode/gfm/test.js"></script>
-    <script src="../mode/haml/test.js"></script>
-    <script src="../mode/javascript/test.js"></script>
-    <script src="../mode/jsx/test.js"></script>
-    <script src="../mode/markdown/test.js"></script>
-    <script src="../mode/php/test.js"></script>
-    <script src="../mode/powershell/test.js"></script>
-    <script src="../mode/ruby/test.js"></script>
-    <script src="../mode/sass/test.js"></script>
-    <script src="../mode/shell/test.js"></script>
-    <script src="../mode/slim/test.js"></script>
-    <script src="../mode/soy/test.js"></script>
-    <script src="../mode/stex/test.js"></script>
-    <script src="../mode/swift/test.js"></script>
-    <script src="../mode/textile/test.js"></script>
-    <script src="../mode/verilog/test.js"></script>
-    <script src="../mode/xml/test.js"></script>
-    <script src="../mode/xquery/test.js"></script>
-    <script src="../mode/python/test.js"></script>
-    <script src="../mode/rust/test.js"></script>
-    <script src="../mode/mscgen/mscgen_test.js"></script>
-    <script src="../mode/mscgen/xu_test.js"></script>
-    <script src="../mode/mscgen/msgenny_test.js"></script>
-    <script src="../mode/dylan/test.js"></script>
-    <script src="../addon/mode/multiplex_test.js"></script>
-    <script src="emacs_test.js"></script>
-    <script src="sql-hint-test.js"></script>
-    <script src="sublime_test.js"></script>
-    <script src="vim_test.js"></script>
-    <script>
-      window.onload = runHarness;
-      CodeMirror.on(window, 'hashchange', runHarness);
-
-      function esc(str) {
-        return str.replace(/[<&]/, function(ch) { return ch == "<" ? "&lt;" : "&amp;"; });
-      }
-
-      var output = document.getElementById("output"),
-          progress = document.getElementById("progress"),
-          progressRan = document.getElementById("progress_ran").childNodes[0],
-          progressTotal = document.getElementById("progress_total").childNodes[0];
-      var count = 0,
-          failed = 0,
-          skipped = 0,
-          bad = "",
-          running = false, // Flag that states tests are running
-          quit = false, // Flag to quit tests ASAP
-          verbose = false; // Adds message for *every* test to output
-
-      function runHarness(){
-        if (running) {
-          quit = true;
-          setStatus("Restarting tests...", '', true);
-          setTimeout(function(){runHarness();}, 500);
-          return;
-        }
-        filters = [];
-        verbose = false;
-        if (window.location.hash.substr(1)){
-          var strings = window.location.hash.substr(1).split(",");
-          while (strings.length) {
-            var s = strings.shift();
-            if (s === "verbose")
-              verbose = true;
-            else
-              filters.push(parseTestFilter(decodeURIComponent(s)));
-          }
-        }
-        quit = false;
-        running = true;
-        setStatus("Loading tests...");
-        count = 0;
-        failed = 0;
-        skipped = 0;
-        bad = "";
-        totalTests = countTests();
-        progressTotal.nodeValue = " of " + totalTests;
-        progressRan.nodeValue = count;
-        output.innerHTML = '';
-        document.getElementById("testground").innerHTML = "<form>" +
-          "<textarea id=\"code\" name=\"code\"></textarea>" +
-          "<input type=submit value=ok name=submit>" +
-          "</form>";
-        runTests(displayTest);
-      }
-
-      function setStatus(message, className, force){
-        if (quit && !force) return;
-        if (!message) throw("must provide message");
-        var status = document.getElementById("status").childNodes[0];
-        status.nodeValue = message;
-        status.parentNode.className = className;
-      }
-      function addOutput(name, className, code){
-        var newOutput = document.createElement("dl");
-        var newTitle = document.createElement("dt");
-        newTitle.className = className;
-        newTitle.appendChild(document.createTextNode(name));
-        newOutput.appendChild(newTitle);
-        var newMessage = document.createElement("dd");
-        newMessage.innerHTML = code;
-        newOutput.appendChild(newTitle);
-        newOutput.appendChild(newMessage);
-        output.appendChild(newOutput);
-      }
-      function displayTest(type, name, customMessage) {
-        var message = "???";
-        if (type != "done" && type != "skipped") ++count;
-        progress.style.width = (count * (progress.parentNode.clientWidth - 2) / (totalTests || 1)) + "px";
-        progressRan.nodeValue = count;
-        if (type == "ok") {
-          message = "Test '" + name + "' passed";
-          if (!verbose) customMessage = false;
-        } else if (type == "skipped") {
-          message = "Test '" + name + "' skipped";
-          ++skipped;
-          if (!verbose) customMessage = false;
-        } else if (type == "expected") {
-          message = "Test '" + name + "' failed as expected";
-          if (!verbose) customMessage = false;
-        } else if (type == "error" || type == "fail") {
-          ++failed;
-          message = "Test '" + name + "' failed";
-        } else if (type == "done") {
-          if (failed) {
-            type += " fail";
-            message = failed + " failure" + (failed > 1 ? "s" : "");
-          } else if (count < totalTests) {
-            failed = totalTests - count;
-            type += " fail";
-            message = failed + " failure" + (failed > 1 ? "s" : "");
-          } else {
-            type += " ok";
-            message = "All passed";
-            if (skipped) {
-              message += " (" + skipped + " skipped)";
-            }
-          }
-          progressTotal.nodeValue = '';
-          customMessage = true; // Hack to avoid adding to output
-        }
-        if (verbose && !customMessage)  customMessage = message;
-        setStatus(message, type);
-        if (customMessage && customMessage.length > 0) {
-          addOutput(name, type, customMessage);
-        }
-      }
-    </script>
-
-</article>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/index.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/index.html.xml
deleted file mode 100644
index 66e1a7449c1ec6de096edcb58673dc2f687fdeb0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/index.html.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>index.html</string> </value>
-        </item>
-        <item>
-            <key> <string>_vars</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>globals</string> </key>
-            <value>
-              <dictionary/>
-            </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/lint.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/lint.js.js
deleted file mode 100644
index 502706de8e51a2feb72b098cddcf5736c253fe9c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/lint.js.js
+++ /dev/null
@@ -1,19 +0,0 @@
-var blint = require("blint");
-
-["mode", "lib", "addon", "keymap"].forEach(function(dir) {
-  blint.checkDir(dir, {
-    browser: true,
-    allowedGlobals: ["CodeMirror", "define", "test", "requirejs"],
-    ecmaVersion: 5
-  });
-});
-
-["src"].forEach(function(dir) {
-  blint.checkDir(dir, {
-    browser: true,
-    ecmaVersion: 6,
-    semicolons: false
-  });
-});
-
-module.exports = {ok: blint.success()};
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/lint.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/lint.js.xml
deleted file mode 100644
index eb9e4cda57a47b5e74da6ebd50ca21726bde3bef..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/lint.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>lint.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.css.css
deleted file mode 100644
index f83271b4e29cddb5d444a13843f3c8b4a5fc9685..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.css.css
+++ /dev/null
@@ -1,23 +0,0 @@
-.mt-output .mt-token {
-  border: 1px solid #ddd;
-  white-space: pre;
-  font-family: "Consolas", monospace;
-  text-align: center;
-}
-
-.mt-output .mt-style {
-  font-size: x-small;
-}
-
-.mt-output .mt-state {
-  font-size: x-small;
-  vertical-align: top;
-}
-
-.mt-output .mt-state-row {
-  display: none;
-}
-
-.mt-state-unhide .mt-output .mt-state-row {
-  display: table-row;
-}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.css.xml
deleted file mode 100644
index e95ec6305b04f37c18d9b4b390bc592ef6d4deff..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.css.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>mode_test.css</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.js.js
deleted file mode 100644
index 0aed50f7dc0ebe2b94e4de667a01eec5558cfaae..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.js.js
+++ /dev/null
@@ -1,192 +0,0 @@
-/**
- * Helper to test CodeMirror highlighting modes. It pretty prints output of the
- * highlighter and can check against expected styles.
- *
- * Mode tests are registered by calling test.mode(testName, mode,
- * tokens), where mode is a mode object as returned by
- * CodeMirror.getMode, and tokens is an array of lines that make up
- * the test.
- *
- * These lines are strings, in which styled stretches of code are
- * enclosed in brackets `[]`, and prefixed by their style. For
- * example, `[keyword if]`. Brackets in the code itself must be
- * duplicated to prevent them from being interpreted as token
- * boundaries. For example `a[[i]]` for `a[i]`. If a token has
- * multiple styles, the styles must be separated by ampersands, for
- * example `[tag&error </hmtl>]`.
- *
- * See the test.js files in the css, markdown, gfm, and stex mode
- * directories for examples.
- */
-(function() {
-  function findSingle(str, pos, ch) {
-    for (;;) {
-      var found = str.indexOf(ch, pos);
-      if (found == -1) return null;
-      if (str.charAt(found + 1) != ch) return found;
-      pos = found + 2;
-    }
-  }
-
-  var styleName = /[\w&-_]+/g;
-  function parseTokens(strs) {
-    var tokens = [], plain = "";
-    for (var i = 0; i < strs.length; ++i) {
-      if (i) plain += "\n";
-      var str = strs[i], pos = 0;
-      while (pos < str.length) {
-        var style = null, text;
-        if (str.charAt(pos) == "[" && str.charAt(pos+1) != "[") {
-          styleName.lastIndex = pos + 1;
-          var m = styleName.exec(str);
-          style = m[0].replace(/&/g, " ");
-          var textStart = pos + style.length + 2;
-          var end = findSingle(str, textStart, "]");
-          if (end == null) throw new Error("Unterminated token at " + pos + " in '" + str + "'" + style);
-          text = str.slice(textStart, end);
-          pos = end + 1;
-        } else {
-          var end = findSingle(str, pos, "[");
-          if (end == null) end = str.length;
-          text = str.slice(pos, end);
-          pos = end;
-        }
-        text = text.replace(/\[\[|\]\]/g, function(s) {return s.charAt(0);});
-        tokens.push({style: style, text: text});
-        plain += text;
-      }
-    }
-    return {tokens: tokens, plain: plain};
-  }
-
-  test.mode = function(name, mode, tokens, modeName) {
-    var data = parseTokens(tokens);
-    return test((modeName || mode.name) + "_" + name, function() {
-      return compare(data.plain, data.tokens, mode);
-    });
-  };
-
-  function esc(str) {
-    return str.replace('&', '&amp;').replace('<', '&lt;').replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
-;
-  }
-
-  function compare(text, expected, mode) {
-
-    var expectedOutput = [];
-    for (var i = 0; i < expected.length; ++i) {
-      var sty = expected[i].style;
-      if (sty && sty.indexOf(" ")) sty = sty.split(' ').sort().join(' ');
-      expectedOutput.push({style: sty, text: expected[i].text});
-    }
-
-    var observedOutput = highlight(text, mode);
-
-    var s = "";
-    var diff = highlightOutputsDifferent(expectedOutput, observedOutput);
-    if (diff != null) {
-      s += '<div class="mt-test mt-fail">';
-      s +=   '<pre>' + esc(text) + '</pre>';
-      s +=   '<div class="cm-s-default">';
-      s += 'expected:';
-      s +=   prettyPrintOutputTable(expectedOutput, diff);
-      s += 'observed: [<a onclick="this.parentElement.className+=\' mt-state-unhide\'">display states</a>]';
-      s +=   prettyPrintOutputTable(observedOutput, diff);
-      s +=   '</div>';
-      s += '</div>';
-    }
-    if (observedOutput.indentFailures) {
-      for (var i = 0; i < observedOutput.indentFailures.length; i++)
-        s += "<div class='mt-test mt-fail'>" + esc(observedOutput.indentFailures[i]) + "</div>";
-    }
-    if (s) throw new Failure(s);
-  }
-
-  function stringify(obj) {
-    function replacer(key, obj) {
-      if (typeof obj == "function") {
-        var m = obj.toString().match(/function\s*[^\s(]*/);
-        return m ? m[0] : "function";
-      }
-      return obj;
-    }
-    if (window.JSON && JSON.stringify)
-      return JSON.stringify(obj, replacer, 2);
-    return "[unsupported]";  // Fail safely if no native JSON.
-  }
-
-  function highlight(string, mode) {
-    var state = mode.startState();
-
-    var lines = string.replace(/\r\n/g,'\n').split('\n');
-    var st = [], pos = 0;
-    for (var i = 0; i < lines.length; ++i) {
-      var line = lines[i], newLine = true;
-      if (mode.indent) {
-        var ws = line.match(/^\s*/)[0];
-        var indent = mode.indent(state, line.slice(ws.length));
-        if (indent != CodeMirror.Pass && indent != ws.length)
-          (st.indentFailures || (st.indentFailures = [])).push(
-            "Indentation of line " + (i + 1) + " is " + indent + " (expected " + ws.length + ")");
-      }
-      var stream = new CodeMirror.StringStream(line);
-      if (line == "" && mode.blankLine) mode.blankLine(state);
-      /* Start copied code from CodeMirror.highlight */
-      while (!stream.eol()) {
-        for (var j = 0; j < 10 && stream.start >= stream.pos; j++)
-          var compare = mode.token(stream, state);
-        if (j == 10)
-          throw new Failure("Failed to advance the stream." + stream.string + " " + stream.pos);
-        var substr = stream.current();
-        if (compare && compare.indexOf(" ") > -1) compare = compare.split(' ').sort().join(' ');
-        stream.start = stream.pos;
-        if (pos && st[pos-1].style == compare && !newLine) {
-          st[pos-1].text += substr;
-        } else if (substr) {
-          st[pos++] = {style: compare, text: substr, state: stringify(state)};
-        }
-        // Give up when line is ridiculously long
-        if (stream.pos > 5000) {
-          st[pos++] = {style: null, text: this.text.slice(stream.pos)};
-          break;
-        }
-        newLine = false;
-      }
-    }
-
-    return st;
-  }
-
-  function highlightOutputsDifferent(o1, o2) {
-    var minLen = Math.min(o1.length, o2.length);
-    for (var i = 0; i < minLen; ++i)
-      if (o1[i].style != o2[i].style || o1[i].text != o2[i].text) return i;
-    if (o1.length > minLen || o2.length > minLen) return minLen;
-  }
-
-  function prettyPrintOutputTable(output, diffAt) {
-    var s = '<table class="mt-output">';
-    s += '<tr>';
-    for (var i = 0; i < output.length; ++i) {
-      var style = output[i].style, val = output[i].text;
-      s +=
-      '<td class="mt-token"' + (i == diffAt ? " style='background: pink'" : "") + '>' +
-        '<span class="cm-' + esc(String(style)) + '">' +
-        esc(val.replace(/ /g,'\xb7')) +  // 路 MIDDLE DOT
-        '</span>' +
-        '</td>';
-    }
-    s += '</tr><tr>';
-    for (var i = 0; i < output.length; ++i) {
-      s += '<td class="mt-style"><span>' + (output[i].style || null) + '</span></td>';
-    }
-    if(output[0].state) {
-      s += '</tr><tr class="mt-state-row" title="State AFTER each token">';
-      for (var i = 0; i < output.length; ++i) {
-        s += '<td class="mt-state"><pre>' + esc(output[i].state) + '</pre></td>';
-      }
-    }
-    s += '</tr></table>';
-    return s;
-  }
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.js.xml
deleted file mode 100644
index 056221661b27f8fe981f9f2bf82180586661452c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/mode_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>mode_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/multi_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/multi_test.js.js
deleted file mode 100644
index 49169b9900c41869f7533e419e2246dd3fb35fb6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/multi_test.js.js
+++ /dev/null
@@ -1,285 +0,0 @@
-(function() {
-  namespace = "multi_";
-
-  function hasSelections(cm) {
-    var sels = cm.listSelections();
-    var given = (arguments.length - 1) / 4;
-    if (sels.length != given)
-      throw new Failure("expected " + given + " selections, found " + sels.length);
-    for (var i = 0, p = 1; i < given; i++, p += 4) {
-      var anchor = Pos(arguments[p], arguments[p + 1]);
-      var head = Pos(arguments[p + 2], arguments[p + 3]);
-      eqCharPos(sels[i].anchor, anchor, "anchor of selection " + i);
-      eqCharPos(sels[i].head, head, "head of selection " + i);
-    }
-  }
-  function hasCursors(cm) {
-    var sels = cm.listSelections();
-    var given = (arguments.length - 1) / 2;
-    if (sels.length != given)
-      throw new Failure("expected " + given + " selections, found " + sels.length);
-    for (var i = 0, p = 1; i < given; i++, p += 2) {
-      eqCursorPos(sels[i].anchor, sels[i].head, "something selected for " + i);
-      var head = Pos(arguments[p], arguments[p + 1]);
-      eqCharPos(sels[i].head, head, "selection " + i);
-    }
-  }
-
-  testCM("getSelection", function(cm) {
-    select(cm, {anchor: Pos(0, 0), head: Pos(1, 2)}, {anchor: Pos(2, 2), head: Pos(2, 0)});
-    eq(cm.getSelection(), "1234\n56\n90");
-    eq(cm.getSelection(false).join("|"), "1234|56|90");
-    eq(cm.getSelections().join("|"), "1234\n56|90");
-  }, {value: "1234\n5678\n90"});
-
-  testCM("setSelection", function(cm) {
-    select(cm, Pos(3, 0), Pos(0, 0), {anchor: Pos(2, 5), head: Pos(1, 0)});
-    hasSelections(cm, 0, 0, 0, 0,
-                  2, 5, 1, 0,
-                  3, 0, 3, 0);
-    cm.setSelection(Pos(1, 2), Pos(1, 1));
-    hasSelections(cm, 1, 2, 1, 1);
-    select(cm, {anchor: Pos(1, 1), head: Pos(2, 4)},
-           {anchor: Pos(0, 0), head: Pos(1, 3)},
-           Pos(3, 0), Pos(2, 2));
-    hasSelections(cm, 0, 0, 2, 4,
-                  3, 0, 3, 0);
-    cm.setSelections([{anchor: Pos(0, 1), head: Pos(0, 2)},
-                      {anchor: Pos(1, 1), head: Pos(1, 2)},
-                      {anchor: Pos(2, 1), head: Pos(2, 2)}], 1);
-    eqCharPos(cm.getCursor("head"), Pos(1, 2));
-    eqCharPos(cm.getCursor("anchor"), Pos(1, 1));
-    eqCharPos(cm.getCursor("from"), Pos(1, 1));
-    eqCharPos(cm.getCursor("to"), Pos(1, 2));
-    cm.setCursor(Pos(1, 1));
-    hasCursors(cm, 1, 1);
-  }, {value: "abcde\nabcde\nabcde\n"});
-
-  testCM("somethingSelected", function(cm) {
-    select(cm, Pos(0, 1), {anchor: Pos(0, 3), head: Pos(0, 5)});
-    eq(cm.somethingSelected(), true);
-    select(cm, Pos(0, 1), Pos(0, 3), Pos(0, 5));
-    eq(cm.somethingSelected(), false);
-  }, {value: "123456789"});
-
-  testCM("extendSelection", function(cm) {
-    select(cm, Pos(0, 1), Pos(1, 1), Pos(2, 1));
-    cm.setExtending(true);
-    cm.extendSelections([Pos(0, 2), Pos(1, 0), Pos(2, 3)]);
-    hasSelections(cm, 0, 1, 0, 2,
-                  1, 1, 1, 0,
-                  2, 1, 2, 3);
-    cm.extendSelection(Pos(2, 4), Pos(2, 0));
-    hasSelections(cm, 2, 4, 2, 0);
-  }, {value: "1234\n1234\n1234"});
-
-  testCM("addSelection", function(cm) {
-    select(cm, Pos(0, 1), Pos(1, 1));
-    cm.addSelection(Pos(0, 0), Pos(0, 4));
-    hasSelections(cm, 0, 0, 0, 4,
-                  1, 1, 1, 1);
-    cm.addSelection(Pos(2, 2));
-    hasSelections(cm, 0, 0, 0, 4,
-                  1, 1, 1, 1,
-                  2, 2, 2, 2);
-  }, {value: "1234\n1234\n1234"});
-
-  testCM("replaceSelection", function(cm) {
-    var selections = [{anchor: Pos(0, 0), head: Pos(0, 1)},
-                      {anchor: Pos(0, 2), head: Pos(0, 3)},
-                      {anchor: Pos(0, 4), head: Pos(0, 5)},
-                      {anchor: Pos(2, 1), head: Pos(2, 4)},
-                      {anchor: Pos(2, 5), head: Pos(2, 6)}];
-    var val = "123456\n123456\n123456";
-    cm.setValue(val);
-    cm.setSelections(selections);
-    cm.replaceSelection("ab", "around");
-    eq(cm.getValue(), "ab2ab4ab6\n123456\n1ab5ab");
-    hasSelections(cm, 0, 0, 0, 2,
-                  0, 3, 0, 5,
-                  0, 6, 0, 8,
-                  2, 1, 2, 3,
-                  2, 4, 2, 6);
-    cm.setValue(val);
-    cm.setSelections(selections);
-    cm.replaceSelection("", "around");
-    eq(cm.getValue(), "246\n123456\n15");
-    hasSelections(cm, 0, 0, 0, 0,
-                  0, 1, 0, 1,
-                  0, 2, 0, 2,
-                  2, 1, 2, 1,
-                  2, 2, 2, 2);
-    cm.setValue(val);
-    cm.setSelections(selections);
-    cm.replaceSelection("X\nY\nZ", "around");
-    hasSelections(cm, 0, 0, 2, 1,
-                  2, 2, 4, 1,
-                  4, 2, 6, 1,
-                  8, 1, 10, 1,
-                  10, 2, 12, 1);
-    cm.replaceSelection("a", "around");
-    hasSelections(cm, 0, 0, 0, 1,
-                  0, 2, 0, 3,
-                  0, 4, 0, 5,
-                  2, 1, 2, 2,
-                  2, 3, 2, 4);
-    cm.replaceSelection("xy", "start");
-    hasSelections(cm, 0, 0, 0, 0,
-                  0, 3, 0, 3,
-                  0, 6, 0, 6,
-                  2, 1, 2, 1,
-                  2, 4, 2, 4);
-    cm.replaceSelection("z\nf");
-    hasSelections(cm, 1, 1, 1, 1,
-                  2, 1, 2, 1,
-                  3, 1, 3, 1,
-                  6, 1, 6, 1,
-                  7, 1, 7, 1);
-    eq(cm.getValue(), "z\nfxy2z\nfxy4z\nfxy6\n123456\n1z\nfxy5z\nfxy");
-  });
-
-  function select(cm) {
-    var sels = [];
-    for (var i = 1; i < arguments.length; i++) {
-      var arg = arguments[i];
-      if (arg.head) sels.push(arg);
-      else sels.push({head: arg, anchor: arg});
-    }
-    cm.setSelections(sels, sels.length - 1);
-  }
-
-  testCM("indentSelection", function(cm) {
-    select(cm, Pos(0, 1), Pos(1, 1));
-    cm.indentSelection(4);
-    eq(cm.getValue(), "    foo\n    bar\nbaz");
-
-    select(cm, Pos(0, 2), Pos(0, 3), Pos(0, 4));
-    cm.indentSelection(-2);
-    eq(cm.getValue(), "  foo\n    bar\nbaz");
-
-    select(cm, {anchor: Pos(0, 0), head: Pos(1, 2)},
-           {anchor: Pos(1, 3), head: Pos(2, 0)});
-    cm.indentSelection(-2);
-    eq(cm.getValue(), "foo\n  bar\nbaz");
-  }, {value: "foo\nbar\nbaz"});
-
-  testCM("killLine", function(cm) {
-    select(cm, Pos(0, 1), Pos(0, 2), Pos(1, 1));
-    cm.execCommand("killLine");
-    eq(cm.getValue(), "f\nb\nbaz");
-    cm.execCommand("killLine");
-    eq(cm.getValue(), "fbbaz");
-    cm.setValue("foo\nbar\nbaz");
-    select(cm, Pos(0, 1), {anchor: Pos(0, 2), head: Pos(2, 1)});
-    cm.execCommand("killLine");
-    eq(cm.getValue(), "faz");
-  }, {value: "foo\nbar\nbaz"});
-
-  testCM("deleteLine", function(cm) {
-    select(cm, Pos(0, 0),
-           {head: Pos(0, 1), anchor: Pos(2, 0)},
-           Pos(4, 0));
-    cm.execCommand("deleteLine");
-    eq(cm.getValue(), "4\n6\n7");
-    select(cm, Pos(2, 1));
-    cm.execCommand("deleteLine");
-    eq(cm.getValue(), "4\n6\n");
-  }, {value: "1\n2\n3\n4\n5\n6\n7"});
-
-  testCM("deleteH", function(cm) {
-    select(cm, Pos(0, 4), {anchor: Pos(1, 4), head: Pos(1, 5)});
-    cm.execCommand("delWordAfter");
-    eq(cm.getValue(), "foo bar baz\nabc ef ghi\n");
-    cm.execCommand("delWordAfter");
-    eq(cm.getValue(), "foo  baz\nabc  ghi\n");
-    cm.execCommand("delCharBefore");
-    cm.execCommand("delCharBefore");
-    eq(cm.getValue(), "fo baz\nab ghi\n");
-    select(cm, Pos(0, 3), Pos(0, 4), Pos(0, 5));
-    cm.execCommand("delWordAfter");
-    eq(cm.getValue(), "fo \nab ghi\n");
-  }, {value: "foo bar baz\nabc def ghi\n"});
-
-  testCM("goLineStart", function(cm) {
-    select(cm, Pos(0, 2), Pos(0, 3), Pos(1, 1));
-    cm.execCommand("goLineStart");
-    hasCursors(cm, 0, 0, 1, 0);
-    select(cm, Pos(1, 1), Pos(0, 1));
-    cm.setExtending(true);
-    cm.execCommand("goLineStart");
-    hasSelections(cm, 0, 1, 0, 0,
-                  1, 1, 1, 0);
-  }, {value: "foo\nbar\nbaz"});
-
-  testCM("moveV", function(cm) {
-    select(cm, Pos(0, 2), Pos(1, 2));
-    cm.execCommand("goLineDown");
-    hasCursors(cm, 1, 2, 2, 2);
-    cm.execCommand("goLineUp");
-    hasCursors(cm, 0, 2, 1, 2);
-    cm.execCommand("goLineUp");
-    hasCursors(cm, 0, 0, 0, 2);
-    cm.execCommand("goLineUp");
-    hasCursors(cm, 0, 0);
-    select(cm, Pos(0, 2), Pos(1, 2));
-    cm.setExtending(true);
-    cm.execCommand("goLineDown");
-    hasSelections(cm, 0, 2, 2, 2);
-  }, {value: "12345\n12345\n12345"});
-
-  testCM("moveH", function(cm) {
-    select(cm, Pos(0, 1), Pos(0, 3), Pos(0, 5), Pos(2, 3));
-    cm.execCommand("goCharRight");
-    hasCursors(cm, 0, 2, 0, 4, 1, 0, 2, 4);
-    cm.execCommand("goCharLeft");
-    hasCursors(cm, 0, 1, 0, 3, 0, 5, 2, 3);
-    for (var i = 0; i < 15; i++)
-      cm.execCommand("goCharRight");
-    hasCursors(cm, 2, 4, 2, 5);
-  }, {value: "12345\n12345\n12345"});
-
-  testCM("newlineAndIndent", function(cm) {
-    select(cm, Pos(0, 5), Pos(1, 5));
-    cm.execCommand("newlineAndIndent");
-    hasCursors(cm, 1, 2, 3, 2);
-    eq(cm.getValue(), "x = [\n  1];\ny = [\n  2];");
-    cm.undo();
-    eq(cm.getValue(), "x = [1];\ny = [2];");
-    hasCursors(cm, 0, 5, 1, 5);
-    select(cm, Pos(0, 5), Pos(0, 6));
-    cm.execCommand("newlineAndIndent");
-    hasCursors(cm, 1, 2, 2, 0);
-    eq(cm.getValue(), "x = [\n  1\n];\ny = [2];");
-  }, {value: "x = [1];\ny = [2];", mode: "javascript"});
-
-  testCM("goDocStartEnd", function(cm) {
-    select(cm, Pos(0, 1), Pos(1, 1));
-    cm.execCommand("goDocStart");
-    hasCursors(cm, 0, 0);
-    select(cm, Pos(0, 1), Pos(1, 1));
-    cm.execCommand("goDocEnd");
-    hasCursors(cm, 1, 3);
-    select(cm, Pos(0, 1), Pos(1, 1));
-    cm.setExtending(true);
-    cm.execCommand("goDocEnd");
-    hasSelections(cm, 1, 1, 1, 3);
-  }, {value: "abc\ndef"});
-
-  testCM("selectionHistory", function(cm) {
-    for (var i = 0; i < 3; ++i)
-      cm.addSelection(Pos(0, i * 2), Pos(0, i * 2 + 1));
-    cm.execCommand("undoSelection");
-    eq(cm.getSelection(), "1\n2");
-    cm.execCommand("undoSelection");
-    eq(cm.getSelection(), "1");
-    cm.execCommand("undoSelection");
-    eq(cm.getSelection(), "");
-    eqCharPos(cm.getCursor(), Pos(0, 0));
-    cm.execCommand("redoSelection");
-    eq(cm.getSelection(), "1");
-    cm.execCommand("redoSelection");
-    eq(cm.getSelection(), "1\n2");
-    cm.execCommand("redoSelection");
-    eq(cm.getSelection(), "1\n2\n3");
-  }, {value: "1 2 3"});
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/multi_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/multi_test.js.xml
deleted file mode 100644
index fc8f1f38c16fabc60d424f04f1849cf25e87556f..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/multi_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>multi_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/phantom_driver.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/phantom_driver.js.js
deleted file mode 100644
index dbad08db6334004729626bff6274cfa30ee798c4..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/phantom_driver.js.js
+++ /dev/null
@@ -1,31 +0,0 @@
-var page = require('webpage').create();
-
-page.open("http://localhost:3000/test/index.html", function (status) {
-  if (status != "success") {
-    console.log("page couldn't be loaded successfully");
-    phantom.exit(1);
-  }
-  waitFor(function () {
-    return page.evaluate(function () {
-      var output = document.getElementById('status');
-      if (!output) { return false; }
-      return (/^(\d+ failures?|all passed)/i).test(output.innerText);
-    });
-  }, function () {
-    var failed = page.evaluate(function () { return window.failed; });
-    var output = page.evaluate(function () {
-      return document.getElementById('output').innerText + "\n" +
-        document.getElementById('status').innerText;
-    });
-    console.log(output);
-    phantom.exit(failed > 0 ? 1 : 0);
-  });
-});
-
-function waitFor (test, cb) {
-  if (test()) {
-    cb();
-  } else {
-    setTimeout(function () { waitFor(test, cb); }, 250);
-  }
-}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/phantom_driver.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/phantom_driver.js.xml
deleted file mode 100644
index 763f1fda185248bd6a55cf106b9a99dbabfe087a..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/phantom_driver.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>phantom_driver.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/run.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/run.js.js
deleted file mode 100644
index 54984e73a5f9abb7fe21ea95ebd5f838059353bf..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/run.js.js
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/usr/bin/env node
-
-var ok = require("./lint").ok;
-
-var files = new (require('node-static').Server)();
-
-var server = require('http').createServer(function (req, res) {
-  req.addListener('end', function () {
-    files.serve(req, res, function (err/*, result */) {
-      if (err) {
-        console.error(err);
-        process.exit(1);
-      }
-    });
-  }).resume();
-}).addListener('error', function (err) {
-  throw err;
-}).listen(3000, function () {
-  var childProcess = require('child_process');
-  var phantomjs = require("phantomjs-prebuilt");
-  var childArgs = [
-    require("path").join(__dirname, 'phantom_driver.js')
-  ];
-  childProcess.execFile(phantomjs.path, childArgs, function (err, stdout, stderr) {
-    server.close();
-    console.log(stdout);
-    if (err) console.error(err);
-    if (stderr) console.error(stderr);
-    process.exit(err || stderr || !ok ? 1 : 0);
-  });
-});
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/scroll_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/scroll_test.js.js
deleted file mode 100644
index 55aac78ebb848201c819d1f89c6975c016bf8b7c..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/scroll_test.js.js
+++ /dev/null
@@ -1,115 +0,0 @@
-(function() {
-  "use strict";
-
-  namespace = "scroll_";
-
-  testCM("bars_hidden", function(cm) {
-    for (var i = 0;; i++) {
-      var wrapBox = cm.getWrapperElement().getBoundingClientRect();
-      var scrollBox = cm.getScrollerElement().getBoundingClientRect();
-      is(wrapBox.bottom < scrollBox.bottom - 10);
-      is(wrapBox.right < scrollBox.right - 10);
-      if (i == 1) break;
-      cm.getWrapperElement().style.height = "auto";
-      cm.refresh();
-    }
-  });
-  
-  function barH(cm) { return byClassName(cm.getWrapperElement(), "CodeMirror-hscrollbar")[0]; }
-  function barV(cm) { return byClassName(cm.getWrapperElement(), "CodeMirror-vscrollbar")[0]; }
-
-  function displayBottom(cm, scrollbar) {
-    if (scrollbar && cm.display.scroller.offsetHeight > cm.display.scroller.clientHeight)
-      return barH(cm).getBoundingClientRect().top;
-    else
-      return cm.getWrapperElement().getBoundingClientRect().bottom - 1;
-  }
-
-  function displayRight(cm, scrollbar) {
-    if (scrollbar && cm.display.scroller.offsetWidth > cm.display.scroller.clientWidth)
-      return barV(cm).getBoundingClientRect().left;
-    else
-      return cm.getWrapperElement().getBoundingClientRect().right - 1;
-  }
-
-  function testMovedownFixed(cm, hScroll) {
-    cm.setSize("100px", "100px");
-    if (hScroll) cm.setValue(new Array(100).join("x"));
-    var bottom = displayBottom(cm, hScroll);
-    for (var i = 0; i < 30; i++) {
-      cm.replaceSelection("x\n");
-      var cursorBottom = cm.cursorCoords(null, "window").bottom;
-      is(cursorBottom <= bottom);
-    }
-    is(cursorBottom >= bottom - 5);
-  }
-
-  testCM("movedown_fixed", function(cm) {testMovedownFixed(cm, false);});
-  testCM("movedown_hscroll_fixed", function(cm) {testMovedownFixed(cm, true);});
-
-  function testMovedownResize(cm, hScroll) {
-    cm.getWrapperElement().style.height = "auto";
-    if (hScroll) cm.setValue(new Array(100).join("x"));
-    cm.refresh();
-    for (var i = 0; i < 30; i++) {
-      cm.replaceSelection("x\n");
-      var bottom = displayBottom(cm, hScroll);
-      var cursorBottom = cm.cursorCoords(null, "window").bottom;
-      is(cursorBottom <= bottom);
-      is(cursorBottom >= bottom - 5);
-    }
-  }
-
-  testCM("movedown_resize", function(cm) {testMovedownResize(cm, false);});
-  testCM("movedown_hscroll_resize", function(cm) {testMovedownResize(cm, true);});
-
-  function testMoveright(cm, wrap, scroll) {
-    cm.setSize("100px", "100px");
-    if (wrap) cm.setOption("lineWrapping", true);
-    if (scroll) {
-      cm.setValue("\n" + new Array(100).join("x\n"));
-      cm.setCursor(Pos(0, 0));
-    }
-    var right = displayRight(cm, scroll);
-    for (var i = 0; i < 10; i++) {
-      cm.replaceSelection("xxxxxxxxxx");
-      var cursorRight = cm.cursorCoords(null, "window").right;
-      is(cursorRight < right);
-    }
-    if (!wrap) is(cursorRight > right - 20);
-  }
-
-  testCM("moveright", function(cm) {testMoveright(cm, false, false);});
-  testCM("moveright_wrap", function(cm) {testMoveright(cm, true, false);});
-  testCM("moveright_scroll", function(cm) {testMoveright(cm, false, true);});
-  testCM("moveright_scroll_wrap", function(cm) {testMoveright(cm, true, true);});
-
-  testCM("suddenly_wide", function(cm) {
-    addDoc(cm, 100, 100);
-    cm.replaceSelection(new Array(600).join("l ") + "\n");
-    cm.execCommand("goLineUp");
-    cm.execCommand("goLineEnd");
-    is(barH(cm).scrollLeft > cm.getScrollerElement().scrollLeft - 1);
-  });
-
-  testCM("wrap_changes_height", function(cm) {
-    var line = new Array(20).join("a ") + "\n";
-    cm.setValue(new Array(20).join(line));
-    var box = cm.getWrapperElement().getBoundingClientRect();
-    cm.setSize(cm.cursorCoords(Pos(0), "window").right - box.left + 2,
-               cm.cursorCoords(Pos(19, 0), "window").bottom - box.top + 2);
-    cm.setCursor(Pos(19, 0));
-    cm.replaceSelection("\n");
-    is(cm.cursorCoords(null, "window").bottom < displayBottom(cm, false));
-  }, {lineWrapping: true});
-
-  testCM("height_auto_with_gutter_expect_no_scroll_after_line_delete", function(cm) {
-    cm.setSize(null, "auto");
-    cm.setValue("x\n");
-    cm.execCommand("goDocEnd");
-    cm.execCommand("delCharBefore");
-    eq(cm.getScrollInfo().top, 0);
-    cm.scrollTo(null, 10);
-    is(cm.getScrollInfo().top < 5);
-  }, {lineNumbers: true});
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/scroll_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/scroll_test.js.xml
deleted file mode 100644
index 7a2c34c495a243bf14c877a3f420abb96d608270..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/scroll_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>scroll_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/search_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/search_test.js.js
deleted file mode 100644
index 9fe898bacdc83355dc56194593759e019edb2ec0..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/search_test.js.js
+++ /dev/null
@@ -1,62 +0,0 @@
-(function() {
-  "use strict";
-
-  function test(name) {
-    var text = Array.prototype.slice.call(arguments, 1, arguments.length - 1).join("\n");
-    var body = arguments[arguments.length - 1];
-    return window.test("search_" + name, function() {
-      body(new CodeMirror.Doc(text));
-    });
-  }
-
-  function run(doc, query, insensitive) {
-    var cursor = doc.getSearchCursor(query, null, insensitive);
-    for (var i = 3; i < arguments.length; i += 4) {
-      var found = cursor.findNext();
-      is(found, "not enough results (forward)");
-      eqCharPos(Pos(arguments[i], arguments[i + 1]), cursor.from(), "from, forward, " + (i - 3) / 4);
-      eqCharPos(Pos(arguments[i + 2], arguments[i + 3]), cursor.to(), "to, forward, " + (i - 3) / 4);
-    }
-    is(!cursor.findNext(), "too many matches (forward)");
-    for (var i = arguments.length - 4; i >= 3; i -= 4) {
-      var found = cursor.findPrevious();
-      is(found, "not enough results (backwards)");
-      eqCharPos(Pos(arguments[i], arguments[i + 1]), cursor.from(), "from, backwards, " + (i - 3) / 4);
-      eqCharPos(Pos(arguments[i + 2], arguments[i + 3]), cursor.to(), "to, backwards, " + (i - 3) / 4);
-    }
-    is(!cursor.findPrevious(), "too many matches (backwards)");
-  }
-
-  test("simple", "abcdefg", "abcdefg", function(doc) {
-    run(doc, "cde", false, 0, 2, 0, 5, 1, 2, 1, 5);
-  });
-
-  test("multiline", "hallo", "goodbye", function(doc) {
-    run(doc, "llo\ngoo", false, 0, 2, 1, 3);
-    run(doc, "blah\nhall", false);
-    run(doc, "bye\neye", false);
-  });
-
-  test("regexp", "abcde", "abcde", function(doc) {
-    run(doc, /bcd/, false, 0, 1, 0, 4, 1, 1, 1, 4);
-    run(doc, /BCD/, false);
-    run(doc, /BCD/i, false, 0, 1, 0, 4, 1, 1, 1, 4);
-  });
-
-  test("insensitive", "hallo", "HALLO", "oink", "hAllO", function(doc) {
-    run(doc, "All", false, 3, 1, 3, 4);
-    run(doc, "All", true, 0, 1, 0, 4, 1, 1, 1, 4, 3, 1, 3, 4);
-  });
-
-  test("multilineInsensitive", "zie ginds komT", "De Stoomboot", "uit Spanje weer aan", function(doc) {
-    run(doc, "komt\nde stoomboot\nuit", false);
-    run(doc, "komt\nde stoomboot\nuit", true, 0, 10, 2, 3);
-    run(doc, "kOMt\ndE stOOmboot\nuiT", true, 0, 10, 2, 3);
-  });
-
-  test("expandingCaseFold", "<b>陌陌 陌陌</b>", "<b>uu uu</b>", function(doc) {
-    if (phantom) return; // A Phantom bug makes this hang
-    run(doc, "</b>", true, 0, 8, 0, 12, 1, 8, 1, 12);
-    run(doc, "陌陌", true, 0, 3, 0, 5, 0, 6, 0, 8);
-  });
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/search_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/search_test.js.xml
deleted file mode 100644
index f7ed84c74ddf1804924546272096ba14696c1cf1..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/search_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>search_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sql-hint-test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sql-hint-test.js.js
deleted file mode 100644
index 31d0490f191218c047307f4c62f476e82fd09d6b..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sql-hint-test.js.js
+++ /dev/null
@@ -1,189 +0,0 @@
-// CodeMirror, copyright (c) by Marijn Haverbeke and others
-// Distributed under an MIT license: http://codemirror.net/LICENSE
-
-(function() {
-  var Pos = CodeMirror.Pos;
-
-  var simpleTables = {
-    "users": ["name", "score", "birthDate"],
-    "xcountries": ["name", "population", "size"]
-  };
-
-  var schemaTables = {
-    "schema.users": ["name", "score", "birthDate"],
-    "schema.countries": ["name", "population", "size"]
-  };
-
-  var displayTextTables = [{
-    text: "mytable",
-    displayText: "mytable | The main table",
-    columns: [{text: "id", displayText: "id | Unique ID"},
-              {text: "name", displayText: "name | The name"}]
-  }];
-
-  namespace = "sql-hint_";
-
-  function test(name, spec) {
-    testCM(name, function(cm) {
-      cm.setValue(spec.value);
-      cm.setCursor(spec.cursor);
-      var completion = CodeMirror.hint.sql(cm, {tables: spec.tables});
-      if (!deepCompare(completion.list, spec.list))
-        throw new Failure("Wrong completion results " + JSON.stringify(completion.list) + " vs " + JSON.stringify(spec.list));
-      eqCharPos(completion.from, spec.from);
-      eqCharPos(completion.to, spec.to);
-    }, {
-      value: spec.value,
-      mode: "text/x-mysql"
-    });
-  }
-
-  test("keywords", {
-    value: "SEL",
-    cursor: Pos(0, 3),
-    list: ["SELECT"],
-    from: Pos(0, 0),
-    to: Pos(0, 3)
-  });
-
-  test("from", {
-    value: "SELECT * fr",
-    cursor: Pos(0, 11),
-    list: ["FROM"],
-    from: Pos(0, 9),
-    to: Pos(0, 11)
-  });
-
-  test("table", {
-    value: "SELECT xc",
-    cursor: Pos(0, 9),
-    tables: simpleTables,
-    list: ["xcountries"],
-    from: Pos(0, 7),
-    to: Pos(0, 9)
-  });
-
-  test("columns", {
-    value: "SELECT users.",
-    cursor: Pos(0, 13),
-    tables: simpleTables,
-    list: ["users.name", "users.score", "users.birthDate"],
-    from: Pos(0, 7),
-    to: Pos(0, 13)
-  });
-
-  test("singlecolumn", {
-    value: "SELECT users.na",
-    cursor: Pos(0, 15),
-    tables: simpleTables,
-    list: ["users.name"],
-    from: Pos(0, 7),
-    to: Pos(0, 15)
-  });
-
-  test("quoted", {
-    value: "SELECT `users`.`na",
-    cursor: Pos(0, 18),
-    tables: simpleTables,
-    list: ["`users`.`name`"],
-    from: Pos(0, 7),
-    to: Pos(0, 18)
-  });
-
-  test("quotedcolumn", {
-    value: "SELECT users.`na",
-    cursor: Pos(0, 16),
-    tables: simpleTables,
-    list: ["`users`.`name`"],
-    from: Pos(0, 7),
-    to: Pos(0, 16)
-  });
-
-  test("schema", {
-    value: "SELECT schem",
-    cursor: Pos(0, 12),
-    tables: schemaTables,
-    list: ["schema.users", "schema.countries",
-           "SCHEMA", "SCHEMA_NAME", "SCHEMAS"],
-    from: Pos(0, 7),
-    to: Pos(0, 12)
-  });
-
-  test("schemaquoted", {
-    value: "SELECT `sch",
-    cursor: Pos(0, 11),
-    tables: schemaTables,
-    list: ["`schema`.`users`", "`schema`.`countries`"],
-    from: Pos(0, 7),
-    to: Pos(0, 11)
-  });
-
-  test("schemacolumn", {
-    value: "SELECT schema.users.",
-    cursor: Pos(0, 20),
-    tables: schemaTables,
-    list: ["schema.users.name",
-           "schema.users.score",
-           "schema.users.birthDate"],
-    from: Pos(0, 7),
-    to: Pos(0, 20)
-  });
-
-  test("schemacolumnquoted", {
-    value: "SELECT `schema`.`users`.",
-    cursor: Pos(0, 24),
-    tables: schemaTables,
-    list: ["`schema`.`users`.`name`",
-           "`schema`.`users`.`score`",
-           "`schema`.`users`.`birthDate`"],
-    from: Pos(0, 7),
-    to: Pos(0, 24)
-  });
-
-  test("displayText_table", {
-    value: "SELECT myt",
-    cursor: Pos(0, 10),
-    tables: displayTextTables,
-    list: displayTextTables,
-    from: Pos(0, 7),
-    to: Pos(0, 10)
-  });
-
-  test("displayText_column", {
-    value: "SELECT mytable.",
-    cursor: Pos(0, 15),
-    tables: displayTextTables,
-    list: [{text: "mytable.id", displayText: "id | Unique ID"},
-           {text: "mytable.name", displayText: "name | The name"}],
-    from: Pos(0, 7),
-    to: Pos(0, 15)
-  });
-
-  test("alias_complete", {
-    value: "SELECT t. FROM users t",
-    cursor: Pos(0, 9),
-    tables: simpleTables,
-    list: ["t.name", "t.score", "t.birthDate"],
-    from: Pos(0, 7),
-    to: Pos(0, 9)
-  });
-
-  test("alias_complete_with_displayText", {
-    value: "SELECT t. FROM mytable t",
-    cursor: Pos(0, 9),
-    tables: displayTextTables,
-    list: [{text: "t.id", displayText: "id | Unique ID"},
-           {text: "t.name", displayText: "name | The name"}],
-    from: Pos(0, 7),
-    to: Pos(0, 9)
-  })
-
-  function deepCompare(a, b) {
-    if (!a || typeof a != "object")
-      return a === b;
-    if (!b || typeof b != "object")
-      return false;
-    for (var prop in a) if (!deepCompare(a[prop], b[prop])) return false;
-    return true;
-  }
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sql-hint-test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sql-hint-test.js.xml
deleted file mode 100644
index 2e801d98c91666a635715e6f3ebbeb3cade33bc5..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sql-hint-test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>sql-hint-test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sublime_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sublime_test.js.js
deleted file mode 100644
index e9cd342ff4c28b37453b12dd1f3a20612fb275bf..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sublime_test.js.js
+++ /dev/null
@@ -1,307 +0,0 @@
-(function() {
-  "use strict";
-  
-  var Pos = CodeMirror.Pos;
-  namespace = "sublime_";
-
-  function stTest(name) {
-    var actions = Array.prototype.slice.call(arguments, 1);
-    testCM(name, function(cm) {
-      for (var i = 0; i < actions.length; i++) {
-        var action = actions[i];
-        if (typeof action == "string" && i == 0)
-          cm.setValue(action);
-        else if (typeof action == "string")
-          cm.execCommand(action);
-        else if (action instanceof Pos)
-          cm.setCursor(action);
-        else
-          action(cm);
-      }
-    });
-  }
-
-  function at(line, ch, msg) {
-    return function(cm) {
-      eq(cm.listSelections().length, 1);
-      eqCursorPos(cm.getCursor("head"), Pos(line, ch), msg);
-      eqCursorPos(cm.getCursor("anchor"), Pos(line, ch), msg);
-    };
-  }
-
-  function val(content, msg) {
-    return function(cm) { eq(cm.getValue(), content, msg); };
-  }
-
-  function argsToRanges(args) {
-    if (args.length % 4) throw new Error("Wrong number of arguments for ranges.");
-    var ranges = [];
-    for (var i = 0; i < args.length; i += 4)
-      ranges.push({anchor: Pos(args[i], args[i + 1]),
-                   head: Pos(args[i + 2], args[i + 3])});
-    return ranges;
-  }
-
-  function setSel() {
-    var ranges = argsToRanges(arguments);
-    return function(cm) { cm.setSelections(ranges, 0); };
-  }
-
-  function hasSel() {
-    var ranges = argsToRanges(arguments);
-    return function(cm) {
-      var sels = cm.listSelections();
-      if (sels.length != ranges.length)
-        throw new Failure("Expected " + ranges.length + " selections, but found " + sels.length);
-      for (var i = 0; i < sels.length; i++) {
-        eqCharPos(sels[i].anchor, ranges[i].anchor, "anchor " + i);
-        eqCharPos(sels[i].head, ranges[i].head, "head " + i);
-      }
-    };
-  }
-
-  stTest("bySubword", "the foo_bar DooDahBah \n a",
-         "goSubwordLeft", at(0, 0),
-         "goSubwordRight", at(0, 3),
-         "goSubwordRight", at(0, 7),
-         "goSubwordRight", at(0, 11),
-         "goSubwordRight", at(0, 15),
-         "goSubwordRight", at(0, 18),
-         "goSubwordRight", at(0, 21),
-         "goSubwordRight", at(0, 22),
-         "goSubwordRight", at(1, 0),
-         "goSubwordRight", at(1, 2),
-         "goSubwordRight", at(1, 2),
-         "goSubwordLeft", at(1, 1),
-         "goSubwordLeft", at(1, 0),
-         "goSubwordLeft", at(0, 22),
-         "goSubwordLeft", at(0, 18),
-         "goSubwordLeft", at(0, 15),
-         "goSubwordLeft", at(0, 12),
-         "goSubwordLeft", at(0, 8),
-         "goSubwordLeft", at(0, 4),
-         "goSubwordLeft", at(0, 0));
-
-  stTest("splitSelectionByLine", "abc\ndef\nghi",
-         setSel(0, 1, 2, 2),
-         "splitSelectionByLine",
-         hasSel(0, 1, 0, 3,
-                1, 0, 1, 3,
-                2, 0, 2, 2));
-
-  stTest("splitSelectionByLineMulti", "abc\ndef\nghi\njkl",
-         setSel(0, 1, 1, 1,
-                1, 2, 3, 2,
-                3, 3, 3, 3),
-         "splitSelectionByLine",
-         hasSel(0, 1, 0, 3,
-                1, 0, 1, 1,
-                1, 2, 1, 3,
-                2, 0, 2, 3,
-                3, 0, 3, 2,
-                3, 3, 3, 3));
-
-  stTest("selectLine", "abc\ndef\nghi",
-         setSel(0, 1, 0, 1,
-                2, 0, 2, 1),
-         "selectLine",
-         hasSel(0, 0, 1, 0,
-                2, 0, 2, 3),
-         setSel(0, 1, 1, 0),
-         "selectLine",
-         hasSel(0, 0, 2, 0));
-
-  stTest("insertLineAfter", "abcde\nfghijkl\nmn",
-         setSel(0, 1, 0, 1,
-                0, 3, 0, 3,
-                1, 2, 1, 2,
-                1, 3, 1, 5), "insertLineAfter",
-         hasSel(1, 0, 1, 0,
-                3, 0, 3, 0), val("abcde\n\nfghijkl\n\nmn"));
-
-  stTest("insertLineBefore", "abcde\nfghijkl\nmn",
-         setSel(0, 1, 0, 1,
-                0, 3, 0, 3,
-                1, 2, 1, 2,
-                1, 3, 1, 5), "insertLineBefore",
-         hasSel(0, 0, 0, 0,
-                2, 0, 2, 0), val("\nabcde\n\nfghijkl\nmn"));
-
-  stTest("selectNextOccurrence", "a foo bar\nfoobar foo",
-         setSel(0, 2, 0, 5),
-         "selectNextOccurrence", hasSel(0, 2, 0, 5,
-                                        1, 0, 1, 3),
-         "selectNextOccurrence", hasSel(0, 2, 0, 5,
-                                        1, 0, 1, 3,
-                                        1, 7, 1, 10),
-         "selectNextOccurrence", hasSel(0, 2, 0, 5,
-                                        1, 0, 1, 3,
-                                        1, 7, 1, 10),
-         Pos(0, 3), "selectNextOccurrence", hasSel(0, 2, 0, 5),
-        "selectNextOccurrence", hasSel(0, 2, 0, 5,
-                                       1, 7, 1, 10),
-         setSel(0, 6, 0, 9),
-         "selectNextOccurrence", hasSel(0, 6, 0, 9,
-                                        1, 3, 1, 6));
-
-  stTest("selectScope", "foo(a) {\n  bar[1, 2];\n}",
-         "selectScope", hasSel(0, 0, 2, 1),
-         Pos(0, 4), "selectScope", hasSel(0, 4, 0, 5),
-         Pos(0, 5), "selectScope", hasSel(0, 4, 0, 5),
-         Pos(0, 6), "selectScope", hasSel(0, 0, 2, 1),
-         Pos(0, 8), "selectScope", hasSel(0, 8, 2, 0),
-         Pos(1, 2), "selectScope", hasSel(0, 8, 2, 0),
-         Pos(1, 6), "selectScope", hasSel(1, 6, 1, 10),
-         Pos(1, 9), "selectScope", hasSel(1, 6, 1, 10));
-
-  stTest("goToBracket", "foo(a) {\n  bar[1, 2];\n}",
-         Pos(0, 0), "goToBracket", at(0, 0),
-         Pos(0, 4), "goToBracket", at(0, 5), "goToBracket", at(0, 4),
-         Pos(0, 8), "goToBracket", at(2, 0), "goToBracket", at(0, 8),
-         Pos(1, 2), "goToBracket", at(2, 0),
-         Pos(1, 7), "goToBracket", at(1, 10), "goToBracket", at(1, 6));
-
-  stTest("swapLine", "1\n2\n3---\n4\n5",
-         "swapLineDown", val("2\n1\n3---\n4\n5"),
-         "swapLineUp", val("1\n2\n3---\n4\n5"),
-         "swapLineUp", val("1\n2\n3---\n4\n5"),
-         Pos(4, 1), "swapLineDown", val("1\n2\n3---\n4\n5"),
-         setSel(0, 1, 0, 1,
-                1, 0, 2, 0,
-                2, 2, 2, 2),
-         "swapLineDown", val("4\n1\n2\n3---\n5"),
-         hasSel(1, 1, 1, 1,
-                2, 0, 3, 0,
-                3, 2, 3, 2),
-         "swapLineUp", val("1\n2\n3---\n4\n5"),
-         hasSel(0, 1, 0, 1,
-                1, 0, 2, 0,
-                2, 2, 2, 2));
-
-  stTest("swapLineEmptyBottomSel", "1\n2\n3",
-         setSel(0, 1, 1, 0),
-         "swapLineDown", val("2\n1\n3"), hasSel(1, 1, 2, 0),
-         "swapLineUp", val("1\n2\n3"), hasSel(0, 1, 1, 0),
-         "swapLineUp", val("1\n2\n3"), hasSel(0, 0, 0, 0));
-
-  stTest("swapLineUpFromEnd", "a\nb\nc",
-         Pos(2, 1), "swapLineUp",
-         hasSel(1, 1, 1, 1), val("a\nc\nb"));
-
-  stTest("joinLines", "abc\ndef\nghi\njkl",
-         "joinLines", val("abc def\nghi\njkl"), at(0, 4),
-         "undo",
-         setSel(0, 2, 1, 1), "joinLines",
-         val("abc def ghi\njkl"), hasSel(0, 2, 0, 8),
-         "undo",
-         setSel(0, 1, 0, 1,
-                1, 1, 1, 1,
-                3, 1, 3, 1), "joinLines",
-         val("abc def ghi\njkl"), hasSel(0, 4, 0, 4,
-                                         0, 8, 0, 8,
-                                         1, 3, 1, 3));
-
-  stTest("duplicateLine", "abc\ndef\nghi",
-         Pos(1, 0), "duplicateLine", val("abc\ndef\ndef\nghi"), at(2, 0),
-         "undo",
-         setSel(0, 1, 0, 1,
-                1, 1, 1, 1,
-                2, 1, 2, 1), "duplicateLine",
-         val("abc\nabc\ndef\ndef\nghi\nghi"), hasSel(1, 1, 1, 1,
-                                                     3, 1, 3, 1,
-                                                     5, 1, 5, 1));
-  stTest("duplicateLineSelection", "abcdef",
-         setSel(0, 1, 0, 1,
-                0, 2, 0, 4,
-                0, 5, 0, 5),
-         "duplicateLine",
-         val("abcdef\nabcdcdef\nabcdcdef"), hasSel(2, 1, 2, 1,
-                                                   2, 4, 2, 6,
-                                                   2, 7, 2, 7));
-
-  stTest("selectLinesUpward", "123\n345\n789\n012",
-         setSel(0, 1, 0, 1,
-                1, 1, 1, 3,
-                2, 0, 2, 0,
-                3, 0, 3, 0),
-         "selectLinesUpward",
-         hasSel(0, 1, 0, 1,
-                0, 3, 0, 3,
-                1, 0, 1, 0,
-                1, 1, 1, 3,
-                2, 0, 2, 0,
-                3, 0, 3, 0));
-
-  stTest("selectLinesDownward", "123\n345\n789\n012",
-         setSel(0, 1, 0, 1,
-                1, 1, 1, 3,
-                2, 0, 2, 0,
-                3, 0, 3, 0),
-         "selectLinesDownward",
-         hasSel(0, 1, 0, 1,
-                1, 1, 1, 3,
-                2, 0, 2, 0,
-                2, 3, 2, 3,
-                3, 0, 3, 0));
-
-  stTest("sortLines", "c\nb\na\nC\nB\nA",
-         "sortLines", val("A\nB\nC\na\nb\nc"),
-         "undo",
-         setSel(0, 0, 2, 0,
-                3, 0, 5, 0),
-         "sortLines", val("b\nc\na\nB\nC\nA"),
-         hasSel(0, 0, 2, 0,
-                3, 0, 5, 0),
-         "undo",
-         setSel(1, 0, 5, 0), "sortLinesInsensitive", val("c\na\nB\nb\nC\nA"));
-
-  stTest("bookmarks", "abc\ndef\nghi\njkl",
-         Pos(0, 1), "toggleBookmark",
-         setSel(1, 1, 1, 2), "toggleBookmark",
-         setSel(2, 1, 2, 2), "toggleBookmark",
-         "nextBookmark", hasSel(0, 1, 0, 1),
-         "nextBookmark", hasSel(1, 1, 1, 2),
-         "nextBookmark", hasSel(2, 1, 2, 2),
-         "prevBookmark", hasSel(1, 1, 1, 2),
-         "prevBookmark", hasSel(0, 1, 0, 1),
-         "prevBookmark", hasSel(2, 1, 2, 2),
-         "prevBookmark", hasSel(1, 1, 1, 2),
-         "toggleBookmark",
-         "prevBookmark", hasSel(2, 1, 2, 2),
-         "prevBookmark", hasSel(0, 1, 0, 1),
-         "selectBookmarks", hasSel(0, 1, 0, 1,
-                                   2, 1, 2, 2),
-         "clearBookmarks",
-         Pos(0, 0), "selectBookmarks", at(0, 0));
-
-  stTest("smartBackspace", "  foo\n    bar",
-         setSel(0, 2, 0, 2, 1, 4, 1, 4, 1, 6, 1, 6), "smartBackspace",
-         val("foo\n  br"))
-
-  stTest("upAndDowncaseAtCursor", "abc\ndef  x\nghI",
-         setSel(0, 1, 0, 3,
-                1, 1, 1, 1,
-                1, 4, 1, 4), "upcaseAtCursor",
-         val("aBC\nDEF  x\nghI"), hasSel(0, 1, 0, 3,
-                                         1, 3, 1, 3,
-                                         1, 4, 1, 4),
-         "downcaseAtCursor",
-         val("abc\ndef  x\nghI"), hasSel(0, 1, 0, 3,
-                                         1, 3, 1, 3,
-                                         1, 4, 1, 4));
-
-  stTest("mark", "abc\ndef\nghi",
-         Pos(1, 1), "setSublimeMark",
-         Pos(2, 1), "selectToSublimeMark", hasSel(2, 1, 1, 1),
-         Pos(0, 1), "swapWithSublimeMark", at(1, 1), "swapWithSublimeMark", at(0, 1),
-         "deleteToSublimeMark", val("aef\nghi"),
-         "sublimeYank", val("abc\ndef\nghi"), at(1, 1));
-
-  stTest("findUnder", "foo foobar  a",
-         "findUnder", hasSel(0, 4, 0, 7),
-         "findUnder", hasSel(0, 0, 0, 3),
-         "findUnderPrevious", hasSel(0, 4, 0, 7),
-         "findUnderPrevious", hasSel(0, 0, 0, 3),
-         Pos(0, 4), "findUnder", hasSel(0, 4, 0, 10),
-         Pos(0, 11), "findUnder", hasSel(0, 11, 0, 11));
-})();
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sublime_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sublime_test.js.xml
deleted file mode 100644
index 5b2a4c8de647725faf021afdfa23b1f1bfd55437..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/sublime_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>sublime_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/test.js.js
deleted file mode 100644
index b9f5aa8c4ce0301cd3cfc2fab377e7007d58d7be..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/test.js.js
+++ /dev/null
@@ -1,2416 +0,0 @@
-var Pos = CodeMirror.Pos;
-
-CodeMirror.defaults.rtlMoveVisually = true;
-
-function forEach(arr, f) {
-  for (var i = 0, e = arr.length; i < e; ++i) f(arr[i], i);
-}
-
-function addDoc(cm, width, height) {
-  var content = [], line = "";
-  for (var i = 0; i < width; ++i) line += "x";
-  for (var i = 0; i < height; ++i) content.push(line);
-  cm.setValue(content.join("\n"));
-}
-
-function byClassName(elt, cls) {
-  if (elt.getElementsByClassName) return elt.getElementsByClassName(cls);
-  var found = [], re = new RegExp("\\b" + cls + "\\b");
-  function search(elt) {
-    if (elt.nodeType == 3) return;
-    if (re.test(elt.className)) found.push(elt);
-    for (var i = 0, e = elt.childNodes.length; i < e; ++i)
-      search(elt.childNodes[i]);
-  }
-  search(elt);
-  return found;
-}
-
-var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent);
-var ie_lt9 = /MSIE [1-8]\b/.test(navigator.userAgent);
-var mac = /Mac/.test(navigator.platform);
-var phantom = /PhantomJS/.test(navigator.userAgent);
-var opera = /Opera\/\./.test(navigator.userAgent);
-var opera_version = opera && navigator.userAgent.match(/Version\/(\d+\.\d+)/);
-if (opera_version) opera_version = Number(opera_version);
-var opera_lt10 = opera && (!opera_version || opera_version < 10);
-
-namespace = "core_";
-
-test("core_fromTextArea", function() {
-  var te = document.getElementById("code");
-  te.value = "CONTENT";
-  var cm = CodeMirror.fromTextArea(te);
-  is(!te.offsetHeight);
-  eq(cm.getValue(), "CONTENT");
-  cm.setValue("foo\nbar");
-  eq(cm.getValue(), "foo\nbar");
-  cm.save();
-  is(/^foo\r?\nbar$/.test(te.value));
-  cm.setValue("xxx");
-  cm.toTextArea();
-  is(te.offsetHeight);
-  eq(te.value, "xxx");
-});
-
-testCM("getRange", function(cm) {
-  eq(cm.getLine(0), "1234");
-  eq(cm.getLine(1), "5678");
-  eq(cm.getLine(2), null);
-  eq(cm.getLine(-1), null);
-  eq(cm.getRange(Pos(0, 0), Pos(0, 3)), "123");
-  eq(cm.getRange(Pos(0, -1), Pos(0, 200)), "1234");
-  eq(cm.getRange(Pos(0, 2), Pos(1, 2)), "34\n56");
-  eq(cm.getRange(Pos(1, 2), Pos(100, 0)), "78");
-}, {value: "1234\n5678"});
-
-testCM("replaceRange", function(cm) {
-  eq(cm.getValue(), "");
-  cm.replaceRange("foo\n", Pos(0, 0));
-  eq(cm.getValue(), "foo\n");
-  cm.replaceRange("a\nb", Pos(0, 1));
-  eq(cm.getValue(), "fa\nboo\n");
-  eq(cm.lineCount(), 3);
-  cm.replaceRange("xyzzy", Pos(0, 0), Pos(1, 1));
-  eq(cm.getValue(), "xyzzyoo\n");
-  cm.replaceRange("abc", Pos(0, 0), Pos(10, 0));
-  eq(cm.getValue(), "abc");
-  eq(cm.lineCount(), 1);
-});
-
-testCM("selection", function(cm) {
-  cm.setSelection(Pos(0, 4), Pos(2, 2));
-  is(cm.somethingSelected());
-  eq(cm.getSelection(), "11\n222222\n33");
-  eqCursorPos(cm.getCursor(false), Pos(2, 2));
-  eqCursorPos(cm.getCursor(true), Pos(0, 4));
-  cm.setSelection(Pos(1, 0));
-  is(!cm.somethingSelected());
-  eq(cm.getSelection(), "");
-  eqCursorPos(cm.getCursor(true), Pos(1, 0));
-  cm.replaceSelection("abc", "around");
-  eq(cm.getSelection(), "abc");
-  eq(cm.getValue(), "111111\nabc222222\n333333");
-  cm.replaceSelection("def", "end");
-  eq(cm.getSelection(), "");
-  eqCursorPos(cm.getCursor(true), Pos(1, 3));
-  cm.setCursor(Pos(2, 1));
-  eqCursorPos(cm.getCursor(true), Pos(2, 1));
-  cm.setCursor(1, 2);
-  eqCursorPos(cm.getCursor(true), Pos(1, 2));
-}, {value: "111111\n222222\n333333"});
-
-testCM("extendSelection", function(cm) {
-  cm.setExtending(true);
-  addDoc(cm, 10, 10);
-  cm.setSelection(Pos(3, 5));
-  eqCursorPos(cm.getCursor("head"), Pos(3, 5));
-  eqCursorPos(cm.getCursor("anchor"), Pos(3, 5));
-  cm.setSelection(Pos(2, 5), Pos(5, 5));
-  eqCursorPos(cm.getCursor("head"), Pos(5, 5));
-  eqCursorPos(cm.getCursor("anchor"), Pos(2, 5));
-  eqCursorPos(cm.getCursor("start"), Pos(2, 5));
-  eqCursorPos(cm.getCursor("end"), Pos(5, 5));
-  cm.setSelection(Pos(5, 5), Pos(2, 5));
-  eqCursorPos(cm.getCursor("head"), Pos(2, 5));
-  eqCursorPos(cm.getCursor("anchor"), Pos(5, 5));
-  eqCursorPos(cm.getCursor("start"), Pos(2, 5));
-  eqCursorPos(cm.getCursor("end"), Pos(5, 5));
-  cm.extendSelection(Pos(3, 2));
-  eqCursorPos(cm.getCursor("head"), Pos(3, 2));
-  eqCursorPos(cm.getCursor("anchor"), Pos(5, 5));
-  cm.extendSelection(Pos(6, 2));
-  eqCursorPos(cm.getCursor("head"), Pos(6, 2));
-  eqCursorPos(cm.getCursor("anchor"), Pos(5, 5));
-  cm.extendSelection(Pos(6, 3), Pos(6, 4));
-  eqCursorPos(cm.getCursor("head"), Pos(6, 4));
-  eqCursorPos(cm.getCursor("anchor"), Pos(5, 5));
-  cm.extendSelection(Pos(0, 3), Pos(0, 4));
-  eqCursorPos(cm.getCursor("head"), Pos(0, 3));
-  eqCursorPos(cm.getCursor("anchor"), Pos(5, 5));
-  cm.extendSelection(Pos(4, 5), Pos(6, 5));
-  eqCursorPos(cm.getCursor("head"), Pos(6, 5));
-  eqCursorPos(cm.getCursor("anchor"), Pos(4, 5));
-  cm.setExtending(false);
-  cm.extendSelection(Pos(0, 3), Pos(0, 4));
-  eqCursorPos(cm.getCursor("head"), Pos(0, 3));
-  eqCursorPos(cm.getCursor("anchor"), Pos(0, 4));
-});
-
-testCM("lines", function(cm) {
-  eq(cm.getLine(0), "111111");
-  eq(cm.getLine(1), "222222");
-  eq(cm.getLine(-1), null);
-  cm.replaceRange("", Pos(1, 0), Pos(2, 0))
-  cm.replaceRange("abc", Pos(1, 0), Pos(1));
-  eq(cm.getValue(), "111111\nabc");
-}, {value: "111111\n222222\n333333"});
-
-testCM("indent", function(cm) {
-  cm.indentLine(1);
-  eq(cm.getLine(1), "   blah();");
-  cm.setOption("indentUnit", 8);
-  cm.indentLine(1);
-  eq(cm.getLine(1), "\tblah();");
-  cm.setOption("indentUnit", 10);
-  cm.setOption("tabSize", 4);
-  cm.indentLine(1);
-  eq(cm.getLine(1), "\t\t  blah();");
-}, {value: "if (x) {\nblah();\n}", indentUnit: 3, indentWithTabs: true, tabSize: 8});
-
-testCM("indentByNumber", function(cm) {
-  cm.indentLine(0, 2);
-  eq(cm.getLine(0), "  foo");
-  cm.indentLine(0, -200);
-  eq(cm.getLine(0), "foo");
-  cm.setSelection(Pos(0, 0), Pos(1, 2));
-  cm.indentSelection(3);
-  eq(cm.getValue(), "   foo\n   bar\nbaz");
-}, {value: "foo\nbar\nbaz"});
-
-test("core_defaults", function() {
-  var defsCopy = {}, defs = CodeMirror.defaults;
-  for (var opt in defs) defsCopy[opt] = defs[opt];
-  defs.indentUnit = 5;
-  defs.value = "uu";
-  defs.indentWithTabs = true;
-  defs.tabindex = 55;
-  var place = document.getElementById("testground"), cm = CodeMirror(place);
-  try {
-    eq(cm.getOption("indentUnit"), 5);
-    cm.setOption("indentUnit", 10);
-    eq(defs.indentUnit, 5);
-    eq(cm.getValue(), "uu");
-    eq(cm.getOption("indentWithTabs"), true);
-    eq(cm.getInputField().tabIndex, 55);
-  }
-  finally {
-    for (var opt in defsCopy) defs[opt] = defsCopy[opt];
-    place.removeChild(cm.getWrapperElement());
-  }
-});
-
-testCM("lineInfo", function(cm) {
-  eq(cm.lineInfo(-1), null);
-  var mark = document.createElement("span");
-  var lh = cm.setGutterMarker(1, "FOO", mark);
-  var info = cm.lineInfo(1);
-  eq(info.text, "222222");
-  eq(info.gutterMarkers.FOO, mark);
-  eq(info.line, 1);
-  eq(cm.lineInfo(2).gutterMarkers, null);
-  cm.setGutterMarker(lh, "FOO", null);
-  eq(cm.lineInfo(1).gutterMarkers, null);
-  cm.setGutterMarker(1, "FOO", mark);
-  cm.setGutterMarker(0, "FOO", mark);
-  cm.clearGutter("FOO");
-  eq(cm.lineInfo(0).gutterMarkers, null);
-  eq(cm.lineInfo(1).gutterMarkers, null);
-}, {value: "111111\n222222\n333333"});
-
-testCM("coords", function(cm) {
-  cm.setSize(null, 100);
-  addDoc(cm, 32, 200);
-  var top = cm.charCoords(Pos(0, 0));
-  var bot = cm.charCoords(Pos(200, 30));
-  is(top.left < bot.left);
-  is(top.top < bot.top);
-  is(top.top < top.bottom);
-  cm.scrollTo(null, 100);
-  var top2 = cm.charCoords(Pos(0, 0));
-  is(top.top > top2.top);
-  eq(top.left, top2.left);
-});
-
-testCM("coordsChar", function(cm) {
-  addDoc(cm, 35, 70);
-  for (var i = 0; i < 2; ++i) {
-    var sys = i ? "local" : "page";
-    for (var ch = 0; ch <= 35; ch += 5) {
-      for (var line = 0; line < 70; line += 5) {
-        cm.setCursor(line, ch);
-        var coords = cm.charCoords(Pos(line, ch), sys);
-        var pos = cm.coordsChar({left: coords.left + 1, top: coords.top + 1}, sys);
-        eqCharPos(pos, Pos(line, ch));
-      }
-    }
-  }
-}, {lineNumbers: true});
-
-testCM("posFromIndex", function(cm) {
-  cm.setValue(
-    "This function should\n" +
-    "convert a zero based index\n" +
-    "to line and ch."
-  );
-
-  var examples = [
-    { index: -1, line: 0, ch: 0  }, // <- Tests clipping
-    { index: 0,  line: 0, ch: 0  },
-    { index: 10, line: 0, ch: 10 },
-    { index: 39, line: 1, ch: 18 },
-    { index: 55, line: 2, ch: 7  },
-    { index: 63, line: 2, ch: 15 },
-    { index: 64, line: 2, ch: 15 }  // <- Tests clipping
-  ];
-
-  for (var i = 0; i < examples.length; i++) {
-    var example = examples[i];
-    var pos = cm.posFromIndex(example.index);
-    eq(pos.line, example.line);
-    eq(pos.ch, example.ch);
-    if (example.index >= 0 && example.index < 64)
-      eq(cm.indexFromPos(pos), example.index);
-  }
-});
-
-testCM("undo", function(cm) {
-  cm.replaceRange("def", Pos(0, 0), Pos(0));
-  eq(cm.historySize().undo, 1);
-  cm.undo();
-  eq(cm.getValue(), "abc");
-  eq(cm.historySize().undo, 0);
-  eq(cm.historySize().redo, 1);
-  cm.redo();
-  eq(cm.getValue(), "def");
-  eq(cm.historySize().undo, 1);
-  eq(cm.historySize().redo, 0);
-  cm.setValue("1\n\n\n2");
-  cm.clearHistory();
-  eq(cm.historySize().undo, 0);
-  for (var i = 0; i < 20; ++i) {
-    cm.replaceRange("a", Pos(0, 0));
-    cm.replaceRange("b", Pos(3, 0));
-  }
-  eq(cm.historySize().undo, 40);
-  for (var i = 0; i < 40; ++i)
-    cm.undo();
-  eq(cm.historySize().redo, 40);
-  eq(cm.getValue(), "1\n\n\n2");
-}, {value: "abc"});
-
-testCM("undoDepth", function(cm) {
-  cm.replaceRange("d", Pos(0));
-  cm.replaceRange("e", Pos(0));
-  cm.replaceRange("f", Pos(0));
-  cm.undo(); cm.undo(); cm.undo();
-  eq(cm.getValue(), "abcd");
-}, {value: "abc", undoDepth: 4});
-
-testCM("undoDoesntClearValue", function(cm) {
-  cm.undo();
-  eq(cm.getValue(), "x");
-}, {value: "x"});
-
-testCM("undoMultiLine", function(cm) {
-  cm.operation(function() {
-    cm.replaceRange("x", Pos(0, 0));
-    cm.replaceRange("y", Pos(1, 0));
-  });
-  cm.undo();
-  eq(cm.getValue(), "abc\ndef\nghi");
-  cm.operation(function() {
-    cm.replaceRange("y", Pos(1, 0));
-    cm.replaceRange("x", Pos(0, 0));
-  });
-  cm.undo();
-  eq(cm.getValue(), "abc\ndef\nghi");
-  cm.operation(function() {
-    cm.replaceRange("y", Pos(2, 0));
-    cm.replaceRange("x", Pos(1, 0));
-    cm.replaceRange("z", Pos(2, 0));
-  });
-  cm.undo();
-  eq(cm.getValue(), "abc\ndef\nghi", 3);
-}, {value: "abc\ndef\nghi"});
-
-testCM("undoComposite", function(cm) {
-  cm.replaceRange("y", Pos(1));
-  cm.operation(function() {
-    cm.replaceRange("x", Pos(0));
-    cm.replaceRange("z", Pos(2));
-  });
-  eq(cm.getValue(), "ax\nby\ncz\n");
-  cm.undo();
-  eq(cm.getValue(), "a\nby\nc\n");
-  cm.undo();
-  eq(cm.getValue(), "a\nb\nc\n");
-  cm.redo(); cm.redo();
-  eq(cm.getValue(), "ax\nby\ncz\n");
-}, {value: "a\nb\nc\n"});
-
-testCM("undoSelection", function(cm) {
-  cm.setSelection(Pos(0, 2), Pos(0, 4));
-  cm.replaceSelection("");
-  cm.setCursor(Pos(1, 0));
-  cm.undo();
-  eqCursorPos(cm.getCursor(true), Pos(0, 2));
-  eqCursorPos(cm.getCursor(false), Pos(0, 4));
-  cm.setCursor(Pos(1, 0));
-  cm.redo();
-  eqCursorPos(cm.getCursor(true), Pos(0, 2));
-  eqCursorPos(cm.getCursor(false), Pos(0, 2));
-}, {value: "abcdefgh\n"});
-
-testCM("undoSelectionAsBefore", function(cm) {
-  cm.replaceSelection("abc", "around");
-  cm.undo();
-  cm.redo();
-  eq(cm.getSelection(), "abc");
-});
-
-testCM("selectionChangeConfusesHistory", function(cm) {
-  cm.replaceSelection("abc", null, "dontmerge");
-  cm.operation(function() {
-    cm.setCursor(Pos(0, 0));
-    cm.replaceSelection("abc", null, "dontmerge");
-  });
-  eq(cm.historySize().undo, 2);
-});
-
-testCM("markTextSingleLine", function(cm) {
-  forEach([{a: 0, b: 1, c: "", f: 2, t: 5},
-           {a: 0, b: 4, c: "", f: 0, t: 2},
-           {a: 1, b: 2, c: "x", f: 3, t: 6},
-           {a: 4, b: 5, c: "", f: 3, t: 5},
-           {a: 4, b: 5, c: "xx", f: 3, t: 7},
-           {a: 2, b: 5, c: "", f: 2, t: 3},
-           {a: 2, b: 5, c: "abcd", f: 6, t: 7},
-           {a: 2, b: 6, c: "x", f: null, t: null},
-           {a: 3, b: 6, c: "", f: null, t: null},
-           {a: 0, b: 9, c: "hallo", f: null, t: null},
-           {a: 4, b: 6, c: "x", f: 3, t: 4},
-           {a: 4, b: 8, c: "", f: 3, t: 4},
-           {a: 6, b: 6, c: "a", f: 3, t: 6},
-           {a: 8, b: 9, c: "", f: 3, t: 6}], function(test) {
-    cm.setValue("1234567890");
-    var r = cm.markText(Pos(0, 3), Pos(0, 6), {className: "foo"});
-    cm.replaceRange(test.c, Pos(0, test.a), Pos(0, test.b));
-    var f = r.find();
-    eq(f && f.from.ch, test.f); eq(f && f.to.ch, test.t);
-  });
-});
-
-testCM("markTextMultiLine", function(cm) {
-  function p(v) { return v && Pos(v[0], v[1]); }
-  forEach([{a: [0, 0], b: [0, 5], c: "", f: [0, 0], t: [2, 5]},
-           {a: [0, 0], b: [0, 5], c: "foo\n", f: [1, 0], t: [3, 5]},
-           {a: [0, 1], b: [0, 10], c: "", f: [0, 1], t: [2, 5]},
-           {a: [0, 5], b: [0, 6], c: "x", f: [0, 6], t: [2, 5]},
-           {a: [0, 0], b: [1, 0], c: "", f: [0, 0], t: [1, 5]},
-           {a: [0, 6], b: [2, 4], c: "", f: [0, 5], t: [0, 7]},
-           {a: [0, 6], b: [2, 4], c: "aa", f: [0, 5], t: [0, 9]},
-           {a: [1, 2], b: [1, 8], c: "", f: [0, 5], t: [2, 5]},
-           {a: [0, 5], b: [2, 5], c: "xx", f: null, t: null},
-           {a: [0, 0], b: [2, 10], c: "x", f: null, t: null},
-           {a: [1, 5], b: [2, 5], c: "", f: [0, 5], t: [1, 5]},
-           {a: [2, 0], b: [2, 3], c: "", f: [0, 5], t: [2, 2]},
-           {a: [2, 5], b: [3, 0], c: "a\nb", f: [0, 5], t: [2, 5]},
-           {a: [2, 3], b: [3, 0], c: "x", f: [0, 5], t: [2, 3]},
-           {a: [1, 1], b: [1, 9], c: "1\n2\n3", f: [0, 5], t: [4, 5]}], function(test) {
-    cm.setValue("aaaaaaaaaa\nbbbbbbbbbb\ncccccccccc\ndddddddd\n");
-    var r = cm.markText(Pos(0, 5), Pos(2, 5),
-                        {className: "CodeMirror-matchingbracket"});
-    cm.replaceRange(test.c, p(test.a), p(test.b));
-    var f = r.find();
-    eqCursorPos(f && f.from, p(test.f)); eqCursorPos(f && f.to, p(test.t));
-  });
-});
-
-testCM("markTextUndo", function(cm) {
-  var marker1, marker2, bookmark;
-  marker1 = cm.markText(Pos(0, 1), Pos(0, 3),
-                        {className: "CodeMirror-matchingbracket"});
-  marker2 = cm.markText(Pos(0, 0), Pos(2, 1),
-                        {className: "CodeMirror-matchingbracket"});
-  bookmark = cm.setBookmark(Pos(1, 5));
-  cm.operation(function(){
-    cm.replaceRange("foo", Pos(0, 2));
-    cm.replaceRange("bar\nbaz\nbug\n", Pos(2, 0), Pos(3, 0));
-  });
-  var v1 = cm.getValue();
-  cm.setValue("");
-  eq(marker1.find(), null); eq(marker2.find(), null); eq(bookmark.find(), null);
-  cm.undo();
-  eqCursorPos(bookmark.find(), Pos(1, 5), "still there");
-  cm.undo();
-  var m1Pos = marker1.find(), m2Pos = marker2.find();
-  eqCursorPos(m1Pos.from, Pos(0, 1)); eqCursorPos(m1Pos.to, Pos(0, 3));
-  eqCursorPos(m2Pos.from, Pos(0, 0)); eqCursorPos(m2Pos.to, Pos(2, 1));
-  eqCursorPos(bookmark.find(), Pos(1, 5));
-  cm.redo(); cm.redo();
-  eq(bookmark.find(), null);
-  cm.undo();
-  eqCursorPos(bookmark.find(), Pos(1, 5));
-  eq(cm.getValue(), v1);
-}, {value: "1234\n56789\n00\n"});
-
-testCM("markTextStayGone", function(cm) {
-  var m1 = cm.markText(Pos(0, 0), Pos(0, 1));
-  cm.replaceRange("hi", Pos(0, 2));
-  m1.clear();
-  cm.undo();
-  eq(m1.find(), null);
-}, {value: "hello"});
-
-testCM("markTextAllowEmpty", function(cm) {
-  var m1 = cm.markText(Pos(0, 1), Pos(0, 2), {clearWhenEmpty: false});
-  is(m1.find());
-  cm.replaceRange("x", Pos(0, 0));
-  is(m1.find());
-  cm.replaceRange("y", Pos(0, 2));
-  is(m1.find());
-  cm.replaceRange("z", Pos(0, 3), Pos(0, 4));
-  is(!m1.find());
-  var m2 = cm.markText(Pos(0, 1), Pos(0, 2), {clearWhenEmpty: false,
-                                              inclusiveLeft: true,
-                                              inclusiveRight: true});
-  cm.replaceRange("q", Pos(0, 1), Pos(0, 2));
-  is(m2.find());
-  cm.replaceRange("", Pos(0, 0), Pos(0, 3));
-  is(!m2.find());
-  var m3 = cm.markText(Pos(0, 1), Pos(0, 1), {clearWhenEmpty: false});
-  cm.replaceRange("a", Pos(0, 3));
-  is(m3.find());
-  cm.replaceRange("b", Pos(0, 1));
-  is(!m3.find());
-}, {value: "abcde"});
-
-testCM("markTextStacked", function(cm) {
-  var m1 = cm.markText(Pos(0, 0), Pos(0, 0), {clearWhenEmpty: false});
-  var m2 = cm.markText(Pos(0, 0), Pos(0, 0), {clearWhenEmpty: false});
-  cm.replaceRange("B", Pos(0, 1));
-  is(m1.find() && m2.find());
-}, {value: "A"});
-
-testCM("undoPreservesNewMarks", function(cm) {
-  cm.markText(Pos(0, 3), Pos(0, 4));
-  cm.markText(Pos(1, 1), Pos(1, 3));
-  cm.replaceRange("", Pos(0, 3), Pos(3, 1));
-  var mBefore = cm.markText(Pos(0, 0), Pos(0, 1));
-  var mAfter = cm.markText(Pos(0, 5), Pos(0, 6));
-  var mAround = cm.markText(Pos(0, 2), Pos(0, 4));
-  cm.undo();
-  eqCursorPos(mBefore.find().from, Pos(0, 0));
-  eqCursorPos(mBefore.find().to, Pos(0, 1));
-  eqCursorPos(mAfter.find().from, Pos(3, 3));
-  eqCursorPos(mAfter.find().to, Pos(3, 4));
-  eqCursorPos(mAround.find().from, Pos(0, 2));
-  eqCursorPos(mAround.find().to, Pos(3, 2));
-  var found = cm.findMarksAt(Pos(2, 2));
-  eq(found.length, 1);
-  eq(found[0], mAround);
-}, {value: "aaaa\nbbbb\ncccc\ndddd"});
-
-testCM("markClearBetween", function(cm) {
-  cm.setValue("aaa\nbbb\nccc\nddd\n");
-  cm.markText(Pos(0, 0), Pos(2));
-  cm.replaceRange("aaa\nbbb\nccc", Pos(0, 0), Pos(2));
-  eq(cm.findMarksAt(Pos(1, 1)).length, 0);
-});
-
-testCM("findMarksMiddle", function(cm) {
-  var mark = cm.markText(Pos(1, 1), Pos(3, 1));
-  var found = cm.findMarks(Pos(2, 1), Pos(2, 2));
-  eq(found.length, 1);
-  eq(found[0], mark);
-}, {value: "line 0\nline 1\nline 2\nline 3"});
-
-testCM("deleteSpanCollapsedInclusiveLeft", function(cm) {
-  var from = Pos(1, 0), to = Pos(1, 1);
-  var m = cm.markText(from, to, {collapsed: true, inclusiveLeft: true});
-  // Delete collapsed span.
-  cm.replaceRange("", from, to);
-}, {value: "abc\nX\ndef"});
-
-testCM("markTextCSS", function(cm) {
-  function present() {
-    var spans = cm.display.lineDiv.getElementsByTagName("span");
-    for (var i = 0; i < spans.length; i++)
-      if (spans[i].style.color == "cyan" && span[i].textContent == "cdefg") return true;
-  }
-  var m = cm.markText(Pos(0, 2), Pos(0, 6), {css: "color: cyan"});
-  m.clear();
-  is(!present());
-}, {value: "abcdefgh"});
-
-testCM("bookmark", function(cm) {
-  function p(v) { return v && Pos(v[0], v[1]); }
-  forEach([{a: [1, 0], b: [1, 1], c: "", d: [1, 4]},
-           {a: [1, 1], b: [1, 1], c: "xx", d: [1, 7]},
-           {a: [1, 4], b: [1, 5], c: "ab", d: [1, 6]},
-           {a: [1, 4], b: [1, 6], c: "", d: null},
-           {a: [1, 5], b: [1, 6], c: "abc", d: [1, 5]},
-           {a: [1, 6], b: [1, 8], c: "", d: [1, 5]},
-           {a: [1, 4], b: [1, 4], c: "\n\n", d: [3, 1]},
-           {bm: [1, 9], a: [1, 1], b: [1, 1], c: "\n", d: [2, 8]}], function(test) {
-    cm.setValue("1234567890\n1234567890\n1234567890");
-    var b = cm.setBookmark(p(test.bm) || Pos(1, 5));
-    cm.replaceRange(test.c, p(test.a), p(test.b));
-    eqCursorPos(b.find(), p(test.d));
-  });
-});
-
-testCM("bookmarkInsertLeft", function(cm) {
-  var br = cm.setBookmark(Pos(0, 2), {insertLeft: false});
-  var bl = cm.setBookmark(Pos(0, 2), {insertLeft: true});
-  cm.setCursor(Pos(0, 2));
-  cm.replaceSelection("hi");
-  eqCursorPos(br.find(), Pos(0, 2));
-  eqCursorPos(bl.find(), Pos(0, 4));
-  cm.replaceRange("", Pos(0, 4), Pos(0, 5));
-  cm.replaceRange("", Pos(0, 2), Pos(0, 4));
-  cm.replaceRange("", Pos(0, 1), Pos(0, 2));
-  // Verify that deleting next to bookmarks doesn't kill them
-  eqCursorPos(br.find(), Pos(0, 1));
-  eqCursorPos(bl.find(), Pos(0, 1));
-}, {value: "abcdef"});
-
-testCM("bookmarkCursor", function(cm) {
-  var pos01 = cm.cursorCoords(Pos(0, 1)), pos11 = cm.cursorCoords(Pos(1, 1)),
-      pos20 = cm.cursorCoords(Pos(2, 0)), pos30 = cm.cursorCoords(Pos(3, 0)),
-      pos41 = cm.cursorCoords(Pos(4, 1));
-  cm.setBookmark(Pos(0, 1), {widget: document.createTextNode("鈫�"), insertLeft: true});
-  cm.setBookmark(Pos(2, 0), {widget: document.createTextNode("鈫�"), insertLeft: true});
-  cm.setBookmark(Pos(1, 1), {widget: document.createTextNode("鈫�")});
-  cm.setBookmark(Pos(3, 0), {widget: document.createTextNode("鈫�")});
-  var new01 = cm.cursorCoords(Pos(0, 1)), new11 = cm.cursorCoords(Pos(1, 1)),
-      new20 = cm.cursorCoords(Pos(2, 0)), new30 = cm.cursorCoords(Pos(3, 0));
-  near(new01.left, pos01.left, 1);
-  near(new01.top, pos01.top, 1);
-  is(new11.left > pos11.left, "at right, middle of line");
-  near(new11.top == pos11.top, 1);
-  near(new20.left, pos20.left, 1);
-  near(new20.top, pos20.top, 1);
-  is(new30.left > pos30.left, "at right, empty line");
-  near(new30.top, pos30, 1);
-  cm.setBookmark(Pos(4, 0), {widget: document.createTextNode("鈫�")});
-  is(cm.cursorCoords(Pos(4, 1)).left > pos41.left, "single-char bug");
-}, {value: "foo\nbar\n\n\nx\ny"});
-
-testCM("multiBookmarkCursor", function(cm) {
-  if (phantom) return;
-  var ms = [], m;
-  function add(insertLeft) {
-    for (var i = 0; i < 3; ++i) {
-      var node = document.createElement("span");
-      node.innerHTML = "X";
-      ms.push(cm.setBookmark(Pos(0, 1), {widget: node, insertLeft: insertLeft}));
-    }
-  }
-  var base1 = cm.cursorCoords(Pos(0, 1)).left, base4 = cm.cursorCoords(Pos(0, 4)).left;
-  add(true);
-  near(base1, cm.cursorCoords(Pos(0, 1)).left, 1);
-  while (m = ms.pop()) m.clear();
-  add(false);
-  near(base4, cm.cursorCoords(Pos(0, 1)).left, 1);
-}, {value: "abcdefg"});
-
-testCM("getAllMarks", function(cm) {
-  addDoc(cm, 10, 10);
-  var m1 = cm.setBookmark(Pos(0, 2));
-  var m2 = cm.markText(Pos(0, 2), Pos(3, 2));
-  var m3 = cm.markText(Pos(1, 2), Pos(1, 8));
-  var m4 = cm.markText(Pos(8, 0), Pos(9, 0));
-  eq(cm.getAllMarks().length, 4);
-  m1.clear();
-  m3.clear();
-  eq(cm.getAllMarks().length, 2);
-});
-
-testCM("setValueClears", function(cm) {
-  cm.addLineClass(0, "wrap", "foo");
-  var mark = cm.markText(Pos(0, 0), Pos(1, 1), {inclusiveLeft: true, inclusiveRight: true});
-  cm.setValue("foo");
-  is(!cm.lineInfo(0).wrapClass);
-  is(!mark.find());
-}, {value: "a\nb"});
-
-testCM("bug577", function(cm) {
-  cm.setValue("a\nb");
-  cm.clearHistory();
-  cm.setValue("fooooo");
-  cm.undo();
-});
-
-testCM("scrollSnap", function(cm) {
-  cm.setSize(100, 100);
-  addDoc(cm, 200, 200);
-  cm.setCursor(Pos(100, 180));
-  var info = cm.getScrollInfo();
-  is(info.left > 0 && info.top > 0);
-  cm.setCursor(Pos(0, 0));
-  info = cm.getScrollInfo();
-  is(info.left == 0 && info.top == 0, "scrolled clean to top");
-  cm.setCursor(Pos(100, 180));
-  cm.setCursor(Pos(199, 0));
-  info = cm.getScrollInfo();
-  is(info.left == 0 && info.top + 2 > info.height - cm.getScrollerElement().clientHeight, "scrolled clean to bottom");
-});
-
-testCM("scrollIntoView", function(cm) {
-  if (phantom) return;
-  var outer = cm.getWrapperElement().getBoundingClientRect();
-  function test(line, ch, msg) {
-    var pos = Pos(line, ch);
-    cm.scrollIntoView(pos);
-    var box = cm.charCoords(pos, "window");
-    is(box.left >= outer.left, msg + " (left)");
-    is(box.right <= outer.right, msg + " (right)");
-    is(box.top >= outer.top, msg + " (top)");
-    is(box.bottom <= outer.bottom, msg + " (bottom)");
-  }
-  addDoc(cm, 200, 200);
-  test(199, 199, "bottom right");
-  test(0, 0, "top left");
-  test(100, 100, "center");
-  test(199, 0, "bottom left");
-  test(0, 199, "top right");
-  test(100, 100, "center again");
-});
-
-testCM("scrollBackAndForth", function(cm) {
-  addDoc(cm, 1, 200);
-  cm.operation(function() {
-    cm.scrollIntoView(Pos(199, 0));
-    cm.scrollIntoView(Pos(4, 0));
-  });
-  is(cm.getScrollInfo().top > 0);
-});
-
-testCM("selectAllNoScroll", function(cm) {
-  addDoc(cm, 1, 200);
-  cm.execCommand("selectAll");
-  eq(cm.getScrollInfo().top, 0);
-  cm.setCursor(199);
-  cm.execCommand("selectAll");
-  is(cm.getScrollInfo().top > 0);
-});
-
-testCM("selectionPos", function(cm) {
-  if (phantom || cm.getOption("inputStyle") != "textarea") return;
-  cm.setSize(100, 100);
-  addDoc(cm, 200, 100);
-  cm.setSelection(Pos(1, 100), Pos(98, 100));
-  var lineWidth = cm.charCoords(Pos(0, 200), "local").left;
-  var lineHeight = (cm.charCoords(Pos(99)).top - cm.charCoords(Pos(0)).top) / 100;
-  cm.scrollTo(0, 0);
-  var selElt = byClassName(cm.getWrapperElement(), "CodeMirror-selected");
-  var outer = cm.getWrapperElement().getBoundingClientRect();
-  var sawMiddle, sawTop, sawBottom;
-  for (var i = 0, e = selElt.length; i < e; ++i) {
-    var box = selElt[i].getBoundingClientRect();
-    var atLeft = box.left - outer.left < 30;
-    var width = box.right - box.left;
-    var atRight = box.right - outer.left > .8 * lineWidth;
-    if (atLeft && atRight) {
-      sawMiddle = true;
-      is(box.bottom - box.top > 90 * lineHeight, "middle high");
-      is(width > .9 * lineWidth, "middle wide");
-    } else {
-      is(width > .4 * lineWidth, "top/bot wide enough");
-      is(width < .6 * lineWidth, "top/bot slim enough");
-      if (atLeft) {
-        sawBottom = true;
-        is(box.top - outer.top > 96 * lineHeight, "bot below");
-      } else if (atRight) {
-        sawTop = true;
-        is(box.top - outer.top < 2.1 * lineHeight, "top above");
-      }
-    }
-  }
-  is(sawTop && sawBottom && sawMiddle, "all parts");
-}, null);
-
-testCM("restoreHistory", function(cm) {
-  cm.setValue("abc\ndef");
-  cm.replaceRange("hello", Pos(1, 0), Pos(1));
-  cm.replaceRange("goop", Pos(0, 0), Pos(0));
-  cm.undo();
-  var storedVal = cm.getValue(), storedHist = cm.getHistory();
-  if (window.JSON) storedHist = JSON.parse(JSON.stringify(storedHist));
-  eq(storedVal, "abc\nhello");
-  cm.setValue("");
-  cm.clearHistory();
-  eq(cm.historySize().undo, 0);
-  cm.setValue(storedVal);
-  cm.setHistory(storedHist);
-  cm.redo();
-  eq(cm.getValue(), "goop\nhello");
-  cm.undo(); cm.undo();
-  eq(cm.getValue(), "abc\ndef");
-});
-
-testCM("doubleScrollbar", function(cm) {
-  var dummy = document.body.appendChild(document.createElement("p"));
-  dummy.style.cssText = "height: 50px; overflow: scroll; width: 50px";
-  var scrollbarWidth = dummy.offsetWidth + 1 - dummy.clientWidth;
-  document.body.removeChild(dummy);
-  if (scrollbarWidth < 2) return;
-  cm.setSize(null, 100);
-  addDoc(cm, 1, 300);
-  var wrap = cm.getWrapperElement();
-  is(wrap.offsetWidth - byClassName(wrap, "CodeMirror-lines")[0].offsetWidth <= scrollbarWidth * 1.5);
-});
-
-testCM("weirdLinebreaks", function(cm) {
-  cm.setValue("foo\nbar\rbaz\r\nquux\n\rplop");
-  is(cm.getValue(), "foo\nbar\nbaz\nquux\n\nplop");
-  is(cm.lineCount(), 6);
-  cm.setValue("\n\n");
-  is(cm.lineCount(), 3);
-});
-
-testCM("setSize", function(cm) {
-  cm.setSize(100, 100);
-  var wrap = cm.getWrapperElement();
-  is(wrap.offsetWidth, 100);
-  is(wrap.offsetHeight, 100);
-  cm.setSize("100%", "3em");
-  is(wrap.style.width, "100%");
-  is(wrap.style.height, "3em");
-  cm.setSize(null, 40);
-  is(wrap.style.width, "100%");
-  is(wrap.style.height, "40px");
-});
-
-function foldLines(cm, start, end, autoClear) {
-  return cm.markText(Pos(start, 0), Pos(end - 1), {
-    inclusiveLeft: true,
-    inclusiveRight: true,
-    collapsed: true,
-    clearOnEnter: autoClear
-  });
-}
-
-testCM("collapsedLines", function(cm) {
-  addDoc(cm, 4, 10);
-  var range = foldLines(cm, 4, 5), cleared = 0;
-  CodeMirror.on(range, "clear", function() {cleared++;});
-  cm.setCursor(Pos(3, 0));
-  CodeMirror.commands.goLineDown(cm);
-  eqCharPos(cm.getCursor(), Pos(5, 0));
-  cm.replaceRange("abcdefg", Pos(3, 0), Pos(3));
-  cm.setCursor(Pos(3, 6));
-  CodeMirror.commands.goLineDown(cm);
-  eqCharPos(cm.getCursor(), Pos(5, 4));
-  cm.replaceRange("ab", Pos(3, 0), Pos(3));
-  cm.setCursor(Pos(3, 2));
-  CodeMirror.commands.goLineDown(cm);
-  eqCharPos(cm.getCursor(), Pos(5, 2));
-  cm.operation(function() {range.clear(); range.clear();});
-  eq(cleared, 1);
-});
-
-testCM("collapsedRangeCoordsChar", function(cm) {
-  var pos_1_3 = cm.charCoords(Pos(1, 3));
-  pos_1_3.left += 2; pos_1_3.top += 2;
-  var opts = {collapsed: true, inclusiveLeft: true, inclusiveRight: true};
-  var m1 = cm.markText(Pos(0, 0), Pos(2, 0), opts);
-  eqCharPos(cm.coordsChar(pos_1_3), Pos(3, 3));
-  m1.clear();
-  var m1 = cm.markText(Pos(0, 0), Pos(1, 1), {collapsed: true, inclusiveLeft: true});
-  var m2 = cm.markText(Pos(1, 1), Pos(2, 0), {collapsed: true, inclusiveRight: true});
-  eqCharPos(cm.coordsChar(pos_1_3), Pos(3, 3));
-  m1.clear(); m2.clear();
-  var m1 = cm.markText(Pos(0, 0), Pos(1, 6), opts);
-  eqCharPos(cm.coordsChar(pos_1_3), Pos(3, 3));
-}, {value: "123456\nabcdef\nghijkl\nmnopqr\n"});
-
-testCM("collapsedRangeBetweenLinesSelected", function(cm) {
-  if (cm.getOption("inputStyle") != "textarea") return;
-  var widget = document.createElement("span");
-  widget.textContent = "\u2194";
-  cm.markText(Pos(0, 3), Pos(1, 0), {replacedWith: widget});
-  cm.setSelection(Pos(0, 3), Pos(1, 0));
-  var selElts = byClassName(cm.getWrapperElement(), "CodeMirror-selected");
-  for (var i = 0, w = 0; i < selElts.length; i++)
-    w += selElts[i].offsetWidth;
-  is(w > 0);
-}, {value: "one\ntwo"});
-
-testCM("randomCollapsedRanges", function(cm) {
-  addDoc(cm, 20, 500);
-  cm.operation(function() {
-    for (var i = 0; i < 200; i++) {
-      var start = Pos(Math.floor(Math.random() * 500), Math.floor(Math.random() * 20));
-      if (i % 4)
-        try { cm.markText(start, Pos(start.line + 2, 1), {collapsed: true}); }
-        catch(e) { if (!/overlapping/.test(String(e))) throw e; }
-      else
-        cm.markText(start, Pos(start.line, start.ch + 4), {"className": "foo"});
-    }
-  });
-});
-
-testCM("hiddenLinesAutoUnfold", function(cm) {
-  var range = foldLines(cm, 1, 3, true), cleared = 0;
-  CodeMirror.on(range, "clear", function() {cleared++;});
-  cm.setCursor(Pos(3, 0));
-  eq(cleared, 0);
-  cm.execCommand("goCharLeft");
-  eq(cleared, 1);
-  range = foldLines(cm, 1, 3, true);
-  CodeMirror.on(range, "clear", function() {cleared++;});
-  eqCursorPos(cm.getCursor(), Pos(3, 0));
-  cm.setCursor(Pos(0, 3));
-  cm.execCommand("goCharRight");
-  eq(cleared, 2);
-}, {value: "abc\ndef\nghi\njkl"});
-
-testCM("hiddenLinesSelectAll", function(cm) {  // Issue #484
-  addDoc(cm, 4, 20);
-  foldLines(cm, 0, 10);
-  foldLines(cm, 11, 20);
-  CodeMirror.commands.selectAll(cm);
-  eqCursorPos(cm.getCursor(true), Pos(10, 0));
-  eqCursorPos(cm.getCursor(false), Pos(10, 4));
-});
-
-
-testCM("everythingFolded", function(cm) {
-  addDoc(cm, 2, 2);
-  function enterPress() {
-    cm.triggerOnKeyDown({type: "keydown", keyCode: 13, preventDefault: function(){}, stopPropagation: function(){}});
-  }
-  var fold = foldLines(cm, 0, 2);
-  enterPress();
-  eq(cm.getValue(), "xx\nxx");
-  fold.clear();
-  fold = foldLines(cm, 0, 2, true);
-  eq(fold.find(), null);
-  enterPress();
-  eq(cm.getValue(), "\nxx\nxx");
-});
-
-testCM("structuredFold", function(cm) {
-  if (phantom) return;
-  addDoc(cm, 4, 8);
-  var range = cm.markText(Pos(1, 2), Pos(6, 2), {
-    replacedWith: document.createTextNode("Q")
-  });
-  cm.setCursor(0, 3);
-  CodeMirror.commands.goLineDown(cm);
-  eqCharPos(cm.getCursor(), Pos(6, 2));
-  CodeMirror.commands.goCharLeft(cm);
-  eqCharPos(cm.getCursor(), Pos(1, 2));
-  CodeMirror.commands.delCharAfter(cm);
-  eq(cm.getValue(), "xxxx\nxxxx\nxxxx");
-  addDoc(cm, 4, 8);
-  range = cm.markText(Pos(1, 2), Pos(6, 2), {
-    replacedWith: document.createTextNode("M"),
-    clearOnEnter: true
-  });
-  var cleared = 0;
-  CodeMirror.on(range, "clear", function(){++cleared;});
-  cm.setCursor(0, 3);
-  CodeMirror.commands.goLineDown(cm);
-  eqCharPos(cm.getCursor(), Pos(6, 2));
-  CodeMirror.commands.goCharLeft(cm);
-  eqCharPos(cm.getCursor(), Pos(6, 1));
-  eq(cleared, 1);
-  range.clear();
-  eq(cleared, 1);
-  range = cm.markText(Pos(1, 2), Pos(6, 2), {
-    replacedWith: document.createTextNode("Q"),
-    clearOnEnter: true
-  });
-  range.clear();
-  cm.setCursor(1, 2);
-  CodeMirror.commands.goCharRight(cm);
-  eqCharPos(cm.getCursor(), Pos(1, 3));
-  range = cm.markText(Pos(2, 0), Pos(4, 4), {
-    replacedWith: document.createTextNode("M")
-  });
-  cm.setCursor(1, 0);
-  CodeMirror.commands.goLineDown(cm);
-  eqCharPos(cm.getCursor(), Pos(2, 0));
-}, null);
-
-testCM("nestedFold", function(cm) {
-  addDoc(cm, 10, 3);
-  function fold(ll, cl, lr, cr) {
-    return cm.markText(Pos(ll, cl), Pos(lr, cr), {collapsed: true});
-  }
-  var inner1 = fold(0, 6, 1, 3), inner2 = fold(0, 2, 1, 8), outer = fold(0, 1, 2, 3), inner0 = fold(0, 5, 0, 6);
-  cm.setCursor(0, 1);
-  CodeMirror.commands.goCharRight(cm);
-  eqCursorPos(cm.getCursor(), Pos(2, 3));
-  inner0.clear();
-  CodeMirror.commands.goCharLeft(cm);
-  eqCursorPos(cm.getCursor(), Pos(0, 1));
-  outer.clear();
-  CodeMirror.commands.goCharRight(cm);
-  eqCursorPos(cm.getCursor(), Pos(0, 2, "before"));
-  CodeMirror.commands.goCharRight(cm);
-  eqCursorPos(cm.getCursor(), Pos(1, 8));
-  inner2.clear();
-  CodeMirror.commands.goCharLeft(cm);
-  eqCursorPos(cm.getCursor(), Pos(1, 7, "after"));
-  cm.setCursor(0, 5);
-  CodeMirror.commands.goCharRight(cm);
-  eqCursorPos(cm.getCursor(), Pos(0, 6, "before"));
-  CodeMirror.commands.goCharRight(cm);
-  eqCursorPos(cm.getCursor(), Pos(1, 3));
-});
-
-testCM("badNestedFold", function(cm) {
-  addDoc(cm, 4, 4);
-  cm.markText(Pos(0, 2), Pos(3, 2), {collapsed: true});
-  var caught;
-  try {cm.markText(Pos(0, 1), Pos(0, 3), {collapsed: true});}
-  catch(e) {caught = e;}
-  is(caught instanceof Error, "no error");
-  is(/overlap/i.test(caught.message), "wrong error");
-});
-
-testCM("nestedFoldOnSide", function(cm) {
-  var m1 = cm.markText(Pos(0, 1), Pos(2, 1), {collapsed: true, inclusiveRight: true});
-  var m2 = cm.markText(Pos(0, 1), Pos(0, 2), {collapsed: true});
-  cm.markText(Pos(0, 1), Pos(0, 2), {collapsed: true}).clear();
-  try { cm.markText(Pos(0, 1), Pos(0, 2), {collapsed: true, inclusiveLeft: true}); }
-  catch(e) { var caught = e; }
-  is(caught && /overlap/i.test(caught.message));
-  var m3 = cm.markText(Pos(2, 0), Pos(2, 1), {collapsed: true});
-  var m4 = cm.markText(Pos(2, 0), Pos(2, 1), {collapse: true, inclusiveRight: true});
-  m1.clear(); m4.clear();
-  m1 = cm.markText(Pos(0, 1), Pos(2, 1), {collapsed: true});
-  cm.markText(Pos(2, 0), Pos(2, 1), {collapsed: true}).clear();
-  try { cm.markText(Pos(2, 0), Pos(2, 1), {collapsed: true, inclusiveRight: true}); }
-  catch(e) { var caught = e; }
-  is(caught && /overlap/i.test(caught.message));
-}, {value: "ab\ncd\ef"});
-
-testCM("editInFold", function(cm) {
-  addDoc(cm, 4, 6);
-  var m = cm.markText(Pos(1, 2), Pos(3, 2), {collapsed: true});
-  cm.replaceRange("", Pos(0, 0), Pos(1, 3));
-  cm.replaceRange("", Pos(2, 1), Pos(3, 3));
-  cm.replaceRange("a\nb\nc\nd", Pos(0, 1), Pos(1, 0));
-  cm.cursorCoords(Pos(0, 0));
-});
-
-testCM("wrappingInlineWidget", function(cm) {
-  cm.setSize("11em");
-  var w = document.createElement("span");
-  w.style.color = "red";
-  w.innerHTML = "one two three four";
-  cm.markText(Pos(0, 6), Pos(0, 9), {replacedWith: w});
-  var cur0 = cm.cursorCoords(Pos(0, 0)), cur1 = cm.cursorCoords(Pos(0, 10));
-  is(cur0.top < cur1.top);
-  is(cur0.bottom < cur1.bottom);
-  var curL = cm.cursorCoords(Pos(0, 6)), curR = cm.cursorCoords(Pos(0, 9));
-  eq(curL.top, cur0.top);
-  eq(curL.bottom, cur0.bottom);
-  eq(curR.top, cur1.top);
-  eq(curR.bottom, cur1.bottom);
-  cm.replaceRange("", Pos(0, 9), Pos(0));
-  curR = cm.cursorCoords(Pos(0, 9));
-  if (phantom) return;
-  eq(curR.top, cur1.top);
-  eq(curR.bottom, cur1.bottom);
-}, {value: "1 2 3 xxx 4", lineWrapping: true});
-
-testCM("showEmptyWidgetSpan", function(cm) {
-  var marker = cm.markText(Pos(0, 2), Pos(0, 2), {
-    clearWhenEmpty: false,
-    replacedWith: document.createTextNode("X")
-  });
-  var text = cm.display.view[0].text;
-  eq(text.textContent || text.innerText, "abXc");
-}, {value: "abc"});
-
-testCM("changedInlineWidget", function(cm) {
-  cm.setSize("10em");
-  var w = document.createElement("span");
-  w.innerHTML = "x";
-  var m = cm.markText(Pos(0, 4), Pos(0, 5), {replacedWith: w});
-  w.innerHTML = "and now the widget is really really long all of a sudden and a scrollbar is needed";
-  m.changed();
-  var hScroll = byClassName(cm.getWrapperElement(), "CodeMirror-hscrollbar")[0];
-  is(hScroll.scrollWidth > hScroll.clientWidth);
-}, {value: "hello there"});
-
-testCM("changedBookmark", function(cm) {
-  cm.setSize("10em");
-  var w = document.createElement("span");
-  w.innerHTML = "x";
-  var m = cm.setBookmark(Pos(0, 4), {widget: w});
-  w.innerHTML = "and now the widget is really really long all of a sudden and a scrollbar is needed";
-  m.changed();
-  var hScroll = byClassName(cm.getWrapperElement(), "CodeMirror-hscrollbar")[0];
-  is(hScroll.scrollWidth > hScroll.clientWidth);
-}, {value: "abcdefg"});
-
-testCM("inlineWidget", function(cm) {
-  var w = cm.setBookmark(Pos(0, 2), {widget: document.createTextNode("uu")});
-  cm.setCursor(0, 2);
-  CodeMirror.commands.goLineDown(cm);
-  eqCharPos(cm.getCursor(), Pos(1, 4));
-  cm.setCursor(0, 2);
-  cm.replaceSelection("hi");
-  eqCharPos(w.find(), Pos(0, 2));
-  cm.setCursor(0, 1);
-  cm.replaceSelection("ay");
-  eqCharPos(w.find(), Pos(0, 4));
-  eq(cm.getLine(0), "uayuhiuu");
-}, {value: "uuuu\nuuuuuu"});
-
-testCM("wrappingAndResizing", function(cm) {
-  cm.setSize(null, "auto");
-  cm.setOption("lineWrapping", true);
-  var wrap = cm.getWrapperElement(), h0 = wrap.offsetHeight;
-  var doc = "xxx xxx xxx xxx xxx";
-  cm.setValue(doc);
-  for (var step = 10, w = cm.charCoords(Pos(0, 18), "div").right;; w += step) {
-    cm.setSize(w);
-    if (wrap.offsetHeight <= h0 * (opera_lt10 ? 1.2 : 1.5)) {
-      if (step == 10) { w -= 10; step = 1; }
-      else break;
-    }
-  }
-  // Ensure that putting the cursor at the end of the maximally long
-  // line doesn't cause wrapping to happen.
-  cm.setCursor(Pos(0, doc.length));
-  eq(wrap.offsetHeight, h0);
-  cm.replaceSelection("x");
-  is(wrap.offsetHeight > h0, "wrapping happens");
-  // Now add a max-height and, in a document consisting of
-  // almost-wrapped lines, go over it so that a scrollbar appears.
-  cm.setValue(doc + "\n" + doc + "\n");
-  cm.getScrollerElement().style.maxHeight = "100px";
-  cm.replaceRange("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n!\n", Pos(2, 0));
-  forEach([Pos(0, doc.length), Pos(0, doc.length - 1),
-           Pos(0, 0), Pos(1, doc.length), Pos(1, doc.length - 1)],
-          function(pos) {
-    var coords = cm.charCoords(pos);
-    eqCharPos(pos, cm.coordsChar({left: coords.left + 2, top: coords.top + 5}));
-  });
-}, null, ie_lt8);
-
-testCM("measureEndOfLine", function(cm) {
-  if (phantom) return;
-  cm.setSize(null, "auto");
-  var inner = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild;
-  var lh = inner.offsetHeight;
-  for (var step = 10, w = cm.charCoords(Pos(0, 7), "div").right;; w += step) {
-    cm.setSize(w);
-    if (inner.offsetHeight < 2.5 * lh) {
-      if (step == 10) { w -= 10; step = 1; }
-      else break;
-    }
-  }
-  cm.setValue(cm.getValue() + "\n\n");
-  var endPos = cm.charCoords(Pos(0, 18), "local");
-  is(endPos.top > lh * .8, "not at top");
-  is(endPos.left > w - 20, "at right");
-  endPos = cm.charCoords(Pos(0, 18));
-  eqCursorPos(cm.coordsChar({left: endPos.left, top: endPos.top + 5}), Pos(0, 18, "before"));
-
-  var wrapPos = cm.cursorCoords(Pos(0, 9, "before"));
-  is(wrapPos.top < endPos.top, "wrapPos is actually in first line");
-  eqCursorPos(cm.coordsChar({left: wrapPos.left + 10, top: wrapPos.top}), Pos(0, 9, "before"));
-}, {mode: "text/html", value: "<!-- foo barrr -->", lineWrapping: true}, ie_lt8 || opera_lt10);
-
-testCM("measureWrappedEndOfLine", function(cm) {
-  if (phantom) return;
-  cm.setSize(null, "auto");
-  var inner = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild;
-  var lh = inner.offsetHeight;
-  for (var step = 10, w = cm.charCoords(Pos(0, 7), "div").right;; w += step) {
-    cm.setSize(w);
-    if (inner.offsetHeight < 2.5 * lh) {
-      if (step == 10) { w -= 10; step = 1; }
-      else break;
-    }
-  }
-  for (var i = 0; i < 3; ++i) {
-    var endPos = cm.charCoords(Pos(0, 12)); // Next-to-last since last would wrap (#1862)
-    endPos.left += w; // Add width of editor just to be sure that we are behind last character
-    eqCursorPos(cm.coordsChar(endPos), Pos(0, 13, "before"));
-    endPos.left += w * 100;
-    eqCursorPos(cm.coordsChar(endPos), Pos(0, 13, "before"));
-    cm.setValue("0123456789abc丕亘噩丕亘噩丕亘噩丕亘噩");
-    if (i == 1) {
-      var node = document.createElement("div");
-      node.innerHTML = "hi"; node.style.height = "30px";
-      cm.addLineWidget(0, node, {above: true});
-    }
-  }
-}, {mode: "text/html", value: "0123456789abcde0123456789", lineWrapping: true}, ie_lt8 || opera_lt10);
-
-testCM("measureWrappedBeginOfLine", function(cm) {
-  if (phantom) return;
-  cm.setSize(null, "auto");
-  var inner = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild;
-  var lh = inner.offsetHeight;
-  for (var step = 10, w = cm.charCoords(Pos(0, 7), "div").right;; w += step) {
-    cm.setSize(w);
-    if (inner.offsetHeight < 2.5 * lh) {
-      if (step == 10) { w -= 10; step = 1; }
-      else break;
-    }
-  }
-  var beginOfSecondLine = Pos(0, 13, "after");
-  for (var i = 0; i < 2; ++i) {
-    var beginPos = cm.charCoords(Pos(0, 0));
-    beginPos.left -= w;
-    eqCursorPos(cm.coordsChar(beginPos), Pos(0, 0, "after"));
-    beginPos = cm.cursorCoords(beginOfSecondLine);
-    beginPos.left = 0;
-    eqCursorPos(cm.coordsChar(beginPos), beginOfSecondLine);
-    cm.setValue("0123456789abc丕亘噩丕亘噩丕亘噩丕亘噩");
-    beginOfSecondLine = Pos(0, 25, "before");
-  }
-}, {mode: "text/html", value: "0123456789abcde0123456789", lineWrapping: true});
-
-testCM("scrollVerticallyAndHorizontally", function(cm) {
-  if (cm.getOption("inputStyle") != "textarea") return;
-  cm.setSize(100, 100);
-  addDoc(cm, 40, 40);
-  cm.setCursor(39);
-  var wrap = cm.getWrapperElement(), bar = byClassName(wrap, "CodeMirror-vscrollbar")[0];
-  is(bar.offsetHeight < wrap.offsetHeight, "vertical scrollbar limited by horizontal one");
-  var cursorBox = byClassName(wrap, "CodeMirror-cursor")[0].getBoundingClientRect();
-  var editorBox = wrap.getBoundingClientRect();
-  is(cursorBox.bottom < editorBox.top + cm.getScrollerElement().clientHeight,
-     "bottom line visible");
-}, {lineNumbers: true});
-
-testCM("moveVstuck", function(cm) {
-  var lines = byClassName(cm.getWrapperElement(), "CodeMirror-lines")[0].firstChild, h0 = lines.offsetHeight;
-  var val = "fooooooooooooooooooooooooo baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar\n";
-  cm.setValue(val);
-  for (var w = cm.charCoords(Pos(0, 26), "div").right * 2.8;; w += 5) {
-    cm.setSize(w);
-    if (lines.offsetHeight <= 3.5 * h0) break;
-  }
-  cm.setCursor(Pos(0, val.length - 1));
-  cm.moveV(-1, "line");
-  eqCursorPos(cm.getCursor(), Pos(0, 27, "before"));
-  is(cm.cursorCoords(null, "local").top < h0, "cursor is in first visual line");
-}, {lineWrapping: true}, ie_lt8 || opera_lt10);
-
-testCM("collapseOnMove", function(cm) {
-  cm.setSelection(Pos(0, 1), Pos(2, 4));
-  cm.execCommand("goLineUp");
-  is(!cm.somethingSelected());
-  eqCharPos(cm.getCursor(), Pos(0, 1));
-  cm.setSelection(Pos(0, 1), Pos(2, 4));
-  cm.execCommand("goPageDown");
-  is(!cm.somethingSelected());
-  eqCharPos(cm.getCursor(), Pos(2, 4));
-  cm.execCommand("goLineUp");
-  cm.execCommand("goLineUp");
-  eqCharPos(cm.getCursor(), Pos(0, 4));
-  cm.setSelection(Pos(0, 1), Pos(2, 4));
-  cm.execCommand("goCharLeft");
-  is(!cm.somethingSelected());
-  eqCharPos(cm.getCursor(), Pos(0, 1));
-}, {value: "aaaaa\nb\nccccc"});
-
-testCM("clickTab", function(cm) {
-  var p0 = cm.charCoords(Pos(0, 0));
-  eqCharPos(cm.coordsChar({left: p0.left + 5, top: p0.top + 5}), Pos(0, 0));
-  eqCharPos(cm.coordsChar({left: p0.right - 5, top: p0.top + 5}), Pos(0, 1));
-}, {value: "\t\n\n", lineWrapping: true, tabSize: 8});
-
-testCM("verticalScroll", function(cm) {
-  cm.setSize(100, 200);
-  cm.setValue("foo\nbar\nbaz\n");
-  var sc = cm.getScrollerElement(), baseWidth = sc.scrollWidth;
-  cm.replaceRange("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah", Pos(0, 0), Pos(0));
-  is(sc.scrollWidth > baseWidth, "scrollbar present");
-  cm.replaceRange("foo", Pos(0, 0), Pos(0));
-  if (!phantom) eq(sc.scrollWidth, baseWidth, "scrollbar gone");
-  cm.replaceRange("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaah", Pos(0, 0), Pos(0));
-  cm.replaceRange("bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbh", Pos(1, 0), Pos(1));
-  is(sc.scrollWidth > baseWidth, "present again");
-  var curWidth = sc.scrollWidth;
-  cm.replaceRange("foo", Pos(0, 0), Pos(0));
-  is(sc.scrollWidth < curWidth, "scrollbar smaller");
-  is(sc.scrollWidth > baseWidth, "but still present");
-});
-
-testCM("extraKeys", function(cm) {
-  var outcome;
-  function fakeKey(expected, code, props) {
-    if (typeof code == "string") code = code.charCodeAt(0);
-    var e = {type: "keydown", keyCode: code, preventDefault: function(){}, stopPropagation: function(){}};
-    if (props) for (var n in props) e[n] = props[n];
-    outcome = null;
-    cm.triggerOnKeyDown(e);
-    eq(outcome, expected);
-  }
-  CodeMirror.commands.testCommand = function() {outcome = "tc";};
-  CodeMirror.commands.goTestCommand = function() {outcome = "gtc";};
-  cm.setOption("extraKeys", {"Shift-X": function() {outcome = "sx";},
-                             "X": function() {outcome = "x";},
-                             "Ctrl-Alt-U": function() {outcome = "cau";},
-                             "End": "testCommand",
-                             "Home": "goTestCommand",
-                             "Tab": false});
-  fakeKey(null, "U");
-  fakeKey("cau", "U", {ctrlKey: true, altKey: true});
-  fakeKey(null, "U", {shiftKey: true, ctrlKey: true, altKey: true});
-  fakeKey("x", "X");
-  fakeKey("sx", "X", {shiftKey: true});
-  fakeKey("tc", 35);
-  fakeKey(null, 35, {shiftKey: true});
-  fakeKey("gtc", 36);
-  fakeKey("gtc", 36, {shiftKey: true});
-  fakeKey(null, 9);
-}, null, window.opera && mac);
-
-testCM("wordMovementCommands", function(cm) {
-  cm.execCommand("goWordLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  cm.execCommand("goWordRight"); cm.execCommand("goWordRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 7, "before"));
-  cm.execCommand("goWordLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 5, "after"));
-  cm.execCommand("goWordRight"); cm.execCommand("goWordRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 12, "before"));
-  cm.execCommand("goWordLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 9, "after"));
-  cm.execCommand("goWordRight"); cm.execCommand("goWordRight"); cm.execCommand("goWordRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 24, "before"));
-  cm.execCommand("goWordRight"); cm.execCommand("goWordRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 9, "before"));
-  cm.execCommand("goWordRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 13, "before"));
-  cm.execCommand("goWordRight"); cm.execCommand("goWordRight");
-  eqCharPos(cm.getCursor(), Pos(2, 0));
-}, {value: "this is (the) firstline.\na foo12\u00e9\u00f8\u00d7bar\n"});
-
-testCM("groupMovementCommands", function(cm) {
-  cm.execCommand("goGroupLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  cm.execCommand("goGroupRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 4, "before"));
-  cm.execCommand("goGroupRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 7, "before"));
-  cm.execCommand("goGroupRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 10, "before"));
-  cm.execCommand("goGroupLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 7, "after"));
-  cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 15, "before"));
-  cm.setCursor(Pos(0, 17));
-  cm.execCommand("goGroupLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 16, "after"));
-  cm.execCommand("goGroupLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 14, "after"));
-  cm.execCommand("goGroupRight"); cm.execCommand("goGroupRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 20, "before"));
-  cm.execCommand("goGroupRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 0, "after"));
-  cm.execCommand("goGroupRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 2, "before"));
-  cm.execCommand("goGroupRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 5, "before"));
-  cm.execCommand("goGroupLeft"); cm.execCommand("goGroupLeft");
-  eqCursorPos(cm.getCursor(), Pos(1, 0, "after"));
-  cm.execCommand("goGroupLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 20, "after"));
-  cm.execCommand("goGroupLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 16, "after"));
-}, {value: "booo ba---quux. ffff\n  abc d"});
-
-testCM("groupsAndWhitespace", function(cm) {
-  var positions = [Pos(0, 0), Pos(0, 2), Pos(0, 5), Pos(0, 9), Pos(0, 11),
-                   Pos(1, 0), Pos(1, 2), Pos(1, 5)];
-  for (var i = 1; i < positions.length; i++) {
-    cm.execCommand("goGroupRight");
-    eqCharPos(cm.getCursor(), positions[i]);
-  }
-  for (var i = positions.length - 2; i >= 0; i--) {
-    cm.execCommand("goGroupLeft");
-    eqCharPos(cm.getCursor(), i == 2 ? Pos(0, 6, "before") : positions[i]);
-  }
-}, {value: "  foo +++  \n  bar"});
-
-testCM("charMovementCommands", function(cm) {
-  cm.execCommand("goCharLeft"); cm.execCommand("goColumnLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  cm.execCommand("goCharRight"); cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 2, "before"));
-  cm.setCursor(Pos(1, 0));
-  cm.execCommand("goColumnLeft");
-  eqCursorPos(cm.getCursor(), Pos(1, 0));
-  cm.execCommand("goCharLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 5, "before"));
-  cm.execCommand("goColumnRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 5, "before"));
-  cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 0, "after"));
-  cm.execCommand("goLineEnd");
-  eqCursorPos(cm.getCursor(), Pos(1, 5, "before"));
-  cm.execCommand("goLineStartSmart");
-  eqCursorPos(cm.getCursor(), Pos(1, 1, "after"));
-  cm.execCommand("goLineStartSmart");
-  eqCursorPos(cm.getCursor(), Pos(1, 0, "after"));
-  cm.setCursor(Pos(2, 0));
-  cm.execCommand("goCharRight"); cm.execCommand("goColumnRight");
-  eqCursorPos(cm.getCursor(), Pos(2, 0));
-}, {value: "line1\n ine2\n"});
-
-testCM("verticalMovementCommands", function(cm) {
-  cm.execCommand("goLineUp");
-  eqCharPos(cm.getCursor(), Pos(0, 0));
-  cm.execCommand("goLineDown");
-  if (!phantom) // This fails in PhantomJS, though not in a real Webkit
-    eqCharPos(cm.getCursor(), Pos(1, 0));
-  cm.setCursor(Pos(1, 12));
-  cm.execCommand("goLineDown");
-  eqCharPos(cm.getCursor(), Pos(2, 5));
-  cm.execCommand("goLineDown");
-  eqCharPos(cm.getCursor(), Pos(3, 0));
-  cm.execCommand("goLineUp");
-  eqCharPos(cm.getCursor(), Pos(2, 5));
-  cm.execCommand("goLineUp");
-  eqCharPos(cm.getCursor(), Pos(1, 12));
-  cm.execCommand("goPageDown");
-  eqCharPos(cm.getCursor(), Pos(5, 0));
-  cm.execCommand("goPageDown"); cm.execCommand("goLineDown");
-  eqCharPos(cm.getCursor(), Pos(5, 0));
-  cm.execCommand("goPageUp");
-  eqCharPos(cm.getCursor(), Pos(0, 0));
-}, {value: "line1\nlong long line2\nline3\n\nline5\n"});
-
-testCM("verticalMovementCommandsWrapping", function(cm) {
-  cm.setSize(120);
-  cm.setCursor(Pos(0, 5));
-  cm.execCommand("goLineDown");
-  eq(cm.getCursor().line, 0);
-  is(cm.getCursor().ch > 5, "moved beyond wrap");
-  for (var i = 0; ; ++i) {
-    is(i < 20, "no endless loop");
-    cm.execCommand("goLineDown");
-    var cur = cm.getCursor();
-    if (cur.line == 1) eq(cur.ch, 5);
-    if (cur.line == 2) { eq(cur.ch, 1); break; }
-  }
-}, {value: "a very long line that wraps around somehow so that we can test cursor movement\nshortone\nk",
-    lineWrapping: true});
-
-testCM("verticalMovementCommandsSingleLine", function(cm) {
-  cm.display.wrapper.style.height = "auto";
-  cm.refresh();
-  cm.execCommand("goLineUp");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  cm.execCommand("goLineDown");
-  eqCursorPos(cm.getCursor(), Pos(0, 11));
-  cm.setCursor(Pos(0, 5));
-  cm.execCommand("goLineDown");
-  eqCursorPos(cm.getCursor(), Pos(0, 11));
-  cm.execCommand("goLineDown");
-  eqCursorPos(cm.getCursor(), Pos(0, 11));
-  cm.execCommand("goLineUp");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  cm.execCommand("goLineUp");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  cm.execCommand("goPageDown");
-  eqCursorPos(cm.getCursor(), Pos(0, 11));
-  cm.execCommand("goPageDown"); cm.execCommand("goLineDown");
-  eqCursorPos(cm.getCursor(), Pos(0, 11));
-  cm.execCommand("goPageUp");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  cm.setCursor(Pos(0, 5));
-  cm.execCommand("goPageUp");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  cm.setCursor(Pos(0, 5));
-  cm.execCommand("goPageDown");
-  eqCursorPos(cm.getCursor(), Pos(0, 11));
-}, {value: "single line"});
-
-
-testCM("rtlMovement", function(cm) {
-  if (cm.getOption("inputStyle") != "textarea") return;
-  forEach(["禺丨噩", "禺丨abc禺丨噩", "ab禺丨禺丨噩cd", "ab禺de", "ab禺丨2342禺1丨噩", "禺1丨2禺丨3丨x噩",
-           "禺丨cd", "1禺丨cd", "abcde丨1噩", "禺賲乇丨亘賴丕 賲賴丕!", "foobar乇", "禺 丞 賯",
-           "<img src=\"/讘讚讬拽讛3.jpg\">", "賷鬲賲 丕賱爻丨亘 賮賷 05 賮亘乇丕賷乇 2014"], function(line) {
-    cm.setValue(line + "\n"); cm.execCommand("goLineStart");
-    var cursors = byClassName(cm.getWrapperElement(), "CodeMirror-cursors")[0];
-    var cursor = cursors.firstChild;
-    var prevX = cursor.offsetLeft, prevY = cursor.offsetTop;
-    for (var i = 0; i <= line.length; ++i) {
-      cm.execCommand("goCharRight");
-      cursor = cursors.firstChild;
-      if (i == line.length) is(cursor.offsetTop > prevY, "next line");
-      else is(cursor.offsetLeft > prevX, "moved right");
-      prevX = cursor.offsetLeft; prevY = cursor.offsetTop;
-    }
-    cm.setCursor(0, 0); cm.execCommand("goLineEnd");
-    prevX = cursors.firstChild.offsetLeft;
-    for (var i = 0; i < line.length; ++i) {
-      cm.execCommand("goCharLeft");
-      cursor = cursors.firstChild;
-      is(cursor.offsetLeft < prevX, "moved left");
-      prevX = cursor.offsetLeft;
-    }
-  });
-}, null, ie_lt9);
-
-// Verify that updating a line clears its bidi ordering
-testCM("bidiUpdate", function(cm) {
-  cm.setCursor(Pos(0, 2, "before"));
-  cm.replaceSelection("禺丨噩", "start");
-  cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 6, "before"));
-}, {value: "abcd\n"});
-
-testCM("movebyTextUnit", function(cm) {
-  cm.setValue("讘职旨专值讗砖执\ne虂e虂e虂虂\n");
-  cm.execCommand("goLineStart");
-  for (var i = 0; i < 4; ++i) cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 0, "after"));
-  cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 0, "after"));
-  cm.execCommand("goCharRight");
-  cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 4, "before"));
-  cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(1, 7, "before"));
-});
-
-testCM("lineChangeEvents", function(cm) {
-  addDoc(cm, 3, 5);
-  var log = [], want = ["ch 0", "ch 1", "del 2", "ch 0", "ch 0", "del 1", "del 3", "del 4"];
-  for (var i = 0; i < 5; ++i) {
-    CodeMirror.on(cm.getLineHandle(i), "delete", function(i) {
-      return function() {log.push("del " + i);};
-    }(i));
-    CodeMirror.on(cm.getLineHandle(i), "change", function(i) {
-      return function() {log.push("ch " + i);};
-    }(i));
-  }
-  cm.replaceRange("x", Pos(0, 1));
-  cm.replaceRange("xy", Pos(1, 1), Pos(2));
-  cm.replaceRange("foo\nbar", Pos(0, 1));
-  cm.replaceRange("", Pos(0, 0), Pos(cm.lineCount()));
-  eq(log.length, want.length, "same length");
-  for (var i = 0; i < log.length; ++i)
-    eq(log[i], want[i]);
-});
-
-testCM("scrollEntirelyToRight", function(cm) {
-  if (phantom || cm.getOption("inputStyle") != "textarea") return;
-  addDoc(cm, 500, 2);
-  cm.setCursor(Pos(0, 500));
-  var wrap = cm.getWrapperElement(), cur = byClassName(wrap, "CodeMirror-cursor")[0];
-  is(wrap.getBoundingClientRect().right > cur.getBoundingClientRect().left);
-});
-
-testCM("lineWidgets", function(cm) {
-  addDoc(cm, 500, 3);
-  var last = cm.charCoords(Pos(2, 0));
-  var node = document.createElement("div");
-  node.innerHTML = "hi";
-  var widget = cm.addLineWidget(1, node);
-  is(last.top < cm.charCoords(Pos(2, 0)).top, "took up space");
-  cm.setCursor(Pos(1, 1));
-  cm.execCommand("goLineDown");
-  eqCharPos(cm.getCursor(), Pos(2, 1));
-  cm.execCommand("goLineUp");
-  eqCharPos(cm.getCursor(), Pos(1, 1));
-});
-
-testCM("lineWidgetFocus", function(cm) {
-  var place = document.getElementById("testground");
-  place.className = "offscreen";
-  try {
-    addDoc(cm, 500, 10);
-    var node = document.createElement("input");
-    var widget = cm.addLineWidget(1, node);
-    node.focus();
-    eq(document.activeElement, node);
-    cm.replaceRange("new stuff", Pos(1, 0));
-    eq(document.activeElement, node);
-  } finally {
-    place.className = "";
-  }
-});
-
-testCM("lineWidgetCautiousRedraw", function(cm) {
-  var node = document.createElement("div");
-  node.innerHTML = "hahah";
-  var w = cm.addLineWidget(0, node);
-  var redrawn = false;
-  w.on("redraw", function() { redrawn = true; });
-  cm.replaceSelection("0");
-  is(!redrawn);
-}, {value: "123\n456"});
-
-
-var knownScrollbarWidth;
-function scrollbarWidth(measure) {
-  if (knownScrollbarWidth != null) return knownScrollbarWidth;
-  var div = document.createElement('div');
-  div.style.cssText = "width: 50px; height: 50px; overflow-x: scroll";
-  document.body.appendChild(div);
-  knownScrollbarWidth = div.offsetHeight - div.clientHeight;
-  document.body.removeChild(div);
-  return knownScrollbarWidth || 0;
-}
-
-testCM("lineWidgetChanged", function(cm) {
-  addDoc(cm, 2, 300);
-  var halfScrollbarWidth = scrollbarWidth(cm.display.measure)/2;
-  cm.setOption('lineNumbers', true);
-  cm.setSize(600, cm.defaultTextHeight() * 50);
-  cm.scrollTo(null, cm.heightAtLine(125, "local"));
-
-  var expectedWidgetHeight = 60;
-  var expectedLinesInWidget = 3;
-  function w() {
-    var node = document.createElement("div");
-    // we use these children with just under half width of the line to check measurements are made with correct width
-    // when placed in the measure div.
-    // If the widget is measured at a width much narrower than it is displayed at, the underHalf children will span two lines and break the test.
-    // If the widget is measured at a width much wider than it is displayed at, the overHalf children will combine and break the test.
-    // Note that this test only checks widgets where coverGutter is true, because these require extra styling to get the width right.
-    // It may also be worthwhile to check this for non-coverGutter widgets.
-    // Visually:
-    // Good:
-    // | ------------- display width ------------- |
-    // | ------- widget-width when measured ------ |
-    // | | -- under-half -- | | -- under-half -- | |
-    // | | --- over-half --- |                     |
-    // | | --- over-half --- |                     |
-    // Height: measured as 3 lines, same as it will be when actually displayed
-
-    // Bad (too narrow):
-    // | ------------- display width ------------- |
-    // | ------ widget-width when measured ----- |  < -- uh oh
-    // | | -- under-half -- |                    |
-    // | | -- under-half -- |                    |  < -- when measured, shoved to next line
-    // | | --- over-half --- |                   |
-    // | | --- over-half --- |                   |
-    // Height: measured as 4 lines, more than expected . Will be displayed as 3 lines!
-
-    // Bad (too wide):
-    // | ------------- display width ------------- |
-    // | -------- widget-width when measured ------- | < -- uh oh
-    // | | -- under-half -- | | -- under-half -- |   |
-    // | | --- over-half --- | | --- over-half --- | | < -- when measured, combined on one line
-    // Height: measured as 2 lines, less than expected. Will be displayed as 3 lines!
-
-    var barelyUnderHalfWidthHtml = '<div style="display: inline-block; height: 1px; width: '+(285 - halfScrollbarWidth)+'px;"></div>';
-    var barelyOverHalfWidthHtml = '<div style="display: inline-block; height: 1px; width: '+(305 - halfScrollbarWidth)+'px;"></div>';
-    node.innerHTML = new Array(3).join(barelyUnderHalfWidthHtml) + new Array(3).join(barelyOverHalfWidthHtml);
-    node.style.cssText = "background: yellow;font-size:0;line-height: " + (expectedWidgetHeight/expectedLinesInWidget) + "px;";
-    return node;
-  }
-  var info0 = cm.getScrollInfo();
-  var w0 = cm.addLineWidget(0, w(), { coverGutter: true });
-  var w150 = cm.addLineWidget(150, w(), { coverGutter: true });
-  var w300 = cm.addLineWidget(300, w(), { coverGutter: true });
-  var info1 = cm.getScrollInfo();
-  eq(info0.height + (3 * expectedWidgetHeight), info1.height);
-  eq(info0.top + expectedWidgetHeight, info1.top);
-  expectedWidgetHeight = 12;
-  w0.node.style.lineHeight = w150.node.style.lineHeight = w300.node.style.lineHeight = (expectedWidgetHeight/expectedLinesInWidget) + "px";
-  w0.changed(); w150.changed(); w300.changed();
-  var info2 = cm.getScrollInfo();
-  eq(info0.height + (3 * expectedWidgetHeight), info2.height);
-  eq(info0.top + expectedWidgetHeight, info2.top);
-});
-
-testCM("getLineNumber", function(cm) {
-  addDoc(cm, 2, 20);
-  var h1 = cm.getLineHandle(1);
-  eq(cm.getLineNumber(h1), 1);
-  cm.replaceRange("hi\nbye\n", Pos(0, 0));
-  eq(cm.getLineNumber(h1), 3);
-  cm.setValue("");
-  eq(cm.getLineNumber(h1), null);
-});
-
-testCM("jumpTheGap", function(cm) {
-  if (phantom) return;
-  var longLine = "abcdef ghiklmnop qrstuvw xyz ";
-  longLine += longLine; longLine += longLine; longLine += longLine;
-  cm.replaceRange(longLine, Pos(2, 0), Pos(2));
-  cm.setSize("200px", null);
-  cm.getWrapperElement().style.lineHeight = 2;
-  cm.refresh();
-  cm.setCursor(Pos(0, 1));
-  cm.execCommand("goLineDown");
-  eqCharPos(cm.getCursor(), Pos(1, 1));
-  cm.execCommand("goLineDown");
-  eqCharPos(cm.getCursor(), Pos(2, 1));
-  cm.execCommand("goLineDown");
-  eq(cm.getCursor().line, 2);
-  is(cm.getCursor().ch > 1);
-  cm.execCommand("goLineUp");
-  eqCharPos(cm.getCursor(), Pos(2, 1));
-  cm.execCommand("goLineUp");
-  eqCharPos(cm.getCursor(), Pos(1, 1));
-  var node = document.createElement("div");
-  node.innerHTML = "hi"; node.style.height = "30px";
-  cm.addLineWidget(0, node);
-  cm.addLineWidget(1, node.cloneNode(true), {above: true});
-  cm.setCursor(Pos(0, 2));
-  cm.execCommand("goLineDown");
-  eqCharPos(cm.getCursor(), Pos(1, 2));
-  cm.execCommand("goLineUp");
-  eqCharPos(cm.getCursor(), Pos(0, 2));
-}, {lineWrapping: true, value: "abc\ndef\nghi\njkl\n"});
-
-testCM("addLineClass", function(cm) {
-  function cls(line, text, bg, wrap, gutter) {
-    var i = cm.lineInfo(line);
-    eq(i.textClass, text);
-    eq(i.bgClass, bg);
-    eq(i.wrapClass, wrap);
-    if (typeof i.handle.gutterClass !== 'undefined') {
-        eq(i.handle.gutterClass, gutter);
-    }
-  }
-  cm.addLineClass(0, "text", "foo");
-  cm.addLineClass(0, "text", "bar");
-  cm.addLineClass(1, "background", "baz");
-  cm.addLineClass(1, "wrap", "foo");
-  cm.addLineClass(1, "gutter", "gutter-class");
-  cls(0, "foo bar", null, null, null);
-  cls(1, null, "baz", "foo", "gutter-class");
-  var lines = cm.display.lineDiv;
-  eq(byClassName(lines, "foo").length, 2);
-  eq(byClassName(lines, "bar").length, 1);
-  eq(byClassName(lines, "baz").length, 1);
-  eq(byClassName(lines, "gutter-class").length, 2); // Gutter classes are reflected in 2 nodes
-  cm.removeLineClass(0, "text", "foo");
-  cls(0, "bar", null, null, null);
-  cm.removeLineClass(0, "text", "foo");
-  cls(0, "bar", null, null, null);
-  cm.removeLineClass(0, "text", "bar");
-  cls(0, null, null, null);
-
-  cm.addLineClass(1, "wrap", "quux");
-  cls(1, null, "baz", "foo quux", "gutter-class");
-  cm.removeLineClass(1, "wrap");
-  cls(1, null, "baz", null, "gutter-class");
-  cm.removeLineClass(1, "gutter", "gutter-class");
-  eq(byClassName(lines, "gutter-class").length, 0);
-  cls(1, null, "baz", null, null);
-
-  cm.addLineClass(1, "gutter", "gutter-class");
-  cls(1, null, "baz", null, "gutter-class");
-  cm.removeLineClass(1, "gutter", "gutter-class");
-  cls(1, null, "baz", null, null);
-
-}, {value: "hohoho\n", lineNumbers: true});
-
-testCM("atomicMarker", function(cm) {
-  addDoc(cm, 10, 10);
-  function atom(ll, cl, lr, cr, li, ri) {
-    return cm.markText(Pos(ll, cl), Pos(lr, cr),
-                       {atomic: true, inclusiveLeft: li, inclusiveRight: ri});
-  }
-  var m = atom(0, 1, 0, 5);
-  cm.setCursor(Pos(0, 1));
-  cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(0, 5));
-  cm.execCommand("goCharLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 1));
-  m.clear();
-  m = atom(0, 0, 0, 5, true);
-  eqCursorPos(cm.getCursor(), Pos(0, 5), "pushed out");
-  cm.execCommand("goCharLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 5));
-  m.clear();
-  m = atom(8, 4, 9, 10, false, true);
-  cm.setCursor(Pos(9, 8));
-  eqCursorPos(cm.getCursor(), Pos(8, 4), "set");
-  cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(8, 4), "char right");
-  cm.execCommand("goLineDown");
-  eqCursorPos(cm.getCursor(), Pos(8, 4), "line down");
-  cm.execCommand("goCharLeft");
-  eqCursorPos(cm.getCursor(), Pos(8, 3, "after"));
-  m.clear();
-  m = atom(1, 1, 3, 8);
-  cm.setCursor(Pos(0, 0));
-  cm.setCursor(Pos(2, 0));
-  eqCursorPos(cm.getCursor(), Pos(3, 8));
-  cm.execCommand("goCharLeft");
-  eqCursorPos(cm.getCursor(), Pos(1, 1));
-  cm.execCommand("goCharRight");
-  eqCursorPos(cm.getCursor(), Pos(3, 8));
-  cm.execCommand("goLineUp");
-  eqCursorPos(cm.getCursor(), Pos(1, 1));
-  cm.execCommand("goLineDown");
-  eqCursorPos(cm.getCursor(), Pos(3, 8));
-  cm.execCommand("delCharBefore");
-  eq(cm.getValue().length, 80, "del chunk");
-  m = atom(3, 0, 5, 5);
-  cm.setCursor(Pos(3, 0));
-  cm.execCommand("delWordAfter");
-  eq(cm.getValue().length, 53, "del chunk");
-});
-
-testCM("selectionBias", function(cm) {
-  cm.markText(Pos(0, 1), Pos(0, 3), {atomic: true});
-  cm.setCursor(Pos(0, 2));
-  eqCursorPos(cm.getCursor(), Pos(0, 1));
-  cm.setCursor(Pos(0, 2));
-  eqCursorPos(cm.getCursor(), Pos(0, 3));
-  cm.setCursor(Pos(0, 2));
-  eqCursorPos(cm.getCursor(), Pos(0, 1));
-  cm.setCursor(Pos(0, 2), null, {bias: -1});
-  eqCursorPos(cm.getCursor(), Pos(0, 1));
-  cm.setCursor(Pos(0, 4));
-  cm.setCursor(Pos(0, 2), null, {bias: 1});
-  eqCursorPos(cm.getCursor(), Pos(0, 3));
-}, {value: "12345"});
-
-testCM("selectionHomeEnd", function(cm) {
-  cm.markText(Pos(1, 0), Pos(1, 1), {atomic: true, inclusiveLeft: true});
-  cm.markText(Pos(1, 3), Pos(1, 4), {atomic: true, inclusiveRight: true});
-  cm.setCursor(Pos(1, 2));
-  cm.execCommand("goLineStart");
-  eqCursorPos(cm.getCursor(), Pos(1, 1));
-  cm.execCommand("goLineEnd");
-  eqCursorPos(cm.getCursor(), Pos(1, 3));
-}, {value: "ab\ncdef\ngh"});
-
-testCM("readOnlyMarker", function(cm) {
-  function mark(ll, cl, lr, cr, at) {
-    return cm.markText(Pos(ll, cl), Pos(lr, cr),
-                       {readOnly: true, atomic: at});
-  }
-  var m = mark(0, 1, 0, 4);
-  cm.setCursor(Pos(0, 2));
-  cm.replaceSelection("hi", "end");
-  eqCursorPos(cm.getCursor(), Pos(0, 2));
-  eq(cm.getLine(0), "abcde");
-  cm.execCommand("selectAll");
-  cm.replaceSelection("oops", "around");
-  eq(cm.getValue(), "oopsbcd");
-  cm.undo();
-  eqCursorPos(m.find().from, Pos(0, 1));
-  eqCursorPos(m.find().to, Pos(0, 4));
-  m.clear();
-  cm.setCursor(Pos(0, 2));
-  cm.replaceSelection("hi", "around");
-  eq(cm.getLine(0), "abhicde");
-  eqCursorPos(cm.getCursor(), Pos(0, 4));
-  m = mark(0, 2, 2, 2, true);
-  cm.setSelection(Pos(1, 1), Pos(2, 4));
-  cm.replaceSelection("t", "end");
-  eqCursorPos(cm.getCursor(), Pos(2, 3));
-  eq(cm.getLine(2), "klto");
-  cm.execCommand("goCharLeft");
-  cm.execCommand("goCharLeft");
-  eqCursorPos(cm.getCursor(), Pos(0, 2));
-  cm.setSelection(Pos(0, 1), Pos(0, 3));
-  cm.replaceSelection("xx", "around");
-  eqCursorPos(cm.getCursor(), Pos(0, 3));
-  eq(cm.getLine(0), "axxhicde");
-}, {value: "abcde\nfghij\nklmno\n"});
-
-testCM("dirtyBit", function(cm) {
-  eq(cm.isClean(), true);
-  cm.replaceSelection("boo", null, "test");
-  eq(cm.isClean(), false);
-  cm.undo();
-  eq(cm.isClean(), true);
-  cm.replaceSelection("boo", null, "test");
-  cm.replaceSelection("baz", null, "test");
-  cm.undo();
-  eq(cm.isClean(), false);
-  cm.markClean();
-  eq(cm.isClean(), true);
-  cm.undo();
-  eq(cm.isClean(), false);
-  cm.redo();
-  eq(cm.isClean(), true);
-});
-
-testCM("changeGeneration", function(cm) {
-  cm.replaceSelection("x");
-  var softGen = cm.changeGeneration();
-  cm.replaceSelection("x");
-  cm.undo();
-  eq(cm.getValue(), "");
-  is(!cm.isClean(softGen));
-  cm.replaceSelection("x");
-  var hardGen = cm.changeGeneration(true);
-  cm.replaceSelection("x");
-  cm.undo();
-  eq(cm.getValue(), "x");
-  is(cm.isClean(hardGen));
-});
-
-testCM("addKeyMap", function(cm) {
-  function sendKey(code) {
-    cm.triggerOnKeyDown({type: "keydown", keyCode: code,
-                         preventDefault: function(){}, stopPropagation: function(){}});
-  }
-
-  sendKey(39);
-  eqCursorPos(cm.getCursor(), Pos(0, 1, "before"));
-  var test = 0;
-  var map1 = {Right: function() { ++test; }}, map2 = {Right: function() { test += 10; }}
-  cm.addKeyMap(map1);
-  sendKey(39);
-  eqCursorPos(cm.getCursor(), Pos(0, 1, "before"));
-  eq(test, 1);
-  cm.addKeyMap(map2, true);
-  sendKey(39);
-  eq(test, 2);
-  cm.removeKeyMap(map1);
-  sendKey(39);
-  eq(test, 12);
-  cm.removeKeyMap(map2);
-  sendKey(39);
-  eq(test, 12);
-  eqCursorPos(cm.getCursor(), Pos(0, 2, "before"));
-  cm.addKeyMap({Right: function() { test = 55; }, name: "mymap"});
-  sendKey(39);
-  eq(test, 55);
-  cm.removeKeyMap("mymap");
-  sendKey(39);
-  eqCursorPos(cm.getCursor(), Pos(0, 3, "before"));
-}, {value: "abc"});
-
-testCM("findPosH", function(cm) {
-  forEach([{from: Pos(0, 0), to: Pos(0, 1, "before"), by: 1},
-           {from: Pos(0, 0), to: Pos(0, 0), by: -1, hitSide: true},
-           {from: Pos(0, 0), to: Pos(0, 4, "before"), by: 1, unit: "word"},
-           {from: Pos(0, 0), to: Pos(0, 8, "before"), by: 2, unit: "word"},
-           {from: Pos(0, 0), to: Pos(2, 0, "after"), by: 20, unit: "word", hitSide: true},
-           {from: Pos(0, 7), to: Pos(0, 5, "after"), by: -1, unit: "word"},
-           {from: Pos(0, 4), to: Pos(0, 8, "before"), by: 1, unit: "word"},
-           {from: Pos(1, 0), to: Pos(1, 18, "before"), by: 3, unit: "word"},
-           {from: Pos(1, 22), to: Pos(1, 5, "after"), by: -3, unit: "word"},
-           {from: Pos(1, 15), to: Pos(1, 10, "after"), by: -5},
-           {from: Pos(1, 15), to: Pos(1, 10, "after"), by: -5, unit: "column"},
-           {from: Pos(1, 15), to: Pos(1, 0, "after"), by: -50, unit: "column", hitSide: true},
-           {from: Pos(1, 15), to: Pos(1, 24, "before"), by: 50, unit: "column", hitSide: true},
-           {from: Pos(1, 15), to: Pos(2, 0, "after"), by: 50, hitSide: true}], function(t) {
-    var r = cm.findPosH(t.from, t.by, t.unit || "char");
-    eqCursorPos(r, t.to);
-    eq(!!r.hitSide, !!t.hitSide);
-  });
-}, {value: "line one\nline two.something.other\n"});
-
-testCM("beforeChange", function(cm) {
-  cm.on("beforeChange", function(cm, change) {
-    var text = [];
-    for (var i = 0; i < change.text.length; ++i)
-      text.push(change.text[i].replace(/\s/g, "_"));
-    change.update(null, null, text);
-  });
-  cm.setValue("hello, i am a\nnew document\n");
-  eq(cm.getValue(), "hello,_i_am_a\nnew_document\n");
-  CodeMirror.on(cm.getDoc(), "beforeChange", function(doc, change) {
-    if (change.from.line == 0) change.cancel();
-  });
-  cm.setValue("oops"); // Canceled
-  eq(cm.getValue(), "hello,_i_am_a\nnew_document\n");
-  cm.replaceRange("hey hey hey", Pos(1, 0), Pos(2, 0));
-  eq(cm.getValue(), "hello,_i_am_a\nhey_hey_hey");
-}, {value: "abcdefghijk"});
-
-testCM("beforeChangeUndo", function(cm) {
-  cm.replaceRange("hi", Pos(0, 0), Pos(0));
-  cm.replaceRange("bye", Pos(0, 0), Pos(0));
-  eq(cm.historySize().undo, 2);
-  cm.on("beforeChange", function(cm, change) {
-    is(!change.update);
-    change.cancel();
-  });
-  cm.undo();
-  eq(cm.historySize().undo, 0);
-  eq(cm.getValue(), "bye\ntwo");
-}, {value: "one\ntwo"});
-
-testCM("beforeSelectionChange", function(cm) {
-  function notAtEnd(cm, pos) {
-    var len = cm.getLine(pos.line).length;
-    if (!len || pos.ch == len) return Pos(pos.line, pos.ch - 1);
-    return pos;
-  }
-  cm.on("beforeSelectionChange", function(cm, obj) {
-    obj.update([{anchor: notAtEnd(cm, obj.ranges[0].anchor),
-                 head: notAtEnd(cm, obj.ranges[0].head)}]);
-  });
-
-  addDoc(cm, 10, 10);
-  cm.execCommand("goLineEnd");
-  eqCursorPos(cm.getCursor(), Pos(0, 9));
-  cm.execCommand("selectAll");
-  eqCursorPos(cm.getCursor("start"), Pos(0, 0));
-  eqCursorPos(cm.getCursor("end"), Pos(9, 9));
-});
-
-testCM("change_removedText", function(cm) {
-  cm.setValue("abc\ndef");
-
-  var removedText = [];
-  cm.on("change", function(cm, change) {
-    removedText.push(change.removed);
-  });
-
-  cm.operation(function() {
-    cm.replaceRange("xyz", Pos(0, 0), Pos(1,1));
-    cm.replaceRange("123", Pos(0,0));
-  });
-
-  eq(removedText.length, 2);
-  eq(removedText[0].join("\n"), "abc\nd");
-  eq(removedText[1].join("\n"), "");
-
-  var removedText = [];
-  cm.undo();
-  eq(removedText.length, 2);
-  eq(removedText[0].join("\n"), "123");
-  eq(removedText[1].join("\n"), "xyz");
-
-  var removedText = [];
-  cm.redo();
-  eq(removedText.length, 2);
-  eq(removedText[0].join("\n"), "abc\nd");
-  eq(removedText[1].join("\n"), "");
-});
-
-testCM("lineStyleFromMode", function(cm) {
-  CodeMirror.defineMode("test_mode", function() {
-    return {token: function(stream) {
-      if (stream.match(/^\[[^\]]*\]/)) return "  line-brackets  ";
-      if (stream.match(/^\([^\)]*\)/)) return "  line-background-parens  ";
-      if (stream.match(/^<[^>]*>/)) return "  span  line-line  line-background-bg  ";
-      stream.match(/^\s+|^\S+/);
-    }};
-  });
-  cm.setOption("mode", "test_mode");
-  var bracketElts = byClassName(cm.getWrapperElement(), "brackets");
-  eq(bracketElts.length, 1, "brackets count");
-  eq(bracketElts[0].nodeName, "PRE");
-  is(!/brackets.*brackets/.test(bracketElts[0].className));
-  var parenElts = byClassName(cm.getWrapperElement(), "parens");
-  eq(parenElts.length, 1, "parens count");
-  eq(parenElts[0].nodeName, "DIV");
-  is(!/parens.*parens/.test(parenElts[0].className));
-  eq(parenElts[0].parentElement.nodeName, "DIV");
-
-  is(byClassName(cm.getWrapperElement(), "bg").length > 0);
-  is(byClassName(cm.getWrapperElement(), "line").length > 0);
-  var spanElts = byClassName(cm.getWrapperElement(), "cm-span");
-  eq(spanElts.length, 2);
-  is(/^\s*cm-span\s*$/.test(spanElts[0].className));
-}, {value: "line1: [br] [br]\nline2: (par) (par)\nline3: <tag> <tag>"});
-
-testCM("lineStyleFromBlankLine", function(cm) {
-  CodeMirror.defineMode("lineStyleFromBlankLine_mode", function() {
-    return {token: function(stream) { stream.skipToEnd(); return "comment"; },
-            blankLine: function() { return "line-blank"; }};
-  });
-  cm.setOption("mode", "lineStyleFromBlankLine_mode");
-  var blankElts = byClassName(cm.getWrapperElement(), "blank");
-  eq(blankElts.length, 1);
-  eq(blankElts[0].nodeName, "PRE");
-  cm.replaceRange("x", Pos(1, 0));
-  blankElts = byClassName(cm.getWrapperElement(), "blank");
-  eq(blankElts.length, 0);
-}, {value: "foo\n\nbar"});
-
-CodeMirror.registerHelper("xxx", "a", "A");
-CodeMirror.registerHelper("xxx", "b", "B");
-CodeMirror.defineMode("yyy", function() {
-  return {
-    token: function(stream) { stream.skipToEnd(); },
-    xxx: ["a", "b", "q"]
-  };
-});
-CodeMirror.registerGlobalHelper("xxx", "c", function(m) { return m.enableC; }, "C");
-
-testCM("helpers", function(cm) {
-  cm.setOption("mode", "yyy");
-  eq(cm.getHelpers(Pos(0, 0), "xxx").join("/"), "A/B");
-  cm.setOption("mode", {name: "yyy", modeProps: {xxx: "b", enableC: true}});
-  eq(cm.getHelpers(Pos(0, 0), "xxx").join("/"), "B/C");
-  cm.setOption("mode", "javascript");
-  eq(cm.getHelpers(Pos(0, 0), "xxx").join("/"), "");
-});
-
-testCM("selectionHistory", function(cm) {
-  for (var i = 0; i < 3; i++) {
-    cm.setExtending(true);
-    cm.execCommand("goCharRight");
-    cm.setExtending(false);
-    cm.execCommand("goCharRight");
-    cm.execCommand("goCharRight");
-  }
-  cm.execCommand("undoSelection");
-  eq(cm.getSelection(), "c");
-  cm.execCommand("undoSelection");
-  eq(cm.getSelection(), "");
-  eqCursorPos(cm.getCursor(), Pos(0, 4, "before"));
-  cm.execCommand("undoSelection");
-  eq(cm.getSelection(), "b");
-  cm.execCommand("redoSelection");
-  eq(cm.getSelection(), "");
-  eqCursorPos(cm.getCursor(), Pos(0, 4, "before"));
-  cm.execCommand("redoSelection");
-  eq(cm.getSelection(), "c");
-  cm.execCommand("redoSelection");
-  eq(cm.getSelection(), "");
-  eqCursorPos(cm.getCursor(), Pos(0, 6, "before"));
-}, {value: "a b c d"});
-
-testCM("selectionChangeReducesRedo", function(cm) {
-  cm.replaceSelection("X");
-  cm.execCommand("goCharRight");
-  cm.undoSelection();
-  cm.execCommand("selectAll");
-  cm.undoSelection();
-  eq(cm.getValue(), "Xabc");
-  eqCursorPos(cm.getCursor(), Pos(0, 1));
-  cm.undoSelection();
-  eq(cm.getValue(), "abc");
-}, {value: "abc"});
-
-testCM("selectionHistoryNonOverlapping", function(cm) {
-  cm.setSelection(Pos(0, 0), Pos(0, 1));
-  cm.setSelection(Pos(0, 2), Pos(0, 3));
-  cm.execCommand("undoSelection");
-  eqCursorPos(cm.getCursor("anchor"), Pos(0, 0));
-  eqCursorPos(cm.getCursor("head"), Pos(0, 1));
-}, {value: "1234"});
-
-testCM("cursorMotionSplitsHistory", function(cm) {
-  cm.replaceSelection("a");
-  cm.execCommand("goCharRight");
-  cm.replaceSelection("b");
-  cm.replaceSelection("c");
-  cm.undo();
-  eq(cm.getValue(), "a1234");
-  eqCursorPos(cm.getCursor(), Pos(0, 2, "before"));
-  cm.undo();
-  eq(cm.getValue(), "1234");
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-}, {value: "1234"});
-
-testCM("selChangeInOperationDoesNotSplit", function(cm) {
-  for (var i = 0; i < 4; i++) {
-    cm.operation(function() {
-      cm.replaceSelection("x");
-      cm.setCursor(Pos(0, cm.getCursor().ch - 1));
-    });
-  }
-  eqCursorPos(cm.getCursor(), Pos(0, 0));
-  eq(cm.getValue(), "xxxxa");
-  cm.undo();
-  eq(cm.getValue(), "a");
-}, {value: "a"});
-
-testCM("alwaysMergeSelEventWithChangeOrigin", function(cm) {
-  cm.replaceSelection("U", null, "foo");
-  cm.setSelection(Pos(0, 0), Pos(0, 1), {origin: "foo"});
-  cm.undoSelection();
-  eq(cm.getValue(), "a");
-  cm.replaceSelection("V", null, "foo");
-  cm.setSelection(Pos(0, 0), Pos(0, 1), {origin: "bar"});
-  cm.undoSelection();
-  eq(cm.getValue(), "Va");
-}, {value: "a"});
-
-testCM("getTokenAt", function(cm) {
-  var tokPlus = cm.getTokenAt(Pos(0, 2));
-  eq(tokPlus.type, "operator");
-  eq(tokPlus.string, "+");
-  var toks = cm.getLineTokens(0);
-  eq(toks.length, 3);
-  forEach([["number", "1"], ["operator", "+"], ["number", "2"]], function(expect, i) {
-    eq(toks[i].type, expect[0]);
-    eq(toks[i].string, expect[1]);
-  });
-}, {value: "1+2", mode: "javascript"});
-
-testCM("getTokenTypeAt", function(cm) {
-  eq(cm.getTokenTypeAt(Pos(0, 0)), "number");
-  eq(cm.getTokenTypeAt(Pos(0, 6)), "string");
-  cm.addOverlay({
-    token: function(stream) {
-      if (stream.match("foo")) return "foo";
-      else stream.next();
-    }
-  });
-  eq(byClassName(cm.getWrapperElement(), "cm-foo").length, 1);
-  eq(cm.getTokenTypeAt(Pos(0, 6)), "string");
-}, {value: "1 + 'foo'", mode: "javascript"});
-
-testCM("resizeLineWidget", function(cm) {
-  addDoc(cm, 200, 3);
-  var widget = document.createElement("pre");
-  widget.innerHTML = "imwidget";
-  widget.style.background = "yellow";
-  cm.addLineWidget(1, widget, {noHScroll: true});
-  cm.setSize(40);
-  is(widget.parentNode.offsetWidth < 42);
-});
-
-testCM("combinedOperations", function(cm) {
-  var place = document.getElementById("testground");
-  var other = CodeMirror(place, {value: "123"});
-  try {
-    cm.operation(function() {
-      cm.addLineClass(0, "wrap", "foo");
-      other.addLineClass(0, "wrap", "foo");
-    });
-    eq(byClassName(cm.getWrapperElement(), "foo").length, 1);
-    eq(byClassName(other.getWrapperElement(), "foo").length, 1);
-    cm.operation(function() {
-      cm.removeLineClass(0, "wrap", "foo");
-      other.removeLineClass(0, "wrap", "foo");
-    });
-    eq(byClassName(cm.getWrapperElement(), "foo").length, 0);
-    eq(byClassName(other.getWrapperElement(), "foo").length, 0);
-  } finally {
-    place.removeChild(other.getWrapperElement());
-  }
-}, {value: "abc"});
-
-testCM("eventOrder", function(cm) {
-  var seen = [];
-  cm.on("change", function() {
-    if (!seen.length) cm.replaceSelection(".");
-    seen.push("change");
-  });
-  cm.on("cursorActivity", function() {
-    cm.replaceSelection("!");
-    seen.push("activity");
-  });
-  cm.replaceSelection("/");
-  eq(seen.join(","), "change,change,activity,change");
-});
-
-testCM("splitSpaces_nonspecial", function(cm) {
-  eq(byClassName(cm.getWrapperElement(), "cm-invalidchar").length, 0);
-}, {
-  specialChars: /[\u00a0]/,
-  value: "spaces ->            <- between"
-});
-
-test("core_rmClass", function() {
-  var node = document.createElement("div");
-  node.className = "foo-bar baz-quux yadda";
-  CodeMirror.rmClass(node, "quux");
-  eq(node.className, "foo-bar baz-quux yadda");
-  CodeMirror.rmClass(node, "baz-quux");
-  eq(node.className, "foo-bar yadda");
-  CodeMirror.rmClass(node, "yadda");
-  eq(node.className, "foo-bar");
-  CodeMirror.rmClass(node, "foo-bar");
-  eq(node.className, "");
-  node.className = " foo ";
-  CodeMirror.rmClass(node, "foo");
-  eq(node.className, "");
-});
-
-test("core_addClass", function() {
-  var node = document.createElement("div");
-  CodeMirror.addClass(node, "a");
-  eq(node.className, "a");
-  CodeMirror.addClass(node, "a");
-  eq(node.className, "a");
-  CodeMirror.addClass(node, "b");
-  eq(node.className, "a b");
-  CodeMirror.addClass(node, "a");
-  CodeMirror.addClass(node, "b");
-  eq(node.className, "a b");
-});
-
-testCM("lineSeparator", function(cm) {
-  eq(cm.lineCount(), 3);
-  eq(cm.getLine(1), "bar\r");
-  eq(cm.getLine(2), "baz\rquux");
-  cm.setOption("lineSeparator", "\r");
-  eq(cm.lineCount(), 5);
-  eq(cm.getLine(4), "quux");
-  eq(cm.getValue(), "foo\rbar\r\rbaz\rquux");
-  eq(cm.getValue("\n"), "foo\nbar\n\nbaz\nquux");
-  cm.setOption("lineSeparator", null);
-  cm.setValue("foo\nbar\r\nbaz\rquux");
-  eq(cm.lineCount(), 4);
-}, {value: "foo\nbar\r\nbaz\rquux",
-    lineSeparator: "\n"});
-
-var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/
-var getChar = function (noExtending) { var res; do {res = String.fromCharCode(Math.floor(Math.random()*0x8ac)); } while ([0x90].indexOf(res.charCodeAt(0)) != -1 || (noExtending && extendingChars.test(res))); return res }
-var getString = function (n) { var res = getChar(true); while (--n > 0) res += getChar(); return res }
-
-function makeItWrapAfter(cm, pos) {
-  var firstLineTop = cm.cursorCoords(Pos(0, 0)).top;
-  for(var w = 0, posTop; posTop != firstLineTop; ++w) {
-    cm.setSize(w);
-    posTop = cm.charCoords(pos).top;
-  }
-}
-
-function countIf(arr, f) {
-  var result = 0
-  for (var i = 0; i < arr.length; i++) if (f[arr[i]]) result++
-  return result
-}
-
-function testMoveBidi(str) {
-  testCM("move_bidi_" + str, function(cm) {
-    if (cm.getOption("inputStyle") != "textarea" || !cm.getOption("rtlMoveVisually")) return;
-    cm.getScrollerElement().style.fontFamily = "monospace";
-    makeItWrapAfter(cm, Pos(0, 5));
-
-    var steps = str.length - countIf(str.split(""), function(ch) { return extendingChars.test(ch) });
-    var lineBreaks = {}
-    lineBreaks[6 - countIf(str.substr(0, 5).split(""), function(ch) { return extendingChars.test(ch) })] = 'w';
-    if (str.indexOf("\n") != -1) {
-      lineBreaks[steps - 2] = 'n';
-    }
-
-    // Make sure we are at the visual beginning of the first line
-    cm.execCommand("goLineStart");
-
-    var prevCoords = cm.cursorCoords(), coords;
-    for(var i = 0; i < steps; ++i) {
-      cm.execCommand("goCharRight");
-      coords = cm.cursorCoords();
-      if ((i >= 10 && i <= 12) && !lineBreaks[i] && coords.left < prevCoords.left && coords.top > prevCoords.top) {
-        // The first line wraps twice
-        lineBreaks[i] = 'w';
-      }
-      if (!lineBreaks[i]) {
-        is(coords.left > prevCoords.left, "In step " + i + ", cursor didn't move right");
-        eq(coords.top, prevCoords.top, "In step " + i + ", cursor moved out of line");
-      } else {
-        is(coords.left < prevCoords.left, i);
-        is(coords.top > prevCoords.top, i);
-      }
-      prevCoords = coords;
-    }
-
-    cm.execCommand("goCharRight");
-    coords = cm.cursorCoords();
-    eq(coords.left, prevCoords.left, "Moving " + steps + " steps right didn't reach the end");
-    eq(coords.top, prevCoords.top, "Moving " + steps + " steps right didn't reach the end");
-
-    for(i = steps - 1; i >= 0; --i) {
-      cm.execCommand("goCharLeft");
-      coords = cm.cursorCoords();
-      if (!(lineBreaks[i] == 'n' || lineBreaks[i + 1] == 'w')) {
-        is(coords.left < prevCoords.left, "In step " + i + ", cursor didn't move left");
-        eq(coords.top, prevCoords.top, "In step " + i + ", cursor is not at the same line anymore");
-      } else {
-        is(coords.left > prevCoords.left, i);
-        is(coords.top < prevCoords.top, i);
-      }
-      prevCoords = coords;
-    }
-
-    cm.execCommand("goCharLeft");
-    coords = cm.cursorCoords();
-    eq(coords.left, prevCoords.left, "Moving " + steps + " steps left didn't reach the beginning");
-    eq(coords.top, prevCoords.top, "Moving " + steps + " steps left didn't reach the beginning");
-  }, {value: str, lineWrapping: true})
-};
-
-function testMoveEndBidi(str) {
-  testCM("move_end_bidi_" + str, function(cm) {
-    cm.getScrollerElement().style.fontFamily = "monospace";
-    makeItWrapAfter(cm, Pos(0, 5));
-
-    cm.execCommand("goLineStart");
-    var pos = cm.doc.getCursor();
-    cm.execCommand("goCharLeft");
-    eqCursorPos(pos, cm.doc.getCursor());
-
-    cm.execCommand("goLineEnd");
-    pos = cm.doc.getCursor();
-    cm.execCommand("goColumnRight");
-    eqCursorPos(pos, cm.doc.getCursor());
-  }, {value: str, lineWrapping: true})
-};
-
-var bidiTests = [];
-
-// We don't correctly implement L1 UBA
-// See https://bugzilla.mozilla.org/show_bug.cgi?id=1331501
-// and https://bugs.chromium.org/p/chromium/issues/detail?id=673405
-/*
-bidiTests.push("Say 丕 亘 噩abj\nS");
-bidiTests.push("Sayyy 丕 丕 亘 噩");
-*/
-
-if (!phantom) {
-  bidiTests.push("螌葷菨讵葔邾状酆讍蓘药蹚\n页");
-  bidiTests.push("艑影褌賯趣貋匹貐伲膸群佟\n蠚");
-  bidiTests.push("倩芯窑褧呀惟志貕茂委謩浅\n俚");
-  bidiTests.push("貐貋膯諘瓶蓙菫袭貭醛贸膰\n膹");
-  bidiTests.push("R浓膹遥弄z息艓茝詵趪讦\n訄");
-  bidiTests.push("蠈讑鄯佗詼一袨爪袎賷膷菬\n雪");
-  bidiTests.push("蹜脷页視诂摹诠瞻褟懦KV\nr");
-  bidiTests.push("藕诨覔煤蹃4诐1葼c1a\n詠");
-  bidiTests.push("覓权覠謨茷佴該圈诎覔芒匹\n冥");
-  bidiTests.push("蠔爻諌葟脓螖詻菃膸訜蹖凇\n苇");
-  bidiTests.push("酃丶L鄣暮颧袣詸鼗讗7状\n賲");
-  bidiTests.push("賳 (賷)\u2009兀賯賵丕爻"); // thin space to throw off Firefox 51's broken white-space compressing behavior
-}
-
-bidiTests.push("謩沾学钱脽倬眉泞覎覟褳诔\n缨");
-
-//bidiTests.push("Count 佟 佗 伲 伽");
-//bidiTests.push("樱讗痞习貖葥蹛脹賵炸佻夭\n溪");
-//bidiTests.push("揖粘俪褵I諙踊佶篆謵販趶\n蹘");
-//bidiTests.push("椰脫肖販趥寞佴峡蓳趷统俚\n請");
-//bidiTests.push("a汛N某然賴藝覂诒缨腔值\na");
-//bidiTests.push(" a侑丕佗 亘 噩a\nS");
-
-for (var i = 0; i < bidiTests.length; ++i) {
-  testMoveBidi(bidiTests[i]);
-  testMoveEndBidi(bidiTests[i]);
-}
-
-/*
-for (var i = 0; i < 5; ++i) {
-  testMoveBidi(getString(12) + "\n" + getString(1));
-}
-*/
-
-function testCoordsWrappedBidi(str) {
-  testCM("coords_wrapped_bidi_" + str, function(cm) {
-    cm.getScrollerElement().style.fontFamily = "monospace";
-    makeItWrapAfter(cm, Pos(0, 5));
-
-    // Make sure we are at the visual beginning of the first line
-    var pos = Pos(0, 0), lastPos;
-    cm.doc.setCursor(pos);
-    do {
-      lastPos = pos;
-      cm.execCommand("goCharLeft");
-      pos = cm.doc.getCursor();
-    } while (pos != lastPos)
-
-    var top = cm.charCoords(Pos(0, 0)).top, lastTop;
-    for (var i = 1; i < str.length; ++i) {
-      lastTop = top;
-      top = cm.charCoords(Pos(0, i)).top;
-      is(top >= lastTop);
-    }
-  }, {value: str, lineWrapping: true})
-};
-
-testCoordsWrappedBidi("Count 佟 佗 伲 伽");
-/*
-for (var i = 0; i < 5; ++i) {
-  testCoordsWrappedBidi(getString(50));
-}
-*/
-
-testCM("delete_wrapped", function(cm) {
-  makeItWrapAfter(cm, Pos(0, 2));
-  cm.doc.setCursor(Pos(0, 3, "after"));
-  cm.deleteH(-1, "char");
-  eq(cm.getLine(0), "1245");
-}, {value: "12345", lineWrapping: true})
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/vim_test.js.js b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/vim_test.js.js
deleted file mode 100644
index 67cf8d8fea1a1e8a6b6cde9585707ccb9fba3df6..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/vim_test.js.js
+++ /dev/null
@@ -1,4094 +0,0 @@
-var Pos = CodeMirror.Pos;
-CodeMirror.Vim.suppressErrorLogging = true;
-
-var code = '' +
-' wOrd1 (#%\n' +
-' word3] \n' +
-'aopop pop 0 1 2 3 4\n' +
-' (a) [b] {c} \n' +
-'int getchar(void) {\n' +
-'  static char buf[BUFSIZ];\n' +
-'  static char *bufp = buf;\n' +
-'  if (n == 0) {  /* buffer is empty */\n' +
-'    n = read(0, buf, sizeof buf);\n' +
-'    bufp = buf;\n' +
-'  }\n' +
-'\n' +
-'  return (--n >= 0) ? (unsigned char) *bufp++ : EOF;\n' +
-' \n' +
-'}\n';
-
-var lines = (function() {
-  lineText = code.split('\n');
-  var ret = [];
-  for (var i = 0; i < lineText.length; i++) {
-    ret[i] = {
-      line: i,
-      length: lineText[i].length,
-      lineText: lineText[i],
-      textStart: /^\s*/.exec(lineText[i])[0].length
-    };
-  }
-  return ret;
-})();
-var endOfDocument = makeCursor(lines.length - 1,
-    lines[lines.length - 1].length);
-var wordLine = lines[0];
-var bigWordLine = lines[1];
-var charLine = lines[2];
-var bracesLine = lines[3];
-var seekBraceLine = lines[4];
-
-var word1 = {
-  start: new Pos(wordLine.line, 1),
-  end: new Pos(wordLine.line, 5)
-};
-var word2 = {
-  start: new Pos(wordLine.line, word1.end.ch + 2),
-  end: new Pos(wordLine.line, word1.end.ch + 4)
-};
-var word3 = {
-  start: new Pos(bigWordLine.line, 1),
-  end: new Pos(bigWordLine.line, 5)
-};
-var bigWord1 = word1;
-var bigWord2 = word2;
-var bigWord3 = {
-  start: new Pos(bigWordLine.line, 1),
-  end: new Pos(bigWordLine.line, 7)
-};
-var bigWord4 = {
-  start: new Pos(bigWordLine.line, bigWord1.end.ch + 3),
-  end: new Pos(bigWordLine.line, bigWord1.end.ch + 7)
-};
-
-var oChars = [ new Pos(charLine.line, 1),
-    new Pos(charLine.line, 3),
-    new Pos(charLine.line, 7) ];
-var pChars = [ new Pos(charLine.line, 2),
-    new Pos(charLine.line, 4),
-    new Pos(charLine.line, 6),
-    new Pos(charLine.line, 8) ];
-var numChars = [ new Pos(charLine.line, 10),
-    new Pos(charLine.line, 12),
-    new Pos(charLine.line, 14),
-    new Pos(charLine.line, 16),
-    new Pos(charLine.line, 18)];
-var parens1 = {
-  start: new Pos(bracesLine.line, 1),
-  end: new Pos(bracesLine.line, 3)
-};
-var squares1 = {
-  start: new Pos(bracesLine.line, 5),
-  end: new Pos(bracesLine.line, 7)
-};
-var curlys1 = {
-  start: new Pos(bracesLine.line, 9),
-  end: new Pos(bracesLine.line, 11)
-};
-var seekOutside = {
-  start: new Pos(seekBraceLine.line, 1),
-  end: new Pos(seekBraceLine.line, 16)
-};
-var seekInside = {
-  start: new Pos(seekBraceLine.line, 14),
-  end: new Pos(seekBraceLine.line, 11)
-};
-
-function copyCursor(cur) {
-  return new Pos(cur.line, cur.ch);
-}
-
-function forEach(arr, func) {
-  for (var i = 0; i < arr.length; i++) {
-    func(arr[i], i, arr);
-  }
-}
-
-function testVim(name, run, opts, expectedFail) {
-  var vimOpts = {
-    lineNumbers: true,
-    vimMode: true,
-    showCursorWhenSelecting: true,
-    value: code
-  };
-  for (var prop in opts) {
-    if (opts.hasOwnProperty(prop)) {
-      vimOpts[prop] = opts[prop];
-    }
-  }
-  return test('vim_' + name, function() {
-    var place = document.getElementById("testground");
-    var cm = CodeMirror(place, vimOpts);
-    var vim = CodeMirror.Vim.maybeInitVimState_(cm);
-
-    function doKeysFn(cm) {
-      return function(args) {
-        if (args instanceof Array) {
-          arguments = args;
-        }
-        for (var i = 0; i < arguments.length; i++) {
-          var result = CodeMirror.Vim.handleKey(cm, arguments[i]);
-          if (!result && cm.state.vim.insertMode) {
-            cm.replaceSelections(fillArray(arguments[i], cm.listSelections().length));
-          }
-        }
-      }
-    }
-    function doInsertModeKeysFn(cm) {
-      return function(args) {
-        if (args instanceof Array) { arguments = args; }
-        function executeHandler(handler) {
-          if (typeof handler == 'string') {
-            CodeMirror.commands[handler](cm);
-          } else {
-            handler(cm);
-          }
-          return true;
-        }
-        for (var i = 0; i < arguments.length; i++) {
-          var key = arguments[i];
-          // Find key in keymap and handle.
-          var handled = CodeMirror.lookupKey(key, cm.getOption('keyMap'), executeHandler, cm);
-          // Record for insert mode.
-          if (handled == "handled" && cm.state.vim.insertMode && arguments[i] != 'Esc') {
-            var lastChange = CodeMirror.Vim.getVimGlobalState_().macroModeState.lastInsertModeChanges;
-            if (lastChange && (key.indexOf('Delete') != -1 || key.indexOf('Backspace') != -1)) {
-              lastChange.changes.push(new CodeMirror.Vim.InsertModeKey(key));
-            }
-          }
-        }
-      }
-    }
-    function doExFn(cm) {
-      return function(command) {
-        cm.openDialog = helpers.fakeOpenDialog(command);
-        helpers.doKeys(':');
-      }
-    }
-    function assertCursorAtFn(cm) {
-      return function(line, ch) {
-        var pos;
-        if (ch == null && typeof line.line == 'number') {
-          pos = line;
-        } else {
-          pos = makeCursor(line, ch);
-        }
-        eqCursorPos(cm.getCursor(), pos);
-      }
-    }
-    function fakeOpenDialog(result) {
-      return function(text, callback) {
-        return callback(result);
-      }
-    }
-    function fakeOpenNotification(matcher) {
-      return function(text) {
-        matcher(text);
-      }
-    }
-    var helpers = {
-      doKeys: doKeysFn(cm),
-      // Warning: Only emulates keymap events, not character insertions. Use
-      // replaceRange to simulate character insertions.
-      // Keys are in CodeMirror format, NOT vim format.
-      doInsertModeKeys: doInsertModeKeysFn(cm),
-      doEx: doExFn(cm),
-      assertCursorAt: assertCursorAtFn(cm),
-      fakeOpenDialog: fakeOpenDialog,
-      fakeOpenNotification: fakeOpenNotification,
-      getRegisterController: function() {
-        return CodeMirror.Vim.getRegisterController();
-      }
-    }
-    CodeMirror.Vim.resetVimGlobalState_();
-    var successful = false;
-    var savedOpenNotification = cm.openNotification;
-    var savedOpenDialog = cm.openDialog;
-    try {
-      run(cm, vim, helpers);
-      successful = true;
-    } finally {
-      cm.openNotification = savedOpenNotification;
-      cm.openDialog = savedOpenDialog;
-      if (!successful || verbose) {
-        place.style.visibility = "visible";
-      } else {
-        place.removeChild(cm.getWrapperElement());
-      }
-    }
-  }, expectedFail);
-};
-testVim('qq@q', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'q', 'l', 'l', 'q');
-  helpers.assertCursorAt(0,2);
-  helpers.doKeys('@', 'q');
-  helpers.assertCursorAt(0,4);
-}, { value: '            '});
-testVim('@@', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'q', 'l', 'l', 'q');
-  helpers.assertCursorAt(0,2);
-  helpers.doKeys('@', 'q');
-  helpers.assertCursorAt(0,4);
-  helpers.doKeys('@', '@');
-  helpers.assertCursorAt(0,6);
-}, { value: '            '});
-var jumplistScene = ''+
-  'word\n'+
-  '(word)\n'+
-  '{word\n'+
-  'word.\n'+
-  '\n'+
-  'word search\n'+
-  '}word\n'+
-  'word\n'+
-  'word\n';
-function testJumplist(name, keys, endPos, startPos, dialog) {
-  endPos = makeCursor(endPos[0], endPos[1]);
-  startPos = makeCursor(startPos[0], startPos[1]);
-  testVim(name, function(cm, vim, helpers) {
-    CodeMirror.Vim.resetVimGlobalState_();
-    if(dialog)cm.openDialog = helpers.fakeOpenDialog('word');
-    cm.setCursor(startPos);
-    helpers.doKeys.apply(null, keys);
-    helpers.assertCursorAt(endPos);
-  }, {value: jumplistScene});
-};
-testJumplist('jumplist_H', ['H', '<C-o>'], [5,2], [5,2]);
-testJumplist('jumplist_M', ['M', '<C-o>'], [2,2], [2,2]);
-testJumplist('jumplist_L', ['L', '<C-o>'], [2,2], [2,2]);
-testJumplist('jumplist_[[', ['[', '[', '<C-o>'], [5,2], [5,2]);
-testJumplist('jumplist_]]', [']', ']', '<C-o>'], [2,2], [2,2]);
-testJumplist('jumplist_G', ['G', '<C-o>'], [5,2], [5,2]);
-testJumplist('jumplist_gg', ['g', 'g', '<C-o>'], [5,2], [5,2]);
-testJumplist('jumplist_%', ['%', '<C-o>'], [1,5], [1,5]);
-testJumplist('jumplist_{', ['{', '<C-o>'], [1,5], [1,5]);
-testJumplist('jumplist_}', ['}', '<C-o>'], [1,5], [1,5]);
-testJumplist('jumplist_\'', ['m', 'a', 'h', '\'', 'a', 'h', '<C-i>'], [1,0], [1,5]);
-testJumplist('jumplist_`', ['m', 'a', 'h', '`', 'a', 'h', '<C-i>'], [1,5], [1,5]);
-testJumplist('jumplist_*_cachedCursor', ['*', '<C-o>'], [1,3], [1,3]);
-testJumplist('jumplist_#_cachedCursor', ['#', '<C-o>'], [1,3], [1,3]);
-testJumplist('jumplist_n', ['#', 'n', '<C-o>'], [1,1], [2,3]);
-testJumplist('jumplist_N', ['#', 'N', '<C-o>'], [1,1], [2,3]);
-testJumplist('jumplist_repeat_<c-o>', ['*', '*', '*', '3', '<C-o>'], [2,3], [2,3]);
-testJumplist('jumplist_repeat_<c-i>', ['*', '*', '*', '3', '<C-o>', '2', '<C-i>'], [5,0], [2,3]);
-testJumplist('jumplist_repeated_motion', ['3', '*', '<C-o>'], [2,3], [2,3]);
-testJumplist('jumplist_/', ['/', '<C-o>'], [2,3], [2,3], 'dialog');
-testJumplist('jumplist_?', ['?', '<C-o>'], [2,3], [2,3], 'dialog');
-testJumplist('jumplist_skip_deleted_mark<c-o>',
-             ['*', 'n', 'n', 'k', 'd', 'k', '<C-o>', '<C-o>', '<C-o>'],
-             [0,2], [0,2]);
-testJumplist('jumplist_skip_deleted_mark<c-i>',
-             ['*', 'n', 'n', 'k', 'd', 'k', '<C-o>', '<C-i>', '<C-i>'],
-             [1,0], [0,2]);
-
-/**
- * @param name Name of the test
- * @param keys An array of keys or a string with a single key to simulate.
- * @param endPos The expected end position of the cursor.
- * @param startPos The position the cursor should start at, defaults to 0, 0.
- */
-function testMotion(name, keys, endPos, startPos) {
-  testVim(name, function(cm, vim, helpers) {
-    if (!startPos) {
-      startPos = new Pos(0, 0);
-    }
-    cm.setCursor(startPos);
-    helpers.doKeys(keys);
-    helpers.assertCursorAt(endPos);
-  });
-};
-
-function makeCursor(line, ch) {
-  return new Pos(line, ch);
-};
-
-function offsetCursor(cur, offsetLine, offsetCh) {
-  return new Pos(cur.line + offsetLine, cur.ch + offsetCh);
-};
-
-// Motion tests
-testMotion('|', '|', makeCursor(0, 0), makeCursor(0,4));
-testMotion('|_repeat', ['3', '|'], makeCursor(0, 2), makeCursor(0,4));
-testMotion('h', 'h', makeCursor(0, 0), word1.start);
-testMotion('h_repeat', ['3', 'h'], offsetCursor(word1.end, 0, -3), word1.end);
-testMotion('l', 'l', makeCursor(0, 1));
-testMotion('l_repeat', ['2', 'l'], makeCursor(0, 2));
-testMotion('j', 'j', offsetCursor(word1.end, 1, 0), word1.end);
-testMotion('j_repeat', ['2', 'j'], offsetCursor(word1.end, 2, 0), word1.end);
-testMotion('j_repeat_clip', ['1000', 'j'], endOfDocument);
-testMotion('k', 'k', offsetCursor(word3.end, -1, 0), word3.end);
-testMotion('k_repeat', ['2', 'k'], makeCursor(0, 4), makeCursor(2, 4));
-testMotion('k_repeat_clip', ['1000', 'k'], makeCursor(0, 4), makeCursor(2, 4));
-testMotion('w', 'w', word1.start);
-testMotion('w_multiple_newlines_no_space', 'w', makeCursor(12, 2), makeCursor(11, 2));
-testMotion('w_multiple_newlines_with_space', 'w', makeCursor(14, 0), makeCursor(12, 51));
-testMotion('w_repeat', ['2', 'w'], word2.start);
-testMotion('w_wrap', ['w'], word3.start, word2.start);
-testMotion('w_endOfDocument', 'w', endOfDocument, endOfDocument);
-testMotion('w_start_to_end', ['1000', 'w'], endOfDocument, makeCursor(0, 0));
-testMotion('W', 'W', bigWord1.start);
-testMotion('W_repeat', ['2', 'W'], bigWord3.start, bigWord1.start);
-testMotion('e', 'e', word1.end);
-testMotion('e_repeat', ['2', 'e'], word2.end);
-testMotion('e_wrap', 'e', word3.end, word2.end);
-testMotion('e_endOfDocument', 'e', endOfDocument, endOfDocument);
-testMotion('e_start_to_end', ['1000', 'e'], endOfDocument, makeCursor(0, 0));
-testMotion('b', 'b', word3.start, word3.end);
-testMotion('b_repeat', ['2', 'b'], word2.start, word3.end);
-testMotion('b_wrap', 'b', word2.start, word3.start);
-testMotion('b_startOfDocument', 'b', makeCursor(0, 0), makeCursor(0, 0));
-testMotion('b_end_to_start', ['1000', 'b'], makeCursor(0, 0), endOfDocument);
-testMotion('ge', ['g', 'e'], word2.end, word3.end);
-testMotion('ge_repeat', ['2', 'g', 'e'], word1.end, word3.start);
-testMotion('ge_wrap', ['g', 'e'], word2.end, word3.start);
-testMotion('ge_startOfDocument', ['g', 'e'], makeCursor(0, 0),
-    makeCursor(0, 0));
-testMotion('ge_end_to_start', ['1000', 'g', 'e'], makeCursor(0, 0), endOfDocument);
-testMotion('gg', ['g', 'g'], makeCursor(lines[0].line, lines[0].textStart),
-    makeCursor(3, 1));
-testMotion('gg_repeat', ['3', 'g', 'g'],
-    makeCursor(lines[2].line, lines[2].textStart));
-testMotion('G', 'G',
-    makeCursor(lines[lines.length - 1].line, lines[lines.length - 1].textStart),
-    makeCursor(3, 1));
-testMotion('G_repeat', ['3', 'G'], makeCursor(lines[2].line,
-    lines[2].textStart));
-// TODO: Make the test code long enough to test Ctrl-F and Ctrl-B.
-testMotion('0', '0', makeCursor(0, 0), makeCursor(0, 8));
-testMotion('^', '^', makeCursor(0, lines[0].textStart), makeCursor(0, 8));
-testMotion('+', '+', makeCursor(1, lines[1].textStart), makeCursor(0, 8));
-testMotion('-', '-', makeCursor(0, lines[0].textStart), makeCursor(1, 4));
-testMotion('_', ['6','_'], makeCursor(5, lines[5].textStart), makeCursor(0, 8));
-testMotion('$', '$', makeCursor(0, lines[0].length - 1), makeCursor(0, 1));
-testMotion('$_repeat', ['2', '$'], makeCursor(1, lines[1].length - 1),
-    makeCursor(0, 3));
-testMotion('f', ['f', 'p'], pChars[0], makeCursor(charLine.line, 0));
-testMotion('f_repeat', ['2', 'f', 'p'], pChars[2], pChars[0]);
-testMotion('f_num', ['f', '2'], numChars[2], makeCursor(charLine.line, 0));
-testMotion('t', ['t','p'], offsetCursor(pChars[0], 0, -1),
-    makeCursor(charLine.line, 0));
-testMotion('t_repeat', ['2', 't', 'p'], offsetCursor(pChars[2], 0, -1),
-    pChars[0]);
-testMotion('F', ['F', 'p'], pChars[0], pChars[1]);
-testMotion('F_repeat', ['2', 'F', 'p'], pChars[0], pChars[2]);
-testMotion('T', ['T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[1]);
-testMotion('T_repeat', ['2', 'T', 'p'], offsetCursor(pChars[0], 0, 1), pChars[2]);
-testMotion('%_parens', ['%'], parens1.end, parens1.start);
-testMotion('%_squares', ['%'], squares1.end, squares1.start);
-testMotion('%_braces', ['%'], curlys1.end, curlys1.start);
-testMotion('%_seek_outside', ['%'], seekOutside.end, seekOutside.start);
-testMotion('%_seek_inside', ['%'], seekInside.end, seekInside.start);
-testVim('%_seek_skip', function(cm, vim, helpers) {
-  cm.setCursor(0,0);
-  helpers.doKeys(['%']);
-  helpers.assertCursorAt(0,9);
-}, {value:'01234"("()'});
-testVim('%_skip_string', function(cm, vim, helpers) {
-  cm.setCursor(0,0);
-  helpers.doKeys(['%']);
-  helpers.assertCursorAt(0,4);
-  cm.setCursor(0,2);
-  helpers.doKeys(['%']);
-  helpers.assertCursorAt(0,0);
-}, {value:'(")")'});
-testVim('%_skip_comment', function(cm, vim, helpers) {
-  cm.setCursor(0,0);
-  helpers.doKeys(['%']);
-  helpers.assertCursorAt(0,6);
-  cm.setCursor(0,3);
-  helpers.doKeys(['%']);
-  helpers.assertCursorAt(0,0);
-}, {value:'(/*)*/)'});
-// Make sure that moving down after going to the end of a line always leaves you
-// at the end of a line, but preserves the offset in other cases
-testVim('Changing lines after Eol operation', function(cm, vim, helpers) {
-  cm.setCursor(0,0);
-  helpers.doKeys(['$']);
-  helpers.doKeys(['j']);
-  // After moving to Eol and then down, we should be at Eol of line 2
-  helpers.assertCursorAt(new Pos(1, lines[1].length - 1));
-  helpers.doKeys(['j']);
-  // After moving down, we should be at Eol of line 3
-  helpers.assertCursorAt(new Pos(2, lines[2].length - 1));
-  helpers.doKeys(['h']);
-  helpers.doKeys(['j']);
-  // After moving back one space and then down, since line 4 is shorter than line 2, we should
-  // be at Eol of line 2 - 1
-  helpers.assertCursorAt(new Pos(3, lines[3].length - 1));
-  helpers.doKeys(['j']);
-  helpers.doKeys(['j']);
-  // After moving down again, since line 3 has enough characters, we should be back to the
-  // same place we were at on line 1
-  helpers.assertCursorAt(new Pos(5, lines[2].length - 2));
-});
-//making sure gj and gk recover from clipping
-testVim('gj_gk_clipping', function(cm,vim,helpers){
-  cm.setCursor(0, 1);
-  helpers.doKeys('g','j','g','j');
-  helpers.assertCursorAt(2, 1);
-  helpers.doKeys('g','k','g','k');
-  helpers.assertCursorAt(0, 1);
-},{value: 'line 1\n\nline 2'});
-//testing a mix of j/k and gj/gk
-testVim('j_k_and_gj_gk', function(cm,vim,helpers){
-  cm.setSize(120);
-  cm.setCursor(0, 0);
-  //go to the last character on the first line
-  helpers.doKeys('$');
-  //move up/down on the column within the wrapped line
-  //side-effect: cursor is not locked to eol anymore
-  helpers.doKeys('g','k');
-  var cur=cm.getCursor();
-  eq(cur.line,0);
-  is((cur.ch<176),'gk didn\'t move cursor back (1)');
-  helpers.doKeys('g','j');
-  helpers.assertCursorAt(0, 176);
-  //should move to character 177 on line 2 (j/k preserve character index within line)
-  helpers.doKeys('j');
-  //due to different line wrapping, the cursor can be on a different screen-x now
-  //gj and gk preserve screen-x on movement, much like moveV
-  helpers.doKeys('3','g','k');
-  cur=cm.getCursor();
-  eq(cur.line,1);
-  is((cur.ch<176),'gk didn\'t move cursor back (2)');
-  helpers.doKeys('g','j','2','g','j');
-  //should return to the same character-index
-  helpers.doKeys('k');
-  helpers.assertCursorAt(0, 176);
-},{ lineWrapping:true, value: 'This line is intentially long to test movement of gj and gk over wrapped lines. I will start on the end of this line, then make a step up and back to set the origin for j and k.\nThis line is supposed to be even longer than the previous. I will jump here and make another wiggle with gj and gk, before I jump back to the line above. Both wiggles should not change my cursor\'s target character but both j/k and gj/gk change each other\'s reference position.'});
-testVim('gj_gk', function(cm, vim, helpers) {
-  if (phantom) return;
-  cm.setSize(120);
-  // Test top of document edge case.
-  cm.setCursor(0, 4);
-  helpers.doKeys('g', 'j');
-  helpers.doKeys('10', 'g', 'k');
-  helpers.assertCursorAt(0, 4);
-
-  // Test moving down preserves column position.
-  helpers.doKeys('g', 'j');
-  var pos1 = cm.getCursor();
-  var expectedPos2 = new Pos(0, (pos1.ch - 4) * 2 + 4);
-  helpers.doKeys('g', 'j');
-  helpers.assertCursorAt(expectedPos2);
-
-  // Move to the last character
-  cm.setCursor(0, 0);
-  // Move left to reset HSPos
-  helpers.doKeys('h');
-  // Test bottom of document edge case.
-  helpers.doKeys('100', 'g', 'j');
-  var endingPos = cm.getCursor();
-  is(endingPos != 0, 'gj should not be on wrapped line 0');
-  var topLeftCharCoords = cm.charCoords(makeCursor(0, 0));
-  var endingCharCoords = cm.charCoords(endingPos);
-  is(topLeftCharCoords.left == endingCharCoords.left, 'gj should end up on column 0');
-},{ lineNumbers: false, lineWrapping:true, value: 'Thislineisintentionallylongtotestmovementofgjandgkoverwrappedlines.' });
-testVim('}', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('}');
-  helpers.assertCursorAt(1, 0);
-  cm.setCursor(0, 0);
-  helpers.doKeys('2', '}');
-  helpers.assertCursorAt(4, 0);
-  cm.setCursor(0, 0);
-  helpers.doKeys('6', '}');
-  helpers.assertCursorAt(5, 0);
-}, { value: 'a\n\nb\nc\n\nd' });
-testVim('{', function(cm, vim, helpers) {
-  cm.setCursor(5, 0);
-  helpers.doKeys('{');
-  helpers.assertCursorAt(4, 0);
-  cm.setCursor(5, 0);
-  helpers.doKeys('2', '{');
-  helpers.assertCursorAt(1, 0);
-  cm.setCursor(5, 0);
-  helpers.doKeys('6', '{');
-  helpers.assertCursorAt(0, 0);
-}, { value: 'a\n\nb\nc\n\nd' });
-testVim('paragraph_motions', function(cm, vim, helpers) {
-  cm.setCursor(10, 0);
-  helpers.doKeys('{');
-  helpers.assertCursorAt(4, 0);
-  helpers.doKeys('{');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('2', '}');
-  helpers.assertCursorAt(7, 0);
-  helpers.doKeys('2', '}');
-  helpers.assertCursorAt(16, 0);
-
-  cm.setCursor(9, 0);
-  helpers.doKeys('}');
-  helpers.assertCursorAt(14, 0);
-
-  cm.setCursor(6, 0);
-  helpers.doKeys('}');
-  helpers.assertCursorAt(7, 0);
-
-  // ip inside empty space
-  cm.setCursor(10, 0);
-  helpers.doKeys('v', 'i', 'p');
-  eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
-  eqCursorPos(Pos(12, 0), cm.getCursor('head'));
-  helpers.doKeys('i', 'p');
-  eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
-  eqCursorPos(Pos(13, 1), cm.getCursor('head'));
-  helpers.doKeys('2', 'i', 'p');
-  eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
-  eqCursorPos(Pos(16, 1), cm.getCursor('head'));
-
-  // should switch to visualLine mode
-  cm.setCursor(14, 0);
-  helpers.doKeys('<Esc>', 'v', 'i', 'p');
-  helpers.assertCursorAt(14, 0);
-
-  cm.setCursor(14, 0);
-  helpers.doKeys('<Esc>', 'V', 'i', 'p');
-  eqCursorPos(Pos(16, 1), cm.getCursor('head'));
-
-  // ap inside empty space
-  cm.setCursor(10, 0);
-  helpers.doKeys('<Esc>', 'v', 'a', 'p');
-  eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
-  eqCursorPos(Pos(13, 1), cm.getCursor('head'));
-  helpers.doKeys('a', 'p');
-  eqCursorPos(Pos(7, 0), cm.getCursor('anchor'));
-  eqCursorPos(Pos(16, 1), cm.getCursor('head'));
-
-  cm.setCursor(13, 0);
-  helpers.doKeys('v', 'a', 'p');
-  eqCursorPos(Pos(13, 0), cm.getCursor('anchor'));
-  eqCursorPos(Pos(14, 0), cm.getCursor('head'));
-
-  cm.setCursor(16, 0);
-  helpers.doKeys('v', 'a', 'p');
-  eqCursorPos(Pos(14, 0), cm.getCursor('anchor'));
-  eqCursorPos(Pos(16, 1), cm.getCursor('head'));
-
-  cm.setCursor(0, 0);
-  helpers.doKeys('v', 'a', 'p');
-  eqCursorPos(Pos(0, 0), cm.getCursor('anchor'));
-  eqCursorPos(Pos(4, 0), cm.getCursor('head'));
-
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'i', 'p');
-  var register = helpers.getRegisterController().getRegister();
-  eq('a\na\n', register.toString());
-  is(register.linewise);
-  helpers.doKeys('3', 'j', 'p');
-  helpers.doKeys('y', 'i', 'p');
-  is(register.linewise);
-  eq('b\na\na\nc\n', register.toString());
-}, { value: 'a\na\n\n\n\nb\nc\n\n\n\n\n\n\nd\n\ne\nf' });
-
-// Operator tests
-testVim('dl', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 0);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'l');
-  eq('word1 ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(' ', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-}, { value: ' word1 ' });
-testVim('dl_eol', function(cm, vim, helpers) {
-  cm.setCursor(0, 6);
-  helpers.doKeys('d', 'l');
-  eq(' word1', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(' ', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 5);
-}, { value: ' word1 ' });
-testVim('dl_repeat', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 0);
-  cm.setCursor(curStart);
-  helpers.doKeys('2', 'd', 'l');
-  eq('ord1 ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(' w', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-}, { value: ' word1 ' });
-testVim('dh', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 3);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'h');
-  eq(' wrd1 ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('o', register.toString());
-  is(!register.linewise);
-  eqCursorPos(offsetCursor(curStart, 0 , -1), cm.getCursor());
-}, { value: ' word1 ' });
-testVim('dj', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 3);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'j');
-  eq(' word3', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(' word1\nword2\n', register.toString());
-  is(register.linewise);
-  helpers.assertCursorAt(0, 1);
-}, { value: ' word1\nword2\n word3' });
-testVim('dj_end_of_document', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 3);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'j');
-  eq('', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(' word1 \n', register.toString());
-  is(register.linewise);
-  helpers.assertCursorAt(0, 0);
-}, { value: ' word1 ' });
-testVim('dk', function(cm, vim, helpers) {
-  var curStart = makeCursor(1, 3);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'k');
-  eq(' word3', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(' word1\nword2\n', register.toString());
-  is(register.linewise);
-  helpers.assertCursorAt(0, 1);
-}, { value: ' word1\nword2\n word3' });
-testVim('dk_start_of_document', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 3);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'k');
-  eq('', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(' word1 \n', register.toString());
-  is(register.linewise);
-  helpers.assertCursorAt(0, 0);
-}, { value: ' word1 ' });
-testVim('dw_space', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 0);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'w');
-  eq('word1 ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(' ', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-}, { value: ' word1 ' });
-testVim('dw_word', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 1);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'w');
-  eq(' word2', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1 ', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-}, { value: ' word1 word2' });
-testVim('dw_unicode_word', function(cm, vim, helpers) {
-  helpers.doKeys('d', 'w');
-  eq(cm.getValue().length, 10);
-  helpers.doKeys('d', 'w');
-  eq(cm.getValue().length, 6);
-  helpers.doKeys('d', 'w');
-  eq(cm.getValue().length, 5);
-  helpers.doKeys('d', 'e');
-  eq(cm.getValue().length, 2);
-}, { value: '  \u0562\u0561\u0580\u0587\xbbe\xb5g  ' });
-testVim('dw_only_word', function(cm, vim, helpers) {
-  // Test that if there is only 1 word left, dw deletes till the end of the
-  // line.
-  cm.setCursor(0, 1);
-  helpers.doKeys('d', 'w');
-  eq(' ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1 ', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 0);
-}, { value: ' word1 ' });
-testVim('dw_eol', function(cm, vim, helpers) {
-  // Assert that dw does not delete the newline if last word to delete is at end
-  // of line.
-  cm.setCursor(0, 1);
-  helpers.doKeys('d', 'w');
-  eq(' \nword2', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 0);
-}, { value: ' word1\nword2' });
-testVim('dw_eol_with_multiple_newlines', function(cm, vim, helpers) {
-  // Assert that dw does not delete the newline if last word to delete is at end
-  // of line and it is followed by multiple newlines.
-  cm.setCursor(0, 1);
-  helpers.doKeys('d', 'w');
-  eq(' \n\nword2', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 0);
-}, { value: ' word1\n\nword2' });
-testVim('dw_empty_line_followed_by_whitespace', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'w');
-  eq('  \nword', cm.getValue());
-}, { value: '\n  \nword' });
-testVim('dw_empty_line_followed_by_word', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'w');
-  eq('word', cm.getValue());
-}, { value: '\nword' });
-testVim('dw_empty_line_followed_by_empty_line', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'w');
-  eq('\n', cm.getValue());
-}, { value: '\n\n' });
-testVim('dw_whitespace_followed_by_whitespace', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'w');
-  eq('\n   \n', cm.getValue());
-}, { value: '  \n   \n' });
-testVim('dw_whitespace_followed_by_empty_line', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'w');
-  eq('\n\n', cm.getValue());
-}, { value: '  \n\n' });
-testVim('dw_word_whitespace_word', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'w');
-  eq('\n   \nword2', cm.getValue());
-}, { value: 'word1\n   \nword2'})
-testVim('dw_end_of_document', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('d', 'w');
-  eq('\nab', cm.getValue());
-}, { value: '\nabc' });
-testVim('dw_repeat', function(cm, vim, helpers) {
-  // Assert that dw does delete newline if it should go to the next line, and
-  // that repeat works properly.
-  cm.setCursor(0, 1);
-  helpers.doKeys('d', '2', 'w');
-  eq(' ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1\nword2', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 0);
-}, { value: ' word1\nword2' });
-testVim('de_word_start_and_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'e');
-  eq('\n\n', cm.getValue());
-}, { value: 'word\n\n' });
-testVim('de_word_end_and_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  helpers.doKeys('d', 'e');
-  eq('wor', cm.getValue());
-}, { value: 'word\n\n\n' });
-testVim('de_whitespace_and_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'e');
-  eq('', cm.getValue());
-}, { value: '   \n\n\n' });
-testVim('de_end_of_document', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('d', 'e');
-  eq('\nab', cm.getValue());
-}, { value: '\nabc' });
-testVim('db_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(2, 0);
-  helpers.doKeys('d', 'b');
-  eq('\n\n', cm.getValue());
-}, { value: '\n\n\n' });
-testVim('db_word_start_and_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(2, 0);
-  helpers.doKeys('d', 'b');
-  eq('\nword', cm.getValue());
-}, { value: '\n\nword' });
-testVim('db_word_end_and_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(2, 3);
-  helpers.doKeys('d', 'b');
-  eq('\n\nd', cm.getValue());
-}, { value: '\n\nword' });
-testVim('db_whitespace_and_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(2, 0);
-  helpers.doKeys('d', 'b');
-  eq('', cm.getValue());
-}, { value: '\n   \n' });
-testVim('db_start_of_document', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'b');
-  eq('abc\n', cm.getValue());
-}, { value: 'abc\n' });
-testVim('dge_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(1, 0);
-  helpers.doKeys('d', 'g', 'e');
-  // Note: In real VIM the result should be '', but it's not quite consistent,
-  // since 2 newlines are deleted. But in the similar case of word\n\n, only
-  // 1 newline is deleted. We'll diverge from VIM's behavior since it's much
-  // easier this way.
-  eq('\n', cm.getValue());
-}, { value: '\n\n' });
-testVim('dge_word_and_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(1, 0);
-  helpers.doKeys('d', 'g', 'e');
-  eq('wor\n', cm.getValue());
-}, { value: 'word\n\n'});
-testVim('dge_whitespace_and_empty_lines', function(cm, vim, helpers) {
-  cm.setCursor(2, 0);
-  helpers.doKeys('d', 'g', 'e');
-  eq('', cm.getValue());
-}, { value: '\n  \n' });
-testVim('dge_start_of_document', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', 'g', 'e');
-  eq('bc\n', cm.getValue());
-}, { value: 'abc\n' });
-testVim('d_inclusive', function(cm, vim, helpers) {
-  // Assert that when inclusive is set, the character the cursor is on gets
-  // deleted too.
-  var curStart = makeCursor(0, 1);
-  cm.setCursor(curStart);
-  helpers.doKeys('d', 'e');
-  eq('  ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-}, { value: ' word1 ' });
-testVim('d_reverse', function(cm, vim, helpers) {
-  // Test that deleting in reverse works.
-  cm.setCursor(1, 0);
-  helpers.doKeys('d', 'b');
-  eq(' word2 ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1\n', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 1);
-}, { value: ' word1\nword2 ' });
-testVim('dd', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedBuffer = cm.getRange(new Pos(0, 0),
-    new Pos(1, 0));
-  var expectedLineCount = cm.lineCount() - 1;
-  helpers.doKeys('d', 'd');
-  eq(expectedLineCount, cm.lineCount());
-  var register = helpers.getRegisterController().getRegister();
-  eq(expectedBuffer, register.toString());
-  is(register.linewise);
-  helpers.assertCursorAt(0, lines[1].textStart);
-});
-testVim('dd_prefix_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedBuffer = cm.getRange(new Pos(0, 0),
-    new Pos(2, 0));
-  var expectedLineCount = cm.lineCount() - 2;
-  helpers.doKeys('2', 'd', 'd');
-  eq(expectedLineCount, cm.lineCount());
-  var register = helpers.getRegisterController().getRegister();
-  eq(expectedBuffer, register.toString());
-  is(register.linewise);
-  helpers.assertCursorAt(0, lines[2].textStart);
-});
-testVim('dd_motion_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedBuffer = cm.getRange(new Pos(0, 0),
-    new Pos(2, 0));
-  var expectedLineCount = cm.lineCount() - 2;
-  helpers.doKeys('d', '2', 'd');
-  eq(expectedLineCount, cm.lineCount());
-  var register = helpers.getRegisterController().getRegister();
-  eq(expectedBuffer, register.toString());
-  is(register.linewise);
-  helpers.assertCursorAt(0, lines[2].textStart);
-});
-testVim('dd_multiply_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedBuffer = cm.getRange(new Pos(0, 0),
-    new Pos(6, 0));
-  var expectedLineCount = cm.lineCount() - 6;
-  helpers.doKeys('2', 'd', '3', 'd');
-  eq(expectedLineCount, cm.lineCount());
-  var register = helpers.getRegisterController().getRegister();
-  eq(expectedBuffer, register.toString());
-  is(register.linewise);
-  helpers.assertCursorAt(0, lines[6].textStart);
-});
-testVim('dd_lastline', function(cm, vim, helpers) {
-  cm.setCursor(cm.lineCount(), 0);
-  var expectedLineCount = cm.lineCount() - 1;
-  helpers.doKeys('d', 'd');
-  eq(expectedLineCount, cm.lineCount());
-  helpers.assertCursorAt(cm.lineCount() - 1, 0);
-});
-testVim('dd_only_line', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  var expectedRegister = cm.getValue() + "\n";
-  helpers.doKeys('d','d');
-  eq(1, cm.lineCount());
-  eq('', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq(expectedRegister, register.toString());
-}, { value: "thisistheonlyline" });
-// Yank commands should behave the exact same as d commands, expect that nothing
-// gets deleted.
-testVim('yw_repeat', function(cm, vim, helpers) {
-  // Assert that yw does yank newline if it should go to the next line, and
-  // that repeat works properly.
-  var curStart = makeCursor(0, 1);
-  cm.setCursor(curStart);
-  helpers.doKeys('y', '2', 'w');
-  eq(' word1\nword2', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1\nword2', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-}, { value: ' word1\nword2' });
-testVim('yy_multiply_repeat', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 3);
-  cm.setCursor(curStart);
-  var expectedBuffer = cm.getRange(new Pos(0, 0),
-    new Pos(6, 0));
-  var expectedLineCount = cm.lineCount();
-  helpers.doKeys('2', 'y', '3', 'y');
-  eq(expectedLineCount, cm.lineCount());
-  var register = helpers.getRegisterController().getRegister();
-  eq(expectedBuffer, register.toString());
-  is(register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-});
-// Change commands behave like d commands except that it also enters insert
-// mode. In addition, when the change is linewise, an additional newline is
-// inserted so that insert mode starts on that line.
-testVim('cw', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('c', '2', 'w');
-  eq(' word3', cm.getValue());
-  helpers.assertCursorAt(0, 0);
-}, { value: 'word1 word2 word3'});
-testVim('cw_repeat', function(cm, vim, helpers) {
-  // Assert that cw does delete newline if it should go to the next line, and
-  // that repeat works properly.
-  var curStart = makeCursor(0, 1);
-  cm.setCursor(curStart);
-  helpers.doKeys('c', '2', 'w');
-  eq(' ', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('word1\nword2', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-  eq('vim-insert', cm.getOption('keyMap'));
-}, { value: ' word1\nword2' });
-testVim('cc_multiply_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedBuffer = cm.getRange(new Pos(0, 0),
-    new Pos(6, 0));
-  var expectedLineCount = cm.lineCount() - 5;
-  helpers.doKeys('2', 'c', '3', 'c');
-  eq(expectedLineCount, cm.lineCount());
-  var register = helpers.getRegisterController().getRegister();
-  eq(expectedBuffer, register.toString());
-  is(register.linewise);
-  eq('vim-insert', cm.getOption('keyMap'));
-});
-testVim('ct', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('c', 't', 'w');
-  eq('  word1  word3', cm.getValue());
-  helpers.doKeys('<Esc>', 'c', '|');
-  eq(' word3', cm.getValue());
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('<Esc>', '2', 'u', 'w', 'h');
-  helpers.doKeys('c', '2', 'g', 'e');
-  eq('  wordword3', cm.getValue());
-}, { value: '  word1  word2  word3'});
-testVim('cc_should_not_append_to_document', function(cm, vim, helpers) {
-  var expectedLineCount = cm.lineCount();
-  cm.setCursor(cm.lastLine(), 0);
-  helpers.doKeys('c', 'c');
-  eq(expectedLineCount, cm.lineCount());
-});
-function fillArray(val, times) {
-  var arr = [];
-  for (var i = 0; i < times; i++) {
-    arr.push(val);
-  }
-  return arr;
-}
-testVim('c_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'l', 'l', 'c');
-  var replacement = fillArray('hello', 3);
-  cm.replaceSelections(replacement);
-  eq('1hello\n5hello\nahellofg', cm.getValue());
-  helpers.doKeys('<Esc>');
-  cm.setCursor(2, 3);
-  helpers.doKeys('<C-v>', '2', 'k', 'h', 'C');
-  replacement = fillArray('world', 3);
-  cm.replaceSelections(replacement);
-  eq('1hworld\n5hworld\nahworld', cm.getValue());
-}, {value: '1234\n5678\nabcdefg'});
-testVim('c_visual_block_replay', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'c');
-  var replacement = fillArray('fo', 3);
-  cm.replaceSelections(replacement);
-  eq('1fo4\n5fo8\nafodefg', cm.getValue());
-  helpers.doKeys('<Esc>');
-  cm.setCursor(0, 0);
-  helpers.doKeys('.');
-  eq('foo4\nfoo8\nfoodefg', cm.getValue());
-}, {value: '1234\n5678\nabcdefg'});
-
-testVim('d_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'l', 'l', 'd');
-  eq('1\n5\nafg', cm.getValue());
-}, {value: '1234\n5678\nabcdefg'});
-testVim('D_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'D');
-  eq('1\n5\na', cm.getValue());
-}, {value: '1234\n5678\nabcdefg'});
-
-testVim('s_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'l', 'l', 's');
-  var replacement = fillArray('hello{', 3);
-  cm.replaceSelections(replacement);
-  eq('1hello{\n5hello{\nahello{fg\n', cm.getValue());
-  helpers.doKeys('<Esc>');
-  cm.setCursor(2, 3);
-  helpers.doKeys('<C-v>', '1', 'k', 'h', 'S');
-  replacement = fillArray('world', 1);
-  cm.replaceSelections(replacement);
-  eq('1hello{\n  world\n', cm.getValue());
-}, {value: '1234\n5678\nabcdefg\n'});
-
-// Swapcase commands edit in place and do not modify registers.
-testVim('g~w_repeat', function(cm, vim, helpers) {
-  // Assert that dw does delete newline if it should go to the next line, and
-  // that repeat works properly.
-  var curStart = makeCursor(0, 1);
-  cm.setCursor(curStart);
-  helpers.doKeys('g', '~', '2', 'w');
-  eq(' WORD1\nWORD2', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-}, { value: ' word1\nword2' });
-testVim('g~g~', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 3);
-  cm.setCursor(curStart);
-  var expectedLineCount = cm.lineCount();
-  var expectedValue = cm.getValue().toUpperCase();
-  helpers.doKeys('2', 'g', '~', '3', 'g', '~');
-  eq(expectedValue, cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-}, { value: ' word1\nword2\nword3\nword4\nword5\nword6' });
-testVim('gu_and_gU', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 7);
-  var value = cm.getValue();
-  cm.setCursor(curStart);
-  helpers.doKeys('2', 'g', 'U', 'w');
-  eq(cm.getValue(), 'wa wb xX WC wd');
-  eqCursorPos(curStart, cm.getCursor());
-  helpers.doKeys('2', 'g', 'u', 'w');
-  eq(cm.getValue(), value);
-
-  helpers.doKeys('2', 'g', 'U', 'B');
-  eq(cm.getValue(), 'wa WB Xx wc wd');
-  eqCursorPos(makeCursor(0, 3), cm.getCursor());
-
-  cm.setCursor(makeCursor(0, 4));
-  helpers.doKeys('g', 'u', 'i', 'w');
-  eq(cm.getValue(), 'wa wb Xx wc wd');
-  eqCursorPos(makeCursor(0, 3), cm.getCursor());
-
-  // TODO: support gUgU guu
-  // eqCursorPos(makeCursor(0, 0), cm.getCursor());
-
-  var register = helpers.getRegisterController().getRegister();
-  eq('', register.toString());
-  is(!register.linewise);
-}, { value: 'wa wb xx wc wd' });
-testVim('visual_block_~', function(cm, vim, helpers) {
-  cm.setCursor(1, 1);
-  helpers.doKeys('<C-v>', 'l', 'l', 'j', '~');
-  helpers.assertCursorAt(1, 1);
-  eq('hello\nwoRLd\naBCDe', cm.getValue());
-  cm.setCursor(2, 0);
-  helpers.doKeys('v', 'l', 'l', '~');
-  helpers.assertCursorAt(2, 0);
-  eq('hello\nwoRLd\nAbcDe', cm.getValue());
-},{value: 'hello\nwOrld\nabcde' });
-testVim('._swapCase_visualBlock', function(cm, vim, helpers) {
-  helpers.doKeys('<C-v>', 'j', 'j', 'l', '~');
-  cm.setCursor(0, 3);
-  helpers.doKeys('.');
-  eq('HelLO\nWorLd\nAbcdE', cm.getValue());
-},{value: 'hEllo\nwOrlD\naBcDe' });
-testVim('._delete_visualBlock', function(cm, vim, helpers) {
-  helpers.doKeys('<C-v>', 'j', 'x');
-  eq('ive\ne\nsome\nsugar', cm.getValue());
-  helpers.doKeys('.');
-  eq('ve\n\nsome\nsugar', cm.getValue());
-  helpers.doKeys('j', 'j', '.');
-  eq('ve\n\nome\nugar', cm.getValue());
-  helpers.doKeys('u', '<C-r>', '.');
-  eq('ve\n\nme\ngar', cm.getValue());
-},{value: 'give\nme\nsome\nsugar' });
-testVim('>{motion}', function(cm, vim, helpers) {
-  cm.setCursor(1, 3);
-  var expectedLineCount = cm.lineCount();
-  var expectedValue = '   word1\n  word2\nword3 ';
-  helpers.doKeys('>', 'k');
-  eq(expectedValue, cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 3);
-}, { value: ' word1\nword2\nword3 ', indentUnit: 2 });
-testVim('>>', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedLineCount = cm.lineCount();
-  var expectedValue = '   word1\n  word2\nword3 ';
-  helpers.doKeys('2', '>', '>');
-  eq(expectedValue, cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 3);
-}, { value: ' word1\nword2\nword3 ', indentUnit: 2 });
-testVim('<{motion}', function(cm, vim, helpers) {
-  cm.setCursor(1, 3);
-  var expectedLineCount = cm.lineCount();
-  var expectedValue = ' word1\nword2\nword3 ';
-  helpers.doKeys('<', 'k');
-  eq(expectedValue, cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 1);
-}, { value: '   word1\n  word2\nword3 ', indentUnit: 2 });
-testVim('<<', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedLineCount = cm.lineCount();
-  var expectedValue = ' word1\nword2\nword3 ';
-  helpers.doKeys('2', '<', '<');
-  eq(expectedValue, cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 1);
-}, { value: '   word1\n  word2\nword3 ', indentUnit: 2 });
-
-// Edit tests
-function testEdit(name, before, pos, edit, after) {
-  return testVim(name, function(cm, vim, helpers) {
-             var ch = before.search(pos)
-             var line = before.substring(0, ch).split('\n').length - 1;
-             if (line) {
-               ch = before.substring(0, ch).split('\n').pop().length;
-             }
-             cm.setCursor(line, ch);
-             helpers.doKeys.apply(this, edit.split(''));
-             eq(after, cm.getValue());
-           }, {value: before});
-}
-
-// These Delete tests effectively cover word-wise Change, Visual & Yank.
-// Tabs are used as differentiated whitespace to catch edge cases.
-// Normal word:
-testEdit('diw_mid_spc', 'foo \tbAr\t baz', /A/, 'diw', 'foo \t\t baz');
-testEdit('daw_mid_spc', 'foo \tbAr\t baz', /A/, 'daw', 'foo \tbaz');
-testEdit('diw_mid_punct', 'foo \tbAr.\t baz', /A/, 'diw', 'foo \t.\t baz');
-testEdit('daw_mid_punct', 'foo \tbAr.\t baz', /A/, 'daw', 'foo.\t baz');
-testEdit('diw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diw', 'foo \t,.\t baz');
-testEdit('daw_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daw', 'foo \t,.\t baz');
-testEdit('diw_start_spc', 'bAr \tbaz', /A/, 'diw', ' \tbaz');
-testEdit('daw_start_spc', 'bAr \tbaz', /A/, 'daw', 'baz');
-testEdit('diw_start_punct', 'bAr. \tbaz', /A/, 'diw', '. \tbaz');
-testEdit('daw_start_punct', 'bAr. \tbaz', /A/, 'daw', '. \tbaz');
-testEdit('diw_end_spc', 'foo \tbAr', /A/, 'diw', 'foo \t');
-testEdit('daw_end_spc', 'foo \tbAr', /A/, 'daw', 'foo');
-testEdit('diw_end_punct', 'foo \tbAr.', /A/, 'diw', 'foo \t.');
-testEdit('daw_end_punct', 'foo \tbAr.', /A/, 'daw', 'foo.');
-// Big word:
-testEdit('diW_mid_spc', 'foo \tbAr\t baz', /A/, 'diW', 'foo \t\t baz');
-testEdit('daW_mid_spc', 'foo \tbAr\t baz', /A/, 'daW', 'foo \tbaz');
-testEdit('diW_mid_punct', 'foo \tbAr.\t baz', /A/, 'diW', 'foo \t\t baz');
-testEdit('daW_mid_punct', 'foo \tbAr.\t baz', /A/, 'daW', 'foo \tbaz');
-testEdit('diW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'diW', 'foo \t\t baz');
-testEdit('daW_mid_punct2', 'foo \t,bAr.\t baz', /A/, 'daW', 'foo \tbaz');
-testEdit('diW_start_spc', 'bAr\t baz', /A/, 'diW', '\t baz');
-testEdit('daW_start_spc', 'bAr\t baz', /A/, 'daW', 'baz');
-testEdit('diW_start_punct', 'bAr.\t baz', /A/, 'diW', '\t baz');
-testEdit('daW_start_punct', 'bAr.\t baz', /A/, 'daW', 'baz');
-testEdit('diW_end_spc', 'foo \tbAr', /A/, 'diW', 'foo \t');
-testEdit('daW_end_spc', 'foo \tbAr', /A/, 'daW', 'foo');
-testEdit('diW_end_punct', 'foo \tbAr.', /A/, 'diW', 'foo \t');
-testEdit('daW_end_punct', 'foo \tbAr.', /A/, 'daW', 'foo');
-// Deleting text objects
-//    Open and close on same line
-testEdit('di(_open_spc', 'foo (bAr) baz', /\(/, 'di(', 'foo () baz');
-testEdit('di)_open_spc', 'foo (bAr) baz', /\(/, 'di)', 'foo () baz');
-testEdit('dib_open_spc', 'foo (bAr) baz', /\(/, 'dib', 'foo () baz');
-testEdit('da(_open_spc', 'foo (bAr) baz', /\(/, 'da(', 'foo  baz');
-testEdit('da)_open_spc', 'foo (bAr) baz', /\(/, 'da)', 'foo  baz');
-
-testEdit('di(_middle_spc', 'foo (bAr) baz', /A/, 'di(', 'foo () baz');
-testEdit('di)_middle_spc', 'foo (bAr) baz', /A/, 'di)', 'foo () baz');
-testEdit('da(_middle_spc', 'foo (bAr) baz', /A/, 'da(', 'foo  baz');
-testEdit('da)_middle_spc', 'foo (bAr) baz', /A/, 'da)', 'foo  baz');
-
-testEdit('di(_close_spc', 'foo (bAr) baz', /\)/, 'di(', 'foo () baz');
-testEdit('di)_close_spc', 'foo (bAr) baz', /\)/, 'di)', 'foo () baz');
-testEdit('da(_close_spc', 'foo (bAr) baz', /\)/, 'da(', 'foo  baz');
-testEdit('da)_close_spc', 'foo (bAr) baz', /\)/, 'da)', 'foo  baz');
-
-//  delete around and inner b.
-testEdit('dab_on_(_should_delete_around_()block', 'o( in(abc) )', /\(a/, 'dab', 'o( in )');
-
-//  delete around and inner B.
-testEdit('daB_on_{_should_delete_around_{}block', 'o{ in{abc} }', /{a/, 'daB', 'o{ in }');
-testEdit('diB_on_{_should_delete_inner_{}block', 'o{ in{abc} }', /{a/, 'diB', 'o{ in{} }');
-
-testEdit('da{_on_{_should_delete_inner_block', 'o{ in{abc} }', /{a/, 'da{', 'o{ in }');
-testEdit('di[_on_(_should_not_delete', 'foo (bAr) baz', /\(/, 'di[', 'foo (bAr) baz');
-testEdit('di[_on_)_should_not_delete', 'foo (bAr) baz', /\)/, 'di[', 'foo (bAr) baz');
-testEdit('da[_on_(_should_not_delete', 'foo (bAr) baz', /\(/, 'da[', 'foo (bAr) baz');
-testEdit('da[_on_)_should_not_delete', 'foo (bAr) baz', /\)/, 'da[', 'foo (bAr) baz');
-testMotion('di(_outside_should_stay', ['d', 'i', '('], new Pos(0, 0), new Pos(0, 0));
-
-//  Open and close on different lines, equally indented
-testEdit('di{_middle_spc', 'a{\n\tbar\n}b', /r/, 'di{', 'a{}b');
-testEdit('di}_middle_spc', 'a{\n\tbar\n}b', /r/, 'di}', 'a{}b');
-testEdit('da{_middle_spc', 'a{\n\tbar\n}b', /r/, 'da{', 'ab');
-testEdit('da}_middle_spc', 'a{\n\tbar\n}b', /r/, 'da}', 'ab');
-testEdit('daB_middle_spc', 'a{\n\tbar\n}b', /r/, 'daB', 'ab');
-
-// open and close on diff lines, open indented less than close
-testEdit('di{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'di{', 'a{}b');
-testEdit('di}_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'di}', 'a{}b');
-testEdit('da{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'da{', 'ab');
-testEdit('da}_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'da}', 'ab');
-
-// open and close on diff lines, open indented more than close
-testEdit('di[_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'di[', 'a\t[]b');
-testEdit('di]_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'di]', 'a\t[]b');
-testEdit('da[_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'da[', 'a\tb');
-testEdit('da]_middle_spc', 'a\t[\n\tbar\n]b', /r/, 'da]', 'a\tb');
-
-function testSelection(name, before, pos, keys, sel) {
-  return testVim(name, function(cm, vim, helpers) {
-             var ch = before.search(pos)
-             var line = before.substring(0, ch).split('\n').length - 1;
-             if (line) {
-               ch = before.substring(0, ch).split('\n').pop().length;
-             }
-             cm.setCursor(line, ch);
-             helpers.doKeys.apply(this, keys.split(''));
-             eq(sel, cm.getSelection());
-           }, {value: before});
-}
-testSelection('viw_middle_spc', 'foo \tbAr\t baz', /A/, 'viw', 'bAr');
-testSelection('vaw_middle_spc', 'foo \tbAr\t baz', /A/, 'vaw', 'bAr\t ');
-testSelection('viw_middle_punct', 'foo \tbAr,\t baz', /A/, 'viw', 'bAr');
-testSelection('vaW_middle_punct', 'foo \tbAr,\t baz', /A/, 'vaW', 'bAr,\t ');
-testSelection('viw_start_spc', 'foo \tbAr\t baz', /b/, 'viw', 'bAr');
-testSelection('viw_end_spc', 'foo \tbAr\t baz', /r/, 'viw', 'bAr');
-testSelection('viw_eol', 'foo \tbAr', /r/, 'viw', 'bAr');
-testSelection('vi{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'vi{', '\n\tbar\n\t');
-testSelection('va{_middle_spc', 'a{\n\tbar\n\t}b', /r/, 'va{', '{\n\tbar\n\t}');
-
-testVim('mouse_select', function(cm, vim, helpers) {
-  cm.setSelection(Pos(0, 2), Pos(0, 4), {origin: '*mouse'});
-  is(cm.state.vim.visualMode);
-  is(!cm.state.vim.visualLine);
-  is(!cm.state.vim.visualBlock);
-  helpers.doKeys('<Esc>');
-  is(!cm.somethingSelected());
-  helpers.doKeys('g', 'v');
-  eq('cd', cm.getSelection());
-}, {value: 'abcdef'});
-
-// Operator-motion tests
-testVim('D', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  helpers.doKeys('D');
-  eq(' wo\nword2\n word3', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('rd1', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 2);
-}, { value: ' word1\nword2\n word3' });
-testVim('C', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 3);
-  cm.setCursor(curStart);
-  helpers.doKeys('C');
-  eq(' wo\nword2\n word3', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('rd1', register.toString());
-  is(!register.linewise);
-  eqCursorPos(curStart, cm.getCursor());
-  eq('vim-insert', cm.getOption('keyMap'));
-}, { value: ' word1\nword2\n word3' });
-testVim('Y', function(cm, vim, helpers) {
-  var curStart = makeCursor(0, 3);
-  cm.setCursor(curStart);
-  helpers.doKeys('Y');
-  eq(' word1\nword2\n word3', cm.getValue());
-  var register = helpers.getRegisterController().getRegister();
-  eq('rd1', register.toString());
-  is(!register.linewise);
-  helpers.assertCursorAt(0, 3);
-}, { value: ' word1\nword2\n word3' });
-testVim('~', function(cm, vim, helpers) {
-  helpers.doKeys('3', '~');
-  eq('ABCdefg', cm.getValue());
-  helpers.assertCursorAt(0, 3);
-}, { value: 'abcdefg' });
-
-// Action tests
-testVim('ctrl-a', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-a>');
-  eq('-9', cm.getValue());
-  helpers.assertCursorAt(0, 1);
-  helpers.doKeys('2','<C-a>');
-  eq('-7', cm.getValue());
-}, {value: '-10'});
-testVim('ctrl-x', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-x>');
-  eq('-1', cm.getValue());
-  helpers.assertCursorAt(0, 1);
-  helpers.doKeys('2','<C-x>');
-  eq('-3', cm.getValue());
-}, {value: '0'});
-testVim('<C-x>/<C-a> search forward', function(cm, vim, helpers) {
-  forEach(['<C-x>', '<C-a>'], function(key) {
-    cm.setCursor(0, 0);
-    helpers.doKeys(key);
-    helpers.assertCursorAt(0, 5);
-    helpers.doKeys('l');
-    helpers.doKeys(key);
-    helpers.assertCursorAt(0, 10);
-    cm.setCursor(0, 11);
-    helpers.doKeys(key);
-    helpers.assertCursorAt(0, 11);
-  });
-}, {value: '__jmp1 jmp2 jmp'});
-testVim('a', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('a');
-  helpers.assertCursorAt(0, 2);
-  eq('vim-insert', cm.getOption('keyMap'));
-});
-testVim('a_eol', function(cm, vim, helpers) {
-  cm.setCursor(0, lines[0].length - 1);
-  helpers.doKeys('a');
-  helpers.assertCursorAt(0, lines[0].length);
-  eq('vim-insert', cm.getOption('keyMap'));
-});
-testVim('A_endOfSelectedArea', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('v', 'j', 'l');
-  helpers.doKeys('A');
-  helpers.assertCursorAt(1, 2);
-  eq('vim-insert', cm.getOption('keyMap'));
-}, {value: 'foo\nbar'});
-testVim('i', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('i');
-  helpers.assertCursorAt(0, 1);
-  eq('vim-insert', cm.getOption('keyMap'));
-});
-testVim('i_repeat', function(cm, vim, helpers) {
-  helpers.doKeys('3', 'i');
-  cm.replaceRange('test', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  eq('testtesttest', cm.getValue());
-  helpers.assertCursorAt(0, 11);
-}, { value: '' });
-testVim('i_repeat_delete', function(cm, vim, helpers) {
-  cm.setCursor(0, 4);
-  helpers.doKeys('2', 'i');
-  cm.replaceRange('z', cm.getCursor());
-  helpers.doInsertModeKeys('Backspace', 'Backspace');
-  helpers.doKeys('<Esc>');
-  eq('abe', cm.getValue());
-  helpers.assertCursorAt(0, 1);
-}, { value: 'abcde' });
-testVim('insert', function(cm, vim, helpers) {
-  helpers.doKeys('i');
-  eq('vim-insert', cm.getOption('keyMap'));
-  eq(false, cm.state.overwrite);
-  helpers.doKeys('<Ins>');
-  eq('vim-replace', cm.getOption('keyMap'));
-  eq(true, cm.state.overwrite);
-  helpers.doKeys('<Ins>');
-  eq('vim-insert', cm.getOption('keyMap'));
-  eq(false, cm.state.overwrite);
-});
-testVim('i_backspace', function(cm, vim, helpers) {
-  cm.setCursor(0, 10);
-  helpers.doKeys('i');
-  helpers.doInsertModeKeys('Backspace');
-  helpers.assertCursorAt(0, 9);
-  eq('012345678', cm.getValue());
-}, { value: '0123456789'});
-testVim('i_overwrite_backspace', function(cm, vim, helpers) {
-  cm.setCursor(0, 10);
-  helpers.doKeys('i');
-  helpers.doKeys('<Ins>');
-  helpers.doInsertModeKeys('Backspace');
-  helpers.assertCursorAt(Pos(0, 9, "after"));
-  eq('0123456789', cm.getValue());
-}, { value: '0123456789'});
-testVim('A', function(cm, vim, helpers) {
-  helpers.doKeys('A');
-  helpers.assertCursorAt(0, lines[0].length);
-  eq('vim-insert', cm.getOption('keyMap'));
-});
-testVim('A_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'l', 'A');
-  var replacement = new Array(cm.listSelections().length+1).join('hello ').split(' ');
-  replacement.pop();
-  cm.replaceSelections(replacement);
-  eq('testhello\nmehello\npleahellose', cm.getValue());
-  helpers.doKeys('<Esc>');
-  cm.setCursor(0, 0);
-  helpers.doKeys('.');
-  // TODO this doesn't work yet
-  // eq('teshellothello\nme hello hello\nplehelloahellose', cm.getValue());
-}, {value: 'test\nme\nplease'});
-testVim('I', function(cm, vim, helpers) {
-  cm.setCursor(0, 4);
-  helpers.doKeys('I');
-  helpers.assertCursorAt(0, lines[0].textStart);
-  eq('vim-insert', cm.getOption('keyMap'));
-});
-testVim('I_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('3', 'I');
-  cm.replaceRange('test', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  eq('testtesttestblah', cm.getValue());
-  helpers.assertCursorAt(0, 11);
-}, { value: 'blah' });
-testVim('I_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'l', 'I');
-  var replacement = new Array(cm.listSelections().length+1).join('hello ').split(' ');
-  replacement.pop();
-  cm.replaceSelections(replacement);
-  eq('hellotest\nhellome\nhelloplease', cm.getValue());
-}, {value: 'test\nme\nplease'});
-testVim('o', function(cm, vim, helpers) {
-  cm.setCursor(0, 4);
-  helpers.doKeys('o');
-  eq('word1\n\nword2', cm.getValue());
-  helpers.assertCursorAt(1, 0);
-  eq('vim-insert', cm.getOption('keyMap'));
-}, { value: 'word1\nword2' });
-testVim('o_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('3', 'o');
-  cm.replaceRange('test', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  eq('\ntest\ntest\ntest', cm.getValue());
-  helpers.assertCursorAt(3, 3);
-}, { value: '' });
-testVim('O', function(cm, vim, helpers) {
-  cm.setCursor(0, 4);
-  helpers.doKeys('O');
-  eq('\nword1\nword2', cm.getValue());
-  helpers.assertCursorAt(0, 0);
-  eq('vim-insert', cm.getOption('keyMap'));
-}, { value: 'word1\nword2' });
-testVim('J', function(cm, vim, helpers) {
-  cm.setCursor(0, 4);
-  helpers.doKeys('J');
-  var expectedValue = 'word1  word2\nword3\n word4';
-  eq(expectedValue, cm.getValue());
-  helpers.assertCursorAt(0, expectedValue.indexOf('word2') - 1);
-}, { value: 'word1 \n    word2\nword3\n word4' });
-testVim('J_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 4);
-  helpers.doKeys('3', 'J');
-  var expectedValue = 'word1  word2 word3\n word4';
-  eq(expectedValue, cm.getValue());
-  helpers.assertCursorAt(0, expectedValue.indexOf('word3') - 1);
-}, { value: 'word1 \n    word2\nword3\n word4' });
-testVim('p', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false);
-  helpers.doKeys('p');
-  eq('__abc\ndef_', cm.getValue());
-  helpers.assertCursorAt(1, 2);
-}, { value: '___' });
-testVim('p_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.getRegisterController().getRegister('a').setText('abc\ndef', false);
-  helpers.doKeys('"', 'a', 'p');
-  eq('__abc\ndef_', cm.getValue());
-  helpers.assertCursorAt(1, 2);
-}, { value: '___' });
-testVim('p_wrong_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.getRegisterController().getRegister('a').setText('abc\ndef', false);
-  helpers.doKeys('p');
-  eq('___', cm.getValue());
-  helpers.assertCursorAt(0, 1);
-}, { value: '___' });
-testVim('p_line', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.getRegisterController().pushText('"', 'yank', '  a\nd\n', true);
-  helpers.doKeys('2', 'p');
-  eq('___\n  a\nd\n  a\nd', cm.getValue());
-  helpers.assertCursorAt(1, 2);
-}, { value: '___' });
-testVim('p_lastline', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.getRegisterController().pushText('"', 'yank', '  a\nd', true);
-  helpers.doKeys('2', 'p');
-  eq('___\n  a\nd\n  a\nd', cm.getValue());
-  helpers.assertCursorAt(1, 2);
-}, { value: '___' });
-testVim(']p_first_indent_is_smaller', function(cm, vim, helpers) {
-  helpers.getRegisterController().pushText('"', 'yank', '  abc\n    def\n', true);
-  helpers.doKeys(']', 'p');
-  eq('  ___\n  abc\n    def', cm.getValue());
-}, { value: '  ___' });
-testVim(']p_first_indent_is_larger', function(cm, vim, helpers) {
-  helpers.getRegisterController().pushText('"', 'yank', '    abc\n  def\n', true);
-  helpers.doKeys(']', 'p');
-  eq('  ___\n  abc\ndef', cm.getValue());
-}, { value: '  ___' });
-testVim(']p_with_tab_indents', function(cm, vim, helpers) {
-  helpers.getRegisterController().pushText('"', 'yank', '\t\tabc\n\t\t\tdef\n', true);
-  helpers.doKeys(']', 'p');
-  eq('\t___\n\tabc\n\t\tdef', cm.getValue());
-}, { value: '\t___', indentWithTabs: true});
-testVim(']p_with_spaces_translated_to_tabs', function(cm, vim, helpers) {
-  helpers.getRegisterController().pushText('"', 'yank', '  abc\n    def\n', true);
-  helpers.doKeys(']', 'p');
-  eq('\t___\n\tabc\n\t\tdef', cm.getValue());
-}, { value: '\t___', indentWithTabs: true, tabSize: 2 });
-testVim('[p', function(cm, vim, helpers) {
-  helpers.getRegisterController().pushText('"', 'yank', '  abc\n    def\n', true);
-  helpers.doKeys('[', 'p');
-  eq('  abc\n    def\n  ___', cm.getValue());
-}, { value: '  ___' });
-testVim('P', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.getRegisterController().pushText('"', 'yank', 'abc\ndef', false);
-  helpers.doKeys('P');
-  eq('_abc\ndef__', cm.getValue());
-  helpers.assertCursorAt(1, 3);
-}, { value: '___' });
-testVim('P_line', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.getRegisterController().pushText('"', 'yank', '  a\nd\n', true);
-  helpers.doKeys('2', 'P');
-  eq('  a\nd\n  a\nd\n___', cm.getValue());
-  helpers.assertCursorAt(0, 2);
-}, { value: '___' });
-testVim('r', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('3', 'r', 'u');
-  eq('wuuuet\nanother', cm.getValue(),'3r failed');
-  helpers.assertCursorAt(0, 3);
-  cm.setCursor(0, 4);
-  helpers.doKeys('v', 'j', 'h', 'r', '<Space>');
-  eq('wuuu  \n    her', cm.getValue(),'Replacing selection by space-characters failed');
-}, { value: 'wordet\nanother' });
-testVim('r_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(2, 3);
-  helpers.doKeys('<C-v>', 'k', 'k', 'h', 'h', 'r', 'l');
-  eq('1lll\n5lll\nalllefg', cm.getValue());
-  helpers.doKeys('<C-v>', 'l', 'j', 'r', '<Space>');
-  eq('1  l\n5  l\nalllefg', cm.getValue());
-  cm.setCursor(2, 0);
-  helpers.doKeys('o');
-  helpers.doKeys('<Esc>');
-  cm.replaceRange('\t\t', cm.getCursor());
-  helpers.doKeys('<C-v>', 'h', 'h', 'r', 'r');
-  eq('1  l\n5  l\nalllefg\nrrrrrrrr', cm.getValue());
-}, {value: '1234\n5678\nabcdefg'});
-testVim('R', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('R');
-  helpers.assertCursorAt(0, 1);
-  eq('vim-replace', cm.getOption('keyMap'));
-  is(cm.state.overwrite, 'Setting overwrite state failed');
-});
-testVim('mark', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 't');
-  cm.setCursor(0, 0);
-  helpers.doKeys('`', 't');
-  helpers.assertCursorAt(2, 2);
-  cm.setCursor(2, 0);
-  cm.replaceRange('   h', cm.getCursor());
-  cm.setCursor(0, 0);
-  helpers.doKeys('\'', 't');
-  helpers.assertCursorAt(2, 3);
-});
-testVim('jumpToMark_next', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 't');
-  cm.setCursor(0, 0);
-  helpers.doKeys(']', '`');
-  helpers.assertCursorAt(2, 2);
-  cm.setCursor(0, 0);
-  helpers.doKeys(']', '\'');
-  helpers.assertCursorAt(2, 0);
-});
-testVim('jumpToMark_next_repeat', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(3, 2);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(4, 2);
-  helpers.doKeys('m', 'c');
-  cm.setCursor(0, 0);
-  helpers.doKeys('2', ']', '`');
-  helpers.assertCursorAt(3, 2);
-  cm.setCursor(0, 0);
-  helpers.doKeys('2', ']', '\'');
-  helpers.assertCursorAt(3, 1);
-});
-testVim('jumpToMark_next_sameline', function(cm, vim, helpers) {
-  cm.setCursor(2, 0);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(2, 4);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(2, 2);
-  helpers.doKeys(']', '`');
-  helpers.assertCursorAt(2, 4);
-});
-testVim('jumpToMark_next_onlyprev', function(cm, vim, helpers) {
-  cm.setCursor(2, 0);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(4, 0);
-  helpers.doKeys(']', '`');
-  helpers.assertCursorAt(4, 0);
-});
-testVim('jumpToMark_next_nomark', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys(']', '`');
-  helpers.assertCursorAt(2, 2);
-  helpers.doKeys(']', '\'');
-  helpers.assertCursorAt(2, 0);
-});
-testVim('jumpToMark_next_linewise_over', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(3, 4);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(2, 1);
-  helpers.doKeys(']', '\'');
-  helpers.assertCursorAt(3, 1);
-});
-testVim('jumpToMark_next_action', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 't');
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', ']', '`');
-  helpers.assertCursorAt(0, 0);
-  var actual = cm.getLine(0);
-  var expected = 'pop pop 0 1 2 3 4';
-  eq(actual, expected, "Deleting while jumping to the next mark failed.");
-});
-testVim('jumpToMark_next_line_action', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 't');
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', ']', '\'');
-  helpers.assertCursorAt(0, 1);
-  var actual = cm.getLine(0);
-  var expected = ' (a) [b] {c} '
-  eq(actual, expected, "Deleting while jumping to the next mark line failed.");
-});
-testVim('jumpToMark_prev', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 't');
-  cm.setCursor(4, 0);
-  helpers.doKeys('[', '`');
-  helpers.assertCursorAt(2, 2);
-  cm.setCursor(4, 0);
-  helpers.doKeys('[', '\'');
-  helpers.assertCursorAt(2, 0);
-});
-testVim('jumpToMark_prev_repeat', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(3, 2);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(4, 2);
-  helpers.doKeys('m', 'c');
-  cm.setCursor(5, 0);
-  helpers.doKeys('2', '[', '`');
-  helpers.assertCursorAt(3, 2);
-  cm.setCursor(5, 0);
-  helpers.doKeys('2', '[', '\'');
-  helpers.assertCursorAt(3, 1);
-});
-testVim('jumpToMark_prev_sameline', function(cm, vim, helpers) {
-  cm.setCursor(2, 0);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(2, 4);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(2, 2);
-  helpers.doKeys('[', '`');
-  helpers.assertCursorAt(2, 0);
-});
-testVim('jumpToMark_prev_onlynext', function(cm, vim, helpers) {
-  cm.setCursor(4, 4);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(2, 0);
-  helpers.doKeys('[', '`');
-  helpers.assertCursorAt(2, 0);
-});
-testVim('jumpToMark_prev_nomark', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('[', '`');
-  helpers.assertCursorAt(2, 2);
-  helpers.doKeys('[', '\'');
-  helpers.assertCursorAt(2, 0);
-});
-testVim('jumpToMark_prev_linewise_over', function(cm, vim, helpers) {
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(3, 4);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(3, 6);
-  helpers.doKeys('[', '\'');
-  helpers.assertCursorAt(2, 0);
-});
-testVim('delmark_single', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('m', 't');
-  helpers.doEx('delmarks t');
-  cm.setCursor(0, 0);
-  helpers.doKeys('`', 't');
-  helpers.assertCursorAt(0, 0);
-});
-testVim('delmark_range', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(3, 2);
-  helpers.doKeys('m', 'c');
-  cm.setCursor(4, 2);
-  helpers.doKeys('m', 'd');
-  cm.setCursor(5, 2);
-  helpers.doKeys('m', 'e');
-  helpers.doEx('delmarks b-d');
-  cm.setCursor(0, 0);
-  helpers.doKeys('`', 'a');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'b');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'c');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'd');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'e');
-  helpers.assertCursorAt(5, 2);
-});
-testVim('delmark_multi', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(3, 2);
-  helpers.doKeys('m', 'c');
-  cm.setCursor(4, 2);
-  helpers.doKeys('m', 'd');
-  cm.setCursor(5, 2);
-  helpers.doKeys('m', 'e');
-  helpers.doEx('delmarks bcd');
-  cm.setCursor(0, 0);
-  helpers.doKeys('`', 'a');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'b');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'c');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'd');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'e');
-  helpers.assertCursorAt(5, 2);
-});
-testVim('delmark_multi_space', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(3, 2);
-  helpers.doKeys('m', 'c');
-  cm.setCursor(4, 2);
-  helpers.doKeys('m', 'd');
-  cm.setCursor(5, 2);
-  helpers.doKeys('m', 'e');
-  helpers.doEx('delmarks b c d');
-  cm.setCursor(0, 0);
-  helpers.doKeys('`', 'a');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'b');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'c');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'd');
-  helpers.assertCursorAt(1, 2);
-  helpers.doKeys('`', 'e');
-  helpers.assertCursorAt(5, 2);
-});
-testVim('delmark_all', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('m', 'a');
-  cm.setCursor(2, 2);
-  helpers.doKeys('m', 'b');
-  cm.setCursor(3, 2);
-  helpers.doKeys('m', 'c');
-  cm.setCursor(4, 2);
-  helpers.doKeys('m', 'd');
-  cm.setCursor(5, 2);
-  helpers.doKeys('m', 'e');
-  helpers.doEx('delmarks a b-de');
-  cm.setCursor(0, 0);
-  helpers.doKeys('`', 'a');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('`', 'b');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('`', 'c');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('`', 'd');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('`', 'e');
-  helpers.assertCursorAt(0, 0);
-});
-testVim('visual', function(cm, vim, helpers) {
-  helpers.doKeys('l', 'v', 'l', 'l');
-  helpers.assertCursorAt(0, 4);
-  eqCursorPos(makeCursor(0, 1), cm.getCursor('anchor'));
-  helpers.doKeys('d');
-  eq('15', cm.getValue());
-}, { value: '12345' });
-testVim('visual_yank', function(cm, vim, helpers) {
-  helpers.doKeys('v', '3', 'l', 'y');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('p');
-  eq('aa te test for yank', cm.getValue());
-}, { value: 'a test for yank' })
-testVim('visual_w', function(cm, vim, helpers) {
-  helpers.doKeys('v', 'w');
-  eq(cm.getSelection(), 'motion t');
-}, { value: 'motion test'});
-testVim('visual_initial_selection', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('v');
-  cm.getSelection('n');
-}, { value: 'init'});
-testVim('visual_crossover_left', function(cm, vim, helpers) {
-  cm.setCursor(0, 2);
-  helpers.doKeys('v', 'l', 'h', 'h');
-  cm.getSelection('ro');
-}, { value: 'cross'});
-testVim('visual_crossover_left', function(cm, vim, helpers) {
-  cm.setCursor(0, 2);
-  helpers.doKeys('v', 'h', 'l', 'l');
-  cm.getSelection('os');
-}, { value: 'cross'});
-testVim('visual_crossover_up', function(cm, vim, helpers) {
-  cm.setCursor(3, 2);
-  helpers.doKeys('v', 'j', 'k', 'k');
-  eqCursorPos(Pos(2, 2), cm.getCursor('head'));
-  eqCursorPos(Pos(3, 3), cm.getCursor('anchor'));
-  helpers.doKeys('k');
-  eqCursorPos(Pos(1, 2), cm.getCursor('head'));
-  eqCursorPos(Pos(3, 3), cm.getCursor('anchor'));
-}, { value: 'cross\ncross\ncross\ncross\ncross\n'});
-testVim('visual_crossover_down', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('v', 'k', 'j', 'j');
-  eqCursorPos(Pos(2, 3), cm.getCursor('head'));
-  eqCursorPos(Pos(1, 2), cm.getCursor('anchor'));
-  helpers.doKeys('j');
-  eqCursorPos(Pos(3, 3), cm.getCursor('head'));
-  eqCursorPos(Pos(1, 2), cm.getCursor('anchor'));
-}, { value: 'cross\ncross\ncross\ncross\ncross\n'});
-testVim('visual_exit', function(cm, vim, helpers) {
-  helpers.doKeys('<C-v>', 'l', 'j', 'j', '<Esc>');
-  eqCursorPos(cm.getCursor('anchor'), cm.getCursor('head'));
-  eq(vim.visualMode, false);
-}, { value: 'hello\nworld\nfoo' });
-testVim('visual_line', function(cm, vim, helpers) {
-  helpers.doKeys('l', 'V', 'l', 'j', 'j', 'd');
-  eq(' 4\n 5', cm.getValue());
-}, { value: ' 1\n 2\n 3\n 4\n 5' });
-testVim('visual_block_move_to_eol', function(cm, vim, helpers) {
-  // moveToEol should move all block cursors to end of line
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', 'G', '$');
-  var selections = cm.getSelections().join();
-  eq('123,45,6', selections);
-  // Checks that with cursor at Infinity, finding words backwards still works.
-  helpers.doKeys('2', 'k', 'b');
-  selections = cm.getSelections().join();
-  eq('1', selections);
-}, {value: '123\n45\n6'});
-testVim('visual_block_different_line_lengths', function(cm, vim, helpers) {
-  // test the block selection with lines of different length
-  // i.e. extending the selection
-  // till the end of the longest line.
-  helpers.doKeys('<C-v>', 'l', 'j', 'j', '6', 'l', 'd');
-  helpers.doKeys('d', 'd', 'd', 'd');
-  eq('', cm.getValue());
-}, {value: '1234\n5678\nabcdefg'});
-testVim('visual_block_truncate_on_short_line', function(cm, vim, helpers) {
-  // check for left side selection in case
-  // of moving up to a shorter line.
-  cm.replaceRange('', cm.getCursor());
-  cm.setCursor(3, 4);
-  helpers.doKeys('<C-v>', 'l', 'k', 'k', 'd');
-  eq('hello world\n{\ntis\nsa!', cm.getValue());
-}, {value: 'hello world\n{\nthis is\nsparta!'});
-testVim('visual_block_corners', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('<C-v>', '2', 'l', 'k');
-  // circle around the anchor
-  // and check the selections
-  var selections = cm.getSelections();
-  eq('345891', selections.join(''));
-  helpers.doKeys('4', 'h');
-  selections = cm.getSelections();
-  eq('123678', selections.join(''));
-  helpers.doKeys('j', 'j');
-  selections = cm.getSelections();
-  eq('678abc', selections.join(''));
-  helpers.doKeys('4', 'l');
-  selections = cm.getSelections();
-  eq('891cde', selections.join(''));
-}, {value: '12345\n67891\nabcde'});
-testVim('visual_block_mode_switch', function(cm, vim, helpers) {
-  // switch between visual modes
-  cm.setCursor(1, 1);
-  // blockwise to characterwise visual
-  helpers.doKeys('<C-v>', 'j', 'l', 'v');
-  var selections = cm.getSelections();
-  eq('7891\nabc', selections.join(''));
-  // characterwise to blockwise
-  helpers.doKeys('<C-v>');
-  selections = cm.getSelections();
-  eq('78bc', selections.join(''));
-  // blockwise to linewise visual
-  helpers.doKeys('V');
-  selections = cm.getSelections();
-  eq('67891\nabcde', selections.join(''));
-}, {value: '12345\n67891\nabcde'});
-testVim('visual_block_crossing_short_line', function(cm, vim, helpers) {
-  // visual block with long and short lines
-  cm.setCursor(0, 3);
-  helpers.doKeys('<C-v>', 'j', 'j', 'j');
-  var selections = cm.getSelections().join();
-  eq('4,,d,b', selections);
-  helpers.doKeys('3', 'k');
-  selections = cm.getSelections().join();
-  eq('4', selections);
-  helpers.doKeys('5', 'j', 'k');
-  selections = cm.getSelections().join("");
-  eq(10, selections.length);
-}, {value: '123456\n78\nabcdefg\nfoobar\n}\n'});
-testVim('visual_block_curPos_on_exit', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', '3' , 'l', '<Esc>');
-  eqCursorPos(makeCursor(0, 3), cm.getCursor());
-  helpers.doKeys('h', '<C-v>', '2' , 'j' ,'3' , 'l');
-  eq(cm.getSelections().join(), "3456,,cdef");
-  helpers.doKeys('4' , 'h');
-  eq(cm.getSelections().join(), "23,8,bc");
-  helpers.doKeys('2' , 'l');
-  eq(cm.getSelections().join(), "34,,cd");
-}, {value: '123456\n78\nabcdefg\nfoobar'});
-
-testVim('visual_marks', function(cm, vim, helpers) {
-  helpers.doKeys('l', 'v', 'l', 'l', 'j', 'j', 'v');
-  // Test visual mode marks
-  cm.setCursor(2, 1);
-  helpers.doKeys('\'', '<');
-  helpers.assertCursorAt(0, 1);
-  helpers.doKeys('\'', '>');
-  helpers.assertCursorAt(2, 0);
-});
-testVim('visual_join', function(cm, vim, helpers) {
-  helpers.doKeys('l', 'V', 'l', 'j', 'j', 'J');
-  eq(' 1 2 3\n 4\n 5', cm.getValue());
-  is(!vim.visualMode);
-}, { value: ' 1\n 2\n 3\n 4\n 5' });
-testVim('visual_join_2', function(cm, vim, helpers) {
-  helpers.doKeys('G', 'V', 'g', 'g', 'J');
-  eq('1 2 3 4 5 6 ', cm.getValue());
-  is(!vim.visualMode);
-}, { value: '1\n2\n3\n4\n5\n6\n'});
-testVim('visual_blank', function(cm, vim, helpers) {
-  helpers.doKeys('v', 'k');
-  eq(vim.visualMode, true);
-}, { value: '\n' });
-testVim('reselect_visual', function(cm, vim, helpers) {
-  helpers.doKeys('l', 'v', 'l', 'l', 'l', 'y', 'g', 'v');
-  helpers.assertCursorAt(0, 5);
-  eqCursorPos(makeCursor(0, 1), cm.getCursor('anchor'));
-  helpers.doKeys('v');
-  cm.setCursor(1, 0);
-  helpers.doKeys('v', 'l', 'l', 'p');
-  eq('123456\n2345\nbar', cm.getValue());
-  cm.setCursor(0, 0);
-  helpers.doKeys('g', 'v');
-  // here the fake cursor is at (1, 3)
-  helpers.assertCursorAt(1, 4);
-  eqCursorPos(makeCursor(1, 0), cm.getCursor('anchor'));
-  helpers.doKeys('v');
-  cm.setCursor(2, 0);
-  helpers.doKeys('v', 'l', 'l', 'g', 'v');
-  helpers.assertCursorAt(1, 4);
-  eqCursorPos(makeCursor(1, 0), cm.getCursor('anchor'));
-  helpers.doKeys('g', 'v');
-  helpers.assertCursorAt(2, 3);
-  eqCursorPos(makeCursor(2, 0), cm.getCursor('anchor'));
-  eq('123456\n2345\nbar', cm.getValue());
-}, { value: '123456\nfoo\nbar' });
-testVim('reselect_visual_line', function(cm, vim, helpers) {
-  helpers.doKeys('l', 'V', 'j', 'j', 'V', 'g', 'v', 'd');
-  eq('foo\nand\nbar', cm.getValue());
-  cm.setCursor(1, 0);
-  helpers.doKeys('V', 'y', 'j');
-  helpers.doKeys('V', 'p' , 'g', 'v', 'd');
-  eq('foo\nand', cm.getValue());
-}, { value: 'hello\nthis\nis\nfoo\nand\nbar' });
-testVim('reselect_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(1, 2);
-  helpers.doKeys('<C-v>', 'k', 'h', '<C-v>');
-  cm.setCursor(2, 1);
-  helpers.doKeys('v', 'l', 'g', 'v');
-  eqCursorPos(Pos(1, 2), vim.sel.anchor);
-  eqCursorPos(Pos(0, 1), vim.sel.head);
-  // Ensure selection is done with visual block mode rather than one
-  // continuous range.
-  eq(cm.getSelections().join(''), '23oo')
-  helpers.doKeys('g', 'v');
-  eqCursorPos(Pos(2, 1), vim.sel.anchor);
-  eqCursorPos(Pos(2, 2), vim.sel.head);
-  helpers.doKeys('<Esc>');
-  // Ensure selection of deleted range
-  cm.setCursor(1, 1);
-  helpers.doKeys('v', '<C-v>', 'j', 'd', 'g', 'v');
-  eq(cm.getSelections().join(''), 'or');
-}, { value: '123456\nfoo\nbar' });
-testVim('s_normal', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('s');
-  helpers.doKeys('<Esc>');
-  eq('ac', cm.getValue());
-}, { value: 'abc'});
-testVim('s_visual', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('v', 's');
-  helpers.doKeys('<Esc>');
-  helpers.assertCursorAt(0, 0);
-  eq('ac', cm.getValue());
-}, { value: 'abc'});
-testVim('o_visual', function(cm, vim, helpers) {
-  cm.setCursor(0,0);
-  helpers.doKeys('v','l','l','l','o');
-  helpers.assertCursorAt(0,0);
-  helpers.doKeys('v','v','j','j','j','o');
-  helpers.assertCursorAt(0,0);
-  helpers.doKeys('O');
-  helpers.doKeys('l','l')
-  helpers.assertCursorAt(3, 3);
-  helpers.doKeys('d');
-  eq('p',cm.getValue());
-}, { value: 'abcd\nefgh\nijkl\nmnop'});
-testVim('o_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('<C-v>','3','j','l','l', 'o');
-  eqCursorPos(Pos(3, 3), vim.sel.anchor);
-  eqCursorPos(Pos(0, 1), vim.sel.head);
-  helpers.doKeys('O');
-  eqCursorPos(Pos(3, 1), vim.sel.anchor);
-  eqCursorPos(Pos(0, 3), vim.sel.head);
-  helpers.doKeys('o');
-  eqCursorPos(Pos(0, 3), vim.sel.anchor);
-  eqCursorPos(Pos(3, 1), vim.sel.head);
-}, { value: 'abcd\nefgh\nijkl\nmnop'});
-testVim('changeCase_visual', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('v', 'l', 'l');
-  helpers.doKeys('U');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('v', 'l', 'l');
-  helpers.doKeys('u');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('l', 'l', 'l', '.');
-  helpers.assertCursorAt(0, 3);
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'a', 'v', 'j', 'U', 'q');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('j', '@', 'a');
-  helpers.assertCursorAt(1, 0);
-  cm.setCursor(3, 0);
-  helpers.doKeys('V', 'U', 'j', '.');
-  eq('ABCDEF\nGHIJKL\nMnopq\nSHORT LINE\nLONG LINE OF TEXT', cm.getValue());
-}, { value: 'abcdef\nghijkl\nmnopq\nshort line\nlong line of text'});
-testVim('changeCase_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(2, 1);
-  helpers.doKeys('<C-v>', 'k', 'k', 'h', 'U');
-  eq('ABcdef\nGHijkl\nMNopq\nfoo', cm.getValue());
-  cm.setCursor(0, 2);
-  helpers.doKeys('.');
-  eq('ABCDef\nGHIJkl\nMNOPq\nfoo', cm.getValue());
-  // check when last line is shorter.
-  cm.setCursor(2, 2);
-  helpers.doKeys('.');
-  eq('ABCDef\nGHIJkl\nMNOPq\nfoO', cm.getValue());
-}, { value: 'abcdef\nghijkl\nmnopq\nfoo'});
-testVim('visual_paste', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('v', 'l', 'l', 'y');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('3', 'l', 'j', 'v', 'l', 'p');
-  helpers.assertCursorAt(1, 5);
-  eq('this is a\nunithitest for visual paste', cm.getValue());
-  cm.setCursor(0, 0);
-  // in case of pasting whole line
-  helpers.doKeys('y', 'y');
-  cm.setCursor(1, 6);
-  helpers.doKeys('v', 'l', 'l', 'l', 'p');
-  helpers.assertCursorAt(2, 0);
-  eq('this is a\nunithi\nthis is a\n for visual paste', cm.getValue());
-}, { value: 'this is a\nunit test for visual paste'});
-
-// This checks the contents of the register used to paste the text
-testVim('v_paste_from_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('"', 'a', 'y', 'w');
-  cm.setCursor(1, 0);
-  helpers.doKeys('v', 'p');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/a\s+register/.test(text));
-  });
-}, { value: 'register contents\nare not erased'});
-testVim('S_normal', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('j', 'S');
-  helpers.doKeys('<Esc>');
-  helpers.assertCursorAt(1, 1);
-  eq('aa{\n  \ncc', cm.getValue());
-  helpers.doKeys('j', 'S');
-  eq('aa{\n  \n  ', cm.getValue());
-  helpers.assertCursorAt(2, 2);
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('d', 'd', 'd', 'd');
-  helpers.assertCursorAt(0, 0);
-  helpers.doKeys('S');
-  is(vim.insertMode);
-  eq('', cm.getValue());
-}, { value: 'aa{\nbb\ncc'});
-testVim('blockwise_paste', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', '3', 'j', 'l', 'y');
-  cm.setCursor(0, 2);
-  // paste one char after the current cursor position
-  helpers.doKeys('p');
-  eq('helhelo\nworwold\nfoofo\nbarba', cm.getValue());
-  cm.setCursor(0, 0);
-  helpers.doKeys('v', '4', 'l', 'y');
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', '3', 'j', 'p');
-  eq('helheelhelo\norwold\noofo\narba', cm.getValue());
-}, { value: 'hello\nworld\nfoo\nbar'});
-testVim('blockwise_paste_long/short_line', function(cm, vim, helpers) {
-  // extend short lines in case of different line lengths.
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', 'j', 'j', 'y');
-  cm.setCursor(0, 3);
-  helpers.doKeys('p');
-  eq('hellho\nfoo f\nbar b', cm.getValue());
-}, { value: 'hello\nfoo\nbar'});
-testVim('blockwise_paste_cut_paste', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', '2', 'j', 'x');
-  cm.setCursor(0, 0);
-  helpers.doKeys('P');
-  eq('cut\nand\npaste\nme', cm.getValue());
-}, { value: 'cut\nand\npaste\nme'});
-testVim('blockwise_paste_from_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', '2', 'j', '"', 'a', 'y');
-  cm.setCursor(0, 3);
-  helpers.doKeys('"', 'a', 'p');
-  eq('foobfar\nhellho\nworlwd', cm.getValue());
-}, { value: 'foobar\nhello\nworld'});
-testVim('blockwise_paste_last_line', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'y');
-  cm.setCursor(3, 0);
-  helpers.doKeys('p');
-  eq('cut\nand\npaste\nmcue\n an\n pa', cm.getValue());
-}, { value: 'cut\nand\npaste\nme'});
-
-testVim('S_visual', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('v', 'j', 'S');
-  helpers.doKeys('<Esc>');
-  helpers.assertCursorAt(0, 0);
-  eq('\ncc', cm.getValue());
-}, { value: 'aa\nbb\ncc'});
-
-testVim('d_/', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('match');
-  helpers.doKeys('2', 'd', '/');
-  helpers.assertCursorAt(0, 0);
-  eq('match \n next', cm.getValue());
-  cm.openDialog = helpers.fakeOpenDialog('2');
-  helpers.doKeys('d', ':');
-  // TODO eq(' next', cm.getValue());
-}, { value: 'text match match \n next' });
-testVim('/ and n/N', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('match');
-  helpers.doKeys('/');
-  helpers.assertCursorAt(0, 11);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(1, 6);
-  helpers.doKeys('N');
-  helpers.assertCursorAt(0, 11);
-
-  cm.setCursor(0, 0);
-  helpers.doKeys('2', '/');
-  helpers.assertCursorAt(1, 6);
-}, { value: 'match nope match \n nope Match' });
-testVim('/_case', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('Match');
-  helpers.doKeys('/');
-  helpers.assertCursorAt(1, 6);
-}, { value: 'match nope match \n nope Match' });
-testVim('/_2_pcre', function(cm, vim, helpers) {
-  CodeMirror.Vim.setOption('pcre', true);
-  cm.openDialog = helpers.fakeOpenDialog('(word){2}');
-  helpers.doKeys('/');
-  helpers.assertCursorAt(1, 9);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(2, 1);
-}, { value: 'word\n another wordword\n wordwordword\n' });
-testVim('/_2_nopcre', function(cm, vim, helpers) {
-  CodeMirror.Vim.setOption('pcre', false);
-  cm.openDialog = helpers.fakeOpenDialog('\\(word\\)\\{2}');
-  helpers.doKeys('/');
-  helpers.assertCursorAt(1, 9);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(2, 1);
-}, { value: 'word\n another wordword\n wordwordword\n' });
-testVim('/_nongreedy', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('aa');
-  helpers.doKeys('/');
-  helpers.assertCursorAt(0, 4);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(1, 3);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 0);
-}, { value: 'aaa aa \n a aa'});
-testVim('?_nongreedy', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('aa');
-  helpers.doKeys('?');
-  helpers.assertCursorAt(1, 3);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 4);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 0);
-}, { value: 'aaa aa \n a aa'});
-testVim('/_greedy', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('a+');
-  helpers.doKeys('/');
-  helpers.assertCursorAt(0, 4);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(1, 1);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(1, 3);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 0);
-}, { value: 'aaa aa \n a aa'});
-testVim('?_greedy', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('a+');
-  helpers.doKeys('?');
-  helpers.assertCursorAt(1, 3);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(1, 1);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 4);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 0);
-}, { value: 'aaa aa \n a aa'});
-testVim('/_greedy_0_or_more', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('a*');
-  helpers.doKeys('/');
-  helpers.assertCursorAt(0, 3);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 4);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 5);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(1, 0);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(1, 1);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 0);
-}, { value: 'aaa  aa\n aa'});
-testVim('?_greedy_0_or_more', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('a*');
-  helpers.doKeys('?');
-  helpers.assertCursorAt(1, 1);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(1, 0);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 5);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 4);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 3);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 0);
-}, { value: 'aaa  aa\n aa'});
-testVim('? and n/N', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('match');
-  helpers.doKeys('?');
-  helpers.assertCursorAt(1, 6);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 11);
-  helpers.doKeys('N');
-  helpers.assertCursorAt(1, 6);
-
-  cm.setCursor(0, 0);
-  helpers.doKeys('2', '?');
-  helpers.assertCursorAt(0, 11);
-}, { value: 'match nope match \n nope Match' });
-testVim('*', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('*');
-  helpers.assertCursorAt(0, 22);
-
-  cm.setCursor(0, 9);
-  helpers.doKeys('2', '*');
-  helpers.assertCursorAt(1, 8);
-}, { value: 'nomatch match nomatch match \nnomatch Match' });
-testVim('*_no_word', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('*');
-  helpers.assertCursorAt(0, 0);
-}, { value: ' \n match \n' });
-testVim('*_symbol', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('*');
-  helpers.assertCursorAt(1, 0);
-}, { value: ' /}\n/} match \n' });
-testVim('#', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('#');
-  helpers.assertCursorAt(1, 8);
-
-  cm.setCursor(0, 9);
-  helpers.doKeys('2', '#');
-  helpers.assertCursorAt(0, 22);
-}, { value: 'nomatch match nomatch match \nnomatch Match' });
-testVim('*_seek', function(cm, vim, helpers) {
-  // Should skip over space and symbols.
-  cm.setCursor(0, 3);
-  helpers.doKeys('*');
-  helpers.assertCursorAt(0, 22);
-}, { value: '    :=  match nomatch match \nnomatch Match' });
-testVim('#', function(cm, vim, helpers) {
-  // Should skip over space and symbols.
-  cm.setCursor(0, 3);
-  helpers.doKeys('#');
-  helpers.assertCursorAt(1, 8);
-}, { value: '    :=  match nomatch match \nnomatch Match' });
-testVim('g*', function(cm, vim, helpers) {
-  cm.setCursor(0, 8);
-  helpers.doKeys('g', '*');
-  helpers.assertCursorAt(0, 18);
-  cm.setCursor(0, 8);
-  helpers.doKeys('3', 'g', '*');
-  helpers.assertCursorAt(1, 8);
-}, { value: 'matches match alsoMatch\nmatchme matching' });
-testVim('g#', function(cm, vim, helpers) {
-  cm.setCursor(0, 8);
-  helpers.doKeys('g', '#');
-  helpers.assertCursorAt(0, 0);
-  cm.setCursor(0, 8);
-  helpers.doKeys('3', 'g', '#');
-  helpers.assertCursorAt(1, 0);
-}, { value: 'matches match alsoMatch\nmatchme matching' });
-testVim('macro_insert', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'a', '0', 'i');
-  cm.replaceRange('foo', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('q', '@', 'a');
-  eq('foofoo', cm.getValue());
-}, { value: ''});
-testVim('macro_insert_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'a', '$', 'a');
-  cm.replaceRange('larry.', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('a');
-  cm.replaceRange('curly.', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('q');
-  helpers.doKeys('a');
-  cm.replaceRange('moe.', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('@', 'a');
-  // At this point, the most recent edit should be the 2nd insert change
-  // inside the macro, i.e. "curly.".
-  helpers.doKeys('.');
-  eq('larry.curly.moe.larry.curly.curly.', cm.getValue());
-}, { value: ''});
-testVim('macro_space', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('<Space>', '<Space>');
-  helpers.assertCursorAt(0, 2);
-  helpers.doKeys('q', 'a', '<Space>', '<Space>', 'q');
-  helpers.assertCursorAt(0, 4);
-  helpers.doKeys('@', 'a');
-  helpers.assertCursorAt(0, 6);
-  helpers.doKeys('@', 'a');
-  helpers.assertCursorAt(0, 8);
-}, { value: 'one line of text.'});
-testVim('macro_t_search', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'a', 't', 'e', 'q');
-  helpers.assertCursorAt(0, 1);
-  helpers.doKeys('l', '@', 'a');
-  helpers.assertCursorAt(0, 6);
-  helpers.doKeys('l', ';');
-  helpers.assertCursorAt(0, 12);
-}, { value: 'one line of text.'});
-testVim('macro_f_search', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'b', 'f', 'e', 'q');
-  helpers.assertCursorAt(0, 2);
-  helpers.doKeys('@', 'b');
-  helpers.assertCursorAt(0, 7);
-  helpers.doKeys(';');
-  helpers.assertCursorAt(0, 13);
-}, { value: 'one line of text.'});
-testVim('macro_slash_search', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'c');
-  cm.openDialog = helpers.fakeOpenDialog('e');
-  helpers.doKeys('/', 'q');
-  helpers.assertCursorAt(0, 2);
-  helpers.doKeys('@', 'c');
-  helpers.assertCursorAt(0, 7);
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 13);
-}, { value: 'one line of text.'});
-testVim('macro_multislash_search', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'd');
-  cm.openDialog = helpers.fakeOpenDialog('e');
-  helpers.doKeys('/');
-  cm.openDialog = helpers.fakeOpenDialog('t');
-  helpers.doKeys('/', 'q');
-  helpers.assertCursorAt(0, 12);
-  helpers.doKeys('@', 'd');
-  helpers.assertCursorAt(0, 15);
-}, { value: 'one line of text to rule them all.'});
-testVim('macro_last_ex_command_register', function (cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doEx('s/a/b');
-  helpers.doKeys('2', '@', ':');
-  eq('bbbaa', cm.getValue());
-  helpers.assertCursorAt(0, 2);
-}, { value: 'aaaaa'});
-testVim('macro_parens', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'z', 'i');
-  cm.replaceRange('(', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('e', 'a');
-  cm.replaceRange(')', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('q');
-  helpers.doKeys('w', '@', 'z');
-  helpers.doKeys('w', '@', 'z');
-  eq('(see) (spot) (run)', cm.getValue());
-}, { value: 'see spot run'});
-testVim('macro_overwrite', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'z', '0', 'i');
-  cm.replaceRange('I ', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('q');
-  helpers.doKeys('e');
-  // Now replace the macro with something else.
-  helpers.doKeys('q', 'z', 'a');
-  cm.replaceRange('.', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('q');
-  helpers.doKeys('e', '@', 'z');
-  helpers.doKeys('e', '@', 'z');
-  eq('I see. spot. run.', cm.getValue());
-}, { value: 'see spot run'});
-testVim('macro_search_f', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'a', 'f', ' ');
-  helpers.assertCursorAt(0,3);
-  helpers.doKeys('q', '0');
-  helpers.assertCursorAt(0,0);
-  helpers.doKeys('@', 'a');
-  helpers.assertCursorAt(0,3);
-}, { value: 'The quick brown fox jumped over the lazy dog.'});
-testVim('macro_search_2f', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'a', '2', 'f', ' ');
-  helpers.assertCursorAt(0,9);
-  helpers.doKeys('q', '0');
-  helpers.assertCursorAt(0,0);
-  helpers.doKeys('@', 'a');
-  helpers.assertCursorAt(0,9);
-}, { value: 'The quick brown fox jumped over the lazy dog.'});
-testVim('yank_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('"', 'a', 'y', 'y');
-  helpers.doKeys('j', '"', 'b', 'y', 'y');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/a\s+foo/.test(text));
-    is(/b\s+bar/.test(text));
-  });
-  helpers.doKeys(':');
-}, { value: 'foo\nbar'});
-testVim('yank_visual_block', function(cm, vim, helpers) {
-  cm.setCursor(0, 1);
-  helpers.doKeys('<C-v>', 'l', 'j', '"', 'a', 'y');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/a\s+oo\nar/.test(text));
-  });
-  helpers.doKeys(':');
-}, { value: 'foo\nbar'});
-testVim('yank_append_line_to_line_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('"', 'a', 'y', 'y');
-  helpers.doKeys('j', '"', 'A', 'y', 'y');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/a\s+foo\nbar/.test(text));
-    is(/"\s+foo\nbar/.test(text));
-  });
-  helpers.doKeys(':');
-}, { value: 'foo\nbar'});
-testVim('yank_append_word_to_word_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('"', 'a', 'y', 'w');
-  helpers.doKeys('j', '"', 'A', 'y', 'w');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/a\s+foobar/.test(text));
-    is(/"\s+foobar/.test(text));
-  });
-  helpers.doKeys(':');
-}, { value: 'foo\nbar'});
-testVim('yank_append_line_to_word_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('"', 'a', 'y', 'w');
-  helpers.doKeys('j', '"', 'A', 'y', 'y');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/a\s+foo\nbar/.test(text));
-    is(/"\s+foo\nbar/.test(text));
-  });
-  helpers.doKeys(':');
-}, { value: 'foo\nbar'});
-testVim('yank_append_word_to_line_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('"', 'a', 'y', 'y');
-  helpers.doKeys('j', '"', 'A', 'y', 'w');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/a\s+foo\nbar/.test(text));
-    is(/"\s+foo\nbar/.test(text));
-  });
-  helpers.doKeys(':');
-}, { value: 'foo\nbar'});
-testVim('macro_register', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('q', 'a', 'i');
-  cm.replaceRange('gangnam', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('q');
-  helpers.doKeys('q', 'b', 'o');
-  cm.replaceRange('style', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('q');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/a\s+i/.test(text));
-    is(/b\s+o/.test(text));
-  });
-  helpers.doKeys(':');
-}, { value: ''});
-testVim('._register', function(cm,vim,helpers) {
-  cm.setCursor(0,0);
-  helpers.doKeys('i');
-  cm.replaceRange('foo',cm.getCursor());
-  helpers.doKeys('<Esc>');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/\.\s+foo/.test(text));
-  });
-  helpers.doKeys(':');
-}, {value: ''});
-testVim(':_register', function(cm,vim,helpers) {
-  helpers.doEx('bar');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/:\s+bar/.test(text));
-  });
-  helpers.doKeys(':');
-}, {value: ''});
-testVim('search_register_escape', function(cm, vim, helpers) {
-  // Check that the register is restored if the user escapes rather than confirms.
-  cm.openDialog = helpers.fakeOpenDialog('waldo');
-  helpers.doKeys('/');
-  var onKeyDown;
-  var onKeyUp;
-  var KEYCODES = {
-    f: 70,
-    o: 79,
-    Esc: 27
-  };
-  cm.openDialog = function(template, callback, options) {
-    onKeyDown = options.onKeyDown;
-    onKeyUp = options.onKeyUp;
-  };
-  var close = function() {};
-  helpers.doKeys('/');
-  // Fake some keyboard events coming in.
-  onKeyDown({keyCode: KEYCODES.f}, '', close);
-  onKeyUp({keyCode: KEYCODES.f}, '', close);
-  onKeyDown({keyCode: KEYCODES.o}, 'f', close);
-  onKeyUp({keyCode: KEYCODES.o}, 'f', close);
-  onKeyDown({keyCode: KEYCODES.o}, 'fo', close);
-  onKeyUp({keyCode: KEYCODES.o}, 'fo', close);
-  onKeyDown({keyCode: KEYCODES.Esc}, 'foo', close);
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/waldo/.test(text));
-    is(!/foo/.test(text));
-  });
-  helpers.doKeys(':');
-}, {value: ''});
-testVim('search_register', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('foo');
-  helpers.doKeys('/');
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  cm.openNotification = helpers.fakeOpenNotification(function(text) {
-    is(/\/\s+foo/.test(text));
-  });
-  helpers.doKeys(':');
-}, {value: ''});
-testVim('search_history', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('this');
-  helpers.doKeys('/');
-  cm.openDialog = helpers.fakeOpenDialog('checks');
-  helpers.doKeys('/');
-  cm.openDialog = helpers.fakeOpenDialog('search');
-  helpers.doKeys('/');
-  cm.openDialog = helpers.fakeOpenDialog('history');
-  helpers.doKeys('/');
-  cm.openDialog = helpers.fakeOpenDialog('checks');
-  helpers.doKeys('/');
-  var onKeyDown;
-  var onKeyUp;
-  var query = '';
-  var keyCodes = {
-    Up: 38,
-    Down: 40
-  };
-  cm.openDialog = function(template, callback, options) {
-    onKeyUp = options.onKeyUp;
-    onKeyDown = options.onKeyDown;
-  };
-  var close = function(newVal) {
-    if (typeof newVal == 'string') query = newVal;
-  }
-  helpers.doKeys('/');
-  onKeyDown({keyCode: keyCodes.Up}, query, close);
-  onKeyUp({keyCode: keyCodes.Up}, query, close);
-  eq(query, 'checks');
-  onKeyDown({keyCode: keyCodes.Up}, query, close);
-  onKeyUp({keyCode: keyCodes.Up}, query, close);
-  eq(query, 'history');
-  onKeyDown({keyCode: keyCodes.Up}, query, close);
-  onKeyUp({keyCode: keyCodes.Up}, query, close);
-  eq(query, 'search');
-  onKeyDown({keyCode: keyCodes.Up}, query, close);
-  onKeyUp({keyCode: keyCodes.Up}, query, close);
-  eq(query, 'this');
-  onKeyDown({keyCode: keyCodes.Down}, query, close);
-  onKeyUp({keyCode: keyCodes.Down}, query, close);
-  eq(query, 'search');
-}, {value: ''});
-testVim('exCommand_history', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('registers');
-  helpers.doKeys(':');
-  cm.openDialog = helpers.fakeOpenDialog('sort');
-  helpers.doKeys(':');
-  cm.openDialog = helpers.fakeOpenDialog('map');
-  helpers.doKeys(':');
-  cm.openDialog = helpers.fakeOpenDialog('invalid');
-  helpers.doKeys(':');
-  var onKeyDown;
-  var onKeyUp;
-  var input = '';
-  var keyCodes = {
-    Up: 38,
-    Down: 40,
-    s: 115
-  };
-  cm.openDialog = function(template, callback, options) {
-    onKeyUp = options.onKeyUp;
-    onKeyDown = options.onKeyDown;
-  };
-  var close = function(newVal) {
-    if (typeof newVal == 'string') input = newVal;
-  }
-  helpers.doKeys(':');
-  onKeyDown({keyCode: keyCodes.Up}, input, close);
-  eq(input, 'invalid');
-  onKeyDown({keyCode: keyCodes.Up}, input, close);
-  eq(input, 'map');
-  onKeyDown({keyCode: keyCodes.Up}, input, close);
-  eq(input, 'sort');
-  onKeyDown({keyCode: keyCodes.Up}, input, close);
-  eq(input, 'registers');
-  onKeyDown({keyCode: keyCodes.s}, '', close);
-  input = 's';
-  onKeyDown({keyCode: keyCodes.Up}, input, close);
-  eq(input, 'sort');
-}, {value: ''});
-testVim('search_clear', function(cm, vim, helpers) {
-  var onKeyDown;
-  var input = '';
-  var keyCodes = {
-    Ctrl: 17,
-    u: 85
-  };
-  cm.openDialog = function(template, callback, options) {
-    onKeyDown = options.onKeyDown;
-  };
-  var close = function(newVal) {
-    if (typeof newVal == 'string') input = newVal;
-  }
-  helpers.doKeys('/');
-  input = 'foo';
-  onKeyDown({keyCode: keyCodes.Ctrl}, input, close);
-  onKeyDown({keyCode: keyCodes.u, ctrlKey: true}, input, close);
-  eq(input, '');
-});
-testVim('exCommand_clear', function(cm, vim, helpers) {
-  var onKeyDown;
-  var input = '';
-  var keyCodes = {
-    Ctrl: 17,
-    u: 85
-  };
-  cm.openDialog = function(template, callback, options) {
-    onKeyDown = options.onKeyDown;
-  };
-  var close = function(newVal) {
-    if (typeof newVal == 'string') input = newVal;
-  }
-  helpers.doKeys(':');
-  input = 'foo';
-  onKeyDown({keyCode: keyCodes.Ctrl}, input, close);
-  onKeyDown({keyCode: keyCodes.u, ctrlKey: true}, input, close);
-  eq(input, '');
-});
-testVim('.', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('2', 'd', 'w');
-  helpers.doKeys('.');
-  eq('5 6', cm.getValue());
-}, { value: '1 2 3 4 5 6'});
-testVim('._repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('2', 'd', 'w');
-  helpers.doKeys('3', '.');
-  eq('6', cm.getValue());
-}, { value: '1 2 3 4 5 6'});
-testVim('._insert', function(cm, vim, helpers) {
-  helpers.doKeys('i');
-  cm.replaceRange('test', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('.');
-  eq('testestt', cm.getValue());
-  helpers.assertCursorAt(0, 6);
-  helpers.doKeys('O');
-  cm.replaceRange('xyz', cm.getCursor());
-  helpers.doInsertModeKeys('Backspace');
-  helpers.doInsertModeKeys('Down');
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('.');
-  eq('xy\nxy\ntestestt', cm.getValue());
-  helpers.assertCursorAt(1, 1);
-}, { value: ''});
-testVim('._insert_repeat', function(cm, vim, helpers) {
-  helpers.doKeys('i');
-  cm.replaceRange('test', cm.getCursor());
-  cm.setCursor(0, 4);
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('2', '.');
-  eq('testesttestt', cm.getValue());
-  helpers.assertCursorAt(0, 10);
-}, { value: ''});
-testVim('._repeat_insert', function(cm, vim, helpers) {
-  helpers.doKeys('3', 'i');
-  cm.replaceRange('te', cm.getCursor());
-  cm.setCursor(0, 2);
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('.');
-  eq('tetettetetee', cm.getValue());
-  helpers.assertCursorAt(0, 10);
-}, { value: ''});
-testVim('._insert_o', function(cm, vim, helpers) {
-  helpers.doKeys('o');
-  cm.replaceRange('z', cm.getCursor());
-  cm.setCursor(1, 1);
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('.');
-  eq('\nz\nz', cm.getValue());
-  helpers.assertCursorAt(2, 0);
-}, { value: ''});
-testVim('._insert_o_repeat', function(cm, vim, helpers) {
-  helpers.doKeys('o');
-  cm.replaceRange('z', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  cm.setCursor(1, 0);
-  helpers.doKeys('2', '.');
-  eq('\nz\nz\nz', cm.getValue());
-  helpers.assertCursorAt(3, 0);
-}, { value: ''});
-testVim('._insert_o_indent', function(cm, vim, helpers) {
-  helpers.doKeys('o');
-  cm.replaceRange('z', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  cm.setCursor(1, 2);
-  helpers.doKeys('.');
-  eq('{\n  z\n  z', cm.getValue());
-  helpers.assertCursorAt(2, 2);
-}, { value: '{'});
-testVim('._insert_cw', function(cm, vim, helpers) {
-  helpers.doKeys('c', 'w');
-  cm.replaceRange('test', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  cm.setCursor(0, 3);
-  helpers.doKeys('2', 'l');
-  helpers.doKeys('.');
-  eq('test test word3', cm.getValue());
-  helpers.assertCursorAt(0, 8);
-}, { value: 'word1 word2 word3' });
-testVim('._insert_cw_repeat', function(cm, vim, helpers) {
-  // For some reason, repeat cw in desktop VIM will does not repeat insert mode
-  // changes. Will conform to that behavior.
-  helpers.doKeys('c', 'w');
-  cm.replaceRange('test', cm.getCursor());
-  helpers.doKeys('<Esc>');
-  cm.setCursor(0, 4);
-  helpers.doKeys('l');
-  helpers.doKeys('2', '.');
-  eq('test test', cm.getValue());
-  helpers.assertCursorAt(0, 8);
-}, { value: 'word1 word2 word3' });
-testVim('._delete', function(cm, vim, helpers) {
-  cm.setCursor(0, 5);
-  helpers.doKeys('i');
-  helpers.doInsertModeKeys('Backspace');
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('.');
-  eq('zace', cm.getValue());
-  helpers.assertCursorAt(0, 1);
-}, { value: 'zabcde'});
-testVim('._delete_repeat', function(cm, vim, helpers) {
-  cm.setCursor(0, 6);
-  helpers.doKeys('i');
-  helpers.doInsertModeKeys('Backspace');
-  helpers.doKeys('<Esc>');
-  helpers.doKeys('2', '.');
-  eq('zzce', cm.getValue());
-  helpers.assertCursorAt(0, 1);
-}, { value: 'zzabcde'});
-testVim('._visual_>', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('V', 'j', '>');
-  cm.setCursor(2, 0)
-  helpers.doKeys('.');
-  eq('  1\n  2\n  3\n  4', cm.getValue());
-  helpers.assertCursorAt(2, 2);
-}, { value: '1\n2\n3\n4'});
-testVim('f;', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('f', 'x');
-  helpers.doKeys(';');
-  helpers.doKeys('2', ';');
-  eq(9, cm.getCursor().ch);
-}, { value: '01x3xx678x'});
-testVim('F;', function(cm, vim, helpers) {
-  cm.setCursor(0, 8);
-  helpers.doKeys('F', 'x');
-  helpers.doKeys(';');
-  helpers.doKeys('2', ';');
-  eq(2, cm.getCursor().ch);
-}, { value: '01x3xx6x8x'});
-testVim('t;', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('t', 'x');
-  helpers.doKeys(';');
-  helpers.doKeys('2', ';');
-  eq(8, cm.getCursor().ch);
-}, { value: '01x3xx678x'});
-testVim('T;', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('T', 'x');
-  helpers.doKeys(';');
-  helpers.doKeys('2', ';');
-  eq(2, cm.getCursor().ch);
-}, { value: '0xx3xx678x'});
-testVim('f,', function(cm, vim, helpers) {
-  cm.setCursor(0, 6);
-  helpers.doKeys('f', 'x');
-  helpers.doKeys(',');
-  helpers.doKeys('2', ',');
-  eq(2, cm.getCursor().ch);
-}, { value: '01x3xx678x'});
-testVim('F,', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  helpers.doKeys('F', 'x');
-  helpers.doKeys(',');
-  helpers.doKeys('2', ',');
-  eq(9, cm.getCursor().ch);
-}, { value: '01x3xx678x'});
-testVim('t,', function(cm, vim, helpers) {
-  cm.setCursor(0, 6);
-  helpers.doKeys('t', 'x');
-  helpers.doKeys(',');
-  helpers.doKeys('2', ',');
-  eq(3, cm.getCursor().ch);
-}, { value: '01x3xx678x'});
-testVim('T,', function(cm, vim, helpers) {
-  cm.setCursor(0, 4);
-  helpers.doKeys('T', 'x');
-  helpers.doKeys(',');
-  helpers.doKeys('2', ',');
-  eq(8, cm.getCursor().ch);
-}, { value: '01x3xx67xx'});
-testVim('fd,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('f', '4');
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', ';');
-  eq('56789', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 9);
-  helpers.doKeys('d', ',');
-  eq('01239', cm.getValue());
-}, { value: '0123456789'});
-testVim('Fd,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('F', '4');
-  cm.setCursor(0, 9);
-  helpers.doKeys('d', ';');
-  eq('01239', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', ',');
-  eq('56789', cm.getValue());
-}, { value: '0123456789'});
-testVim('td,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('t', '4');
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', ';');
-  eq('456789', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 9);
-  helpers.doKeys('d', ',');
-  eq('012349', cm.getValue());
-}, { value: '0123456789'});
-testVim('Td,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('T', '4');
-  cm.setCursor(0, 9);
-  helpers.doKeys('d', ';');
-  eq('012349', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 0);
-  helpers.doKeys('d', ',');
-  eq('456789', cm.getValue());
-}, { value: '0123456789'});
-testVim('fc,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('f', '4');
-  cm.setCursor(0, 0);
-  helpers.doKeys('c', ';', '<Esc>');
-  eq('56789', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 9);
-  helpers.doKeys('c', ',');
-  eq('01239', cm.getValue());
-}, { value: '0123456789'});
-testVim('Fc,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('F', '4');
-  cm.setCursor(0, 9);
-  helpers.doKeys('c', ';', '<Esc>');
-  eq('01239', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 0);
-  helpers.doKeys('c', ',');
-  eq('56789', cm.getValue());
-}, { value: '0123456789'});
-testVim('tc,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('t', '4');
-  cm.setCursor(0, 0);
-  helpers.doKeys('c', ';', '<Esc>');
-  eq('456789', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 9);
-  helpers.doKeys('c', ',');
-  eq('012349', cm.getValue());
-}, { value: '0123456789'});
-testVim('Tc,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('T', '4');
-  cm.setCursor(0, 9);
-  helpers.doKeys('c', ';', '<Esc>');
-  eq('012349', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 0);
-  helpers.doKeys('c', ',');
-  eq('456789', cm.getValue());
-}, { value: '0123456789'});
-testVim('fy,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('f', '4');
-  cm.setCursor(0, 0);
-  helpers.doKeys('y', ';', 'P');
-  eq('012340123456789', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 9);
-  helpers.doKeys('y', ',', 'P');
-  eq('012345678456789', cm.getValue());
-}, { value: '0123456789'});
-testVim('Fy,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('F', '4');
-  cm.setCursor(0, 9);
-  helpers.doKeys('y', ';', 'p');
-  eq('012345678945678', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 0);
-  helpers.doKeys('y', ',', 'P');
-  eq('012340123456789', cm.getValue());
-}, { value: '0123456789'});
-testVim('ty,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys('t', '4');
-  cm.setCursor(0, 0);
-  helpers.doKeys('y', ';', 'P');
-  eq('01230123456789', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 9);
-  helpers.doKeys('y', ',', 'p');
-  eq('01234567895678', cm.getValue());
-}, { value: '0123456789'});
-testVim('Ty,;', function(cm, vim, helpers) {
-  cm.setCursor(0, 9);
-  helpers.doKeys('T', '4');
-  cm.setCursor(0, 9);
-  helpers.doKeys('y', ';', 'p');
-  eq('01234567895678', cm.getValue());
-  helpers.doKeys('u');
-  cm.setCursor(0, 0);
-  helpers.doKeys('y', ',', 'P');
-  eq('01230123456789', cm.getValue());
-}, { value: '0123456789'});
-testVim('HML', function(cm, vim, helpers) {
-  var lines = 35;
-  var textHeight = cm.defaultTextHeight();
-  cm.setSize(600, lines*textHeight);
-  cm.setCursor(120, 0);
-  helpers.doKeys('H');
-  helpers.assertCursorAt(86, 2);
-  helpers.doKeys('L');
-  helpers.assertCursorAt(120, 4);
-  helpers.doKeys('M');
-  helpers.assertCursorAt(103,4);
-}, { value: (function(){
-  var lines = new Array(100);
-  var upper = '  xx\n';
-  var lower = '    xx\n';
-  upper = lines.join(upper);
-  lower = lines.join(lower);
-  return upper + lower;
-})()});
-
-var zVals = [];
-forEach(['zb','zz','zt','z-','z.','z<CR>'], function(e, idx){
-  var lineNum = 250;
-  var lines = 35;
-  testVim(e, function(cm, vim, helpers) {
-    var k1 = e[0];
-    var k2 = e.substring(1);
-    var textHeight = cm.defaultTextHeight();
-    cm.setSize(600, lines*textHeight);
-    cm.setCursor(lineNum, 0);
-    helpers.doKeys(k1, k2);
-    zVals[idx] = cm.getScrollInfo().top;
-  }, { value: (function(){
-    return new Array(500).join('\n');
-  })()});
-});
-testVim('zb_to_bottom', function(cm, vim, helpers){
-  var lineNum = 250;
-  cm.setSize(600, 35*cm.defaultTextHeight());
-  cm.setCursor(lineNum, 0);
-  helpers.doKeys('z', 'b');
-  var scrollInfo = cm.getScrollInfo();
-  eq(scrollInfo.top + scrollInfo.clientHeight, cm.charCoords(Pos(lineNum, 0), 'local').bottom);
-}, { value: (function(){
-  return new Array(500).join('\n');
-})()});
-testVim('zt_to_top', function(cm, vim, helpers){
-  var lineNum = 250;
-  cm.setSize(600, 35*cm.defaultTextHeight());
-  cm.setCursor(lineNum, 0);
-  helpers.doKeys('z', 't');
-  eq(cm.getScrollInfo().top, cm.charCoords(Pos(lineNum, 0), 'local').top);
-}, { value: (function(){
-  return new Array(500).join('\n');
-})()});
-testVim('zb<zz', function(cm, vim, helpers){
-  eq(zVals[0]<zVals[1], true);
-});
-testVim('zz<zt', function(cm, vim, helpers){
-  eq(zVals[1]<zVals[2], true);
-});
-testVim('zb==z-', function(cm, vim, helpers){
-  eq(zVals[0], zVals[3]);
-});
-testVim('zz==z.', function(cm, vim, helpers){
-  eq(zVals[1], zVals[4]);
-});
-testVim('zt==z<CR>', function(cm, vim, helpers){
-  eq(zVals[2], zVals[5]);
-});
-
-var moveTillCharacterSandbox =
-  'The quick brown fox \n';
-testVim('moveTillCharacter', function(cm, vim, helpers){
-  cm.setCursor(0, 0);
-  // Search for the 'q'.
-  cm.openDialog = helpers.fakeOpenDialog('q');
-  helpers.doKeys('/');
-  eq(4, cm.getCursor().ch);
-  // Jump to just before the first o in the list.
-  helpers.doKeys('t');
-  helpers.doKeys('o');
-  eq('The quick brown fox \n', cm.getValue());
-  // Delete that one character.
-  helpers.doKeys('d');
-  helpers.doKeys('t');
-  helpers.doKeys('o');
-  eq('The quick bown fox \n', cm.getValue());
-  // Delete everything until the next 'o'.
-  helpers.doKeys('.');
-  eq('The quick box \n', cm.getValue());
-  // An unmatched character should have no effect.
-  helpers.doKeys('d');
-  helpers.doKeys('t');
-  helpers.doKeys('q');
-  eq('The quick box \n', cm.getValue());
-  // Matches should only be possible on single lines.
-  helpers.doKeys('d');
-  helpers.doKeys('t');
-  helpers.doKeys('z');
-  eq('The quick box \n', cm.getValue());
-  // After all that, the search for 'q' should still be active, so the 'N' command
-  // can run it again in reverse. Use that to delete everything back to the 'q'.
-  helpers.doKeys('d');
-  helpers.doKeys('N');
-  eq('The ox \n', cm.getValue());
-  eq(4, cm.getCursor().ch);
-}, { value: moveTillCharacterSandbox});
-testVim('searchForPipe', function(cm, vim, helpers){
-  CodeMirror.Vim.setOption('pcre', false);
-  cm.setCursor(0, 0);
-  // Search for the '|'.
-  cm.openDialog = helpers.fakeOpenDialog('|');
-  helpers.doKeys('/');
-  eq(4, cm.getCursor().ch);
-}, { value: 'this|that'});
-
-
-var scrollMotionSandbox =
-  '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n';
-testVim('scrollMotion', function(cm, vim, helpers){
-  var prevCursor, prevScrollInfo;
-  cm.setCursor(0, 0);
-  // ctrl-y at the top of the file should have no effect.
-  helpers.doKeys('<C-y>');
-  eq(0, cm.getCursor().line);
-  prevScrollInfo = cm.getScrollInfo();
-  helpers.doKeys('<C-e>');
-  eq(1, cm.getCursor().line);
-  is(prevScrollInfo.top < cm.getScrollInfo().top);
-  // Jump to the end of the sandbox.
-  cm.setCursor(1000, 0);
-  prevCursor = cm.getCursor();
-  // ctrl-e at the bottom of the file should have no effect.
-  helpers.doKeys('<C-e>');
-  eq(prevCursor.line, cm.getCursor().line);
-  prevScrollInfo = cm.getScrollInfo();
-  helpers.doKeys('<C-y>');
-  eq(prevCursor.line - 1, cm.getCursor().line, "Y");
-  is(prevScrollInfo.top > cm.getScrollInfo().top);
-}, { value: scrollMotionSandbox});
-
-var squareBracketMotionSandbox = ''+
-  '({\n'+//0
-  '  ({\n'+//11
-  '  /*comment {\n'+//2
-  '            */(\n'+//3
-  '#else                \n'+//4
-  '  /*       )\n'+//5
-  '#if        }\n'+//6
-  '  )}*/\n'+//7
-  ')}\n'+//8
-  '{}\n'+//9
-  '#else {{\n'+//10
-  '{}\n'+//11
-  '}\n'+//12
-  '{\n'+//13
-  '#endif\n'+//14
-  '}\n'+//15
-  '}\n'+//16
-  '#else';//17
-testVim('[[, ]]', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys(']', ']');
-  helpers.assertCursorAt(9,0);
-  helpers.doKeys('2', ']', ']');
-  helpers.assertCursorAt(13,0);
-  helpers.doKeys(']', ']');
-  helpers.assertCursorAt(17,0);
-  helpers.doKeys('[', '[');
-  helpers.assertCursorAt(13,0);
-  helpers.doKeys('2', '[', '[');
-  helpers.assertCursorAt(9,0);
-  helpers.doKeys('[', '[');
-  helpers.assertCursorAt(0,0);
-}, { value: squareBracketMotionSandbox});
-testVim('[], ][', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doKeys(']', '[');
-  helpers.assertCursorAt(12,0);
-  helpers.doKeys('2', ']', '[');
-  helpers.assertCursorAt(16,0);
-  helpers.doKeys(']', '[');
-  helpers.assertCursorAt(17,0);
-  helpers.doKeys('[', ']');
-  helpers.assertCursorAt(16,0);
-  helpers.doKeys('2', '[', ']');
-  helpers.assertCursorAt(12,0);
-  helpers.doKeys('[', ']');
-  helpers.assertCursorAt(0,0);
-}, { value: squareBracketMotionSandbox});
-testVim('[{, ]}', function(cm, vim, helpers) {
-  cm.setCursor(4, 10);
-  helpers.doKeys('[', '{');
-  helpers.assertCursorAt(2,12);
-  helpers.doKeys('2', '[', '{');
-  helpers.assertCursorAt(0,1);
-  cm.setCursor(4, 10);
-  helpers.doKeys(']', '}');
-  helpers.assertCursorAt(6,11);
-  helpers.doKeys('2', ']', '}');
-  helpers.assertCursorAt(8,1);
-  cm.setCursor(0,1);
-  helpers.doKeys(']', '}');
-  helpers.assertCursorAt(8,1);
-  helpers.doKeys('[', '{');
-  helpers.assertCursorAt(0,1);
-}, { value: squareBracketMotionSandbox});
-testVim('[(, ])', function(cm, vim, helpers) {
-  cm.setCursor(4, 10);
-  helpers.doKeys('[', '(');
-  helpers.assertCursorAt(3,14);
-  helpers.doKeys('2', '[', '(');
-  helpers.assertCursorAt(0,0);
-  cm.setCursor(4, 10);
-  helpers.doKeys(']', ')');
-  helpers.assertCursorAt(5,11);
-  helpers.doKeys('2', ']', ')');
-  helpers.assertCursorAt(8,0);
-  helpers.doKeys('[', '(');
-  helpers.assertCursorAt(0,0);
-  helpers.doKeys(']', ')');
-  helpers.assertCursorAt(8,0);
-}, { value: squareBracketMotionSandbox});
-testVim('[*, ]*, [/, ]/', function(cm, vim, helpers) {
-  forEach(['*', '/'], function(key){
-    cm.setCursor(7, 0);
-    helpers.doKeys('2', '[', key);
-    helpers.assertCursorAt(2,2);
-    helpers.doKeys('2', ']', key);
-    helpers.assertCursorAt(7,5);
-  });
-}, { value: squareBracketMotionSandbox});
-testVim('[#, ]#', function(cm, vim, helpers) {
-  cm.setCursor(10, 3);
-  helpers.doKeys('2', '[', '#');
-  helpers.assertCursorAt(4,0);
-  helpers.doKeys('5', ']', '#');
-  helpers.assertCursorAt(17,0);
-  cm.setCursor(10, 3);
-  helpers.doKeys(']', '#');
-  helpers.assertCursorAt(14,0);
-}, { value: squareBracketMotionSandbox});
-testVim('[m, ]m, [M, ]M', function(cm, vim, helpers) {
-  cm.setCursor(11, 0);
-  helpers.doKeys('[', 'm');
-  helpers.assertCursorAt(10,7);
-  helpers.doKeys('4', '[', 'm');
-  helpers.assertCursorAt(1,3);
-  helpers.doKeys('5', ']', 'm');
-  helpers.assertCursorAt(11,0);
-  helpers.doKeys('[', 'M');
-  helpers.assertCursorAt(9,1);
-  helpers.doKeys('3', ']', 'M');
-  helpers.assertCursorAt(15,0);
-  helpers.doKeys('5', '[', 'M');
-  helpers.assertCursorAt(7,3);
-}, { value: squareBracketMotionSandbox});
-
-testVim('i_indent_right', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedValue = '   word1\nword2\nword3 ';
-  helpers.doKeys('i', '<C-t>');
-  eq(expectedValue, cm.getValue());
-  helpers.assertCursorAt(0, 5);
-}, { value: ' word1\nword2\nword3 ', indentUnit: 2 });
-testVim('i_indent_left', function(cm, vim, helpers) {
-  cm.setCursor(0, 3);
-  var expectedValue = ' word1\nword2\nword3 ';
-  helpers.doKeys('i', '<C-d>');
-  eq(expectedValue, cm.getValue());
-  helpers.assertCursorAt(0, 1);
-}, { value: '   word1\nword2\nword3 ', indentUnit: 2 });
-
-// Ex mode tests
-testVim('ex_go_to_line', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doEx('4');
-  helpers.assertCursorAt(3, 0);
-}, { value: 'a\nb\nc\nd\ne\n'});
-testVim('ex_write', function(cm, vim, helpers) {
-  var tmp = CodeMirror.commands.save;
-  var written;
-  var actualCm;
-  CodeMirror.commands.save = function(cm) {
-    written = true;
-    actualCm = cm;
-  };
-  // Test that w, wr, wri ... write all trigger :write.
-  var command = 'write';
-  for (var i = 1; i < command.length; i++) {
-    written = false;
-    actualCm = null;
-    helpers.doEx(command.substring(0, i));
-    eq(written, true);
-    eq(actualCm, cm);
-  }
-  CodeMirror.commands.save = tmp;
-});
-testVim('ex_sort', function(cm, vim, helpers) {
-  helpers.doEx('sort');
-  eq('Z\na\nb\nc\nd', cm.getValue());
-}, { value: 'b\nZ\nd\nc\na'});
-testVim('ex_sort_reverse', function(cm, vim, helpers) {
-  helpers.doEx('sort!');
-  eq('d\nc\nb\na', cm.getValue());
-}, { value: 'b\nd\nc\na'});
-testVim('ex_sort_range', function(cm, vim, helpers) {
-  helpers.doEx('2,3sort');
-  eq('b\nc\nd\na', cm.getValue());
-}, { value: 'b\nd\nc\na'});
-testVim('ex_sort_oneline', function(cm, vim, helpers) {
-  helpers.doEx('2sort');
-  // Expect no change.
-  eq('b\nd\nc\na', cm.getValue());
-}, { value: 'b\nd\nc\na'});
-testVim('ex_sort_ignoreCase', function(cm, vim, helpers) {
-  helpers.doEx('sort i');
-  eq('a\nb\nc\nd\nZ', cm.getValue());
-}, { value: 'b\nZ\nd\nc\na'});
-testVim('ex_sort_unique', function(cm, vim, helpers) {
-  helpers.doEx('sort u');
-  eq('Z\na\nb\nc\nd', cm.getValue());
-}, { value: 'b\nZ\na\na\nd\na\nc\na'});
-testVim('ex_sort_decimal', function(cm, vim, helpers) {
-  helpers.doEx('sort d');
-  eq('d3\n s5\n6\n.9', cm.getValue());
-}, { value: '6\nd3\n s5\n.9'});
-testVim('ex_sort_decimal_negative', function(cm, vim, helpers) {
-  helpers.doEx('sort d');
-  eq('z-9\nd3\n s5\n6\n.9', cm.getValue());
-}, { value: '6\nd3\n s5\n.9\nz-9'});
-testVim('ex_sort_decimal_reverse', function(cm, vim, helpers) {
-  helpers.doEx('sort! d');
-  eq('.9\n6\n s5\nd3', cm.getValue());
-}, { value: '6\nd3\n s5\n.9'});
-testVim('ex_sort_hex', function(cm, vim, helpers) {
-  helpers.doEx('sort x');
-  eq(' s5\n6\n.9\n&0xB\nd3', cm.getValue());
-}, { value: '6\nd3\n s5\n&0xB\n.9'});
-testVim('ex_sort_octal', function(cm, vim, helpers) {
-  helpers.doEx('sort o');
-  eq('.9\n.8\nd3\n s5\n6', cm.getValue());
-}, { value: '6\nd3\n s5\n.9\n.8'});
-testVim('ex_sort_decimal_mixed', function(cm, vim, helpers) {
-  helpers.doEx('sort d');
-  eq('z\ny\nc1\nb2\na3', cm.getValue());
-}, { value: 'a3\nz\nc1\ny\nb2'});
-testVim('ex_sort_decimal_mixed_reverse', function(cm, vim, helpers) {
-  helpers.doEx('sort! d');
-  eq('a3\nb2\nc1\nz\ny', cm.getValue());
-}, { value: 'a3\nz\nc1\ny\nb2'});
-testVim('ex_sort_pattern_alpha', function(cm, vim, helpers) {
-  helpers.doEx('sort /[a-z]/');
-  eq('a3\nb2\nc1\ny\nz', cm.getValue());
-}, { value: 'z\ny\nc1\nb2\na3'});
-testVim('ex_sort_pattern_alpha_reverse', function(cm, vim, helpers) {
-  helpers.doEx('sort! /[a-z]/');
-  eq('z\ny\nc1\nb2\na3', cm.getValue());
-}, { value: 'z\ny\nc1\nb2\na3'});
-testVim('ex_sort_pattern_alpha_ignoreCase', function(cm, vim, helpers) {
-  helpers.doEx('sort i/[a-z]/');
-  eq('a3\nb2\nC1\nY\nz', cm.getValue());
-}, { value: 'z\nY\nC1\nb2\na3'});
-testVim('ex_sort_pattern_alpha_longer', function(cm, vim, helpers) {
-  helpers.doEx('sort /[a-z]+/');
-  eq('a\naa\nab\nade\nadele\nadelle\nadriana\nalex\nalexandra\nb\nc\ny\nz', cm.getValue());
-}, { value: 'z\nab\naa\nade\nadelle\nalexandra\nalex\nadriana\nadele\ny\nc\nb\na'});
-testVim('ex_sort_pattern_alpha_only', function(cm, vim, helpers) {
-  helpers.doEx('sort /^[a-z]$/');
-  eq('z1\ny2\na3\nb\nc', cm.getValue());
-}, { value: 'z1\ny2\na3\nc\nb'});
-testVim('ex_sort_pattern_alpha_only_reverse', function(cm, vim, helpers) {
-  helpers.doEx('sort! /^[a-z]$/');
-  eq('c\nb\nz1\ny2\na3', cm.getValue());
-}, { value: 'z1\ny2\na3\nc\nb'});
-testVim('ex_sort_pattern_alpha_num', function(cm, vim, helpers) {
-  helpers.doEx('sort /[a-z][0-9]/');
-  eq('c\nb\na3\ny2\nz1', cm.getValue());
-}, { value: 'z1\ny2\na3\nc\nb'});
-// test for :global command
-testVim('ex_global', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  helpers.doEx('g/one/s//two');
-  eq('two two\n two two\n two two', cm.getValue());
-  helpers.doEx('1,2g/two/s//one');
-  eq('one one\n one one\n two two', cm.getValue());
-}, {value: 'one one\n one one\n one one'});
-testVim('ex_global_confirm', function(cm, vim, helpers) {
-  cm.setCursor(0, 0);
-  var onKeyDown;
-  var openDialogSave = cm.openDialog;
-  var KEYCODES = {
-    a: 65,
-    n: 78,
-    q: 81,
-    y: 89
-  };
-  // Intercept the ex command, 'global'
-  cm.openDialog = function(template, callback, options) {
-    // Intercept the prompt for the embedded ex command, 'substitute'
-    cm.openDialog = function(template, callback, options) {
-      onKeyDown = options.onKeyDown;
-    };
-    callback('g/one/s//two/gc');
-  };
-  helpers.doKeys(':');
-  var close = function() {};
-  onKeyDown({keyCode: KEYCODES.n}, '', close);
-  onKeyDown({keyCode: KEYCODES.y}, '', close);
-  onKeyDown({keyCode: KEYCODES.a}, '', close);
-  onKeyDown({keyCode: KEYCODES.q}, '', close);
-  onKeyDown({keyCode: KEYCODES.y}, '', close);
-  eq('one two\n two two\n one one\n two one\n one one', cm.getValue());
-}, {value: 'one one\n one one\n one one\n one one\n one one'});
-// Basic substitute tests.
-testVim('ex_substitute_same_line', function(cm, vim, helpers) {
-  cm.setCursor(1, 0);
-  helpers.doEx('s/one/two/g');
-  eq('one one\n two two', cm.getValue());
-}, { value: 'one one\n one one'});
-testVim('ex_substitute_full_file', function(cm, vim, helpers) {
-  cm.setCursor(1, 0);
-  helpers.doEx('%s/one/two/g');
-  eq('two two\n two two', cm.getValue());
-}, { value: 'one one\n one one'});
-testVim('ex_substitute_input_range', function(cm, vim, helpers) {
-  cm.setCursor(1, 0);
-  helpers.doEx('1,3s/\\d/0/g');
-  eq('0\n0\n0\n4', cm.getValue());
-}, { value: '1\n2\n3\n4' });
-testVim('ex_substitute_visual_range', function(cm, vim, helpers) {
-  cm.setCursor(1, 0);
-  // Set last visual mode selection marks '< and '> at lines 2 and 4
-  helpers.doKeys('V', '2', 'j', 'v');
-  helpers.doEx('\'<,\'>s/\\d/0/g');
-  eq('1\n0\n0\n0\n5', cm.getValue());
-}, { value: '1\n2\n3\n4\n5' });
-testVim('ex_substitute_empty_query', function(cm, vim, helpers) {
-  // If the query is empty, use last query.
-  cm.setCursor(1, 0);
-  cm.openDialog = helpers.fakeOpenDialog('1');
-  helpers.doKeys('/');
-  helpers.doEx('s//b/g');
-  eq('abb ab2 ab3', cm.getValue());
-}, { value: 'a11 a12 a13' });
-testVim('ex_substitute_javascript', function(cm, vim, helpers) {
-  CodeMirror.Vim.setOption('pcre', false);
-  cm.setCursor(1, 0);
-  // Throw all the things that javascript likes to treat as special values
-  // into the replace part. All should be literal (this is VIM).
-  helpers.doEx('s/\\(\\d+\\)/$$ $\' $` $& \\1/g')
-  eq('a $$ $\' $` $& 0 b', cm.getValue());
-}, { value: 'a 0 b' });
-testVim('ex_substitute_empty_arguments', function(cm,vim,helpers) {
-  cm.setCursor(0, 0);
-  helpers.doEx('s/a/b/g');
-  cm.setCursor(1, 0);
-  helpers.doEx('s');
-  eq('b b\nb a', cm.getValue());
-}, {value: 'a a\na a'});
-
-// More complex substitute tests that test both pcre and nopcre options.
-function testSubstitute(name, options) {
-  testVim(name + '_pcre', function(cm, vim, helpers) {
-    cm.setCursor(1, 0);
-    CodeMirror.Vim.setOption('pcre', true);
-    helpers.doEx(options.expr);
-    eq(options.expectedValue, cm.getValue());
-  }, options);
-  // If no noPcreExpr is defined, assume that it's the same as the expr.
-  var noPcreExpr = options.noPcreExpr ? options.noPcreExpr : options.expr;
-  testVim(name + '_nopcre', function(cm, vim, helpers) {
-    cm.setCursor(1, 0);
-    CodeMirror.Vim.setOption('pcre', false);
-    helpers.doEx(noPcreExpr);
-    eq(options.expectedValue, cm.getValue());
-  }, options);
-}
-testSubstitute('ex_substitute_capture', {
-  value: 'a11 a12 a13',
-  expectedValue: 'a1111 a1212 a1313',
-  // $n is a backreference
-  expr: 's/(\\d+)/$1$1/g',
-  // \n is a backreference.
-  noPcreExpr: 's/\\(\\d+\\)/\\1\\1/g'});
-testSubstitute('ex_substitute_capture2', {
-  value: 'a 0 b',
-  expectedValue: 'a $00 b',
-  expr: 's/(\\d+)/$$$1$1/g',
-  noPcreExpr: 's/\\(\\d+\\)/$\\1\\1/g'});
-testSubstitute('ex_substitute_nocapture', {
-  value: 'a11 a12 a13',
-  expectedValue: 'a$1$1 a$1$1 a$1$1',
-  expr: 's/(\\d+)/$$1$$1/g',
-  noPcreExpr: 's/\\(\\d+\\)/$1$1/g'});
-testSubstitute('ex_substitute_nocapture2', {
-  value: 'a 0 b',
-  expectedValue: 'a $10 b',
-  expr: 's/(\\d+)/$$1$1/g',
-  noPcreExpr: 's/\\(\\d+\\)/\\$1\\1/g'});
-testSubstitute('ex_substitute_nocapture', {
-  value: 'a b c',
-  expectedValue: 'a $ c',
-  expr: 's/b/$$/',
-  noPcreExpr: 's/b/$/'});
-testSubstitute('ex_substitute_slash_regex', {
-  value: 'one/two \n three/four',
-  expectedValue: 'one|two \n three|four',
-  expr: '%s/\\//|'});
-testSubstitute('ex_substitute_pipe_regex', {
-  value: 'one|two \n three|four',
-  expectedValue: 'one,two \n three,four',
-  expr: '%s/\\|/,/',
-  noPcreExpr: '%s/|/,/'});
-testSubstitute('ex_substitute_or_regex', {
-  value: 'one|two \n three|four',
-  expectedValue: 'ana|twa \n thraa|faar',
-  expr: '%s/o|e|u/a/g',
-  noPcreExpr: '%s/o\\|e\\|u/a/g'});
-testSubstitute('ex_substitute_or_word_regex', {
-  value: 'one|two \n three|four',
-  expectedValue: 'five|five \n three|four',
-  expr: '%s/(one|two)/five/g',
-  noPcreExpr: '%s/\\(one\\|two\\)/five/g'});
-testSubstitute('ex_substitute_backslashslash_regex', {
-  value: 'one\\two \n three\\four',
-  expectedValue: 'one,two \n three,four',
-  expr: '%s/\\\\/,'});
-testSubstitute('ex_substitute_slash_replacement', {
-  value: 'one,two \n three,four',
-  expectedValue: 'one/two \n three/four',
-  expr: '%s/,/\\/'});
-testSubstitute('ex_substitute_backslash_replacement', {
-  value: 'one,two \n three,four',
-  expectedValue: 'one\\two \n three\\four',
-  expr: '%s/,/\\\\/g'});
-testSubstitute('ex_substitute_multibackslash_replacement', {
-  value: 'one,two \n three,four',
-  expectedValue: 'one\\\\\\\\two \n three\\\\\\\\four', // 2*8 backslashes.
-  expr: '%s/,/\\\\\\\\\\\\\\\\/g'}); // 16 backslashes.
-testSubstitute('ex_substitute_newline_replacement', {
-  value: 'one,two \n three,four',
-  expectedValue: 'one\ntwo \n three\nfour',
-  expr: '%s/,/\\n/g'});
-testSubstitute('ex_substitute_braces_word', {
-  value: 'ababab abb ab{2}',
-  expectedValue: 'ab abb ab{2}',
-  expr: '%s/(ab){2}//g',
-  noPcreExpr: '%s/\\(ab\\)\\{2\\}//g'});
-testSubstitute('ex_substitute_braces_range', {
-  value: 'a aa aaa aaaa',
-  expectedValue: 'a   a',
-  expr: '%s/a{2,3}//g',
-  noPcreExpr: '%s/a\\{2,3\\}//g'});
-testSubstitute('ex_substitute_braces_literal', {
-  value: 'ababab abb ab{2}',
-  expectedValue: 'ababab abb ',
-  expr: '%s/ab\\{2\\}//g',
-  noPcreExpr: '%s/ab{2}//g'});
-testSubstitute('ex_substitute_braces_char', {
-  value: 'ababab abb ab{2}',
-  expectedValue: 'ababab  ab{2}',
-  expr: '%s/ab{2}//g',
-  noPcreExpr: '%s/ab\\{2\\}//g'});
-testSubstitute('ex_substitute_braces_no_escape', {
-  value: 'ababab abb ab{2}',
-  expectedValue: 'ababab  ab{2}',
-  expr: '%s/ab{2}//g',
-  noPcreExpr: '%s/ab\\{2}//g'});
-testSubstitute('ex_substitute_count', {
-  value: '1\n2\n3\n4',
-  expectedValue: '1\n0\n0\n4',
-  expr: 's/\\d/0/i 2'});
-testSubstitute('ex_substitute_count_with_range', {
-  value: '1\n2\n3\n4',
-  expectedValue: '1\n2\n0\n0',
-  expr: '1,3s/\\d/0/ 3'});
-testSubstitute('ex_substitute_not_global', {
-  value: 'aaa\nbaa\ncaa',
-  expectedValue: 'xaa\nbxa\ncxa',
-  expr: '%s/a/x/'});
-function testSubstituteConfirm(name, command, initialValue, expectedValue, keys, finalPos) {
-  testVim(name, function(cm, vim, helpers) {
-    var savedOpenDialog = cm.openDialog;
-    var savedKeyName = CodeMirror.keyName;
-    var onKeyDown;
-    var recordedCallback;
-    var closed = true; // Start out closed, set false on second openDialog.
-    function close() {
-      closed = true;
-    }
-    // First openDialog should save callback.
-    cm.openDialog = function(template, callback, options) {
-      recordedCallback = callback;
-    }
-    // Do first openDialog.
-    helpers.doKeys(':');
-    // Second openDialog should save keyDown handler.
-    cm.openDialog = function(template, callback, options) {
-      onKeyDown = options.onKeyDown;
-      closed = false;
-    };
-    // Return the command to Vim and trigger second openDialog.
-    recordedCallback(command);
-    // The event should really use keyCode, but here just mock it out and use
-    // key and replace keyName to just return key.
-    CodeMirror.keyName = function (e) { return e.key; }
-    keys = keys.toUpperCase();
-    for (var i = 0; i < keys.length; i++) {
-      is(!closed);
-      onKeyDown({ key: keys.charAt(i) }, '', close);
-    }
-    try {
-      eq(expectedValue, cm.getValue());
-      helpers.assertCursorAt(finalPos);
-      is(closed);
-    } catch(e) {
-      throw e
-    } finally {
-      // Restore overridden functions.
-      CodeMirror.keyName = savedKeyName;
-      cm.openDialog = savedOpenDialog;
-    }
-  }, { value: initialValue });
-};
-testSubstituteConfirm('ex_substitute_confirm_emptydoc',
-    '%s/x/b/c', '', '', '', makeCursor(0, 0));
-testSubstituteConfirm('ex_substitute_confirm_nomatch',
-    '%s/x/b/c', 'ba a\nbab', 'ba a\nbab', '', makeCursor(0, 0));
-testSubstituteConfirm('ex_substitute_confirm_accept',
-    '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'yyy', makeCursor(1, 1));
-testSubstituteConfirm('ex_substitute_confirm_random_keys',
-    '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'ysdkywerty', makeCursor(1, 1));
-testSubstituteConfirm('ex_substitute_confirm_some',
-    '%s/a/b/cg', 'ba a\nbab', 'bb a\nbbb', 'yny', makeCursor(1, 1));
-testSubstituteConfirm('ex_substitute_confirm_all',
-    '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'a', makeCursor(1, 1));
-testSubstituteConfirm('ex_substitute_confirm_accept_then_all',
-    '%s/a/b/cg', 'ba a\nbab', 'bb b\nbbb', 'ya', makeCursor(1, 1));
-testSubstituteConfirm('ex_substitute_confirm_quit',
-    '%s/a/b/cg', 'ba a\nbab', 'bb a\nbab', 'yq', makeCursor(0, 3));
-testSubstituteConfirm('ex_substitute_confirm_last',
-    '%s/a/b/cg', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3));
-testSubstituteConfirm('ex_substitute_confirm_oneline',
-    '1s/a/b/cg', 'ba a\nbab', 'bb b\nbab', 'yl', makeCursor(0, 3));
-testSubstituteConfirm('ex_substitute_confirm_range_accept',
-    '1,2s/a/b/cg', 'aa\na \na\na', 'bb\nb \na\na', 'yyy', makeCursor(1, 0));
-testSubstituteConfirm('ex_substitute_confirm_range_some',
-    '1,3s/a/b/cg', 'aa\na \na\na', 'ba\nb \nb\na', 'ynyy', makeCursor(2, 0));
-testSubstituteConfirm('ex_substitute_confirm_range_all',
-    '1,3s/a/b/cg', 'aa\na \na\na', 'bb\nb \nb\na', 'a', makeCursor(2, 0));
-testSubstituteConfirm('ex_substitute_confirm_range_last',
-    '1,3s/a/b/cg', 'aa\na \na\na', 'bb\nb \na\na', 'yyl', makeCursor(1, 0));
-//:noh should clear highlighting of search-results but allow to resume search through n
-testVim('ex_noh_clearSearchHighlight', function(cm, vim, helpers) {
-  cm.openDialog = helpers.fakeOpenDialog('match');
-  helpers.doKeys('?');
-  helpers.doEx('noh');
-  eq(vim.searchState_.getOverlay(),null,'match-highlighting wasn\'t cleared');
-  helpers.doKeys('n');
-  helpers.assertCursorAt(0, 11,'can\'t resume search after clearing highlighting');
-}, { value: 'match nope match \n nope Match' });
-testVim('ex_yank', function (cm, vim, helpers) {
-  var curStart = makeCursor(3, 0);
-  cm.setCursor(curStart);
-  helpers.doEx('y');
-  var register = helpers.getRegisterController().getRegister();
-  var line = cm.getLine(3);
-  eq(line + '\n', register.toString());
-});
-testVim('set_boolean', function(cm, vim, helpers) {
-  CodeMirror.Vim.defineOption('testoption', true, 'boolean');
-  // Test default value is set.
-  is(CodeMirror.Vim.getOption('testoption'));
-  try {
-    // Test fail to set to non-boolean
-    CodeMirror.Vim.setOption('testoption', '5');
-    fail();
-  } catch (expected) {}
-  // Test setOption
-  CodeMirror.Vim.setOption('testoption', false);
-  is(!CodeMirror.Vim.getOption('testoption'));
-});
-testVim('ex_set_boolean', function(cm, vim, helpers) {
-  CodeMirror.Vim.defineOption('testoption', true, 'boolean');
-  // Test default value is set.
-  is(CodeMirror.Vim.getOption('testoption'));
-  try {
-    // Test fail to set to non-boolean
-    helpers.doEx('set testoption=22');
-    fail();
-  } catch (expected) {}
-  // Test setOption
-  helpers.doEx('set notestoption');
-  is(!CodeMirror.Vim.getOption('testoption'));
-});
-testVim('set_string', function(cm, vim, helpers) {
-  CodeMirror.Vim.defineOption('testoption', 'a', 'string');
-  // Test default value is set.
-  eq('a', CodeMirror.Vim.getOption('testoption'));
-  try {
-    // Test fail to set non-string.
-    CodeMirror.Vim.setOption('testoption', true);
-    fail();
-  } catch (expected) {}
-  try {
-    // Test fail to set 'notestoption'
-    CodeMirror.Vim.setOption('notestoption', 'b');
-    fail();
-  } catch (expected) {}
-  // Test setOption
-  CodeMirror.Vim.setOption('testoption', 'c');
-  eq('c', CodeMirror.Vim.getOption('testoption'));
-});
-testVim('ex_set_string', function(cm, vim, helpers) {
-  CodeMirror.Vim.defineOption('testopt', 'a', 'string');
-  // Test default value is set.
-  eq('a', CodeMirror.Vim.getOption('testopt'));
-  try {
-    // Test fail to set 'notestopt'
-    helpers.doEx('set notestopt=b');
-    fail();
-  } catch (expected) {}
-  // Test setOption
-  helpers.doEx('set testopt=c')
-  eq('c', CodeMirror.Vim.getOption('testopt'));
-  helpers.doEx('set testopt=c')
-  eq('c', CodeMirror.Vim.getOption('testopt', cm)); //local || global
-  eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); // local
-  eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); // global
-  eq('c', CodeMirror.Vim.getOption('testopt')); // global
-  // Test setOption global
-  helpers.doEx('setg testopt=d')
-  eq('c', CodeMirror.Vim.getOption('testopt', cm));
-  eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'}));
-  eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'}));
-  eq('d', CodeMirror.Vim.getOption('testopt'));
-  // Test setOption local
-  helpers.doEx('setl testopt=e')
-  eq('e', CodeMirror.Vim.getOption('testopt', cm));
-  eq('e', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'}));
-  eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'}));
-  eq('d', CodeMirror.Vim.getOption('testopt'));
-});
-testVim('ex_set_callback', function(cm, vim, helpers) {
-  var global;
-
-  function cb(val, cm, cfg) {
-    if (val === undefined) {
-      // Getter
-      if (cm) {
-        return cm._local;
-      } else {
-        return global;
-      }
-    } else {
-      // Setter
-      if (cm) {
-        cm._local = val;
-      } else {
-        global = val;
-      }
-    }
-  }
-
-  CodeMirror.Vim.defineOption('testopt', 'a', 'string', cb);
-  // Test default value is set.
-  eq('a', CodeMirror.Vim.getOption('testopt'));
-  try {
-    // Test fail to set 'notestopt'
-    helpers.doEx('set notestopt=b');
-    fail();
-  } catch (expected) {}
-  // Test setOption (Identical to the string tests, but via callback instead)
-  helpers.doEx('set testopt=c')
-  eq('c', CodeMirror.Vim.getOption('testopt', cm)); //local || global
-  eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'})); // local
-  eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'})); // global
-  eq('c', CodeMirror.Vim.getOption('testopt')); // global
-  // Test setOption global
-  helpers.doEx('setg testopt=d')
-  eq('c', CodeMirror.Vim.getOption('testopt', cm));
-  eq('c', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'}));
-  eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'}));
-  eq('d', CodeMirror.Vim.getOption('testopt'));
-  // Test setOption local
-  helpers.doEx('setl testopt=e')
-  eq('e', CodeMirror.Vim.getOption('testopt', cm));
-  eq('e', CodeMirror.Vim.getOption('testopt', cm, {scope: 'local'}));
-  eq('d', CodeMirror.Vim.getOption('testopt', cm, {scope: 'global'}));
-  eq('d', CodeMirror.Vim.getOption('testopt'));
-})
-testVim('ex_set_filetype', function(cm, vim, helpers) {
-  CodeMirror.defineMode('test_mode', function() {
-    return {token: function(stream) {
-      stream.match(/^\s+|^\S+/);
-    }};
-  });
-  CodeMirror.defineMode('test_mode_2', function() {
-    return {token: function(stream) {
-      stream.match(/^\s+|^\S+/);
-    }};
-  });
-  // Test mode is set.
-  helpers.doEx('set filetype=test_mode');
-  eq('test_mode', cm.getMode().name);
-  // Test 'ft' alias also sets mode.
-  helpers.doEx('set ft=test_mode_2');
-  eq('test_mode_2', cm.getMode().name);
-});
-testVim('ex_set_filetype_null', function(cm, vim, helpers) {
-  CodeMirror.defineMode('test_mode', function() {
-    return {token: function(stream) {
-      stream.match(/^\s+|^\S+/);
-    }};
-  });
-  cm.setOption('mode', 'test_mode');
-  // Test mode is set to null.
-  helpers.doEx('set filetype=');
-  eq('null', cm.getMode().name);
-});
-// TODO: Reset key maps after each test.
-testVim('ex_map_key2key', function(cm, vim, helpers) {
-  helpers.doEx('map a x');
-  helpers.doKeys('a');
-  helpers.assertCursorAt(0, 0);
-  eq('bc', cm.getValue());
-}, { value: 'abc' });
-testVim('ex_unmap_key2key', function(cm, vim, helpers) {
-  helpers.doEx('unmap a');
-  helpers.doKeys('a');
-  eq('vim-insert', cm.getOption('keyMap'));
-}, { value: 'abc' });
-testVim('ex_unmap_key2key_does_not_remove_default', function(cm, vim, helpers) {
-  try {
-    helpers.doEx('unmap a');
-    fail();
-  } catch (expected) {}
-  helpers.doKeys('a');
-  eq('vim-insert', cm.getOption('keyMap'));
-}, { value: 'abc' });
-testVim('ex_map_key2key_to_colon', function(cm, vim, helpers) {
-  helpers.doEx('map ; :');
-  var dialogOpened = false;
-  cm.openDialog = function() {
-    dialogOpened = true;
-  }
-  helpers.doKeys(';');
-  eq(dialogOpened, true);
-});
-testVim('ex_map_ex2key:', function(cm, vim, helpers) {
-  helpers.doEx('map :del x');
-  helpers.doEx('del');
-  helpers.assertCursorAt(0, 0);
-  eq('bc', cm.getValue());
-}, { value: 'abc' });
-testVim('ex_map_ex2ex', function(cm, vim, helpers) {
-  helpers.doEx('map :del :w');
-  var tmp = CodeMirror.commands.save;
-  var written = false;
-  var actualCm;
-  CodeMirror.commands.save = function(cm) {
-    written = true;
-    actualCm = cm;
-  };
-  helpers.doEx('del');
-  CodeMirror.commands.save = tmp;
-  eq(written, true);
-  eq(actualCm, cm);
-});
-testVim('ex_map_key2ex', function(cm, vim, helpers) {
-  helpers.doEx('map a :w');
-  var tmp = CodeMirror.commands.save;
-  var written = false;
-  var actualCm;
-  CodeMirror.commands.save = function(cm) {
-    written = true;
-    actualCm = cm;
-  };
-  helpers.doKeys('a');
-  CodeMirror.commands.save = tmp;
-  eq(written, true);
-  eq(actualCm, cm);
-});
-testVim('ex_map_key2key_visual_api', function(cm, vim, helpers) {
-  CodeMirror.Vim.map('b', ':w', 'visual');
-  var tmp = CodeMirror.commands.save;
-  var written = false;
-  var actualCm;
-  CodeMirror.commands.save = function(cm) {
-    written = true;
-    actualCm = cm;
-  };
-  // Mapping should not work in normal mode.
-  helpers.doKeys('b');
-  eq(written, false);
-  // Mapping should work in visual mode.
-  helpers.doKeys('v', 'b');
-  eq(written, true);
-  eq(actualCm, cm);
-
-  CodeMirror.commands.save = tmp;
-});
-testVim('ex_imap', function(cm, vim, helpers) {
-  CodeMirror.Vim.map('jk', '<Esc>', 'insert');
-  helpers.doKeys('i');
-  is(vim.insertMode);
-  helpers.doKeys('j', 'k');
-  is(!vim.insertMode);
-  cm.setCursor(0, 1);
-  CodeMirror.Vim.map('jj', '<Esc>', 'insert');
-  helpers.doKeys('<C-v>', '2', 'j', 'l', 'c');
-  var replacement = fillArray('fo', 3);
-  cm.replaceSelections(replacement);
-  eq('1fo4\n5fo8\nafodefg', cm.getValue());
-  helpers.doKeys('j', 'j');
-  cm.setCursor(0, 0);
-  helpers.doKeys('.');
-  eq('foo4\nfoo8\nfoodefg', cm.getValue());
-}, { value: '1234\n5678\nabcdefg' });
-testVim('ex_unmap_api', function(cm, vim, helpers) {
-  CodeMirror.Vim.map('<Alt-X>', 'gg', 'normal');
-  is(CodeMirror.Vim.handleKey(cm, "<Alt-X>", "normal"), "Alt-X key is mapped");
-  CodeMirror.Vim.unmap("<Alt-X>", "normal");
-  is(!CodeMirror.Vim.handleKey(cm, "<Alt-X>", "normal"), "Alt-X key is unmapped");
-});
-
-// Testing registration of functions as ex-commands and mapping to <Key>-keys
-testVim('ex_api_test', function(cm, vim, helpers) {
-  var res=false;
-  var val='from';
-  CodeMirror.Vim.defineEx('extest','ext',function(cm,params){
-    if(params.args)val=params.args[0];
-    else res=true;
-  });
-  helpers.doEx(':ext to');
-  eq(val,'to','Defining ex-command failed');
-  CodeMirror.Vim.map('<C-CR><Space>',':ext');
-  helpers.doKeys('<C-CR>','<Space>');
-  is(res,'Mapping to key failed');
-});
-// For now, this test needs to be last because it messes up : for future tests.
-testVim('ex_map_key2key_from_colon', function(cm, vim, helpers) {
-  helpers.doEx('map : x');
-  helpers.doKeys(':');
-  helpers.assertCursorAt(0, 0);
-  eq('bc', cm.getValue());
-}, { value: 'abc' });
-
-// Test event handlers
-testVim('beforeSelectionChange', function(cm, vim, helpers) {
-  cm.setCursor(0, 100);
-  eqCursorPos(cm.getCursor('head'), cm.getCursor('anchor'));
-}, { value: 'abc' });
-
-
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/vim_test.js.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/vim_test.js.xml
deleted file mode 100644
index e34f4d0411b6b2723d2fe7f67edbce0bdfddda76..0000000000000000000000000000000000000000
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/test/vim_test.js.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-<ZopeData>
-  <record id="1" aka="AAAAAAAAAAE=">
-    <pickle>
-      <global name="File" module="OFS.Image"/>
-    </pickle>
-    <pickle>
-      <dictionary>
-        <item>
-            <key> <string>_Cacheable__manager_id</string> </key>
-            <value> <string>http_cache</string> </value>
-        </item>
-        <item>
-            <key> <string>__name__</string> </key>
-            <value> <string>vim_test.js</string> </value>
-        </item>
-        <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>application/javascript</string> </value>
-        </item>
-        <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
-      </dictionary>
-    </pickle>
-  </record>
-</ZopeData>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/3024-day.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/3024-day.css.xml
index 843ada1107bb647ee9d6a7275a83f426b56ad51e..eebdd4324ec0af109179d06e82f78c80dcdaaed5 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/3024-day.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/3024-day.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>3024-day.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/3024-night.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/3024-night.css.xml
index 0491dad55cd1c81ae9e596994fd923b9d4eb101d..aa1d114369d447a942bd9484039d82ae0d0a1001 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/3024-night.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/3024-night.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>3024-night.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/abcdef.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/abcdef.css.css
index 7f9d788704efb12d634a7eefe417e4f30ee4ea4a..cf93530946b49faa4039bc85cf1768ca9b42c516 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/abcdef.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/abcdef.css.css
@@ -14,7 +14,7 @@
 .cm-s-abcdef span.cm-def { color: #fffabc; }
 .cm-s-abcdef span.cm-variable { color: #abcdef; }
 .cm-s-abcdef span.cm-variable-2 { color: #cacbcc; }
-.cm-s-abcdef span.cm-variable-3 { color: #def; }
+.cm-s-abcdef span.cm-variable-3, .cm-s-abcdef span.cm-type { color: #def; }
 .cm-s-abcdef span.cm-property { color: #fedcba; }
 .cm-s-abcdef span.cm-operator { color: #ff0; }
 .cm-s-abcdef span.cm-comment { color: #7a7b7c; font-style: italic;}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/abcdef.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/abcdef.css.xml
index c24ba3c7f212d3dc22ef04d1da18a159fda21651..59cca5d6244ccfaa45562dba7db43525cdfeede1 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/abcdef.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/abcdef.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>abcdef.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance-mobile.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance-mobile.css.xml
index 8d71998d0b9189c8519d94c0797c1cc01a4c7c22..09365ab1dcaf2e8d2b53d8b858c91204753c9ac9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance-mobile.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance-mobile.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>ambiance-mobile.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance.css.css
index bce3446494552b5cf1d643ed7fd7f564334b705e..782fca43f52759db5c6352338375814119859707 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance.css.css
@@ -11,7 +11,7 @@
 .cm-s-ambiance .cm-def { color: #aac6e3; }
 .cm-s-ambiance .cm-variable { color: #ffb795; }
 .cm-s-ambiance .cm-variable-2 { color: #eed1b3; }
-.cm-s-ambiance .cm-variable-3 { color: #faded3; }
+.cm-s-ambiance .cm-variable-3, .cm-s-ambiance .cm-type { color: #faded3; }
 .cm-s-ambiance .cm-property { color: #eed1b3; }
 .cm-s-ambiance .cm-operator { color: #fa8d6a; }
 .cm-s-ambiance .cm-comment { color: #555; font-style:italic; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance.css.xml
index 4af869588bf0b36a473967439941ec26492631a5..5f3525218a1e6fb48e19fd9045c2f0d2a8b9c0b9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ambiance.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>ambiance.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/base16-dark.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/base16-dark.css.xml
index 6edfab71d5825bcc23760ea4416b4be2418a0914..5d48b9bf0726a48c9da22a82b8da00f124f8e868 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/base16-dark.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/base16-dark.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>base16-dark.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/base16-light.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/base16-light.css.xml
index 22d819e117a911427dee5b16cbab63be1d71f822..09971ee1cf134f59d9d2ae9a0daa8b5c91b3b238 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/base16-light.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/base16-light.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>base16-light.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/bespin.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/bespin.css.xml
index 79c0ff63f4a34f9279c466c24ed92b1fcf178a23..9ea1b409b536a3eb5ac669132f59cd67d58e10bf 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/bespin.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/bespin.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>bespin.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/blackboard.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/blackboard.css.xml
index 36c2bc34169b476036f35bf99ff1c1369fd1804a..6c2b140047bd944e811ef7b19d8685a63399a392 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/blackboard.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/blackboard.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>blackboard.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/cobalt.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/cobalt.css.css
index d88223ed8007aacf906014d02d9461cafd6c7fb2..bbbda3b54382afdf7b0cad665dde50720cb26d07 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/cobalt.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/cobalt.css.css
@@ -15,7 +15,7 @@
 .cm-s-cobalt span.cm-string { color: #3ad900; }
 .cm-s-cobalt span.cm-meta { color: #ff9d00; }
 .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; }
-.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; }
+.cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def, .cm-s-cobalt .cm-type { color: white; }
 .cm-s-cobalt span.cm-bracket { color: #d8d8d8; }
 .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; }
 .cm-s-cobalt span.cm-link { color: #845dc4; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/cobalt.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/cobalt.css.xml
index 760f2275bfae9c387931b298c1091ad15087ab00..a6fb254bd3712f459dea28b06221c19d3c120548 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/cobalt.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/cobalt.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>cobalt.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/colorforth.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/colorforth.css.css
index 606899f3097261c3bc1a0bbb4fcd293bb3176770..19095e41d98cc16de9436a75117e4eac50e04ca3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/colorforth.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/colorforth.css.css
@@ -15,7 +15,7 @@
 .cm-s-colorforth span.cm-atom        { color: #606060; }
 
 .cm-s-colorforth span.cm-variable-2  { color: #EEE; }
-.cm-s-colorforth span.cm-variable-3  { color: #DDD; }
+.cm-s-colorforth span.cm-variable-3, .cm-s-colorforth span.cm-type { color: #DDD; }
 .cm-s-colorforth span.cm-property    {}
 .cm-s-colorforth span.cm-operator    {}
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/colorforth.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/colorforth.css.xml
index 5a72d73ecb62c8233f3c0be1f594e29fc0d109f3..7e7963daf8492ed65244819c28def5f62b6ae048 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/colorforth.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/colorforth.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>colorforth.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/dracula.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/dracula.css.css
index 53a660b5219b9f477a1d4e6cabe1c63a5a00054c..253133efe7929edcdb55b6f37e549df3944e42e9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/dracula.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/dracula.css.css
@@ -34,7 +34,7 @@
 .cm-s-dracula span.cm-qualifier { color: #50fa7b; }
 .cm-s-dracula span.cm-property { color: #66d9ef; }
 .cm-s-dracula span.cm-builtin { color: #50fa7b; }
-.cm-s-dracula span.cm-variable-3 { color: #ffb86c; }
+.cm-s-dracula span.cm-variable-3, .cm-s-dracula span.cm-type { color: #ffb86c; }
 
 .cm-s-dracula .CodeMirror-activeline-background { background: rgba(255,255,255,0.1); }
 .cm-s-dracula .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/dracula.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/dracula.css.xml
index 662b1bee05d338deb1898b4d7b990c05e2d97902..88cb8fe50bbd5406720987af1acbe6162d515ee7 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/dracula.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/dracula.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>dracula.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-dark.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-dark.css.css
index b09a585c97867305d9ea1e7fc9deb069cb2c46a7..88fdc76c8ea8e80a1cb3aadfb86e67ab9d104958 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-dark.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-dark.css.css
@@ -24,7 +24,7 @@ CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bra
 .cm-s-duotone-dark span.cm-operator { color: #ffad5c; }
 .cm-s-duotone-dark span.cm-positive { color: #6a51e6; }
 
-.cm-s-duotone-dark span.cm-variable-2, .cm-s-duotone-dark span.cm-variable-3, .cm-s-duotone-dark span.cm-string-2, .cm-s-duotone-dark span.cm-url { color: #7a63ee; }
+.cm-s-duotone-dark span.cm-variable-2, .cm-s-duotone-dark span.cm-variable-3, .cm-s-duotone-dark span.cm-type, .cm-s-duotone-dark span.cm-string-2, .cm-s-duotone-dark span.cm-url { color: #7a63ee; }
 .cm-s-duotone-dark span.cm-def, .cm-s-duotone-dark span.cm-tag, .cm-s-duotone-dark span.cm-builtin, .cm-s-duotone-dark span.cm-qualifier, .cm-s-duotone-dark span.cm-header, .cm-s-duotone-dark span.cm-em { color: #eeebff; }
 .cm-s-duotone-dark span.cm-bracket, .cm-s-duotone-dark span.cm-comment { color: #6c6783; }
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-dark.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-dark.css.xml
index 5eece1d112c1f50238bba492701607ebf75f2d91..a14d935bbb98002c90b04f16bb7ed731f7f03bea 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-dark.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-dark.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>duotone-dark.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-light.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-light.css.css
index 80203d15d9a6f62684fdc6a1eba0c6e666de2599..d99480f7c429e811aef606f2b7ab12455ece70e9 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-light.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-light.css.css
@@ -23,7 +23,7 @@ CodeMirror template by Jan T. Sott (https://github.com/idleberg), adapted by Bra
 .cm-s-duotone-light span.cm-string, .cm-s-duotone-light span.cm-operator { color: #1659df; }
 .cm-s-duotone-light span.cm-positive { color: #896724; }
 
-.cm-s-duotone-light span.cm-variable-2, .cm-s-duotone-light span.cm-variable-3, .cm-s-duotone-light span.cm-string-2, .cm-s-duotone-light span.cm-url { color: #896724; }
+.cm-s-duotone-light span.cm-variable-2, .cm-s-duotone-light span.cm-variable-3, .cm-s-duotone-light span.cm-type, .cm-s-duotone-light span.cm-string-2, .cm-s-duotone-light span.cm-url { color: #896724; }
 .cm-s-duotone-light span.cm-def, .cm-s-duotone-light span.cm-tag, .cm-s-duotone-light span.cm-builtin, .cm-s-duotone-light span.cm-qualifier, .cm-s-duotone-light span.cm-header, .cm-s-duotone-light span.cm-em { color: #2d2006; }
 .cm-s-duotone-light span.cm-bracket, .cm-s-duotone-light span.cm-comment { color: #b6ad9a; }
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-light.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-light.css.xml
index 885004296b32cfb055566bd10613e490f2f76a83..f2016128009004cf0e77e5e64dfbd911b18df625 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-light.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/duotone-light.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>duotone-light.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/eclipse.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/eclipse.css.css
index 1bde460e90c737ad3887827877996c855aa55b9e..800d603f6d4fc66970951f303a03914aab974d93 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/eclipse.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/eclipse.css.css
@@ -5,7 +5,7 @@
 .cm-s-eclipse span.cm-def { color: #00f; }
 .cm-s-eclipse span.cm-variable { color: black; }
 .cm-s-eclipse span.cm-variable-2 { color: #0000C0; }
-.cm-s-eclipse span.cm-variable-3 { color: #0000C0; }
+.cm-s-eclipse span.cm-variable-3, .cm-s-eclipse span.cm-type { color: #0000C0; }
 .cm-s-eclipse span.cm-property { color: black; }
 .cm-s-eclipse span.cm-operator { color: black; }
 .cm-s-eclipse span.cm-comment { color: #3F7F5F; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/eclipse.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/eclipse.css.xml
index e1f4aa2aaebc908bc0e8d6143b17596c664ca7df..58419eecf73298d4b9a9ba9a1e8585dfb1feec76 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/eclipse.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/eclipse.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>eclipse.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/elegant.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/elegant.css.xml
index 7fcf5b0e56d5eccd79a75307552cf0f7bd3d8ee0..b6ed548e2b75cabdec415016cac14897d2340a65 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/elegant.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/elegant.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>elegant.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/erlang-dark.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/erlang-dark.css.css
index 65fe4814c15d5002bc52138f0881144b50b1c290..8c8a4171a6079d22f412a057ffa5e986f51d9004 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/erlang-dark.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/erlang-dark.css.css
@@ -27,7 +27,7 @@
 .cm-s-erlang-dark span.cm-tag        { color: #9effff; }
 .cm-s-erlang-dark span.cm-variable   { color: #50fe50; }
 .cm-s-erlang-dark span.cm-variable-2 { color: #e0e; }
-.cm-s-erlang-dark span.cm-variable-3 { color: #ccc; }
+.cm-s-erlang-dark span.cm-variable-3, .cm-s-erlang-dark span.cm-type { color: #ccc; }
 .cm-s-erlang-dark span.cm-error      { color: #9d1e15; }
 
 .cm-s-erlang-dark .CodeMirror-activeline-background { background: #013461; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/erlang-dark.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/erlang-dark.css.xml
index bfe2d6dfeccef6fda0d1e1e77db00dea87a3403a..6dbf54e00af57b48693b3e593bce286a846c3cfd 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/erlang-dark.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/erlang-dark.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>erlang-dark.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/hopscotch.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/hopscotch.css.xml
index 2a6f063da66739cabade7376bf6d42243051b29f..2490819733c8f38e36f13bcc5635817d8264ce81 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/hopscotch.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/hopscotch.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>hopscotch.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/icecoder.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/icecoder.css.css
index ffebaf2f0b951908c7505415b30ece7d7ec43f93..5440fbe27c85c0c8af46d19c25d44b6be5fd560e 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/icecoder.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/icecoder.css.css
@@ -11,7 +11,7 @@ ICEcoder default theme by Matt Pass, used in code editor available at https://ic
 
 .cm-s-icecoder span.cm-variable { color: #6cb5d9; }                /* blue */
 .cm-s-icecoder span.cm-variable-2 { color: #cc1e5c; }              /* pink */
-.cm-s-icecoder span.cm-variable-3 { color: #f9602c; }              /* orange */
+.cm-s-icecoder span.cm-variable-3, .cm-s-icecoder span.cm-type { color: #f9602c; } /* orange */
 
 .cm-s-icecoder span.cm-property { color: #eee; }                   /* off-white 1 */
 .cm-s-icecoder span.cm-operator { color: #9179bb; }                /* purple */
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/icecoder.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/icecoder.css.xml
index f6f75fe2f411b579700a3e5e1707eb879a84fbed..cdff1ce56f2186f31f0d1782323ac89ae16541b5 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/icecoder.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/icecoder.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>icecoder.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/isotope.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/isotope.css.xml
index 6dff572704583d55e48fd04f9867ca813e7fcdb2..9e5e5c3393305943239c4b895afccb4689e9e872 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/isotope.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/isotope.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>isotope.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lesser-dark.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lesser-dark.css.css
index 690c183d7b44514b8ec384a89979a72ef18bbed2..b2ec418fdbc4ce2856de7049f26c4a38a6a34690 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lesser-dark.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lesser-dark.css.css
@@ -27,7 +27,7 @@ Ported to CodeMirror by Peter Kroon
 .cm-s-lesser-dark span.cm-def { color: white; }
 .cm-s-lesser-dark span.cm-variable { color:#D9BF8C; }
 .cm-s-lesser-dark span.cm-variable-2 { color: #669199; }
-.cm-s-lesser-dark span.cm-variable-3 { color: white; }
+.cm-s-lesser-dark span.cm-variable-3, .cm-s-lesser-dark span.cm-type { color: white; }
 .cm-s-lesser-dark span.cm-property { color: #92A75C; }
 .cm-s-lesser-dark span.cm-operator { color: #92A75C; }
 .cm-s-lesser-dark span.cm-comment { color: #666; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lesser-dark.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lesser-dark.css.xml
index 2ac95e44613b8520d3dc5c535f8c80ad473d801a..2c948ae3973e369b4b68aa057cf0c5c4a520afbb 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lesser-dark.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lesser-dark.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>lesser-dark.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/liquibyte.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/liquibyte.css.css
index 9db8bde739e168e467e246234471ecce868ef608..393825e0296a36d6975ab512498263014c9cf084 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/liquibyte.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/liquibyte.css.css
@@ -36,7 +36,7 @@
 .cm-s-liquibyte span.cm-atom        { color: #bf3030; font-weight: bold; }
 
 .cm-s-liquibyte span.cm-variable-2  { color: #007f7f; font-weight: bold; }
-.cm-s-liquibyte span.cm-variable-3  { color: #c080ff; font-weight: bold; }
+.cm-s-liquibyte span.cm-variable-3, .cm-s-liquibyte span.cm-type { color: #c080ff; font-weight: bold; }
 .cm-s-liquibyte span.cm-property    { color: #999; font-weight: bold; }
 .cm-s-liquibyte span.cm-operator    { color: #fff; }
 
@@ -59,10 +59,10 @@
 .CodeMirror-matchingtag { background-color: rgba(150, 255, 0, .3); }
 /* Scrollbars */
 /* Simple */
-.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover, div.CodeMirror-simplescroll-vertical div:hover {
+.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div:hover, .cm-s-liquibyte div.CodeMirror-simplescroll-vertical div:hover {
 	background-color: rgba(80, 80, 80, .7);
 }
-.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div, div.CodeMirror-simplescroll-vertical div {
+.cm-s-liquibyte div.CodeMirror-simplescroll-horizontal div, .cm-s-liquibyte div.CodeMirror-simplescroll-vertical div {
 	background-color: rgba(80, 80, 80, .3);
 	border: 1px solid #404040;
 	border-radius: 5px;
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/liquibyte.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/liquibyte.css.xml
index 916d5f51c4e5e0e82e816c9524f8acd40dc9d3d2..1c8eaf47f1dadec68aad0fdd85a1544305e4ee84 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/liquibyte.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/liquibyte.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>liquibyte.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lucario.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lucario.css.css
new file mode 100644
index 0000000000000000000000000000000000000000..17a1551032f9f254f22ca03f7179ef89e94ed4c6
--- /dev/null
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lucario.css.css
@@ -0,0 +1,37 @@
+/*
+  Name:       lucario
+  Author:     Raphael Amorim
+
+  Original Lucario color scheme (https://github.com/raphamorim/lucario)
+*/
+
+.cm-s-lucario.CodeMirror, .cm-s-lucario .CodeMirror-gutters {
+  background-color: #2b3e50 !important;
+  color: #f8f8f2 !important;
+  border: none;
+}
+.cm-s-lucario .CodeMirror-gutters { color: #2b3e50; }
+.cm-s-lucario .CodeMirror-cursor { border-left: solid thin #E6C845; }
+.cm-s-lucario .CodeMirror-linenumber { color: #f8f8f2; }
+.cm-s-lucario .CodeMirror-selected { background: #243443; }
+.cm-s-lucario .CodeMirror-line::selection, .cm-s-lucario .CodeMirror-line > span::selection, .cm-s-lucario .CodeMirror-line > span > span::selection { background: #243443; }
+.cm-s-lucario .CodeMirror-line::-moz-selection, .cm-s-lucario .CodeMirror-line > span::-moz-selection, .cm-s-lucario .CodeMirror-line > span > span::-moz-selection { background: #243443; }
+.cm-s-lucario span.cm-comment { color: #5c98cd; }
+.cm-s-lucario span.cm-string, .cm-s-lucario span.cm-string-2 { color: #E6DB74; }
+.cm-s-lucario span.cm-number { color: #ca94ff; }
+.cm-s-lucario span.cm-variable { color: #f8f8f2; }
+.cm-s-lucario span.cm-variable-2 { color: #f8f8f2; }
+.cm-s-lucario span.cm-def { color: #72C05D; }
+.cm-s-lucario span.cm-operator { color: #66D9EF; }
+.cm-s-lucario span.cm-keyword { color: #ff6541; }
+.cm-s-lucario span.cm-atom { color: #bd93f9; }
+.cm-s-lucario span.cm-meta { color: #f8f8f2; }
+.cm-s-lucario span.cm-tag { color: #ff6541; }
+.cm-s-lucario span.cm-attribute { color: #66D9EF; }
+.cm-s-lucario span.cm-qualifier { color: #72C05D; }
+.cm-s-lucario span.cm-property { color: #f8f8f2; }
+.cm-s-lucario span.cm-builtin { color: #72C05D; }
+.cm-s-lucario span.cm-variable-3, .cm-s-lucario span.cm-type { color: #ffb86c; }
+
+.cm-s-lucario .CodeMirror-activeline-background { background: #243443; }
+.cm-s-lucario .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closebrackets.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lucario.css.xml
similarity index 71%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closebrackets.html.xml
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lucario.css.xml
index b575ce225b65158ccdf775625e205f35b65613a7..f86df9e4623916815371fc53f5e5411d2477f38c 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/closebrackets.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/lucario.css.xml
@@ -2,13 +2,17 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
+        <item>
+            <key> <string>_Cacheable__manager_id</string> </key>
+            <value> <string>http_cache</string> </value>
+        </item>
         <item>
             <key> <string>__name__</string> </key>
-            <value> <string>closebrackets.html</string> </value>
+            <value> <string>lucario.css</string> </value>
         </item>
         <item>
             <key> <string>_vars</string> </key>
@@ -22,10 +26,6 @@
               <dictionary/>
             </value>
         </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
       </dictionary>
     </pickle>
   </record>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/material.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/material.css.css
index 01d867932a137e2c322e57ba06e5c8fe09b9528b..84962a244b71f9eeb938fb9a48e737e220a9b9b6 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/material.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/material.css.css
@@ -27,7 +27,7 @@
 .cm-s-material .cm-keyword { color: rgba(199, 146, 234, 1); }
 .cm-s-material .cm-operator { color: rgba(233, 237, 237, 1); }
 .cm-s-material .cm-variable-2 { color: #80CBC4; }
-.cm-s-material .cm-variable-3 { color: #82B1FF; }
+.cm-s-material .cm-variable-3, .cm-s-material .cm-type { color: #82B1FF; }
 .cm-s-material .cm-builtin { color: #DECB6B; }
 .cm-s-material .cm-atom { color: #F77669; }
 .cm-s-material .cm-number { color: #F77669; }
@@ -41,7 +41,7 @@
 .cm-s-material .cm-attribute { color: #FFCB6B; }
 .cm-s-material .cm-property { color: #80CBAE; }
 .cm-s-material .cm-qualifier { color: #DECB6B; }
-.cm-s-material .cm-variable-3 { color: #DECB6B; }
+.cm-s-material .cm-variable-3, .cm-s-material .cm-type { color: #DECB6B; }
 .cm-s-material .cm-tag { color: rgba(255, 83, 112, 1); }
 .cm-s-material .cm-error {
   color: rgba(255, 255, 255, 1.0);
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/material.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/material.css.xml
index e2aa9fc88b29ccab760978ec64b8eb96e74a66d5..159156aee247a28a76b5381f6b8e7a5700591e20 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/material.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/material.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>material.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mbo.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mbo.css.xml
index 229c4ef045436211bea51eaaf6b1b722a1adf292..06880217420ce09906076dd2b1ab84a0c2bfd807 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mbo.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mbo.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>mbo.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mdn-like.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mdn-like.css.css
index f325d45005a9920ad0ec61c9e1e05b88a70f9854..622ed3efb74f1bac5c88ef9e624094f105806601 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mdn-like.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mdn-like.css.css
@@ -21,7 +21,7 @@
 .cm-s-mdn-like .cm-number { color:  #ca7841; }
 .cm-s-mdn-like .cm-def { color: #8DA6CE; }
 .cm-s-mdn-like span.cm-variable-2, .cm-s-mdn-like span.cm-tag { color: #690; }
-.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def { color: #07a; }
+.cm-s-mdn-like span.cm-variable-3, .cm-s-mdn-like span.cm-def, .cm-s-mdn-like span.cm-type { color: #07a; }
 
 .cm-s-mdn-like .cm-variable { color: #07a; }
 .cm-s-mdn-like .cm-property { color: #905; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mdn-like.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mdn-like.css.xml
index 51582c7b9c20e8c91b13866d72e132cc9e8d4506..22230105ec4f64c0fb7ba1f510942e837de46990 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mdn-like.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/mdn-like.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>mdn-like.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/midnight.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/midnight.css.css
index e41f10560fe69f254a49b33d9a691500486e4120..17ed39c8bc6fe880ef0c9a05f0369a9220c71364 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/midnight.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/midnight.css.css
@@ -12,8 +12,6 @@
     color: #D1EDFF;
 }
 
-.cm-s-midnight.CodeMirror { border-top: 1px solid black; border-bottom: 1px solid black; }
-
 .cm-s-midnight div.CodeMirror-selected { background: #314D67; }
 .cm-s-midnight .CodeMirror-line::selection, .cm-s-midnight .CodeMirror-line > span::selection, .cm-s-midnight .CodeMirror-line > span > span::selection { background: rgba(49, 77, 103, .99); }
 .cm-s-midnight .CodeMirror-line::-moz-selection, .cm-s-midnight .CodeMirror-line > span::-moz-selection, .cm-s-midnight .CodeMirror-line > span > span::-moz-selection { background: rgba(49, 77, 103, .99); }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/midnight.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/midnight.css.xml
index 4996ce233cf20c694cf8ce046dae1d0ca7a6f565..7f7ee254a6b48437be99f71116818ed1e22c0c42 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/midnight.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/midnight.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>midnight.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/monokai.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/monokai.css.css
index 7c8a4c5d0011624279ecb395a533f67b4a165161..b5edd13fe68af236ff92a19ac928664a62d3c3ca 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/monokai.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/monokai.css.css
@@ -21,7 +21,7 @@
 
 .cm-s-monokai span.cm-variable { color: #f8f8f2; }
 .cm-s-monokai span.cm-variable-2 { color: #9effff; }
-.cm-s-monokai span.cm-variable-3 { color: #66d9ef; }
+.cm-s-monokai span.cm-variable-3, .cm-s-monokai span.cm-type { color: #66d9ef; }
 .cm-s-monokai span.cm-def { color: #fd971f; }
 .cm-s-monokai span.cm-bracket { color: #f8f8f2; }
 .cm-s-monokai span.cm-tag { color: #f92672; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/monokai.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/monokai.css.xml
index cd90bcbdedb3cf764564eb5b10a44ecede546232..5b3f551d3736a42f30529f08150f2a9b44608c88 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/monokai.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/monokai.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>monokai.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/neat.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/neat.css.xml
index c076e1597345129c3c778c3ff3f4d1356e103d6c..449ee8b241fce175037175279934b2da08a43102 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/neat.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/neat.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>neat.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/neo.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/neo.css.xml
index c69010d85bff91bc97e6e893849651fd079e2402..0c0dec7eef50cb61d46bac972d2a3021182e7e91 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/neo.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/neo.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>neo.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/night.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/night.css.css
index fd4e5619337e57368e42c3864ccb738c01ebc2fc..f631bf42c748d189c37abb3670dc19bbe7f877ed 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/night.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/night.css.css
@@ -17,7 +17,7 @@
 .cm-s-night span.cm-string { color: #37f14a; }
 .cm-s-night span.cm-meta { color: #7678e2; }
 .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; }
-.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; }
+.cm-s-night span.cm-variable-3, .cm-s-night span.cm-def, .cm-s-night span.cm-type { color: white; }
 .cm-s-night span.cm-bracket { color: #8da6ce; }
 .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; }
 .cm-s-night span.cm-link { color: #845dc4; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/night.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/night.css.xml
index faa52b273602db292a8bf4219c426c774ae35418..a435c529257d9b216fe50ec9b3b342e1c2f2e035 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/night.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/night.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>night.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/oceanic-next.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/oceanic-next.css.css
new file mode 100644
index 0000000000000000000000000000000000000000..296277ba04a45c499164c5f33857cfe0eecdf38f
--- /dev/null
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/oceanic-next.css.css
@@ -0,0 +1,44 @@
+/*
+
+    Name:       oceanic-next
+    Author:     Filype Pereira (https://github.com/fpereira1)
+
+    Original oceanic-next color scheme by Dmitri Voronianski (https://github.com/voronianski/oceanic-next-color-scheme)
+
+*/
+
+.cm-s-oceanic-next.CodeMirror { background: #304148; color: #f8f8f2; }
+.cm-s-oceanic-next div.CodeMirror-selected { background: rgba(101, 115, 126, 0.33); }
+.cm-s-oceanic-next .CodeMirror-line::selection, .cm-s-oceanic-next .CodeMirror-line > span::selection, .cm-s-oceanic-next .CodeMirror-line > span > span::selection { background: rgba(101, 115, 126, 0.33); }
+.cm-s-oceanic-next .CodeMirror-line::-moz-selection, .cm-s-oceanic-next .CodeMirror-line > span::-moz-selection, .cm-s-oceanic-next .CodeMirror-line > span > span::-moz-selection { background: rgba(101, 115, 126, 0.33); }
+.cm-s-oceanic-next .CodeMirror-gutters { background: #304148; border-right: 10px; }
+.cm-s-oceanic-next .CodeMirror-guttermarker { color: white; }
+.cm-s-oceanic-next .CodeMirror-guttermarker-subtle { color: #d0d0d0; }
+.cm-s-oceanic-next .CodeMirror-linenumber { color: #d0d0d0; }
+.cm-s-oceanic-next .CodeMirror-cursor { border-left: 1px solid #f8f8f0; }
+
+.cm-s-oceanic-next span.cm-comment { color: #65737E; }
+.cm-s-oceanic-next span.cm-atom { color: #C594C5; }
+.cm-s-oceanic-next span.cm-number { color: #F99157; }
+
+.cm-s-oceanic-next span.cm-property { color: #99C794; }
+.cm-s-oceanic-next span.cm-attribute,
+.cm-s-oceanic-next span.cm-keyword { color: #C594C5; }
+.cm-s-oceanic-next span.cm-builtin { color: #66d9ef; }
+.cm-s-oceanic-next span.cm-string { color: #99C794; }
+
+.cm-s-oceanic-next span.cm-variable,
+.cm-s-oceanic-next span.cm-variable-2,
+.cm-s-oceanic-next span.cm-variable-3 { color: #f8f8f2; }
+.cm-s-oceanic-next span.cm-def { color: #6699CC; }
+.cm-s-oceanic-next span.cm-bracket { color: #5FB3B3; }
+.cm-s-oceanic-next span.cm-tag { color: #C594C5; }
+.cm-s-oceanic-next span.cm-header { color: #C594C5; }
+.cm-s-oceanic-next span.cm-link { color: #C594C5; }
+.cm-s-oceanic-next span.cm-error { background: #C594C5; color: #f8f8f0; }
+
+.cm-s-oceanic-next .CodeMirror-activeline-background { background: rgba(101, 115, 126, 0.33); }
+.cm-s-oceanic-next .CodeMirror-matchingbracket {
+  text-decoration: underline;
+  color: white !important;
+}
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/markselection.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/oceanic-next.css.xml
similarity index 71%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/markselection.html.xml
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/oceanic-next.css.xml
index eaaf1a21a3f011baa7f4fab1c297e4aac79d22b9..d7a8f9c5d8d8f75287bca173acea86381824d673 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/markselection.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/oceanic-next.css.xml
@@ -2,13 +2,17 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
+        <item>
+            <key> <string>_Cacheable__manager_id</string> </key>
+            <value> <string>http_cache</string> </value>
+        </item>
         <item>
             <key> <string>__name__</string> </key>
-            <value> <string>markselection.html</string> </value>
+            <value> <string>oceanic-next.css</string> </value>
         </item>
         <item>
             <key> <string>_vars</string> </key>
@@ -22,10 +26,6 @@
               <dictionary/>
             </value>
         </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
       </dictionary>
     </pickle>
   </record>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/panda-syntax.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/panda-syntax.css.css
index c93b2ea03a76e0d2932cb08d243e5cde3e884593..6de58b56f46cf0bfdab1c04992c36cb2785e00e4 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/panda-syntax.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/panda-syntax.css.css
@@ -52,7 +52,7 @@
 .cm-s-panda-syntax .cm-variable-2 {
 	color: #ff9ac1;
 }
-.cm-s-panda-syntax .cm-variable-3 {
+.cm-s-panda-syntax .cm-variable-3, .cm-s-panda-syntax .cm-type {
 	color: #ff9ac1;
 }
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/panda-syntax.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/panda-syntax.css.xml
index 7eaf298761537bd7180252389dd55c2ba5e05b45..433833c2b25770b80339b7e48b9e0b6d13ef3157 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/panda-syntax.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/panda-syntax.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>panda-syntax.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/paraiso-dark.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/paraiso-dark.css.xml
index 91d6b9d1baf0e0d2f0949ce91fbc0d5a68d25030..4d00d806f709a165c68a713e3dd27fce6acd6d34 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/paraiso-dark.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/paraiso-dark.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>paraiso-dark.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/paraiso-light.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/paraiso-light.css.xml
index 5b3e0084ce80408f29b0c987c083129772b7203e..cfb1c5546f2e289a0b7758f252ae68f51bbff9b3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/paraiso-light.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/paraiso-light.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>paraiso-light.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/pastel-on-dark.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/pastel-on-dark.css.css
index 2603d36205a2f9c3e37f234194bfb6117d2c9cd5..60435dd15e635114c914329852c80724afdfd059 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/pastel-on-dark.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/pastel-on-dark.css.css
@@ -34,7 +34,7 @@
 .cm-s-pastel-on-dark span.cm-string { color: #66A968; }
 .cm-s-pastel-on-dark span.cm-variable { color: #AEB2F8; }
 .cm-s-pastel-on-dark span.cm-variable-2 { color: #BEBF55; }
-.cm-s-pastel-on-dark span.cm-variable-3 { color: #DE8E30; }
+.cm-s-pastel-on-dark span.cm-variable-3, .cm-s-pastel-on-dark span.cm-type { color: #DE8E30; }
 .cm-s-pastel-on-dark span.cm-def { color: #757aD8; }
 .cm-s-pastel-on-dark span.cm-bracket { color: #f8f8f2; }
 .cm-s-pastel-on-dark span.cm-tag { color: #C1C144; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/pastel-on-dark.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/pastel-on-dark.css.xml
index ae0aab5a29e5631dcd7a3c72dbcc6d92e62cfed6..015d219c0c67fde84419bad24714c8c4a883f35e 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/pastel-on-dark.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/pastel-on-dark.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>pastel-on-dark.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/railscasts.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/railscasts.css.xml
index d707675968a603868abf9c3de5a68b934c9ccf03..7f7a14dbd120c450609e1cfc34b5b70a999fc17b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/railscasts.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/railscasts.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>railscasts.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/rubyblue.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/rubyblue.css.css
index 76d33e7798fe75e19bda1f1c51f3d61a4eb31b93..1f181b06ec271995f15e4631508e15e984f5343e 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/rubyblue.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/rubyblue.css.css
@@ -15,7 +15,7 @@
 .cm-s-rubyblue span.cm-string { color: #F08047; }
 .cm-s-rubyblue span.cm-meta { color: #F0F; }
 .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; }
-.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; }
+.cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def, .cm-s-rubyblue span.cm-type { color: white; }
 .cm-s-rubyblue span.cm-bracket { color: #F0F; }
 .cm-s-rubyblue span.cm-link { color: #F4C20B; }
 .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/rubyblue.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/rubyblue.css.xml
index 37bc011a69a0065318b3dde1fcf70ddd54b54866..c4db3b0b4bd7f094d70cc49ba7977c8aa41c849c 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/rubyblue.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/rubyblue.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>rubyblue.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/seti.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/seti.css.css
index 6632d3fc7fc48765549a4a741d883000c456a8fd..814f76f7dece86bbade975ad69eeae3d1f101956 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/seti.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/seti.css.css
@@ -38,7 +38,7 @@
 .cm-s-seti span.cm-attribute { color: #9fca56; }
 .cm-s-seti span.cm-qualifier { color: #9fca56; }
 .cm-s-seti span.cm-property { color: #a074c4; }
-.cm-s-seti span.cm-variable-3 { color: #9fca56; }
+.cm-s-seti span.cm-variable-3, .cm-s-seti span.cm-type { color: #9fca56; }
 .cm-s-seti span.cm-builtin { color: #9fca56; }
 .cm-s-seti .CodeMirror-activeline-background { background: #101213; }
 .cm-s-seti .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/seti.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/seti.css.xml
index ebb31d22d8d33a7c476aa923c9a28bb32cff9109..685165fabf5be9338456be5034f4dcf337262d85 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/seti.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/seti.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>seti.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/shadowfox.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/shadowfox.css.css
new file mode 100644
index 0000000000000000000000000000000000000000..32d59b139ac24f306b60da4879004264ad5a6442
--- /dev/null
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/shadowfox.css.css
@@ -0,0 +1,52 @@
+/*
+
+    Name:       shadowfox
+    Author:     overdodactyl (http://github.com/overdodactyl)
+
+    Original shadowfox color scheme by Firefox
+
+*/
+
+.cm-s-shadowfox.CodeMirror { background: #2a2a2e; color: #b1b1b3; }
+.cm-s-shadowfox div.CodeMirror-selected { background: #353B48; }
+.cm-s-shadowfox .CodeMirror-line::selection, .cm-s-shadowfox .CodeMirror-line > span::selection, .cm-s-shadowfox .CodeMirror-line > span > span::selection { background: #353B48; }
+.cm-s-shadowfox .CodeMirror-line::-moz-selection, .cm-s-shadowfox .CodeMirror-line > span::-moz-selection, .cm-s-shadowfox .CodeMirror-line > span > span::-moz-selection { background: #353B48; }
+.cm-s-shadowfox .CodeMirror-gutters { background: #0c0c0d ; border-right: 1px solid #0c0c0d; }
+.cm-s-shadowfox .CodeMirror-guttermarker { color: #555; }
+.cm-s-shadowfox .CodeMirror-linenumber { color: #939393; }
+.cm-s-shadowfox .CodeMirror-cursor { border-left: 1px solid #fff; }
+
+.cm-s-shadowfox span.cm-comment { color: #939393; }
+.cm-s-shadowfox span.cm-atom { color: #FF7DE9; }
+.cm-s-shadowfox span.cm-quote { color: #FF7DE9; }
+.cm-s-shadowfox span.cm-builtin { color: #FF7DE9; }
+.cm-s-shadowfox span.cm-attribute { color: #FF7DE9; }
+.cm-s-shadowfox span.cm-keyword { color: #FF7DE9; }
+.cm-s-shadowfox span.cm-error { color: #FF7DE9; }
+
+.cm-s-shadowfox span.cm-number { color: #6B89FF; }
+.cm-s-shadowfox span.cm-string { color: #6B89FF; }
+.cm-s-shadowfox span.cm-string-2 { color: #6B89FF; }
+
+.cm-s-shadowfox span.cm-meta { color: #939393; }
+.cm-s-shadowfox span.cm-hr { color: #939393; }
+
+.cm-s-shadowfox span.cm-header { color: #75BFFF; }
+.cm-s-shadowfox span.cm-qualifier { color: #75BFFF; }
+.cm-s-shadowfox span.cm-variable-2 { color: #75BFFF; }
+
+.cm-s-shadowfox span.cm-property { color: #86DE74; }
+
+.cm-s-shadowfox span.cm-def { color: #75BFFF; }
+.cm-s-shadowfox span.cm-bracket { color: #75BFFF; }
+.cm-s-shadowfox span.cm-tag { color: #75BFFF; }
+.cm-s-shadowfox span.cm-link:visited { color: #75BFFF; }
+
+.cm-s-shadowfox span.cm-variable { color: #B98EFF; }
+.cm-s-shadowfox span.cm-variable-3 { color: #d7d7db; }
+.cm-s-shadowfox span.cm-link { color: #737373; }
+.cm-s-shadowfox span.cm-operator { color: #b1b1b3; }
+.cm-s-shadowfox span.cm-special { color: #d7d7db; }
+
+.cm-s-shadowfox .CodeMirror-activeline-background { background: rgba(185, 215, 253, .15) }
+.cm-s-shadowfox .CodeMirror-matchingbracket { outline: solid 1px rgba(255, 255, 255, .25); color: white !important; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/html5complete.html.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/shadowfox.css.xml
similarity index 71%
rename from bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/html5complete.html.xml
rename to bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/shadowfox.css.xml
index 64bccc32a051da57d46f753f5d1b8c5b20e85379..49e6c5a39295d5998917a2ac18e557693af43830 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/demo/html5complete.html.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/shadowfox.css.xml
@@ -2,13 +2,17 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="DTMLDocument" module="OFS.DTMLDocument"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
+        <item>
+            <key> <string>_Cacheable__manager_id</string> </key>
+            <value> <string>http_cache</string> </value>
+        </item>
         <item>
             <key> <string>__name__</string> </key>
-            <value> <string>html5complete.html</string> </value>
+            <value> <string>shadowfox.css</string> </value>
         </item>
         <item>
             <key> <string>_vars</string> </key>
@@ -22,10 +26,6 @@
               <dictionary/>
             </value>
         </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
-        </item>
       </dictionary>
     </pickle>
   </record>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/solarized.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/solarized.css.css
index 1f39c7edb21fd4aa130c46206411633ff1b76508..fcd1d70de6a11e5352ba1bea378f3f24b3e4142c 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/solarized.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/solarized.css.css
@@ -57,7 +57,7 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
 
 .cm-s-solarized .cm-variable { color: #839496; }
 .cm-s-solarized .cm-variable-2 { color: #b58900; }
-.cm-s-solarized .cm-variable-3 { color: #6c71c4; }
+.cm-s-solarized .cm-variable-3, .cm-s-solarized .cm-type { color: #6c71c4; }
 
 .cm-s-solarized .cm-property { color: #2aa198; }
 .cm-s-solarized .cm-operator { color: #6c71c4; }
@@ -87,7 +87,6 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png
   text-decoration: underline;
   text-decoration-style: dotted;
 }
-.cm-s-solarized .cm-strong { color: #eee; }
 .cm-s-solarized .cm-error,
 .cm-s-solarized .cm-invalidchar {
   color: #586e75;
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/solarized.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/solarized.css.xml
index 8e0e1ef18515bc6140217ccf3276530e832e6462..44bb8a76b780956357896e826591ca801e798e04 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/solarized.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/solarized.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>solarized.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/the-matrix.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/the-matrix.css.css
index 3912a8dbd85adc2622dadefe0f1b06976ce4132c..c4c93c11eafdbbb32c62666be029ec5a74837607 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/the-matrix.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/the-matrix.css.css
@@ -14,7 +14,7 @@
 .cm-s-the-matrix span.cm-def { color: #99C; }
 .cm-s-the-matrix span.cm-variable { color: #F6C; }
 .cm-s-the-matrix span.cm-variable-2 { color: #C6F; }
-.cm-s-the-matrix span.cm-variable-3 { color: #96F; }
+.cm-s-the-matrix span.cm-variable-3, .cm-s-the-matrix span.cm-type { color: #96F; }
 .cm-s-the-matrix span.cm-property { color: #62FFA0; }
 .cm-s-the-matrix span.cm-operator { color: #999; }
 .cm-s-the-matrix span.cm-comment { color: #CCCCCC; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/the-matrix.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/the-matrix.css.xml
index 9b16d5733e3e6333dcd3c31ff6890983e96e7c70..8b93a15fee6a1af2b134d3ac091429b53a280ff0 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/the-matrix.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/the-matrix.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>the-matrix.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/tomorrow-night-bright.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/tomorrow-night-bright.css.xml
index 9ffec598b50382bd524d774f50a880d28f429bf9..ce2c827318a8350351b668535d8defc5f54901d4 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/tomorrow-night-bright.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/tomorrow-night-bright.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>tomorrow-night-bright.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/tomorrow-night-eighties.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/tomorrow-night-eighties.css.xml
index 3235125dc63b28ff52b84d5e1326b11c533ecc4e..bd42c4d405b1c6d7ff5adeffe7b3a9f04afa869b 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/tomorrow-night-eighties.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/tomorrow-night-eighties.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>tomorrow-night-eighties.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ttcn.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ttcn.css.css
index b3d465645bd5d6d2c2b12b520505ebc53cb849b3..0b14ac35d64f478b643e8d345cd5214ba1ec7bf8 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ttcn.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ttcn.css.css
@@ -29,7 +29,7 @@
 .cm-s-ttcn .cm-tag { color: #170; }
 .cm-s-ttcn .cm-variable { color: #8B2252; }
 .cm-s-ttcn .cm-variable-2 { color: #05a; }
-.cm-s-ttcn .cm-variable-3 { color: #085; }
+.cm-s-ttcn .cm-variable-3, .cm-s-ttcn .cm-type { color: #085; }
 
 .cm-s-ttcn .cm-invalidchar { color: #f00; }
 
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ttcn.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ttcn.css.xml
index 0724db05eb1906419badf59bd58a9c6ab220d8a2..505b03f6ff8c2e574f9bd975393a13e30d7fdd07 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ttcn.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/ttcn.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>ttcn.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/twilight.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/twilight.css.css
index d342b899f6ee0069f661306d9607f15289a7764a..b2b1b2aa93e02e669243eb8eec35d1791f11d3a1 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/twilight.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/twilight.css.css
@@ -14,7 +14,7 @@
 .cm-s-twilight .cm-number { color:  #ca7841; } /**/
 .cm-s-twilight .cm-def { color: #8DA6CE; }
 .cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/
-.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/
+.cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def, .cm-s-twilight span.cm-type { color: #607392; } /**/
 .cm-s-twilight .cm-operator { color: #cda869; } /**/
 .cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/
 .cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/twilight.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/twilight.css.xml
index 6f8889619c784d69c38fc43bb3df09d414cefb23..7b72992c5e8a96e1c2ba3128eff9bb66bdafd829 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/twilight.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/twilight.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>twilight.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/vibrant-ink.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/vibrant-ink.css.css
index ac4ec6d87af286709637406b7721a724cf1bdd10..b13ecf2164bdaf205fe43f062b00a21445537c6e 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/vibrant-ink.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/vibrant-ink.css.css
@@ -16,7 +16,7 @@
 .cm-s-vibrant-ink .cm-number { color:  #FFEE98; }
 .cm-s-vibrant-ink .cm-def { color: #8DA6CE; }
 .cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D; }
-.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D; }
+.cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def, .cm-s-vibrant span.cm-type { color: #FFC66D; }
 .cm-s-vibrant-ink .cm-operator { color: #888; }
 .cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; }
 .cm-s-vibrant-ink .cm-string { color:  #A5C25C; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/vibrant-ink.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/vibrant-ink.css.xml
index fa07006dc92f6823cbd709fa478a7e5148ae682f..17b74ca13770de73c62bf1c55321a645f93192fc 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/vibrant-ink.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/vibrant-ink.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>vibrant-ink.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-dark.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-dark.css.css
index e3bd960bbb72f4722fc5309dab044127cf3c47e7..7da1a0f7053a1458252d43258795c32478139695 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-dark.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-dark.css.css
@@ -36,7 +36,7 @@ THE SOFTWARE.
 .cm-s-xq-dark span.cm-def { color: #FFF; text-decoration:underline; }
 .cm-s-xq-dark span.cm-variable { color: #FFF; }
 .cm-s-xq-dark span.cm-variable-2 { color: #EEE; }
-.cm-s-xq-dark span.cm-variable-3 { color: #DDD; }
+.cm-s-xq-dark span.cm-variable-3, .cm-s-xq-dark span.cm-type { color: #DDD; }
 .cm-s-xq-dark span.cm-property {}
 .cm-s-xq-dark span.cm-operator {}
 .cm-s-xq-dark span.cm-comment { color: gray; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-dark.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-dark.css.xml
index 600f34e705a8aad30a788d747112890f2fcd758f..8cda374ee4e609cb795bd75f05b7947723371687 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-dark.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-dark.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>xq-dark.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-light.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-light.css.css
index 8d2fcb667b69a39d099e8877305bae7dfaf455e3..7b182ea99756bff0cb738dce353278a1bcfa9947 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-light.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-light.css.css
@@ -26,7 +26,7 @@ THE SOFTWARE.
 .cm-s-xq-light span.cm-def { text-decoration:underline; }
 .cm-s-xq-light span.cm-variable { color: black; }
 .cm-s-xq-light span.cm-variable-2 { color:black; }
-.cm-s-xq-light span.cm-variable-3 { color: black; }
+.cm-s-xq-light span.cm-variable-3, .cm-s-xq-light span.cm-type { color: black; }
 .cm-s-xq-light span.cm-property {}
 .cm-s-xq-light span.cm-operator {}
 .cm-s-xq-light span.cm-comment { color: #0080FF; font-style: italic; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-light.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-light.css.xml
index 3b77777c2dd708b508c6cd8b2ecc401de0b3f2bd..4625ebab5b392c6d0cfbb7a0a147840b74711419 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-light.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/xq-light.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>xq-light.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/yeti.css.css b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/yeti.css.css
index c70d4d214e3008736af3ae8b9305fa194b5eb6d5..d085f7249715623f023656aaa7be03ce4d0c24f3 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/yeti.css.css
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/yeti.css.css
@@ -39,6 +39,6 @@
 .cm-s-yeti span.cm-qualifier { color: #96c0d8; }
 .cm-s-yeti span.cm-property { color: #a074c4; }
 .cm-s-yeti span.cm-builtin { color: #a074c4; }
-.cm-s-yeti span.cm-variable-3 { color: #96c0d8; }
+.cm-s-yeti span.cm-variable-3, .cm-s-yeti span.cm-type { color: #96c0d8; }
 .cm-s-yeti .CodeMirror-activeline-background { background: #E7E4E0; }
 .cm-s-yeti .CodeMirror-matchingbracket { text-decoration: underline; }
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/yeti.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/yeti.css.xml
index d51001b44d8d583502b624c3d22a5d7bde21ee99..f9cfcf00fdcd5c5ef52f7ee1308b141651918543 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/yeti.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/yeti.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>yeti.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>
diff --git a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/zenburn.css.xml b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/zenburn.css.xml
index 1a28ef878198ee138b0343c7c50eab9a061d856c..f3009aee53bc0f5f6f48522c2a9a381c43046a4d 100644
--- a/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/zenburn.css.xml
+++ b/bt5/erp5_code_mirror/SkinTemplateItem/portal_skins/erp5_code_mirror/codemirror/theme/zenburn.css.xml
@@ -2,7 +2,7 @@
 <ZopeData>
   <record id="1" aka="AAAAAAAAAAE=">
     <pickle>
-      <global name="File" module="OFS.Image"/>
+      <global name="DTMLMethod" module="OFS.DTMLMethod"/>
     </pickle>
     <pickle>
       <dictionary>
@@ -15,16 +15,16 @@
             <value> <string>zenburn.css</string> </value>
         </item>
         <item>
-            <key> <string>content_type</string> </key>
-            <value> <string>text/css</string> </value>
+            <key> <string>_vars</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
         <item>
-            <key> <string>precondition</string> </key>
-            <value> <string></string> </value>
-        </item>
-        <item>
-            <key> <string>title</string> </key>
-            <value> <string></string> </value>
+            <key> <string>globals</string> </key>
+            <value>
+              <dictionary/>
+            </value>
         </item>
       </dictionary>
     </pickle>