erp_app 3.0.7 → 3.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +23 -0
- data/app/controllers/erp_app/application_controller.rb +1 -0
- data/app/controllers/erp_app/desktop/file_manager/base_controller.rb +33 -23
- data/app/controllers/erp_app/public_controller.rb +2 -3
- data/app/controllers/erp_app/shared/configuration_controller.rb +1 -0
- data/app/controllers/erp_app/shared/notes_controller.rb +1 -0
- data/app/controllers/erp_app/shared/profile_management_controller.rb +22 -0
- data/app/controllers/erp_app/widget_proxy_controller.rb +2 -1
- data/app/models/configuration.rb +7 -0
- data/app/views/erp_app/desktop/base/index.erb +2 -3
- data/app/views/erp_app/login/index.erb +1 -1
- data/app/views/erp_app/mobile/base/index.erb +1 -0
- data/app/views/erp_app/organizer/base/index.erb +2 -3
- data/config/routes.rb +1 -1
- data/lib/active_ext/ext_helpers/column_builder.rb +118 -118
- data/lib/erp_app/config.rb +8 -4
- data/lib/erp_app/extensions/railties/action_view/base.rb +0 -1
- data/lib/erp_app/extensions/railties/action_view/helpers/include_helper.rb +18 -3
- data/lib/erp_app/version.rb +1 -1
- data/lib/erp_app/widgets/base.rb +5 -4
- data/lib/erp_app/widgets/loader.rb +2 -2
- data/public/images/btn/left_panel/left_panel_16x16.png +0 -0
- data/public/images/btn/left_right_panel/left_right_panel_16x16.png +0 -0
- data/public/images/btn/right_panel/right_panel_16x16.png +0 -0
- data/public/images/btn/save/save_16x16.png +0 -0
- data/public/images/btn/save_all/save_all_16x16.png +0 -0
- data/public/javascripts/erp_app/ckeditor/ckeditor.js +138 -135
- data/public/javascripts/erp_app/ckeditor/config.js +1 -1
- data/public/javascripts/erp_app/ckeditor/contents.css +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/_languages.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/_translationstatus.txt +62 -59
- data/public/javascripts/erp_app/ckeditor/lang/af.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ar.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/bg.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/bn.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/bs.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ca.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/cs.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/cy.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/da.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/de.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/el.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/en-au.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/en-ca.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/en-gb.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/en.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/eo.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/es.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/et.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/eu.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/fa.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/fi.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/fo.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/fr-ca.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/fr.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/gl.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/gu.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/he.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/hi.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/hr.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/hu.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/id.js +6 -0
- data/public/javascripts/erp_app/ckeditor/lang/is.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/it.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ja.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ka.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/km.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ko.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/lt.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/lv.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/mk.js +6 -0
- data/public/javascripts/erp_app/ckeditor/lang/mn.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ms.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/nb.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/nl.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/no.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/pl.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/pt-br.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/pt.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ro.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ru.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/sk.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/sl.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/sr-latn.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/sr.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/sv.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/th.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/tr.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/ug.js +6 -0
- data/public/javascripts/erp_app/ckeditor/lang/uk.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/vi.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/zh-cn.js +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/zh.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/_translationstatus.txt +25 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/cs.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/cy.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/da.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/de.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/el.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/en.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/eo.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/fa.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/fi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/fr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/gu.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/he.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/it.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/mk.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/nb.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/nl.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/no.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/pt-br.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/ro.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/tr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/ug.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/vi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/a11yhelp/lang/zh-cn.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/about/dialogs/about.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/adobeair/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/ajax/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/autogrow/plugin.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/bbcode/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/clipboard/dialogs/paste.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/colordialog/dialogs/colordialog.js +3 -3
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/_translationstatus.txt +28 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/bg.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/cs.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/cy.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/da.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/de.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/el.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/en.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/eo.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/et.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/fa.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/fi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/fr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/gu.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/he.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/hr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/it.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/nb.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/nl.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/no.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/pl.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/pt-br.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/tr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/ug.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/uk.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/vi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/lang/zh-cn.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/devtools/plugin.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/dialog/dialogDefinition.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/div/dialogs/div.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/docprops/dialogs/docprops.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/docprops/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/find/dialogs/find.js +3 -3
- data/public/javascripts/erp_app/ckeditor/plugins/flash/dialogs/flash.js +4 -4
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/button.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/checkbox.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/form.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/hiddenfield.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/radio.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/select.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/textarea.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/textfield.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/iframe/dialogs/iframe.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/iframedialog/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/image/dialogs/image.js +9 -9
- data/public/javascripts/erp_app/ckeditor/plugins/inlineeditsave/plugin.js +40 -0
- data/public/javascripts/erp_app/ckeditor/plugins/link/dialogs/anchor.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/link/dialogs/link.js +5 -5
- data/public/javascripts/erp_app/ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/pastefromword/filter/default.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/pastetext/dialogs/pastetext.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/dialogs/placeholder.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/_translationstatus.txt +27 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/bg.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/cs.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/cy.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/da.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/de.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/el.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/en.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/eo.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/et.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/fa.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/fi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/fr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/he.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/hr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/it.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/nb.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/nl.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/no.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/pl.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/pt-br.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/tr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/ug.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/uk.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/vi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/lang/zh-cn.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/placeholder/plugin.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/preview/preview.html +10 -0
- data/public/javascripts/erp_app/ckeditor/plugins/scayt/dialogs/options.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/scayt/dialogs/toolbar.css +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/_translationstatus.txt +22 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/cs.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/cy.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/de.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/el.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/en.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/eo.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/et.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/fa.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/fi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/fr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/he.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/hr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/it.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/nb.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/nl.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/no.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/pt-br.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/tr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/ug.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/zh-cn.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/styles/styles/default.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/stylesheetparser/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/table/dialogs/table.js +5 -5
- data/public/javascripts/erp_app/ckeditor/plugins/tableresize/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/tabletools/dialogs/tableCell.js +3 -3
- data/public/javascripts/erp_app/ckeditor/plugins/templates/dialogs/templates.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/templates/templates/default.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/dialogs/uicolor.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/_translationstatus.txt +28 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/bg.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/cs.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/cy.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/da.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/de.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/el.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/en.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/eo.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/et.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/fa.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/fi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/fr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/he.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/hr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/it.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/mk.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/nb.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/nl.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/no.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/pl.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/pt-br.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/tr.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/ug.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/uk.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/vi.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/lang/zh-cn.js +6 -0
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/plugin.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/yui/assets/yui.css +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/uicolor/yui/yui.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/wsc/dialogs/ciframe.html +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/wsc/dialogs/wsc.css +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/wsc/dialogs/wsc.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/xml/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/kama/dialog.css +6 -6
- data/public/javascripts/erp_app/ckeditor/skins/kama/editor.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/kama/skin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/kama/templates.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/office2003/dialog.css +6 -5
- data/public/javascripts/erp_app/ckeditor/skins/office2003/editor.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/office2003/skin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/office2003/templates.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/v2/dialog.css +5 -5
- data/public/javascripts/erp_app/ckeditor/skins/v2/editor.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/v2/skin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/v2/templates.css +1 -1
- data/public/javascripts/erp_app/ckeditor/themes/default/theme.js +1 -1
- data/public/javascripts/erp_app/ckeditor_example_config_override.js +2 -1
- data/public/javascripts/erp_app/codemirror/LICENSE +5 -1
- data/public/javascripts/erp_app/codemirror/README.md +6 -4
- data/public/javascripts/erp_app/codemirror/{css → doc}/baboon.png +0 -0
- data/public/javascripts/erp_app/codemirror/{css → doc}/baboon_vector.svg +0 -0
- data/public/javascripts/erp_app/codemirror/doc/compress.html +155 -0
- data/public/javascripts/erp_app/codemirror/{css → doc}/docs.css +0 -0
- data/public/javascripts/erp_app/codemirror/doc/internals.html +494 -0
- data/public/javascripts/erp_app/codemirror/{manual.html → doc/manual.html} +465 -167
- data/public/javascripts/erp_app/codemirror/doc/oldrelease.html +267 -0
- data/public/javascripts/erp_app/codemirror/doc/reporting.html +57 -0
- data/public/javascripts/erp_app/codemirror/doc/upgrade_v2.2.html +95 -0
- data/public/javascripts/erp_app/codemirror/keymap/emacs.js +29 -0
- data/public/javascripts/erp_app/codemirror/keymap/vim.js +785 -0
- data/public/javascripts/erp_app/codemirror/lib/codemirror.css +116 -14
- data/public/javascripts/erp_app/codemirror/lib/codemirror.js +2128 -1054
- data/public/javascripts/erp_app/codemirror/lib/util/closetag.js +164 -0
- data/public/javascripts/erp_app/codemirror/lib/util/dialog.css +27 -0
- data/public/javascripts/erp_app/codemirror/lib/util/dialog.js +67 -0
- data/public/javascripts/erp_app/codemirror/lib/util/foldcode.js +196 -0
- data/public/javascripts/erp_app/codemirror/lib/util/formatting.js +299 -0
- data/public/javascripts/erp_app/codemirror/lib/util/javascript-hint.js +134 -0
- data/public/javascripts/erp_app/codemirror/lib/util/loadmode.js +51 -0
- data/public/javascripts/erp_app/codemirror/lib/util/match-highlighter.js +44 -0
- data/public/javascripts/erp_app/codemirror/lib/util/multiplex.js +81 -0
- data/public/javascripts/erp_app/codemirror/lib/{overlay.js → util/overlay.js} +3 -2
- data/public/javascripts/erp_app/codemirror/lib/util/pig-hint.js +123 -0
- data/public/javascripts/erp_app/codemirror/lib/util/runmode.js +49 -0
- data/public/javascripts/erp_app/codemirror/lib/util/search.js +118 -0
- data/public/javascripts/erp_app/codemirror/lib/util/searchcursor.js +117 -0
- data/public/javascripts/erp_app/codemirror/lib/util/simple-hint.css +16 -0
- data/public/javascripts/erp_app/codemirror/lib/util/simple-hint.js +76 -0
- data/public/javascripts/erp_app/codemirror/lib/util/xml-hint.js +137 -0
- data/public/javascripts/erp_app/codemirror/mode/clike/clike.js +50 -17
- data/public/javascripts/erp_app/codemirror/mode/clike/index.html +4 -5
- data/public/javascripts/erp_app/codemirror/mode/clike/scala.html +765 -0
- data/public/javascripts/erp_app/codemirror/mode/clojure/clojure.js +207 -0
- data/public/javascripts/erp_app/codemirror/mode/clojure/index.html +66 -0
- data/public/javascripts/erp_app/codemirror/mode/coffeescript/coffeescript.js +101 -63
- data/public/javascripts/erp_app/codemirror/mode/coffeescript/index.html +9 -4
- data/public/javascripts/erp_app/codemirror/mode/css/css.js +4 -4
- data/public/javascripts/erp_app/codemirror/mode/css/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/diff/diff.js +24 -5
- data/public/javascripts/erp_app/codemirror/mode/diff/index.html +12 -7
- data/public/javascripts/erp_app/codemirror/mode/ecl/ecl.js +203 -0
- data/public/javascripts/erp_app/codemirror/mode/ecl/index.html +42 -0
- data/public/javascripts/erp_app/codemirror/mode/erlang/erlang.js +463 -0
- data/public/javascripts/erp_app/codemirror/mode/erlang/index.html +62 -0
- data/public/javascripts/erp_app/codemirror/mode/gfm/gfm.js +144 -0
- data/public/javascripts/erp_app/codemirror/mode/gfm/index.html +47 -0
- data/public/javascripts/erp_app/codemirror/mode/go/go.js +170 -0
- data/public/javascripts/erp_app/codemirror/mode/go/index.html +72 -0
- data/public/javascripts/erp_app/codemirror/mode/groovy/groovy.js +210 -0
- data/public/javascripts/erp_app/codemirror/mode/groovy/index.html +71 -0
- data/public/javascripts/erp_app/codemirror/mode/haskell/index.html +3 -3
- data/public/javascripts/erp_app/codemirror/mode/haxe/haxe.js +432 -0
- data/public/javascripts/erp_app/codemirror/mode/haxe/index.html +90 -0
- data/public/javascripts/erp_app/codemirror/mode/htmlembedded/htmlembedded.js +68 -0
- data/public/javascripts/erp_app/codemirror/mode/htmlembedded/index.html +49 -0
- data/public/javascripts/erp_app/codemirror/mode/htmlmixed/htmlmixed.js +8 -2
- data/public/javascripts/erp_app/codemirror/mode/htmlmixed/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/javascript/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/javascript/javascript.js +26 -13
- data/public/javascripts/erp_app/codemirror/mode/jinja2/index.html +37 -0
- data/public/javascripts/erp_app/codemirror/mode/jinja2/jinja2.js +42 -0
- data/public/javascripts/erp_app/codemirror/mode/less/index.html +618 -0
- data/public/javascripts/erp_app/codemirror/mode/less/less.js +232 -0
- data/public/javascripts/erp_app/codemirror/mode/lua/index.html +3 -3
- data/public/javascripts/erp_app/codemirror/mode/lua/lua.js +5 -3
- data/public/javascripts/erp_app/codemirror/mode/markdown/index.html +340 -0
- data/public/javascripts/erp_app/codemirror/mode/markdown/markdown.js +268 -0
- data/public/javascripts/erp_app/codemirror/mode/mysql/index.html +41 -0
- data/public/javascripts/erp_app/codemirror/mode/mysql/mysql.js +186 -0
- data/public/javascripts/erp_app/codemirror/mode/ntriples/index.html +32 -0
- data/public/javascripts/erp_app/codemirror/mode/ntriples/ntriples.js +172 -0
- data/public/javascripts/erp_app/codemirror/mode/ocaml/index.html +130 -0
- data/public/javascripts/erp_app/codemirror/mode/ocaml/ocaml.js +114 -0
- data/public/javascripts/erp_app/codemirror/mode/pascal/LICENSE +7 -0
- data/public/javascripts/erp_app/codemirror/mode/pascal/index.html +48 -0
- data/public/javascripts/erp_app/codemirror/mode/pascal/pascal.js +94 -0
- data/public/javascripts/erp_app/codemirror/mode/perl/LICENSE +19 -0
- data/public/javascripts/erp_app/codemirror/mode/perl/index.html +62 -0
- data/public/javascripts/erp_app/codemirror/mode/perl/perl.js +816 -0
- data/public/javascripts/erp_app/codemirror/mode/php/index.html +4 -5
- data/public/javascripts/erp_app/codemirror/mode/php/php.js +62 -27
- data/public/javascripts/erp_app/codemirror/mode/pig/index.html +42 -0
- data/public/javascripts/erp_app/codemirror/mode/pig/pig.js +172 -0
- data/public/javascripts/erp_app/codemirror/mode/plsql/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/plsql/plsql.js +2 -2
- data/public/javascripts/erp_app/codemirror/mode/properties/index.html +40 -0
- data/public/javascripts/erp_app/codemirror/mode/properties/properties.js +63 -0
- data/public/javascripts/erp_app/codemirror/mode/python/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/python/python.js +59 -42
- data/public/javascripts/erp_app/codemirror/mode/r/index.html +5 -5
- data/public/javascripts/erp_app/codemirror/mode/r/r.js +9 -2
- data/public/javascripts/erp_app/codemirror/mode/rpm/changes/changes.js +19 -0
- data/public/javascripts/erp_app/codemirror/mode/rpm/changes/index.html +53 -0
- data/public/javascripts/erp_app/codemirror/mode/rpm/spec/index.html +99 -0
- data/public/javascripts/erp_app/codemirror/mode/rpm/spec/spec.css +5 -0
- data/public/javascripts/erp_app/codemirror/mode/rpm/spec/spec.js +66 -0
- data/public/javascripts/erp_app/codemirror/mode/rst/index.html +4 -5
- data/public/javascripts/erp_app/codemirror/mode/rst/rst.js +15 -22
- data/public/javascripts/erp_app/codemirror/mode/ruby/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/ruby/ruby.js +49 -36
- data/public/javascripts/erp_app/codemirror/mode/rust/index.html +48 -0
- data/public/javascripts/erp_app/codemirror/mode/rust/rust.js +432 -0
- data/public/javascripts/erp_app/codemirror/mode/scheme/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/scheme/scheme.js +71 -23
- data/public/javascripts/erp_app/codemirror/mode/shell/index.html +50 -0
- data/public/javascripts/erp_app/codemirror/mode/shell/shell.js +118 -0
- data/public/javascripts/erp_app/codemirror/mode/smalltalk/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/smalltalk/smalltalk.js +137 -120
- data/public/javascripts/erp_app/codemirror/mode/smarty/index.html +82 -0
- data/public/javascripts/erp_app/codemirror/mode/smarty/smarty.js +148 -0
- data/public/javascripts/erp_app/codemirror/mode/sparql/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/mode/stex/index.html +4 -5
- data/public/javascripts/erp_app/codemirror/mode/stex/stex.js +22 -7
- data/public/javascripts/erp_app/codemirror/mode/stex/test.html +263 -0
- data/public/javascripts/erp_app/codemirror/mode/tiddlywiki/index.html +140 -0
- data/public/javascripts/erp_app/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/public/javascripts/erp_app/codemirror/mode/tiddlywiki/tiddlywiki.js +384 -0
- data/public/javascripts/erp_app/codemirror/mode/tiki/index.html +82 -0
- data/public/javascripts/erp_app/codemirror/mode/tiki/tiki.css +26 -0
- data/public/javascripts/erp_app/codemirror/mode/tiki/tiki.js +316 -0
- data/public/javascripts/erp_app/codemirror/mode/vb/LICENSE.txt +21 -0
- data/public/javascripts/erp_app/codemirror/mode/vb/index.html +88 -0
- data/public/javascripts/erp_app/codemirror/mode/vb/vb.js +260 -0
- data/public/javascripts/erp_app/codemirror/mode/vbscript/index.html +42 -0
- data/public/javascripts/erp_app/codemirror/mode/vbscript/vbscript.js +26 -0
- data/public/javascripts/erp_app/codemirror/mode/velocity/index.html +3 -3
- data/public/javascripts/erp_app/codemirror/mode/verilog/index.html +210 -0
- data/public/javascripts/erp_app/codemirror/mode/verilog/verilog.js +194 -0
- data/public/javascripts/erp_app/codemirror/mode/xml/index.html +7 -5
- data/public/javascripts/erp_app/codemirror/mode/xml/xml.js +127 -32
- data/public/javascripts/erp_app/codemirror/mode/xquery/LICENSE +20 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/index.html +222 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/test/index.html +27 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/test/testBase.js +42 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/test/testEmptySequenceKeyword.js +16 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/test/testMultiAttr.js +16 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/test/testNamespaces.js +91 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/test/testProcessingInstructions.js +16 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/test/testQuotes.js +19 -0
- data/public/javascripts/erp_app/codemirror/mode/xquery/xquery.js +448 -0
- data/public/javascripts/erp_app/codemirror/mode/yaml/index.html +3 -4
- data/public/javascripts/erp_app/codemirror/package.json +29 -0
- data/public/javascripts/erp_app/codemirror/test/driver.js +42 -0
- data/public/javascripts/erp_app/codemirror/test/index.html +55 -0
- data/public/javascripts/erp_app/codemirror/test/mode_test.css +22 -0
- data/public/javascripts/erp_app/codemirror/test/mode_test.js +164 -0
- data/public/javascripts/erp_app/codemirror/test/test.js +467 -0
- data/public/javascripts/erp_app/codemirror/theme/ambiance.css +81 -0
- data/public/javascripts/erp_app/codemirror/theme/blackboard.css +25 -0
- data/public/javascripts/erp_app/codemirror/theme/cobalt.css +18 -0
- data/public/javascripts/erp_app/codemirror/theme/eclipse.css +25 -0
- data/public/javascripts/erp_app/codemirror/theme/elegant.css +3 -2
- data/public/javascripts/erp_app/codemirror/theme/erlang-dark.css +21 -0
- data/public/javascripts/erp_app/codemirror/theme/lesser-dark.css +44 -0
- data/public/javascripts/erp_app/codemirror/theme/monokai.css +28 -0
- data/public/javascripts/erp_app/codemirror/theme/neat.css +4 -3
- data/public/javascripts/erp_app/codemirror/theme/night.css +2 -1
- data/public/javascripts/erp_app/codemirror/theme/rubyblue.css +21 -0
- data/public/javascripts/erp_app/codemirror/theme/vibrant-ink.css +27 -0
- data/public/javascripts/erp_app/codemirror/theme/xq-dark.css +46 -0
- data/public/javascripts/erp_app/codemirror_highlight.js +17 -0
- data/public/javascripts/erp_app/desktop/applications/audit_log_viewer/module.js +1 -57
- data/public/javascripts/erp_app/desktop/applications/control_panel/application_management_panel.js +1 -2
- data/public/javascripts/erp_app/desktop/applications/control_panel/module.js +1 -1
- data/public/javascripts/erp_app/desktop/applications/file_manager/module.js +12 -1
- data/public/javascripts/erp_app/desktop/ext_ux_desktop_module.js +9 -1
- data/public/javascripts/erp_app/jquery_support.js +6 -1
- data/public/javascripts/erp_app/login/window.js +1 -1
- data/public/javascripts/erp_app/organizer/default_menu_tree_panel.js +3 -1
- data/public/javascripts/erp_app/organizer/layout.js +92 -79
- data/public/javascripts/erp_app/organizer/preference_window.js +1 -1
- data/public/javascripts/erp_app/{desktop/applications/audit_log_viewer → shared/audit_log}/audit_log_grid_panel.js +1 -0
- data/public/javascripts/erp_app/{desktop/applications/audit_log_viewer → shared/audit_log}/audit_log_item_grid_panel.js +0 -0
- data/public/javascripts/erp_app/shared/audit_log/audit_log_tab_panel.js +52 -0
- data/public/javascripts/erp_app/shared/compass_ckeditor.js +51 -1
- data/public/javascripts/erp_app/shared/compass_codemirror.js +2 -8
- data/public/javascripts/erp_app/shared/configuration/configuration_panel.js +24 -22
- data/public/javascripts/erp_app/shared/dynamic_editable_grid.js +1 -0
- data/public/javascripts/erp_app/shared/dynamic_editable_grid_loader_panel.js +5 -1
- data/public/javascripts/erp_app/shared/file_manager_tree.js +358 -270
- data/public/javascripts/erp_app/shared/file_upload/Ext.ux.panel.UploadPanel.js +580 -0
- data/public/javascripts/erp_app/shared/file_upload/plupload.flash.swf +0 -0
- data/public/javascripts/erp_app/shared/file_upload/plupload.full.js +2 -0
- data/public/javascripts/erp_app/shared/file_upload/plupload.silverlight.xap +0 -0
- data/public/javascripts/erp_app/shared/file_upload/upload_window.js +19 -212
- data/public/javascripts/erp_app/{desktop/applications/control_panel → shared}/profile_management_panel.js +14 -23
- data/public/javascripts/erp_app/utility.js +340 -272
- data/public/javascripts/erp_app/widgets.js +2 -2
- data/public/javascripts/extjs/MultiCellSelectionModel.js +490 -0
- data/public/javascripts/jquery_plugins/jquery.address.min.js +21 -24
- data/public/stylesheets/erp_app/desktop/base.css +3 -1
- data/public/stylesheets/erp_app/shared/compass-ext-all.css +29 -0
- data/public/stylesheets/erp_app/shared/hover_finger.css +4 -0
- metadata +267 -71
- data/app/controllers/erp_app/desktop/control_panel/profile_management_controller.rb +0 -23
- data/app/models/extensions/party.rb +0 -39
- data/public/images/icons/add/Thumbs.db +0 -0
- data/public/images/icons/calendar/Thumbs.db +0 -0
- data/public/images/icons/copy/Thumbs.db +0 -0
- data/public/images/icons/cut/Thumbs.db +0 -0
- data/public/images/icons/delete/Thumbs.db +0 -0
- data/public/images/icons/edit/Thumbs.db +0 -0
- data/public/images/icons/folder/Thumbs.db +0 -0
- data/public/images/icons/gear/Thumbs.db +0 -0
- data/public/images/icons/globe/Thumbs.db +0 -0
- data/public/images/icons/grid/Thumbs.db +0 -0
- data/public/images/icons/help/Thumbs.db +0 -0
- data/public/images/icons/information/Thumbs.db +0 -0
- data/public/images/icons/key/Thumbs.db +0 -0
- data/public/images/icons/log_out/Thumbs.db +0 -0
- data/public/images/icons/mail/Thumbs.db +0 -0
- data/public/images/icons/new/Thumbs.db +0 -0
- data/public/images/icons/next/Thumbs.db +0 -0
- data/public/images/icons/open/Thumbs.db +0 -0
- data/public/images/icons/paste/Thumbs.db +0 -0
- data/public/images/icons/picture/Thumbs.db +0 -0
- data/public/images/icons/presentation/Thumbs.db +0 -0
- data/public/images/icons/preview/Thumbs.db +0 -0
- data/public/images/icons/previous/Thumbs.db +0 -0
- data/public/images/icons/print/Thumbs.db +0 -0
- data/public/images/icons/properties/Thumbs.db +0 -0
- data/public/images/icons/redo/Thumbs.db +0 -0
- data/public/images/icons/refresh/Thumbs.db +0 -0
- data/public/images/icons/remove/Thumbs.db +0 -0
- data/public/images/icons/rename/Thumbs.db +0 -0
- data/public/images/icons/save/Thumbs.db +0 -0
- data/public/images/icons/search/Thumbs.db +0 -0
- data/public/images/icons/send/Thumbs.db +0 -0
- data/public/images/icons/settings/Thumbs.db +0 -0
- data/public/images/icons/synchronize/Thumbs.db +0 -0
- data/public/images/icons/undo/Thumbs.db +0 -0
- data/public/images/icons/upload/Thumbs.db +0 -0
- data/public/images/icons/user/Thumbs.db +0 -0
- data/public/images/icons/zoom_in/Thumbs.db +0 -0
- data/public/images/icons/zoom_out/Thumbs.db +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/jwplayer/jwplayer/Thumbs.db +0 -0
- data/public/javascripts/erp_app/codemirror/lib/runmode.js +0 -27
- data/public/javascripts/erp_app/codemirror/mode/diff/diff.css +0 -3
- data/public/javascripts/erp_app/codemirror/mode/rst/rst.css +0 -75
- data/public/javascripts/erp_app/codemirror/mode/xmlpure/index.html +0 -60
- data/public/javascripts/erp_app/codemirror/mode/xmlpure/xmlpure.js +0 -481
- data/public/javascripts/erp_app/codemirror/theme/default.css +0 -19
- data/public/javascripts/erp_app/shared/file_upload/Ext.ux.AwesomeUploader.js +0 -511
- data/public/javascripts/erp_app/shared/file_upload/Ext.ux.AwesomeUploaderLocalization.js +0 -45
- data/public/javascripts/erp_app/shared/file_upload/Ext.ux.XHRUpload.js +0 -138
- data/public/javascripts/erp_app/tinymce/Ext.ux.TinyMCE.js +0 -689
- data/public/javascripts/erp_app/tinymce/center_region.js +0 -611
@@ -3,7 +3,7 @@
|
|
3
3
|
<head>
|
4
4
|
<title>CodeMirror: User Manual</title>
|
5
5
|
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans:bold"/>
|
6
|
-
<link rel="stylesheet" type="text/css" href="
|
6
|
+
<link rel="stylesheet" type="text/css" href="docs.css"/>
|
7
7
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
8
8
|
<style>dl dl {margin: 0;}</style>
|
9
9
|
</head>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<h1><span class="logo-braces">{ }</span> <a href="http://codemirror.net/">CodeMirror</a></h1>
|
13
13
|
|
14
14
|
<pre class="grey">
|
15
|
-
<img src="
|
15
|
+
<img src="baboon.png" class="logo" alt="logo"/>/* User manual and
|
16
16
|
reference guide */
|
17
17
|
</pre>
|
18
18
|
|
@@ -21,17 +21,19 @@
|
|
21
21
|
<h2 id="overview">Overview</h2>
|
22
22
|
|
23
23
|
<p>CodeMirror is a code-editor component that can be embedded in
|
24
|
-
Web pages.
|
25
|
-
accompanying buttons
|
26
|
-
(see <a href="http://www.octolabs.com/javascripts/codemirror-ui/">CodeMirror
|
27
|
-
UI</a> for a drop-in button bar), auto-completion, or other IDE
|
24
|
+
Web pages. The code library provides <em>only</em> the editor
|
25
|
+
component, no accompanying buttons, auto-completion, or other IDE
|
28
26
|
functionality. It does provide a rich API on top of which such
|
29
|
-
functionality can be straightforwardly implemented
|
27
|
+
functionality can be straightforwardly implemented. See
|
28
|
+
the <a href="#addons">add-ons</a> included in the distribution,
|
29
|
+
and
|
30
|
+
the <a href="https://github.com/jagthedrummer/codemirror-ui">CodeMirror
|
31
|
+
UI</a> project, for reusable implementations of extra features.</p>
|
30
32
|
|
31
33
|
<p>CodeMirror works with language-specific modes. Modes are
|
32
34
|
JavaScript programs that help color (and optionally indent) text
|
33
|
-
written in a given language. The distribution comes with a
|
34
|
-
modes (see the <code>mode/</code> directory), and it isn't hard
|
35
|
+
written in a given language. The distribution comes with a number
|
36
|
+
of modes (see the <code>mode/</code> directory), and it isn't hard
|
35
37
|
to <a href="#modeapi">write new ones</a> for other languages.</p>
|
36
38
|
|
37
39
|
<h2 id="usage">Basic Usage</h2>
|
@@ -40,18 +42,15 @@
|
|
40
42
|
and style sheet found under <code>lib/</code> in the distribution,
|
41
43
|
plus a mode script from one of the <code>mode/</code> directories
|
42
44
|
and a theme stylesheet from <code>theme/</code>. (See
|
43
|
-
also <a href="compress.html">the
|
45
|
+
also <a href="compress.html">the compression helper</a>.) For
|
44
46
|
example:</p>
|
45
47
|
|
46
48
|
<pre><script src="lib/codemirror.js"></script>
|
47
|
-
<link rel="stylesheet" href="lib/codemirror.css">
|
48
|
-
<script src="mode/javascript/javascript.js"></script>
|
49
|
-
<link rel="stylesheet" href="theme/default.css"></pre>
|
49
|
+
<link rel="stylesheet" href="../lib/codemirror.css">
|
50
|
+
<script src="mode/javascript/javascript.js"></script></pre>
|
50
51
|
|
51
|
-
<p>
|
52
|
-
|
53
|
-
<a href="#option_theme"><code>theme</code></a> option.) Having
|
54
|
-
done this, an editor instance can be created like this:</p>
|
52
|
+
<p>Having done this, an editor instance can be created like
|
53
|
+
this:</p>
|
55
54
|
|
56
55
|
<pre>var myCodeMirror = CodeMirror(document.body);</pre>
|
57
56
|
|
@@ -106,12 +105,6 @@
|
|
106
105
|
<p>Options are not checked in any way, so setting bogus option
|
107
106
|
values is bound to lead to odd errors.</p>
|
108
107
|
|
109
|
-
<p><em>Note:</em> CodeMirror
|
110
|
-
2 <a href="internals.html#summary">does not support</a>
|
111
|
-
line-wrapping. I would have very much liked to support it, but it
|
112
|
-
combines extremely poorly with the way the editor is
|
113
|
-
implemented.</p>
|
114
|
-
|
115
108
|
<p>These are the supported options:</p>
|
116
109
|
|
117
110
|
<dl>
|
@@ -137,52 +130,29 @@
|
|
137
130
|
<dd>The theme to style the editor with. You must make sure the
|
138
131
|
CSS file defining the corresponding <code>.cm-s-[name]</code>
|
139
132
|
styles is loaded (see
|
140
|
-
the <a href="theme/"><code>theme</code></a> directory in the
|
141
|
-
distribution)
|
133
|
+
the <a href="../theme/"><code>theme</code></a> directory in the
|
134
|
+
distribution). The default is <code>"default"</code>, for which
|
135
|
+
colors are included in <code>codemirror.css</code>. It is
|
136
|
+
possible to use multiple theming classes at once—for
|
137
|
+
example <code>"foo bar"</code> will assign both
|
138
|
+
the <code>cm-s-foo</code> and the <code>cm-s-bar</code> classes
|
139
|
+
to the editor.</dd>
|
142
140
|
|
143
141
|
<dt id="option_indentUnit"><code>indentUnit (integer)</code></dt>
|
144
142
|
<dd>How many spaces a block (whatever that means in the edited
|
145
143
|
language) should be indented. The default is 2.</dd>
|
146
144
|
|
147
|
-
<dt id="
|
148
|
-
<dd>Whether
|
149
|
-
|
145
|
+
<dt id="option_smartIndent"><code>smartIndent (boolean)</code></dt>
|
146
|
+
<dd>Whether to use the context-sensitive indentation that the
|
147
|
+
mode provides (or just indent the same as the line before).
|
148
|
+
Defaults to true.</dd>
|
150
149
|
|
151
|
-
<dt id="
|
152
|
-
<dd>
|
153
|
-
Must be one of the following:
|
154
|
-
<dl>
|
155
|
-
<dt><code>"classic" (the default)</code></dt>
|
156
|
-
<dd>When nothing is selected, insert a tab. Otherwise,
|
157
|
-
behave like the <code>"shift"</code> mode. (When shift is
|
158
|
-
held, this behaves like the <code>"indent"</code> mode.)</dd>
|
159
|
-
<dt><code>"shift"</code></dt>
|
160
|
-
<dd>Indent all selected lines by
|
161
|
-
one <a href="#option_indentUnit"><code>indentUnit</code></a>.
|
162
|
-
If shift was held while pressing tab, un-indent all selected
|
163
|
-
lines one unit.</dd>
|
164
|
-
<dt><code>"indent"</code></dt>
|
165
|
-
<dd>Indent the line the 'correctly', based on its syntactic
|
166
|
-
context. Only works if the
|
167
|
-
mode <a href="#indent">supports</a> it.</dd>
|
168
|
-
<dt><code>"default"</code></dt>
|
169
|
-
<dd>Do not capture tab presses, let the browser apply its
|
170
|
-
default behaviour (which usually means it skips to the next
|
171
|
-
control).</dd>
|
172
|
-
</dl></dd>
|
150
|
+
<dt id="option_tabSize"><code>tabSize (integer)</code></dt>
|
151
|
+
<dd>The width of a tab character. Defaults to 4.</dd>
|
173
152
|
|
174
|
-
<dt id="
|
175
|
-
<dd>
|
176
|
-
|
177
|
-
<dl>
|
178
|
-
<dt><code>"indent" (the default)</code></dt>
|
179
|
-
<dd>Use the mode's indentation rules to give the new line
|
180
|
-
the correct indentation.</dd>
|
181
|
-
<dt><code>"keep"</code></dt>
|
182
|
-
<dd>Indent the line the same as the previous line.</dd>
|
183
|
-
<dt><code>"flat"</code></dt>
|
184
|
-
<dd>Do not indent the new line.</dd>
|
185
|
-
</dl></dd>
|
153
|
+
<dt id="option_indentWithTabs"><code>indentWithTabs (boolean)</code></dt>
|
154
|
+
<dd>Whether, when indenting, the first N*<code>tabSize</code>
|
155
|
+
spaces should be replaced by N tabs. Default is false.</dd>
|
186
156
|
|
187
157
|
<dt id="option_electricChars"><code>electricChars (boolean)</code></dt>
|
188
158
|
<dd>Configures whether the editor should re-indent the current
|
@@ -190,10 +160,29 @@
|
|
190
160
|
indentation (only works if the mode supports indentation).
|
191
161
|
Default is true.</dd>
|
192
162
|
|
193
|
-
<dt id="
|
194
|
-
<dd>
|
195
|
-
|
196
|
-
|
163
|
+
<dt id="option_autoClearEmptyLines"><code>autoClearEmptyLines (boolean)</code></dt>
|
164
|
+
<dd>When turned on (default is off), this will clear
|
165
|
+
automatically clear lines consisting only of whitespace when the
|
166
|
+
cursor leaves them. This is mostly useful to prevent auto
|
167
|
+
indentation from introducing trailing whitespace in a file.</dd>
|
168
|
+
|
169
|
+
<dt id="option_keyMap"><code>keyMap (string)</code></dt>
|
170
|
+
<dd>Configures the keymap to use. The default
|
171
|
+
is <code>"default"</code>, which is the only keymap defined
|
172
|
+
in <code>codemirror.js</code> itself. Extra keymaps are found in
|
173
|
+
the <a href="../keymap/"><code>keymap</code></a> directory. See
|
174
|
+
the <a href="#keymaps">section on keymaps</a> for more
|
175
|
+
information.</dd>
|
176
|
+
|
177
|
+
<dt id="option_extraKeys"><code>extraKeys (object)</code></dt>
|
178
|
+
<dd>Can be used to specify extra keybindings for the editor,
|
179
|
+
alongside the ones defined
|
180
|
+
by <a href="#option_keyMap"><code>keyMap</code></a>. Should be
|
181
|
+
either null, or a valid <a href="#keymaps">keymap</a> value.</dd>
|
182
|
+
|
183
|
+
<dt id="option_lineWrapping"><code>lineWrapping (boolean)</code></dt>
|
184
|
+
<dd>Whether CodeMirror should scroll or wrap for long lines.
|
185
|
+
Defaults to <code>false</code> (scroll).</dd>
|
197
186
|
|
198
187
|
<dt id="option_lineNumbers"><code>lineNumbers (boolean)</code></dt>
|
199
188
|
<dd>Whether to show line numbers to the left of the editor.</dd>
|
@@ -201,31 +190,49 @@
|
|
201
190
|
<dt id="option_firstLineNumber"><code>firstLineNumber (integer)</code></dt>
|
202
191
|
<dd>At which number to start counting lines. Default is 1.</dd>
|
203
192
|
|
193
|
+
<dt id="option_lineNumberFormatter"><code>lineNumberFormatter (function(integer))</code></dt>
|
194
|
+
<dd>A function used to format line numbers. The function is passed the current line number. Default prints the line number verbatim.</dd>
|
195
|
+
|
204
196
|
<dt id="option_gutter"><code>gutter (boolean)</code></dt>
|
205
197
|
<dd>Can be used to force a 'gutter' (empty space on the left of
|
206
198
|
the editor) to be shown even when no line numbers are active.
|
207
199
|
This is useful for setting <a href="#setMarker">markers</a>.</dd>
|
208
200
|
|
201
|
+
<dt id="option_fixedGutter"><code>fixedGutter (boolean)</code></dt>
|
202
|
+
<dd>When enabled (off by default), this will make the gutter
|
203
|
+
stay visible when the document is scrolled horizontally.</dd>
|
204
|
+
|
209
205
|
<dt id="option_readOnly"><code>readOnly (boolean)</code></dt>
|
210
|
-
<dd>This disables editing of the editor content by the user.
|
211
|
-
|
212
|
-
|
213
|
-
|
206
|
+
<dd>This disables editing of the editor content by the user. If
|
207
|
+
the special value <code>"nocursor"</code> is given (instead of
|
208
|
+
simply <code>true</code>), focusing of the editor is also
|
209
|
+
disallowed.</dd>
|
214
210
|
|
215
211
|
<dt id="option_onChange"><code>onChange (function)</code></dt>
|
216
212
|
<dd>When given, this function will be called every time the
|
217
213
|
content of the editor is changed. It will be given the editor
|
218
|
-
instance as
|
214
|
+
instance as first argument, and an <code>{from, to, text, next}</code>
|
215
|
+
object containing information about the changes
|
216
|
+
that occurred as second argument. <code>from</code>
|
217
|
+
and <code>to</code> are the positions (in the pre-change
|
218
|
+
coordinate system) where the change started and
|
219
|
+
ended (for example, it might be <code>{ch:0, line:18}</code> if the
|
220
|
+
position is at the beginning of line #19). <code>text</code>
|
221
|
+
is an array of strings representing the text that replaced the changed
|
222
|
+
range (split by line). If multiple changes happened during a single
|
223
|
+
operation, the object will have a <code>next</code> property pointing to
|
224
|
+
another change object (which may point to another, etc).</dd>
|
219
225
|
|
220
226
|
<dt id="option_onCursorActivity"><code>onCursorActivity (function)</code></dt>
|
221
|
-
<dd>
|
222
|
-
|
227
|
+
<dd>Will be called when the cursor or selection moves, or any
|
228
|
+
change is made to the editor content.</dd>
|
223
229
|
|
224
230
|
<dt id="option_onGutterClick"><code>onGutterClick (function)</code></dt>
|
225
231
|
<dd>When given, will be called whenever the editor gutter (the
|
226
232
|
line-number area) is clicked. Will be given the editor instance
|
227
|
-
as first argument,
|
228
|
-
|
233
|
+
as first argument, the (zero-based) number of the line that was
|
234
|
+
clicked as second argument, and the raw <code>mousedown</code>
|
235
|
+
event object as third argument.</dd>
|
229
236
|
|
230
237
|
<dt id="option_onFocus"><code>onFocus, onBlur (function)</code></dt>
|
231
238
|
<dd>The given functions will be called whenever the editor is
|
@@ -240,6 +247,9 @@
|
|
240
247
|
this function (if given) will be called. It'll be given a single
|
241
248
|
argument, the editor instance.</dd>
|
242
249
|
|
250
|
+
<dt id="option_onUpdate"><code>onUpdate (function)</code></dt>
|
251
|
+
<dd>Will be called whenever CodeMirror updates its DOM display.</dd>
|
252
|
+
|
243
253
|
<dt id="option_matchBrackets"><code>matchBrackets (boolean)</code></dt>
|
244
254
|
<dd>Determines whether brackets are matched whenever the cursor
|
245
255
|
is moved next to a bracket.</dd>
|
@@ -251,6 +261,13 @@
|
|
251
261
|
defaults are 200 and 300, you can change these options to make
|
252
262
|
the highlighting more or less aggressive.</dd>
|
253
263
|
|
264
|
+
<dt id="option_pollInterval"><code>pollInterval (number)</code></dt>
|
265
|
+
<dd>Indicates how quickly CodeMirror should poll its input
|
266
|
+
textarea for changes. Most input is captured by events, but some
|
267
|
+
things, like IME input on some browsers, doesn't generate events
|
268
|
+
that allow CodeMirror to properly detect it. Thus, it polls.
|
269
|
+
Default is 100 milliseconds.</dd>
|
270
|
+
|
254
271
|
<dt id="option_undoDepth"><code>undoDepth (integer)</code></dt>
|
255
272
|
<dd>The maximum number of undo levels that the editor stores.
|
256
273
|
Defaults to 40.</dd>
|
@@ -260,10 +277,25 @@
|
|
260
277
|
index</a> to assign to the editor. If not given, no tab index
|
261
278
|
will be assigned.</dd>
|
262
279
|
|
263
|
-
<dt id="
|
264
|
-
<dd>
|
265
|
-
|
266
|
-
|
280
|
+
<dt id="option_autofocus"><code>autofocus (boolean)</code></dt>
|
281
|
+
<dd>Can be used to make CodeMirror focus itself on
|
282
|
+
initialization. Defaults to off.
|
283
|
+
When <a href="#fromTextArea"><code>fromTextArea</code></a> is
|
284
|
+
used, and no explicit value is given for this option, it will
|
285
|
+
inherit the setting from the textarea's <code>autofocus</code>
|
286
|
+
attribute.</dd>
|
287
|
+
|
288
|
+
<dt id="option_dragDrop"><code>dragDrop (boolean)</code></dt>
|
289
|
+
<dd>Controls whether drag-and-drop is enabled. On by default.</dd>
|
290
|
+
|
291
|
+
<dt id="option_onDragEvent"><code>onDragEvent (function)</code></dt>
|
292
|
+
<dd>When given, this will be called when the editor is handling
|
293
|
+
a <code>dragenter</code>, <code>dragover</code>,
|
294
|
+
or <code>drop</code> event. It will be passed the editor instance
|
295
|
+
and the event object as arguments. The callback can choose to
|
296
|
+
handle the event itself, in which case it should
|
297
|
+
return <code>true</code> to indicate that CodeMirror should not
|
298
|
+
do anything further.</dd>
|
267
299
|
|
268
300
|
<dt id="option_onKeyEvent"><code>onKeyEvent (function)</code></dt>
|
269
301
|
<dd>This provides a rather low-level hook into CodeMirror's key
|
@@ -285,6 +317,63 @@
|
|
285
317
|
that need character data).</dd>
|
286
318
|
</dl>
|
287
319
|
|
320
|
+
<h2 id="keymaps">Keymaps</h2>
|
321
|
+
|
322
|
+
<p>Keymaps are ways to associate keys with functionality. A keymap
|
323
|
+
is an object mapping strings that identify the keys to functions
|
324
|
+
that implement their functionality.</p>
|
325
|
+
|
326
|
+
<p>Keys are identified either by name or by character.
|
327
|
+
The <code>CodeMirror.keyNames</code> object defines names for
|
328
|
+
common keys and associates them with their key codes. Examples of
|
329
|
+
names defined here are <code>Enter</code>, <code>F5</code>,
|
330
|
+
and <code>Q</code>. These can be prefixed
|
331
|
+
with <code>Shift-</code>, <code>Cmd-</code>, <code>Ctrl-</code>,
|
332
|
+
and <code>Alt-</code> (in that order!) to specify a modifier. So
|
333
|
+
for example, <code>Shift-Ctrl-Space</code> would be a valid key
|
334
|
+
identifier.</p>
|
335
|
+
|
336
|
+
<p>Alternatively, a character can be specified directly by
|
337
|
+
surrounding it in single quotes, for example <code>'$'</code>
|
338
|
+
or <code>'q'</code>. Due to limitations in the way browsers fire
|
339
|
+
key events, these may not be prefixed with modifiers.</p>
|
340
|
+
|
341
|
+
<p>The <code>CodeMirror.keyMap</code> object associates keymaps
|
342
|
+
with names. User code and keymap definitions can assign extra
|
343
|
+
properties to this object. Anywhere where a keymap is expected, a
|
344
|
+
string can be given, which will be looked up in this object. It
|
345
|
+
also contains the <code>"default"</code> keymap holding the
|
346
|
+
default bindings.</p>
|
347
|
+
|
348
|
+
<p>The values of properties in keymaps can be either functions of
|
349
|
+
a single argument (the CodeMirror instance), or strings. Such
|
350
|
+
strings refer to properties of the
|
351
|
+
<code>CodeMirror.commands</code> object, which defines a number of
|
352
|
+
common commands that are used by the default keybindings, and maps
|
353
|
+
them to functions. A key handler function may throw
|
354
|
+
<code>CodeMirror.Pass</code> to indicate that it has decided not
|
355
|
+
to handle the key, and other handlers (or the default behavior)
|
356
|
+
should be given a turn.</p>
|
357
|
+
|
358
|
+
<p>Keys mapped to command names that start with the
|
359
|
+
characters <code>"go"</code> (which should be used for
|
360
|
+
cursor-movement actions) will be fired even when an
|
361
|
+
extra <code>Shift</code> modifier is present (i.e. <code>"Up":
|
362
|
+
"goLineUp"</code> matches both up and shift-up). This is used to
|
363
|
+
easily implement shift-selection.</p>
|
364
|
+
|
365
|
+
<p>Keymaps can defer to each other by defining
|
366
|
+
a <code>fallthrough</code> property. This indicates that when a
|
367
|
+
key is not found in the map itself, one or more other maps should
|
368
|
+
be searched. It can hold either a single keymap or an array of
|
369
|
+
keymaps.</p>
|
370
|
+
|
371
|
+
<p>When a keymap contains a <code>nofallthrough</code> property
|
372
|
+
set to <code>true</code>, keys matched against that map will be
|
373
|
+
ignored if they don't match any of the bindings in the map (no
|
374
|
+
further child maps will be tried, and the default effect of
|
375
|
+
inserting a character will not occur).</p>
|
376
|
+
|
288
377
|
<h2 id="styling">Customized Styling</h2>
|
289
378
|
|
290
379
|
<p>Up to a certain extent, CodeMirror's look can be changed by
|
@@ -292,7 +381,7 @@
|
|
292
381
|
simply provide the colors for that mode, and can be adapted in a
|
293
382
|
very straightforward way. To style the editor itself, it is
|
294
383
|
possible to alter or override the styles defined
|
295
|
-
in <a href="lib/codemirror.css"><code>codemirror.css</code></a>.</p>
|
384
|
+
in <a href="../lib/codemirror.css"><code>codemirror.css</code></a>.</p>
|
296
385
|
|
297
386
|
<p>Some care must be taken there, since a lot of the rules in this
|
298
387
|
file are necessary to have CodeMirror function properly. Adjusting
|
@@ -302,16 +391,17 @@
|
|
302
391
|
|
303
392
|
<dl>
|
304
393
|
<dt id="class_CodeMirror"><code>CodeMirror</code></dt>
|
305
|
-
<dd>The outer element of the editor. This should be used for
|
306
|
-
borders and positioning. Can also be used to set
|
307
|
-
should hold for everything inside the editor (such
|
308
|
-
and font size), or to set a background.</dd>
|
394
|
+
<dd>The outer element of the editor. This should be used for the
|
395
|
+
editor width, borders and positioning. Can also be used to set
|
396
|
+
styles that should hold for everything inside the editor (such
|
397
|
+
as font and font size), or to set a background.</dd>
|
309
398
|
|
310
399
|
<dt id="class_CodeMirror_scroll"><code>CodeMirror-scroll</code></dt>
|
311
|
-
<dd>This determines whether the editor
|
312
|
-
auto</code> + fixed height). By
|
313
|
-
this <code>height: auto; overflow:
|
314
|
-
the editor to resize to fit its
|
400
|
+
<dd>This determines the editor's height, and whether the editor
|
401
|
+
scrolls (<code>overflow: auto</code> + fixed height). By
|
402
|
+
default, it does. Giving this <code>height: auto; overflow:
|
403
|
+
visible;</code> will cause the editor to resize to fit its
|
404
|
+
content.</dd>
|
315
405
|
|
316
406
|
<dt id="class_CodeMirror_focused"><code>CodeMirror-focused</code></dt>
|
317
407
|
<dd>Whenever the editor is focused, the top element gets this
|
@@ -351,12 +441,18 @@
|
|
351
441
|
<dd>These are used to style matched (or unmatched) brackets.</dd>
|
352
442
|
</dl>
|
353
443
|
|
444
|
+
<p id="css-resize">So note carefully that, in order to resize the
|
445
|
+
editor, you should set a <code>width</code> on
|
446
|
+
the <a href="#getWrapperElement">wrapper</a>
|
447
|
+
(class <code>CodeMirror</code>) element, and a height on
|
448
|
+
the <a href="#getScrollerElement">scroller</a>
|
449
|
+
(class <code>CodeMirror-scroll</code>) element.</p>
|
450
|
+
|
354
451
|
<p>The actual lines, as well as the cursor, are represented
|
355
452
|
by <code>pre</code> elements. By default no text styling (such as
|
356
453
|
bold) that might change line height is applied. If you do want
|
357
454
|
such effects, you'll have to give <code>CodeMirror pre</code> a
|
358
|
-
fixed height
|
359
|
-
is constant.</p>
|
455
|
+
fixed height.</p>
|
360
456
|
|
361
457
|
<p>If your page's style sheets do funky things to
|
362
458
|
all <code>div</code> or <code>pre</code> elements (you probably
|
@@ -364,6 +460,10 @@
|
|
364
460
|
effects out again for elements under the <code>CodeMirror</code>
|
365
461
|
class.</p>
|
366
462
|
|
463
|
+
<p>Themes are also simply CSS files, which define colors for
|
464
|
+
various syntactic elements. See the files in
|
465
|
+
the <a href="../theme/"><code>theme</code></a> directory.</p>
|
466
|
+
|
367
467
|
<h2 id="api">Programming API</h2>
|
368
468
|
|
369
469
|
<p>A lot of CodeMirror features are only available through its API.
|
@@ -382,7 +482,9 @@
|
|
382
482
|
|
383
483
|
<dl>
|
384
484
|
<dt id="getValue"><code>getValue() → string</code></dt>
|
385
|
-
<dd>Get the current editor content
|
485
|
+
<dd>Get the current editor content. You can pass it an optional
|
486
|
+
argument to specify the string to be used to separate lines
|
487
|
+
(defaults to <code>"\n"</code>).</dd>
|
386
488
|
<dt id="setValue"><code>setValue(string)</code></dt>
|
387
489
|
<dd>Set the editor content.</dd>
|
388
490
|
|
@@ -391,8 +493,24 @@
|
|
391
493
|
<dt id="replaceSelection"><code>replaceSelection(string)</code></dt>
|
392
494
|
<dd>Replace the selection with the given string.</dd>
|
393
495
|
|
496
|
+
<dt id="setSize"><code>setSize(width, height)</code></dt>
|
497
|
+
<dd>Programatically set the size of the editor (overriding the
|
498
|
+
applicable <a href="#css-resize">CSS
|
499
|
+
rules</a>). <code>width</code> and <code>height</code> height
|
500
|
+
can be either numbers (interpreted as pixels) or CSS units
|
501
|
+
(<code>"100%"</code>, for example). You can
|
502
|
+
pass <code>null</code> for either of them to indicate that that
|
503
|
+
dimension should not be changed.</dd>
|
394
504
|
<dt id="focus"><code>focus()</code></dt>
|
395
505
|
<dd>Give the editor focus.</dd>
|
506
|
+
<dt id="scrollTo"><code>scrollTo(x, y)</code></dt>
|
507
|
+
<dd>Scroll the editor to a given (pixel) position. Both
|
508
|
+
arguments may be left as <code>null</code>
|
509
|
+
or <code>undefined</code> to have no effect.</dd>
|
510
|
+
<dt id="getScrollInfo"><code>getScrollInfo()</code></dt>
|
511
|
+
<dd>Get an <code>{x, y, width, height}</code> object that
|
512
|
+
represents the current scroll position and scrollable area size
|
513
|
+
of the editor.</dd>
|
396
514
|
|
397
515
|
<dt id="setOption"><code>setOption(option, value)</code></dt>
|
398
516
|
<dd>Change the configuration of the editor. <code>option</code>
|
@@ -403,13 +521,16 @@
|
|
403
521
|
<dd>Retrieves the current value of the given option for this
|
404
522
|
editor instance.</dd>
|
405
523
|
|
406
|
-
<dt id="cursorCoords"><code>cursorCoords(start) → object</code></dt>
|
524
|
+
<dt id="cursorCoords"><code>cursorCoords(start, mode) → object</code></dt>
|
407
525
|
<dd>Returns an <code>{x, y, yBot}</code> object containing the
|
408
|
-
coordinates of the cursor
|
526
|
+
coordinates of the cursor. If <code>mode</code>
|
527
|
+
is <code>"local"</code>, they will be relative to the top-left
|
528
|
+
corner of the editable document. If it is <code>"page"</code> or
|
529
|
+
not given, they are relative to the top-left corner of the
|
409
530
|
page. <code>yBot</code> is the coordinate of the bottom of the
|
410
531
|
cursor. <code>start</code> is a boolean indicating whether you
|
411
532
|
want the start or the end of the selection.</dd>
|
412
|
-
<dt id="charCoords"><code>charCoords(pos) → object</code></dt>
|
533
|
+
<dt id="charCoords"><code>charCoords(pos, mode) → object</code></dt>
|
413
534
|
<dd>Like <code>cursorCoords</code>, but returns the position of
|
414
535
|
an arbitrary characters. <code>pos</code> should be
|
415
536
|
a <code>{line, ch}</code> object.</dd>
|
@@ -426,6 +547,17 @@
|
|
426
547
|
<dd>Returns an object with <code>{undo, redo}</code> properties,
|
427
548
|
both of which hold integers, indicating the amount of stored
|
428
549
|
undo and redo operations.</dd>
|
550
|
+
<dt id="clearHistory"><code>clearHistory()</code></dt>
|
551
|
+
<dd>Clears the editor's undo history.</dd>
|
552
|
+
<dt id="getHistory"><code>getHistory() → object</code></dt>
|
553
|
+
<dd>Get a (JSON-serializeable) representation of the undo history.</dd>
|
554
|
+
<dt id="setHistory"><code>setHistory(object)</code></dt>
|
555
|
+
<dd>Replace the editor's undo history with the one provided,
|
556
|
+
which must be a value as returned
|
557
|
+
by <a href="#getHistory"><code>getHistory</code></a>. Note that
|
558
|
+
this will have entirely undefined results if the editor content
|
559
|
+
isn't also the same as it was when <code>getHistory</code> was
|
560
|
+
called.</dd>
|
429
561
|
|
430
562
|
<dt id="indentLine"><code>indentLine(line, dir)</code></dt>
|
431
563
|
<dd>Reset the given line's indentation to the indentation
|
@@ -434,37 +566,9 @@
|
|
434
566
|
decreased (if false) by an <a href="#option_indentUnit">indent
|
435
567
|
unit</a> instead.</dd>
|
436
568
|
|
437
|
-
<dt id="getSearchCursor"><code>getSearchCursor(query, start, caseFold) → cursor</code></dt>
|
438
|
-
<dd>Used to implement search/replace
|
439
|
-
functionality. <code>query</code> can be a regular expression or
|
440
|
-
a string (only strings will match across lines—if they contain
|
441
|
-
newlines). <code>start</code> provides the starting position of
|
442
|
-
the search. It can be a <code>{line, ch}</code> object, or can
|
443
|
-
be left off to default to the start of the
|
444
|
-
document. <code>caseFold</code> is only relevant when matching a
|
445
|
-
string. It will cause the search to be case-insensitive. A
|
446
|
-
search cursor has the following methods:
|
447
|
-
<dl>
|
448
|
-
<dt><code>findNext(), findPrevious() → boolean</code></dt>
|
449
|
-
<dd>Search forward or backward from the current position.
|
450
|
-
The return value indicates whether a match was found. If
|
451
|
-
matching a regular expression, the return value will be the
|
452
|
-
array returned by the <code>match</code> method, in case you
|
453
|
-
want to extract matched groups.</dd>
|
454
|
-
<dt><code>from(), to() → object</code></dt>
|
455
|
-
<dd>These are only valid when the last call
|
456
|
-
to <code>findNext</code> or <code>findPrevious</code> did
|
457
|
-
not return false. They will return <code>{line, ch}</code>
|
458
|
-
objects pointing at the start and end of the match.</dd>
|
459
|
-
<dt><code>replace(text)</code></dt>
|
460
|
-
<dd>Replaces the currently found match with the given text
|
461
|
-
and adjusts the cursor position to reflect the
|
462
|
-
replacement.</dd>
|
463
|
-
</dl></dd>
|
464
|
-
|
465
569
|
<dt id="getTokenAt"><code>getTokenAt(pos) → object</code></dt>
|
466
570
|
<dd>Retrieves information about the token the current mode found
|
467
|
-
|
571
|
+
before the given position (a <code>{line, ch}</code> object). The
|
468
572
|
returned object has the following properties:
|
469
573
|
<dl>
|
470
574
|
<dt><code>start</code></dt><dd>The character (on the given line) at which the token starts.</dd>
|
@@ -475,11 +579,26 @@
|
|
475
579
|
<dt><code>state</code></dt><dd>The mode's state at the end of this token.</dd>
|
476
580
|
</dl></dd>
|
477
581
|
|
478
|
-
<dt id="markText"><code>markText(from, to, className) →
|
582
|
+
<dt id="markText"><code>markText(from, to, className) → object</code></dt>
|
479
583
|
<dd>Can be used to mark a range of text with a specific CSS
|
480
584
|
class name. <code>from</code> and <code>to</code> should
|
481
|
-
be <code>{line, ch}</code> objects. The method will return
|
482
|
-
|
585
|
+
be <code>{line, ch}</code> objects. The method will return an
|
586
|
+
object with two methods, <code>clear()</code>, which removes the
|
587
|
+
mark, and <code>find()</code>, which returns a <code>{from,
|
588
|
+
to}</code> (both document positions), indicating the current
|
589
|
+
position of the marked range.</dd>
|
590
|
+
|
591
|
+
<dt id="setBookmark"><code>setBookmark(pos) → object</code></dt>
|
592
|
+
<dd>Inserts a bookmark, a handle that follows the text around it
|
593
|
+
as it is being edited, at the given position. A bookmark has two
|
594
|
+
methods <code>find()</code> and <code>clear()</code>. The first
|
595
|
+
returns the current position of the bookmark, if it is still in
|
596
|
+
the document, and the second explicitly removes the
|
597
|
+
bookmark.</dd>
|
598
|
+
|
599
|
+
<dt id="findMarksAt"><code>findMarksAt(pos) → array</code></dt>
|
600
|
+
<dd>Returns an array of all the bookmarks and marked ranges
|
601
|
+
present at the given position.</dd>
|
483
602
|
|
484
603
|
<dt id="setMarker"><code>setMarker(line, text, className) → lineHandle</code></dt>
|
485
604
|
<dd>Add a gutter marker for the given line. Gutter markers are
|
@@ -500,17 +619,37 @@
|
|
500
619
|
number or a handle returned by <code>setMarker</code> (since a
|
501
620
|
number may now refer to a different line if something was added
|
502
621
|
or deleted).</dd>
|
503
|
-
<dt id="setLineClass"><code>setLineClass(line, className) → lineHandle</code></dt>
|
622
|
+
<dt id="setLineClass"><code>setLineClass(line, className, backgroundClassName) → lineHandle</code></dt>
|
504
623
|
<dd>Set a CSS class name for the given line. <code>line</code>
|
505
624
|
can be a number or a line handle (as returned
|
506
|
-
by <code>setMarker</code> or this
|
507
|
-
|
625
|
+
by <code>setMarker</code> or this
|
626
|
+
function). <code>className</code> will be used to style the text
|
627
|
+
for the line, and <code>backgroundClassName</code> to style its
|
628
|
+
background (which lies behind the selection).
|
629
|
+
Pass <code>null</code> to clear the classes for a line.</dd>
|
630
|
+
<dt id="hideLine"><code>hideLine(line) → lineHandle</code></dt>
|
631
|
+
<dd>Hide the given line (either by number or by handle). Hidden
|
632
|
+
lines don't show up in the editor, and their numbers are skipped
|
633
|
+
when <a href="#option_lineNumbers">line numbers</a> are enabled.
|
634
|
+
Deleting a region around them does delete them, and coping a
|
635
|
+
region around will include them in the copied text.</dd>
|
636
|
+
<dt id="showLine"><code>showLine(line) → lineHandle</code></dt>
|
637
|
+
<dd>The inverse of <code>hideLine</code>—re-shows a previously
|
638
|
+
hidden line, by number or by handle.</dd>
|
639
|
+
|
640
|
+
<dt id="onDeleteLine"><code>onDeleteLine(line, func)</code></dt>
|
641
|
+
<dd>Register a function that should be called when the line is
|
642
|
+
deleted from the document.</dd>
|
508
643
|
|
509
644
|
<dt id="lineInfo"><code>lineInfo(line) → object</code></dt>
|
510
645
|
<dd>Returns the line number, text content, and marker status of
|
511
646
|
the given line, which can be either a number or a handle
|
512
647
|
returned by <code>setMarker</code>. The returned object has the
|
513
|
-
structure <code>{line, text, markerText, markerClass
|
648
|
+
structure <code>{line, handle, text, markerText, markerClass,
|
649
|
+
lineClass, bgClass}</code>.</dd>
|
650
|
+
|
651
|
+
<dt id="getLineHandle"><code>getLineHandle(num) → lineHandle</code></dt>
|
652
|
+
<dd>Fetches the line handle for the given line number.</dd>
|
514
653
|
|
515
654
|
<dt id="addWidget"><code>addWidget(pos, node, scrollIntoView)</code></dt>
|
516
655
|
<dd>Puts <code>node</code>, which should be an absolutely
|
@@ -552,13 +691,24 @@
|
|
552
691
|
|
553
692
|
<dt id="getRange"><code>getRange(from, to) → string</code></td>
|
554
693
|
<dd>Get the text between the given points in the editor, which
|
555
|
-
should be <code>{line, ch}</code> objects
|
694
|
+
should be <code>{line, ch}</code> objects. An optional third
|
695
|
+
argument can be given to indicate the line separator string to
|
696
|
+
use (defaults to <code>"\n"</code>).</dd>
|
556
697
|
<dt id="replaceRange"><code>replaceRange(string, from, to)</code></dt>
|
557
698
|
<dd>Replace the part of the document between <code>from</code>
|
558
699
|
and <code>to</code> with the given string. <code>from</code>
|
559
700
|
and <code>to</code> must be <code>{line, ch}</code>
|
560
701
|
objects. <code>to</code> can be left off to simply insert the
|
561
702
|
string at position <code>from</code>.</dd>
|
703
|
+
|
704
|
+
<dt id="posFromIndex"><code>posFromIndex(index) → object</code></dt>
|
705
|
+
<dd>Calculates and returns a <code>{line, ch}</code> object for a
|
706
|
+
zero-based <code>index</code> who's value is relative to the start of the
|
707
|
+
editor's text. If the <code>index</code> is out of range of the text then
|
708
|
+
the returned object is clipped to start or end of the text
|
709
|
+
respectively.</dd>
|
710
|
+
<dt id="indexFromPos"><code>indexFromPos(object) → number</code></dt>
|
711
|
+
<dd>The reverse of <a href="#posFromIndex"><code>posFromIndex</code></a>.</dd>
|
562
712
|
</dl>
|
563
713
|
|
564
714
|
<p>The following are more low-level methods:</p>
|
@@ -574,6 +724,11 @@
|
|
574
724
|
lot faster. The return value from this method will be the return
|
575
725
|
value of your function.</dd>
|
576
726
|
|
727
|
+
<dt id="compoundChange"><code>compoundChange(func) → result</code></dt>
|
728
|
+
<dd>Will call the given function (and return its result),
|
729
|
+
combining all changes made while that function executes into a
|
730
|
+
single undo event.</dd>
|
731
|
+
|
577
732
|
<dt id="refresh"><code>refresh()</code></dt>
|
578
733
|
<dd>If your code does something to change the size of the editor
|
579
734
|
element (window resizes are already listened for), or unhides
|
@@ -581,15 +736,17 @@
|
|
581
736
|
ensure CodeMirror is still looking as intended.</dd>
|
582
737
|
|
583
738
|
<dt id="getInputField"><code>getInputField() → textarea</code></dt>
|
584
|
-
<dd>Returns the
|
739
|
+
<dd>Returns the hidden textarea used to read input.</dd>
|
585
740
|
<dt id="getWrapperElement"><code>getWrapperElement() → node</code></dt>
|
586
|
-
<dd>Returns the DOM node that represents the editor
|
587
|
-
from your tree to delete an
|
741
|
+
<dd>Returns the DOM node that represents the editor, and
|
742
|
+
controls its width. Remove this from your tree to delete an
|
743
|
+
editor instance. Set it's <code>width</code> style when
|
744
|
+
resizing.</dd>
|
588
745
|
<dt id="getScrollerElement"><code>getScrollerElement() → node</code></dt>
|
589
|
-
<dd>Returns the DOM node that is responsible for the
|
590
|
-
|
591
|
-
the <code>height</code>
|
592
|
-
|
746
|
+
<dd>Returns the DOM node that is responsible for the vertical
|
747
|
+
sizing and horizontal scrolling of the editor. You can change
|
748
|
+
the <code>height</code> style of this element to resize an
|
749
|
+
editor. (You might have to call
|
593
750
|
the <a href="#refresh"><code>refresh</code></a> method
|
594
751
|
afterwards.)</dd>
|
595
752
|
<dt id="getGutterElement"><code>getGutterElement() → node</code></dt>
|
@@ -619,27 +776,163 @@
|
|
619
776
|
<dt id="toTextArea"><code>toTextArea()</code></dt>
|
620
777
|
<dd>Remove the editor, and restore the original textarea (with
|
621
778
|
the editor's current content).</dd>
|
779
|
+
|
780
|
+
<dt id="getTextArea"><code>getTextArea() → textarea</code></dt>
|
781
|
+
<dd>Returns the textarea that the instance was based on.</dd>
|
622
782
|
</dl>
|
623
783
|
|
624
|
-
<p id="defineExtension">If you want define extra methods in terms
|
625
|
-
of the CodeMirror API, is
|
784
|
+
<p id="defineExtension">If you want to define extra methods in terms
|
785
|
+
of the CodeMirror API, it is possible to
|
626
786
|
use <code>CodeMirror.defineExtension(name, value)</code>. This
|
627
787
|
will cause the given value (usually a method) to be added to all
|
628
788
|
CodeMirror instances created from then on.</p>
|
629
789
|
|
630
|
-
<h2 id="
|
790
|
+
<h2 id="addons">Add-ons</h2>
|
791
|
+
|
792
|
+
<p>The <code>lib/util</code> directory in the distribution
|
793
|
+
contains a number of reusable components that implement extra
|
794
|
+
editor functionality. In brief, they are:</p>
|
795
|
+
|
796
|
+
<dl>
|
797
|
+
<dt id="util_dialog"><a href="../lib/util/dialog.js"><code>dialog.js</code></a></dt>
|
798
|
+
<dd>Provides a very simple way to query users for text input.
|
799
|
+
Adds an <code>openDialog</code> method to CodeMirror instances,
|
800
|
+
which can be called with an HTML fragment that provides the
|
801
|
+
prompt (should include an <code>input</code> tag), and a
|
802
|
+
callback function that is called when text has been entered.
|
803
|
+
Depends on <code>lib/util/dialog.css</code>.</dd>
|
804
|
+
<dt id="util_searchcursor"><a href="../lib/util/searchcursor.js"><code>searchcursor.js</code></a></dt>
|
805
|
+
<dd>Adds the <code>getSearchCursor(query, start, caseFold) →
|
806
|
+
cursor</code> method to CodeMirror instances, which can be used
|
807
|
+
to implement search/replace functionality. <code>query</code>
|
808
|
+
can be a regular expression or a string (only strings will match
|
809
|
+
across lines—if they contain newlines). <code>start</code>
|
810
|
+
provides the starting position of the search. It can be
|
811
|
+
a <code>{line, ch}</code> object, or can be left off to default
|
812
|
+
to the start of the document. <code>caseFold</code> is only
|
813
|
+
relevant when matching a string. It will cause the search to be
|
814
|
+
case-insensitive. A search cursor has the following methods:
|
815
|
+
<dl>
|
816
|
+
<dt><code>findNext(), findPrevious() → boolean</code></dt>
|
817
|
+
<dd>Search forward or backward from the current position.
|
818
|
+
The return value indicates whether a match was found. If
|
819
|
+
matching a regular expression, the return value will be the
|
820
|
+
array returned by the <code>match</code> method, in case you
|
821
|
+
want to extract matched groups.</dd>
|
822
|
+
<dt><code>from(), to() → object</code></dt>
|
823
|
+
<dd>These are only valid when the last call
|
824
|
+
to <code>findNext</code> or <code>findPrevious</code> did
|
825
|
+
not return false. They will return <code>{line, ch}</code>
|
826
|
+
objects pointing at the start and end of the match.</dd>
|
827
|
+
<dt><code>replace(text)</code></dt>
|
828
|
+
<dd>Replaces the currently found match with the given text
|
829
|
+
and adjusts the cursor position to reflect the
|
830
|
+
replacement.</dd>
|
831
|
+
</dl></dd>
|
631
832
|
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
833
|
+
<dt id="util_search"><a href="../lib/util/search.js"><code>search.js</code></a></dt>
|
834
|
+
<dd>Implements the search commands. CodeMirror has keys bound to
|
835
|
+
these by default, but will not do anything with them unless an
|
836
|
+
implementation is provided. Depends
|
837
|
+
on <code>searchcursor.js</code>, and will make use
|
838
|
+
of <a href="#util_dialog"><code>openDialog</code></a> when
|
839
|
+
available to make prompting for search queries less ugly.</dd>
|
840
|
+
<dt id="util_foldcode"><a href="../lib/util/foldcode.js"><code>foldcode.js</code></a></dt>
|
841
|
+
<dd>Helps with code folding.
|
842
|
+
See <a href="../demo/folding.html">the demo</a> for an example.
|
843
|
+
Call <code>CodeMirror.newFoldFunction</code> with a range-finder
|
844
|
+
helper function to create a function that will, when applied to
|
845
|
+
a CodeMirror instance and a line number, attempt to fold or
|
846
|
+
unfold the block starting at the given line. A range-finder is a
|
847
|
+
language-specific function that also takes an instance and a
|
848
|
+
line number, and returns an end line for the block, or null if
|
849
|
+
no block is started on that line. This file
|
850
|
+
provides <code>CodeMirror.braceRangeFinder</code>, which finds
|
851
|
+
blocks in brace languages (JavaScript, C, Java,
|
852
|
+
etc), <code>CodeMirror.indentRangeFinder</code>, for languages
|
853
|
+
where indentation determines block structure (Python, Haskell),
|
854
|
+
and <code>CodeMirror.tagRangeFinder</code>, for XML-style
|
855
|
+
languages.</dd>
|
856
|
+
<dt id="util_runmode"><a href="../lib/util/runmode.js"><code>runmode.js</code></a></dt>
|
857
|
+
<dd>Can be used to run a CodeMirror mode over text without
|
858
|
+
actually opening an editor instance.
|
859
|
+
See <a href="../demo/runmode.html">the demo</a> for an
|
860
|
+
example.</dd>
|
861
|
+
<dt id="util_overlay"><a href="../lib/util/overlay.js"><code>overlay.js</code></a></dt>
|
862
|
+
<dd>Mode combinator that can be used to extend a mode with an
|
863
|
+
'overlay' — a secondary mode is run over the stream, along with
|
864
|
+
the base mode, and can color specific pieces of text without
|
865
|
+
interfering with the base mode.
|
866
|
+
Defines <code>CodeMirror.overlayMode</code>, which is used to
|
867
|
+
create such a mode. See <a href="../demo/mustache.html">this
|
868
|
+
demo</a> for a detailed example.</dd>
|
869
|
+
<dt id="util_multiplex"><a href="../lib/util/multiplex.js"><code>multiplex.js</code></a></dt>
|
870
|
+
<dd>Mode combinator that can be used to easily 'multiplex'
|
871
|
+
between several modes.
|
872
|
+
Defines <code>CodeMirror.multiplexingMode</code> which, when
|
873
|
+
given as first argument a mode object, and as other arguments
|
874
|
+
any number of <code>{open, close, mode [, delimStyle]}</code>
|
875
|
+
objects, will return a mode object that starts parsing using the
|
876
|
+
mode passed as first argument, but will switch to another mode
|
877
|
+
as soon as it encounters a string that occurs in one of
|
878
|
+
the <code>open</code> fields of the passed objects. When in a
|
879
|
+
sub-mode, it will go back to the top mode again when
|
880
|
+
the <code>close</code> string is encountered.
|
881
|
+
When <code>delimStyle</code> is specified, it will be the token
|
882
|
+
style returned for the delimiter tokens. The outer mode will not
|
883
|
+
see the content between the delimiters.
|
884
|
+
See <a href="../demo/multiplex.html">this demo</a> for an
|
885
|
+
example.</dd>
|
886
|
+
<dt id="util_simple-hint"><a href="../lib/util/simple-hint.js"><code>simple-hint.js</code></a></dt>
|
887
|
+
<dd>Provides a framework for showing autocompletion hints.
|
888
|
+
Defines <code>CodeMirror.simpleHint</code>, which takes a
|
889
|
+
CodeMirror instance and a hinting function, and pops up a widget
|
890
|
+
that allows the user to select a completion. Hinting functions
|
891
|
+
are function that take an editor instance, and return
|
892
|
+
a <code>{list, from, to}</code> object, where <code>list</code>
|
893
|
+
is an array of strings (the completions), and <code>from</code>
|
894
|
+
and <code>to</code> give the start and end of the token that is
|
895
|
+
being completed. Depends
|
896
|
+
on <code>lib/util/simple-hint.css</code>.</dd>
|
897
|
+
<dt id="util_javascript-hint"><a href="../lib/util/javascript-hint.js"><code>javascript-hint.js</code></a></dt>
|
898
|
+
<dd>Defines <code>CodeMirror.javascriptHint</code>
|
899
|
+
and <code>CodeMirror.coffeescriptHint</code>, which are simple
|
900
|
+
hinting functions for the JavaScript and CoffeeScript
|
901
|
+
modes.</dd>
|
902
|
+
<dt id="util_match-highlighter"><a href="../lib/util/match-highlighter.js"><code>match-highlighter.js</code></a></dt>
|
903
|
+
<dd>Adds a <code>matchHighlight</code> method to CodeMirror
|
904
|
+
instances that can be called (typically from
|
905
|
+
a <a href="#option_onCursorActivity"><code>onCursorActivity</code></a>
|
906
|
+
handler) to highlight all instances of a currently selected word
|
907
|
+
with the a classname given as a first argument to the method.
|
908
|
+
Depends on
|
909
|
+
the <a href="#util_searchcursor"><code>searchcursor</code></a>
|
910
|
+
add-on. Demo <a href="../demo/matchhighlighter.html">here</a>.</dd>
|
911
|
+
<dt id="util_closetag"><a href="../lib/util/closetag.js"><code>closetag.js</code></a></dt>
|
912
|
+
<dd>Provides utility functions for adding automatic tag closing
|
913
|
+
to XML modes. See
|
914
|
+
the <a href="../demo/closetag.html">demo</a>.</dd>
|
915
|
+
<dt id="util_loadmode"><a href="../lib/util/loadmode.js"><code>loadmode.js</code></a></dt>
|
916
|
+
<dd>Defines a <code>CodeMirror.requireMode(modename,
|
917
|
+
callback)</code> function that will try to load a given mode and
|
918
|
+
call the callback when it succeeded. You'll have to
|
919
|
+
set <code>CodeMirror.modeURL</code> to a string that mode paths
|
920
|
+
can be constructed from, for
|
921
|
+
example <code>"mode/%N/%N.js"</code>—the <code>%N</code>'s will
|
922
|
+
be replaced with the mode name. Also
|
923
|
+
defines <code>CodeMirror.autoLoadMode(instance, mode)</code>,
|
924
|
+
which will ensure the given mode is loaded and cause the given
|
925
|
+
editor instance to refresh its mode when the loading
|
926
|
+
succeeded. See the <a href="../demo/loadmode.html">demo</a>.</dd>
|
927
|
+
</dl>
|
928
|
+
|
929
|
+
<h2 id="modeapi">Writing CodeMirror Modes</h2>
|
638
930
|
|
639
|
-
<p>
|
640
|
-
|
641
|
-
|
642
|
-
|
931
|
+
<p>Modes typically consist of a single JavaScript file. This file
|
932
|
+
defines, in the simplest case, a lexer (tokenizer) for your
|
933
|
+
language—a function that takes a character stream as input,
|
934
|
+
advances it past a token, and returns a style for that token. More
|
935
|
+
advanced modes can also handle indentation for the language.</p>
|
643
936
|
|
644
937
|
<p id="defineMode">The mode script should
|
645
938
|
call <code>CodeMirror.defineMode</code> to register itself with
|
@@ -649,9 +942,10 @@
|
|
649
942
|
mode (i.e. <code>"xml"</code> is defined <code>xml.js</code>). The
|
650
943
|
second argument should be a function that, given a CodeMirror
|
651
944
|
configuration object (the thing passed to
|
652
|
-
the <code>CodeMirror</code> function) and
|
653
|
-
object (as in
|
654
|
-
option), returns
|
945
|
+
the <code>CodeMirror</code> function) and an optional mode
|
946
|
+
configuration object (as in
|
947
|
+
the <a href="#option_mode"><code>mode</code></a> option), returns
|
948
|
+
a mode object.</p>
|
655
949
|
|
656
950
|
<p>Typically, you should use this second argument
|
657
951
|
to <code>defineMode</code> as your module scope function (modes
|
@@ -665,8 +959,8 @@
|
|
665
959
|
meaning that they look at one element (<em>token</em>) of the code
|
666
960
|
at a time, with no memory of what came before. Most, however, will
|
667
961
|
need to remember something. This is done by using a <em>state
|
668
|
-
object</em>, which is an object that
|
669
|
-
|
962
|
+
object</em>, which is an object that is always passed when
|
963
|
+
reading a token, and which can be mutated by the tokenizer.</p>
|
670
964
|
|
671
965
|
<p id="startState">Modes that use a state must define
|
672
966
|
a <code>startState</code> method on their mode object. This is a
|
@@ -680,8 +974,7 @@
|
|
680
974
|
style string, or <code>null</code> for tokens that do not have to
|
681
975
|
be styled. For your styles, you can either use the 'standard' ones
|
682
976
|
defined in the themes (without the <code>cm-</code> prefix), or
|
683
|
-
define your own
|
684
|
-
mode does) and have people include a custom theme for your
|
977
|
+
define your own and have people include a custom CSS file for your
|
685
978
|
mode.<p>
|
686
979
|
|
687
980
|
<p id="StringStream">The stream object encapsulates a line of code
|
@@ -721,7 +1014,9 @@
|
|
721
1014
|
<dd>Moves the position to the end of the line.</dd>
|
722
1015
|
<dt><code>skipTo(ch) → boolean</code></dt>
|
723
1016
|
<dd>Skips to the next occurrence of the given character, if
|
724
|
-
found
|
1017
|
+
found on the current line (doesn't advance the stream if the
|
1018
|
+
character does not occur on the line). Returns true if the
|
1019
|
+
character was found.</dd>
|
725
1020
|
<dt><code>match(pattern, consume, caseFold) → boolean</code></dt>
|
726
1021
|
<dd>Act like a
|
727
1022
|
multi-character <code>eat</code>—if <code>consume</code> is true
|
@@ -782,9 +1077,10 @@
|
|
782
1077
|
reliable highlighting of bad closing tags, as an example.</p>
|
783
1078
|
|
784
1079
|
<p id="indent">If you want your mode to provide smart indentation
|
785
|
-
(
|
786
|
-
and <
|
787
|
-
|
1080
|
+
(though the <a href="#indentLine"><code>indentLine</code></a>
|
1081
|
+
method and the <code>indentAuto</code>
|
1082
|
+
and <code>newlineAndIndent</code> commands, which keys can be
|
1083
|
+
<a href="#option_extraKeys">bound</a> to), you must define
|
788
1084
|
an <code>indent(state, textAfter)</code> method on your mode
|
789
1085
|
object.</p>
|
790
1086
|
|
@@ -805,15 +1101,15 @@
|
|
805
1101
|
<p>So, to summarize, a mode <em>must</em> provide
|
806
1102
|
a <code>token</code> method, and it <em>may</em>
|
807
1103
|
provide <code>startState</code>, <code>copyState</code>,
|
808
|
-
and <code>indent</code> methods. For
|
809
|
-
|
810
|
-
|
811
|
-
the <a href="mode/
|
1104
|
+
<code>compareStates</code>, and <code>indent</code> methods. For
|
1105
|
+
an example of a trivial mode, see
|
1106
|
+
the <a href="../mode/diff/diff.js">diff mode</a>, for a more involved
|
1107
|
+
example, see the <a href="../mode/clike/clike.js">C-like
|
812
1108
|
mode</a>.</p>
|
813
1109
|
|
814
1110
|
<p>Sometimes, it is useful for modes to <em>nest</em>—to have one
|
815
1111
|
mode delegate work to another mode. An example of this kind of
|
816
|
-
mode is the <a href="mode/htmlmixed/htmlmixed.js">mixed-mode HTML
|
1112
|
+
mode is the <a href="../mode/htmlmixed/htmlmixed.js">mixed-mode HTML
|
817
1113
|
mode</a>. To implement such nesting, it is usually necessary to
|
818
1114
|
create mode objects and copy states yourself. To create a mode
|
819
1115
|
object, there are <code>CodeMirror.getMode(options,
|
@@ -851,8 +1147,10 @@
|
|
851
1147
|
<li><a href="#overview">Overview</a></li>
|
852
1148
|
<li><a href="#usage">Basic Usage</a></li>
|
853
1149
|
<li><a href="#config">Configuration</a></li>
|
1150
|
+
<li><a href="#keymaps">Keymaps</a></li>
|
854
1151
|
<li><a href="#styling">Customized Styling</a></li>
|
855
1152
|
<li><a href="#api">Programming API</a></li>
|
1153
|
+
<li><a href="#addons">Add-ons</a></li>
|
856
1154
|
<li><a href="#modeapi">Writing CodeMirror Modes</a></li>
|
857
1155
|
</ul>
|
858
1156
|
|