Commit d7c4f478 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_code_mirror] Update to codemirror 5.24.2

parent a7ffbc92
...@@ -9,11 +9,14 @@ Adam King ...@@ -9,11 +9,14 @@ Adam King
adanlobato adanlobato
Adán Lobato Adán Lobato
Adrian Aichner Adrian Aichner
Adrian Heine
Adrien Bertrand
aeroson aeroson
Ahmad Amireh Ahmad Amireh
Ahmad M. Zawawi Ahmad M. Zawawi
ahoward ahoward
Akeksandr Motsjonov Akeksandr Motsjonov
Alasdair Smith
Alberto González Palomo Alberto González Palomo
Alberto Pose Alberto Pose
Albert Xing Albert Xing
...@@ -42,9 +45,11 @@ Andrea G ...@@ -42,9 +45,11 @@ Andrea G
Andreas Reischuck Andreas Reischuck
Andres Taylor Andres Taylor
Andre von Houck Andre von Houck
Andrew Cheng
Andrey Fedorov Andrey Fedorov
Andrey Klyuchnikov Andrey Klyuchnikov
Andrey Lushnikov Andrey Lushnikov
Andrey Shchekin
Andy Joslin Andy Joslin
Andy Kimball Andy Kimball
Andy Li Andy Li
...@@ -59,10 +64,13 @@ anthonygego ...@@ -59,10 +64,13 @@ anthonygego
Anthony Gégo Anthony Gégo
Anthony Grimes Anthony Grimes
Anton Kovalyov Anton Kovalyov
Apollo Zhu
AQNOUCH Mohammed AQNOUCH Mohammed
areos areos
Arnab Bose Arnab Bose
Arthur Müller
as3boyan as3boyan
atelierbram
AtomicPages LLC AtomicPages LLC
Atul Bhouraskar Atul Bhouraskar
Aurelian Oancea Aurelian Oancea
...@@ -75,9 +83,12 @@ benbro ...@@ -75,9 +83,12 @@ benbro
Beni Cherniavsky-Paskin Beni Cherniavsky-Paskin
Benjamin DeCoste Benjamin DeCoste
Ben Keen Ben Keen
Ben Miller
Ben Mosher Ben Mosher
Bernhard Sirlinger Bernhard Sirlinger
Bert Chang Bert Chang
Bharad
BigBlueHat
Billy Moon Billy Moon
binny binny
B Krishna Chaitanya B Krishna Chaitanya
...@@ -92,8 +103,11 @@ Brett Zamir ...@@ -92,8 +103,11 @@ Brett Zamir
Brian Grinstead Brian Grinstead
Brian Sletten Brian Sletten
Bruce Mitchener Bruce Mitchener
Bryan Massoth
Caitlin Potter Caitlin Potter
Calin Barbat Calin Barbat
callodacity
Camilo Roca
Chad Jolly Chad Jolly
Chandra Sekhar Pydi Chandra Sekhar Pydi
Charles Skelton Charles Skelton
...@@ -104,6 +118,7 @@ Chris Granger ...@@ -104,6 +118,7 @@ Chris Granger
Chris Houseknecht Chris Houseknecht
Chris Lohfink Chris Lohfink
Chris Morgan Chris Morgan
Chris Smith
Christian Oyarzun Christian Oyarzun
Christian Petrov Christian Petrov
Christopher Brown Christopher Brown
...@@ -135,6 +150,7 @@ Darius Roberts ...@@ -135,6 +150,7 @@ Darius Roberts
Dave Brondsema Dave Brondsema
Dave Myers Dave Myers
David Barnett David Barnett
David H. Bronke
David Mignot David Mignot
David Pathakjee David Pathakjee
David Vázquez David Vázquez
...@@ -143,6 +159,7 @@ deebugger ...@@ -143,6 +159,7 @@ deebugger
Deep Thought Deep Thought
Devin Abbott Devin Abbott
Devon Carew Devon Carew
Dick Choi
dignifiedquire dignifiedquire
Dimage Sapelkin Dimage Sapelkin
Dmitry Kiselyov Dmitry Kiselyov
...@@ -160,10 +177,12 @@ eborden ...@@ -160,10 +177,12 @@ eborden
edsharp edsharp
ekhaled ekhaled
Elisée Elisée
Emmanuel Schanzer
Enam Mijbah Noor Enam Mijbah Noor
Eric Allam Eric Allam
Erik Welander Erik Welander
eustas eustas
Fabien Dubosson
Fabien O'Carroll Fabien O'Carroll
Fabio Zendhi Nagao Fabio Zendhi Nagao
Faiza Alsaied Faiza Alsaied
...@@ -172,7 +191,9 @@ fbuchinger ...@@ -172,7 +191,9 @@ fbuchinger
feizhang365 feizhang365
Felipe Lalanne Felipe Lalanne
Felix Raab Felix Raab
ficristo
Filip Noetzel Filip Noetzel
Filip Stollár
flack flack
ForbesLindesay ForbesLindesay
Forbes Lindesay Forbes Lindesay
...@@ -183,9 +204,11 @@ Gabriel Gheorghian ...@@ -183,9 +204,11 @@ Gabriel Gheorghian
Gabriel Horner Gabriel Horner
Gabriel Nahmias Gabriel Nahmias
galambalazs galambalazs
Gary Sheng
Gautam Mehta Gautam Mehta
Gavin Douglas Gavin Douglas
gekkoe gekkoe
Geordie Hall
geowarin geowarin
Gerard Braad Gerard Braad
Gergely Hegykozi Gergely Hegykozi
...@@ -199,6 +222,7 @@ Gordon Smith ...@@ -199,6 +222,7 @@ Gordon Smith
Grant Skinner Grant Skinner
greengiant greengiant
Gregory Koberger Gregory Koberger
Grzegorz Mazur
Guillaume Massé Guillaume Massé
Guillaume Massé Guillaume Massé
guraga guraga
...@@ -206,8 +230,10 @@ Gustavo Rodrigues ...@@ -206,8 +230,10 @@ Gustavo Rodrigues
Hakan Tunc Hakan Tunc
Hans Engel Hans Engel
Hardest Hardest
Harshvardhan Gupta
Hasan Karahan Hasan Karahan
Hector Oswaldo Caballero Hector Oswaldo Caballero
Hendrik Wallbaum
Herculano Campos Herculano Campos
Hiroyuki Makino Hiroyuki Makino
hitsthings hitsthings
...@@ -226,10 +252,12 @@ Irakli Gozalishvili ...@@ -226,10 +252,12 @@ Irakli Gozalishvili
Ivan Kurnosov Ivan Kurnosov
Ivoah Ivoah
Jacob Lee Jacob Lee
Jake Peyser
Jakob Miland Jakob Miland
Jakub Vrana Jakub Vrana
Jakub Vrána Jakub Vrána
James Campos James Campos
James Howard
James Thorne James Thorne
Jamie Hill Jamie Hill
Jan Jongboom Jan Jongboom
...@@ -238,7 +266,9 @@ Jan Keromnes ...@@ -238,7 +266,9 @@ Jan Keromnes
Jan Odvarko Jan Odvarko
Jan Schär Jan Schär
Jan T. Sott Jan T. Sott
Jared Dean
Jared Forsyth Jared Forsyth
Jared Jacobs
Jason Jason
Jason Barnabe Jason Barnabe
Jason Grout Jason Grout
...@@ -248,16 +278,21 @@ Jason Siefken ...@@ -248,16 +278,21 @@ Jason Siefken
Jaydeep Solanki Jaydeep Solanki
Jean Boussier Jean Boussier
Jeff Blaisdell Jeff Blaisdell
Jeff Jenkins
jeffkenton jeffkenton
Jeff Pickhardt Jeff Pickhardt
jem (graphite) jem (graphite)
Jeremy Parmenter Jeremy Parmenter
Jim Jim
Jim Avery
JobJob JobJob
jochenberger jochenberger
Jochen Berger Jochen Berger
Joel Einbinder
joelpinheiro
Johan Ask Johan Ask
John Connor John Connor
John-David Dalton
John Engler John Engler
John Lees-Miller John Lees-Miller
John Snelson John Snelson
...@@ -265,12 +300,15 @@ John Van Der Loo ...@@ -265,12 +300,15 @@ John Van Der Loo
Jon Ander Peñalba Jon Ander Peñalba
Jonas Döbertin Jonas Döbertin
Jonathan Malmaud Jonathan Malmaud
Jon Gacnik
jongalloway jongalloway
Jon Malmaud Jon Malmaud
Jon Sangster Jon Sangster
Joost-Wim Boekesteijn Joost-Wim Boekesteijn
Joseph Pecoraro Joseph Pecoraro
Josh Barnes
Josh Cohen Josh Cohen
Josh Soref
Joshua Newman Joshua Newman
Josh Watzman Josh Watzman
jots jots
...@@ -286,10 +324,12 @@ jwallers@gmail.com ...@@ -286,10 +324,12 @@ jwallers@gmail.com
kaniga kaniga
karevn karevn
Kayur Patel Kayur Patel
Kazuhito Hokamura
Ken Newman Ken Newman
ken restivo ken restivo
Ken Rockot Ken Rockot
Kevin Earls Kevin Earls
Kevin Muret
Kevin Sawicki Kevin Sawicki
Kevin Ushey Kevin Ushey
Klaus Silveira Klaus Silveira
...@@ -297,9 +337,11 @@ Koh Zi Han, Cliff ...@@ -297,9 +337,11 @@ Koh Zi Han, Cliff
komakino komakino
Konstantin Lopuhin Konstantin Lopuhin
koops koops
Kris Ciccarello
ks-ifware ks-ifware
kubelsmieci kubelsmieci
KwanEsq KwanEsq
Kyle Kelley
Lanfei Lanfei
Lanny Lanny
Laszlo Vidacs Laszlo Vidacs
...@@ -314,6 +356,9 @@ LM ...@@ -314,6 +356,9 @@ LM
lochel lochel
Lorenzo Stoakes Lorenzo Stoakes
Luciano Longo Luciano Longo
Lu Fangjian
Luke Browning
Luke Granger-Brown
Luke Stagner Luke Stagner
lynschinzer lynschinzer
M1cha M1cha
...@@ -321,9 +366,11 @@ Madhura Jayaratne ...@@ -321,9 +366,11 @@ Madhura Jayaratne
Maksim Lin Maksim Lin
Maksym Taran Maksym Taran
Malay Majithia Malay Majithia
Manideep
Manuel Rego Casasnovas Manuel Rego Casasnovas
Marat Dreizin Marat Dreizin
Marcel Gerber Marcel Gerber
Marcelo Camargo
Marco Aurélio Marco Aurélio
Marco Munizaga Marco Munizaga
Marcus Bointon Marcus Bointon
...@@ -334,6 +381,7 @@ Mario Pietsch ...@@ -334,6 +381,7 @@ Mario Pietsch
Mark Anderson Mark Anderson
Mark Lentczner Mark Lentczner
Marko Bonaci Marko Bonaci
Mark Peace
Markus Bordihn Markus Bordihn
Martin Balek Martin Balek
Martín Gaitán Martín Gaitán
...@@ -348,6 +396,7 @@ mats cronqvist ...@@ -348,6 +396,7 @@ mats cronqvist
Matt Gaide Matt Gaide
Matthew Bauer Matthew Bauer
Matthew Beale Matthew Beale
matthewhayes
Matthew Rathbone Matthew Rathbone
Matthias Bussonnier Matthias Bussonnier
Matthias BUSSONNIER Matthias BUSSONNIER
...@@ -380,6 +429,7 @@ Mike Brevoort ...@@ -380,6 +429,7 @@ Mike Brevoort
Mike Diaz Mike Diaz
Mike Ivanov Mike Ivanov
Mike Kadin Mike Kadin
Mike Kobit
MinRK MinRK
Miraculix87 Miraculix87
misfo misfo
...@@ -389,6 +439,7 @@ Moritz Schwörer ...@@ -389,6 +439,7 @@ Moritz Schwörer
mps mps
ms ms
mtaran-google mtaran-google
Mu-An Chiou
Narciso Jaramillo Narciso Jaramillo
Nathan Williams Nathan Williams
ndr ndr
...@@ -413,19 +464,23 @@ nlwillia ...@@ -413,19 +464,23 @@ nlwillia
noragrossman noragrossman
Norman Rzepka Norman Rzepka
Oreoluwa Onatemowo Oreoluwa Onatemowo
Oskar Segersvärd
pablo pablo
pabloferz pabloferz
Page Page
Panupong Pasupat Panupong Pasupat
paris paris
Paris Paris
Paris Kasidiaris
Patil Arpith Patil Arpith
Patrick Stoica Patrick Stoica
Patrick Strawderman Patrick Strawderman
Paul Garvin Paul Garvin
Paul Ivanov Paul Ivanov
Paul Masson
Pavel Pavel
Pavel Feldman Pavel Feldman
Pavel Petržela
Pavel Strashkin Pavel Strashkin
Paweł Bartkiewicz Paweł Bartkiewicz
peteguhl peteguhl
...@@ -437,6 +492,7 @@ Philipp A ...@@ -437,6 +492,7 @@ Philipp A
Philip Stadermann Philip Stadermann
Pierre Gerold Pierre Gerold
Piët Delport Piët Delport
Pontus Melke
prasanthj prasanthj
Prasanth J Prasanth J
Prayag Verma Prayag Verma
...@@ -450,20 +506,26 @@ Randy Edmunds ...@@ -450,20 +506,26 @@ Randy Edmunds
Rasmus Erik Voel Jensen Rasmus Erik Voel Jensen
ray ratchup ray ratchup
Ray Ratchup Ray Ratchup
Remi Nyborg
Richard Denton Richard Denton
Richard van der Meer Richard van der Meer
Richard Z.H. Wang Richard Z.H. Wang
Rishi Goomar
Robert Crossfield Robert Crossfield
Roberto Abdelkader Martínez Pérez Roberto Abdelkader Martínez Pérez
robertop23 robertop23
Robert Plummer Robert Plummer
Rrandom Rrandom
Rrrandom
Ruslan Osmanov Ruslan Osmanov
Ryan Prior Ryan Prior
sabaca sabaca
Sam Lee
Samuel Ainsworth Samuel Ainsworth
Sam Wilson
sandeepshetty sandeepshetty
Sander AKA Redsandro Sander AKA Redsandro
Sander Verweij
santec santec
Sascha Peilicke Sascha Peilicke
satamas satamas
...@@ -475,6 +537,7 @@ Scott Aikin ...@@ -475,6 +537,7 @@ Scott Aikin
Scott Goodhew Scott Goodhew
Sebastian Zaha Sebastian Zaha
Sergey Goder Sergey Goder
Sergey Tselovalnikov
Se-Won Kim Se-Won Kim
shaund shaund
shaun gilchrist shaun gilchrist
...@@ -484,6 +547,7 @@ sheopory ...@@ -484,6 +547,7 @@ sheopory
Shiv Deepak Shiv Deepak
Shmuel Englard Shmuel Englard
Shubham Jain Shubham Jain
Siamak Mokhtari
silverwind silverwind
sinkuu sinkuu
snasa snasa
...@@ -498,12 +562,14 @@ Steffen Beyer ...@@ -498,12 +562,14 @@ Steffen Beyer
Steffen Bruchmann Steffen Bruchmann
Stephen Lavelle Stephen Lavelle
Steve Champagne Steve Champagne
Steve Hoover
Steve O'Hara Steve O'Hara
stoskov stoskov
Stu Kennedy Stu Kennedy
Sungho Kim Sungho Kim
sverweij sverweij
Taha Jahangir Taha Jahangir
takamori
Tako Schotanus Tako Schotanus
Takuji Shimokawa Takuji Shimokawa
Tarmil Tarmil
...@@ -513,17 +579,22 @@ tfjgeorge ...@@ -513,17 +579,22 @@ tfjgeorge
Thaddee Tyl Thaddee Tyl
thanasis thanasis
TheHowl TheHowl
themrmax
think think
Thomas Dvornik Thomas Dvornik
Thomas Kluyver
Thomas Schmid Thomas Schmid
Tim Alby Tim Alby
Tim Baumann Tim Baumann
Timothy Farrell Timothy Farrell
Timothy Gu
Timothy Hatcher Timothy Hatcher
TobiasBg TobiasBg
Todd Berman
Tomas-A Tomas-A
Tomas Varaneckas Tomas Varaneckas
Tom Erik Støwer Tom Erik Støwer
Tom Klancer
Tom MacWright Tom MacWright
Tony Jian Tony Jian
Travis Heppe Travis Heppe
...@@ -531,11 +602,13 @@ Triangle717 ...@@ -531,11 +602,13 @@ Triangle717
Tristan Tarrant Tristan Tarrant
TSUYUSATO Kitsune TSUYUSATO Kitsune
twifkak twifkak
VapidWorx
Vestimir Markov Vestimir Markov
vf vf
Victor Bocharsky Victor Bocharsky
Vincent Woo Vincent Woo
Volker Mische Volker Mische
Weiyan Shao
wenli wenli
Wes Cossick Wes Cossick
Wesley Wiser Wesley Wiser
...@@ -553,6 +626,7 @@ Yunchi Luo ...@@ -553,6 +626,7 @@ Yunchi Luo
Yuvi Panda Yuvi Panda
Zac Anger Zac Anger
Zachary Dremann Zachary Dremann
Zeno Rocha
Zhang Hao Zhang Hao
zziuni zziuni
魏鹏刚 魏鹏刚
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>AUTHORS</string> </value> <value> <string>AUTHORS</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>application/octet-stream</string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<dictionary/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>CHANGELOG.md</string> </value> <value> <string>CHANGELOG.md</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>application/octet-stream</string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<dictionary/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>CONTRIBUTING.md</string> </value> <value> <string>CONTRIBUTING.md</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>application/octet-stream</string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<dictionary/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
Copyright (C) 2016 by Marijn Haverbeke <marijnh@gmail.com> and others MIT License
Copyright (C) 2017 by Marijn Haverbeke <marijnh@gmail.com> and others
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>LICENSE</string> </value> <value> <string>LICENSE</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>application/octet-stream</string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<dictionary/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -26,3 +26,9 @@ The CodeMirror community aims to be welcoming to everybody. We use the ...@@ -26,3 +26,9 @@ The CodeMirror community aims to be welcoming to everybody. We use the
[Contributor Covenant [Contributor Covenant
(1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of (1.1)](http://contributor-covenant.org/version/1/1/0/) as our code of
conduct. conduct.
### Quickstart
To build the project, make sure you have Node.js installed (at least version 6)
and then `npm install`. To run, just open `index.html` in your
browser (you don't need to run a webserver). Run the tests with `npm test`.
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>README.md</string> </value> <value> <string>README.md</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>application/octet-stream</string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<dictionary/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
function getConfig(cm) { function getConfig(cm) {
var deflt = cm.state.closeBrackets; var deflt = cm.state.closeBrackets;
if (!deflt) return null; if (!deflt || deflt.override) return deflt;
var mode = cm.getModeAt(cm.getCursor()); var mode = cm.getModeAt(cm.getCursor());
return mode.closeBrackets || deflt; return mode.closeBrackets || deflt;
} }
...@@ -109,14 +109,16 @@ ...@@ -109,14 +109,16 @@
var ranges = cm.listSelections(); var ranges = cm.listSelections();
var opening = pos % 2 == 0; var opening = pos % 2 == 0;
var type, next; var type;
for (var i = 0; i < ranges.length; i++) { for (var i = 0; i < ranges.length; i++) {
var range = ranges[i], cur = range.head, curType; var range = ranges[i], cur = range.head, curType;
var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1)); var next = cm.getRange(cur, Pos(cur.line, cur.ch + 1));
if (opening && !range.empty()) { if (opening && !range.empty()) {
curType = "surround"; curType = "surround";
} else if ((identical || !opening) && next == ch) { } else if ((identical || !opening) && next == ch) {
if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch) if (identical && stringStartsAfter(cm, cur))
curType = "both";
else if (triples.indexOf(ch) >= 0 && cm.getRange(cur, Pos(cur.line, cur.ch + 3)) == ch + ch + ch)
curType = "skipThree"; curType = "skipThree";
else else
curType = "skip"; curType = "skip";
...@@ -183,7 +185,7 @@ ...@@ -183,7 +185,7 @@
function enteringString(cm, pos, ch) { function enteringString(cm, pos, ch) {
var line = cm.getLine(pos.line); var line = cm.getLine(pos.line);
var token = cm.getTokenAt(pos); var token = cm.getTokenAt(pos);
if (/\bstring2?\b/.test(token.type)) return false; 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); var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);
stream.pos = stream.start = token.start; stream.pos = stream.start = token.start;
for (;;) { for (;;) {
...@@ -192,4 +194,9 @@ ...@@ -192,4 +194,9 @@
stream.start = stream.pos; 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
}
}); });
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
})(function(CodeMirror) { })(function(CodeMirror) {
"use strict"; "use strict";
var listRE = /^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/, var listRE = /^(\s*)(>[> ]*|- \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,
emptyListRE = /^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/, emptyListRE = /^(\s*)(>[> ]*|- \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,
unorderedListRE = /[*+-]\s/; unorderedListRE = /[*+-]\s/;
CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) {
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
return; return;
} }
if (emptyListRE.test(line)) { if (emptyListRE.test(line)) {
cm.replaceRange("", { if (!/>\s*$/.test(line)) cm.replaceRange("", {
line: pos.line, ch: 0 line: pos.line, ch: 0
}, { }, {
line: pos.line, ch: pos.ch + 1 line: pos.line, ch: pos.ch + 1
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
} else { } else {
var indent = match[1], after = match[5]; var indent = match[1], after = match[5];
var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0 var bullet = unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0
? match[2] ? match[2].replace("x", " ")
: (parseInt(match[3], 10) + 1) + match[4]; : (parseInt(match[3], 10) + 1) + match[4];
replacements[i] = "\n" + indent + bullet + after; replacements[i] = "\n" + indent + bullet + after;
......
...@@ -102,8 +102,10 @@ ...@@ -102,8 +102,10 @@
} }
CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) { CodeMirror.defineOption("matchBrackets", false, function(cm, val, old) {
if (old && old != CodeMirror.Init) if (old && old != CodeMirror.Init) {
cm.off("cursorActivity", doMatchBrackets); cm.off("cursorActivity", doMatchBrackets);
if (currentlyHighlighted) {currentlyHighlighted(); currentlyHighlighted = null;}
}
if (val) { if (val) {
cm.state.matchBrackets = typeof val == "object" ? val : {}; cm.state.matchBrackets = typeof val == "object" ? val : {};
cm.on("cursorActivity", doMatchBrackets); cm.on("cursorActivity", doMatchBrackets);
......
...@@ -44,9 +44,22 @@ ...@@ -44,9 +44,22 @@
} }
}); });
// 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)
}
function getMode(cm, pos) {
var mode = cm.getMode()
return mode.useInnerComments === false || !mode.innerMode ? mode : cm.getModeAt(pos)
}
CodeMirror.defineExtension("lineComment", function(from, to, options) { CodeMirror.defineExtension("lineComment", function(from, to, options) {
if (!options) options = noOptions; if (!options) options = noOptions;
var self = this, mode = self.getModeAt(from); var self = this, mode = getMode(self, from);
var firstLine = self.getLine(from.line);
if (firstLine == null || probablyInsideString(self, from, firstLine)) return;
var commentString = options.lineComment || mode.lineComment; var commentString = options.lineComment || mode.lineComment;
if (!commentString) { if (!commentString) {
if (options.blockCommentStart || mode.blockCommentStart) { if (options.blockCommentStart || mode.blockCommentStart) {
...@@ -55,8 +68,7 @@ ...@@ -55,8 +68,7 @@
} }
return; return;
} }
var firstLine = self.getLine(from.line);
if (firstLine == null) return;
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1); var end = Math.min(to.ch != 0 || to.line == from.line ? to.line + 1 : to.line, self.lastLine() + 1);
var pad = options.padding == null ? " " : options.padding; var pad = options.padding == null ? " " : options.padding;
var blankLines = options.commentBlankLines || from.line == to.line; var blankLines = options.commentBlankLines || from.line == to.line;
...@@ -88,7 +100,7 @@ ...@@ -88,7 +100,7 @@
CodeMirror.defineExtension("blockComment", function(from, to, options) { CodeMirror.defineExtension("blockComment", function(from, to, options) {
if (!options) options = noOptions; if (!options) options = noOptions;
var self = this, mode = self.getModeAt(from); var self = this, mode = getMode(self, from);
var startString = options.blockCommentStart || mode.blockCommentStart; var startString = options.blockCommentStart || mode.blockCommentStart;
var endString = options.blockCommentEnd || mode.blockCommentEnd; var endString = options.blockCommentEnd || mode.blockCommentEnd;
if (!startString || !endString) { if (!startString || !endString) {
...@@ -96,6 +108,7 @@ ...@@ -96,6 +108,7 @@
self.lineComment(from, to, options); self.lineComment(from, to, options);
return; return;
} }
if (/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return
var end = Math.min(to.line, self.lastLine()); var end = Math.min(to.line, self.lastLine());
if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end; if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end;
...@@ -121,7 +134,7 @@ ...@@ -121,7 +134,7 @@
CodeMirror.defineExtension("uncomment", function(from, to, options) { CodeMirror.defineExtension("uncomment", function(from, to, options) {
if (!options) options = noOptions; if (!options) options = noOptions;
var self = this, mode = self.getModeAt(from); var self = this, mode = getMode(self, from);
var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end); var end = Math.min(to.ch != 0 || to.line == from.line ? to.line : to.line - 1, self.lastLine()), start = Math.min(from.line, end);
// Try finding line comments // Try finding line comments
...@@ -133,7 +146,7 @@ ...@@ -133,7 +146,7 @@
var line = self.getLine(i); var line = self.getLine(i);
var found = line.indexOf(lineString); var found = line.indexOf(lineString);
if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1; if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1;
if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment; if (found == -1 && nonWS.test(line)) break lineComment;
if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment; if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment;
lines.push(line); lines.push(line);
} }
...@@ -155,13 +168,15 @@ ...@@ -155,13 +168,15 @@
var endString = options.blockCommentEnd || mode.blockCommentEnd; var endString = options.blockCommentEnd || mode.blockCommentEnd;
if (!startString || !endString) return false; if (!startString || !endString) return false;
var lead = options.blockCommentLead || mode.blockCommentLead; var lead = options.blockCommentLead || mode.blockCommentLead;
var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end); var startLine = self.getLine(start), open = startLine.indexOf(startString)
var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString); 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) { if (close == -1 && start != end) {
endLine = self.getLine(--end); endLine = self.getLine(--end);
close = endLine.lastIndexOf(endString); close = endLine.indexOf(endString);
} }
if (open == -1 || close == -1 || if (close == -1 ||
!/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) || !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) ||
!/comment/.test(self.getTokenTypeAt(Pos(end, close + 1)))) !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1))))
return false; return false;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>dialog.css</string> </value> <value> <string>dialog.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>fullscreen.css</string> </value> <value> <string>fullscreen.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
var height = (options && options.height) || node.offsetHeight; var height = (options && options.height) || node.offsetHeight;
this._setSize(null, info.heightLeft -= height); this._setSize(null, info.heightLeft -= height);
info.panels++; info.panels++;
if (options.stable && isAtTop(this, node))
this.scrollTo(null, this.getScrollInfo().top + height)
return new Panel(this, node, options, height); return new Panel(this, node, options, height);
}); });
...@@ -54,6 +57,8 @@ ...@@ -54,6 +57,8 @@
this.cleared = true; this.cleared = true;
var info = this.cm.state.panels; var info = this.cm.state.panels;
this.cm._setSize(null, info.heightLeft += this.height); this.cm._setSize(null, info.heightLeft += this.height);
if (this.options.stable && isAtTop(this.cm, this.node))
this.cm.scrollTo(null, this.cm.getScrollInfo().top - this.height)
info.wrapper.removeChild(this.node); info.wrapper.removeChild(this.node);
if (--info.panels == 0) removePanels(this.cm); if (--info.panels == 0) removePanels(this.cm);
}; };
...@@ -109,4 +114,10 @@ ...@@ -109,4 +114,10 @@
cm.setSize = cm._setSize; cm.setSize = cm._setSize;
cm.setSize(); cm.setSize();
} }
function isAtTop(cm, dom) {
for (var sibling = dom.nextSibling; sibling; sibling = sibling.nextSibling)
if (sibling == cm.getWrapperElement()) return true
return false
}
}); });
...@@ -11,30 +11,26 @@ ...@@ -11,30 +11,26 @@
})(function(CodeMirror) { })(function(CodeMirror) {
"use strict"; "use strict";
CodeMirror.defineOption("rulers", false, function(cm, val, old) { CodeMirror.defineOption("rulers", false, function(cm, val) {
if (old && old != CodeMirror.Init) { if (cm.state.rulerDiv) {
clearRulers(cm); cm.state.rulerDiv.parentElement.removeChild(cm.state.rulerDiv)
cm.off("refresh", refreshRulers); cm.state.rulerDiv = null
cm.off("refresh", drawRulers)
} }
if (val && val.length) { if (val && val.length) {
setRulers(cm); cm.state.rulerDiv = cm.display.lineSpace.parentElement.insertBefore(document.createElement("div"), cm.display.lineSpace)
cm.on("refresh", refreshRulers); cm.state.rulerDiv.className = "CodeMirror-rulers"
drawRulers(cm)
cm.on("refresh", drawRulers)
} }
}); });
function clearRulers(cm) { function drawRulers(cm) {
for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) { cm.state.rulerDiv.textContent = ""
var node = cm.display.lineSpace.childNodes[i];
if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className))
node.parentNode.removeChild(node);
}
}
function setRulers(cm) {
var val = cm.getOption("rulers"); var val = cm.getOption("rulers");
var cw = cm.defaultCharWidth(); var cw = cm.defaultCharWidth();
var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left; var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left;
var minH = cm.display.scroller.offsetHeight + 30; cm.state.rulerDiv.style.minHeight = (cm.display.scroller.offsetHeight + 30) + "px";
for (var i = 0; i < val.length; i++) { for (var i = 0; i < val.length; i++) {
var elt = document.createElement("div"); var elt = document.createElement("div");
elt.className = "CodeMirror-ruler"; elt.className = "CodeMirror-ruler";
...@@ -49,15 +45,7 @@ ...@@ -49,15 +45,7 @@
if (conf.width) elt.style.borderLeftWidth = conf.width; if (conf.width) elt.style.borderLeftWidth = conf.width;
} }
elt.style.left = (left + col * cw) + "px"; elt.style.left = (left + col * cw) + "px";
elt.style.top = "-50px"; cm.state.rulerDiv.appendChild(elt)
elt.style.bottom = "-20px";
elt.style.minHeight = minH + "px";
cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv);
} }
} }
function refreshRulers(cm) {
clearRulers(cm);
setRulers(cm);
}
}); });
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
CodeMirror.registerHelper("fold", "brace", function(cm, start) { CodeMirror.registerHelper("fold", "brace", function(cm, start) {
var line = start.line, lineText = cm.getLine(line); var line = start.line, lineText = cm.getLine(line);
var startCh, tokenType; var tokenType;
function findOpening(openCh) { function findOpening(openCh) {
for (var at = start.ch, pass = 0;;) { for (var at = start.ch, pass = 0;;) {
...@@ -72,15 +72,15 @@ CodeMirror.registerHelper("fold", "import", function(cm, start) { ...@@ -72,15 +72,15 @@ CodeMirror.registerHelper("fold", "import", function(cm, start) {
} }
} }
var start = start.line, has = hasImport(start), prev; var startLine = start.line, has = hasImport(startLine), prev;
if (!has || hasImport(start - 1) || ((prev = hasImport(start - 2)) && prev.end.line == start - 1)) if (!has || hasImport(startLine - 1) || ((prev = hasImport(startLine - 2)) && prev.end.line == startLine - 1))
return null; return null;
for (var end = has.end;;) { for (var end = has.end;;) {
var next = hasImport(end.line + 1); var next = hasImport(end.line + 1);
if (next == null) break; if (next == null) break;
end = next.end; end = next.end;
} }
return {from: cm.clipPos(CodeMirror.Pos(start, has.startCh + 1)), to: end}; return {from: cm.clipPos(CodeMirror.Pos(startLine, has.startCh + 1)), to: end};
}); });
CodeMirror.registerHelper("fold", "include", function(cm, start) { CodeMirror.registerHelper("fold", "include", function(cm, start) {
...@@ -91,14 +91,14 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) { ...@@ -91,14 +91,14 @@ CodeMirror.registerHelper("fold", "include", function(cm, start) {
if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8; if (start.type == "meta" && start.string.slice(0, 8) == "#include") return start.start + 8;
} }
var start = start.line, has = hasInclude(start); var startLine = start.line, has = hasInclude(startLine);
if (has == null || hasInclude(start - 1) != null) return null; if (has == null || hasInclude(startLine - 1) != null) return null;
for (var end = start;;) { for (var end = startLine;;) {
var next = hasInclude(end + 1); var next = hasInclude(end + 1);
if (next == null) break; if (next == null) break;
++end; ++end;
} }
return {from: CodeMirror.Pos(start, has + 1), return {from: CodeMirror.Pos(startLine, has + 1),
to: cm.clipPos(CodeMirror.Pos(end))}; to: cm.clipPos(CodeMirror.Pos(end))};
}); });
......
...@@ -29,7 +29,7 @@ CodeMirror.registerGlobalHelper("fold", "comment", function(mode) { ...@@ -29,7 +29,7 @@ CodeMirror.registerGlobalHelper("fold", "comment", function(mode) {
} }
if (pass == 1 && found < start.ch) return; if (pass == 1 && found < start.ch) return;
if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) && if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1))) &&
(lineText.slice(found - endToken.length, found) == endToken || (found == 0 || lineText.slice(found - endToken.length, found) == endToken ||
!/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) { !/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found))))) {
startCh = found + startToken.length; startCh = found + startToken.length;
break; break;
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
}); });
var myRange = cm.markText(range.from, range.to, { var myRange = cm.markText(range.from, range.to, {
replacedWith: myWidget, replacedWith: myWidget,
clearOnEnter: true, clearOnEnter: getOption(cm, options, "clearOnEnter"),
__isFold: true __isFold: true
}); });
myRange.on("clear", function(from, to) { myRange.on("clear", function(from, to) {
...@@ -129,7 +129,8 @@ ...@@ -129,7 +129,8 @@
rangeFinder: CodeMirror.fold.auto, rangeFinder: CodeMirror.fold.auto,
widget: "\u2194", widget: "\u2194",
minFoldSize: 0, minFoldSize: 0,
scanUp: false scanUp: false,
clearOnEnter: true
}; };
CodeMirror.defineOption("foldOptions", null); CodeMirror.defineOption("foldOptions", null);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>foldgutter.css</string> </value> <value> <string>foldgutter.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
} }
function isFolded(cm, line) { function isFolded(cm, line) {
var marks = cm.findMarksAt(Pos(line)); var marks = cm.findMarks(Pos(line, 0), Pos(line + 1, 0));
for (var i = 0; i < marks.length; ++i) for (var i = 0; i < marks.length; ++i)
if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i]; if (marks[i].__isFold && marks[i].find().from.line == line) return marks[i];
} }
......
...@@ -11,32 +11,36 @@ ...@@ -11,32 +11,36 @@
})(function(CodeMirror) { })(function(CodeMirror) {
"use strict"; "use strict";
function lineIndent(cm, lineNo) {
var text = cm.getLine(lineNo)
var spaceTo = text.search(/\S/)
if (spaceTo == -1 || /\bcomment\b/.test(cm.getTokenTypeAt(CodeMirror.Pos(lineNo, spaceTo + 1))))
return -1
return CodeMirror.countColumn(text, null, cm.getOption("tabSize"))
}
!
CodeMirror.registerHelper("fold", "indent", function(cm, start) { CodeMirror.registerHelper("fold", "indent", function(cm, start) {
var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); var myIndent = lineIndent(cm, start.line)
if (!/\S/.test(firstLine)) return; if (myIndent < 0) return
var getIndent = function(line) { var lastLineInFold = null
return CodeMirror.countColumn(line, null, tabSize);
};
var myIndent = getIndent(firstLine);
var lastLineInFold = null;
// Go through lines until we find a line that definitely doesn't belong in // Go through lines until we find a line that definitely doesn't belong in
// the block we're folding, or to the end. // the block we're folding, or to the end.
for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) {
var curLine = cm.getLine(i); var indent = lineIndent(cm, i)
var curIndent = getIndent(curLine); if (indent == -1) {
if (curIndent > myIndent) { } else if (indent > myIndent) {
// Lines with a greater indent are considered part of the block. // Lines with a greater indent are considered part of the block.
lastLineInFold = i; lastLineInFold = i;
} else if (!/\S/.test(curLine)) {
// Empty lines might be breaks within the block we're trying to fold.
} else { } else {
// A non-empty line at an indent equal to or less than ours marks the // If this line has non-space, non-comment content, and is
// start of another block. // indented less or equal to the start line, it is the start of
// another block.
break; break;
} }
} }
if (lastLineInFold) return { if (lastLineInFold) return {
from: CodeMirror.Pos(start.line, firstLine.length), from: CodeMirror.Pos(start.line, cm.getLine(start.line).length),
to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length)
}; };
}); });
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
function Iter(cm, line, ch, range) { function Iter(cm, line, ch, range) {
this.line = line; this.ch = ch; this.line = line; this.ch = ch;
this.cm = cm; this.text = cm.getLine(line); this.cm = cm; this.text = cm.getLine(line);
this.min = range ? range.from : cm.firstLine(); this.min = range ? Math.max(range.from, cm.firstLine()) : cm.firstLine();
this.max = range ? range.to - 1 : cm.lastLine(); this.max = range ? Math.min(range.to - 1, cm.lastLine()) : cm.lastLine();
} }
function tagAt(iter, ch) { function tagAt(iter, ch) {
...@@ -140,9 +140,9 @@ ...@@ -140,9 +140,9 @@
var openTag = toNextTag(iter), end; var openTag = toNextTag(iter), end;
if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return; if (!openTag || iter.line != start.line || !(end = toTagEnd(iter))) return;
if (!openTag[1] && end != "selfClose") { if (!openTag[1] && end != "selfClose") {
var start = Pos(iter.line, iter.ch); var startPos = Pos(iter.line, iter.ch);
var close = findMatchingClose(iter, openTag[2]); var endPos = findMatchingClose(iter, openTag[2]);
return close && {from: start, to: close.from}; return endPos && {from: startPos, to: endPos.from};
} }
} }
}); });
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
} }
}; };
// Used by addon/cm_edit/closetag.js // Used by addon/edit/closetag.js
CodeMirror.scanForClosingTag = function(cm, pos, name, end) { CodeMirror.scanForClosingTag = function(cm, pos, name, end) {
var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null); var iter = new Iter(cm, pos.line, pos.ch, end ? {from: 0, to: end} : null);
return findMatchingClose(iter, name); return findMatchingClose(iter, name);
......
...@@ -97,6 +97,15 @@ ...@@ -97,6 +97,15 @@
var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " + 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(" "); "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(" ");
function forAllProps(obj, callback) {
if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) {
for (var name in obj) callback(name)
} else {
for (var o = obj; o; o = Object.getPrototypeOf(o))
Object.getOwnPropertyNames(o).forEach(callback)
}
}
function getCompletions(token, context, keywords, options) { function getCompletions(token, context, keywords, options) {
var found = [], start = token.string, global = options && options.globalScope || window; var found = [], start = token.string, global = options && options.globalScope || window;
function maybeAdd(str) { function maybeAdd(str) {
...@@ -106,7 +115,7 @@ ...@@ -106,7 +115,7 @@
if (typeof obj == "string") forEach(stringProps, maybeAdd); if (typeof obj == "string") forEach(stringProps, maybeAdd);
else if (obj instanceof Array) forEach(arrayProps, maybeAdd); else if (obj instanceof Array) forEach(arrayProps, maybeAdd);
else if (obj instanceof Function) forEach(funcProps, maybeAdd); else if (obj instanceof Function) forEach(funcProps, maybeAdd);
for (var name in obj) maybeAdd(name); forAllProps(obj, maybeAdd)
} }
if (context && context.length) { if (context && context.length) {
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
margin: 0; margin: 0;
padding: 0 4px; padding: 0 4px;
border-radius: 2px; border-radius: 2px;
max-width: 19em;
overflow: hidden;
white-space: pre; white-space: pre;
color: black; color: black;
cursor: pointer; cursor: pointer;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>show-hint.css</string> </value> <value> <string>show-hint.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -108,15 +108,11 @@ ...@@ -108,15 +108,11 @@
}, },
update: function(first) { update: function(first) {
if (this.tick == null) return; if (this.tick == null) return
if (!this.options.hint.async) { var self = this, myTick = ++this.tick
this.finishUpdate(this.options.hint(this.cm, this.options), first); fetchHints(this.options.hint, this.cm, this.options, function(data) {
} else { if (self.tick == myTick) self.finishUpdate(data, first)
var myTick = ++this.tick, self = this; })
this.options.hint(this.cm, function(data) {
if (self.tick == myTick) self.finishUpdate(data, first);
}, this.options);
}
}, },
finishUpdate: function(data, first) { finishUpdate: function(data, first) {
...@@ -233,6 +229,9 @@ ...@@ -233,6 +229,9 @@
var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight); var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
(completion.options.container || document.body).appendChild(hints); (completion.options.container || document.body).appendChild(hints);
var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH;
var scrolls = hints.scrollHeight > hints.clientHeight + 1
var startScroll = cm.getScrollInfo();
if (overlapY > 0) { if (overlapY > 0) {
var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top);
if (curTop - height > 0) { // Fits above cursor if (curTop - height > 0) { // Fits above cursor
...@@ -257,6 +256,8 @@ ...@@ -257,6 +256,8 @@
} }
hints.style.left = (left = pos.left - overlapX) + "px"; hints.style.left = (left = pos.left - overlapX) + "px";
} }
if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling)
node.style.paddingRight = cm.display.nativeBarWidth + "px"
cm.addKeyMap(this.keyMap = buildKeyMap(completion, { cm.addKeyMap(this.keyMap = buildKeyMap(completion, {
moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); }, moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); },
...@@ -274,7 +275,6 @@ ...@@ -274,7 +275,6 @@
cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); }); cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); });
} }
var startScroll = cm.getScrollInfo();
cm.on("scroll", this.onScroll = function() { cm.on("scroll", this.onScroll = function() {
var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect(); var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect();
var newTop = top + startScroll.top - curScroll.top; var newTop = top + startScroll.top - curScroll.top;
...@@ -362,40 +362,31 @@ ...@@ -362,40 +362,31 @@
return result return result
} }
function fetchHints(hint, cm, options, callback) {
if (hint.async) {
hint(cm, callback, options)
} else {
var result = hint(cm, options)
if (result && result.then) result.then(callback)
else callback(result)
}
}
function resolveAutoHints(cm, pos) { function resolveAutoHints(cm, pos) {
var helpers = cm.getHelpers(pos, "hint"), words var helpers = cm.getHelpers(pos, "hint"), words
if (helpers.length) { if (helpers.length) {
var async = false, resolved var resolved = function(cm, callback, options) {
for (var i = 0; i < helpers.length; i++) if (helpers[i].async) async = true var app = applicableHelpers(cm, helpers);
if (async) { function run(i) {
resolved = function(cm, callback, options) { if (i == app.length) return callback(null)
var app = applicableHelpers(cm, helpers) fetchHints(app[i], cm, options, function(result) {
function run(i, result) { if (result && result.list.length > 0) callback(result)
if (i == app.length) return callback(null) else run(i + 1)
var helper = app[i] })
if (helper.async) {
helper(cm, function(result) {
if (result) callback(result)
else run(i + 1)
}, options)
} else {
var result = helper(cm, options)
if (result) callback(result)
else run(i + 1)
}
}
run(0)
}
resolved.async = true
} else {
resolved = function(cm, options) {
var app = applicableHelpers(cm, helpers)
for (var i = 0; i < app.length; i++) {
var cur = app[i](cm, options)
if (cur && cur.list.length) return cur
}
} }
run(0)
} }
resolved.async = true
resolved.supportsSelection = true resolved.supportsSelection = true
return resolved return resolved
} else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) {
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
QUERY_DIV: ";", QUERY_DIV: ";",
ALIAS_KEYWORD: "AS" ALIAS_KEYWORD: "AS"
}; };
var Pos = CodeMirror.Pos; var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos;
function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" } function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" }
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
} }
function nameCompletion(cur, token, result, editor) { function nameCompletion(cur, token, result, editor) {
// Try to complete table, colunm names and return start position of completion // Try to complete table, column names and return start position of completion
var useBacktick = false; var useBacktick = false;
var nameParts = []; var nameParts = [];
var start = token.start; var start = token.start;
...@@ -178,15 +178,6 @@ ...@@ -178,15 +178,6 @@
} }
} }
function convertCurToNumber(cur) {
// max characters of a line is 999,999.
return cur.line + cur.ch / Math.pow(10, 6);
}
function convertNumberToCur(num) {
return Pos(Math.floor(num), +num.toString().split('.').pop());
}
function findTableByAlias(alias, editor) { function findTableByAlias(alias, editor) {
var doc = editor.doc; var doc = editor.doc;
var fullQuery = doc.getValue(); var fullQuery = doc.getValue();
...@@ -209,15 +200,14 @@ ...@@ -209,15 +200,14 @@
separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length)); separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length));
//find valid range //find valid range
var prevItem = 0; var prevItem = null;
var current = convertCurToNumber(editor.getCursor()); var current = editor.getCursor()
for (var i = 0; i < separator.length; i++) { for (var i = 0; i < separator.length; i++) {
var _v = convertCurToNumber(separator[i]); if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) {
if (current > prevItem && current <= _v) { validRange = {start: prevItem, end: separator[i]};
validRange = { start: convertNumberToCur(prevItem), end: convertNumberToCur(_v) };
break; break;
} }
prevItem = _v; prevItem = separator[i];
} }
var query = doc.getRange(validRange.start, validRange.end, false); var query = doc.getRange(validRange.start, validRange.end, false);
...@@ -241,7 +231,7 @@ ...@@ -241,7 +231,7 @@
var defaultTableName = options && options.defaultTable; var defaultTableName = options && options.defaultTable;
var disableKeywords = options && options.disableKeywords; var disableKeywords = options && options.disableKeywords;
defaultTable = defaultTableName && getTable(defaultTableName); defaultTable = defaultTableName && getTable(defaultTableName);
keywords = keywords || getKeywords(editor); keywords = getKeywords(editor);
if (defaultTableName && !defaultTable) if (defaultTableName && !defaultTable)
defaultTable = findTableByAlias(defaultTableName, editor); defaultTable = findTableByAlias(defaultTableName, editor);
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
} }
.CodeMirror-lint-tooltip { .CodeMirror-lint-tooltip {
background-color: infobackground; background-color: #ffd;
border: 1px solid black; border: 1px solid black;
border-radius: 4px 4px 4px 4px; border-radius: 4px 4px 4px 4px;
color: infotext; color: black;
font-family: monospace; font-family: monospace;
font-size: 10pt; font-size: 10pt;
overflow: hidden; overflow: hidden;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>lint.css</string> </value> <value> <string>lint.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -204,7 +204,8 @@ ...@@ -204,7 +204,8 @@
var annotations = []; var annotations = [];
for (var i = 0; i < spans.length; ++i) { for (var i = 0; i < spans.length; ++i) {
annotations.push(spans[i].__annotation); var ann = spans[i].__annotation;
if (ann) annotations.push(ann);
} }
if (annotations.length) popupTooltips(annotations, e); if (annotations.length) popupTooltips(annotations, e);
} }
...@@ -225,7 +226,7 @@ ...@@ -225,7 +226,7 @@
var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter); var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter);
if (state.options.lintOnChange !== false) if (state.options.lintOnChange !== false)
cm.on("change", onChange); cm.on("change", onChange);
if (state.options.tooltips != false) if (state.options.tooltips != false && state.options.tooltips != "gutter")
CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver);
startLinting(cm); startLinting(cm);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>merge.css</string> </value> <value> <string>merge.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -76,8 +76,13 @@ CodeMirror.overlayMode = function(base, overlay, combine) { ...@@ -76,8 +76,13 @@ CodeMirror.overlayMode = function(base, overlay, combine) {
innerMode: function(state) { return {state: state.base, mode: base}; }, innerMode: function(state) { return {state: state.base, mode: base}; },
blankLine: function(state) { blankLine: function(state) {
if (base.blankLine) base.blankLine(state.base); var baseToken, overlayToken;
if (overlay.blankLine) overlay.blankLine(state.overlay); if (base.blankLine) baseToken = base.blankLine(state.base);
if (overlay.blankLine) overlayToken = overlay.blankLine(state.overlay);
return overlayToken == null ?
baseToken :
(combine && baseToken != null ? baseToken + " " + overlayToken : overlayToken);
} }
}; };
}; };
......
...@@ -77,17 +77,21 @@ ...@@ -77,17 +77,21 @@
curLine = pos.line; curLine = pos.line;
curLineObj = cm.getLineHandle(curLine); curLineObj = cm.getLineHandle(curLine);
} }
if (wrapping && curLineObj.height > singleLineH) if ((curLineObj.widgets && curLineObj.widgets.length) ||
(wrapping && curLineObj.height > singleLineH))
return cm.charCoords(pos, "local")[top ? "top" : "bottom"]; return cm.charCoords(pos, "local")[top ? "top" : "bottom"];
var topY = cm.heightAtLine(curLineObj, "local"); var topY = cm.heightAtLine(curLineObj, "local");
return topY + (top ? 0 : curLineObj.height); return topY + (top ? 0 : curLineObj.height);
} }
var lastLine = cm.lastLine()
if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) { if (cm.display.barWidth) for (var i = 0, nextTop; i < anns.length; i++) {
var ann = anns[i]; var ann = anns[i];
if (ann.to.line > lastLine) continue;
var top = nextTop || getY(ann.from, true) * hScale; var top = nextTop || getY(ann.from, true) * hScale;
var bottom = getY(ann.to, false) * hScale; var bottom = getY(ann.to, false) * hScale;
while (i < anns.length - 1) { while (i < anns.length - 1) {
if (anns[i + 1].to.line > lastLine) break;
nextTop = getY(anns[i + 1].from, true) * hScale; nextTop = getY(anns[i + 1].from, true) * hScale;
if (nextTop > bottom + .9) break; if (nextTop > bottom + .9) break;
ann = anns[++i]; ann = anns[++i];
......
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
if (cm.state.scrollPastEndPadding != padding) { if (cm.state.scrollPastEndPadding != padding) {
cm.state.scrollPastEndPadding = padding; cm.state.scrollPastEndPadding = padding;
cm.display.lineSpace.parentNode.style.paddingBottom = padding; cm.display.lineSpace.parentNode.style.paddingBottom = padding;
cm.off("refresh", updateBottomMargin);
cm.setSize(); cm.setSize();
cm.on("refresh", updateBottomMargin);
} }
} }
}); });
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>simplescrollbars.css</string> </value> <value> <string>simplescrollbars.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
CodeMirror.on(this.node, "DOMMouseScroll", onWheel); CodeMirror.on(this.node, "DOMMouseScroll", onWheel);
} }
Bar.prototype.setPos = function(pos) { Bar.prototype.setPos = function(pos, force) {
if (pos < 0) pos = 0; if (pos < 0) pos = 0;
if (pos > this.total - this.screen) pos = this.total - this.screen; if (pos > this.total - this.screen) pos = this.total - this.screen;
if (pos == this.pos) return false; if (!force && pos == this.pos) return false;
this.pos = pos; this.pos = pos;
this.inner.style[this.orientation == "horizontal" ? "left" : "top"] = this.inner.style[this.orientation == "horizontal" ? "left" : "top"] =
(pos * (this.size / this.total)) + "px"; (pos * (this.size / this.total)) + "px";
...@@ -76,9 +76,12 @@ ...@@ -76,9 +76,12 @@
var minButtonSize = 10; var minButtonSize = 10;
Bar.prototype.update = function(scrollSize, clientSize, barSize) { Bar.prototype.update = function(scrollSize, clientSize, barSize) {
this.screen = clientSize; var sizeChanged = this.screen != clientSize || this.total != scrollSize || this.size != barSize
this.total = scrollSize; if (sizeChanged) {
this.size = barSize; this.screen = clientSize;
this.total = scrollSize;
this.size = barSize;
}
var buttonSize = this.screen * (this.size / this.total); var buttonSize = this.screen * (this.size / this.total);
if (buttonSize < minButtonSize) { if (buttonSize < minButtonSize) {
...@@ -87,7 +90,7 @@ ...@@ -87,7 +90,7 @@
} }
this.inner.style[this.orientation == "horizontal" ? "width" : "height"] = this.inner.style[this.orientation == "horizontal" ? "width" : "height"] =
buttonSize + "px"; buttonSize + "px";
this.setPos(this.pos); this.setPos(this.pos, sizeChanged);
}; };
function SimpleScrollbars(cls, place, scroll) { function SimpleScrollbars(cls, place, scroll) {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
// highlighted only if the selected text is a word. showToken, when enabled, // highlighted only if the selected text is a word. showToken, when enabled,
// will cause the current token to be highlighted when nothing is selected. // will cause the current token to be highlighted when nothing is selected.
// delay is used to specify how much time to wait, in milliseconds, before // delay is used to specify how much time to wait, in milliseconds, before
// highlighting the matches. If annotateScrollbar is enabled, the occurances // highlighting the matches. If annotateScrollbar is enabled, the occurences
// will be highlighted on the scrollbar via the matchesonscrollbar addon. // will be highlighted on the scrollbar via the matchesonscrollbar addon.
(function(mod) { (function(mod) {
...@@ -29,26 +29,23 @@ ...@@ -29,26 +29,23 @@
})(function(CodeMirror) { })(function(CodeMirror) {
"use strict"; "use strict";
var DEFAULT_MIN_CHARS = 2; var defaults = {
var DEFAULT_TOKEN_STYLE = "matchhighlight"; style: "matchhighlight",
var DEFAULT_DELAY = 100; minChars: 2,
var DEFAULT_WORDS_ONLY = false; delay: 100,
wordsOnly: false,
annotateScrollbar: false,
showToken: false,
trim: true
}
function State(options) { function State(options) {
if (typeof options == "object") { this.options = {}
this.minChars = options.minChars; for (var name in defaults)
this.style = options.style; this.options[name] = (options && options.hasOwnProperty(name) ? options : defaults)[name]
this.showToken = options.showToken;
this.delay = options.delay;
this.wordsOnly = options.wordsOnly;
this.annotateScrollbar = options.annotateScrollbar;
}
if (this.style == null) this.style = DEFAULT_TOKEN_STYLE;
if (this.minChars == null) this.minChars = DEFAULT_MIN_CHARS;
if (this.delay == null) this.delay = DEFAULT_DELAY;
if (this.wordsOnly == null) this.wordsOnly = DEFAULT_WORDS_ONLY;
this.overlay = this.timeout = null; this.overlay = this.timeout = null;
this.matchesonscroll = null; this.matchesonscroll = null;
this.active = false;
} }
CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) { CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) {
...@@ -57,26 +54,44 @@ ...@@ -57,26 +54,44 @@
clearTimeout(cm.state.matchHighlighter.timeout); clearTimeout(cm.state.matchHighlighter.timeout);
cm.state.matchHighlighter = null; cm.state.matchHighlighter = null;
cm.off("cursorActivity", cursorActivity); cm.off("cursorActivity", cursorActivity);
cm.off("focus", onFocus)
} }
if (val) { if (val) {
cm.state.matchHighlighter = new State(val); var state = cm.state.matchHighlighter = new State(val);
highlightMatches(cm); if (cm.hasFocus()) {
state.active = true
highlightMatches(cm)
} else {
cm.on("focus", onFocus)
}
cm.on("cursorActivity", cursorActivity); cm.on("cursorActivity", cursorActivity);
} }
}); });
function cursorActivity(cm) { function cursorActivity(cm) {
var state = cm.state.matchHighlighter; var state = cm.state.matchHighlighter;
if (state.active || cm.hasFocus()) scheduleHighlight(cm, state)
}
function onFocus(cm) {
var state = cm.state.matchHighlighter
if (!state.active) {
state.active = true
scheduleHighlight(cm, state)
}
}
function scheduleHighlight(cm, state) {
clearTimeout(state.timeout); clearTimeout(state.timeout);
state.timeout = setTimeout(function() {highlightMatches(cm);}, state.delay); state.timeout = setTimeout(function() {highlightMatches(cm);}, state.options.delay);
} }
function addOverlay(cm, query, hasBoundary, style) { function addOverlay(cm, query, hasBoundary, style) {
var state = cm.state.matchHighlighter; var state = cm.state.matchHighlighter;
cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style)); cm.addOverlay(state.overlay = makeOverlay(query, hasBoundary, style));
if (state.annotateScrollbar) { if (state.options.annotateScrollbar && cm.showMatchesOnScrollbar) {
var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query; var searchFor = hasBoundary ? new RegExp("\\b" + query + "\\b") : query;
state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, true, state.matchesonscroll = cm.showMatchesOnScrollbar(searchFor, false,
{className: "CodeMirror-selection-highlight-scrollbar"}); {className: "CodeMirror-selection-highlight-scrollbar"});
} }
} }
...@@ -86,7 +101,7 @@ ...@@ -86,7 +101,7 @@
if (state.overlay) { if (state.overlay) {
cm.removeOverlay(state.overlay); cm.removeOverlay(state.overlay);
state.overlay = null; state.overlay = null;
if (state.annotateScrollbar) { if (state.matchesonscroll) {
state.matchesonscroll.clear(); state.matchesonscroll.clear();
state.matchesonscroll = null; state.matchesonscroll = null;
} }
...@@ -97,21 +112,22 @@ ...@@ -97,21 +112,22 @@
cm.operation(function() { cm.operation(function() {
var state = cm.state.matchHighlighter; var state = cm.state.matchHighlighter;
removeOverlay(cm); removeOverlay(cm);
if (!cm.somethingSelected() && state.showToken) { if (!cm.somethingSelected() && state.options.showToken) {
var re = state.showToken === true ? /[\w$]/ : state.showToken; var re = state.options.showToken === true ? /[\w$]/ : state.options.showToken;
var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start; var cur = cm.getCursor(), line = cm.getLine(cur.line), start = cur.ch, end = start;
while (start && re.test(line.charAt(start - 1))) --start; while (start && re.test(line.charAt(start - 1))) --start;
while (end < line.length && re.test(line.charAt(end))) ++end; while (end < line.length && re.test(line.charAt(end))) ++end;
if (start < end) if (start < end)
addOverlay(cm, line.slice(start, end), re, state.style); addOverlay(cm, line.slice(start, end), re, state.options.style);
return; return;
} }
var from = cm.getCursor("from"), to = cm.getCursor("to"); var from = cm.getCursor("from"), to = cm.getCursor("to");
if (from.line != to.line) return; if (from.line != to.line) return;
if (state.wordsOnly && !isWord(cm, from, to)) return; if (state.options.wordsOnly && !isWord(cm, from, to)) return;
var selection = cm.getRange(from, to).replace(/^\s+|\s+$/g, ""); var selection = cm.getRange(from, to)
if (selection.length >= state.minChars) if (state.options.trim) selection = selection.replace(/^\s+|\s+$/g, "")
addOverlay(cm, selection, false, state.style); if (selection.length >= state.options.minChars)
addOverlay(cm, selection, false, state.options.style);
}); });
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>matchesonscrollbar.css</string> </value> <value> <string>matchesonscrollbar.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -57,12 +57,13 @@ ...@@ -57,12 +57,13 @@
return cm.getSearchCursor(query, pos, queryCaseInsensitive(query)); return cm.getSearchCursor(query, pos, queryCaseInsensitive(query));
} }
function persistentDialog(cm, text, deflt, f) { function persistentDialog(cm, text, deflt, onEnter, onKeyDown) {
cm.openDialog(text, f, { cm.openDialog(text, onEnter, {
value: deflt, value: deflt,
selectValueOnOpen: true, selectValueOnOpen: true,
closeOnEnter: false, closeOnEnter: false,
onClose: function() { clearSearch(cm); } onClose: function() { clearSearch(cm); },
onKeyDown: onKeyDown
}); });
} }
...@@ -112,16 +113,19 @@ ...@@ -112,16 +113,19 @@
} }
} }
function doSearch(cm, rev, persistent) { function doSearch(cm, rev, persistent, immediate) {
var state = getSearchState(cm); var state = getSearchState(cm);
if (state.query) return findNext(cm, rev); if (state.query) return findNext(cm, rev);
var q = cm.getSelection() || state.lastQuery; var q = cm.getSelection() || state.lastQuery;
if (persistent && cm.openDialog) { if (persistent && cm.openDialog) {
var hiding = null var hiding = null
persistentDialog(cm, queryDialog, q, function(query, event) { var searchNext = function(query, event) {
CodeMirror.e_stop(event); CodeMirror.e_stop(event);
if (!query) return; if (!query) return;
if (query != state.queryText) startSearch(cm, state, query); if (query != state.queryText) {
startSearch(cm, state, query);
state.posFrom = state.posTo = cm.getCursor();
}
if (hiding) hiding.style.opacity = 1 if (hiding) hiding.style.opacity = 1
findNext(cm, event.shiftKey, function(_, to) { findNext(cm, event.shiftKey, function(_, to) {
var dialog var dialog
...@@ -130,7 +134,25 @@ ...@@ -130,7 +134,25 @@
dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top) dialog.getBoundingClientRect().bottom - 4 > cm.cursorCoords(to, "window").top)
(hiding = dialog).style.opacity = .4 (hiding = dialog).style.opacity = .4
}) })
};
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]
if (cmd == "findNext" || cmd == "findPrev" ||
cmd == "findPersistentNext" || cmd == "findPersistentPrev") {
CodeMirror.e_stop(event);
startSearch(cm, getSearchState(cm), query);
cm.execCommand(cmd);
} else if (cmd == "find" || cmd == "findPersistent") {
CodeMirror.e_stop(event);
searchNext(query, event);
}
}); });
if (immediate && q) {
startSearch(cm, state, q);
findNext(cm, rev);
}
} else { } else {
dialog(cm, queryDialog, "Search for:", q, function(query) { dialog(cm, queryDialog, "Search for:", q, function(query) {
if (query && !state.query) cm.operation(function() { if (query && !state.query) cm.operation(function() {
...@@ -193,7 +215,7 @@ ...@@ -193,7 +215,7 @@
replaceAll(cm, query, text) replaceAll(cm, query, text)
} else { } else {
clearSearch(cm); clearSearch(cm);
var cursor = getSearchCursor(cm, query, cm.getCursor()); var cursor = getSearchCursor(cm, query, cm.getCursor("from"));
var advance = function() { var advance = function() {
var start = cursor.from(), match; var start = cursor.from(), match;
if (!(match = cursor.findNext())) { if (!(match = cursor.findNext())) {
...@@ -220,6 +242,8 @@ ...@@ -220,6 +242,8 @@
CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);}; CodeMirror.commands.find = function(cm) {clearSearch(cm); doSearch(cm);};
CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);}; CodeMirror.commands.findPersistent = function(cm) {clearSearch(cm); doSearch(cm, false, true);};
CodeMirror.commands.findPersistentNext = function(cm) {doSearch(cm, false, true, true);};
CodeMirror.commands.findPersistentPrev = function(cm) {doSearch(cm, true, true, true);};
CodeMirror.commands.findNext = doSearch; CodeMirror.commands.findNext = doSearch;
CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);}; CodeMirror.commands.findPrev = function(cm) {doSearch(cm, true);};
CodeMirror.commands.clearSearch = clearSearch; CodeMirror.commands.clearSearch = clearSearch;
......
// CodeMirror, copyright (c) by Marijn Haverbeke and others // CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE // Distributed under an MIT license: http://codemirror.net/LICENSE
// Because sometimes you need to style the cursor's line.
//
// Adds an option 'styleActiveLine' which, when enabled, gives the
// active line's wrapping <div> the CSS class "CodeMirror-activeline",
// and gives its background <div> the class "CodeMirror-activeline-background".
(function(mod) { (function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror")); mod(require("../../lib/codemirror"));
...@@ -21,16 +15,18 @@ ...@@ -21,16 +15,18 @@
var GUTT_CLASS = "CodeMirror-activeline-gutter"; var GUTT_CLASS = "CodeMirror-activeline-gutter";
CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) {
var prev = old && old != CodeMirror.Init; var prev = old == CodeMirror.Init ? false : old;
if (val && !prev) { if (val == prev) return
cm.state.activeLines = []; if (prev) {
updateActiveLines(cm, cm.listSelections());
cm.on("beforeSelectionChange", selectionChange);
} else if (!val && prev) {
cm.off("beforeSelectionChange", selectionChange); cm.off("beforeSelectionChange", selectionChange);
clearActiveLines(cm); clearActiveLines(cm);
delete cm.state.activeLines; delete cm.state.activeLines;
} }
if (val) {
cm.state.activeLines = [];
updateActiveLines(cm, cm.listSelections());
cm.on("beforeSelectionChange", selectionChange);
}
}); });
function clearActiveLines(cm) { function clearActiveLines(cm) {
...@@ -52,7 +48,9 @@ ...@@ -52,7 +48,9 @@
var active = []; var active = [];
for (var i = 0; i < ranges.length; i++) { for (var i = 0; i < ranges.length; i++) {
var range = ranges[i]; var range = ranges[i];
if (!range.empty()) continue; var option = cm.getOption("styleActiveLine");
if (typeof option == "object" && option.nonEmpty ? range.anchor.line != range.head.line : !range.empty())
continue
var line = cm.getLineHandleVisualStart(range.head.line); var line = cm.getLineHandleVisualStart(range.head.line);
if (active[active.length - 1] != line) active.push(line); if (active[active.length - 1] != line) active.push(line);
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
<value> <string>tern.css</string> </value> <value> <string>tern.css</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/css</string> </value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>precondition</string> </key>
<value> <value> <string></string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
var data = findDoc(ts, doc); var data = findDoc(ts, doc);
var argHints = ts.cachedArgHints; var argHints = ts.cachedArgHints;
if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) <= 0) if (argHints && argHints.doc == doc && cmpPos(argHints.start, change.to) >= 0)
ts.cachedArgHints = null; ts.cachedArgHints = null;
var changed = data.changed; var changed = data.changed;
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
ts.request(cm, {type: "type", preferFunction: true, end: start}, function(error, data) { ts.request(cm, {type: "type", preferFunction: true, end: start}, function(error, data) {
if (error || !data.type || !(/^fn\(/).test(data.type)) return; if (error || !data.type || !(/^fn\(/).test(data.type)) return;
ts.cachedArgHints = { ts.cachedArgHints = {
start: pos, start: start,
type: parseFnType(data.type), type: parseFnType(data.type),
name: data.exprName || data.name || "fn", name: data.exprName || data.name || "fn",
guess: data.guess, guess: data.guess,
......
...@@ -30,7 +30,9 @@ ...@@ -30,7 +30,9 @@
} }
function findBreakPoint(text, column, wrapOn, killTrailingSpace) { function findBreakPoint(text, column, wrapOn, killTrailingSpace) {
for (var at = column; at > 0; --at) var at = column
while (at < text.length && text.charAt(at) == " ") at++
for (; at > 0; --at)
if (wrapOn.test(text.slice(at - 1, at + 1))) break; if (wrapOn.test(text.slice(at - 1, at + 1))) break;
for (var first = true;; first = false) { for (var first = true;; first = false) {
var endOfText = at; var endOfText = at;
......
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>authors.sh</string> </value> <value> <string>authors.sh</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>text/x-sh</string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<dictionary/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
// Script files are specified without .js ending. Prefixing them with // Script files are specified without .js ending. Prefixing them with
// their full (local) path is optional. So you may say lib/codemirror // 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 // or mode/xml/xml to be more precise. In fact, even the .js suffix
// may be speficied, if wanted. // may be specified, if wanted.
"use strict"; "use strict";
...@@ -68,7 +68,7 @@ walk("mode/"); ...@@ -68,7 +68,7 @@ walk("mode/");
if (!local && !blob) help(false); if (!local && !blob) help(false);
if (files.length) { if (files.length) {
console.log("Some speficied files were not found: " + console.log("Some specified files were not found: " +
files.map(function(a){return a.name;}).join(", ")); files.map(function(a){return a.name;}).join(", "));
process.exit(1); process.exit(1);
} }
......
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>compress</string> </value> <value> <string>compress</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>application/octet-stream</string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<dictionary/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,25 +2,29 @@ ...@@ -2,25 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="DTMLMethod" module="OFS.DTMLMethod"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
<value> <string>lint</string> </value> <value> <string>lint</string> </value>
</item> </item>
<item> <item>
<key> <string>_vars</string> </key> <key> <string>content_type</string> </key>
<value> <value> <string>application/octet-stream</string> </value>
<dictionary/> </item>
</value> <item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>globals</string> </key> <key> <string>title</string> </key>
<value> <value> <string></string> </value>
<dictionary/>
</value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -16,12 +16,12 @@ function rewrite(file, f) { ...@@ -16,12 +16,12 @@ function rewrite(file, f) {
fs.writeFileSync(file, f(fs.readFileSync(file, "utf8")), "utf8"); fs.writeFileSync(file, f(fs.readFileSync(file, "utf8")), "utf8");
} }
rewrite("lib/codemirror.js", function(lib) { rewrite("src/edit/main.js", function(lib) {
return lib.replace(/CodeMirror\.version = "\d+\.\d+\.\d+"/, return lib.replace(/CodeMirror\.version = "\d+\.\d+\.\d+"/,
"CodeMirror.version = \"" + number + "\""); "CodeMirror.version = \"" + number + "\"");
}); });
function rewriteJSON(pack) { function rewriteJSON(pack) {
return pack.replace(/"version":"\d+\.\d+\.\d+"/, "\"version\":\"" + number + "\""); return pack.replace(/"version":\s*"\d+\.\d+\.\d+"/, "\"version\": \"" + number + "\"");
} }
rewrite("package.json", rewriteJSON); rewrite("package.json", rewriteJSON);
rewrite("doc/manual.html", function(manual) { rewrite("doc/manual.html", function(manual) {
...@@ -32,14 +32,7 @@ if (bumpOnly) process.exit(0); ...@@ -32,14 +32,7 @@ if (bumpOnly) process.exit(0);
child.exec("bash bin/authors.sh", function(){}); child.exec("bash bin/authors.sh", function(){});
var simple = number.slice(0, number.lastIndexOf("."));
rewrite("doc/compress.html", function(cmp) {
return cmp.replace(/<option value="http:\/\/codemirror.net\/">HEAD<\/option>/,
"<option value=\"http://codemirror.net/\">HEAD</option>\n <option value=\"http://marijnhaverbeke.nl/git/codemirror?a=blob_plain;hb=" + number + ";f=\">" + simple + "</option>");
});
rewrite("index.html", function(index) { rewrite("index.html", function(index) {
return index.replace(/\.zip">\d+\.\d+<\/a>/, return index.replace(/\.zip">\d+\.\d+\.\d+<\/a>/,
".zip\">" + simple + "</a>"); ".zip\">" + number + "</a>");
}); });
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_Cacheable__manager_id</string> </key>
<value> <value> <string>http_cache</string> </value>
<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>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>__name__</string> </key>
<value> <string>text/html</string> </value> <value> <string>release</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>content_type</string> </key>
<value> <int>0</int> </value> <value> <string>application/octet-stream</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>precondition</string> </key>
<value> <string>release</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -17,14 +17,11 @@ if (sPos == -1 || sPos == process.argv.length - 1) { ...@@ -17,14 +17,11 @@ if (sPos == -1 || sPos == process.argv.length - 1) {
process.exit(1); process.exit(1);
} }
var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang; var lang = process.argv[sPos + 1].toLowerCase(), modeName = lang;
CodeMirror.modeInfo.forEach(function(info) { var found = CodeMirror.findModeByMIME(lang) || CodeMirror.findModeByName(lang)
if (info.mime == lang) { if (found) {
modeName = info.mode; modeName = found.mode
} else if (info.name.toLowerCase() == lang) { lang = found.mime
modeName = info.mode; }
lang = info.mime;
}
});
if (!CodeMirror.modes[modeName]) if (!CodeMirror.modes[modeName])
require("../mode/" + modeName + "/" + modeName + ".js"); require("../mode/" + modeName + "/" + modeName + ".js");
...@@ -48,4 +45,4 @@ CodeMirror.runMode(code, lang, function(text, style) { ...@@ -48,4 +45,4 @@ CodeMirror.runMode(code, lang, function(text, style) {
accum += text; accum += text;
} }
}); });
flush(); flush();
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="File" module="OFS.Image"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>_Cacheable__manager_id</string> </key>
<value> <value> <string>http_cache</string> </value>
<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>
<item> <item>
<key> <string>content_type</string> </key> <key> <string>__name__</string> </key>
<value> <string>text/html</string> </value> <value> <string>source-highlight</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>content_type</string> </key>
<value> <int>0</int> </value> <value> <string>application/octet-stream</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>precondition</string> </key>
<value> <string>source-highlight</string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
"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()
})
<?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>
{
"name": "codemirror",
"main": ["lib/codemirror.js", "lib/codemirror.css"],
"ignore": [
"**/.*",
"node_modules",
"components",
"bin",
"demo",
"doc",
"test",
"index.html",
"package.json",
"mode/*/*test.js",
"mode/*/*.html"
]
}
...@@ -65,14 +65,24 @@ ...@@ -65,14 +65,24 @@
</rss></textarea></form> </rss></textarea></form>
<script> <script>
var nonEmpty = false;
var editor = CodeMirror.fromTextArea(document.getElementById("code"), { var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: "application/xml", mode: "application/xml",
styleActiveLine: true, styleActiveLine: true,
lineNumbers: true, lineNumbers: true,
lineWrapping: 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> </script>
<p>Styling the current cursor line.</p> <p>Styling the current cursor line.</p>
</article> <button onclick="toggleSelProp()" id="toggleButton">Enable <code>nonEmpty</code> option</button>
\ No newline at end of file
</article>
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>activeline.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>activeline.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -76,4 +76,4 @@ to those.</p> ...@@ -76,4 +76,4 @@ to those.</p>
extraKeys: {"Ctrl-Space": "autocomplete"} extraKeys: {"Ctrl-Space": "autocomplete"}
}); });
</script> </script>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>anywordhint.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>anywordhint.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -30,28 +30,28 @@ ...@@ -30,28 +30,28 @@
<dl> <dl>
<dt id=option_value><code>value (string or Doc)</code></dt> <dt id=option_value><code>value (string or Doc)</code></dt>
<dd>قيمة الؚداية المحرر. يمكن أن تكون سلسلة، أو. كا؊ن مستند.</dd> <dd>قيمة البداية المحرر. يمكن أن تكون سلسلة، أو. كائن مستند.</dd>
<dt id=option_mode><code>mode (string or object)</code></dt> <dt id=option_mode><code>mode (string or object)</code></dt>
<dd>وضع الاستخدام. عندما لا تعطى، وهذا الافتراضي إلى الطريقة الاولى <dd>وضع الاستخدام. عندما لا تعطى، وهذا الافتراضي إلى الطريقة الاولى
التي تم تحميلها. قد يكون من سلسلة، والتي إما أسماء أو ؚؚساطة هو وضع التي تم تحميلها. قد يكون من سلسلة، والتي إما أسماء أو ببساطة هو وضع
MIME نوع المرتؚطة اسطة. ؚدلا من ذلك، قد يكون من كا؊ن يحتوي على MIME نوع المرتبطة اسطة. بدلا من ذلك، قد يكون من كائن يحتوي على
خيارات التكوين لواسطة، مع <code>name</code> الخاصية التي وضع أسماء خيارات التكوين لواسطة، مع <code>name</code> الخاصية التي وضع أسماء
(على سؚيل المثال <code>{name: "javascript", json: true}</code>). (على سبيل المثال <code>{name: "javascript", json: true}</code>).
صفحات التجريؚي لكل وضع تحتوي على معلومات حول ما معلمات تكوين وضع صفحات التجريبي لكل وضع تحتوي على معلومات حول ما معلمات تكوين وضع
يدعمها. يمكنك أن تطلؚ CodeMirror التي تم تعريفها طرق وأنواع MIME يدعمها. يمكنك أن تطلب CodeMirror التي تم تعريفها طرق وأنواع MIME
الك؎ف على <code>CodeMirror.modes</code> الكشف على <code>CodeMirror.modes</code>
و <code>CodeMirror.mimeModes</code> الكا؊نات. وضع خرا؊ط الأسماء و <code>CodeMirror.mimeModes</code> الكائنات. وضع خرائط الأسماء
الأولى لمن؎؊ات الخاصة ؚهم، وخرا؊ط لأنواع MIME 2 المواصفات الأولى لمنشئات الخاصة بهم، وخرائط لأنواع MIME 2 المواصفات
واسطة.</dd> واسطة.</dd>
<dt id=option_theme><code>theme (string)</code></dt> <dt id=option_theme><code>theme (string)</code></dt>
<dd>موضوع لنمط المحرر مع. يجؚ عليك التأكد من الملف CSS تحديد <dd>موضوع لنمط المحرر مع. يجب عليك التأكد من الملف CSS تحديد
المقاؚلة <code>.cm-s-[name]</code> يتم تحميل أنماط (ان؞ر المقابلة <code>.cm-s-[name]</code> يتم تحميل أنماط (انظر
<a href="../theme/"><code>theme</code></a> الدليل في التوزيع). <a href="../theme/"><code>theme</code></a> الدليل في التوزيع).
الافتراضي هو <code>"default"</code> ، والتي تم تضمينها في الافتراضي هو <code>"default"</code> ، والتي تم تضمينها في
الألوان <code>codemirror.css</code>. فمن الممكن استخدام ف؊ات متعددة الألوان <code>codemirror.css</code>. فمن الممكن استخدام فئات متعددة
في تطؚيق السمات مرة واحدة على سؚيل المثال <code>"foo bar"</code> في تطبيق السمات مرة واحدة على سبيل المثال <code>"foo bar"</code>
سيتم تعيين كل من <code>cm-s-foo</code> و <code>cm-s-bar</code> سيتم تعيين كل من <code>cm-s-foo</code> و <code>cm-s-bar</code>
الطؚقات إلى المحرر.</dd> الطبقات إلى المحرر.</dd>
</dl> </dl>
</textarea></form> </textarea></form>
...@@ -71,4 +71,4 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), { ...@@ -71,4 +71,4 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
bug</a> with cursor motion and mouse clicks in bi-directional lines bug</a> with cursor motion and mouse clicks in bi-directional lines
that are line wrapped.</p> that are line wrapped.</p>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>bidi.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>bidi.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
<!doctype html> <!doctype html>
<title>CodeMirror: B-Tree visualization</title> <title>CodeMirror: B-Tree visualization</title>
<meta charset="utf-8"/> <meta charset="utf-8"/>
...@@ -80,4 +80,4 @@ function fillEditor() { ...@@ -80,4 +80,4 @@ function fillEditor() {
<p><button onclick="fillEditor()">Add a lot of content</button></p> <p><button onclick="fillEditor()">Add a lot of content</button></p>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>btree.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>btree.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -106,4 +106,4 @@ selectBuffer(ed_bot, "js"); ...@@ -106,4 +106,4 @@ selectBuffer(ed_bot, "js");
using <a href="../doc/manual.html#swapDoc"><code>swapDoc</code></a> using <a href="../doc/manual.html#swapDoc"><code>swapDoc</code></a>
to use a single editor to display multiple documents.</p> to use a single editor to display multiple documents.</p>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>buffers.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>buffers.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -55,4 +55,4 @@ either JavaScript or Scheme mode based on that.</p> ...@@ -55,4 +55,4 @@ either JavaScript or Scheme mode based on that.</p>
editor.setOption("mode", looksLikeScheme(editor.getValue()) ? "scheme" : "javascript"); editor.setOption("mode", looksLikeScheme(editor.getValue()) ? "scheme" : "javascript");
} }
</script> </script>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>changemode.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>changemode.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<link rel="stylesheet" href="../lib/codemirror.css"> <link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script> <script src="../lib/codemirror.js"></script>
<script src="../addon/cm_edit/closebrackets.js"></script> <script src="../addon/edit/closebrackets.js"></script>
<script src="../mode/javascript/javascript.js"></script> <script src="../mode/javascript/javascript.js"></script>
<style type="text/css"> <style type="text/css">
.CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;} .CodeMirror {border-top: 1px solid #888; border-bottom: 1px solid #888;}
...@@ -49,4 +49,4 @@ Grid.prototype.moveValue = function(from, to) { ...@@ -49,4 +49,4 @@ Grid.prototype.moveValue = function(from, to) {
<script type="text/javascript"> <script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {autoCloseBrackets: true}); var editor = CodeMirror.fromTextArea(document.getElementById("code"), {autoCloseBrackets: true});
</script> </script>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>closebrackets.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>closebrackets.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<link rel="stylesheet" href="../lib/codemirror.css"> <link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script> <script src="../lib/codemirror.js"></script>
<script src="../addon/cm_edit/closetag.js"></script> <script src="../addon/edit/closetag.js"></script>
<script src="../addon/fold/xml-fold.js"></script> <script src="../addon/fold/xml-fold.js"></script>
<script src="../mode/xml/xml.js"></script> <script src="../mode/xml/xml.js"></script>
<script src="../mode/javascript/javascript.js"></script> <script src="../mode/javascript/javascript.js"></script>
...@@ -38,4 +38,4 @@ ...@@ -38,4 +38,4 @@
autoCloseTags: true autoCloseTags: true
}); });
</script> </script>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>closetag.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>closetag.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<script src="../addon/hint/show-hint.js"></script> <script src="../addon/hint/show-hint.js"></script>
<script src="../addon/hint/javascript-hint.js"></script> <script src="../addon/hint/javascript-hint.js"></script>
<script src="../mode/javascript/javascript.js"></script> <script src="../mode/javascript/javascript.js"></script>
<script src="../mode/markdown/markdown.js"></script>
<div id=nav> <div id=nav>
<a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a> <a href="http://codemirror.net"><h1>CodeMirror</h1><img id=logo src="../doc/logo.png"></a>
...@@ -69,11 +70,57 @@ on top of the <a href="../doc/manual.html#addon_show-hint"><code>show-hint</code ...@@ -69,11 +70,57 @@ on top of the <a href="../doc/manual.html#addon_show-hint"><code>show-hint</code
and <a href="../doc/manual.html#addon_javascript-hint"><code>javascript-hint</code></a> and <a href="../doc/manual.html#addon_javascript-hint"><code>javascript-hint</code></a>
addons.</p> addons.</p>
<script> <form><textarea style="display: none" id="synonyms" name="synonyms">
var editor = CodeMirror.fromTextArea(document.getElementById("code"), { Here, the completion use an asynchronous hinting functions to provide
lineNumbers: true, synonyms for each words. If your browser support `Promises`, the
extraKeys: {"Ctrl-Space": "autocomplete"}, hinting function can also return one.
mode: {name: "javascript", globalVars: true} </textarea></form>
});
</script> <script>
</article> var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
\ No newline at end of file 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>
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>complete.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>complete.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<script src="../lib/codemirror.js"></script> <script src="../lib/codemirror.js"></script>
<script src="../mode/clike/clike.js"></script> <script src="../mode/clike/clike.js"></script>
<script src="../keymap/emacs.js"></script> <script src="../keymap/emacs.js"></script>
<script src="../addon/cm_edit/matchbrackets.js"></script> <script src="../addon/edit/matchbrackets.js"></script>
<script src="../addon/comment/comment.js"></script> <script src="../addon/comment/comment.js"></script>
<script src="../addon/dialog/dialog.js"></script> <script src="../addon/dialog/dialog.js"></script>
<script src="../addon/search/searchcursor.js"></script> <script src="../addon/search/searchcursor.js"></script>
...@@ -72,4 +72,4 @@ or open a new window.</p> ...@@ -72,4 +72,4 @@ or open a new window.</p>
}); });
</script> </script>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>emacs.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>emacs.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -12,10 +12,12 @@ ...@@ -12,10 +12,12 @@
<script src="../addon/fold/foldgutter.js"></script> <script src="../addon/fold/foldgutter.js"></script>
<script src="../addon/fold/brace-fold.js"></script> <script src="../addon/fold/brace-fold.js"></script>
<script src="../addon/fold/xml-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/markdown-fold.js"></script>
<script src="../addon/fold/comment-fold.js"></script> <script src="../addon/fold/comment-fold.js"></script>
<script src="../mode/javascript/javascript.js"></script> <script src="../mode/javascript/javascript.js"></script>
<script src="../mode/xml/xml.js"></script> <script src="../mode/xml/xml.js"></script>
<script src="../mode/python/python.js"></script>
<script src="../mode/markdown/markdown.js"></script> <script src="../mode/markdown/markdown.js"></script>
<style type="text/css"> <style type="text/css">
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
...@@ -43,6 +45,24 @@ ...@@ -43,6 +45,24 @@
<textarea id="code" name="code"></textarea></div> <textarea id="code" name="code"></textarea></div>
<div style="max-width: 50em; margin-bottom: 1em">HTML:<br> <div style="max-width: 50em; margin-bottom: 1em">HTML:<br>
<textarea id="code-html" name="code-html"></textarea></div> <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> <div style="max-width: 50em">Markdown:<br>
<textarea id="code-markdown" name="code"></textarea></div> <textarea id="code-markdown" name="code"></textarea></div>
</form> </form>
...@@ -57,6 +77,7 @@ window.onload = function() { ...@@ -57,6 +77,7 @@ window.onload = function() {
sc.innerHTML = ""; sc.innerHTML = "";
var te_html = document.getElementById("code-html"); var te_html = document.getElementById("code-html");
te_html.value = document.documentElement.innerHTML; te_html.value = document.documentElement.innerHTML;
var te_python = document.getElementById("code-python");
var te_markdown = document.getElementById("code-markdown"); 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" te_markdown.value = "# Foo\n## Bar\n\nblah blah\n\n## Baz\n\nblah blah\n\n# Quux\n\nblah blah\n"
...@@ -81,6 +102,14 @@ window.onload = function() { ...@@ -81,6 +102,14 @@ window.onload = function() {
editor_html.foldCode(CodeMirror.Pos(0, 0)); editor_html.foldCode(CodeMirror.Pos(0, 0));
editor_html.foldCode(CodeMirror.Pos(21, 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, { window.editor_markdown = CodeMirror.fromTextArea(te_markdown, {
mode: "markdown", mode: "markdown",
lineNumbers: true, lineNumbers: true,
...@@ -92,4 +121,4 @@ window.onload = function() { ...@@ -92,4 +121,4 @@ window.onload = function() {
}; };
</script> </script>
</article> </article>
</body> </body>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>folding.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>folding.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -44,11 +44,11 @@ ...@@ -44,11 +44,11 @@
special <a href="#option_specialCharPlaceholder">placeholder</a>. special <a href="#option_specialCharPlaceholder">placeholder</a>.
Mostly useful for non-printing special characters. The default Mostly useful for non-printing special characters. The default
is <code>/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/</code>.</dd> is <code>/[\u0000-\u0019\u00ad\u200b\u2028\u2029\ufeff]/</code>.</dd>
<dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char) → Element</code></dt> <dt id="option_specialCharPlaceholder"><code><strong>specialCharPlaceholder</strong>: function(char) → Element</code></dt>
<dd>A function that, given a special character identified by <dd>A function that, given a special character identified by
the <a href="#option_specialChars"><code>specialChars</code></a> the <a href="#option_specialChars"><code>specialChars</code></a>
option, produces a DOM node that is used to represent the option, produces a DOM node that is used to represent the
character. By default, a red dot (<span style="color: red">•</span>) character. By default, a red dot (<span style="color: red"></span>)
is shown, with a title tooltip to indicate the character code.</dd> is shown, with a title tooltip to indicate the character code.</dd>
<dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt> <dt id="option_rtlMoveVisually"><code><strong>rtlMoveVisually</strong>: boolean</code></dt>
...@@ -80,4 +80,4 @@ ...@@ -80,4 +80,4 @@
addon. Press <strong>F11</strong> when cursor is in the editor to addon. Press <strong>F11</strong> when cursor is in the editor to
toggle full screen editing. <strong>Esc</strong> can also be used toggle full screen editing. <strong>Esc</strong> can also be used
to <i>exit</i> full screen editing.</p> to <i>exit</i> full screen editing.</p>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>fullscreen.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>fullscreen.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -72,4 +72,4 @@ editor.on("change", function(cm, change) { ...@@ -72,4 +72,4 @@ editor.on("change", function(cm, change) {
}); });
</script> </script>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>hardwrap.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>hardwrap.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>html5complete.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>html5complete.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>indentwrap.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>indentwrap.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>lint.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>lint.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -69,4 +69,4 @@ function change() { ...@@ -69,4 +69,4 @@ function change() {
} }
} }
</script> </script>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>loadmode.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>loadmode.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -40,7 +40,7 @@ editor.on("gutterClick", function(cm, n) { ...@@ -40,7 +40,7 @@ editor.on("gutterClick", function(cm, n) {
function makeMarker() { function makeMarker() {
var marker = document.createElement("div"); var marker = document.createElement("div");
marker.style.color = "#822"; marker.style.color = "#822";
marker.innerHTML = "●"; marker.innerHTML = "";
return marker; return marker;
} }
</textarea></form> </textarea></form>
...@@ -49,4 +49,4 @@ function makeMarker() { ...@@ -49,4 +49,4 @@ function makeMarker() {
<script>eval(document.getElementById("code").value);</script> <script>eval(document.getElementById("code").value);</script>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>marker.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>marker.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -49,4 +49,4 @@ editor.markText({line: 6, ch: 26}, {line: 6, ch: 42}, {className: "styled-backgr ...@@ -49,4 +49,4 @@ editor.markText({line: 6, ch: 26}, {line: 6, ch: 42}, {className: "styled-backgr
<p>Simple addon to easily mark (and style) selected text. <a href="../doc/manual.html#addon_mark-selection">Docs</a>.</p> <p>Simple addon to easily mark (and style) selected text. <a href="../doc/manual.html#addon_mark-selection">Docs</a>.</p>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>markselection.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>markselection.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -100,4 +100,4 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), { ...@@ -100,4 +100,4 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
<p>Search and highlight occurences of the selected text.</p> <p>Search and highlight occurences of the selected text.</p>
</article> </article>
\ No newline at end of file
...@@ -2,51 +2,29 @@ ...@@ -2,51 +2,29 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/> <global name="DTMLDocument" module="OFS.DTMLDocument"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
<item> <item>
<key> <string>_bind_names</string> </key> <key> <string>__name__</string> </key>
<value> <value> <string>matchhighlighter.html</string> </value>
<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>content_type</string> </key>
<value> <string>text/html</string> </value>
</item> </item>
<item> <item>
<key> <string>expand</string> </key> <key> <string>_vars</string> </key>
<value> <int>0</int> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>globals</string> </key>
<value> <string>matchhighlighter.html</string> </value> <value>
<dictionary/>
</value>
</item> </item>
<item> <item>
<key> <string>output_encoding</string> </key> <key> <string>title</string> </key>
<value> <string>iso-8859-15</string> </value> <value> <string></string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<link rel="stylesheet" href="../lib/codemirror.css"> <link rel="stylesheet" href="../lib/codemirror.css">
<script src="../lib/codemirror.js"></script> <script src="../lib/codemirror.js"></script>
<script src="../addon/fold/xml-fold.js"></script> <script src="../addon/fold/xml-fold.js"></script>
<script src="../addon/cm_edit/matchtags.js"></script> <script src="../addon/edit/matchtags.js"></script>
<script src="../mode/xml/xml.js"></script> <script src="../mode/xml/xml.js"></script>
<style type="text/css"> <style type="text/css">
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} .CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
...@@ -45,4 +45,4 @@ window.onload = function() { ...@@ -45,4 +45,4 @@ window.onload = function() {
<p>Put the cursor on or inside a pair of tags to highlight them. <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 Press Ctrl-J to jump to the tag that matches the one under the
cursor.</p> cursor.</p>
</article> </article>
\ No newline at end of file
  • To workaround the problem described in 54087b03 , last time we updated codemirror we used a sed to replace edit by cm_edit using the procedure described in 639c0d5a

    In this commit, portal_skins/erp5_code_mirror/codemirror/addon/edit is properly renamed to portal_skins/erp5_code_mirror/codemirror/addon/cm_edit, but it adds a new portal_skins/erp5_code_mirror/codemirror/src/edit folder which will cause the same problem.

    I'm also wondering, are the files from this src folder used ? isn't there a built version ?

  • The src folder doesn't seem to be used. We can drop it from portal_skins/erp5_code_mirror/codemirror

Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment