erp_app 3.0.0 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -0
- data/app/controllers/erp_app/application_controller.rb +1 -0
- data/app/controllers/erp_app/desktop/base_controller.rb +1 -1
- data/app/controllers/erp_app/desktop/configuration_management/base_controller.rb +180 -0
- data/app/controllers/erp_app/desktop/configuration_management/options_controller.rb +55 -0
- data/app/controllers/erp_app/desktop/configuration_management/types_controller.rb +129 -0
- data/app/controllers/erp_app/desktop/control_panel/application_management_controller.rb +1 -1
- data/app/controllers/erp_app/desktop/control_panel/desktop_management_controller.rb +1 -1
- data/app/controllers/erp_app/desktop/control_panel/profile_management_controller.rb +14 -16
- data/app/controllers/erp_app/desktop/file_manager/base_controller.rb +5 -7
- data/app/controllers/erp_app/desktop/system_management/application_role_management_controller.rb +1 -1
- data/app/controllers/erp_app/desktop/user_management/application_management_controller.rb +9 -9
- data/app/controllers/erp_app/desktop/user_management/base_controller.rb +1 -1
- data/app/controllers/erp_app/desktop/user_management/role_management_controller.rb +13 -8
- data/app/controllers/erp_app/mobile/base_controller.rb +21 -0
- data/app/controllers/erp_app/mobile/login_controller.rb +11 -0
- data/app/controllers/erp_app/mobile/user_management/base_controller.rb +24 -0
- data/app/controllers/erp_app/organizer/base_controller.rb +6 -5
- data/app/controllers/erp_app/organizer/crm/base_controller.rb +117 -15
- data/app/controllers/erp_app/public_controller.rb +73 -6
- data/app/controllers/erp_app/shared/configuration_controller.rb +53 -0
- data/app/controllers/erp_app/widget_proxy_controller.rb +1 -1
- data/app/models/app_container.rb +8 -2
- data/app/models/application.rb +1 -1
- data/app/models/configuration.rb +129 -0
- data/app/models/configuration_item.rb +45 -0
- data/app/models/configuration_item_type.rb +96 -0
- data/app/models/configuration_item_type_configuration_option.rb +10 -0
- data/app/models/configuration_option.rb +20 -0
- data/app/models/desktop.rb +7 -10
- data/app/models/extensions/user.rb +41 -2
- data/app/models/mobile.rb +10 -0
- data/app/models/mobile_application.rb +6 -0
- data/app/models/organizer.rb +3 -6
- data/app/models/preference.rb +2 -2
- data/app/models/preference_type.rb +1 -1
- data/app/models/user_preference.rb +3 -3
- data/app/models/valid_configuration.rb +4 -0
- data/app/models/valid_preference_type.rb +2 -2
- data/app/observers/user_app_container_observer.rb +7 -2
- data/app/views/erp_app/desktop/base/index.erb +25 -32
- data/app/views/erp_app/login/index.erb +3 -3
- data/app/views/erp_app/mobile/base/index.erb +37 -0
- data/app/views/erp_app/mobile/login/index.erb +22 -0
- data/app/views/erp_app/mobile/user_management/base/index.html.erb +28 -0
- data/app/views/erp_app/organizer/base/get_party_details.erb +19 -0
- data/app/views/erp_app/organizer/base/index.erb +20 -23
- data/app/views/erp_app/widget_proxy/index.erb +1 -1
- data/config/routes.rb +22 -0
- data/db/data_migrations/20110728201729_erp_app_setup.rb +3 -1
- data/db/data_migrations/20120229160222_add_userinfo_widget.rb +30 -0
- data/db/data_migrations/20120405193721_create_party_and_role_type_for_communication_events.rb +10 -0
- data/db/data_migrations/20120411180756_create_user_management_mobile_application.rb +18 -0
- data/db/data_migrations/20120413000515_create_mobile_containers.rb +13 -0
- data/db/data_migrations/20120418164215_create_configuration_management_desktop_application.rb +22 -0
- data/db/data_migrations/upgrade/20120213182651_add_true_north_background.rb +16 -0
- data/db/migrate/20080805000096_base_app_framework.rb +125 -33
- data/db/migrate/20120316152543_add_is_template_to_configurations.rb +5 -0
- data/db/migrate/20120320182253_update_app_container.rb +20 -0
- data/db/migrate/20120325123722_remove_file_system_loader_column.rb +9 -0
- data/db/migrate/20120411151848_add_base_url_to_application.rb +5 -0
- data/db/migrate/20120427000446_add_user_defined_to_config_option.rb +17 -0
- data/db/migrate/20120429130430_update_configuration_join_tables.rb +16 -0
- data/db/migrate/upgrade/20120208201934_add_configuration_models.rb +109 -0
- data/db/migrate/upgrade/20120209194251_add_user_defined_to_config_type.rb +5 -0
- data/db/migrate/upgrade/20120210172929_add_config_types_to_configs.rb +23 -0
- data/lib/erp_app/application_resource_loader/base_loader.rb +17 -0
- data/lib/erp_app/application_resource_loader/{file_system_loader.rb → desktop_organizer_loader.rb} +15 -29
- data/lib/erp_app/application_resource_loader/mobile_loader.rb +46 -0
- data/lib/erp_app/application_resource_loader/shared_loader.rb +26 -0
- data/lib/erp_app/application_resource_loader.rb +4 -0
- data/lib/erp_app/config.rb +2 -2
- data/lib/erp_app/engine.rb +7 -4
- data/lib/erp_app/extensions/railties/action_view/base.rb +12 -0
- data/lib/erp_app/extensions/railties/action_view/helpers/active_ext_helper.rb +17 -0
- data/lib/erp_app/extensions/railties/action_view/helpers/extjs_helper.rb +45 -0
- data/lib/erp_app/extensions/railties/action_view/helpers/include_helper.rb +134 -0
- data/lib/erp_app/extensions/railties/action_view/helpers/tag_helper.rb +27 -0
- data/lib/erp_app/extensions.rb +1 -2
- data/lib/erp_app/version.rb +8 -1
- data/lib/erp_app/widgets/base.rb +50 -43
- data/lib/erp_app/widgets/javascript_loader.rb +13 -20
- data/lib/erp_app/widgets/loader.rb +126 -0
- data/lib/erp_app/widgets/railties/action_view/base.rb +8 -0
- data/lib/erp_app/widgets/railties/action_view/helpers/widget_helper.rb +57 -0
- data/lib/erp_app/widgets.rb +2 -2
- data/lib/erp_app.rb +3 -1
- data/lib/generators/cms_widget/templates/engine/engine_template.rb +0 -4
- data/lib/generators/cms_widget/templates/javascript/base.js.erb +2 -1
- data/lib/generators/desktop_application/USAGE +1 -1
- data/lib/generators/desktop_application/templates/controllers/controller_template.rb +7 -5
- data/lib/generators/desktop_application/templates/migrate/migration_template.rb +0 -4
- data/lib/generators/mobile_application/USAGE +24 -0
- data/lib/generators/mobile_application/mobile_application_generator.rb +27 -0
- data/lib/generators/mobile_application/templates/INSTALL +25 -0
- data/lib/generators/mobile_application/templates/controllers/controller_template.rb +11 -0
- data/lib/generators/mobile_application/templates/migrate/migration_template.rb +14 -0
- data/lib/generators/mobile_application/templates/public/app.js.erb +35 -0
- data/lib/generators/mobile_application/templates/views/index.html.erb +28 -0
- data/lib/generators/organizer_application/templates/controllers/controller_template.rb +9 -11
- data/public/images/icons/apartment/apartment_16x16.png +0 -0
- data/public/images/icons/apartment/apartment_24x24.png +0 -0
- data/public/images/icons/apartment/apartment_32x32.png +0 -0
- data/public/images/icons/apartment/apartment_48x48.png +0 -0
- data/public/images/wallpaper/truenorth.png +0 -0
- data/public/javascripts/erp_app/authentication/widget_manager.js +23 -2
- data/public/javascripts/erp_app/ckeditor/ckeditor.js +113 -111
- data/public/javascripts/erp_app/ckeditor/contents.css +2 -2
- data/public/javascripts/erp_app/ckeditor/lang/_translationstatus.txt +59 -59
- data/public/javascripts/erp_app/ckeditor/lang/af.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/ar.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/bg.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/bn.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/bs.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/ca.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/cs.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/cy.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/da.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/de.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/el.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/en-au.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/en-ca.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/en-gb.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/en.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/eo.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/es.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/et.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/eu.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/fa.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/fi.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/fo.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/fr-ca.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/fr.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/gl.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/gu.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/he.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/hi.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/hr.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/hu.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/is.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/it.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/ja.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/ka.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/km.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/ko.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/lt.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/lv.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/mn.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/ms.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/nb.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/nl.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/no.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/pl.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/pt-br.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/pt.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/ro.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/ru.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/sk.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/sl.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/sr-latn.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/sr.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/sv.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/th.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/tr.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/uk.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/vi.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/zh-cn.js +1 -1
- data/public/javascripts/erp_app/ckeditor/lang/zh.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/autogrow/plugin.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/docprops/dialogs/docprops.js +2 -2
- data/public/javascripts/erp_app/ckeditor/plugins/find/dialogs/find.js +5 -5
- data/public/javascripts/erp_app/ckeditor/plugins/flash/dialogs/flash.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/forms/dialogs/textarea.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/image/dialogs/image.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/link/dialogs/link.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/codemirror_config.js +85 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/editor.css +96 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/images/buttonbg.gif +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/images/cancel.png +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/images/highlight.png +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/images/redo.png +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/images/reindent.png +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/images/save.png +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/images/search.png +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/images/undo.png +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/config/nocolors.css +24 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/LICENSE +23 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/bigtest.html +1296 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/compress.html +169 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/csharp/css/csharpcolors.css +60 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/csharp/index.html +61 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/csharp/js/parsecsharp.js +329 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/csharp/js/tokenizecsharp.js +196 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/freemarker/LICENSE +24 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/freemarker/css/freemarkercolors.css +63 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/freemarker/index.html +75 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/freemarker/js/parsefreemarker.js +380 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/groovy/index.html +57 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/java/LICENSE +20 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/java/css/javacolors.css +64 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/java/index.html +66 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/java/js/parsejava.js +285 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/java/js/tokenizejava.js +222 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/lua/LICENSE +32 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/lua/css/luacolors.css +63 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/lua/index.html +68 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/lua/js/parselua.js +254 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/ometa/LICENSE +23 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/ometa/css/ometacolors.css +63 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/ometa/index.html +77 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/ometa/js/parseometa.js +364 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/ometa/js/tokenizeometa.js +209 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/php/LICENSE +37 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/php/css/phpcolors.css +114 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/php/index.html +310 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/php/js/parsephp.js +419 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/php/js/parsephphtmlmixed.js +116 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/php/js/tokenizephp.js +1208 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/plsql/LICENSE +22 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/plsql/css/plsqlcolors.css +57 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/plsql/index.html +67 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/plsql/js/parseplsql.js +233 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/python/LICENSE +32 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/python/css/pythoncolors.css +58 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/python/index.html +141 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/python/js/parsepython.js +541 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/regex/css/js-regexcolors.css +214 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/regex/css/regexcolors.css +214 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/regex/index.html +114 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/regex/js/parsejavascript_and_regex.js +91 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/regex/js/parseregex-unicode.js +284 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/regex/js/parseregex.js +847 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/regex/js-regex.html +118 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/scheme/LICENSE +23 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/scheme/css/schemecolors.css +45 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/scheme/index.html +82 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/scheme/js/parsescheme.js +428 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/scheme/js/tokenizescheme.js +241 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/sql/LICENSE +22 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/sql/css/sqlcolors.css +59 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/sql/index.html +56 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/sql/js/parsesql.js +267 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/xquery/LICENSE +13 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/xquery/css/xqcolors-dark.css +93 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/xquery/css/xqcolors.css +99 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/xquery/css/xqcolors2.css +96 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/xquery/index.html +552 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/xquery/js/parsexquery.js +234 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/contrib/xquery/js/tokenizexquery.js +457 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/baboon.png +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/baboon_vector.ai +965 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/csscolors.css +55 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/docs.css +158 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/font.js +15 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/jscolors.css +59 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/people.jpg +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/sparqlcolors.css +43 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/css/xmlcolors.css +55 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/csstest.html +60 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/faq.html +86 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/favicon.ico +0 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/googleb196c451afc2ee11.html +1 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/googlehostedservice.html +1 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/highlight.html +82 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/htmltest.html +53 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/index.html +254 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/codemirror.js +582 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/editor.js +1670 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/highlight.js +68 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/mirrorframe.js +81 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/parsecss.js +161 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/parsedummy.js +32 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/parsehtmlmixed.js +93 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/parsejavascript.js +359 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/parsesparql.js +162 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/parsexml.js +291 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/select.js +697 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/stringstream.js +159 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/tokenize.js +57 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/tokenizejavascript.js +174 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/undo.js +413 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/unittests.js +44 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/js/util.js +133 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/jstest.html +56 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/manual.html +806 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/mixedtest.html +52 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/sparqltest.html +41 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/story.html +672 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/unittests.html +125 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/editor/xhtmltest.xhtml +50 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/lang/de.js +20 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/codemirror/lang/en.js +20 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/dialogs/sourcepopup.js +102 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/lang/de.js +9 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/lang/en.js +9 -0
- data/public/javascripts/erp_app/ckeditor/plugins/sourcepopup/plugin.js +27 -0
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/specialchar/lang/en.js +1 -1
- data/public/javascripts/erp_app/ckeditor/plugins/table/dialogs/table.js +4 -4
- data/public/javascripts/erp_app/ckeditor/plugins/wsc/dialogs/wsc.js +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/kama/dialog.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/kama/editor.css +3 -3
- data/public/javascripts/erp_app/ckeditor/skins/office2003/dialog.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/office2003/editor.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/v2/dialog.css +1 -1
- data/public/javascripts/erp_app/ckeditor/skins/v2/editor.css +1 -1
- data/public/javascripts/erp_app/ckeditor/themes/default/theme.js +2 -2
- data/public/javascripts/erp_app/ckeditor_example_config_override.js +44 -0
- data/public/javascripts/erp_app/desktop/applications/configuration_management/configuration_options_panel.js +229 -0
- data/public/javascripts/erp_app/desktop/applications/configuration_management/configuration_tree_panel.js +482 -0
- data/public/javascripts/erp_app/desktop/applications/configuration_management/configuration_types_panel.js +425 -0
- data/public/javascripts/erp_app/desktop/applications/configuration_management/module.js +95 -0
- data/public/javascripts/erp_app/desktop/applications/configuration_management/stores.0.js +68 -0
- data/public/javascripts/erp_app/desktop/applications/control_panel/application_management_panel.js +2 -1
- data/public/javascripts/erp_app/desktop/applications/control_panel/module.js +48 -47
- data/public/javascripts/erp_app/desktop/applications/control_panel/profile_management_panel.js +141 -84
- data/public/javascripts/erp_app/desktop/applications/file_manager/module.js +1 -2
- data/public/javascripts/erp_app/desktop/applications/scaffold/models_tree_panel.js +1 -2
- data/public/javascripts/erp_app/desktop/applications/system_management/application_role_management_panel.js +1 -2
- data/public/javascripts/erp_app/desktop/applications/user_management/module.js +10 -6
- data/public/javascripts/erp_app/desktop/applications/user_management/role_management_panel.js +3 -9
- data/public/javascripts/erp_app/desktop/applications/user_management/user_application_mgt_panel.js +4 -10
- data/public/javascripts/erp_app/ecommerce/credit_card_window.js +1 -1
- data/public/javascripts/erp_app/jquery_support.js +5 -5
- data/public/javascripts/erp_app/login/mobile.js +52 -0
- data/public/javascripts/erp_app/mobile/app.js +46 -0
- data/public/javascripts/erp_app/mobile/applications/user_management/app/model/user.js +14 -0
- data/public/javascripts/erp_app/mobile/applications/user_management/app/store/users.js +19 -0
- data/public/javascripts/erp_app/mobile/applications/user_management/app/view/templates.js +24 -0
- data/public/javascripts/erp_app/mobile/applications/user_management/app.js +168 -0
- data/public/javascripts/erp_app/mobile/mobile_base.js +10 -0
- data/public/javascripts/erp_app/organizer/applications/crm/base.js +415 -117
- data/public/javascripts/erp_app/organizer/applications/crm/contact_mechanism_grid.js +8 -1
- data/public/javascripts/erp_app/organizer/applications/crm/party_grid.js +33 -36
- data/public/javascripts/erp_app/organizer/applications/crm/userinfo.js +215 -0
- data/public/javascripts/erp_app/organizer/layout.js +9 -11
- data/public/javascripts/erp_app/shared/active_ext/active_ext_grid.js +1 -2
- data/public/javascripts/erp_app/shared/active_ext/active_ext_grid_panel.js +2 -3
- data/public/javascripts/erp_app/shared/compass_ckeditor.js +7 -6
- data/public/javascripts/erp_app/shared/compass_codemirror.js +161 -162
- data/public/javascripts/erp_app/shared/configuration/configuration_form.js +278 -0
- data/public/javascripts/erp_app/shared/configuration/configuration_panel.js +109 -0
- data/public/javascripts/erp_app/{coolclock → shared/coolclock}/coolclock.js +0 -0
- data/public/javascripts/erp_app/{coolclock → shared/coolclock}/moreskins.js +0 -0
- data/public/javascripts/erp_app/{coolclock → shared/coolclock}/tray_clock.js +0 -0
- data/public/javascripts/erp_app/shared/dynamic_editable_grid.js +29 -28
- data/public/javascripts/erp_app/shared/dynamic_editable_grid_loader_panel.js +3 -3
- data/public/javascripts/erp_app/shared/file_manager_tree.js +41 -25
- data/public/javascripts/erp_app/shared/file_upload/Ext.ux.AwesomeUploader.js +1 -1
- data/public/javascripts/erp_app/shared/file_upload/Ext.ux.XHRUpload.js +1 -1
- data/public/javascripts/erp_app/shared/file_upload/upload_window.js +245 -242
- data/public/javascripts/erp_app/shared/google_map_panel.js +82 -83
- data/public/javascripts/erp_app/shared/notes_grid.js +1 -2
- data/public/javascripts/erp_app/shared/preference_form.js +3 -5
- data/public/javascripts/erp_app/tinymce/Ext.ux.TinyMCE.js +689 -0
- data/public/javascripts/erp_app/tinymce/center_region.js +611 -0
- data/public/javascripts/erp_app/utility.js +284 -246
- data/public/javascripts/erp_app/widgets.js +39 -35
- data/public/javascripts/extjs/Ext.ux.form.MultiSelect.js +422 -0
- data/public/javascripts/extjs/ext-all-debug.js +15973 -12927
- data/public/javascripts/extjs/ext-all.js +1 -1
- data/public/javascripts/extjs/overrides.js +61 -0
- data/public/javascripts/sencha_touch/sencha-touch-all-debug.js +78370 -0
- data/public/javascripts/sencha_touch/sencha-touch-all.js +15 -0
- data/public/stylesheets/erp_app/mobile/applications/user_management/main.css +5 -0
- data/public/stylesheets/erp_app/mobile/mobile.css +336 -0
- data/public/stylesheets/erp_app/{compass-ext-all.css → shared/compass-ext-all.css} +37 -1
- data/public/stylesheets/extjs/resources/css/ext-all-access.css +1 -1
- data/public/stylesheets/extjs/resources/css/ext-all-gray.css +1 -1
- data/public/stylesheets/extjs/resources/css/ext-all-scoped.css +1 -1
- data/public/stylesheets/extjs/resources/css/ext-all.css +1 -1
- data/public/stylesheets/extjs/resources/css/ext-ie-scoped.css +1 -1
- data/public/stylesheets/extjs/resources/css/ext-ie.css +1 -1
- data/public/stylesheets/extjs/resources/css/ext-sandbox.css +1 -1
- data/public/stylesheets/extjs/resources/css/ext-standard-scoped.css +1 -1
- data/public/stylesheets/extjs/resources/css/ext-standard.css +1 -1
- data/public/stylesheets/extjs/resources/sass/ext-all-access.scss +7 -0
- data/public/stylesheets/extjs/resources/sass/ext-all-gray.scss +6 -0
- data/public/stylesheets/extjs/resources/themes/images/access/boundlist/trigger-arrow.png +0 -0
- data/public/stylesheets/extjs/resources/themes/images/access/grid/refresh-disabled.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/access/tab-bar/{tab-bar-bg.gif → tab-bar-default-bg.gif} +0 -0
- data/public/stylesheets/extjs/resources/themes/images/access/tree/drop-above.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/access/tree/drop-append.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/access/tree/drop-below.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-large-focus-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-large-over-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-large-pressed-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-medium-focus-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-medium-over-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-medium-pressed-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-small-focus-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-small-over-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-small-pressed-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-focus-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-over-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-large-pressed-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-focus-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-over-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-medium-pressed-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-focus-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-over-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/form-invalid-tip/form-invalid-tip-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/form-invalid-tip/form-invalid-tip-sides.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/tab/tab-default-bottom-disabled-bg.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/tab/tab-default-bottom-disabled-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/tab/tab-default-bottom-disabled-sides.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/tab/tab-default-top-disabled-bg.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/tab/tab-default-top-disabled-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/tab/tab-default-top-disabled-sides.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/tab-bar/tab-bar-default-bg.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/tip/tip-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/window-header/window-header-default-bottom-sides.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/window-header/window-header-default-left-sides.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/window-header/window-header-default-right-sides.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/window-header/window-header-default-top-corners.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/images/default/window-header/window-header-default-top-sides.gif +0 -0
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/_all.scss +3 -0
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/_mixins.scss +6 -3
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/core/_core.scss +17 -17
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/core/_reset.scss +17 -7
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/layout/_layout.scss +10 -6
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/mixins/_frame.scss +4 -4
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/mixins/_reset-extras.scss +144 -0
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/mixins/_theme-background-image.scss +8 -4
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/util/_dragdrop.scss +3 -3
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/util/_messagebox.scss +5 -5
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/util/_resizable.scss +6 -6
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/util/_splitter.scss +8 -8
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/util/_tool.scss +1 -1
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/variables/_core.scss +1 -1
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/variables/_menu.scss +1 -0
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_button.scss +38 -27
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_datepicker.scss +7 -7
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_drawcomponent.scss +1 -5
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_grid.scss +56 -57
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_loadmask.scss +1 -1
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_menu.scss +22 -16
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_panel.scss +10 -4
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_progress-bar.scss +2 -1
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_qtip.scss +1 -1
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_slider.scss +9 -11
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_tab.scss +68 -43
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_tabbar.scss +1 -1
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_toolbar.scss +3 -3
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/_tree.scss +48 -31
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/form/_all.scss +4 -2
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/form/_checkbox.scss +3 -2
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/form/_checkboxgroup.scss +3 -2
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/form/_field.scss +3 -3
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/form/_fieldset.scss +1 -5
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/form/_htmleditor.scss +16 -15
- data/public/stylesheets/extjs/resources/themes/stylesheets/ext4/default/widgets/form/_triggerfield.scss +10 -10
- data/public/stylesheets/extjs/resources/themes/templates/resources/sass/config.rb +2 -4
- data/public/stylesheets/extjs/resources/themes/templates/resources/sass/my-ext-theme.scss +1 -0
- data/public/stylesheets/sencha_touch/resources/css/android.css +1 -0
- data/public/stylesheets/sencha_touch/resources/css/apple.css +1 -0
- data/public/stylesheets/sencha_touch/resources/css/bb6.css +1 -0
- data/public/stylesheets/sencha_touch/resources/css/sencha-touch.css +1 -0
- data/public/stylesheets/sencha_touch/resources/css/touch-charts.css +1 -0
- data/public/stylesheets/sencha_touch/resources/css-debug/android.css +6757 -0
- data/public/stylesheets/sencha_touch/resources/css-debug/apple.css +6766 -0
- data/public/stylesheets/sencha_touch/resources/css-debug/bb6.css +6352 -0
- data/public/stylesheets/sencha_touch/resources/css-debug/sencha-touch.css +6755 -0
- data/public/stylesheets/sencha_touch/resources/images/icon1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/images/icon2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/images/icon3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/images/icon4.png +0 -0
- data/public/stylesheets/sencha_touch/resources/images/welcome.png +0 -0
- data/public/stylesheets/sencha_touch/resources/sass/android.scss +37 -0
- data/public/stylesheets/sencha_touch/resources/sass/apple.scss +39 -0
- data/public/stylesheets/sencha_touch/resources/sass/bb6.scss +66 -0
- data/public/stylesheets/sencha_touch/resources/sass/config-debug.rb +11 -0
- data/public/stylesheets/sencha_touch/resources/sass/config.rb +11 -0
- data/public/stylesheets/sencha_touch/resources/sass/sencha-touch.scss +18 -0
- data/public/stylesheets/sencha_touch/resources/themes/compass_init.rb +6 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/check.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/clear_icon.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/disclosure.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/disclosure2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/dotgrid.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/loading.gif +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/action.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/add.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/add1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/add_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/address_book.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/arrow_down.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/arrow_left.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/arrow_right.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/arrow_up.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/at.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/atom.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/attachment.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/attachment2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/attachment3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/attachment_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/backspace.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/battery_full.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/battery_low.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/battery_power.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/blank.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bolt.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bolt_side.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bookmark1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bookmark2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bookmark_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bookmarks.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/briefcase1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/briefcase2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/brightness1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/brightness2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/broadcast.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bug.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bulb.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bullseye1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/bullseye2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/calendar.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/calendar2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/calendar_add.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/card1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/card2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chart1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chart2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chart3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chat.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chat1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chat2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chat3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chat4.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chat_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/chat_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/check1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/check2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/check_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/check_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/check_dotted.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/circle.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/circle2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/clash.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/cloud.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/cloud_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/cloud_black_upload1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/cloud_black_upload2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/cloud_bolt.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/cloud_download.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/code1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/code2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/code3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/compass1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/compass2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/compass3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/compose.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/compose1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/compose2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/compose3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/compose_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/contract.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/cube.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/data.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/delete.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/delete1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/delete_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/delete_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_black_landscape.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_compose1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_compose2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_delete.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_down.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_drawer.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_list.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_new.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_send.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/doc_up.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/docs1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/docs2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/docs_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/docs_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/download.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/download1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/download2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/download_screen.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/eject.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/empty1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/empty2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/equalizer1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/equalizer2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/event_complete.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/expand.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/favorites.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/favorites1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/favorites_circle.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/fforward.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/find.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/flag.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/flickr2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/folder.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/folder_add.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/folder_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/folder_black_open.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/folder_delete.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/folder_delete2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/folder_lock.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/folder_open2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/font.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/forbidden.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/forward_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/globe1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/globe2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/globe_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/headphones.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/heart.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/heart_circle.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/help.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/help_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/home.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/home2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/hot.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/inbox1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/inbox2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/inbox3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/infinite.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/infinite2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/info.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/info2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/info_plain.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/info_plain2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/json.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/lab.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/layout.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/link1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/link2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/link_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/list.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/locate.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/locate1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/locate2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/locate3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/locate4.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/lock_closed.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/lock_open.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/look.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/loop.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/loop2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/loop_circle.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/magic.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/mail.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/mail1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/mail2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/mail3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/mail4.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/mail5.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/maps.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/mic.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/minus1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/minus2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/minus_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/minus_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/monitor1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/monitor2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/monitor3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/monitor4.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/more.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/mouse.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/move.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/music1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/music2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/nodes1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/nodes2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/note1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/note2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/note3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/note_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/nuclear.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/organize.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/outbox.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/pause.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/phone1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/phone2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/phone_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/phone_ring1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/phone_ring2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/photo1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/photo2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/photo3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/photo_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/photo_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/photos1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/photos2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/photos4.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/piechart.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/play1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/play2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/play_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/play_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/podcast.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/power socket.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/power_on.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/print.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/print2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/quote1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/quote2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/quote_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/quote_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/quote_black3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/refresh.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/refresh1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/refresh2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/refresh3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/refresh5.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/reply.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/replytoall.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/resize.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/resize_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/rewind.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/right.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/right2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/rss.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/rss2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/rss_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/rss_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/rss_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/screens.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/search.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/search1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/search2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/search_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/server.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/servers.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings10.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings11.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings4.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings5.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings6.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings7.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings8.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings9.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/settings_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/share.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/shield1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/shield2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/shop1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/shop2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/shuffle.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/sign_backforth.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/sign_cross.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/sign_leftright.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/sign_leftright2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/sign_split.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/sign_switch.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/sign_uturn.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/spaces1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/spaces2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/speedometer1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/speedometer2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/speedometer_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/speedometer_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/star.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/stop.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/stop1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/stop2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/sync.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/tabbed_book.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/tag.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/tag_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/tags.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/team.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/team1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/time.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/time_repeat.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/trash.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/trash2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/trash_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/tree.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/tv.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/tweak.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/twitter1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/twitter2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/up1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/up2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/up_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/upload2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user_add.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user_business.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user_fave.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user_list.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user_list2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user_remote1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user_remove2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/user_send.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/video.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/video_black1.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/video_black2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/volume.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/volume_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/volume_down.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/volume_mute.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/volume_up.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/warming_dotted.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/warning_black.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/wifi.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/wifi2.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/wifi3.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/wifi4.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pictos/window.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/pullarrow.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/select_mask.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/tip.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/tip_horizontal.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/tip_right.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/togglebg.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/togglemask.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/togglethumb.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/togglethumbbg.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/togglethumbmask.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/images/default/trackmask_outer.png +0 -0
- data/public/stylesheets/sencha_touch/resources/themes/lib/theme_images.rb +18 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/_all.scss +2 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/_core.scss +3 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/_global.scss +2 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/_mixins.scss +196 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/_variables.scss +116 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/_widgets.scss +16 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/core/_core.scss +189 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/core/_layout.scss +362 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/core/_reset.scss +62 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_buttons.scss +354 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_carousel.scss +113 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_form-sliders-basic.scss +102 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_form-sliders.scss +149 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_form.scss +608 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_img.scss +5 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_indexbar.scss +76 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_list.scss +401 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_loading-spinner.scss +121 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_map.scss +11 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_media.scss +21 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_msgbox.scss +94 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_panel.scss +79 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_picker.scss +154 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_sheets.scss +52 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_tabs.scss +269 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_toolbar-forms.scss +182 -0
- data/public/stylesheets/sencha_touch/resources/themes/stylesheets/sencha-touch/default/widgets/_toolbar.scss +156 -0
- data/public/stylesheets/sencha_touch/resources/themes/templates/project/manifest.rb +1 -0
- data/public/stylesheets/sencha_touch/resources/themes/templates/project/sencha-touch.scss +17 -0
- metadata +3251 -2688
- data/README.rdoc +0 -2
- data/config/initializers/erp_app.rb +0 -4
- data/lib/erp_app/extensions/active_record/acts_as_app_container.rb +0 -72
- data/lib/erp_app/extensions/railties/action_view.rb +0 -110
- data/lib/erp_app/widgets/railties/action_view.rb +0 -36
- data/lib/erp_app/widgets/railties/engine.rb +0 -55
- 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/shared/ajax_pagination.js +0 -33
- data/public/stylesheets/extjs/resources/themes/images/access/tab-bar/tab-bar-bg.png +0 -0
- data/public/stylesheets/extjs/resources/themes/templates/resources/css/my-ext-theme.css +0 -59
- data/spec/dummy/db/schema.rb +0 -709
- data/spec/dummy/db/spec.sqlite3 +0 -0
- data/spec/dummy/log/RAILS_ENV=spec.log +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/spec.log +0 -52150
@@ -0,0 +1,672 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Implementing a Syntax-Highlighting JavaScript Editor In JavaScript</title>
|
5
|
+
<link rel="stylesheet" type="text/css" href="css/docs.css"/>
|
6
|
+
<link rel="stylesheet" type="text/css" href="css/jscolors.css"/>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<h1 style="letter-spacing: -2px; font-size: 2.7em;">Implementing a Syntax-Highlighting<br/> JavaScript Editor—In JavaScript</h1>
|
12
|
+
|
13
|
+
<pre class="grey">
|
14
|
+
<img src="css/baboon.png" class="logo" alt="logo"/>/* A brutal odyssey to the dark
|
15
|
+
side of the DOM tree */
|
16
|
+
</pre>
|
17
|
+
|
18
|
+
<div class="clear"><div class="leftbig blk">
|
19
|
+
|
20
|
+
<p>In one of his (very informative) <a
|
21
|
+
href="http://www.learnwebdesignonline.com/videos/programming/javascript/yahoo-douglas-crockford">video
|
22
|
+
lectures</a>, Douglas Crockford remarks that writing JavaScript
|
23
|
+
for the web is 'programming in a hostile environment'. I had done
|
24
|
+
my fair share of weird workarounds, and even occasonally gave up
|
25
|
+
an on idea entirely because browsers just wouldn't support it, but
|
26
|
+
before this project I never really realized just how powerless a
|
27
|
+
programmer can be in the face of buggy, incompatible, and poorly
|
28
|
+
designed platforms.</p>
|
29
|
+
|
30
|
+
<p>The plan was not ridiculously ambitious. I wanted to 'enhance' a
|
31
|
+
textarea to the point where writing code in it is pleasant. This meant
|
32
|
+
automatic indentation and, if possible at all, syntax highlighting.</p>
|
33
|
+
|
34
|
+
<p>In this document I describe the story of implementing this, for your
|
35
|
+
education and amusement. A demonstration of the resulting program,
|
36
|
+
along with the source code, can be found at <a
|
37
|
+
href="http://codemirror.net/">the project website</a>.</p>
|
38
|
+
|
39
|
+
<p style="color: #811; font-size: 90%; font-style: italic">Note:
|
40
|
+
some of the details given here no longer apply to the current <a
|
41
|
+
href="http://codemirror.net/">CodeMirror</a> codebase, which has
|
42
|
+
evolved quite a bit in the meantime.</p>
|
43
|
+
|
44
|
+
<h2 id="indent">Take one: Only indentation</h2>
|
45
|
+
|
46
|
+
<p>The very first attempt merely added auto-indentation to a textarea
|
47
|
+
element. It would scan backwards through the content of the area,
|
48
|
+
starting from the cursor, until it had enough information to decide
|
49
|
+
how to indent the current line. It took me a while to figure out a
|
50
|
+
decent model for indenting JavaScript code, but in the end this seems
|
51
|
+
to work:</p>
|
52
|
+
|
53
|
+
<ul>
|
54
|
+
<li>Code that sits inside a block is indented one unit (generally two
|
55
|
+
spaces) more than the statement or brace that opened the block.</li>
|
56
|
+
<li>A statement that is continued to the next line is indented one unit
|
57
|
+
more than the line that starts the statement.</li>
|
58
|
+
<li>When dealing with lists of arguments or the content of array and
|
59
|
+
object literals there are two possible models. If there is any text
|
60
|
+
directly after the opening brace, bracket, or parenthesis,
|
61
|
+
subsequent lines are aligned with this opening character. If the
|
62
|
+
opening character is followed by a newline (optionally with whitespace
|
63
|
+
or comments before it), the next line is indented one unit further
|
64
|
+
than the line that started the list.</li>
|
65
|
+
<li>And, obviously, if a statement follows another statement it is
|
66
|
+
indented the same amount as the one before it.</li>
|
67
|
+
</ul>
|
68
|
+
|
69
|
+
<p>When scanning backwards through code one has to take string values,
|
70
|
+
comments, and regular expressions (which are delimited by slashes)
|
71
|
+
into account, because braces and semicolons and such are not
|
72
|
+
significant when they appear inside them. Single-line ('//') comments
|
73
|
+
turned out to be rather inefficient to check for when doing a
|
74
|
+
backwards scan, since every time you encounter a newline you have to
|
75
|
+
go on to the next newline to determine whether this line ends in a
|
76
|
+
comment or not. Regular expressions are even worse ― without
|
77
|
+
contextual information they are impossible to distinguish from the
|
78
|
+
division operator, and I didn't get them working in this first
|
79
|
+
version.</p>
|
80
|
+
|
81
|
+
<p>To find out which line to indent, and to make sure that adding or
|
82
|
+
removing whitespace doesn't cause the cursor to jump in strange ways,
|
83
|
+
it is necessary to determine which text the user has selected. Even
|
84
|
+
though I was working with just a simple textarea at this point, this
|
85
|
+
was already a bit of a headache.</p>
|
86
|
+
|
87
|
+
<p>On W3C-standards-respecting browsers, textarea nodes have
|
88
|
+
<code>selectionStart</code> and <code>selectionEnd</code>
|
89
|
+
properties which nicely give you the amount of characters before
|
90
|
+
the start and end of the selection. Great!</p>
|
91
|
+
|
92
|
+
<p>Then, there is Internet Explorer. Internet Explorer also has an API
|
93
|
+
for looking at and manipulating selections. It gives you information
|
94
|
+
such as a detailed map of the space the selected lines take up on the
|
95
|
+
screen, in pixels, and of course the text inside the selection. It
|
96
|
+
does, however, not give you much of a clue on where the selection is
|
97
|
+
located in the document.</p>
|
98
|
+
|
99
|
+
<p>After some experimentation I managed to work out an elaborate
|
100
|
+
method for getting something similar to the
|
101
|
+
<code>selectionStart</code> and <code>selectionEnd</code> values
|
102
|
+
in other browsers. It worked like this:</p>
|
103
|
+
|
104
|
+
<ul>
|
105
|
+
<li>Get the <code>TextRange</code> object corresponding to the selection.</li>
|
106
|
+
<li>Record the length of the text inside it.</li>
|
107
|
+
<li>Make another <code>TextRange</code> that covers the whole textarea element.</li>
|
108
|
+
<li>Set the start of the first <code>TextRange</code> to the start of the second one.</li>
|
109
|
+
<li>Again get the length of the text in the first object.</li>
|
110
|
+
<li>Now <code>selectionEnd</code> is the second length, and <code>selectionStart</code> is
|
111
|
+
the second minus the first one.</li>
|
112
|
+
</ul>
|
113
|
+
|
114
|
+
<p>That seemed to work, but when resetting the selection after modifying
|
115
|
+
the content of the textarea I ran into another interesting feature of
|
116
|
+
these <code>TextRange</code>s: You can move their endpoints by a given number of
|
117
|
+
characters, which is useful when trying to set a cursor at the Nth
|
118
|
+
character of a textarea, but in this context, newlines are <em>not</em>
|
119
|
+
considered to be characters, so you'll always end up one character too
|
120
|
+
far for every newline you passed. Of course, you can count newlines
|
121
|
+
and compensate for this (though it is still not possible to position
|
122
|
+
the cursor right in front of a newline). Sheesh.</p>
|
123
|
+
|
124
|
+
<p>After ragging on Internet Explorer for a while, let us move on and rag
|
125
|
+
on Firefox a bit. It turns out that, in Firefox, getting and setting
|
126
|
+
the text content of a DOM element is unexplainably expensive,
|
127
|
+
especially when there is a lot of text involved. As soon as I tried to
|
128
|
+
use my indentation code to indent itself (some 400 lines), I found
|
129
|
+
myself waiting for over four seconds every time I pressed enter. That
|
130
|
+
seemed a little slow.</p>
|
131
|
+
|
132
|
+
<h2 id="designmode">designMode it is</h2>
|
133
|
+
|
134
|
+
<p>The solution was obvious: Since the text inside a textarea can only be
|
135
|
+
manipulated as one single big string, I had to spread it out over
|
136
|
+
multiple nodes. How do you spread editable content over multiple
|
137
|
+
nodes? Right! <code>designMode</code> or <code>contentEditable</code>.</p>
|
138
|
+
|
139
|
+
<p>Now I wasn't entirely naive about <code>designMode</code>, I had been looking
|
140
|
+
into writing a non-messy WYSIWYG editor before, and at that time I had
|
141
|
+
concluded two things:</p>
|
142
|
+
|
143
|
+
<ul>
|
144
|
+
<li>It is impossible to prevent the user from inserting whichever HTML
|
145
|
+
junk he wants into the document.</li>
|
146
|
+
<li>In Internet Explorer, it is extemely hard to get a good view
|
147
|
+
on what nodes the user has selected.</li>
|
148
|
+
</ul>
|
149
|
+
|
150
|
+
<p>Basically, the good folks at Microsoft designed a really bad interface
|
151
|
+
for putting editable documents in pages, and the other browsers, not
|
152
|
+
wanting to be left behind, more or less copied that. And there isn't
|
153
|
+
much hope for a better way to do this appearing anytime soon. Wise
|
154
|
+
people probably use a Flash movie or (God forbid) a Java applet for
|
155
|
+
these kind of things, though those are not without drawbacks either.</p>
|
156
|
+
|
157
|
+
<p>Anyway, seeing how using an editable document would also make syntax
|
158
|
+
highlighting possible, I foolishly went ahead. There is something
|
159
|
+
perversely fascinating about trying to build a complicated system on a
|
160
|
+
lousy, unsuitable platform.</p>
|
161
|
+
|
162
|
+
<h2 id="parser">A parser</h2>
|
163
|
+
|
164
|
+
<p>How does one do decent syntax highlighting? A very simple scanning can
|
165
|
+
tell the difference between strings, comments, keywords, and other
|
166
|
+
code. But this time I wanted to actually be able to recognize regular
|
167
|
+
expressions, so that I didn't have any blatant incorrect behaviour
|
168
|
+
anymore.</p>
|
169
|
+
|
170
|
+
<p>That brought me to the idea of doing a serious parse on the code. This
|
171
|
+
would not only make detecting regular expressions much easier, it
|
172
|
+
would also give me detailed information about the code, which can be
|
173
|
+
used to determine proper indentation levels, and to make subtle
|
174
|
+
distinctions in colouring, for example the difference between variable
|
175
|
+
names and property names.</p>
|
176
|
+
|
177
|
+
<p>And hey, when we're parsing the whole thing, it would even be possible
|
178
|
+
to make a distinction between local and global variables, and colour
|
179
|
+
them differently. If you've ever programmed JavaScript you can
|
180
|
+
probably imagine how useful this would be ― it is ridiculously easy
|
181
|
+
to accidentally create global instead of local variables. I don't
|
182
|
+
consider myself a JavaScript rookie anymore, but it was (embarrasingly
|
183
|
+
enough) only this week that I realized that my habit of typing <code>for
|
184
|
+
(name in object) ...</code> was creating a global variable <code>name</code>, and that
|
185
|
+
I should be typing <code>for (var name in object) ...</code> instead.</p>
|
186
|
+
|
187
|
+
<p>Re-parsing all the code the user has typed in every time he hits a key
|
188
|
+
is obviously not feasible. So how does one combine on-the-fly
|
189
|
+
highlighting with a serious parser? One option would be to split the
|
190
|
+
code into top-level statements (functions, variable definitions, etc.)
|
191
|
+
and parse these separately. This is horribly clunky though, especially
|
192
|
+
considering the fact that modern JavaScripters often put all the code
|
193
|
+
in a file in a single big object or function to prevent namespace
|
194
|
+
pollution.</p>
|
195
|
+
|
196
|
+
<p>I have always liked continuation-passing style and generators. So the
|
197
|
+
idea I came up with is this: An interruptable, resumable parser. This
|
198
|
+
is a parser that does not run through a whole document at once, but
|
199
|
+
parses on-demand, a little bit at a time. At any moment you can create
|
200
|
+
a copy of its current state, which can be resumed later. You start
|
201
|
+
parsing at the top of the code, and keep going as long as you like,
|
202
|
+
but throughout the document, for example at every end of line, you
|
203
|
+
store a copy of the current parser state. Later on, when line 106
|
204
|
+
changes, you grab the interrupted parser that was stored at the end of
|
205
|
+
line 105, and use it to re-parse line 106. It still knows exactly what
|
206
|
+
the context was at that point, which local variables were defined,
|
207
|
+
which unfinished statements were encountered, and so on.</p>
|
208
|
+
|
209
|
+
<p>But that, unfortunately, turned out to be not quite as easy as it
|
210
|
+
sounds.</p>
|
211
|
+
|
212
|
+
<h2 id="dom">The DOM nodes underfoot</h2>
|
213
|
+
|
214
|
+
<p>Of course, when working inside an editable frame we don't just
|
215
|
+
have to deal with text. The code will be represented by some kind
|
216
|
+
of DOM tree. My first idea was to set the <code>white-space:
|
217
|
+
pre</code> style for the frame and try to work with mostly text,
|
218
|
+
with the occasional coloured <code>span</code> element. It turned
|
219
|
+
out that support for <code>white-space: pre</code> in browsers,
|
220
|
+
especially in editable frames, is so hopelessly glitchy that this
|
221
|
+
was unworkable.</p>
|
222
|
+
|
223
|
+
<p>Next I tried a series of <code>div</code> elements, one per
|
224
|
+
line, with <code>span</code> elements inside them. This seemed to
|
225
|
+
nicely reflect the structure of the code in a shallowly
|
226
|
+
hierarchical way. I soon realized, however, that my code would be
|
227
|
+
much more straightfoward when using no hierarchy whatsoever
|
228
|
+
― a series of <code>span</code>s, with <code>br</code> tags
|
229
|
+
at the end of every line. This way, the DOM nodes form a flat
|
230
|
+
sequence that corresponds to the sequence of the text ―
|
231
|
+
just extract text from <code>span</code> nodes and substitute
|
232
|
+
newlines for <code>br</code> nodes.</p>
|
233
|
+
|
234
|
+
<p>It would be a shame if the editor would fall apart as soon as
|
235
|
+
someone pastes some complicated HTML into it. I wanted it to be
|
236
|
+
able to deal with whatever mess it finds. This means using some
|
237
|
+
kind of HTML-normalizer that takes arbitrary HTML and flattens it
|
238
|
+
into a series of <code>br</code>s and <code>span</code> elements
|
239
|
+
that contain a single text node. Just like the parsing process, it
|
240
|
+
would be best if this did not have to done to the entire buffer
|
241
|
+
every time something changes.</p>
|
242
|
+
|
243
|
+
<p>It took some banging my head against my keyboard, but I found a very
|
244
|
+
nice way to model this. It makes heavy use of generators, for which I
|
245
|
+
used <a href="http://www.mochikit.com">MochiKit</a>'s iterator
|
246
|
+
framework. Bob Ippolito explains the concepts in this library very
|
247
|
+
well in his <a
|
248
|
+
href="http://bob.pythonmac.org/archives/2005/07/06/iteration-in-javascript/">blog
|
249
|
+
post</a> about it. (Also notice some of the dismissive comments at the
|
250
|
+
bottom of that post. They say "I don't think I really want to learn
|
251
|
+
this, so I'll make up some silly reason to condemn it.")</p>
|
252
|
+
|
253
|
+
<p>The highlighting process consists of the following elements:
|
254
|
+
normalizing the DOM tree, extracting the text from the DOM tree,
|
255
|
+
tokenizing this text, parsing the tokens, and finally adjusting the
|
256
|
+
DOM nodes to reflect the structure of the code.</p>
|
257
|
+
|
258
|
+
<p>The first two, I put into a single generator. It scans the DOM
|
259
|
+
tree, fixing anything that is not a simple top-level
|
260
|
+
<code>span</code> or <code>br</code>, and it produces the text
|
261
|
+
content of the nodes (or a newline in case of a <code>br</code>)
|
262
|
+
as its output ― each time it is called, it yields a string.
|
263
|
+
Continuation passing style was a good way to model this process in
|
264
|
+
an iterator, which has to be processed one step at a time. Look at
|
265
|
+
this simplified version:</p>
|
266
|
+
|
267
|
+
<pre class="code" style="width: 110%"><span class="js-keyword">function</span> <span class="js-variable">traverseDOM</span>(<span class="js-variabledef">start</span>){
|
268
|
+
<span class="js-keyword">var</span> <span class="js-variabledef">cc</span> = <span class="js-keyword">function</span>(){<span class="js-keyword">return</span> <span class="js-variable">scanNode</span>(<span class="js-localvariable">start</span>, <span class="js-variable">stop</span>);};
|
269
|
+
<span class="js-keyword">function</span> <span class="js-variabledef">stop</span>(){
|
270
|
+
<span class="js-localvariable">cc</span> = <span class="js-localvariable">stop</span>;
|
271
|
+
<span class="js-keyword">throw</span> <span class="js-variable">StopIteration</span>;
|
272
|
+
}
|
273
|
+
<span class="js-keyword">function</span> <span class="js-variabledef">yield</span>(<span class="js-variabledef">value</span>, <span class="js-variabledef">c</span>){
|
274
|
+
<span class="js-localvariable">cc</span> = <span class="js-localvariable">c</span>;
|
275
|
+
<span class="js-keyword">return</span> <span class="js-localvariable">value</span>;
|
276
|
+
}
|
277
|
+
|
278
|
+
<span class="js-keyword">function</span> <span class="js-variabledef">scanNode</span>(<span class="js-variabledef">node</span>, <span class="js-variabledef">c</span>){
|
279
|
+
<span class="js-keyword">if</span> (<span class="js-localvariable">node</span>.<span class="js-property">nextSibling</span>)
|
280
|
+
<span class="js-keyword">var</span> <span class="js-variabledef">nextc</span> = <span class="js-keyword">function</span>(){<span class="js-keyword">return</span> <span class="js-localvariable">scanNode</span>(<span class="js-localvariable">node</span>.<span class="js-property">nextSibling</span>, <span class="js-localvariable">c</span>);};
|
281
|
+
<span class="js-keyword">else</span>
|
282
|
+
<span class="js-keyword">var</span> <span class="js-variabledef">nextc</span> = <span class="js-localvariable">c</span>;
|
283
|
+
|
284
|
+
<span class="js-keyword">if</span> (<span class="js-comment">/* node is proper span element */</span>)
|
285
|
+
<span class="js-keyword">return</span> <span class="js-localvariable">yield</span>(<span class="js-localvariable">node</span>.<span class="js-property">firstChild</span>.<span class="js-property">nodeValue</span>, <span class="js-localvariable">nextc</span>);
|
286
|
+
<span class="js-keyword">else</span> <span class="js-keyword">if</span> (<span class="js-comment">/* node is proper br element */</span>)
|
287
|
+
<span class="js-keyword">return</span> <span class="js-localvariable">yield</span>(<span class="js-string">"\n"</span>, <span class="js-localvariable">nextc</span>);
|
288
|
+
<span class="js-keyword">else</span>
|
289
|
+
<span class="js-comment">/* flatten node, yield its textual content */</span>;
|
290
|
+
}
|
291
|
+
|
292
|
+
<span class="js-keyword">return</span> {<span class="js-property">next</span>: <span class="js-keyword">function</span>(){<span class="js-keyword">return</span> <span class="js-localvariable">cc</span>();}};
|
293
|
+
}</pre>
|
294
|
+
|
295
|
+
<p>The variable <code>c</code> stands for 'continuation', and <code>cc</code> for 'current
|
296
|
+
continuation' ― that last variable is used to store the function to
|
297
|
+
continue with, when yielding a value to the outside world. Every time
|
298
|
+
control leaves this function, it has to make sure that <code>cc</code> is set to
|
299
|
+
a suitable value, which is what <code>yield</code> and <code>stop</code> take care of.</p>
|
300
|
+
|
301
|
+
<p>The object that is returned contains a <code>next</code> method, which is
|
302
|
+
MochiKit's idea of an iterator, and the initial continuation just
|
303
|
+
throws a <code>StopIteration</code>, which is how MochiKit signals that an
|
304
|
+
iterator has reached its end.</p>
|
305
|
+
|
306
|
+
<p>The first lines of <code>scanNode</code> extend the continuation with the task of
|
307
|
+
scanning the next node, if there is a next node. The rest of the
|
308
|
+
function decides what kind of value to <code>yield</code>. Note that this is a
|
309
|
+
rather trivial example of this technique, since the process of going
|
310
|
+
through these nodes is basically linear (it was much, much more
|
311
|
+
complex in earlier versions), but still the trick with the
|
312
|
+
continuations makes the code shorter and, for those in the know,
|
313
|
+
clearer than the equivalent 'storing the iterator state in variables'
|
314
|
+
approach.</p>
|
315
|
+
|
316
|
+
<p>The next iterator that the input passes through is the
|
317
|
+
tokenizer. Well, actually, there is another iterator in between
|
318
|
+
that isolates the tokenizer from the fact that the DOM traversal
|
319
|
+
yields a bunch of separate strings, and presents them as a single
|
320
|
+
character stream (with a convenient <code>peek</code> operation),
|
321
|
+
but this is not a very interesting one. What the tokenizer returns
|
322
|
+
is a stream of token objects, each of which has a
|
323
|
+
<code>value</code>, its textual content, a <code>type</code>, like
|
324
|
+
<code>"variable"</code>, <code>"operator"</code>, or just itself,
|
325
|
+
<code>"{"</code> for example, in the case of significant
|
326
|
+
punctuation or special keywords. They also have a
|
327
|
+
<code>style</code>, which is used later by the highlighter to give
|
328
|
+
their <code>span</code> elements a class name (the parser will
|
329
|
+
still adjust this in some cases).</p>
|
330
|
+
|
331
|
+
<p>At first I assumed the parser would have to talk back to the
|
332
|
+
tokenizer about the current context, in order to be able to
|
333
|
+
distinguish those accursed regular expressions from divisions, but
|
334
|
+
it seems that regular expressions are only allowed if the previous
|
335
|
+
(non-whitespace, non-comment) token was either an operator, a
|
336
|
+
keyword like <code>new</code> or <code>throw</code>, or a specific
|
337
|
+
kind of punctuation (<code>"[{}(,;:"</code>) that indicates a new
|
338
|
+
expression can be started here. This made things considerably
|
339
|
+
easier, since the 'regexp or no regexp' question could stay
|
340
|
+
entirely within the tokenizer.</p>
|
341
|
+
|
342
|
+
<p>The next step, then, is the parser. It does not do a very
|
343
|
+
thorough job because, firstly, it has to be fast, and secondly, it
|
344
|
+
should not go to pieces when fed an incorrect program. So only
|
345
|
+
superficial constructs are recognized, keywords that resemble each
|
346
|
+
other in syntax, such as <code>while</code> and <code>if</code>,
|
347
|
+
are treated in precisely the same way, as are <code>try</code> and
|
348
|
+
<code>else</code> ― the parser doesn't mind if an
|
349
|
+
<code>else</code> appears without an <code>if</code>. Stuff that
|
350
|
+
binds variables, <code>var</code>, <code>function</code>, and
|
351
|
+
<code>catch</code> to be precise, is treated with more care,
|
352
|
+
because the parser wants to know about local variables.</p>
|
353
|
+
|
354
|
+
<p>Inside the parser, three kinds of context are stored. Firstly, a set
|
355
|
+
of known local variables, which is used to adjust the style of
|
356
|
+
variable tokens. Every time the parser enters a function, a new set of
|
357
|
+
variables is created. If there was already such a set (entering an
|
358
|
+
inner function), a pointer to the old one is stored in the new one. At
|
359
|
+
the end of the function, the current variable set is 'popped' off and
|
360
|
+
the previous one is restored.</p>
|
361
|
+
|
362
|
+
<p>The second kind of context is the lexical context, this keeps track of
|
363
|
+
whether we are inside a statement, block, or list. Like the variable
|
364
|
+
context, it also forms a stack of contexts, with each one containing a
|
365
|
+
pointer to the previous ones so that they can be popped off again when
|
366
|
+
they are finished. This information is used for indentation. Every
|
367
|
+
time the parser encounters a newline token, it attaches the current
|
368
|
+
lexical context and a 'copy' of itself (more about that later) to this
|
369
|
+
token.</p>
|
370
|
+
|
371
|
+
<p>The third context is a continuation context. This parser does not use
|
372
|
+
straight continuation style, instead it uses a stack of actions that
|
373
|
+
have to be performed. These actions are simple functions, a kind of
|
374
|
+
minilanguage, they act on tokens, and decide what kind of new actions
|
375
|
+
should be pushed onto the stack. Here are some examples:</p>
|
376
|
+
|
377
|
+
<pre class="code" style="width: 110%"><span class="js-keyword">function</span> <span class="js-variable">expression</span>(<span class="js-variabledef">type</span>){
|
378
|
+
<span class="js-keyword">if</span> (<span class="js-localvariable">type</span> in <span class="js-variable">atomicTypes</span>)
|
379
|
+
<span class="js-variable">cont</span>(<span class="js-variable">maybeoperator</span>);
|
380
|
+
<span class="js-keyword">else</span> <span class="js-keyword">if</span> (<span class="js-localvariable">type</span> == <span class="js-string">"function"</span>)
|
381
|
+
<span class="js-variable">cont</span>(<span class="js-variable">functiondef</span>);
|
382
|
+
<span class="js-keyword">else</span> <span class="js-keyword">if</span> (<span class="js-localvariable">type</span> == <span class="js-string">"("</span>)
|
383
|
+
<span class="js-variable">cont</span>(<span class="js-variable">pushlex</span>(<span class="js-string">"list"</span>), <span class="js-variable">expression</span>, <span class="js-variable">expect</span>(<span class="js-string">")"</span>), <span class="js-variable">poplex</span>);
|
384
|
+
<span class="js-keyword">else</span> <span class="js-keyword">if</span> (<span class="js-localvariable">type</span> == <span class="js-string">"operator"</span>)
|
385
|
+
<span class="js-variable">cont</span>(<span class="js-variable">expression</span>);
|
386
|
+
<span class="js-keyword">else</span> <span class="js-keyword">if</span> (<span class="js-localvariable">type</span> == <span class="js-string">"["</span>)
|
387
|
+
<span class="js-variable">cont</span>(<span class="js-variable">pushlex</span>(<span class="js-string">"list"</span>), <span class="js-variable">commasep</span>(<span class="js-variable">expression</span>), <span class="js-variable">expect</span>(<span class="js-string">"]"</span>), <span class="js-variable">poplex</span>);
|
388
|
+
<span class="js-keyword">else</span> <span class="js-keyword">if</span> (<span class="js-localvariable">type</span> == <span class="js-string">"{"</span>)
|
389
|
+
<span class="js-variable">cont</span>(<span class="js-variable">pushlex</span>(<span class="js-string">"list"</span>), <span class="js-variable">commasep</span>(<span class="js-variable">objprop</span>), <span class="js-variable">expect</span>(<span class="js-string">"}"</span>), <span class="js-variable">poplex</span>);
|
390
|
+
<span class="js-keyword">else</span> <span class="js-keyword">if</span> (<span class="js-localvariable">type</span> == <span class="js-string">"keyword c"</span>)
|
391
|
+
<span class="js-variable">cont</span>(<span class="js-variable">expression</span>);
|
392
|
+
}
|
393
|
+
|
394
|
+
<span class="js-keyword">function</span> <span class="js-variable">block</span>(<span class="js-variabledef">type</span>){
|
395
|
+
<span class="js-keyword">if</span> (<span class="js-localvariable">type</span> == <span class="js-string">"}"</span>) <span class="js-variable">cont</span>();
|
396
|
+
<span class="js-keyword">else</span> <span class="js-variable">pass</span>(<span class="js-variable">statement</span>, <span class="js-variable">block</span>);
|
397
|
+
}</pre>
|
398
|
+
|
399
|
+
<p>The function <code>cont</code> (for continue), will push the actions it is given
|
400
|
+
onto the stack (in reverse order, so that the first one will be popped
|
401
|
+
first). Actions such as <code>pushlex</code> and <code>poplex</code> merely adjust the
|
402
|
+
lexical environment, while others, such as <code>expression</code> itself, do
|
403
|
+
actual parsing. <code>pass</code>, as seen in <code>block</code>, is similar to <code>cont</code>, but
|
404
|
+
it does not 'consume' the current token, so the next action will again
|
405
|
+
see this same token. In <code>block</code>, this happens when the function
|
406
|
+
determines that we are not at the end of the block yet, so it pushes
|
407
|
+
the <code>statement</code> function which will interpret the current token as the
|
408
|
+
start of a statement.</p>
|
409
|
+
|
410
|
+
<p>These actions are called by a 'driver' function, which filters out the
|
411
|
+
whitespace and comments, so that the parser actions do not have to
|
412
|
+
think about those, and keeps track of some things like the indentation
|
413
|
+
of the current line and the column at which the current token ends,
|
414
|
+
which are stored in the lexical context and used for indentation.
|
415
|
+
After calling an action, if the action called <code>cont</code>, this driver
|
416
|
+
function will return the current token, if <code>pass</code> (or nothing) was
|
417
|
+
called, it will immediately continue with the next action.</p>
|
418
|
+
|
419
|
+
<p>This goes to show that it is viable to write a quite elaborate
|
420
|
+
minilanguage in a macro-less language like JavaScript. I don't think
|
421
|
+
it would be possible to do something like this without closures (or
|
422
|
+
similarly powerful abstraction) though, I've certainly never seen
|
423
|
+
anything like it in Java code.</p>
|
424
|
+
|
425
|
+
<p>The way a 'copy' of the parser was produced shows a nice usage
|
426
|
+
of closures. Like with the DOM transformer shown above, most of
|
427
|
+
the local state of the parser is held in a closure produced by
|
428
|
+
calling <code>parse(stream)</code>. The function
|
429
|
+
<code>copy</code>, which is local to the parser function, produces
|
430
|
+
a new closure, with copies of all the relevant variables:</p>
|
431
|
+
|
432
|
+
<pre class="code"><span class="js-keyword">function</span> <span class="js-variable">copy</span>(){
|
433
|
+
<span class="js-keyword">var</span> <span class="js-variabledef">_context</span> = <span class="js-variable">context</span>, <span class="js-variabledef">_lexical</span> = <span class="js-variable">lexical</span>,
|
434
|
+
<span class="js-variabledef">_actions</span> = <span class="js-variable">copyArray</span>(<span class="js-variable">actions</span>);
|
435
|
+
|
436
|
+
<span class="js-keyword">return</span> <span class="js-keyword">function</span>(<span class="js-variabledef">_tokens</span>){
|
437
|
+
<span class="js-variable">context</span> = <span class="js-localvariable">_context</span>;
|
438
|
+
<span class="js-variable">lexical</span> = <span class="js-localvariable">_lexical</span>;
|
439
|
+
<span class="js-variable">actions</span> = <span class="js-variable">copyArray</span>(<span class="js-localvariable">_actions</span>);
|
440
|
+
<span class="js-variable">tokens</span> = <span class="js-localvariable">_tokens</span>;
|
441
|
+
<span class="js-keyword">return</span> <span class="js-variable">parser</span>;
|
442
|
+
};
|
443
|
+
}</pre>
|
444
|
+
|
445
|
+
<p>Where <code>parser</code> is the object that contains the <code>next</code> (driver)
|
446
|
+
function, and a reference to this <code>copy</code> function. When the function
|
447
|
+
that <code>copy</code> produces is called with a token stream as argument, it
|
448
|
+
updates the local variables in the parser closure, and returns the
|
449
|
+
corresponding iterator object.</p>
|
450
|
+
|
451
|
+
<p>Moving on, we get to the last stop in this chain of generators, the
|
452
|
+
actual highlighter. You can view this one as taking two streams as
|
453
|
+
input, on the one hand there is the stream of tokens from the parser,
|
454
|
+
and on the other hand there is the DOM tree as left by the DOM
|
455
|
+
transformer. If everything went correctly, these two should be
|
456
|
+
synchronized. The highlighter can look at the current token, see if
|
457
|
+
the <code>span</code> in the DOM tree corresponds to it (has the same text
|
458
|
+
content, and the correct class), and if not it can chop up the DOM
|
459
|
+
nodes to conform to the tokens.</p>
|
460
|
+
|
461
|
+
<p>Every time the parser yields a newline token, the highligher
|
462
|
+
encounters a <code>br</code> element in the DOM stream. It takes the copy of the
|
463
|
+
parser and the lexical context from this token and attaches them to
|
464
|
+
the DOM node. This way, a new highlighting process can be started from
|
465
|
+
that node by re-starting the copy of the parser with a new token
|
466
|
+
stream, which reads tokens from the DOM nodes starting at that <code>br</code>
|
467
|
+
element, and the indentation code can use the lexical context
|
468
|
+
information to determine the correct indentation at that point.</p>
|
469
|
+
|
470
|
+
<h2 id="selection">Selection woes</h2>
|
471
|
+
|
472
|
+
<p>All the above can be done using the DOM interface that all major
|
473
|
+
browsers have in common, and which is relatively free of weird bugs
|
474
|
+
and abberrations. However, when the user is typing in new code, this
|
475
|
+
must also be highlighted. For this to happen, the program must know
|
476
|
+
where the cursor currently is, and because it mucks up the DOM tree,
|
477
|
+
it has to restore this cursor position after doing the highlighting.</p>
|
478
|
+
|
479
|
+
<p>Re-highlighting always happens per line, because the copy of the
|
480
|
+
parser is stored only at the end of lines. Doing this every time the
|
481
|
+
user presses a key is terribly slow and obnoxious, so what I did was
|
482
|
+
keep a list of 'dirty' nodes, and as soon as the user didn't type
|
483
|
+
anyting for 300 milliseconds the program starts re-highlighting these
|
484
|
+
nodes. If it finds more than ten lines must be re-parsed, it does only
|
485
|
+
ten and waits another 300 milliseconds before it continues, this way
|
486
|
+
the browser never freezes up entirely.</p>
|
487
|
+
|
488
|
+
<p>As mentioned earlier, Internet Explorer's selection model is not the
|
489
|
+
most practical one. My attempts to build a wrapper that makes it look
|
490
|
+
like the W3C model all stranded. In the end I came to the conclusion
|
491
|
+
that I only needed two operations:</p>
|
492
|
+
|
493
|
+
<ul>
|
494
|
+
<li>Creating a selection 'snapshot' that can be restored after
|
495
|
+
highlighting, in such a way that it still works if some of the nodes
|
496
|
+
that were selected are replaced by other nodes with the same
|
497
|
+
size but a different structure.</li>
|
498
|
+
<li>Finding the top-level node around or before the cursor, to mark it
|
499
|
+
dirty or to insert indentation whitespace at the start of that line.</li>
|
500
|
+
</ul>
|
501
|
+
|
502
|
+
<p>It turns out that the pixel-based selection model that Internet
|
503
|
+
Explorer uses, which always seemed completely ludricrous to me, is
|
504
|
+
perfect for the first case. Since the DOM transformation (generally)
|
505
|
+
does not change the position of things, storing the pixel offsets of
|
506
|
+
the selection makes it possible to restore that same selection, never
|
507
|
+
mind what happened to the underlying DOM structure.</p>
|
508
|
+
|
509
|
+
<p>[Later addition: Note that this, due to the very random design
|
510
|
+
of the <a
|
511
|
+
href="http://msdn2.microsoft.com/en-us/library/ms535872(VS.85).aspx#">TextRange
|
512
|
+
interface</a>, only really works when the whole selection falls
|
513
|
+
within the visible part of the document.]</p>
|
514
|
+
|
515
|
+
<p>Doing the same with the W3C selection model is a lot harder. What I
|
516
|
+
ended up with was this:</p>
|
517
|
+
|
518
|
+
<ul>
|
519
|
+
<li>Create an object pointing to the nodes at the start and end of the
|
520
|
+
selection, and the offset within those nodes. This is basically the
|
521
|
+
information that the <code>Range</code> object gives you.</li>
|
522
|
+
<li>Make references from these nodes back to that object.</li>
|
523
|
+
<li>When replacing (part of) a node with another one, check for such a
|
524
|
+
reference, and when it is present, check whether this new node will
|
525
|
+
get the selection. If it does, move the reference from the old to the
|
526
|
+
new node, if it does not, adjust the offset in the selection object to
|
527
|
+
reflect the fact that part of the old node has been replaced.</li>
|
528
|
+
</ul>
|
529
|
+
|
530
|
+
<p>Now in the second case (getting the top-level node at the
|
531
|
+
cursor) the Internet Explorer cheat does not work. In the W3C
|
532
|
+
model this is rather easy, you have to do some creative parent-
|
533
|
+
and sibling-pointer following to arrive at the correct top-level
|
534
|
+
node, but nothing weird. In Internet Explorer, all we have to go
|
535
|
+
on is the <code>parentElement</code> method on a
|
536
|
+
<code>TextRange</code>, which gives the first element that
|
537
|
+
completely envelops the selection. If the cursor is inside a text
|
538
|
+
node, this is good, that text node tells us where we are. If the
|
539
|
+
cursor is between nodes, for example between two <code>br</code>
|
540
|
+
nodes, you get to top-level node itself back, which is remarkably
|
541
|
+
useless. In cases like this I stoop to a rather ugly hack (which
|
542
|
+
fortunately turned out to be acceptably fast) ― I create a
|
543
|
+
temporary empty <code>span</code> with an ID inside the selection,
|
544
|
+
get a reference to this <code>span</code> by ID, take its
|
545
|
+
<code>previousSibling</code>, and remove it again.</p>
|
546
|
+
|
547
|
+
<p>Unfortunately, Opera's selection implementation is buggy, and it
|
548
|
+
will give wildly incorrect <code>Range</code> objects when the cursor
|
549
|
+
is between two nodes. This is a bit of a showstopper, and until I find
|
550
|
+
a workaround for that or it gets fixed, the highlighter doesn't work
|
551
|
+
properly in Opera.</p>
|
552
|
+
|
553
|
+
<p>Also, when one presses enter in a <code>designMode</code>
|
554
|
+
document in Firefox or Opera, a <code>br</code> tag is inserted.
|
555
|
+
In Internet Explorer, pressing enter causes some maniacal gnome to
|
556
|
+
come out and start wrapping all the content before and after the
|
557
|
+
cursor in <code>p</code> tags. I suppose there is something to be
|
558
|
+
said for that, in principle, though if you saw the tag soup of
|
559
|
+
<code>font</code>s and nested paragraphs Internet Explorer
|
560
|
+
generates you would soon enough forget all about principle.
|
561
|
+
Anyway, getting unwanted <code>p</code> tags slowed the
|
562
|
+
highlighter down terribly ― it had to overhaul the whole
|
563
|
+
DOM tree to remove them again, every time the user pressed enter.
|
564
|
+
Fortunately I could fix this by capturing the enter presses and
|
565
|
+
manually inserting a <code>br</code> tag at the cursor.</p>
|
566
|
+
|
567
|
+
<p>On the subject of Internet Explorer's tag soup, here is an interesting
|
568
|
+
anecdote: One time, when testing the effect that modifying the content
|
569
|
+
of a selection had, I inspected the DOM tree and found a <code>"/B"</code>
|
570
|
+
element. This was not a closing tag, there are no closing tags in the
|
571
|
+
DOM tree, just elements. The <code>nodeName</code> of this element was actually
|
572
|
+
<code>"/B"</code>. That was when I gave up any notions of ever understanding the
|
573
|
+
profound mystery that is Internet Explorer.</p>
|
574
|
+
|
575
|
+
<h2 id="closing">Closing thoughts</h2>
|
576
|
+
|
577
|
+
<p>Well, I despaired at times, but I did end up with a working JavaScript
|
578
|
+
editor. I did not keep track of the amount of time I wasted on this,
|
579
|
+
but I would estimate it to be around fifty hours. Finding workarounds
|
580
|
+
for browser bugs can be a terribly nonlinear process. I just spent
|
581
|
+
half a day working on a weird glitch in Firefox that caused the cursor
|
582
|
+
in the editable frame to be displayed 3/4 line too high when it was at
|
583
|
+
the very end of the document. Then I found out that setting the
|
584
|
+
style.display of the iframe to "block" fixed this (why not?). I'm
|
585
|
+
amazed how often issues that seem hopeless do turn out to be
|
586
|
+
avoidable, even if it takes hours of screwing around and some truly
|
587
|
+
non-obvious ideas.</p>
|
588
|
+
|
589
|
+
<p>For a lot of things, JavaScript + DOM elements are a surprisingly
|
590
|
+
powerful platform. Simple interactive documents and forms can be
|
591
|
+
written in browsers with very little effort, generally less than with
|
592
|
+
most 'traditional' platforms (Java, Win32, things like WxWidgets).
|
593
|
+
Libraries like Dojo (and a similar monster I once wrote myself) even
|
594
|
+
make complex, composite widgets workable. However, when applications
|
595
|
+
go sufficiently beyond the things that browsers were designed for, the
|
596
|
+
available APIs do not give enough control, are nonstandard and buggy,
|
597
|
+
and are often poorly designed. Because of this, writing such
|
598
|
+
applications, when it is even possible, is <em>painful</em> process.</p>
|
599
|
+
|
600
|
+
<p>And who likes pain? Sure, when finding that crazy workaround,
|
601
|
+
subdueing the damn browser, and getting everything to work, there
|
602
|
+
is a certain macho thrill. But one can't help wondering how much
|
603
|
+
easier things like preventing the user from pasting pictures in
|
604
|
+
his source code would be on another platform. Maybe something like
|
605
|
+
Silverlight or whatever other new browser plugin gizmos people are
|
606
|
+
pushing these days will become the way to solve things like this
|
607
|
+
in the future. But, personally, I would prefer for those browser
|
608
|
+
companies to put some real effort into things like cleaning up and
|
609
|
+
standardising shady things like <code>designMode</code>, fixing
|
610
|
+
their bugs, and getting serious about ECMAScript 4.</p>
|
611
|
+
|
612
|
+
<p>Which is probably not realistically going to happen anytime soon.</p>
|
613
|
+
|
614
|
+
<hr/>
|
615
|
+
|
616
|
+
<p>Some interesting projects similar to this:</p>
|
617
|
+
|
618
|
+
<ul>
|
619
|
+
<li><a href="http://www.ymacs.org">Ymacs</a></li>
|
620
|
+
<li><a href="http://gpl.internetconnection.net/vi/">vi clone</a></li>
|
621
|
+
<li><a href="http://robrohan.com/projects/9ne/">Emacs clone</a></li>
|
622
|
+
<li><a href="http://codepress.sourceforge.net/">CodePress</a></li>
|
623
|
+
<li><a href="http://www.codeide.com">CodeIDE</a></li>
|
624
|
+
<li><a href="http://www.cdolivet.net/editarea">EditArea</a></li>
|
625
|
+
</ul>
|
626
|
+
|
627
|
+
<hr/>
|
628
|
+
|
629
|
+
<p>If you have any remarks, criticism, or hints related to the
|
630
|
+
above, drop me an e-mail at <a
|
631
|
+
href="mailto:marijnh@gmail.com">marijnh@gmail.com</a>. If you say
|
632
|
+
something generally interesting, I'll include your reaction here
|
633
|
+
at the bottom of this page.</p>
|
634
|
+
|
635
|
+
</div><div class="rightsmall blk">
|
636
|
+
|
637
|
+
<p style="font-size: 80%">
|
638
|
+
<b>Topics</b>: JavaScript, advanced browser weirdness, cool programming techniques<br/>
|
639
|
+
<b>Audience</b>: Programmers, especially JavaScript programmers<br/>
|
640
|
+
<b>Author</b>: Marijn Haverbeke<br/>
|
641
|
+
<b>Date</b>: May 24th 2007
|
642
|
+
</p>
|
643
|
+
|
644
|
+
<h2>Contents</h2>
|
645
|
+
|
646
|
+
<ul>
|
647
|
+
<li><a href="#indent">Only Indentation</a></li>
|
648
|
+
<li><a href="#designmode"><code>designMode</code></a></li>
|
649
|
+
<li><a href="#parser">A Parser</a></li>
|
650
|
+
<li><a href="#dom">DOM Nodes</a></li>
|
651
|
+
<li><a href="#selection">Selection Woes</a></li>
|
652
|
+
<li><a href="#closing">Closing Thoughts</a></li>
|
653
|
+
</ul>
|
654
|
+
|
655
|
+
<h2>Site</h2>
|
656
|
+
|
657
|
+
<ul>
|
658
|
+
<li><a href="index.html">Front Page</a></li>
|
659
|
+
<li><a href="manual.html">User Manual</a></li>
|
660
|
+
<li><a href="faq.html">FAQ</a></li>
|
661
|
+
<li><a href="http://groups.google.com/group/codemirror">Google Group</a></li>
|
662
|
+
<li><a href="compress.html">Compression Helper</a></li>
|
663
|
+
</ul>
|
664
|
+
|
665
|
+
</div></div>
|
666
|
+
|
667
|
+
<div style="height: 2em"> </div>
|
668
|
+
|
669
|
+
<script type="text/javascript" src="css/font.js"></script>
|
670
|
+
|
671
|
+
</body>
|
672
|
+
</html>
|