From ecc71b3e1dfcb66fa95205c2491a604b9a0543b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Dori=C4=87?= Date: Sat, 19 Aug 2017 15:12:19 +0200 Subject: [PATCH] Making Websites With October CMS - Part 45 - Ajax Image Upload --- config/cms.php | 2 +- modules/backend/ServiceProvider.php | 20 +- modules/backend/assets/css/october.css | 185 +- .../assets/images/treeview-submenu-tabs.png | Bin 1341 -> 2714 bytes modules/backend/assets/js/backend.js | 28 + modules/backend/assets/js/october-min.js | 156 +- modules/backend/assets/js/october.js | 1 - modules/backend/assets/js/october.layout.js | 6 +- modules/backend/assets/js/october.navbar.js | 6 +- .../backend/assets/js/october.scrollbar.js | 11 +- .../backend/assets/js/october.sidenav-tree.js | 78 +- modules/backend/assets/js/october.sidenav.js | 10 +- .../backend/assets/js/october.verticalmenu.js | 3 +- .../assets/js/preferences/preferences.js | 29 +- .../assets/less/controls/filelist.less | 35 +- .../assets/less/controls/scrollbar.less | 37 +- .../assets/less/controls/sidenav-tree.less | 75 +- .../assets/less/controls/simplelist.less | 94 +- .../assets/less/controls/treeview.less | 50 +- .../backend/assets/less/core/variables.less | 16 +- .../assets/less/layout/fancylayout.less | 56 +- .../assets/less/layout/flexlayout.less | 19 +- .../backend/assets/less/layout/layout.less | 17 +- .../backend/assets/less/layout/mainmenu.less | 58 +- .../assets/less/layout/outerlayout.less | 34 +- .../backend/assets/less/layout/sidenav.less | 74 +- .../backend/assets/less/layout/sidepanel.less | 2 +- modules/backend/assets/less/october.less | 1 - modules/backend/behaviors/FormController.php | 217 +- .../behaviors/ImportExportController.php | 27 +- modules/backend/behaviors/ListController.php | 75 +- .../backend/behaviors/RelationController.php | 54 +- .../backend/behaviors/ReorderController.php | 17 +- .../behaviors/UserPreferencesModel.php | 14 +- .../TranscodeFilter.php | 2 +- .../partials/_manage_form.htm | 2 +- .../relationcontroller/partials/_toolbar.htm | 2 +- .../reordercontroller/partials/_records.htm | 8 +- modules/backend/classes/AuthManager.php | 58 +- modules/backend/classes/BackendController.php | 10 +- modules/backend/classes/Controller.php | 77 +- .../backend/classes/ControllerBehavior.php | 1 + modules/backend/classes/FormField.php | 25 +- modules/backend/classes/FormTabs.php | 26 + modules/backend/classes/FormWidgetBase.php | 14 + modules/backend/classes/ListColumn.php | 4 +- modules/backend/classes/NavigationManager.php | 48 +- modules/backend/classes/WidgetBase.php | 75 +- modules/backend/classes/WidgetManager.php | 64 +- modules/backend/composer.json | 4 +- modules/backend/controllers/AccessLogs.php | 19 +- modules/backend/controllers/Auth.php | 12 +- modules/backend/controllers/Files.php | 2 +- modules/backend/controllers/Index.php | 3 +- modules/backend/controllers/Preferences.php | 8 +- modules/backend/controllers/UserGroups.php | 46 +- modules/backend/controllers/UserRoles.php | 87 + modules/backend/controllers/Users.php | 24 +- modules/backend/controllers/auth/reset.htm | 2 +- modules/backend/controllers/auth/restore.htm | 2 +- modules/backend/controllers/auth/signin.htm | 19 +- .../preferences/_field_editor_preview.htm | 2 +- .../controllers/usergroups/config_list.yaml | 3 +- .../backend/controllers/usergroups/create.htm | 2 +- .../backend/controllers/usergroups/update.htm | 2 +- .../controllers/userroles/_list_toolbar.htm | 8 + .../controllers/userroles/config_form.yaml | 16 + .../controllers/userroles/config_list.yaml | 16 + .../backend/controllers/userroles/create.htm | 44 + .../backend/controllers/userroles/index.htm | 8 + .../backend/controllers/userroles/update.htm | 53 + .../controllers/users/_list_toolbar.htm | 5 + .../2013_10_01_000001_Db_Backend_Users.php | 1 + ...13_10_01_000002_Db_Backend_User_Groups.php | 1 - ...1_000008_Db_Backend_Add_Superuser_Flag.php | 2 +- ...017_10_01_000010_Db_Backend_User_Roles.php | 162 + .../backend/database/seeds/DatabaseSeeder.php | 1 - .../backend/database/seeds/SeedSetupAdmin.php | 20 +- modules/backend/facades/Backend.php | 2 +- modules/backend/facades/BackendAuth.php | 4 +- modules/backend/facades/BackendMenu.php | 4 +- modules/backend/formwidgets/CodeEditor.php | 14 +- modules/backend/formwidgets/ColorPicker.php | 30 +- modules/backend/formwidgets/DataTable.php | 10 +- modules/backend/formwidgets/DatePicker.php | 26 +- modules/backend/formwidgets/FileUpload.php | 19 +- .../backend/formwidgets/MarkdownEditor.php | 23 +- .../backend/formwidgets/PermissionEditor.php | 95 +- modules/backend/formwidgets/RecordFinder.php | 33 +- modules/backend/formwidgets/Relation.php | 34 +- modules/backend/formwidgets/Repeater.php | 239 +- modules/backend/formwidgets/RichEditor.php | 26 +- modules/backend/formwidgets/TagList.php | 12 +- .../codeeditor/assets/css/codeeditor.css | 2 +- .../codeeditor/assets/js/build-min.js | 270 +- .../codeeditor/assets/vendor/ace/ace.js | 630 +++- .../codeeditor/assets/vendor/ace/ext-emmet.js | 29 +- .../assets/vendor/ace/ext-language_tools.js | 11 +- .../assets/vendor/ace/ext-searchbox.js | 1 + .../codeeditor/assets/vendor/ace/mode-css.js | 357 -- .../codeeditor/assets/vendor/ace/mode-html.js | 378 +- .../assets/vendor/ace/mode-javascript.js | 368 +- .../codeeditor/assets/vendor/ace/mode-less.js | 357 -- .../assets/vendor/ace/mode-markdown.js | 381 +- .../codeeditor/partials/_codeeditor.htm | 8 +- .../colorpicker/assets/css/colorpicker.css | 197 +- .../colorpicker/assets/js/colorpicker.js | 45 +- .../colorpicker/assets/less/colorpicker.less | 111 +- .../assets/vendor/spectrum/LICENSE | 18 + .../assets/vendor/spectrum/README.md | 69 + .../assets/vendor/spectrum/spectrum.css | 507 +++ .../assets/vendor/spectrum/spectrum.js | 2323 ++++++++++++ .../colorpicker/partials/_colorpicker.htm | 4 +- .../datepicker/partials/_datepicker.htm | 2 + .../fileupload/partials/_config_form.htm | 4 +- .../assets/css/markdowneditor.css | 29 +- .../assets/less/markdowneditor.less | 30 +- .../partials/_markdowneditor.htm | 2 +- .../partials/_permissioneditor.htm | 35 +- .../recordfinder/assets/js/recordfinder.js | 49 +- .../recordfinder/partials/_recordfinder.htm | 12 +- .../partials/_recordfinder_form.htm | 4 +- .../repeater/assets/css/repeater.css | 79 +- .../repeater/assets/js/repeater.js | 177 +- .../repeater/assets/less/repeater.less | 84 +- .../repeater/partials/_repeater.htm | 66 +- .../repeater/partials/_repeater_item.htm | 53 +- .../richeditor/assets/css/richeditor.css | 135 +- .../richeditor/assets/js/build-min.js | 248 +- .../formwidgets/richeditor/assets/js/build.js | 2 +- .../richeditor/assets/js/richeditor.js | 10 +- .../assets/vendor/froala/js/languages/ar.js | 4 +- .../assets/vendor/froala/js/languages/bs.js | 4 +- .../assets/vendor/froala/js/languages/cs.js | 4 +- .../assets/vendor/froala/js/languages/da.js | 4 +- .../assets/vendor/froala/js/languages/de.js | 4 +- .../vendor/froala/js/languages/en_ca.js | 4 +- .../vendor/froala/js/languages/en_gb.js | 4 +- .../assets/vendor/froala/js/languages/es.js | 4 +- .../assets/vendor/froala/js/languages/et.js | 4 +- .../assets/vendor/froala/js/languages/fa.js | 4 +- .../assets/vendor/froala/js/languages/fi.js | 4 +- .../assets/vendor/froala/js/languages/fr.js | 12 +- .../assets/vendor/froala/js/languages/he.js | 4 +- .../assets/vendor/froala/js/languages/hr.js | 4 +- .../assets/vendor/froala/js/languages/hu.js | 8 +- .../assets/vendor/froala/js/languages/id.js | 4 +- .../assets/vendor/froala/js/languages/it.js | 4 +- .../assets/vendor/froala/js/languages/ja.js | 4 +- .../assets/vendor/froala/js/languages/ko.js | 4 +- .../assets/vendor/froala/js/languages/me.js | 4 +- .../assets/vendor/froala/js/languages/nb.js | 4 +- .../assets/vendor/froala/js/languages/nl.js | 90 +- .../assets/vendor/froala/js/languages/pl.js | 4 +- .../vendor/froala/js/languages/pt_br.js | 8 +- .../vendor/froala/js/languages/pt_pt.js | 8 +- .../assets/vendor/froala/js/languages/ro.js | 4 +- .../assets/vendor/froala/js/languages/ru.js | 38 +- .../assets/vendor/froala/js/languages/sr.js | 4 +- .../assets/vendor/froala/js/languages/sv.js | 4 +- .../assets/vendor/froala/js/languages/th.js | 4 +- .../assets/vendor/froala/js/languages/tr.js | 4 +- .../assets/vendor/froala/js/languages/ua.js | 4 +- .../assets/vendor/froala/js/languages/vi.js | 173 + .../vendor/froala/js/languages/zh_cn.js | 4 +- .../vendor/froala/js/languages/zh_tw.js | 4 +- .../richeditor/partials/_richeditor.htm | 6 +- modules/backend/helpers/Backend.php | 10 + modules/backend/lang/be/lang.php | 470 +++ modules/backend/lang/de/lang.php | 2 +- modules/backend/lang/el/lang.php | 14 +- modules/backend/lang/en/lang.php | 36 +- modules/backend/lang/es/lang.php | 4 +- modules/backend/lang/et/lang.php | 497 +++ modules/backend/lang/fa/lang.php | 7 +- modules/backend/lang/fr/lang.php | 45 +- modules/backend/lang/hu/lang.php | 24 +- modules/backend/lang/it/lang.php | 4 +- modules/backend/lang/lt/lang.php | 494 +++ modules/backend/lang/nl/lang.php | 20 +- modules/backend/lang/pt-pt/lang.php | 497 +++ modules/backend/lang/ru/lang.php | 147 +- modules/backend/lang/sv/lang.php | 44 +- modules/backend/lang/uk/lang.php | 321 +- modules/backend/lang/zh-cn/lang.php | 199 +- modules/backend/lang/zh-tw/lang.php | 2 +- modules/backend/layouts/_browser_detector.htm | 17 +- modules/backend/layouts/_head.htm | 8 +- modules/backend/layouts/_mainmenu.htm | 15 +- modules/backend/layouts/_sidenav.htm | 6 +- modules/backend/layouts/auth.htm | 14 +- modules/backend/models/AccessLog.php | 2 +- modules/backend/models/BrandSetting.php | 20 +- modules/backend/models/EditorSetting.php | 22 +- modules/backend/models/ExportModel.php | 7 +- modules/backend/models/ImportModel.php | 6 +- modules/backend/models/Preference.php | 75 +- modules/backend/models/User.php | 21 +- modules/backend/models/UserGroup.php | 9 +- modules/backend/models/UserRole.php | 81 + modules/backend/models/UserThrottle.php | 2 +- .../backend/models/brandsetting/custom.less | 11 +- .../backend/models/editorsetting/fields.yaml | 7 + modules/backend/models/user/fields.yaml | 8 +- modules/backend/models/usergroup/columns.yaml | 9 +- modules/backend/models/usergroup/fields.yaml | 3 - modules/backend/models/userrole/columns.yaml | 24 + modules/backend/models/userrole/fields.yaml | 22 + modules/backend/reportwidgets/Welcome.php | 2 +- modules/backend/routes.php | 12 +- modules/backend/skins/Standard.php | 8 +- modules/backend/traits/CollapsableWidget.php | 110 +- modules/backend/traits/ErrorMaker.php | 28 + modules/backend/traits/FormModelSaver.php | 44 +- .../backend/traits/InspectableContainer.php | 2 +- modules/backend/traits/SessionMaker.php | 90 + modules/backend/traits/WidgetMaker.php | 7 +- modules/backend/views/access_denied.php | 2 +- modules/backend/views/mail/invite.htm | 39 +- modules/backend/views/mail/restore.htm | 18 +- modules/backend/views/no_database.php | 2 +- modules/backend/widgets/Filter.php | 38 +- modules/backend/widgets/Form.php | 61 +- modules/backend/widgets/Lists.php | 60 +- modules/backend/widgets/ReportContainer.php | 6 +- modules/backend/widgets/Search.php | 2 +- modules/backend/widgets/Table.php | 31 +- modules/backend/widgets/Toolbar.php | 2 +- .../form/partials/_field_balloon-selector.htm | 13 +- .../widgets/form/partials/_field_checkbox.htm | 2 +- .../form/partials/_field_checkboxlist.htm | 11 +- .../widgets/form/partials/_field_dropdown.htm | 9 +- .../widgets/form/partials/_field_radio.htm | 2 +- .../widgets/form/partials/_field_text.htm | 4 +- .../widgets/form/partials/_form_tabs.htm | 2 +- .../widgets/lists/partials/_list_body_row.htm | 11 +- .../lists/partials/_list_body_tree.htm | 2 +- .../lists/partials/_list_pagination.htm | 79 +- .../widgets/lists/partials/_setup_form.htm | 8 +- .../assets/css/reportcontainer.css | 10 +- .../assets/less/reportcontainer.less | 21 +- .../widgets/table/ClientMemoryDataSource.php | 2 +- .../backend/widgets/table/DataSourceBase.php | 12 +- .../widgets/table/ServerEventDataSource.php | 10 +- .../widgets/table/assets/css/table.css | 36 +- .../widgets/table/assets/js/build-min.js | 96 +- .../backend/widgets/table/assets/js/build.js | 1 + .../table/assets/js/table.datasource.base.js | 7 + .../assets/js/table.datasource.server.js | 16 + .../assets/js/table.helper.navigation.js | 5 +- .../table/assets/js/table.helper.search.js | 116 + .../backend/widgets/table/assets/js/table.js | 102 +- .../table/assets/js/table.processor.base.js | 2 +- .../widgets/table/assets/less/table.less | 38 +- .../backend/widgets/table/partials/_table.htm | 35 +- modules/cms/ServiceProvider.php | 54 +- .../assets/css/themelogs/template-diff.css | 10 + modules/cms/assets/js/october.cmspage.js | 7 +- .../cms/assets/js/themelogs/template-diff.js | 113 + .../cms/assets/less/october.components.less | 2 +- modules/cms/assets/vendor/jsdiff/diff.js | 1407 +++++++ modules/cms/classes/Asset.php | 8 + modules/cms/classes/CmsCompoundObject.php | 17 +- modules/cms/classes/CmsController.php | 6 +- modules/cms/classes/CmsObject.php | 3 +- modules/cms/classes/CmsObjectCollection.php | 6 +- modules/cms/classes/CodeParser.php | 56 +- modules/cms/classes/ComponentBase.php | 19 +- modules/cms/classes/ComponentHelpers.php | 2 +- modules/cms/classes/ComponentManager.php | 13 +- modules/cms/classes/ComponentPartial.php | 22 + modules/cms/classes/Controller.php | 133 +- modules/cms/classes/LayoutCode.php | 2 +- modules/cms/classes/MediaLibrary.php | 88 +- modules/cms/classes/MediaViewHelper.php | 10 +- modules/cms/classes/Page.php | 13 +- modules/cms/classes/Router.php | 8 +- modules/cms/classes/Theme.php | 30 +- modules/cms/classes/ThemeManager.php | 4 +- modules/cms/classes/asset/fields.yaml | 3 + modules/cms/classes/content/fields.yaml | 3 + modules/cms/classes/layout/fields.yaml | 3 + modules/cms/classes/page/fields.yaml | 1 + modules/cms/classes/partial/fields.yaml | 3 + modules/cms/components/Resources.php | 192 + modules/cms/components/UnknownComponent.php | 35 + modules/cms/components/ViewBag.php | 83 + modules/cms/composer.json | 4 +- modules/cms/controllers/Index.php | 36 +- modules/cms/controllers/Media.php | 5 +- modules/cms/controllers/ThemeLogs.php | 96 + modules/cms/controllers/ThemeOptions.php | 151 + modules/cms/controllers/Themes.php | 77 +- .../cms/controllers/index/_page_toolbar.htm | 2 +- .../controllers/index/config_page_list.yaml | 4 + .../controllers/themelogs/_field_content.htm | 3 + .../themelogs/_field_diff_content.htm | 7 + .../themelogs/_field_diff_template.htm | 7 + .../controllers/themelogs/_field_template.htm | 1 + modules/cms/controllers/themelogs/_hint.htm | 4 + .../controllers/themelogs/_hint_preview.htm | 22 + .../controllers/themelogs/_list_toolbar.htm | 31 + .../themelogs/_preview_scoreboard.htm | 18 + .../controllers/themelogs/config_form.yaml | 19 + .../controllers/themelogs/config_list.yaml | 20 + modules/cms/controllers/themelogs/index.htm | 5 + modules/cms/controllers/themelogs/preview.htm | 34 + .../controllers/themeoptions/config_form.yaml | 21 + .../cms/controllers/themeoptions/update.htm | 68 + .../controllers/themes/_theme_list_item.htm | 6 +- ...2016_10_01_000002_Db_Cms_Timestamp_Fix.php | 10 - .../2017_10_01_000003_Db_Cms_Theme_Logs.php | 28 + modules/cms/facades/Cms.php | 2 +- modules/cms/formwidgets/Components.php | 4 +- modules/cms/formwidgets/MediaFinder.php | 46 +- .../mediafinder/assets/css/mediafinder.css | 4 + .../mediafinder/assets/js/mediafinder.js | 30 +- .../assets/less/mediafinder.base.less | 10 + .../mediafinder/partials/_file_single.htm | 4 +- .../mediafinder/partials/_image_single.htm | 6 +- .../mediafinder/partials/_mediafinder.htm | 24 +- modules/cms/helpers/Cms.php | 2 +- modules/cms/lang/be/lang.php | 322 ++ modules/cms/lang/el/lang.php | 14 +- modules/cms/lang/en/lang.php | 62 +- modules/cms/lang/es/lang.php | 223 +- modules/cms/lang/et/lang.php | 360 ++ modules/cms/lang/fa/lang.php | 10 +- modules/cms/lang/fr/lang.php | 19 +- modules/cms/lang/hu/lang.php | 53 +- modules/cms/lang/lt/lang.php | 328 ++ modules/cms/lang/nl/lang.php | 47 +- modules/cms/lang/pt-pt/lang.php | 358 ++ modules/cms/lang/ru/lang.php | 89 +- modules/cms/lang/uk/lang.php | 360 ++ modules/cms/lang/zh-tw/lang.php | 2 +- modules/cms/models/MaintenanceSetting.php | 24 +- modules/cms/models/ThemeData.php | 2 +- modules/cms/models/ThemeExport.php | 2 +- modules/cms/models/ThemeImport.php | 4 +- modules/cms/models/ThemeLog.php | 133 + modules/cms/models/themelog/columns.yaml | 47 + modules/cms/models/themelog/fields.yaml | 36 + modules/cms/reportwidgets/ActiveTheme.php | 2 +- .../activetheme/partials/_widget.htm | 9 +- modules/cms/routes.php | 2 +- modules/cms/traits/UrlMaker.php | 209 + modules/cms/twig/ComponentNode.php | 5 +- modules/cms/twig/ComponentTokenParser.php | 13 +- modules/cms/twig/ContentNode.php | 5 +- modules/cms/twig/ContentTokenParser.php | 15 +- modules/cms/twig/DebugExtension.php | 78 +- modules/cms/twig/DefaultTokenParser.php | 15 +- modules/cms/twig/Extension.php | 11 - modules/cms/twig/FlashNode.php | 3 +- modules/cms/twig/FlashTokenParser.php | 2 +- modules/cms/twig/FrameworkTokenParser.php | 9 +- modules/cms/twig/Loader.php | 87 +- modules/cms/twig/PageNode.php | 2 +- modules/cms/twig/PageTokenParser.php | 7 +- modules/cms/twig/PartialNode.php | 5 +- modules/cms/twig/PartialTokenParser.php | 15 +- modules/cms/twig/PlaceholderNode.php | 7 +- modules/cms/twig/PlaceholderTokenParser.php | 21 +- modules/cms/twig/PutNode.php | 7 +- modules/cms/twig/PutTokenParser.php | 21 +- modules/cms/twig/ScriptsNode.php | 4 +- modules/cms/twig/ScriptsTokenParser.php | 9 +- modules/cms/twig/StylesNode.php | 4 +- modules/cms/twig/StylesTokenParser.php | 9 +- modules/cms/widgets/AssetList.php | 105 +- modules/cms/widgets/MediaManager.php | 251 +- modules/cms/widgets/TemplateList.php | 100 +- .../assetlist/assets/css/assetlist.css | 6 +- .../widgets/assetlist/assets/js/assetlist.js | 14 +- .../assetlist/assets/less/assetlist.less | 8 +- .../assetlist/partials/_new_dir_form.htm | 7 +- .../assetlist/partials/_rename_form.htm | 7 +- .../componentlist/partials/_components.htm | 6 +- .../widgets/componentlist/partials/_items.htm | 2 +- .../mediamanager/assets/css/mediamanager.css | 4 +- .../assets/js/mediamanager-browser-min.js | 17 +- .../mediamanager/assets/js/mediamanager.js | 70 +- .../assets/less/mediamanager.less | 5 - .../mediamanager/partials/_folder-path.htm | 8 +- .../partials/_item-sidebar-preview.htm | 2 +- .../partials/_new-folder-form.htm | 7 +- .../mediamanager/partials/_rename-form.htm | 12 +- .../widgets/templatelist/partials/_items.htm | 8 +- .../partials/_sorting-options.htm | 7 + .../templatelist/partials/_templates.htm | 10 +- .../templatelist/partials/_toolbar.htm | 26 +- modules/system/ServiceProvider.php | 106 +- .../system/assets/css/framework.extras.css | 3 +- .../mailbrandsettings/mailbrandsettings.css | 4 + modules/system/assets/css/styles.css | 53 +- modules/system/assets/css/updates/details.css | 8 +- modules/system/assets/css/updates/install.css | 7 +- modules/system/assets/js/framework.extras.js | 22 +- modules/system/assets/js/framework.js | 236 +- modules/system/assets/js/lang/lang.be.js | 144 + modules/system/assets/js/lang/lang.bg.js | 95 +- modules/system/assets/js/lang/lang.cs.js | 2 +- modules/system/assets/js/lang/lang.da.js | 2 +- modules/system/assets/js/lang/lang.de.js | 2 +- modules/system/assets/js/lang/lang.el.js | 2 +- modules/system/assets/js/lang/lang.en-au.js | 2 +- modules/system/assets/js/lang/lang.en-ca.js | 2 +- modules/system/assets/js/lang/lang.en-gb.js | 2 +- modules/system/assets/js/lang/lang.en.js | 2 +- modules/system/assets/js/lang/lang.es-ar.js | 2 +- modules/system/assets/js/lang/lang.es.js | 2 +- modules/system/assets/js/lang/lang.et.js | 90 + modules/system/assets/js/lang/lang.fa.js | 2 +- modules/system/assets/js/lang/lang.fr-ca.js | 2 +- modules/system/assets/js/lang/lang.fr.js | 2 +- modules/system/assets/js/lang/lang.hu.js | 2 +- modules/system/assets/js/lang/lang.id.js | 2 +- modules/system/assets/js/lang/lang.it.js | 2 +- modules/system/assets/js/lang/lang.ja.js | 2 +- modules/system/assets/js/lang/lang.lt.js | 126 + modules/system/assets/js/lang/lang.lv.js | 2 +- modules/system/assets/js/lang/lang.nb-no.js | 2 +- modules/system/assets/js/lang/lang.nl.js | 2 +- modules/system/assets/js/lang/lang.pl.js | 2 +- modules/system/assets/js/lang/lang.pt-br.js | 2 +- modules/system/assets/js/lang/lang.pt-pt.js | 9 + modules/system/assets/js/lang/lang.ro.js | 2 +- modules/system/assets/js/lang/lang.ru.js | 2 +- modules/system/assets/js/lang/lang.sk.js | 2 +- modules/system/assets/js/lang/lang.sv.js | 2 +- modules/system/assets/js/lang/lang.tr.js | 2 +- modules/system/assets/js/lang/lang.uk.js | 156 + modules/system/assets/js/lang/lang.zh-cn.js | 2 +- modules/system/assets/js/lang/lang.zh-tw.js | 2 +- .../js/mailbrandsettings/mailbrandsettings.js | 37 + .../system/assets/less/framework.extras.less | 2 +- modules/system/assets/less/styles.less | 2 +- .../system/assets/less/updates/details.less | 9 +- .../system/assets/less/updates/install.less | 19 +- modules/system/assets/ui/docs/autocomplete.md | 19 + modules/system/assets/ui/docs/drag-sort.md | 6 +- modules/system/assets/ui/docs/icon.md | 57 +- modules/system/assets/ui/docs/pagination.md | 27 +- modules/system/assets/ui/docs/popover.md | 187 +- modules/system/assets/ui/docs/select.md | 47 +- modules/system/assets/ui/docs/utilities.md | 1 + modules/system/assets/ui/font/FontAwesome.otf | Bin 124988 -> 134808 bytes .../assets/ui/font/fontawesome-webfont.eot | Bin 76518 -> 165742 bytes .../assets/ui/font/fontawesome-webfont.svg | 3350 +++++++++++++---- .../assets/ui/font/fontawesome-webfont.ttf | Bin 152796 -> 165548 bytes .../assets/ui/font/fontawesome-webfont.woff | Bin 90412 -> 98024 bytes .../assets/ui/font/fontawesome-webfont.woff2 | Bin 71896 -> 77160 bytes modules/system/assets/ui/js/autocomplete.js | 421 +++ .../system/assets/ui/js/checkbox.balloon.js | 10 +- modules/system/assets/ui/js/datepicker.js | 4 +- modules/system/assets/ui/js/drag.scroll.js | 68 +- modules/system/assets/ui/js/flashmessage.js | 2 +- modules/system/assets/ui/js/input.preset.js | 20 +- .../assets/ui/js/inspector.editor.dropdown.js | 11 +- .../assets/ui/js/inspector.validationset.js | 4 +- modules/system/assets/ui/js/popover.js | 81 +- modules/system/assets/ui/js/select.js | 27 +- modules/system/assets/ui/js/toolbar.js | 12 +- .../system/assets/ui/less/autocomplete.less | 7 + modules/system/assets/ui/less/breadcrumb.less | 6 +- .../system/assets/ui/less/button.base.less | 2 +- modules/system/assets/ui/less/button.less | 1 - .../system/assets/ui/less/button.mixins.less | 6 - modules/system/assets/ui/less/callout.less | 2 +- modules/system/assets/ui/less/chart.less | 2 +- modules/system/assets/ui/less/checkbox.less | 6 +- modules/system/assets/ui/less/dropdown.less | 4 + .../system/assets/ui/less/flashmessage.less | 3 +- modules/system/assets/ui/less/form.less | 51 +- .../assets/ui/less/global.variables.less | 4 +- modules/system/assets/ui/less/icon.close.less | 1 + modules/system/assets/ui/less/icon.icons.less | 56 + .../system/assets/ui/less/icon.variables.less | 56 + modules/system/assets/ui/less/inspector.less | 4 +- modules/system/assets/ui/less/list.less | 24 +- .../system/assets/ui/less/list.variables.less | 1 + modules/system/assets/ui/less/pagination.less | 65 +- modules/system/assets/ui/less/popover.less | 24 +- modules/system/assets/ui/less/popup.less | 1 - modules/system/assets/ui/less/select.less | 4 +- modules/system/assets/ui/less/tab.base.less | 2 +- modules/system/assets/ui/less/tab.less | 11 +- modules/system/assets/ui/less/toolbar.less | 7 + modules/system/assets/ui/less/utilities.less | 1 + modules/system/assets/ui/storm-min.js | 204 +- modules/system/assets/ui/storm.css | 235 +- modules/system/assets/ui/storm.js | 1 + modules/system/assets/ui/storm.less | 1 + modules/system/behaviors/SettingsModel.php | 17 +- modules/system/classes/CombineAssets.php | 107 +- modules/system/classes/ComposerManager.php | 2 +- modules/system/classes/ErrorHandler.php | 14 +- modules/system/classes/MailManager.php | 402 ++ modules/system/classes/MarkupManager.php | 102 +- modules/system/classes/ModelBehavior.php | 3 +- modules/system/classes/PluginBase.php | 54 +- modules/system/classes/PluginManager.php | 36 +- modules/system/classes/SettingsManager.php | 157 +- modules/system/classes/SystemController.php | 43 + modules/system/classes/UpdateManager.php | 118 +- modules/system/classes/VersionManager.php | 42 +- modules/system/composer.json | 4 +- modules/system/console/OctoberDown.php | 20 +- modules/system/console/OctoberEnv.php | 15 +- modules/system/console/OctoberFresh.php | 10 +- modules/system/console/OctoberInstall.php | 18 +- modules/system/console/OctoberMirror.php | 8 +- modules/system/console/OctoberUp.php | 20 +- modules/system/console/OctoberUpdate.php | 16 +- modules/system/console/OctoberUtil.php | 69 +- modules/system/console/PluginInstall.php | 18 +- modules/system/console/PluginRefresh.php | 30 +- modules/system/console/PluginRemove.php | 17 +- modules/system/console/ThemeInstall.php | 10 +- modules/system/console/ThemeList.php | 10 +- modules/system/console/ThemeRemove.php | 10 +- modules/system/console/ThemeUse.php | 10 +- modules/system/controllers/EventLogs.php | 23 +- .../system/controllers/MailBrandSettings.php | 123 + modules/system/controllers/MailLayouts.php | 30 +- modules/system/controllers/MailPartials.php | 55 + modules/system/controllers/MailTemplates.php | 34 +- modules/system/controllers/RequestLogs.php | 24 +- modules/system/controllers/Settings.php | 6 + modules/system/controllers/Updates.php | 94 +- .../mailbrandsettings/_field_mail_preview.htm | 11 + .../mailbrandsettings/config_form.yaml | 15 + .../controllers/mailbrandsettings/index.htm | 60 + .../controllers/maillayouts/config_form.yaml | 6 +- .../system/controllers/maillayouts/create.htm | 8 +- .../system/controllers/maillayouts/update.htm | 19 +- .../controllers/mailpartials/config_form.yaml | 16 + .../controllers/mailpartials/create.htm | 48 + .../controllers/mailpartials/update.htm | 67 + .../mailtemplates/_list_partials_toolbar.htm | 7 + .../mailtemplates/config_partials_list.yaml | 16 + .../controllers/mailtemplates/create.htm | 2 +- .../controllers/mailtemplates/index.htm | 24 +- .../controllers/mailtemplates/update.htm | 2 +- modules/system/controllers/settings/index.htm | 13 +- .../controllers/updates/_install_plugins.htm | 3 +- .../controllers/updates/_install_themes.htm | 3 +- .../controllers/updates/_project_form.htm | 2 +- .../controllers/updates/_update_list.htm | 32 +- .../migrations/2014_10_01_000010_Db_Jobs.php | 9 +- .../2015_10_01_000018_Db_FailedJobs.php | 9 +- ...6_10_01_000020_Db_System_Timestamp_Fix.php | 33 +- ...10_01_000021_Db_System_Sessions_Update.php | 31 + ...10_01_000022_Db_Jobs_FailedJobs_Update.php | 51 + ...7_10_01_000023_Db_System_Mail_Partials.php | 26 + .../database/seeds/SeedSetupMailLayouts.php | 68 +- modules/system/helpers/View.php | 12 +- modules/system/lang/be/client.php | 88 + modules/system/lang/be/lang.php | 319 ++ modules/system/lang/be/validation.php | 99 + modules/system/lang/bg/client.php | 2 +- modules/system/lang/bg/lang.php | 29 +- modules/system/lang/cs/client.php | 3 - modules/system/lang/cs/lang.php | 28 +- modules/system/lang/da/lang.php | 32 +- modules/system/lang/de/lang.php | 28 +- modules/system/lang/de/validation.php | 4 +- modules/system/lang/el/client.php | 6 +- modules/system/lang/el/lang.php | 36 +- modules/system/lang/en/client.php | 3 + modules/system/lang/en/lang.php | 87 +- modules/system/lang/es-ar/lang.php | 18 +- modules/system/lang/es/lang.php | 32 +- modules/system/lang/es/validation.php | 2 +- modules/system/lang/et/client.php | 88 + modules/system/lang/et/lang.php | 367 ++ modules/system/lang/et/validation.php | 99 + modules/system/lang/fa/client.php | 5 - modules/system/lang/fa/lang.php | 37 +- modules/system/lang/fr/client.php | 1 + modules/system/lang/fr/lang.php | 36 +- modules/system/lang/hu/lang.php | 59 +- modules/system/lang/hu/validation.php | 31 +- modules/system/lang/id/lang.php | 24 +- modules/system/lang/it/lang.php | 32 +- modules/system/lang/ja/lang.php | 21 +- modules/system/lang/lt/client.php | 88 + modules/system/lang/lt/lang.php | 354 ++ modules/system/lang/lt/validation.php | 99 + modules/system/lang/lv/lang.php | 27 +- modules/system/lang/nb-no/lang.php | 32 +- modules/system/lang/nl/lang.php | 74 +- modules/system/lang/pl/lang.php | 60 +- modules/system/lang/pt-br/lang.php | 32 +- modules/system/lang/pt-pt/client.php | 88 + modules/system/lang/pt-pt/lang.php | 366 ++ modules/system/lang/pt-pt/validation.php | 99 + modules/system/lang/ro/client.php | 3 - modules/system/lang/ro/lang.php | 17 +- modules/system/lang/ru/client.php | 45 +- modules/system/lang/ru/lang.php | 73 +- modules/system/lang/ru/validation.php | 2 +- modules/system/lang/sv/client.php | 3 - modules/system/lang/sv/lang.php | 28 +- modules/system/lang/tr/lang.php | 32 +- modules/system/lang/uk/client.php | 88 + modules/system/lang/uk/lang.php | 334 ++ modules/system/lang/uk/validation.php | 99 + modules/system/lang/zh-cn/lang.php | 28 +- modules/system/lang/zh-tw/lang.php | 29 +- modules/system/models/EventLog.php | 3 +- modules/system/models/File.php | 14 +- modules/system/models/LogSetting.php | 70 + modules/system/models/MailBrandSetting.php | 161 + modules/system/models/MailLayout.php | 87 + modules/system/models/MailPartial.php | 121 + modules/system/models/MailSetting.php | 27 +- modules/system/models/MailTemplate.php | 166 +- modules/system/models/PluginVersion.php | 47 +- modules/system/models/RequestLog.php | 4 + modules/system/models/logsetting/fields.yaml | 25 + .../models/mailbrandsetting/custom.less | 300 ++ .../models/mailbrandsetting/fields.yaml | 122 + .../mailbrandsetting/sample_template.htm | 47 + modules/system/models/maillayout/fields.yaml | 3 + .../system/models/mailpartial/columns.yaml | 13 + modules/system/models/mailpartial/fields.yaml | 34 + .../system/models/mailtemplate/fields.yaml | 5 +- .../system/partials/_settings_menu_items.htm | 2 +- modules/system/providers.php | 3 +- modules/system/reportwidgets/Status.php | 11 +- modules/system/routes.php | 2 +- modules/system/traits/AssetMaker.php | 29 +- modules/system/traits/ConfigMaker.php | 18 +- modules/system/traits/EventEmitter.php | 94 + modules/system/traits/PropertyContainer.php | 12 +- modules/system/traits/ViewMaker.php | 21 +- modules/system/twig/Extension.php | 14 +- modules/system/twig/Loader.php | 5 +- modules/system/twig/MailPartialNode.php | 59 + .../system/twig/MailPartialTokenParser.php | 94 + modules/system/views/mail/layout-default.htm | 52 + modules/system/views/mail/layout-system.htm | 49 + modules/system/views/mail/partial-button.htm | 25 + modules/system/views/mail/partial-footer.htm | 16 + modules/system/views/mail/partial-header.htm | 17 + modules/system/views/mail/partial-panel.htm | 17 + .../system/views/mail/partial-promotion.htm | 11 + modules/system/views/mail/partial-subcopy.htm | 11 + modules/system/views/mail/partial-table.htm | 7 + octobermovies.sublime-workspace | 69 +- .../october/demo/components/todo/default.htm | 3 +- plugins/offline/sitesearch/Plugin.php | 1 + plugins/offline/sitesearch/README.md | 148 +- plugins/offline/sitesearch/classes/Result.php | 54 +- .../sitesearch/classes/SearchService.php | 125 + .../ArrizalaminPortfolioResultsProvider.php | 1 + .../providers/CmsPagesResultsProvider.php | 3 +- ...eglewebOctoshopProductsResultsProvider.php | 1 + .../providers/GenericResultsProvider.php | 4 +- .../GrakerPhotoAlbumsResultsProvider.php | 153 + .../IndikatorNewsResultsProvider.php | 1 + .../providers/JiriJKShopResultsProvider.php | 1 + .../OfflineSnipcartShopResultsProvider.php | 1 + .../RadiantWebProBlogResultsProvider.php | 1 + .../providers/RainlabBlogResultsProvider.php | 1 + .../providers/RainlabPagesResultsProvider.php | 18 +- .../ResponsivShowcaseResultsProvider.php | 1 + .../classes/providers/ResultsProvider.php | 52 +- .../VojtaSvobodaBrandsResultsProvider.php | 1 + .../sitesearch/components/BaseComponent.php | 27 + .../sitesearch/components/SearchInput.php | 148 + .../sitesearch/components/SearchResults.php | 66 +- .../components/searchinput/autocomplete.htm | 17 + .../components/searchinput/content.htm | 8 + .../components/searchinput/default.htm | 16 + .../components/searchinput/searchresult.htm | 9 + .../components/searchinput/thumbnail.htm | 5 + .../components/searchresults/content.htm | 8 +- plugins/offline/sitesearch/lang/de/lang.php | 21 + plugins/offline/sitesearch/lang/en/lang.php | 21 + .../sitesearch/models/settings/fields.yaml | 31 + plugins/offline/sitesearch/phpunit.xml | 23 + .../sitesearch/tests/classes/ResultTest.php | 20 + .../offline/sitesearch/updates/version.yaml | 22 + .../offline/sitesearch/vendor/autoload.php | 2 +- .../vendor/composer/autoload_real.php | 6 +- .../sitesearch/vendor/composer/installed.json | 19 +- .../vendor/composer/installers/CHANGELOG.md | 60 + .../composer/installers/CONTRIBUTING.md | 24 + .../vendor/composer/installers/README.md | 36 +- .../vendor/composer/installers/composer.json | 7 + .../Composer/Installers/CakePHPInstaller.php | 1 - .../Installers/Concrete5Installer.php | 5 +- .../Composer/Installers/EliasisInstaller.php | 9 + .../src/Composer/Installers/Installer.php | 8 + .../src/Composer/Installers/ItopInstaller.php | 9 + .../Composer/Installers/KanboardInstaller.php | 18 + .../Composer/Installers/LavaLiteInstaller.php | 10 + .../src/Composer/Installers/MayaInstaller.php | 33 + .../Composer/Installers/MoodleInstaller.php | 1 + .../Composer/Installers/OntoWikiInstaller.php | 24 + .../Composer/Installers/PortoInstaller.php | 9 + .../Composer/Installers/SyDESInstaller.php | 49 + .../Composer/Installers/VgmcpInstaller.php | 49 + .../Installers/Test/InstallerTest.php | 20 +- .../Installers/Test/MayaInstallerTest.php | 61 + .../Installers/Test/OntoWikiInstallerTest.php | 85 + .../Installers/Test/SyDESInstallerTest.php | 81 + .../Installers/Test/VgmcpInstallerTest.php | 79 + plugins/rainlab/blog/Plugin.php | 2 +- plugins/rainlab/blog/README.md | 18 +- plugins/rainlab/blog/components/Post.php | 52 +- plugins/rainlab/blog/components/Posts.php | 10 + .../rainlab/blog/components/posts/default.htm | 2 +- plugins/rainlab/blog/controllers/Posts.php | 1 + .../blog/formwidgets/MLBlogMarkdown.php | 1 + plugins/rainlab/blog/lang/de/lang.php | 48 +- plugins/rainlab/blog/lang/en/lang.php | 3 +- plugins/rainlab/blog/lang/es/lang.php | 124 + plugins/rainlab/blog/lang/hu/lang.php | 10 +- plugins/rainlab/blog/lang/pt-br/lang.php | 26 +- plugins/rainlab/blog/lang/tr/lang.php | 49 +- plugins/rainlab/blog/lang/zh-cn/lang.php | 124 + plugins/rainlab/blog/models/Category.php | 32 +- plugins/rainlab/blog/models/Post.php | 94 +- plugins/rainlab/blog/updates/version.yaml | 4 + plugins/rainlab/blog/vendor/autoload.php | 2 +- .../blog/vendor/composer/autoload_real.php | 6 +- .../blog/vendor/composer/installed.json | 22 +- .../vendor/composer/installers/CHANGELOG.md | 69 + .../composer/installers/CONTRIBUTING.md | 24 + .../blog/vendor/composer/installers/README.md | 40 +- .../vendor/composer/installers/_config.yml | 1 + .../vendor/composer/installers/composer.json | 10 + .../Composer/Installers/CakePHPInstaller.php | 1 - .../Installers/Concrete5Installer.php | 5 +- .../Composer/Installers/EliasisInstaller.php | 9 + .../Installers/EzPlatformInstaller.php | 10 + .../src/Composer/Installers/Installer.php | 12 + .../src/Composer/Installers/ItopInstaller.php | 9 + .../Composer/Installers/KanboardInstaller.php | 18 + .../LanManagementSystemInstaller.php | 27 + .../Composer/Installers/LavaLiteInstaller.php | 10 + .../src/Composer/Installers/MayaInstaller.php | 33 + .../Composer/Installers/MoodleInstaller.php | 1 + .../Composer/Installers/OntoWikiInstaller.php | 24 + .../Composer/Installers/OsclassInstaller.php | 14 + .../Composer/Installers/PortoInstaller.php | 9 + .../Composer/Installers/SyDESInstaller.php | 49 + .../Installers/UserFrostingInstaller.php | 9 + .../Composer/Installers/VgmcpInstaller.php | 49 + .../Installers/Test/InstallerTest.php | 44 +- .../Installers/Test/MayaInstallerTest.php | 61 + .../Installers/Test/OntoWikiInstallerTest.php | 85 + .../Installers/Test/SyDESInstallerTest.php | 81 + .../Installers/Test/VgmcpInstallerTest.php | 79 + plugins/rainlab/builder/Plugin.php | 2 +- .../rainlab/builder/assets/css/builder.css | 21 +- .../rainlab/builder/assets/js/build-min.js | 4 +- .../js/builder.index.entity.databasetable.js | 108 +- .../js/builder.index.entity.modelform.js | 2 +- .../js/builder.index.entity.modellist.js | 108 +- .../builder.inspector.editor.localization.js | 12 +- .../rainlab/builder/assets/less/builder.less | 15 +- .../builder/assets/less/buildingarea.less | 5 +- .../builder/assets/less/localization.less | 22 +- .../behaviors/IndexModelListOperations.php | 11 + .../partials/_tab.htm | 6 +- .../partials/_tab.htm | 4 +- .../builder/classes/ControllerModel.php | 4 +- .../builder/classes/DatabaseTableModel.php | 40 +- .../builder/classes/FilesystemGenerator.php | 24 +- .../builder/classes/LocalizationModel.php | 22 + .../builder/classes/MigrationColumnType.php | 4 +- .../builder/classes/ModelFileParser.php | 5 +- .../builder/classes/ModelFormModel.php | 2 +- .../builder/classes/ModelListModel.php | 2 +- .../rainlab/builder/classes/ModelModel.php | 94 +- .../builder/classes/PluginBaseModel.php | 2 +- .../classes/StandardBehaviorsRegistry.php | 2 +- .../classes/StandardControlsRegistry.php | 69 +- .../classes/databasetablemodel/fields.yaml | 1 + .../classes/modellistmodel/fields.yaml | 1 + .../builder/classes/modelmodel/fields.yaml | 12 +- .../modelmodel/templates/model.php.tpl | 8 +- .../templates/no-timestamps.php.tpl | 6 + .../modelmodel/templates/soft-delete.php.tpl | 4 + .../rainlab/builder/components/RecordList.php | 6 +- .../js/formbuilder.domtopropertyjson.js | 56 +- .../formbuilder/assets/js/formbuilder.js | 2 +- .../partials/_controlcontainer.htm | 2 +- plugins/rainlab/builder/lang/cs/lang.php | 2 +- plugins/rainlab/builder/lang/en/lang.php | 22 +- plugins/rainlab/builder/lang/es/lang.php | 2 +- plugins/rainlab/builder/lang/fa/lang.php | 2 +- plugins/rainlab/builder/lang/nl/lang.php | 2 +- plugins/rainlab/builder/models/Settings.php | 2 +- plugins/rainlab/builder/updates/version.yaml | 10 + .../builder/widgets/ControllerList.php | 5 - .../builder/widgets/DatabaseTableList.php | 5 - .../rainlab/builder/widgets/LanguageList.php | 5 - plugins/rainlab/builder/widgets/ModelList.php | 6 - .../rainlab/builder/widgets/PluginList.php | 5 - .../rainlab/builder/widgets/VersionList.php | 5 - .../partials/_control-static-repeater.htm | 2 +- plugins/rainlab/pages/Plugin.php | 2 +- plugins/rainlab/pages/README.md | 37 +- plugins/rainlab/pages/assets/css/pages.css | 4 + plugins/rainlab/pages/assets/js/pages-page.js | 7 +- plugins/rainlab/pages/classes/Menu.php | 9 + plugins/rainlab/pages/classes/Page.php | 29 + plugins/rainlab/pages/classes/Router.php | 3 +- .../rainlab/pages/classes/menu/fields.yaml | 3 +- .../pages/classes/menuitem/fields.yaml | 3 + .../pages/components/StaticBreadcrumbs.php | 4 +- .../rainlab/pages/components/StaticPage.php | 27 + plugins/rainlab/pages/controllers/Index.php | 51 +- .../pages/formwidgets/MenuItemSearch.php | 92 + .../rainlab/pages/formwidgets/MenuItems.php | 4 +- .../menuitems/assets/js/menu-items-editor.js | 38 +- .../menuitems/partials/_editortemplate.htm | 3 +- .../menuitemsearch/partials/_body.htm | 10 + plugins/rainlab/pages/lang/el/lang.php | 132 + plugins/rainlab/pages/lang/en/lang.php | 7 + plugins/rainlab/pages/lang/hu/lang.php | 7 + plugins/rainlab/pages/updates/version.yaml | 4 + plugins/rainlab/pages/vendor/autoload.php | 2 +- .../pages/vendor/composer/autoload_real.php | 6 +- .../pages/vendor/composer/installed.json | 19 +- .../vendor/composer/installers/CHANGELOG.md | 60 + .../composer/installers/CONTRIBUTING.md | 24 + .../vendor/composer/installers/README.md | 36 +- .../vendor/composer/installers/composer.json | 7 + .../Composer/Installers/CakePHPInstaller.php | 1 - .../Installers/Concrete5Installer.php | 5 +- .../Composer/Installers/EliasisInstaller.php | 9 + .../src/Composer/Installers/Installer.php | 8 + .../src/Composer/Installers/ItopInstaller.php | 9 + .../Composer/Installers/KanboardInstaller.php | 18 + .../Composer/Installers/LavaLiteInstaller.php | 10 + .../src/Composer/Installers/MayaInstaller.php | 33 + .../Composer/Installers/MoodleInstaller.php | 1 + .../Composer/Installers/OntoWikiInstaller.php | 24 + .../Composer/Installers/PortoInstaller.php | 9 + .../Composer/Installers/SyDESInstaller.php | 49 + .../Composer/Installers/VgmcpInstaller.php | 49 + .../Installers/Test/InstallerTest.php | 20 +- .../Installers/Test/MayaInstallerTest.php | 61 + .../Installers/Test/OntoWikiInstallerTest.php | 85 + .../Installers/Test/SyDESInstallerTest.php | 81 + .../Installers/Test/VgmcpInstallerTest.php | 79 + plugins/rainlab/user/Plugin.php | 84 +- plugins/rainlab/user/README.md | 7 +- plugins/rainlab/user/UPGRADE.md | 16 + .../rainlab/user/classes/UserEventBase.php | 40 + plugins/rainlab/user/components/Account.php | 147 +- .../rainlab/user/components/ResetPassword.php | 8 +- plugins/rainlab/user/components/Session.php | 115 +- .../user/components/account/register.htm | 66 +- .../rainlab/user/controllers/UserGroups.php | 25 +- plugins/rainlab/user/controllers/Users.php | 48 +- .../user/controllers/users/_list_toolbar.htm | 14 +- .../controllers/users/_preview_scoreboard.htm | 4 +- .../controllers/users/_preview_toolbar.htm | 11 +- .../user/controllers/users/preview.htm | 6 +- plugins/rainlab/user/lang/cs/lang.php | 4 - plugins/rainlab/user/lang/de/lang.php | 4 - plugins/rainlab/user/lang/en/lang.php | 23 +- plugins/rainlab/user/lang/es-ar/lang.php | 4 - plugins/rainlab/user/lang/es/lang.php | 4 - plugins/rainlab/user/lang/fa/lang.php | 4 - plugins/rainlab/user/lang/fr/lang.php | 4 - plugins/rainlab/user/lang/hu/lang.php | 16 +- plugins/rainlab/user/lang/it/lang.php | 191 + plugins/rainlab/user/lang/nl/lang.php | 4 - plugins/rainlab/user/lang/pt-br/lang.php | 126 +- plugins/rainlab/user/lang/pt-pt/lang.php | 189 + plugins/rainlab/user/lang/ru/lang.php | 4 - plugins/rainlab/user/lang/tr/lang.php | 219 +- plugins/rainlab/user/lang/zh-cn/lang.php | 178 +- plugins/rainlab/user/models/MailBlocker.php | 21 +- plugins/rainlab/user/models/Settings.php | 36 +- plugins/rainlab/user/models/Throttle.php | 2 +- plugins/rainlab/user/models/User.php | 25 +- plugins/rainlab/user/models/UserGroup.php | 4 +- .../rainlab/user/models/settings/fields.yaml | 18 +- .../user/notifyrules/UserActivatedEvent.php | 18 + .../notifyrules/UserAttributeCondition.php | 37 + .../user/notifyrules/UserRegisteredEvent.php | 18 + .../userattributecondition/attributes.yaml | 17 + plugins/rainlab/user/updates/version.yaml | 3 + plugins/rainlab/user/vendor/autoload.php | 2 +- .../user/vendor/composer/autoload_real.php | 6 +- .../user/vendor/composer/installed.json | 19 +- .../vendor/composer/installers/CHANGELOG.md | 60 + .../composer/installers/CONTRIBUTING.md | 24 + .../user/vendor/composer/installers/README.md | 36 +- .../vendor/composer/installers/composer.json | 7 + .../Composer/Installers/CakePHPInstaller.php | 1 - .../Installers/Concrete5Installer.php | 5 +- .../Composer/Installers/EliasisInstaller.php | 9 + .../src/Composer/Installers/Installer.php | 8 + .../src/Composer/Installers/ItopInstaller.php | 9 + .../Composer/Installers/KanboardInstaller.php | 18 + .../Composer/Installers/LavaLiteInstaller.php | 10 + .../src/Composer/Installers/MayaInstaller.php | 33 + .../Composer/Installers/MoodleInstaller.php | 1 + .../Composer/Installers/OntoWikiInstaller.php | 24 + .../Composer/Installers/PortoInstaller.php | 9 + .../Composer/Installers/SyDESInstaller.php | 49 + .../Composer/Installers/VgmcpInstaller.php | 49 + .../Installers/Test/InstallerTest.php | 20 +- .../Installers/Test/MayaInstallerTest.php | 61 + .../Installers/Test/OntoWikiInstallerTest.php | 85 + .../Installers/Test/SyDESInstallerTest.php | 81 + .../Installers/Test/VgmcpInstallerTest.php | 79 + plugins/rainlab/user/views/mail/activate.htm | 18 +- plugins/rainlab/user/views/mail/invite.htm | 29 +- plugins/rainlab/user/views/mail/new_user.htm | 22 +- .../rainlab/user/views/mail/reactivate.htm | 12 +- plugins/rainlab/user/views/mail/restore.htm | 36 +- plugins/rainlab/user/views/mail/welcome.htm | 10 +- .../movies/components/ActorForm.php | 28 +- .../movies/components/actorform/default.htm | 10 +- storage/framework/classes.php | 59 + storage/framework/packages.php | 20 + storage/framework/services.php | 197 + 929 files changed, 35856 insertions(+), 8399 deletions(-) create mode 100644 modules/backend/controllers/UserRoles.php create mode 100644 modules/backend/controllers/userroles/_list_toolbar.htm create mode 100644 modules/backend/controllers/userroles/config_form.yaml create mode 100644 modules/backend/controllers/userroles/config_list.yaml create mode 100644 modules/backend/controllers/userroles/create.htm create mode 100644 modules/backend/controllers/userroles/index.htm create mode 100644 modules/backend/controllers/userroles/update.htm create mode 100644 modules/backend/database/migrations/2017_10_01_000010_Db_Backend_User_Roles.php create mode 100644 modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/LICENSE create mode 100644 modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/README.md create mode 100644 modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/spectrum.css create mode 100644 modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/spectrum.js create mode 100644 modules/backend/formwidgets/richeditor/assets/vendor/froala/js/languages/vi.js create mode 100644 modules/backend/lang/be/lang.php create mode 100644 modules/backend/lang/et/lang.php create mode 100644 modules/backend/lang/lt/lang.php create mode 100644 modules/backend/lang/pt-pt/lang.php create mode 100644 modules/backend/models/UserRole.php create mode 100644 modules/backend/models/userrole/columns.yaml create mode 100644 modules/backend/models/userrole/fields.yaml create mode 100644 modules/backend/traits/ErrorMaker.php create mode 100644 modules/backend/traits/SessionMaker.php create mode 100644 modules/backend/widgets/table/assets/js/table.helper.search.js create mode 100644 modules/cms/assets/css/themelogs/template-diff.css create mode 100644 modules/cms/assets/js/themelogs/template-diff.js create mode 100644 modules/cms/assets/vendor/jsdiff/diff.js create mode 100644 modules/cms/components/Resources.php create mode 100644 modules/cms/components/UnknownComponent.php create mode 100644 modules/cms/components/ViewBag.php create mode 100644 modules/cms/controllers/ThemeLogs.php create mode 100644 modules/cms/controllers/ThemeOptions.php create mode 100644 modules/cms/controllers/themelogs/_field_content.htm create mode 100644 modules/cms/controllers/themelogs/_field_diff_content.htm create mode 100644 modules/cms/controllers/themelogs/_field_diff_template.htm create mode 100644 modules/cms/controllers/themelogs/_field_template.htm create mode 100644 modules/cms/controllers/themelogs/_hint.htm create mode 100644 modules/cms/controllers/themelogs/_hint_preview.htm create mode 100644 modules/cms/controllers/themelogs/_list_toolbar.htm create mode 100644 modules/cms/controllers/themelogs/_preview_scoreboard.htm create mode 100644 modules/cms/controllers/themelogs/config_form.yaml create mode 100644 modules/cms/controllers/themelogs/config_list.yaml create mode 100644 modules/cms/controllers/themelogs/index.htm create mode 100644 modules/cms/controllers/themelogs/preview.htm create mode 100644 modules/cms/controllers/themeoptions/config_form.yaml create mode 100644 modules/cms/controllers/themeoptions/update.htm create mode 100644 modules/cms/database/migrations/2017_10_01_000003_Db_Cms_Theme_Logs.php create mode 100644 modules/cms/lang/be/lang.php create mode 100644 modules/cms/lang/et/lang.php create mode 100644 modules/cms/lang/lt/lang.php create mode 100644 modules/cms/lang/pt-pt/lang.php create mode 100644 modules/cms/lang/uk/lang.php create mode 100644 modules/cms/models/ThemeLog.php create mode 100644 modules/cms/models/themelog/columns.yaml create mode 100644 modules/cms/models/themelog/fields.yaml create mode 100644 modules/cms/traits/UrlMaker.php create mode 100644 modules/cms/widgets/templatelist/partials/_sorting-options.htm create mode 100644 modules/system/assets/css/mailbrandsettings/mailbrandsettings.css create mode 100644 modules/system/assets/js/lang/lang.be.js create mode 100644 modules/system/assets/js/lang/lang.et.js create mode 100644 modules/system/assets/js/lang/lang.lt.js create mode 100644 modules/system/assets/js/lang/lang.pt-pt.js create mode 100644 modules/system/assets/js/lang/lang.uk.js create mode 100644 modules/system/assets/js/mailbrandsettings/mailbrandsettings.js create mode 100644 modules/system/assets/ui/docs/autocomplete.md create mode 100644 modules/system/assets/ui/js/autocomplete.js create mode 100644 modules/system/assets/ui/less/autocomplete.less create mode 100644 modules/system/classes/MailManager.php create mode 100644 modules/system/classes/SystemController.php create mode 100644 modules/system/controllers/MailBrandSettings.php create mode 100644 modules/system/controllers/MailPartials.php create mode 100644 modules/system/controllers/mailbrandsettings/_field_mail_preview.htm create mode 100644 modules/system/controllers/mailbrandsettings/config_form.yaml create mode 100644 modules/system/controllers/mailbrandsettings/index.htm create mode 100644 modules/system/controllers/mailpartials/config_form.yaml create mode 100644 modules/system/controllers/mailpartials/create.htm create mode 100644 modules/system/controllers/mailpartials/update.htm create mode 100644 modules/system/controllers/mailtemplates/_list_partials_toolbar.htm create mode 100644 modules/system/controllers/mailtemplates/config_partials_list.yaml create mode 100644 modules/system/database/migrations/2017_10_01_000021_Db_System_Sessions_Update.php create mode 100644 modules/system/database/migrations/2017_10_01_000022_Db_Jobs_FailedJobs_Update.php create mode 100644 modules/system/database/migrations/2017_10_01_000023_Db_System_Mail_Partials.php create mode 100644 modules/system/lang/be/client.php create mode 100644 modules/system/lang/be/lang.php create mode 100644 modules/system/lang/be/validation.php create mode 100644 modules/system/lang/et/client.php create mode 100644 modules/system/lang/et/lang.php create mode 100644 modules/system/lang/et/validation.php create mode 100644 modules/system/lang/lt/client.php create mode 100644 modules/system/lang/lt/lang.php create mode 100644 modules/system/lang/lt/validation.php create mode 100644 modules/system/lang/pt-pt/client.php create mode 100644 modules/system/lang/pt-pt/lang.php create mode 100644 modules/system/lang/pt-pt/validation.php create mode 100644 modules/system/lang/uk/client.php create mode 100644 modules/system/lang/uk/lang.php create mode 100644 modules/system/lang/uk/validation.php create mode 100644 modules/system/models/LogSetting.php create mode 100644 modules/system/models/MailBrandSetting.php create mode 100644 modules/system/models/MailPartial.php create mode 100644 modules/system/models/logsetting/fields.yaml create mode 100644 modules/system/models/mailbrandsetting/custom.less create mode 100644 modules/system/models/mailbrandsetting/fields.yaml create mode 100644 modules/system/models/mailbrandsetting/sample_template.htm create mode 100644 modules/system/models/mailpartial/columns.yaml create mode 100644 modules/system/models/mailpartial/fields.yaml create mode 100644 modules/system/traits/EventEmitter.php create mode 100644 modules/system/twig/MailPartialNode.php create mode 100644 modules/system/twig/MailPartialTokenParser.php create mode 100644 modules/system/views/mail/layout-default.htm create mode 100644 modules/system/views/mail/layout-system.htm create mode 100644 modules/system/views/mail/partial-button.htm create mode 100644 modules/system/views/mail/partial-footer.htm create mode 100644 modules/system/views/mail/partial-header.htm create mode 100644 modules/system/views/mail/partial-panel.htm create mode 100644 modules/system/views/mail/partial-promotion.htm create mode 100644 modules/system/views/mail/partial-subcopy.htm create mode 100644 modules/system/views/mail/partial-table.htm create mode 100644 plugins/offline/sitesearch/classes/SearchService.php create mode 100644 plugins/offline/sitesearch/classes/providers/GrakerPhotoAlbumsResultsProvider.php create mode 100644 plugins/offline/sitesearch/components/BaseComponent.php create mode 100644 plugins/offline/sitesearch/components/SearchInput.php create mode 100644 plugins/offline/sitesearch/components/searchinput/autocomplete.htm create mode 100644 plugins/offline/sitesearch/components/searchinput/content.htm create mode 100644 plugins/offline/sitesearch/components/searchinput/default.htm create mode 100644 plugins/offline/sitesearch/components/searchinput/searchresult.htm create mode 100644 plugins/offline/sitesearch/components/searchinput/thumbnail.htm create mode 100644 plugins/offline/sitesearch/phpunit.xml create mode 100644 plugins/offline/sitesearch/tests/classes/ResultTest.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/CHANGELOG.md create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/CONTRIBUTING.md create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php create mode 100644 plugins/offline/sitesearch/vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php create mode 100644 plugins/rainlab/blog/lang/es/lang.php create mode 100644 plugins/rainlab/blog/lang/zh-cn/lang.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/CHANGELOG.md create mode 100644 plugins/rainlab/blog/vendor/composer/installers/CONTRIBUTING.md create mode 100644 plugins/rainlab/blog/vendor/composer/installers/_config.yml create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/EzPlatformInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/LanManagementSystemInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/OsclassInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/UserFrostingInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php create mode 100644 plugins/rainlab/blog/vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php create mode 100644 plugins/rainlab/builder/classes/modelmodel/templates/no-timestamps.php.tpl create mode 100644 plugins/rainlab/builder/classes/modelmodel/templates/soft-delete.php.tpl create mode 100644 plugins/rainlab/pages/formwidgets/MenuItemSearch.php create mode 100644 plugins/rainlab/pages/formwidgets/menuitemsearch/partials/_body.htm create mode 100644 plugins/rainlab/pages/lang/el/lang.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/CHANGELOG.md create mode 100644 plugins/rainlab/pages/vendor/composer/installers/CONTRIBUTING.md create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php create mode 100644 plugins/rainlab/pages/vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php create mode 100644 plugins/rainlab/user/classes/UserEventBase.php create mode 100644 plugins/rainlab/user/lang/it/lang.php create mode 100644 plugins/rainlab/user/lang/pt-pt/lang.php create mode 100644 plugins/rainlab/user/notifyrules/UserActivatedEvent.php create mode 100644 plugins/rainlab/user/notifyrules/UserAttributeCondition.php create mode 100644 plugins/rainlab/user/notifyrules/UserRegisteredEvent.php create mode 100644 plugins/rainlab/user/notifyrules/userattributecondition/attributes.yaml create mode 100644 plugins/rainlab/user/vendor/composer/installers/CHANGELOG.md create mode 100644 plugins/rainlab/user/vendor/composer/installers/CONTRIBUTING.md create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/EliasisInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/ItopInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/LavaLiteInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/OntoWikiInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/PortoInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/SyDESInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/src/Composer/Installers/VgmcpInstaller.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/tests/Composer/Installers/Test/MayaInstallerTest.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/tests/Composer/Installers/Test/OntoWikiInstallerTest.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/tests/Composer/Installers/Test/SyDESInstallerTest.php create mode 100644 plugins/rainlab/user/vendor/composer/installers/tests/Composer/Installers/Test/VgmcpInstallerTest.php create mode 100644 storage/framework/classes.php create mode 100644 storage/framework/packages.php create mode 100644 storage/framework/services.php diff --git a/config/cms.php b/config/cms.php index 7c494e2..ed50173 100644 --- a/config/cms.php +++ b/config/cms.php @@ -24,7 +24,7 @@ | */ - 'edgeUpdates' => false, + 'edgeUpdates' => true, /* |-------------------------------------------------------------------------- diff --git a/modules/backend/ServiceProvider.php b/modules/backend/ServiceProvider.php index 59a1eff..29316b4 100644 --- a/modules/backend/ServiceProvider.php +++ b/modules/backend/ServiceProvider.php @@ -5,7 +5,7 @@ use BackendMenu; use BackendAuth; use Backend\Classes\WidgetManager; -use System\Models\MailTemplate; +use System\Classes\MailManager; use System\Classes\CombineAssets; use System\Classes\SettingsManager; use October\Rain\Support\ModuleServiceProvider; @@ -51,10 +51,10 @@ public function boot() */ protected function registerMailer() { - MailTemplate::registerCallback(function ($template) { - $template->registerMailTemplates([ - 'backend::mail.invite' => 'Invitation for newly created administrators.', - 'backend::mail.restore' => 'Password reset instructions for backend-end administrators.', + MailManager::instance()->registerCallback(function ($manager) { + $manager->registerMailTemplates([ + 'backend::mail.invite', + 'backend::mail.restore', ]); }); } @@ -64,7 +64,7 @@ protected function registerMailer() */ protected function registerAssetBundles() { - CombineAssets::registerCallback(function($combiner) { + CombineAssets::registerCallback(function ($combiner) { $combiner->registerBundle('~/modules/backend/assets/less/october.less'); $combiner->registerBundle('~/modules/backend/assets/js/october.js'); $combiner->registerBundle('~/modules/backend/widgets/table/assets/js/build.js'); @@ -95,7 +95,7 @@ protected function registerBackendNavigation() 'iconSvg' => 'modules/backend/assets/images/dashboard-icon.svg', 'url' => Backend::url('backend'), 'permissions' => ['backend.access_dashboard'], - 'order' => 1 + 'order' => 10 ] ]); }); @@ -107,7 +107,7 @@ protected function registerBackendNavigation() protected function registerBackendReportWidgets() { WidgetManager::instance()->registerReportWidgets(function ($manager) { - $manager->registerReportWidget('Backend\ReportWidgets\Welcome', [ + $manager->registerReportWidget(\Backend\ReportWidgets\Welcome::class, [ 'label' => 'backend::lang.dashboard.welcome.widget_title_default', 'context' => 'dashboard' ]); @@ -198,7 +198,7 @@ protected function registerBackendSettings() 'description' => 'backend::lang.myaccount.menu_description', 'category' => SettingsManager::CATEGORY_MYSETTINGS, 'icon' => 'icon-user', - 'url' => Backend::URL('backend/users/myaccount'), + 'url' => Backend::url('backend/users/myaccount'), 'order' => 500, 'context' => 'mysettings', 'keywords' => 'backend::lang.myaccount.menu_keywords' @@ -208,7 +208,7 @@ protected function registerBackendSettings() 'description' => 'backend::lang.backend_preferences.menu_description', 'category' => SettingsManager::CATEGORY_MYSETTINGS, 'icon' => 'icon-laptop', - 'url' => Backend::URL('backend/preferences'), + 'url' => Backend::url('backend/preferences'), 'permissions' => ['backend.manage_preferences'], 'order' => 510, 'context' => 'mysettings' diff --git a/modules/backend/assets/css/october.css b/modules/backend/assets/css/october.css index efedd37..8ccbe68 100644 --- a/modules/backend/assets/css/october.css +++ b/modules/backend/assets/css/october.css @@ -138,9 +138,9 @@ .control-simplelist.is-scrollable.size-large{min-height:400px} .control-simplelist.is-scrollable.size-huge{min-height:450px} .control-simplelist.is-scrollable.size-giant{min-height:550px} -.control-simplelist.is-divided,.control-simplelist.is-selectable{padding:0} +.control-simplelist.is-divided,.control-simplelist.is-selectable,.control-simplelist.is-selectable-box{padding:0} +.control-simplelist.is-divided li .heading,.control-simplelist.is-selectable li .heading,.control-simplelist.is-selectable-box li .heading{font-size:14px;font-weight:500} .control-simplelist.is-divided li,.control-simplelist.is-selectable li{padding:5px 10px;border-bottom:1px solid #d4d8da} -.control-simplelist.is-divided li .heading,.control-simplelist.is-selectable li .heading{font-size:14px;font-weight:bold} .control-simplelist.is-divided li:last-child,.control-simplelist.is-selectable li:last-child{border-bottom:none} .control-simplelist.is-selectable li a{padding:5px 10px;margin:-5px -10px;display:block;color:#333333} .control-simplelist.is-selectable li:hover{background:#4ea5e0;cursor:pointer} @@ -148,24 +148,35 @@ .control-simplelist.is-selectable li:hover a{text-decoration:none} .control-simplelist.is-selectable li.active a{background:#f0f0f0} .control-simplelist.is-selectable li.active a:hover{background:#4ea5e0} +.control-simplelist.is-selectable-box{padding-top:15px;margin-bottom:0} +.control-simplelist.is-selectable-box li{width:155px;margin:8px;display:inline-block;text-align:center;vertical-align:top} +.control-simplelist.is-selectable-box li a{text-decoration:none;display:block;color:#333333} +.control-simplelist.is-selectable-box li a .box{display:block;width:155px;height:155px;border:3px solid rgba(0,0,0,0.1);position:relative;-webkit-transition:border 0.3s ease;transition:border 0.3s ease} +.control-simplelist.is-selectable-box li a .image{display:block;width:56px;height:56px;position:absolute;top:50%;left:50%;margin-top:-28px;margin-left:-28px} +.control-simplelist.is-selectable-box li a .image > i{font-size:56px;color:rgba(0,0,0,0.25)} +.control-simplelist.is-selectable-box li a .heading{margin:7px 0;padding:0} +.control-simplelist.is-selectable-box li a .description{font-size:12px} +.control-simplelist.is-selectable-box li a:hover .box{border-color:rgba(0,0,0,0.2)} +.control-simplelist.is-selectable-box li a:hover .image > i{color:rgba(0,0,0,0.45)} .list-preview .control-simplelist.is-selectable ul{margin-bottom:0} .drag-noselect{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} .control-scrollbar{position:relative;overflow:hidden;height:100%;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)} .control-scrollbar > div{-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0)} .control-scrollbar > .scrollbar-scrollbar{position:absolute;z-index:100} .control-scrollbar > .scrollbar-scrollbar .scrollbar-track{background-color:transparent;position:relative;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px} -.control-scrollbar > .scrollbar-scrollbar .scrollbar-track .scrollbar-thumb{background-color:#aaaaaa;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;overflow:hidden;position:absolute} +.control-scrollbar > .scrollbar-scrollbar .scrollbar-track .scrollbar-thumb{background-color:rgba(0,0,0,0.35);-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;cursor:pointer;overflow:hidden;position:absolute} .control-scrollbar > .scrollbar-scrollbar.disabled{display:none !important} -.control-scrollbar.vertical > .scrollbar-scrollbar{right:0;width:4px} -.control-scrollbar.vertical > .scrollbar-scrollbar .scrollbar-track{height:100%;width:4px} -.control-scrollbar.vertical > .scrollbar-scrollbar .scrollbar-track .scrollbar-thumb{height:20px;width:4px;top:0;left:0} -.control-scrollbar.vertical > .scrollbar-scrollbar:active,.control-scrollbar.vertical > .scrollbar-scrollbar:hover{width:6px;-webkit-transition:width 0.3s;transition:width 0.3s} -.control-scrollbar.vertical > .scrollbar-scrollbar:active .scrollbar-track,.control-scrollbar.vertical > .scrollbar-scrollbar:hover .scrollbar-track,.control-scrollbar.vertical > .scrollbar-scrollbar:active .scrollbar-thumb,.control-scrollbar.vertical > .scrollbar-scrollbar:hover .scrollbar-thumb{width:6px;-webkit-transition:width 0.3s;transition:width 0.3s} -.control-scrollbar.horizontal > .scrollbar-scrollbar{margin:0 0 5px;clear:both;height:4px} -.control-scrollbar.horizontal > .scrollbar-scrollbar .scrollbar-track{width:100%;height:4px} -.control-scrollbar.horizontal > .scrollbar-scrollbar .scrollbar-track .scrollbar-thumb{height:4px;margin:2px 0;left:0;top:0} -.control-scrollbar.horizontal > .scrollbar-scrollbar:active,.control-scrollbar.horizontal > .scrollbar-scrollbar:hover{height:6px;-webkit-transition:height 0.3s;transition:height 0.3s} -.control-scrollbar.horizontal > .scrollbar-scrollbar:active .scrollbar-track,.control-scrollbar.horizontal > .scrollbar-scrollbar:hover .scrollbar-track,.control-scrollbar.horizontal > .scrollbar-scrollbar:active .scrollbar-thumb,.control-scrollbar.horizontal > .scrollbar-scrollbar:hover .scrollbar-thumb{height:6px;-webkit-transition:height 0.3s;transition:height 0.3s} +.control-scrollbar.vertical > .scrollbar-scrollbar{right:0;margin-right:5px;width:6px} +.control-scrollbar.vertical > .scrollbar-scrollbar .scrollbar-track{height:100%;width:6px} +.control-scrollbar.vertical > .scrollbar-scrollbar .scrollbar-track .scrollbar-thumb{height:20px;width:6px;top:0;left:0} +.control-scrollbar.vertical > .scrollbar-scrollbar:active,.control-scrollbar.vertical > .scrollbar-scrollbar:hover{width:8px;-webkit-transition:width 0.3s;transition:width 0.3s} +.control-scrollbar.vertical > .scrollbar-scrollbar:active .scrollbar-track,.control-scrollbar.vertical > .scrollbar-scrollbar:hover .scrollbar-track,.control-scrollbar.vertical > .scrollbar-scrollbar:active .scrollbar-thumb,.control-scrollbar.vertical > .scrollbar-scrollbar:hover .scrollbar-thumb{width:8px;-webkit-transition:width 0.3s;transition:width 0.3s} +.control-scrollbar.horizontal > .scrollbar-scrollbar{margin:0 0 5px;clear:both;height:6px} +.control-scrollbar.horizontal > .scrollbar-scrollbar .scrollbar-track{width:100%;height:6px} +.control-scrollbar.horizontal > .scrollbar-scrollbar .scrollbar-track .scrollbar-thumb{height:6px;margin:2px 0;left:0;top:0} +.control-scrollbar.horizontal > .scrollbar-scrollbar:active,.control-scrollbar.horizontal > .scrollbar-scrollbar:hover{height:8px;-webkit-transition:height 0.3s;transition:height 0.3s} +.control-scrollbar.horizontal > .scrollbar-scrollbar:active .scrollbar-track,.control-scrollbar.horizontal > .scrollbar-scrollbar:hover .scrollbar-track,.control-scrollbar.horizontal > .scrollbar-scrollbar:active .scrollbar-thumb,.control-scrollbar.horizontal > .scrollbar-scrollbar:hover .scrollbar-thumb{height:8px;-webkit-transition:height 0.3s;transition:height 0.3s} +html.mobile .control-scrollbar{overflow:auto;-webkit-overflow-scrolling:touch} .no-touch .control-scrollbar > .scrollbar-scrollbar{opacity:0;-webkit-transition:opacity 0.3s;transition:opacity 0.3s} .no-touch .control-scrollbar:active > .scrollbar-scrollbar,.no-touch .control-scrollbar:hover > .scrollbar-scrollbar{opacity:1} @media (max-width:768px){.responsive-sidebar > .layout-cell:last-child .control-scrollbar{overflow:visible;height:auto} @@ -221,15 +232,19 @@ .control-filelist.filelist-hero ul li > a span.title{font-size:14px;font-weight:normal;color:#2b3e50} .control-filelist.filelist-hero ul li > a span.description{font-size:13px} .control-filelist.filelist-hero ul li > a .list-icon{position:absolute;left:14px;top:15px;font-size:22px;color:#b7c0c2} -.control-filelist.filelist-hero ul li > a:hover{background:#58b6f7;border-bottom:1px solid #58b6f7 !important} +.control-filelist.filelist-hero ul li > a:hover{background:#4ea5e0;border-bottom:1px solid #4ea5e0 !important} .control-filelist.filelist-hero ul li > a:hover span.title,.control-filelist.filelist-hero ul li > a:hover span.description{color:#ffffff !important} .control-filelist.filelist-hero ul li > a:hover .list-icon{color:#ffffff !important} +.control-filelist.filelist-hero ul li > a:active{background:#3498db;border-bottom:1px solid #3498db !important} +.control-filelist.filelist-hero ul li > a:active span.title,.control-filelist.filelist-hero ul li > a:active span.description{color:#ffffff !important} +.control-filelist.filelist-hero ul li > a:active .list-icon{color:#ffffff !important} .control-filelist.filelist-hero ul li .checkbox{top:-2px;right:0} .control-filelist.filelist-hero ul li.active > a{border-bottom:1px solid #dddddd} .control-filelist.filelist-hero ul li.active > a:after{top:-1px;bottom:-1px;height:auto} .control-filelist.filelist-hero ul li.active > a > span.borders:before{content:' ';position:absolute;width:100%;height:1px;display:block;left:0;background-color:#dddddd} .control-filelist.filelist-hero ul li.active > a > span.borders:before{top:-1px} -.control-filelist.filelist-hero ul li.active > a:hover > span.borders:before{background-color:#58b6f7} +.control-filelist.filelist-hero ul li.active > a:hover > span.borders:before{background-color:#4ea5e0} +.control-filelist.filelist-hero ul li.active > a:active > span.borders:before{background-color:#3498db} .control-filelist.filelist-hero ul li > h4{padding-top:7px;padding-bottom:6px;border-bottom:1px solid #ecf0f1} .control-filelist.filelist-hero ul li > div.controls{display:none;position:absolute;right:16px;top:15px} .control-filelist.filelist-hero ul li > div.controls > a.control{width:16px;height:23px;background:transparent;overflow:hidden;display:inline-block;color:#ffffff !important;padding:0} @@ -240,10 +255,14 @@ .control-filelist.filelist-hero ul li.separator:after{z-index:30;content:'';display:block;width:0;height:0;border-left:8.5px solid transparent;border-right:8.5px solid transparent;border-top:9px solid #95a5a6;border-bottom-width:0;position:absolute;left:14px;bottom:-9px} .control-filelist.filelist-hero ul li.separator h5{color:#2b3e50;font-size:14px;margin:0;font-weight:normal;padding:0} .control-filelist.filelist-hero ul > li.group > ul > li > a{padding-left:66px} -.control-filelist.filelist-hero.single-level ul li:hover{background:#58b6f7} -.control-filelist.filelist-hero.single-level ul li:hover > a{background:#58b6f7;border-bottom:1px solid #58b6f7 !important} +.control-filelist.filelist-hero.single-level ul li:hover{background:#4ea5e0} +.control-filelist.filelist-hero.single-level ul li:hover > a{background:#4ea5e0;border-bottom:1px solid #4ea5e0 !important} .control-filelist.filelist-hero.single-level ul li:hover > a span.title,.control-filelist.filelist-hero.single-level ul li:hover > a span.description{color:#ffffff !important} .control-filelist.filelist-hero.single-level ul li:hover > a .list-icon{color:#ffffff !important} +.control-filelist.filelist-hero.single-level ul li:active{background:#3498db} +.control-filelist.filelist-hero.single-level ul li:active > a{background:#3498db;border-bottom:1px solid #3498db !important} +.control-filelist.filelist-hero.single-level ul li:active > a span.title,.control-filelist.filelist-hero.single-level ul li:active > a span.description{color:#ffffff !important} +.control-filelist.filelist-hero.single-level ul li:active > a .list-icon{color:#ffffff !important} .touch .control-filelist li:not(.active) a:hover{background:transparent} .control-scrollpanel{position:relative;background:#ecf0f1} .control-scrollpanel .control-scrollbar.vertical > .scrollbar-scrollbar{right:0} @@ -305,21 +324,26 @@ .control-treeview ol > li > div > ul.submenu li a{display:block;padding:4px 3px 0 3px;color:#ffffff;text-decoration:none;outline:none} .control-treeview ol > li > div > ul.submenu li a i{margin-right:5px} .control-treeview ol > li > div:hover > ul.submenu{display:block} +.control-treeview ol > li > div:active > ul.submenu{background-position:left -116px} +.control-treeview ol > li > div:active > ul.submenu:before{background-position:left -77px} +.control-treeview ol > li > div:active > ul.submenu:after{background-position:-100px -77px} .control-treeview ol > li > div .checkbox{position:absolute;top:-2px;right:0} .control-treeview ol > li > div .checkbox label{margin-right:0} .control-treeview ol > li > div .checkbox label:before{border-color:#cccccc} -.control-treeview ol > li > div.popover-highlight{background-color:#58b6f7 !important} +.control-treeview ol > li > div.popover-highlight{background-color:#4ea5e0 !important} .control-treeview ol > li > div.popover-highlight:before{background-position:0px -80px} .control-treeview ol > li > div.popover-highlight > a{color:#ffffff !important;cursor:default} .control-treeview ol > li > div.popover-highlight span{color:#ffffff !important} .control-treeview ol > li > div.popover-highlight > ul.submenu,.control-treeview ol > li > div.popover-highlight > span.drag-handle{display:none !important} -.control-treeview ol > li.dragged div,.control-treeview ol > li > div:hover{background-color:#58b6f7 !important} +.control-treeview ol > li.dragged div,.control-treeview ol > li > div:hover{background-color:#4ea5e0 !important} .control-treeview ol > li.dragged div > a,.control-treeview ol > li > div:hover > a{color:#ffffff !important} .control-treeview ol > li.dragged div:before,.control-treeview ol > li > div:hover:before{background-position:0px -80px} .control-treeview ol > li.dragged div:after,.control-treeview ol > li > div:hover:after{top:0 !important;bottom:0 !important} .control-treeview ol > li.dragged div span,.control-treeview ol > li > div:hover span{color:#ffffff !important} .control-treeview ol > li.dragged div span.drag-handle,.control-treeview ol > li > div:hover span.drag-handle{cursor:move;opacity:1;filter:alpha(opacity=100)} .control-treeview ol > li.dragged div span.borders,.control-treeview ol > li > div:hover span.borders{display:none} +.control-treeview ol > li > div:active{background-color:#3498db !important} +.control-treeview ol > li > div:active > a{color:#ffffff !important} .control-treeview ol > li[data-no-drag-mode] div:hover span.drag-handle{cursor:default !important;opacity:0.3 !important;filter:alpha(opacity=30) !important} .control-treeview ol > li.dragged li.has-subitems > div:before,.control-treeview ol > li.dragged.has-subitems > div:before{background-position:0px -52px} .control-treeview ol > li.dragged div > ul.submenu{display:none !important} @@ -386,8 +410,9 @@ .control-treeview ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > div:before{margin-left:100px} .control-treeview ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > ol > li > div > span.expand{left:102px} .control-treeview p.no-data{padding:18px 0;margin:0;color:#666666;font-size:14px;text-align:center;font-weight:400} -.control-treeview a.menu-control{display:block;margin:20px;padding:13px 15px;border:dotted 2px #ebebeb;color:#bdc3c7;font-size:12px;font-weight:600;text-transform:uppercase;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;vertical-align:middle} -.control-treeview a.menu-control:hover{text-decoration:none;background-color:#58b6f7 !important;color:#ffffff !important;border:none;padding:15px 17px} +.control-treeview a.menu-control{display:block;margin:20px;padding:13px 15px;border:dotted 2px #ebebeb;color:#bdc3c7;font-size:12px;font-weight:600;text-transform:uppercase;border-radius:5px;vertical-align:middle} +.control-treeview a.menu-control:hover,.control-treeview a.menu-control:focus{text-decoration:none;background-color:#4ea5e0;color:#ffffff;border:none;padding:15px 17px} +.control-treeview a.menu-control:active{background:#3498db;color:#ffffff} .control-treeview a.menu-control i{margin-right:10px;font-size:14px} .control-treeview.treeview-light{margin-bottom:0;margin-top:20px} .control-treeview.treeview-light ol{background-color:transparent} @@ -418,7 +443,7 @@ body.dragging .control-treeview.treeview-light ol.dragging > li > div,body.dragg .sidenav-tree{width:300px} .sidenav-tree .control-toolbar{padding:0} .sidenav-tree .control-toolbar .toolbar-item{display:block} -.sidenav-tree .control-toolbar input.form-control{border:none;outline:none;padding:12px 13px 13px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:inset -5px 0 3px rgba(0,0,0,0.1);box-shadow:inset -5px 0 3px rgba(0,0,0,0.1)} +.sidenav-tree .control-toolbar input.form-control{border:none;outline:none;padding:12px 13px 13px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:inset -3px 0 3px rgba(0,0,0,0.1);box-shadow:inset -3px 0 3px rgba(0,0,0,0.1)} .sidenav-tree .control-toolbar input.form-control.search{background-position:right -78px} .sidenav-tree ul{padding:0;margin:0;list-style:none} .sidenav-tree div.scrollbar-thumb{background:rgba(0,0,0,0.2) !important} @@ -426,14 +451,12 @@ body.dragging .control-treeview.treeview-light ol.dragging > li > div,body.dragg .sidenav-tree ul.top-level > li[data-status=collapsed] > div.group:before,.sidenav-tree ul.top-level > li[data-status=collapsed] > div.group:after{display:none} .sidenav-tree ul.top-level > li[data-status=collapsed] ul{display:none} .sidenav-tree ul.top-level > li > div.group{position:relative} -.sidenav-tree ul.top-level > li > div.group h3{background:rgba(0,0,0,0.15);color:#ecf0f1;text-transform:uppercase;font-size:15px;padding:15px 15px 15px 40px;margin:0;position:relative;cursor:pointer} +.sidenav-tree ul.top-level > li > div.group h3{background:rgba(0,0,0,0.15);color:#ecf0f1;text-transform:uppercase;font-size:15px;padding:15px 15px 15px 40px;margin:0;position:relative;cursor:pointer;font-weight:400} .sidenav-tree ul.top-level > li > div.group h3:before{display:block;position:absolute;width:10px;height:10px;left:16px;top:15px;color:#cfcfcf;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;content:"\f105";-webkit-transform:rotate(90deg) translate(5px,-3px);-ms-transform:rotate(90deg) translate(5px,-3px);transform:rotate(90deg) translate(5px,-3px);-webkit-transition:all 0.1s ease;transition:all 0.1s ease;font-size:16px} -.sidenav-tree ul.top-level > li > div.group h3:after{content:'';position:absolute;top:0;right:0;width:10px;height:100%;-webkit-box-shadow:inset -5px 0 3px rgba(0,0,0,0.1);box-shadow:inset -5px 0 3px rgba(0,0,0,0.1)} .sidenav-tree ul.top-level > li > div.group:before,.sidenav-tree ul.top-level > li > div.group:after{content:'';display:block;width:0;height:0;border-left:7.5px solid transparent;border-right:7.5px solid transparent;border-top:8px solid #34495e;border-bottom-width:0;position:absolute;left:15px;bottom:-8px;z-index:101} .sidenav-tree ul.top-level > li > div.group:after{content:'';display:block;width:0;height:0;border-left:7.5px solid transparent;border-right:7.5px solid transparent;border-top:8px solid rgba(0,0,0,0.15);border-bottom-width:0} .sidenav-tree ul.top-level > li > ul li a{display:block;position:relative;padding:18px 25px 18px 55px;background:transparent;border-bottom:1px solid rgba(0,0,0,0.15);color:#ffffff;text-decoration:none !important;opacity:0.65;filter:alpha(opacity=65)} -.sidenav-tree ul.top-level > li > ul li a:after{content:'';position:absolute;top:0;right:0;width:10px;height:100%;-webkit-box-shadow:inset -5px 0 3px rgba(0,0,0,0.1);box-shadow:inset -5px 0 3px rgba(0,0,0,0.1)} -.sidenav-tree ul.top-level > li > ul li a:hover{text-decoration:none} +.sidenav-tree ul.top-level > li > ul li a:active,.sidenav-tree ul.top-level > li > ul li a:hover{opacity:1;filter:alpha(opacity=100);text-decoration:none} .sidenav-tree ul.top-level > li > ul li a i{position:absolute;left:16px;top:18px;font-size:22px} .sidenav-tree ul.top-level > li > ul li a span{display:block;line-height:150%} .sidenav-tree ul.top-level > li > ul li a span.header{color:#ffffff;font-size:15px;margin-bottom:5px} @@ -443,8 +466,17 @@ body.dragging .control-treeview.treeview-light ol.dragging > li > div,body.dragg .sidenav-tree ul.top-level > li > ul li.active a{color:rgba(255,255,255,0.91);padding-right:20px} .sidenav-tree ul.top-level > li > ul li.active a span.header{color:#ffffff} .sidenav-tree ul.top-level > li > ul li.active a span.description{color:rgba(255,255,255,0.91)} -.sidenav-tree ul.top-level > li > ul li:last-child a{border-bottom:none} .sidenav-tree .back-link{display:none} +@media (min-width:768px){.sidenav-tree-root .sidenav-tree{width:600px} +.sidenav-tree-root .sidenav-tree ul.top-level > li > ul{font-size:0;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start;align-items:stretch;align-content:stretch} +.sidenav-tree-root .sidenav-tree ul.top-level > li > ul > li{display:inline-block;width:300px} +.sidenav-tree-root .sidenav-tree ul.top-level > li > ul > li a{height:100%} +} +@media (min-width:768px) and (max-width:991px){.sidenav-tree-root .sidenav-tree{width:100%} +.sidenav-tree-root .sidenav-tree ul.top-level > li > ul > li{width:50%} +} +@media (min-width:1200px){.sidenav-tree-root .sidenav-tree{width:900px} +} @media (max-width:768px){.sidenav-tree{width:100%;height:auto !important;display:block !important} .sidenav-tree > .layout{display:none} .sidenav-tree-root .sidenav-tree{width:100% !important;height:100% !important;display:table-cell !important} @@ -503,14 +535,12 @@ div.control-scrollpad > div::-webkit-scrollbar{width:0;height:0} div.control-scrollpad[data-direction=horizontal] > div{overflow-x:scroll;overflow-y:hidden;width:100%} div.control-scrollpad[data-direction=horizontal] > div::-webkit-scrollbar{width:auto;height:0} div.control-scrollpad > .scrollpad-scrollbar{z-index:199;position:absolute;top:0;right:0;bottom:0;width:11px;background-color:transparent;opacity:0;overflow:hidden;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-transition:opacity 0.3s;transition:opacity 0.3s} -div.control-scrollpad > .scrollpad-scrollbar .drag-handle{position:absolute;right:2px;min-height:10px;width:7px;background-color:#aaaaaa;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px} +div.control-scrollpad > .scrollpad-scrollbar .drag-handle{position:absolute;right:2px;min-height:10px;width:7px;background-color:rgba(0,0,0,0.35);-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px} div.control-scrollpad > .scrollpad-scrollbar:hover{opacity:0.7;filter:alpha(opacity=70);-webkit-transition:opacity 0 linear;transition:opacity 0 linear} div.control-scrollpad > .scrollpad-scrollbar[data-visible]{opacity:0.7;filter:alpha(opacity=70)} div.control-scrollpad > .scrollpad-scrollbar[data-hidden]{display:none} div.control-scrollpad[data-direction=horizontal] > .scrollpad-scrollbar{top:auto;left:0;width:auto;height:11px} div.control-scrollpad[data-direction=horizontal] > .scrollpad-scrollbar .drag-handle{right:auto;top:2px;height:7px;min-height:0;min-width:10px;width:auto} -.autocomplete.dropdown-menu{background:white} -.autocomplete.dropdown-menu li a{padding:3px 12px} .svg-icon-container img.svg-icon{display:none} .svg-icon-container.svg-active-effects img.svg-icon{-webkit-filter:grayscale(100%);filter:grayscale(100%);opacity:0.6;filter:alpha(opacity=60)} .svg-icon-container.svg-active-effects:hover img.svg-icon,.svg-icon-container.svg-active-effects.active img.svg-icon{-webkit-filter:none;filter:none;opacity:1;filter:alpha(opacity=100)} @@ -588,25 +618,18 @@ html.svg .svg-icon-container i.svg-replace{display:none} 100%{opacity:0;-webkit-transform:translate3d(0,-100%,0);-ms-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)} } .fadeOutUp{-webkit-animation-name:fadeOutUp;animation-name:fadeOutUp} -body.drag *{cursor:drag !important;cursor:-webkit-grab !important;cursor:-moz-grab !important} +html:not(.mobile) body.drag *{cursor:drag !important;cursor:-webkit-grab !important;cursor:-moz-grab !important} body.dragging,body.dragging *{cursor:move !important} body.loading,body.loading *{cursor:wait !important} body.no-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default !important} html,body{height:100%; } -body{font-family:sans-serif;background:#f9f9f9;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale} +body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";background:#f9f9f9;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale} #layout-canvas{min-height:100%;height:100%} .control-tabs.primary-tabs > ul.nav-tabs,.control-tabs.primary-tabs > div > ul.nav-tabs,.control-tabs.primary-tabs > div > div > ul.nav-tabs{margin-left:-20px;margin-right:-20px} .control-tabs.primary-tabs.tabs-no-inset > ul.nav-tabs,.control-tabs.primary-tabs.tabs-no-inset > div > ul.nav-tabs,.control-tabs.primary-tabs.tabs-no-inset > div > div > ul.nav-tabs{margin-left:0;margin-right:0} .layout{display:table;table-layout:fixed;height:100%;width:100%} .layout > .layout-row{display:table-row;vertical-align:top;height:100%} .layout > .layout-row > .layout-cell{display:table-cell;vertical-align:top;height:100%} -.layout > .layout-row > .layout-cell.width-100{width:100px} -.layout > .layout-row > .layout-cell.width-120{width:120px} -.layout > .layout-row > .layout-cell.width-130{width:130px} -.layout > .layout-row > .layout-cell.width-140{width:140px} -.layout > .layout-row > .layout-cell.width-200{width:200px} -.layout > .layout-row > .layout-cell.width-300{width:300px} -.layout > .layout-row > .layout-cell.width-350{width:350px} .layout > .layout-row > .layout-cell.layout-container,.layout > .layout-row > .layout-cell .layout-container,.layout > .layout-row > .layout-cell.padded-container,.layout > .layout-row > .layout-cell .padded-container{padding:20px 20px 0 20px} .layout > .layout-row > .layout-cell.layout-container .container-flush,.layout > .layout-row > .layout-cell .layout-container .container-flush,.layout > .layout-row > .layout-cell.padded-container .container-flush,.layout > .layout-row > .layout-cell .padded-container .container-flush{padding-top:0} .layout > .layout-row > .layout-cell .layout-relative{position:relative;height:100%} @@ -615,13 +638,6 @@ body{font-family:sans-serif;background:#f9f9f9;-webkit-font-smoothing:antialiase .layout > .layout-row > .layout-cell.min-height{height:0} .layout > .layout-row > .layout-cell.center{text-align:center} .layout > .layout-row > .layout-cell.middle{vertical-align:middle} -.layout > .layout-row > .layout-cell.width-100{width:100px} -.layout > .layout-row > .layout-cell.width-120{width:120px} -.layout > .layout-row > .layout-cell.width-130{width:130px} -.layout > .layout-row > .layout-cell.width-140{width:140px} -.layout > .layout-row > .layout-cell.width-200{width:200px} -.layout > .layout-row > .layout-cell.width-300{width:300px} -.layout > .layout-row > .layout-cell.width-350{width:350px} .layout > .layout-row > .layout-cell.layout-container,.layout > .layout-row > .layout-cell .layout-container,.layout > .layout-row > .layout-cell.padded-container,.layout > .layout-row > .layout-cell .padded-container{padding:20px 20px 0 20px} .layout > .layout-row > .layout-cell.layout-container .container-flush,.layout > .layout-row > .layout-cell .layout-container .container-flush,.layout > .layout-row > .layout-cell.padded-container .container-flush,.layout > .layout-row > .layout-cell .padded-container .container-flush{padding-top:0} .layout > .layout-row > .layout-cell .layout-relative{position:relative;height:100%} @@ -632,13 +648,6 @@ body{font-family:sans-serif;background:#f9f9f9;-webkit-font-smoothing:antialiase .layout > .layout-row > .layout-cell.middle{vertical-align:middle} .layout > .layout-row.min-size{height:0} .layout > .layout-cell{display:table-cell;vertical-align:top;height:100%} -.layout > .layout-cell.width-100{width:100px} -.layout > .layout-cell.width-120{width:120px} -.layout > .layout-cell.width-130{width:130px} -.layout > .layout-cell.width-140{width:140px} -.layout > .layout-cell.width-200{width:200px} -.layout > .layout-cell.width-300{width:300px} -.layout > .layout-cell.width-350{width:350px} .layout > .layout-cell.layout-container,.layout > .layout-cell .layout-container,.layout > .layout-cell.padded-container,.layout > .layout-cell .padded-container{padding:20px 20px 0 20px} .layout > .layout-cell.layout-container .container-flush,.layout > .layout-cell .layout-container .container-flush,.layout > .layout-cell.padded-container .container-flush,.layout > .layout-cell .padded-container .container-flush{padding-top:0} .layout > .layout-cell .layout-relative{position:relative;height:100%} @@ -649,7 +658,7 @@ body{font-family:sans-serif;background:#f9f9f9;-webkit-font-smoothing:antialiase .layout > .layout-cell.middle{vertical-align:middle} .whiteboard{background:white} .layout-fill-container{position:absolute;left:0;top:0;width:100%;height:100%} -.layout-cell.width-fix > form,[data-calculate-width] > form,.layout-cell.width-fix > div,[data-calculate-width] > div{display:inline-block} +[data-calculate-width] > form,[data-calculate-width] > div{display:inline-block} body.compact-container .layout.layout-container,body.compact-container .layout .layout-container{padding:0 !important} body.slim-container .layout.layout-container,body.slim-container .layout .layout-container{padding-left:0 !important;padding-right:0 !important} @media (max-width:768px){.layout .hide-on-small{display:none} @@ -673,17 +682,14 @@ body.slim-container .layout.layout-container,body.slim-container .layout .layout .flex-layout-item.center{-webkit-align-self:center;-moz-align-self:center;-ms-align-self:center;align-self:center} .flex-layout-item.relative{position:relative} .flex-layout-item.layout-container{max-width:none} -.flex-layout-item.width-100{width:100px} -.flex-layout-item.width-200{width:200px} -.flex-layout-item.width-300{width:300px} -body.mainmenu-open{overflow:hidden} +body.mainmenu-open{overflow:hidden;position:fixed} .mainmenu-tooltip .tooltip-inner{font-size:13px;padding:6px 16px} nav#layout-mainmenu{background-color:#000000;padding:0 0 0 20px;line-height:0;white-space:nowrap;vertical-align:top} nav#layout-mainmenu a{text-decoration:none} nav#layout-mainmenu a:focus{background:transparent} nav#layout-mainmenu ul{margin:0;padding:0;list-style:none;float:left;white-space:nowrap;overflow:hidden} nav#layout-mainmenu ul li{color:rgba(255,255,255,0.6);display:inline-block;vertical-align:top;position:relative;margin-right:30px} -nav#layout-mainmenu ul li a{display:inline-block;font-size:14px;color:inherit;outline:none;text-shadow:0 0 2px black;padding:14px 0 10px} +nav#layout-mainmenu ul li a{display:inline-block;font-size:14px;color:inherit;outline:none;padding:14px 0 10px} nav#layout-mainmenu ul li a:hover{background-color:transparent} nav#layout-mainmenu ul li a:active,nav#layout-mainmenu ul li a:focus{text-decoration:none;color:rgba(255,255,255,0.6)} nav#layout-mainmenu ul li a i{line-height:1;font-size:30px;vertical-align:middle} @@ -710,9 +716,9 @@ nav#layout-mainmenu ul li .mainmenu-accountmenu.active{display:block} nav#layout-mainmenu ul li .mainmenu-accountmenu:after{content:'';display:block;width:0;height:0;border-left:8.5px solid transparent;border-right:8.5px solid transparent;border-bottom:7px solid #f9f9f9;right:9px;top:-7px;position:absolute} nav#layout-mainmenu ul li .mainmenu-accountmenu ul{float:none;display:block;overflow:visible} nav#layout-mainmenu ul li .mainmenu-accountmenu li{padding:0;margin:0;font-weight:normal;text-align:left;display:block} -nav#layout-mainmenu ul li .mainmenu-accountmenu li a{display:block;padding:10px 30px;text-align:left;font-size:14px;color:#666666;text-shadow:none} -nav#layout-mainmenu ul li .mainmenu-accountmenu li a:hover,nav#layout-mainmenu ul li .mainmenu-accountmenu li a:focus{background:#4ea5e0;color:#ffffff;text-shadow:0 -1px 0 rgba(0,0,0,0.3)} -nav#layout-mainmenu ul li .mainmenu-accountmenu li a:active{background:#3498db;color:#ffffff;text-shadow:0 -1px 0 rgba(0,0,0,0.3)} +nav#layout-mainmenu ul li .mainmenu-accountmenu li a{display:block;padding:10px 30px;text-align:left;font-size:14px;color:#666666} +nav#layout-mainmenu ul li .mainmenu-accountmenu li a:hover,nav#layout-mainmenu ul li .mainmenu-accountmenu li a:focus{background:#4ea5e0;color:#ffffff} +nav#layout-mainmenu ul li .mainmenu-accountmenu li a:active{background:#3498db;color:#ffffff} nav#layout-mainmenu ul li .mainmenu-accountmenu li:first-child a:hover:after,nav#layout-mainmenu ul li .mainmenu-accountmenu li:first-child a:focus:after,nav#layout-mainmenu ul li .mainmenu-accountmenu li:first-child a:active:after{content:'';display:block;width:0;height:0;border-left:8.5px solid transparent;border-right:8.5px solid transparent;border-bottom:7px solid #4ea5e0;position:absolute;right:9px;top:-7px;z-index:102} nav#layout-mainmenu ul li .mainmenu-accountmenu li:first-child a:active:after{content:'';display:block;width:0;height:0;border-left:8.5px solid transparent;border-right:8.5px solid transparent;border-bottom:7px solid #3498db} nav#layout-mainmenu ul li .mainmenu-accountmenu li.divider{height:1px;width:100%;background-color:#e0e0e0} @@ -740,9 +746,11 @@ nav#layout-mainmenu.navbar-mode-tile ul.mainmenu-nav li:first-child{margin-left: nav#layout-mainmenu.navbar-mode-tile ul.mainmenu-nav li:hover .nav-label{width:auto;min-width:100px;text-overflow:all;overflow:visible;z-index:2} nav#layout-mainmenu.navbar-mode-tile ul.mainmenu-nav li.active:first-child{margin-left:0} nav#layout-mainmenu .menu-toggle{height:45px;line-height:45px;font-size:16px;display:none} -nav#layout-mainmenu .menu-toggle .menu-toggle-icon{background:#333;display:inline-block;height:45px;line-height:45px;width:45px;text-align:center} -nav#layout-mainmenu .menu-toggle .menu-toggle-icon i{line-height:1;font-size:30px;vertical-align:middle} +nav#layout-mainmenu .menu-toggle .menu-toggle-icon{background:#333;display:inline-block;height:45px;line-height:45px;width:45px;text-align:center;opacity:.7} +nav#layout-mainmenu .menu-toggle .menu-toggle-icon i{line-height:45px;font-size:20px;vertical-align:bottom} nav#layout-mainmenu .menu-toggle .menu-toggle-title{margin-left:10px} +nav#layout-mainmenu .menu-toggle:hover .menu-toggle-icon{opacity:1} +body.mainmenu-open nav#layout-mainmenu .menu-toggle-icon{opacity:1} nav#layout-mainmenu.navbar-mode-collapse{padding-left:0;height:45px} nav#layout-mainmenu.navbar-mode-collapse ul.mainmenu-toolbar li.mainmenu-preview a{height:45px;line-height:45px} nav#layout-mainmenu.navbar-mode-collapse ul.mainmenu-toolbar li.mainmenu-account > a{height:45px;line-height:45px} @@ -773,7 +781,7 @@ nav#layout-mainmenu.navbar .menu-toggle{display:inline-block;color:#ffffff !impo .mainmenu-collapsed > div ul.mainmenu-nav li:first-child{margin-left:0} .mainmenu-collapsed > div ul{margin:0;padding:5px 0 15px 15px;overflow:hidden} .mainmenu-collapsed > div ul li{color:rgba(255,255,255,0.6);display:inline-block;vertical-align:top;position:relative;margin-right:30px} -.mainmenu-collapsed > div ul li a{display:inline-block;font-size:14px;color:inherit;outline:none;text-shadow:0 0 2px black} +.mainmenu-collapsed > div ul li a{display:inline-block;font-size:14px;color:inherit;outline:none} .mainmenu-collapsed > div ul li a:hover{background-color:transparent} .mainmenu-collapsed > div ul li a:active,.mainmenu-collapsed > div ul li a:focus{text-decoration:none;color:rgba(255,255,255,0.6)} .mainmenu-collapsed > div ul li a i{line-height:1;font-size:30px;vertical-align:middle} @@ -786,30 +794,34 @@ nav#layout-mainmenu.navbar .menu-toggle{display:inline-block;color:#ffffff !impo .mainmenu-collapsed.scroll-before .scroll-marker.before{display:block} .mainmenu-collapsed.scroll-after .scroll-marker.after{display:block} body.mainmenu-open .mainmenu-collapsed ul{position:absolute;left:0;top:10px;bottom:10px} +html.mobile .mainmenu-collapsed ul{overflow:auto;-webkit-overflow-scrolling:touch} nav#layout-mainmenu.navbar ul li:hover a:active,.mainmenu-collapsed li:hover a:active,nav#layout-mainmenu.navbar ul li:hover a:focus,.mainmenu-collapsed li:hover a:focus{color:#ffffff !important} .touch .mainmenu-collapsed li a:hover{color:rgba(255,255,255,0.6)} nav#layout-mainmenu.navbar ul li.highlight > a,.mainmenu-collapsed li.highlight > a{color:#ffffff !important} nav#layout-mainmenu.navbar ul li.active,.mainmenu-collapsed li.active{color:#ffffff !important} nav#layout-mainmenu.navbar ul li.active a,.mainmenu-collapsed li.active a{color:#ffffff !important} -nav#layout-mainmenu.navbar ul li.active a .nav-label,.mainmenu-collapsed li.active a .nav-label{text-shadow:none} nav#layout-mainmenu.navbar ul li:hover,.mainmenu-collapsed li:hover{color:#ffffff;background:transparent} body.drag nav#layout-mainmenu.navbar ul.nav li:hover,body.drag .mainmenu-collapsed ul li:hover{color:rgba(255,255,255,0.6)} -body.drag nav#layout-mainmenu.navbar ul.nav li a:active .nav-label,body.drag .mainmenu-collapsed ul li a:active .nav-label,body.drag nav#layout-mainmenu.navbar ul.nav li a:focus .nav-label,body.drag .mainmenu-collapsed ul li a:focus .nav-label{text-shadow:none} -#layout-sidenav{position:absolute;height:100%;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} +.layout-sidenav-container{width:120px} +#layout-sidenav{position:absolute;height:100%;width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;font-size:14px} #layout-sidenav ul{position:relative;margin:0;padding:0;height:100%;overflow:hidden} -#layout-sidenav ul:after{content:'';position:absolute;height:100%;top:0;right:0;width:10px;-webkit-box-shadow:inset -5px 0 3px rgba(0,0,0,0.1);box-shadow:inset -5px 0 3px rgba(0,0,0,0.1)} #layout-sidenav ul li{display:block;text-align:center;position:relative} -#layout-sidenav ul li a{padding:20px 10px;display:block;font-size:13px;color:rgba(255,255,255,0.6);font-weight:normal;position:relative} +#layout-sidenav ul li a{padding:1.429em .714em;display:block;font-size:.929em;color:rgba(255,255,255,0.6);font-weight:normal;position:relative} #layout-sidenav ul li a:hover{text-decoration:none;background-color:transparent} #layout-sidenav ul li a:focus{background:transparent} -#layout-sidenav ul li a i{color:rgba(255,255,255,0.6);display:block;margin-bottom:5px;font-size:28px} -#layout-sidenav ul li a .nav-label,#layout-sidenav ul li a .nav-icon{text-shadow:0 -1px 0 rgba(0,0,0,0.6)} -#layout-sidenav ul li:first-child a{padding-top:30px} +#layout-sidenav ul li a i{color:rgba(255,255,255,0.6);display:block;margin-bottom:5px;font-size:2em} +#layout-sidenav ul li:first-child a{padding-top:2.143em} #layout-sidenav ul li.active a,#layout-sidenav ul li a:hover{color:#ffffff} #layout-sidenav ul li.active a i,#layout-sidenav ul li a:hover i{color:#ffffff} -#layout-sidenav ul li.active a .nav-label,#layout-sidenav ul li.active a .nav-icon{text-shadow:0 -1px 0 rgba(0,0,0,0.3)} -#layout-sidenav ul li span.counter{display:block;position:absolute;top:15px;right:15px;padding:2px 6px 3px 4px;background-color:#d9350f;color:#ffffff;font-size:11px;line-height:100%;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;opacity:1;filter:alpha(opacity=100);-webkit-transform:scale(1,);-ms-transform:scale(1,);transform:scale(1,);-webkit-transition:all 0.3s;transition:all 0.3s} +#layout-sidenav ul li span.counter{display:block;position:absolute;top:1.071em;right:1.071em;padding:.143em .429em .214em .286em;background-color:#d9350f;color:#ffffff;font-size:.786em;line-height:100%;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;opacity:1;filter:alpha(opacity=100);-webkit-transform:scale(1,);-ms-transform:scale(1,);transform:scale(1,);-webkit-transition:all 0.3s;transition:all 0.3s} #layout-sidenav ul li span.counter.empty{opacity:0;filter:alpha(opacity=0);-webkit-transform:scale(0,);-ms-transform:scale(0,);transform:scale(0,)} +@media (min-width:768px) and (max-width:991px){#layout-sidenav{font-size:12px} +.layout-sidenav-container{width:100px} +} +@media (max-width:767px){#layout-sidenav{font-size:10px} +.layout-sidenav-container{width:80px} +} +html.mobile #layout-sidenav ul{overflow:auto;-webkit-overflow-scrolling:touch} #layout-sidenav.layout-sidenav ul.drag li:not(.active) a:hover,.touch #layout-sidenav.layout-sidenav li:not(.active) a:hover{color:rgba(255,255,255,0.6) !important} #layout-sidenav.layout-sidenav ul.drag li:not(.active) a:hover i,.touch #layout-sidenav.layout-sidenav li:not(.active) a:hover i{color:rgba(255,255,255,0.6) !important} #layout-sidenav.layout-sidenav ul.drag li:not(.active) a:hover:after,.touch #layout-sidenav.layout-sidenav li:not(.active) a:hover:after{display:none !important} @@ -822,7 +834,7 @@ body.drag nav#layout-mainmenu.navbar ul.nav li a:active .nav-label,body.drag .ma #layout-side-panel .sidepanel-content-header:after{content:'';display:block;width:0;height:0;border-left:7.5px solid transparent;border-right:7.5px solid transparent;border-top:8px solid #d35400;border-bottom-width:0;position:absolute;left:14px;bottom:-8px} body.side-panel-not-fixed #layout-side-panel{display:none} body.side-panel-not-fixed #layout-side-panel .fix-button{opacity:0.5;filter:alpha(opacity=50)} -body.display-side-panel #layout-side-panel{display:block;position:absolute;z-index:600;width:350px;-webkit-box-shadow:2px 0px 2px 0 rgba(0,0,0,0.3);box-shadow:2px 0px 2px 0 rgba(0,0,0,0.3)} +body.display-side-panel #layout-side-panel{display:block;position:absolute;z-index:600;width:350px;-webkit-box-shadow:3px 0px 3px 0 rgba(0,0,0,0.1);box-shadow:3px 0px 3px 0 rgba(0,0,0,0.1)} @media (min-width:992px){body.side-panel-fix-shadow #layout-side-panel{-webkit-box-shadow:none;box-shadow:none} } .touch #layout-side-panel .fix-button{display:none} @@ -837,17 +849,15 @@ body.display-side-panel #layout-side-panel{display:block;position:absolute;z-ind body.outer{background:#2b3e50} body.outer .layout > .layout-row.layout-head{text-align:center;background:#f9f9f9} body.outer .layout > .layout-row.layout-head > .layout-cell{height:40%;padding:50px 0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;vertical-align:middle;position:relative} -body.outer .layout > .layout-row.layout-head > .layout-cell:after{content:'';display:block;width:0;height:0;border-left:35px solid transparent;border-right:35px solid transparent;border-top:25px solid #f9f9f9;border-bottom-width:0;position:absolute;bottom:-25px;left:50%;margin-left:-22px} +body.outer .layout > .layout-row.layout-head > .layout-cell:after{content:'';display:block;width:0;height:0;border-left:28px solid transparent;border-right:28px solid transparent;border-top:20px solid #f9f9f9;border-bottom-width:0;position:absolute;bottom:-20px;left:50%;margin-left:-28px} body.outer .layout > .layout-row.layout-head > .layout-cell h1.oc-logo{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;display:inline-block;width:100%;max-width:450px;height:170px;min-height:72px} body.outer .layout > .layout-row > .layout-cell{vertical-align:top} body.outer .layout > .layout-row > .layout-cell .outer-form-container{margin:0 auto;width:436px;padding:40px 0} body.outer .layout > .layout-row > .layout-cell .outer-form-container h2{font-size:18px;margin:20px 0;color:#feffff} -body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form{font-size:0} +body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form{font-size:0;display:-webkit-box;display:-webkit-flex;display:-moz-flex;display:-ms-flexbox;display:-ms-flex;display:flex} body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form input{vertical-align:top;margin-right:9px;display:inline-block;border:none;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px} -body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form input.width-1{width:160px} -body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form input.width-2{width:323px} body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form button{background:#0181b9;text-align:center;font-size:13px;font-weight:600;height:40px;vertical-align:top;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box} -body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form button.login-button{display:inline-block;width:98px} +body.outer .layout > .layout-row > .layout-cell .outer-form-container .remember label{color:rgba(255,255,255,0.44)} body.outer .layout > .layout-row > .layout-cell .outer-form-container .forgot-password{margin-top:30px;font-size:13px;top:8px} body.outer .layout > .layout-row > .layout-cell .outer-form-container .forgot-password a{color:rgba(255,255,255,0.44)} body.outer .layout > .layout-row > .layout-cell .outer-form-container .forgot-password:before{color:rgba(255,255,255,0.44);font-size:14px;position:relative;margin-right:5px} @@ -855,8 +865,17 @@ html.csstransitions body.outer .outer-form-container{-webkit-transition:all 0.5s html.csstransitions body.outer.preload .outer-form-container{-webkit-transform:scale(0.2,0.2);-moz-transform:scale(0.2,0.2);-ms-transform:scale(0.2,0.2);-o-transform:scale(0.2,0.2);transform:scale(0.2,0.2)} @media (max-width:768px){body.outer .layout > .layout-row.layout-head > .layout-cell{padding:50px 20px} body.outer .layout > .layout-row > .layout-cell .outer-form-container{width:auto;padding:40px} +body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form{display:block} body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizontal-form input{display:block;width:100% !important;margin-bottom:20px} } +body.breadcrumb-fancy .control-breadcrumb,.control-breadcrumb.breadcrumb-fancy{margin-bottom:0;background-color:#e67e22} +body.breadcrumb-fancy .control-breadcrumb li,.control-breadcrumb.breadcrumb-fancy li{background-color:#d35400;color:rgba(255,255,255,0.5)} +body.breadcrumb-fancy .control-breadcrumb li a,.control-breadcrumb.breadcrumb-fancy li a{opacity:.5;-webkit-transition:all 0.3s ease;transition:all 0.3s ease} +body.breadcrumb-fancy .control-breadcrumb li a:hover,.control-breadcrumb.breadcrumb-fancy li a:hover{opacity:1} +body.breadcrumb-fancy .control-breadcrumb li:before,.control-breadcrumb.breadcrumb-fancy li:before{border-left-color:#ffffff;opacity:.5} +body.breadcrumb-fancy .control-breadcrumb li:after,.control-breadcrumb.breadcrumb-fancy li:after{border-left-color:#d35400} +body.breadcrumb-fancy .control-breadcrumb li:last-child,.control-breadcrumb.breadcrumb-fancy li:last-child{background-color:#d35400} +body.breadcrumb-fancy .control-breadcrumb li:last-child:before,.control-breadcrumb.breadcrumb-fancy li:last-child:before{opacity:1;border-left-color:#d35400} .fancy-layout .tab-collapse-icon{position:absolute;display:block;text-decoration:none;outline:none;opacity:0.6;filter:alpha(opacity=60);-webkit-transition:all 0.3s;transition:all 0.3s;font-size:12px;color:#ffffff;right:11px} .fancy-layout .tab-collapse-icon:hover{text-decoration:none;opacity:1;filter:alpha(opacity=100)} .fancy-layout .tab-collapse-icon.primary{color:#475354;bottom:-25px;z-index:100;-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)} @@ -870,7 +889,7 @@ body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizonta .fancy-layout .control-tabs.master-tabs > div > div.tabs-container,.fancy-layout.control-tabs.master-tabs > div > div.tabs-container{background:#d35400;padding-left:20px;padding-right:20px} .fancy-layout .control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs,.fancy-layout.control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs{margin-left:-8px} .fancy-layout .control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li,.fancy-layout.control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li{margin-left:-5px;top:1px;padding-top:3px} -.fancy-layout .control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li span.tab-close,.fancy-layout.control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li span.tab-close{top:14px;right:-3px;left:auto;z-index:110} +.fancy-layout .control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li span.tab-close,.fancy-layout.control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li span.tab-close{top:14px;right:-3px;left:auto;z-index:110;font-family:sans-serif} .fancy-layout .control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li span.tab-close i,.fancy-layout.control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li span.tab-close i{top:4px;right:1px;color:rgba(255,255,255,0.3) !important;font-style:normal;font-weight:bold;font-size:16px} .fancy-layout .control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li span.tab-close i:hover,.fancy-layout.control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li span.tab-close i:hover{color:#ffffff !important} .fancy-layout .control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li a,.fancy-layout.control-tabs.master-tabs > div > div.tabs-container > ul.nav-tabs > li a{border-bottom:none;background:transparent;font-size:14px;color:rgba(255,255,255,0.35);padding:6px 0 0 24px!important;overflow:visible} @@ -923,8 +942,8 @@ body.outer .layout > .layout-row > .layout-cell .outer-form-container .horizonta .fancy-layout .control-tabs.secondary-tabs.secondary-content-tabs.primary-collapsed > div > ul.nav-tabs > li a,.fancy-layout.control-tabs.secondary-tabs.secondary-content-tabs.primary-collapsed > div > ul.nav-tabs > li a{color:white} .fancy-layout .control-tabs.secondary-tabs.secondary-content-tabs.primary-collapsed > div > ul.nav-tabs > li a > span.title:before,.fancy-layout.control-tabs.secondary-tabs.secondary-content-tabs.primary-collapsed > div > ul.nav-tabs > li a > span.title:before,.fancy-layout .control-tabs.secondary-tabs.secondary-content-tabs.primary-collapsed > div > ul.nav-tabs > li a > span.title:after,.fancy-layout.control-tabs.secondary-tabs.secondary-content-tabs.primary-collapsed > div > ul.nav-tabs > li a > span.title:after{background-color:white} .fancy-layout .control-tabs.secondary-tabs.secondary-content-tabs.primary-collapsed > div > ul.nav-tabs > li.active a,.fancy-layout.control-tabs.secondary-tabs.secondary-content-tabs.primary-collapsed > div > ul.nav-tabs > li.active a{color:#2b3e50} +.fancy-layout .control-tabs.primary-tabs.master-area > div > ul.nav-tabs,.fancy-layout.control-tabs.primary-tabs.master-area > div > ul.nav-tabs{-webkit-transition:background-color 0.5s;transition:background-color 0.5s;background:#e67e22} .fancy-layout .control-tabs.primary-tabs > div > ul.nav-tabs,.fancy-layout.control-tabs.primary-tabs > div > ul.nav-tabs{background:#7f8c8d;margin-left:0 !important;margin-right:0 !important} -.fancy-layout .control-tabs.primary-tabs > div > ul.nav-tabs.master-area,.fancy-layout.control-tabs.primary-tabs > div > ul.nav-tabs.master-area{-webkit-transition:background-color 0.5s;transition:background-color 0.5s;background:#e67e22} .fancy-layout .control-tabs.primary-tabs > div > ul.nav-tabs:before,.fancy-layout.control-tabs.primary-tabs > div > ul.nav-tabs:before{display:none} .fancy-layout .control-tabs.primary-tabs > div > ul.nav-tabs > li,.fancy-layout.control-tabs.primary-tabs > div > ul.nav-tabs > li{background:transparent;border-right:none;margin-right:-8px} .fancy-layout .control-tabs.primary-tabs > div > ul.nav-tabs > li:first-child,.fancy-layout.control-tabs.primary-tabs > div > ul.nav-tabs > li:first-child{margin-left:-5px} diff --git a/modules/backend/assets/images/treeview-submenu-tabs.png b/modules/backend/assets/images/treeview-submenu-tabs.png index 4260a5ae88be69b980ff83c5c84f44963a429397..6c39867bada1d1380af79023b63857b8d905e2e8 100644 GIT binary patch literal 2714 zcmb`JS5y;N9>#Boir_FvK$<8ZQiLEul#ZyN2%$;~RRjg;CDhPjLsRrM`bKV7VlA>dy56%N>nP4dKn9Il)Nby>UL^#j+*D+MI%xhu$6EUDFKk zy&}wz!5*7UL6@J!t^qx`_kAgda^#FH+?A!7`XTZ)#5Xp8?buWg-n4mlcEKD9rnYZ; zf#8-Ye+{ENWEh(9k2_y91y{mu@wYU#@AxZ4`^dGf=|Y+TF#R0?QY9^gN1)4z_ZF<} z^&St~o8t_C^SE;dBK)Tyt&f=cdw7Yrf{Rp^9^C(P>#8Gp=y~%7JUQ5W(eTatQXmu7{J$)#&s5Tp94IdT>oA{ZCHcb)a3OOg$<3) zyZhA;)1O5eCx+6eq>%lmZd%?*K(5i^_^u~RQ%%iYf#)r5E zY`j3b?|dCs&4rJ!Kt-nTl8{~r?>_3{!9?2;@UeVqiqrZZx^tp=Vk!1BM!T-OvJI|H zIkD4^@(WJ~p`QmV>SIQ}*8LHqeReTRyz9IXt4pJ0TpaCIx9DW&dRVj%CH#q6(9OROrU zqiADXI9=a|A|RhkOhZJqiJP{ctVFVY(XZKLWjsGbo2xs zfm%3^tS`Uwl2;-Z7>Wp8sj}^v-~d5Hq~ImLfdk-kMmQ=5RZ- z6534lEg52^P#WMXqMd}IqM%UQqHpv0z8fQEW#0@MfXAQ^=x_-1lAfaUz}F^^ueedk zizCSr=G(px>*t)=zP&^$V(Z4VeuG9@i2eT&^aJ&C-kGkLCC~vz(o)>3YjC$5zH>5U!#@Te%26GHVWK~foS@;{& z0eXe!N~s6e(ebBqNoy-%s{&XEq2Z>Erw?Z3V}bts5$qW(OLc_4MIuh=E{0xX^|fjt zml66QK$d(RgbezDii&#$1)dkIHPF_?IBOiO>&JGrI7-hVNXBhdM9)L8*&WCLdw_bA zRc(bQ*}fndxaYR@Jdhz)W#-W*o84OOxt6+Dw9T`2Nj7-)oR+)0S%lXP%|y{H%LL;o z5ZjPuc5JFphS++qV(Ieijra(XTfdA2>p9ecBi8!b_3vlf^RlWx-1o9r8mis!&g*?^$mKlnI-2ka;x(+5>Tr!5g=0I+&Hm1n?u2aNBHf-|`o-rydV9g;O zbRGSct8C5NG?$V*HsF$Z8ws6)(O|sqU(4oWx9Rf+P!PQq@BJ^HsbPAJgOZ-+wBQg? z=rjg(!>SS;Qcxx$q7;2;#rY*_ZJic54wVb@SCD)C&a+gSECJBjnev#hKY6ykwLyA- z`DlDO1vQ^&#FHseMhaJ_o`+LA`Wh7@UcKX&hMO^~iZn_9wNb+iRgithbmJ5b!mm@@ z7X-Ho5+w>;#WCg(0K1~=>^Qhi2*H=AAv9d}liJ@`NCXWR4sNlE*NvZhUg1Cb!2jN% zx{FOatGJ^u^~8*HL|AF_YQR=~|0cUwU16*U`F41SD1yv_jTxkQmD&h6v8iR)GqG0L zKPvM0SrVMV&&M#6oi3d@*aw$88k4wsUg(vsO735b!;e;tcfF5wyl}!-aSqkmadyh1 zgD53o$}zbP+3IoaJ>;ErSf_-tWc8&(8_hj`{{E?A&F*&SMEve$M%OyQ9A7z&zfmOC zWTeq&Cps}0J&Yp_R$*+3>fB)mawL)(+|{Lg=KbbFLg5b;De~pO%lsx`gbV^A>Ycc0 zKKxmf>6WsRN)Ds;H@u@Jf^7XngKlshl(vpn#iP=E@zn~-j`u!>?iw_7a|0tIZ(|%q zxp?gRr`c!U-z;Thn%)iJ3}2Le&J4($FY&7+C*5KFveL#u$b|M=JvxehA~H7klTcA( z{mB(+(hbe~t6`I;a3rsx4;hk1YJl)!aowzsw1te(IZ21GT8|!W=d`pa0H|{4gXcpN?Q67G7jjO5CxCrmN8U=8eJp`W8h5_b z>nC=RZtrV{^x?WCpn>`B8Fy9jE&59ms-#<9~MLo({BG_j4X&DMERn7H~uHt)FXC}Aq5@( ze`sTpXO5RVX^8NHYt1$+s9 W%d8tG7McG_pnKg=`?qTjxPJmA&?X}Q literal 1341 zcmeAS@N?(olHy`uVBq!ia0vp^6+rCE!3-p$cmw`1FfdLH@Ck8k=;{6c|38p~qnw3@ z;A{w^eCkp(5hA$}+rC3oVwwpQubMO$(;T=KG^zUDez-{LiYst7CL?eDKA>Q2|5UhC z4lbCp4Z;PwCuQaJs!4Nz z+}I5-fXY%<-AG%05h4rpZ}O^}(VN~yZTSrJ5d=kT`4qe1Wz43x@#~+(Y7QiHC*5b;24C78h36qfN0J7c7d{ z(7*Tk#_#X!zWb@Y>f7|s``tY8AOGf97O!~KeZP{?NJ)t!clHs zLqpSs2Xjnn;usWJ1#MlVkK!MLvuE`h{Xw6tU0u2>6ccOKS5a! zO(RO)Om6uu`^Y+{blZfM=s97cZ9OMneVRM5`FxGu>dr=yC6*Ue&rfPjPn~|^;smCS ztvkF<$$K8`f2yj--F@Zck+kJ9ca&M*v!*VWbQVpk@Z|ftZ&G7?wezMU##%fA>Dqk9 z{7xQNzA<5Aud_p|qL^*!MoXg)F>B5!C#^Wx^B`Ub5@ZNm`#`#e1G??=`0ibiOvcIvF@Wu8zXdp zRP1X8#RS2&n+a diff --git a/modules/backend/assets/js/backend.js b/modules/backend/assets/js/backend.js index 4ccf339..d21803d 100644 --- a/modules/backend/assets/js/backend.js +++ b/modules/backend/assets/js/backend.js @@ -208,3 +208,31 @@ $.fn.extend({ } }) */ + +/* + * Browser Fixes + * - If another fix using JS is necessary, move this logic to backend.fixes.js + */ + +/* + * Internet Explorer v11 + * - IE11 will not honor height 100% when overflow is used on the Y axis. + */ +if (!!window.MSInputMethodContext && !!document.documentMode) { + $(window).on('resize', function() { + fixMediaManager() + fixSidebar() + }) + + function fixMediaManager() { + var $el = $('div[data-control="media-manager"] .control-scrollpad') + $el.height($el.parent().height()) + } + + function fixSidebar() { + $('#layout-sidenav').height(Math.max( + $('#layout-body').innerHeight(), + $(window).height() - $('#layout-mainmenu').height() + )) + } +} diff --git a/modules/backend/assets/js/october-min.js b/modules/backend/assets/js/october-min.js index 1912b09..3d8b366 100644 --- a/modules/backend/assets/js/october-min.js +++ b/modules/backend/assets/js/october-min.js @@ -670,7 +670,7 @@ return false}) this.wrapper.click(function(){if(self.body.hasClass(self.options.bodyMenuOpenClass)){closeMenu() return false}}) $(window).resize(function(){if(self.body.hasClass(self.options.bodyMenuOpenClass)){if($(window).width()>self.breakpoint){hideMenu()}}}) -this.menuElement.dragScroll({vertical:true,start:function(){self.menuElement.addClass('drag')},stop:function(){self.menuElement.removeClass('drag')},scrollClassContainer:self.menuPanel,scrollMarkerContainer:self.menuContainer}) +this.menuElement.dragScroll({vertical:true,useNative:true,start:function(){self.menuElement.addClass('drag')},stop:function(){self.menuElement.removeClass('drag')},scrollClassContainer:self.menuPanel,scrollMarkerContainer:self.menuContainer}) this.menuElement.on('click',function(){if(self.menuElement.hasClass('drag')) return false}) function hideMenu(){self.body.removeClass(self.options.bodyMenuOpenClass) @@ -691,9 +691,9 @@ if(typeof option=='string')data[option].call($this)})} $.fn.verticalMenu.Constructor=VerticalMenu $.fn.verticalMenu.noConflict=function(){$.fn.verticalMenu=old return this}}(window.jQuery);(function($){$(window).load(function(){$('nav.navbar').each(function(){var -navbar=$(this),nav=$('ul.nav',navbar),collapseMode=navbar.hasClass('navbar-mode-collapse') +navbar=$(this),nav=$('ul.nav',navbar),collapseMode=navbar.hasClass('navbar-mode-collapse'),isMobile=$('html').hasClass('mobile') nav.verticalMenu($('a.menu-toggle',navbar),{breakpoint:collapseMode?Infinity:769}) -$('li.with-tooltip:not(.active) > a',navbar).tooltip({container:'body',placement:'bottom',template:''}) +$('li.with-tooltip:not(.active) > a',navbar).tooltip({container:'body',placement:'bottom',template:''}).on('show.bs.tooltip',function(e){if(isMobile)e.preventDefault()}) $('[data-calculate-width]',navbar).one('oc.widthFixed',function(){var dragScroll=$('[data-control=toolbar]',navbar).data('oc.dragScroll') if(dragScroll){dragScroll.goToElement($('ul.nav > li.active',navbar),undefined,{'duration':0})}})})})})(jQuery);+function($){"use strict";if($.oc===undefined) $.oc={} @@ -703,9 +703,9 @@ this.$list=$('ul',this.$el) this.$items=$('li',this.$list) this.init();} SideNav.DEFAULTS={activeClass:'active'} -SideNav.prototype.init=function(){var self=this;this.$list.dragScroll({vertical:true,start:function(){self.$list.addClass('drag')},stop:function(){self.$list.removeClass('drag')},scrollClassContainer:self.$el,scrollMarkerContainer:self.$el}) -this.$list.on('click',function(){if(self.$list.hasClass('drag')) -return false})} +SideNav.prototype.init=function(){var self=this +this.$list.dragScroll({vertical:true,useNative:true,start:function(){self.$list.addClass('drag')},stop:function(){self.$list.removeClass('drag')},scrollClassContainer:self.$el,scrollMarkerContainer:self.$el}) +this.$list.on('click',function(){if(self.$list.hasClass('drag')){return false}})} SideNav.prototype.unsetActiveItem=function(itemId){this.$items.removeClass(this.options.activeClass)} SideNav.prototype.setActiveItem=function(itemId){if(!itemId){return} this.$items.removeClass(this.options.activeClass).filter('[data-menu-item='+itemId+']').addClass(this.options.activeClass)} @@ -740,9 +740,10 @@ $.fn.sideNav.noConflict=function(){$.fn.sideNav=old return this} $(document).ready(function(){$('[data-control="sidenav"]').sideNav()})}(window.jQuery);+function($){"use strict";var Base=$.oc.foundation.base,BaseProto=Base.prototype var Scrollbar=function(element,options){var -$el=this.$el=$(element),el=$el.get(0),self=this,options=this.options=options||{},sizeName=this.sizeName=options.vertical?'height':'width',isTouch=this.isTouch=Modernizr.touch,isScrollable=this.isScrollable=false,isLocked=this.isLocked=false,eventElementName=options.vertical?'pageY':'pageX',dragStart=0,startOffset=0;$.oc.foundation.controlUtils.markDisposable(element) +$el=this.$el=$(element),el=$el.get(0),self=this,options=this.options=options||{},sizeName=this.sizeName=options.vertical?'height':'width',isNative=$('html').hasClass('mobile'),isTouch=this.isTouch=Modernizr.touch,isScrollable=this.isScrollable=false,isLocked=this.isLocked=false,eventElementName=options.vertical?'pageY':'pageX',dragStart=0,startOffset=0;$.oc.foundation.controlUtils.markDisposable(element) Base.call(this) this.$el.one('dispose-control',this.proxy(this.dispose)) +if(isNative){return} this.$scrollbar=$('
').addClass('scrollbar-scrollbar') this.$track=$('
').addClass('scrollbar-track').appendTo(this.$scrollbar) this.$thumb=$('
').addClass('scrollbar-thumb').appendTo(this.$track) @@ -907,7 +908,7 @@ if(this.pageTitleTemplate===undefined) this.pageTitleTemplate=$title.data('titleTemplate') $title.text(this.pageTitleTemplate.replace('%s',title))} OctoberLayout.prototype.updateLayout=function(title){var $children,$el,fixedWidth,margin -$('.layout-cell.width-fix, [data-calculate-width]').each(function(){$children=$(this).children() +$('[data-calculate-width]').each(function(){$children=$(this).children() if($children.length>0){fixedWidth=0 $children.each(function(){$el=$(this) margin=$el.data('oc.layoutMargin') @@ -917,6 +918,7 @@ fixedWidth+=$el.get(0).offsetWidth+margin}) $(this).width(fixedWidth) $(this).trigger('oc.widthFixed')}})} OctoberLayout.prototype.toggleAccountMenu=function(el){var self=this,$el=$(el),$parent=$(el).parent(),$menu=$el.next() +$el.tooltip('hide') if($menu.hasClass('active')){self.$accountMenuOverlay.remove() $parent.removeClass('highlight') $menu.removeClass('active')} @@ -1071,109 +1073,9 @@ return result?result:this} $.fn.treeListWidget.Constructor=TreeListWidget $.fn.treeListWidget.noConflict=function(){$.fn.treeListWidget=old return this} -$(document).render(function(){$('[data-control="treelist"]').treeListWidget();})}(window.jQuery);!function($){"use strict";var Autocomplete=function(element,options){this.$element=$(element) -this.options=$.extend({},$.fn.autocomplete.defaults,options) -this.matcher=this.options.matcher||this.matcher -this.sorter=this.options.sorter||this.sorter -this.highlighter=this.options.highlighter||this.highlighter -this.updater=this.options.updater||this.updater -this.source=this.options.source -this.$menu=$(this.options.menu) -this.shown=false -this.listen()} -Autocomplete.prototype={constructor:Autocomplete,select:function(){var val=this.$menu.find('.active').attr('data-value') -this.$element.val(this.updater(val)).change() -return this.hide()},updater:function(item){return item},show:function(){var offset=this.options.bodyContainer?this.$element.offset():this.$element.position(),pos=$.extend({},offset,{height:this.$element[0].offsetHeight}),cssOptions={top:pos.top+pos.height,left:pos.left} -if(this.options.matchWidth){cssOptions.width=this.$element[0].offsetWidth} -this.$menu.css(cssOptions) -if(this.options.bodyContainer){$(document.body).append(this.$menu)} -else{this.$menu.insertAfter(this.$element)} -this.$menu.show() -this.shown=true -return this},hide:function(){this.$menu.hide() -this.shown=false -return this},lookup:function(event){var items -this.query=this.$element.val() -if(!this.query||this.query.length'+match+''})},render:function(items){var that=this -items=$(items).map(function(i,item){i=$(that.options.item).attr('data-value',that.itemValue(item)) -i.find('a').html(that.highlighter(that.itemLabel(item))) -return i[0]}) -items.first().addClass('active') -this.$menu.html(items) -return this},next:function(event){var active=this.$menu.find('.active').removeClass('active'),next=active.next() -if(!next.length){next=$(this.$menu.find('li')[0])} -next.addClass('active')},prev:function(event){var active=this.$menu.find('.active').removeClass('active'),prev=active.prev() -if(!prev.length){prev=this.$menu.find('li').last()} -prev.addClass('active')},listen:function(){this.$element.on('focus.autocomplete',$.proxy(this.focus,this)).on('blur.autocomplete',$.proxy(this.blur,this)).on('keypress.autocomplete',$.proxy(this.keypress,this)).on('keyup.autocomplete',$.proxy(this.keyup,this)) -if(this.eventSupported('keydown')){this.$element.on('keydown.autocomplete',$.proxy(this.keydown,this))} -this.$menu.on('click.autocomplete',$.proxy(this.click,this)).on('mouseenter.autocomplete','li',$.proxy(this.mouseenter,this)).on('mouseleave.autocomplete','li',$.proxy(this.mouseleave,this))},eventSupported:function(eventName){var isSupported=eventName in this.$element -if(!isSupported){this.$element.setAttribute(eventName,'return;') -isSupported=typeof this.$element[eventName]==='function'} -return isSupported},move:function(e){if(!this.shown)return -switch(e.keyCode){case 9:case 13:case 27:e.preventDefault() -break -case 38:e.preventDefault() -this.prev() -break -case 40:e.preventDefault() -this.next() -break} -e.stopPropagation()},keydown:function(e){this.suppressKeyPressRepeat=~$.inArray(e.keyCode,[40,38,9,13,27]) -this.move(e)},keypress:function(e){if(this.suppressKeyPressRepeat)return -this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:break -case 9:case 13:if(!this.shown)return -this.select() -break -case 27:if(!this.shown)return -this.hide() -break -default:this.lookup()} -e.stopPropagation() -e.preventDefault()},focus:function(e){this.focused=true},blur:function(e){this.focused=false -if(!this.mousedover&&this.shown)this.hide()},click:function(e){e.stopPropagation() -e.preventDefault() -this.select() -this.$element.focus()},mouseenter:function(e){this.mousedover=true -this.$menu.find('.active').removeClass('active') -$(e.currentTarget).addClass('active')},mouseleave:function(e){this.mousedover=false -if(!this.focused&&this.shown)this.hide()},destroy:function(){this.hide() -this.$element.removeData('autocomplete') -this.$menu.remove() -this.$element.off('.autocomplete') -this.$menu.off('.autocomplete') -this.$element=null -this.$menu=null}} -var old=$.fn.autocomplete -$.fn.autocomplete=function(option){return this.each(function(){var $this=$(this),data=$this.data('autocomplete'),options=typeof option=='object'&&option -if(!data)$this.data('autocomplete',(data=new Autocomplete(this,options))) -if(typeof option=='string')data[option]()})} -$.fn.autocomplete.defaults={source:[],items:8,menu:'',item:'
  • ',minLength:1,bodyContainer:false} -$.fn.autocomplete.Constructor=Autocomplete -$.fn.autocomplete.noConflict=function(){$.fn.autocomplete=old -return this} -$(document).on('focus.autocomplete.data-api','[data-control="autocomplete"]',function(e){var $this=$(this) -if($this.data('autocomplete'))return -$this.autocomplete($this.data())})}(window.jQuery);+function($){"use strict";var SidenavTree=function(element,options){this.options=options +$(document).render(function(){$('[data-control="treelist"]').treeListWidget();})}(window.jQuery);+function($){"use strict";var SidenavTree=function(element,options){this.options=options this.$el=$(element) -this.init();} +this.init()} SidenavTree.DEFAULTS={treeName:'sidenav_tree'} SidenavTree.prototype.init=function(){var self=this $(document.body).addClass('has-sidenav-tree') @@ -1181,17 +1083,18 @@ this.statusCookieName=this.options.treeName+'groupStatus' this.searchCookieName=this.options.treeName+'search' this.$searchInput=$(this.options.searchInput) this.$el.on('click','li > div.group',function(){self.toggleGroup($(this).closest('li')) -return false;});this.$searchInput.on('keyup',function(){self.handleSearchChange()}) +return false}) +this.$searchInput.on('keyup',function(){self.handleSearchChange()}) var searchTerm=$.cookie(this.searchCookieName) if(searchTerm!==undefined&&searchTerm.length>0){this.$searchInput.val(searchTerm) this.applySearch()} var scrollbar=$('[data-control=scrollbar]',this.$el).data('oc.scrollbar'),active=$('li.active',this.$el) -if(active.length>0) -scrollbar.gotoElement(active)} +if(active.length>0){scrollbar.gotoElement(active)}} SidenavTree.prototype.toggleGroup=function(group){var $group=$(group),status=$group.attr('data-status') status===undefined||status=='expanded'?this.collapseGroup($group):this.expandGroup($group)} SidenavTree.prototype.collapseGroup=function(group){var -$list=$('> ul',group),self=this;$list.css('overflow','hidden') +$list=$('> ul',group),self=this +$list.css('overflow','hidden') $list.animate({'height':0},{duration:100,queue:false,complete:function(){$list.css({'overflow':'visible','display':'none'}) $(group).attr('data-status','collapsed') $(window).trigger('oc.updateUi') @@ -1199,32 +1102,30 @@ self.saveGroupStatus($(group).data('group-code'),true)}})} SidenavTree.prototype.expandGroup=function(group,duration){var $list=$('> ul',group),self=this duration=duration===undefined?100:duration -$list.css({'overflow':'hidden','display':'block','height':0}) +$list.css({'overflow':'hidden','display':'','height':0}) $list.animate({'height':$list[0].scrollHeight},{duration:duration,queue:false,complete:function(){$list.css({'overflow':'visible','height':'auto'}) $(group).attr('data-status','expanded') $(window).trigger('oc.updateUi') self.saveGroupStatus($(group).data('group-code'),false)}})} SidenavTree.prototype.saveGroupStatus=function(groupCode,collapsed){var collapsedGroups=$.cookie(this.statusCookieName),updatedGroups=[] -if(collapsedGroups===undefined) -collapsedGroups='' +if(collapsedGroups===undefined){collapsedGroups=''} collapsedGroups=collapsedGroups.split('|') $.each(collapsedGroups,function(){if(groupCode!=this) updatedGroups.push(this)}) -if(collapsed) -updatedGroups.push(groupCode) +if(collapsed){updatedGroups.push(groupCode)} $.cookie(this.statusCookieName,updatedGroups.join('|'),{expires:30,path:'/'})} -SidenavTree.prototype.handleSearchChange=function(){var lastValue=this.$searchInput.data('oc.lastvalue');if(lastValue!==undefined&&lastValue==this.$searchInput.val()) -return +SidenavTree.prototype.handleSearchChange=function(){var lastValue=this.$searchInput.data('oc.lastvalue');if(lastValue!==undefined&&lastValue==this.$searchInput.val()){return} this.$searchInput.data('oc.lastvalue',this.$searchInput.val()) -if(this.dataTrackInputTimer!==undefined) -window.clearTimeout(this.dataTrackInputTimer);var self=this +if(this.dataTrackInputTimer!==undefined){window.clearTimeout(this.dataTrackInputTimer)} +var self=this this.dataTrackInputTimer=window.setTimeout(function(){self.applySearch()},300);$.cookie(this.searchCookieName,$.trim(this.$searchInput.val()),{expires:30,path:'/'})} SidenavTree.prototype.applySearch=function(){var query=$.trim(this.$searchInput.val()),words=query.toLowerCase().split(' '),visibleGroups=[],visibleItems=[],self=this if(query.length==0){$('li',this.$el).removeClass('hidden') return} $('ul.top-level > li',this.$el).each(function(){var $li=$(this) if(self.textContainsWords($('div.group h3',$li).text(),words)){visibleGroups.push($li.get(0)) -$('ul li',$li).each(function(){visibleItems.push(this)})}else{$('ul li',$li).each(function(){if(self.textContainsWords($(this).text(),words)||self.textContainsWords($(this).data('keywords'),words)){visibleGroups.push($li.get(0)) +$('ul li',$li).each(function(){visibleItems.push(this)})} +else{$('ul li',$li).each(function(){if(self.textContainsWords($(this).text(),words)||self.textContainsWords($(this).data('keywords'),words)){visibleGroups.push($li.get(0)) visibleItems.push(this)}})}}) $('ul.top-level > li',this.$el).each(function(){var $li=$(this),groupIsVisible=$.inArray(this,visibleGroups)!==-1 $li.toggleClass('hidden',!groupIsVisible) @@ -1342,4 +1243,9 @@ callback()} img.src=source})}};return o;};assetManager=new AssetManager();if($.oc===undefined) $.oc={} $.oc.escapeHtmlString=function(string){var htmlEscapes={'&':'&','<':'<','>':'>','"':'"',"'":''','/':'/'},htmlEscaper=/[&<>"'\/]/g -return(''+string).replace(htmlEscaper,function(match){return htmlEscapes[match];})} \ No newline at end of file +return(''+string).replace(htmlEscaper,function(match){return htmlEscapes[match];})} +if(!!window.MSInputMethodContext&&!!document.documentMode){$(window).on('resize',function(){fixMediaManager() +fixSidebar()}) +function fixMediaManager(){var $el=$('div[data-control="media-manager"] .control-scrollpad') +$el.height($el.parent().height())} +function fixSidebar(){$('#layout-sidenav').height(Math.max($('#layout-body').innerHeight(),$(window).height()-$('#layout-mainmenu').height()))}} \ No newline at end of file diff --git a/modules/backend/assets/js/october.js b/modules/backend/assets/js/october.js index e964042..ebf91fa 100644 --- a/modules/backend/assets/js/october.js +++ b/modules/backend/assets/js/october.js @@ -29,7 +29,6 @@ =require october.sidepaneltab.js =require october.simplelist.js =require october.treelist.js -=require october.autocomplete.js =require october.sidenav-tree.js =require october.datetime.js diff --git a/modules/backend/assets/js/october.layout.js b/modules/backend/assets/js/october.layout.js index 8cbdd88..3f0af1c 100644 --- a/modules/backend/assets/js/october.layout.js +++ b/modules/backend/assets/js/october.layout.js @@ -15,9 +15,7 @@ OctoberLayout.prototype.updateLayout = function(title) { var $children, $el, fixedWidth, margin - // The entire 'width-fix' class can probably be removed if year >= 2017 - // After checking that it isn't being used anywhere -sg - $('.layout-cell.width-fix, [data-calculate-width]').each(function(){ + $('[data-calculate-width]').each(function(){ $children = $(this).children() if ($children.length > 0) { @@ -46,6 +44,8 @@ $parent = $(el).parent(), $menu = $el.next() + $el.tooltip('hide') + if ($menu.hasClass('active')) { self.$accountMenuOverlay.remove() $parent.removeClass('highlight') diff --git a/modules/backend/assets/js/october.navbar.js b/modules/backend/assets/js/october.navbar.js index bd8ce11..4519e47 100644 --- a/modules/backend/assets/js/october.navbar.js +++ b/modules/backend/assets/js/october.navbar.js @@ -15,7 +15,8 @@ var navbar = $(this), nav = $('ul.nav', navbar), - collapseMode = navbar.hasClass('navbar-mode-collapse') + collapseMode = navbar.hasClass('navbar-mode-collapse'), + isMobile = $('html').hasClass('mobile') nav.verticalMenu($('a.menu-toggle', navbar), { breakpoint: collapseMode ? Infinity : 769 @@ -26,6 +27,9 @@ placement: 'bottom', template: '' }) + .on('show.bs.tooltip', function (e) { + if (isMobile) e.preventDefault() + }) $('[data-calculate-width]', navbar).one('oc.widthFixed', function() { var dragScroll = $('[data-control=toolbar]', navbar).data('oc.dragScroll') diff --git a/modules/backend/assets/js/october.scrollbar.js b/modules/backend/assets/js/october.scrollbar.js index f796cad..26feada 100644 --- a/modules/backend/assets/js/october.scrollbar.js +++ b/modules/backend/assets/js/october.scrollbar.js @@ -25,6 +25,7 @@ self = this, options = this.options = options || {}, sizeName = this.sizeName = options.vertical ? 'height' : 'width', + isNative = $('html').hasClass('mobile'), isTouch = this.isTouch = Modernizr.touch, isScrollable = this.isScrollable = false, isLocked = this.isLocked = false, @@ -38,6 +39,13 @@ this.$el.one('dispose-control', this.proxy(this.dispose)) + /* + * Native (mobile) environments use overflow auto in CSS + */ + if (isNative) { + return + } + /* * Create Scrollbar */ @@ -53,7 +61,6 @@ /* * Bind events */ - if (isTouch) { this.$el.on('touchstart', function (event){ var touchEvent = event.originalEvent; @@ -116,7 +123,7 @@ moveDrag(event) return false }) - + $(window).on('mouseup.scrollbar', function(){ stopDrag() return false diff --git a/modules/backend/assets/js/october.sidenav-tree.js b/modules/backend/assets/js/october.sidenav-tree.js index d0351e0..a4978ba 100644 --- a/modules/backend/assets/js/october.sidenav-tree.js +++ b/modules/backend/assets/js/october.sidenav-tree.js @@ -21,7 +21,7 @@ this.options = options this.$el = $(element) - this.init(); + this.init() } SidenavTree.DEFAULTS = { @@ -32,16 +32,15 @@ var self = this $(document.body).addClass('has-sidenav-tree') - + this.statusCookieName = this.options.treeName + 'groupStatus' this.searchCookieName = this.options.treeName + 'search' this.$searchInput = $(this.options.searchInput) this.$el.on('click', 'li > div.group', function() { self.toggleGroup($(this).closest('li')) - - return false; - }); + return false + }) this.$searchInput.on('keyup', function(){ self.handleSearchChange() @@ -56,38 +55,44 @@ var scrollbar = $('[data-control=scrollbar]', this.$el).data('oc.scrollbar'), active = $('li.active', this.$el) - if (active.length > 0) + if (active.length > 0) { scrollbar.gotoElement(active) + } } SidenavTree.prototype.toggleGroup = function(group) { var $group = $(group), status = $group.attr('data-status') - status === undefined || status == 'expanded' ? - this.collapseGroup($group) : - this.expandGroup($group) + status === undefined || status == 'expanded' + ? this.collapseGroup($group) + : this.expandGroup($group) } SidenavTree.prototype.collapseGroup = function(group) { - var + var $list = $('> ul', group), - self = this; + self = this $list.css('overflow', 'hidden') - $list.animate({'height': 0}, { duration: 100, queue: false, complete: function() { - $list.css({ - 'overflow': 'visible', - 'display': 'none' - }) - $(group).attr('data-status', 'collapsed') - $(window).trigger('oc.updateUi') - self.saveGroupStatus($(group).data('group-code'), true) - } }) + $list.animate({ 'height': 0 }, { + duration: 100, + queue: false, + complete: function() { + $list.css({ + 'overflow': 'visible', + 'display': 'none' + }) + + $(group).attr('data-status', 'collapsed') + $(window).trigger('oc.updateUi') + self.saveGroupStatus($(group).data('group-code'), true) + } + }) } SidenavTree.prototype.expandGroup = function(group, duration) { - var + var $list = $('> ul', group), self = this @@ -95,7 +100,7 @@ $list.css({ 'overflow': 'hidden', - 'display': 'block', + 'display': '', 'height': 0 }) $list.animate({'height': $list[0].scrollHeight}, { duration: duration, queue: false, complete: function() { @@ -113,8 +118,9 @@ var collapsedGroups = $.cookie(this.statusCookieName), updatedGroups = [] - if (collapsedGroups === undefined) + if (collapsedGroups === undefined) { collapsedGroups = '' + } collapsedGroups = collapsedGroups.split('|') $.each(collapsedGroups, function() { @@ -122,8 +128,9 @@ updatedGroups.push(this) }) - if (collapsed) + if (collapsed) { updatedGroups.push(groupCode) + } $.cookie(this.statusCookieName, updatedGroups.join('|'), { expires: 30, path: '/' }) } @@ -131,13 +138,15 @@ SidenavTree.prototype.handleSearchChange = function() { var lastValue = this.$searchInput.data('oc.lastvalue'); - if (lastValue !== undefined && lastValue == this.$searchInput.val()) + if (lastValue !== undefined && lastValue == this.$searchInput.val()) { return + } this.$searchInput.data('oc.lastvalue', this.$searchInput.val()) - if (this.dataTrackInputTimer !== undefined) - window.clearTimeout(this.dataTrackInputTimer); + if (this.dataTrackInputTimer !== undefined) { + window.clearTimeout(this.dataTrackInputTimer) + } var self = this this.dataTrackInputTimer = window.setTimeout(function(){ @@ -160,8 +169,9 @@ return } - // Find visible groups and items - // + /* + * Find visible groups and items + */ $('ul.top-level > li', this.$el).each(function() { var $li = $(this) @@ -171,7 +181,8 @@ $('ul li', $li).each(function(){ visibleItems.push(this) }) - } else { + } + else { $('ul li', $li).each(function(){ if (self.textContainsWords($(this).text(), words) || self.textContainsWords($(this).data('keywords'), words)) { visibleGroups.push($li.get(0)) @@ -181,8 +192,9 @@ } }) - // Hide invisible groups and items - // + /* + * Hide invisible groups and items + */ $('ul.top-level > li', this.$el).each(function() { var $li = $(this), groupIsVisible = $.inArray(this, visibleGroups) !== -1 @@ -253,4 +265,4 @@ $('[data-control=sidenav-tree]').sidenavTree() }) -}(window.jQuery); \ No newline at end of file +}(window.jQuery); diff --git a/modules/backend/assets/js/october.sidenav.js b/modules/backend/assets/js/october.sidenav.js index c33bc11..292caab 100644 --- a/modules/backend/assets/js/october.sidenav.js +++ b/modules/backend/assets/js/october.sidenav.js @@ -35,20 +35,22 @@ } SideNav.prototype.init = function (){ - var self = this; + var self = this this.$list.dragScroll({ vertical: true, - start: function(){ self.$list.addClass('drag') }, - stop: function(){ self.$list.removeClass('drag') }, + useNative: true, + start: function() { self.$list.addClass('drag') }, + stop: function() { self.$list.removeClass('drag') }, scrollClassContainer: self.$el, scrollMarkerContainer: self.$el }) this.$list.on('click', function() { /* Do not handle menu item clicks while dragging */ - if (self.$list.hasClass('drag')) + if (self.$list.hasClass('drag')) { return false + } }) } diff --git a/modules/backend/assets/js/october.verticalmenu.js b/modules/backend/assets/js/october.verticalmenu.js index f5a6d7c..79ecc28 100644 --- a/modules/backend/assets/js/october.verticalmenu.js +++ b/modules/backend/assets/js/october.verticalmenu.js @@ -83,6 +83,7 @@ */ this.menuElement.dragScroll({ vertical: true, + useNative: true, start: function(){self.menuElement.addClass('drag')}, stop: function(){self.menuElement.removeClass('drag')}, scrollClassContainer: self.menuPanel, @@ -155,4 +156,4 @@ return this } -}(window.jQuery); \ No newline at end of file +}(window.jQuery); diff --git a/modules/backend/assets/js/preferences/preferences.js b/modules/backend/assets/js/preferences/preferences.js index 206a48f..9e55335 100644 --- a/modules/backend/assets/js/preferences/preferences.js +++ b/modules/backend/assets/js/preferences/preferences.js @@ -1,4 +1,4 @@ -$(document).ready(function(){ +$(document).ready(function() { var editorEl = $('#editorpreferencesCodeeditor'), editor = editorEl.codeEditor('getEditorObject'), @@ -7,23 +7,23 @@ $(document).ready(function(){ editorEl.height($('#editorSettingsForm').height() - 23) - $('#Form-field-Preferences-editor_theme').on('change', function(){ + $('#Form-field-Preference-editor_theme').on('change', function() { editorEl.codeEditor('setTheme', $(this).val()) }) - $('#Form-field-Preferences-editor_font_size').on('change', function(){ + $('#Form-field-Preference-editor_font_size').on('change', function() { editor.setFontSize(parseInt($(this).val())) }) - $('#Form-field-Preferences-editor_word_wrap').on('change', function(){ + $('#Form-field-Preference-editor_word_wrap').on('change', function() { editorEl.codeEditor('setWordWrap', $(this).val()) }) - $('#Form-field-Preferences-editor_code_folding').on('change', function(){ + $('#Form-field-Preference-editor_code_folding').on('change', function() { session.setFoldStyle($(this).val()) }) - $('#Form-field-Preferences-editor_autocompletion').on('change', function(){ + $('#Form-field-Preference-editor_autocompletion').on('change', function() { editor.setOption('enableBasicAutocompletion', false) editor.setOption('enableLiveAutocompletion', false) @@ -36,37 +36,36 @@ $(document).ready(function(){ } }) - $('#Form-field-Preferences-editor_tab_size').on('change', function(){ + $('#Form-field-Preference-editor_tab_size').on('change', function() { session.setTabSize($(this).val()) }) - $('#Form-field-Preferences-editor_show_invisibles').on('change', function(){ + $('#Form-field-Preference-editor_show_invisibles').on('change', function() { editor.setShowInvisibles($(this).is(':checked')) }) - $('#Form-field-Preferences-editor_enable_snippets').on('change', function(){ + $('#Form-field-Preference-editor_enable_snippets').on('change', function() { editor.setOption('enableSnippets', $(this).is(':checked')) }) - $('#Form-field-Preferences-editor_display_indent_guides').on('change', function(){ + $('#Form-field-Preference-editor_display_indent_guides').on('change', function() { editor.setDisplayIndentGuides($(this).is(':checked')) }) - $('#Form-field-Preferences-editor_show_print_margin').on('change', function(){ + $('#Form-field-Preference-editor_show_print_margin').on('change', function() { editor.setShowPrintMargin($(this).is(':checked')) }) - $('#Form-field-Preferences-editor_highlight_active_line').on('change', function(){ + $('#Form-field-Preference-editor_highlight_active_line').on('change', function() { editor.setHighlightActiveLine($(this).is(':checked')) }) - $('#Form-field-Preferences-editor_use_hard_tabs').on('change', function(){ + $('#Form-field-Preference-editor_use_hard_tabs').on('change', function() { session.setUseSoftTabs(!$(this).is(':checked')) }) - $('#Form-field-Preferences-editor_show_gutter').on('change', function(){ + $('#Form-field-Preference-editor_show_gutter').on('change', function() { renderer.setShowGutter($(this).is(':checked')) }) }) - diff --git a/modules/backend/assets/less/controls/filelist.less b/modules/backend/assets/less/controls/filelist.less index cc9b3de..0a18f93 100644 --- a/modules/backend/assets/less/controls/filelist.less +++ b/modules/backend/assets/less/controls/filelist.less @@ -239,13 +239,25 @@ &.filelist-hero { .a-hover() { background: @color-filelist-hero-hover-bg; - border-bottom: 1px solid @color-filelist-hero-hover-bg!important; + border-bottom: 1px solid @color-filelist-hero-hover-bg !important; span.title, span.description { - color: @color-filelist-hero-hover-text!important; + color: @color-filelist-hero-hover-text !important; } .list-icon { - color: @color-filelist-hero-hover-text!important; + color: @color-filelist-hero-hover-text !important; + } + } + + .a-active() { + background: @color-filelist-hero-active-bg; + border-bottom: 1px solid @color-filelist-hero-active-bg !important; + span.title, span.description { + color: @color-filelist-hero-active-text !important; + } + + .list-icon { + color: @color-filelist-hero-active-text !important; } } @@ -280,6 +292,10 @@ &:hover { .a-hover(); } + + &:active { + .a-active(); + } } .checkbox { @@ -314,6 +330,10 @@ &:hover > span.borders:before { background-color: @color-filelist-hero-hover-bg; } + + &:active > span.borders:before { + background-color: @color-filelist-hero-active-bg; + } } } @@ -394,10 +414,17 @@ .a-hover(); } } + ul li:active { + background: @color-filelist-hero-active-bg; + + > a { + .a-active(); + } + } } } } .touch .control-filelist li:not(.active) a:hover { background: transparent; -} \ No newline at end of file +} diff --git a/modules/backend/assets/less/controls/scrollbar.less b/modules/backend/assets/less/controls/scrollbar.less index 1f0acd8..92f6bd4 100644 --- a/modules/backend/assets/less/controls/scrollbar.less +++ b/modules/backend/assets/less/controls/scrollbar.less @@ -6,6 +6,8 @@ .user-select(none); } +@scrollbar-thumb-size: 6px; + .control-scrollbar { position: relative; overflow: hidden; @@ -32,32 +34,34 @@ position: absolute; } } + &.disabled { - display: none!important; + display: none !important; } } &.vertical { >.scrollbar-scrollbar { right: 0; - width: 4px; + margin-right: 5px; + width: @scrollbar-thumb-size; .scrollbar-track { height: 100%; - width: 4px; + width: @scrollbar-thumb-size; .scrollbar-thumb { height: 20px; - width: 4px; + width: @scrollbar-thumb-size; top: 0; left: 0; } } &:active, &:hover { - width: 6px; + width: @scrollbar-thumb-size + 2px; .transition(width .3s); .scrollbar-track, .scrollbar-thumb { - width: 6px; + width: @scrollbar-thumb-size + 2px; .transition(width .3s); } } @@ -68,24 +72,24 @@ >.scrollbar-scrollbar { margin: 0 0 5px; clear: both; - height: 4px; + height: @scrollbar-thumb-size; .scrollbar-track { width: 100%; - height: 4px; + height: @scrollbar-thumb-size; .scrollbar-thumb { - height: 4px; - margin:2px 0; + height: @scrollbar-thumb-size; + margin: 2px 0; left: 0; top: 0; } } - + &:active, &:hover { - height: 6px; + height: @scrollbar-thumb-size + 2px; .transition(height .3s); .scrollbar-track, .scrollbar-thumb { - height: 6px; + height: @scrollbar-thumb-size + 2px; .transition(height .3s); } } @@ -93,6 +97,13 @@ } } +html.mobile { + .control-scrollbar { + overflow: auto; + -webkit-overflow-scrolling: touch; + } +} + .no-touch .control-scrollbar { >.scrollbar-scrollbar { opacity: 0; diff --git a/modules/backend/assets/less/controls/sidenav-tree.less b/modules/backend/assets/less/controls/sidenav-tree.less index 37a37fe..334eecb 100644 --- a/modules/backend/assets/less/controls/sidenav-tree.less +++ b/modules/backend/assets/less/controls/sidenav-tree.less @@ -1,14 +1,3 @@ -.sidenav-tree-shadow-element() { - content: ''; - position: absolute; - height: 100%; - top: 0; - right: 0; - width: 10px; - height: 100%; - .box-shadow(inset -5px 0 3px rgba(0,0,0,0.1)); -} - .sidenav-tree { width: 300px; @@ -24,7 +13,7 @@ outline: none; padding: 12px 13px 13px; .border-radius(0); - .box-shadow(inset -5px 0 3px rgba(0,0,0,0.1)); + .box-shadow(inset -3px 0 3px rgba(0,0,0,0.1)); &.search { background-position: right -78px; @@ -72,6 +61,7 @@ margin: 0; position: relative; cursor: pointer; + font-weight: 400; &:before { display: block; @@ -86,10 +76,6 @@ .transition(all 0.1s ease); font-size: 16px; } - - &:after { - .sidenav-tree-shadow-element(); - } } // Use two triangles to achieve the darkening effect @@ -117,14 +103,12 @@ background: @color-sidebarnav-tree-inactive-bg; border-bottom: 1px solid @color-sidebarnav-tree-group-bg; color: @color-sidebarnav-tree-inactive-text; - text-decoration: none!important; + text-decoration: none !important; .opacity(.65); - &:after { - .sidenav-tree-shadow-element(); - } - + &:active, &:hover { + .opacity(1); text-decoration: none; } @@ -174,10 +158,9 @@ } } - - &:last-child a { - border-bottom: none; - } + // &:last-child a { + // border-bottom: none; + // } } } } @@ -187,6 +170,48 @@ } } +@media (min-width: @screen-sm-min) { + .sidenav-tree-root .sidenav-tree { + width: 600px; + + ul.top-level > li > ul { + font-size: 0; + display: flex; + flex-direction: row; + flex-wrap: wrap; + justify-content: flex-start; + align-items: stretch; + align-content: stretch; + + > li { + display: inline-block; + // flex-grow: 1; + width: 300px; + + a { + height: 100%; + } + } + } + } +} + +@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { + .sidenav-tree-root .sidenav-tree { + width: 100%; + + ul.top-level > li > ul > li { + width: 50%; + } + } +} + +@media (min-width: @screen-lg-min) { + .sidenav-tree-root .sidenav-tree { + width: 900px; + } +} + @media (max-width: @screen-sm) { .sidenav-tree { width: 100%; diff --git a/modules/backend/assets/less/controls/simplelist.less b/modules/backend/assets/less/controls/simplelist.less index 69eb8a6..919ff49 100644 --- a/modules/backend/assets/less/controls/simplelist.less +++ b/modules/backend/assets/less/controls/simplelist.less @@ -46,6 +46,21 @@ // //
    // +// Selectable (box): +// +// .control-simplelist { font-size: 13px; @@ -125,18 +140,25 @@ } &.is-divided, - &.is-selectable { + &.is-selectable, + &.is-selectable-box { padding: 0; li { - padding: 5px 10px; - border-bottom: 1px solid @color-list-border; .heading { font-size: 14px; - font-weight: bold; + font-weight: 500; } .description {} + } + } + + &.is-divided, + &.is-selectable { + li { + padding: 5px 10px; + border-bottom: 1px solid @color-list-border; &:last-child { border-bottom: none; @@ -170,6 +192,68 @@ } } + &.is-selectable-box { + padding-top: 15px; + margin-bottom: 0; + + li { + width: 155px; + margin: 8px; + display: inline-block; + text-align: center; + vertical-align: top; + + a { + text-decoration: none; + display: block; + color: @text-color; + + .box { + display: block; + width: 155px; + height: 155px; + border: 3px solid rgba(0,0,0,.1); + position: relative; + .transition(border .3s ease); + } + + .image { + display: block; + width: 56px; + height: 56px; + position: absolute; + top: 50%; + left: 50%; + margin-top: -28px; + margin-left: -28px; + + > i { + font-size: 56px; + color: rgba(0,0,0,.25); + } + } + + .heading { + margin: 7px 0; + padding: 0; + } + + .description { + font-size: 12px; + } + + &:hover { + .box { + border-color: rgba(0,0,0,.2); + } + + .image > i { + color: rgba(0,0,0,.45); + } + } + } + } + } } .list-preview .control-simplelist { @@ -178,4 +262,4 @@ margin-bottom: 0; } } -} \ No newline at end of file +} diff --git a/modules/backend/assets/less/controls/treeview.less b/modules/backend/assets/less/controls/treeview.less index 2d5f1df..07f2702 100644 --- a/modules/backend/assets/less/controls/treeview.less +++ b/modules/backend/assets/less/controls/treeview.less @@ -160,6 +160,19 @@ } } + &:active { + > ul.submenu { + background-position: left -116px; + + &:before { + background-position: left -77px; + } + &:after { + background-position: -100px -77px; + } + } + } + .checkbox { position: absolute; top: -2px; @@ -175,19 +188,19 @@ } &.popover-highlight { - background-color: @color-treeview-hover-bg!important; + background-color: @color-treeview-hover-bg !important; &:before { background-position: 0px -80px; } > a { - color: @color-treeview-hover-text!important; + color: @color-treeview-hover-text !important; cursor: default; } span { - color: @color-treeview-hover-text!important; + color: @color-treeview-hover-text !important; } > ul.submenu, > span.drag-handle { @@ -197,10 +210,10 @@ } &.dragged div, > div:hover { - background-color: @color-treeview-hover-bg!important; + background-color: @color-treeview-hover-bg !important; > a { - color: @color-treeview-hover-text!important; + color: @color-treeview-hover-text !important; } &:before { @@ -208,12 +221,12 @@ } &:after { - top: 0!important; - bottom: 0!important; + top: 0 !important; + bottom: 0 !important; } span { - color: @color-treeview-hover-text!important; + color: @color-treeview-hover-text !important; &.drag-handle { cursor: move; @@ -226,6 +239,14 @@ } } + > div:active { + background-color: @color-treeview-active-bg !important; + + > a { + color: @color-treeview-active-text !important; + } + } + &[data-no-drag-mode] div:hover { span.drag-handle { cursor: default!important; @@ -404,17 +425,22 @@ font-size: @font-size-base - 2; font-weight: 600; text-transform: uppercase; - .border-radius(5px); + border-radius: 5px; vertical-align: middle; - &:hover { + &:hover, &:focus { text-decoration: none; - background-color: @color-treeview-hover-bg !important; - color: @color-treeview-hover-text !important; + background-color: @color-treeview-hover-bg; + color: @color-treeview-hover-text; border: none; padding: 15px 17px; } + &:active { + background: @color-treeview-active-bg; + color: @color-treeview-active-text; + } + i { margin-right: 10px; font-size: 14px; diff --git a/modules/backend/assets/less/core/variables.less b/modules/backend/assets/less/core/variables.less index 8ceb853..cf36e59 100644 --- a/modules/backend/assets/less/core/variables.less +++ b/modules/backend/assets/less/core/variables.less @@ -2,7 +2,7 @@ // Override UI variables // -------------------------------------------------- -@font-family-base: sans-serif; +@font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; // // Paths @@ -51,7 +51,7 @@ @color-sidebarnav-back-link-text: #bdc3c7; @color-scrollbar-track: transparent; -@color-scrollbar-thumb: #aaa; +@color-scrollbar-thumb: rgba(0,0,0,.35); @color-scrollpanel-border: #efefef; @color-scrollpanel-fix-button: #aaaaaa; @color-scrollpanel-fix-button-light: #eeeeee; @@ -88,8 +88,10 @@ @color-filelist-cb-border: #cccccc; @color-filelist-title-hero: #2b3e50; @color-filelist-hero-item-bg: #ffffff; -@color-filelist-hero-hover-bg: #58b6f7; -@color-filelist-hero-hover-text: #ffffff; +@color-filelist-hero-hover-bg: @highlight-hover-bg; +@color-filelist-hero-hover-text: @highlight-hover-text; +@color-filelist-hero-active-bg: @highlight-active-bg; +@color-filelist-hero-active-text: @highlight-active-text; @color-fancy-master-tabs-bg: #d35400; @color-fancy-master-tabs-active-text: #ffffff; @@ -125,8 +127,10 @@ @color-treeview-item-title: #2b3e50; @color-treeview-item-comment: #95a5a6; @color-treeview-control: #bdc3c7; -@color-treeview-hover-bg: #58b6f7; -@color-treeview-hover-text: #ffffff; +@color-treeview-hover-bg: @highlight-hover-bg; +@color-treeview-hover-text: @highlight-hover-text; +@color-treeview-active-bg: @highlight-active-bg; +@color-treeview-active-text: @highlight-active-text; @color-treeview-item-active-comment: #8f8f8f; @color-treeview-submenu-text: #ffffff; @color-treeview-light-submenu-bg: #2581b8; diff --git a/modules/backend/assets/less/layout/fancylayout.less b/modules/backend/assets/less/layout/fancylayout.less index 2c3ff4d..37a2587 100644 --- a/modules/backend/assets/less/layout/fancylayout.less +++ b/modules/backend/assets/less/layout/fancylayout.less @@ -1,3 +1,42 @@ +body.breadcrumb-fancy .control-breadcrumb, +.control-breadcrumb.breadcrumb-fancy { + margin-bottom: 0; + + background-color: @color-fancy-form-tabless-fields-bg; + + li { + background-color: @color-fancy-master-tabs-bg; + color: rgba(255,255,255, .5); + + a { + opacity: .5; + .transition(all 0.3s ease); + &:hover { + opacity: 1; + + } + } + + &:before { + border-left-color: @color-fancy-form-text; + opacity: .5; + } + + &:after { + border-left-color: @color-fancy-master-tabs-bg; + } + + &:last-child { + background-color: @color-fancy-master-tabs-bg; + + &:before { + opacity: 1; + border-left-color: @color-fancy-master-tabs-bg; + } + } + } +} + .fancy-layout { // // Fancy form tabs @@ -58,11 +97,12 @@ top: 1px; padding-top: 3px; - span.tab-close{ + span.tab-close { top: 14px; right: -3px; left: auto; z-index: 110; + font-family: sans-serif; i { top: 4px; @@ -74,7 +114,6 @@ &:hover { color: @color-fancy-master-tabs-active-text !important; } } - } a { @@ -359,15 +398,18 @@ } &.primary-tabs { - > div > ul.nav-tabs { - background: @color-fancy-primary-tabs-bg; - margin-left: 0!important; - margin-right: 0!important; - &.master-area { + &.master-area { + > div > ul.nav-tabs { .transition(background-color 0.5s); background: @color-fancy-form-tabless-fields-bg; } + } + + > div > ul.nav-tabs { + background: @color-fancy-primary-tabs-bg; + margin-left: 0!important; + margin-right: 0!important; &:before { display: none; diff --git a/modules/backend/assets/less/layout/flexlayout.less b/modules/backend/assets/less/layout/flexlayout.less index 461751a..fe00e05 100644 --- a/modules/backend/assets/less/layout/flexlayout.less +++ b/modules/backend/assets/less/layout/flexlayout.less @@ -39,17 +39,12 @@ .flex-layout-item { margin: 0; - &.fix {.flex-fix();} - &.stretch {.flex-stretch();} - &.stretch-constrain {.flex-stretch-constrain();} - &.center {.align-self(center);} + &.fix { .flex-fix(); } + &.stretch { .flex-stretch(); } + &.stretch-constrain { .flex-stretch-constrain(); } + &.center { .align-self(center); } - &.relative {position: relative;} + &.relative { position: relative; } - &.layout-container {max-width: none;} - - // @deprecated Remove if year >= 2017 (3 lines below) - &.width-100 {width: 100px;} - &.width-200 {width: 200px;} - &.width-300 {width: 300px;} -} \ No newline at end of file + &.layout-container { max-width: none; } +} diff --git a/modules/backend/assets/less/layout/layout.less b/modules/backend/assets/less/layout/layout.less index a386db6..4d5ad5f 100644 --- a/modules/backend/assets/less/layout/layout.less +++ b/modules/backend/assets/less/layout/layout.less @@ -2,7 +2,7 @@ // Common layout elements // -------------------------------------------------- -body.drag * { +html:not(.mobile) body.drag * { cursor: drag !important; cursor: -webkit-grab !important; cursor: -moz-grab !important; @@ -19,7 +19,7 @@ body.loading, body.loading * { body.no-select { .user-select(none); - cursor: default!important; + cursor: default !important; } // @@ -85,15 +85,6 @@ body { vertical-align: top; height: 100%; - // @deprecated Remove if year >= 2017 (7 lines below) - &.width-100 { width: 100px; } - &.width-120 { width: 120px; } - &.width-130 { width: 130px; } - &.width-140 { width: 140px; } - &.width-200 { width: 200px; } - &.width-300 { width: 300px; } - &.width-350 { width: 350px; } - &.layout-container, .layout-container, &.padded-container, .padded-container { padding: @padding-standard @padding-standard 0 @padding-standard; @@ -171,7 +162,7 @@ body { // Calculated fixed width // -.layout-cell.width-fix, [data-calculate-width] { +[data-calculate-width] { > form, > div { display: inline-block; } @@ -228,4 +219,4 @@ body.slim-container { } } } -} \ No newline at end of file +} diff --git a/modules/backend/assets/less/layout/mainmenu.less b/modules/backend/assets/less/layout/mainmenu.less index 3f20492..1370e3b 100644 --- a/modules/backend/assets/less/layout/mainmenu.less +++ b/modules/backend/assets/less/layout/mainmenu.less @@ -13,6 +13,7 @@ body.mainmenu-open { overflow: hidden; + position: fixed; } .mainmenu-item-link() { @@ -20,7 +21,6 @@ body.mainmenu-open { font-size: @font-size-base; color: inherit; outline: none; - text-shadow: 0 0 2px black; &:hover { background-color: transparent; @@ -277,18 +277,15 @@ nav#layout-mainmenu ul li .mainmenu-accountmenu { text-align: left; font-size: @font-size-base; color: @color-accountmenu-text; - text-shadow: none; &:hover, &:focus { background: @highlight-hover-bg; color: @highlight-hover-text; - text-shadow: 0 -1px 0 @highlight-hover-text-shadow; } &:active { background: @highlight-active-bg; color: @highlight-active-text; - text-shadow: 0 -1px 0 @highlight-active-text-shadow; } } @@ -464,17 +461,32 @@ nav#layout-mainmenu { line-height: @mainmenu-mode-collapse-height; width: @mainmenu-mode-collapse-height; text-align: center; + opacity: .7; i { - line-height: 1; - font-size: 30px; - vertical-align: middle; + line-height: @mainmenu-mode-collapse-height; + font-size: 20px; + vertical-align: bottom; } } .menu-toggle-title { margin-left: 10px; } + + &:hover { + .menu-toggle-icon { + opacity: 1; + } + } + } +} + +body.mainmenu-open { + nav#layout-mainmenu { + .menu-toggle-icon { + opacity: 1; + } } } @@ -488,15 +500,6 @@ nav#layout-mainmenu.navbar-mode-collapse { } } -// This logic is implemented in the october.navbar.js script, -// it prevents the collapse mode from working beyond the min -// breakpoint. Leaving this code just in case, remove later. -// -SG -@media (min-width: @menu-breakpoint-min) { - // #layout-canvas { position: static !important; } - // .mainmenu-collapsed { display: none !important; } -} - .mainmenu-navbar-collapse() { padding-left: 0; @@ -573,6 +576,13 @@ body.mainmenu-open .mainmenu-collapsed ul { bottom: 10px; } +html.mobile { + .mainmenu-collapsed ul { + overflow: auto; + -webkit-overflow-scrolling: touch; + } +} + // // Misc // @@ -593,12 +603,6 @@ nav#layout-mainmenu.navbar ul li:hover, nav#layout-mainmenu.navbar ul li, .mainmenu-collapsed li { - // a:active, a:focus { - // .nav-label { - // text-shadow: 1px 1px 15px white, -1px -1px 15px white; - // } - // } - // Used by account menu &.highlight > a { color: @color-mainmenu-active !important; @@ -609,10 +613,6 @@ nav#layout-mainmenu.navbar ul li, a { color: @color-mainmenu-active !important; - - .nav-label { - text-shadow: none; - } } } @@ -628,11 +628,5 @@ body.drag { &:hover { color: @color-mainmenu-inactive; } - - a:active, a:focus { - .nav-label { - text-shadow: none; - } - } } } diff --git a/modules/backend/assets/less/layout/outerlayout.less b/modules/backend/assets/less/layout/outerlayout.less index 61418e2..2de8055 100644 --- a/modules/backend/assets/less/layout/outerlayout.less +++ b/modules/backend/assets/less/layout/outerlayout.less @@ -19,11 +19,11 @@ body.outer { position: relative; &:after { - .triangle(down, 70px, 25px, @color-outer-header); + .triangle(down, 56px, 20px, @color-outer-header); position: absolute; - bottom: -25px; + bottom: -20px; left: 50%; - margin-left: -22px; + margin-left: -28px; } h1.oc-logo { @@ -53,6 +53,7 @@ body.outer { .horizontal-form { font-size: 0; + .flex-display(); input { vertical-align: top; @@ -60,14 +61,6 @@ body.outer { display: inline-block; border: none; .border-radius(2px); - - &.width-1 { - width: 160px; - } - - &.width-2 { - width: 323px; - } } button { @@ -78,11 +71,12 @@ body.outer { height: 40px; vertical-align: top; .box-sizing(border-box); + } + } - &.login-button { - display: inline-block; - width: 98px; - } + .remember { + label { + color: @color-outer-muted-text; } } @@ -135,10 +129,14 @@ html.csstransitions { width: auto; padding: @padding-standard * 2; - .horizontal-form input { + .horizontal-form { display: block; - width: 100% !important; - margin-bottom: @padding-standard; + + input { + display: block; + width: 100% !important; + margin-bottom: @padding-standard; + } } } } diff --git a/modules/backend/assets/less/layout/sidenav.less b/modules/backend/assets/less/layout/sidenav.less index 3b9fc9b..259bc4f 100644 --- a/modules/backend/assets/less/layout/sidenav.less +++ b/modules/backend/assets/less/layout/sidenav.less @@ -2,21 +2,16 @@ // Side navigation bar // -------------------------------------------------- +.layout-sidenav-container { + width: 120px; +} + #layout-sidenav { position: absolute; height: 100%; width: 100%; .box-sizing(border-box); - - .sidenav-shadow-element() { - content: ''; - position: absolute; - height: 100%; - top: 0; - right: 0; - width: 10px; - .box-shadow(inset -5px 0 3px rgba(0,0,0,.1)); - } + font-size: @font-size-base; ul { position: relative; @@ -25,19 +20,15 @@ height: 100%; overflow: hidden; - &:after { - .sidenav-shadow-element(); - } - li { display: block; text-align: center; position: relative; a { - padding: 20px 10px; + padding: 1.429em .714em; display: block; - font-size: @font-size-base - 1; + font-size: .929em; color: @color-sidebarnav-inactive-text; font-weight: normal; position: relative; @@ -55,17 +46,12 @@ color: @color-sidebarnav-inactive-icon; display: block; margin-bottom: 5px; - font-size: 28px; - } - - .nav-label, - .nav-icon { - text-shadow: 0 -1px 0 rgba(0,0,0,.6); + font-size: 2em; } } &:first-child a { - padding-top: 30px; + padding-top: 2.143em; } &.active a, a:hover { @@ -73,22 +59,15 @@ i { color: @color-sidebarnav-active-icon; } } - &.active a { - .nav-label, - .nav-icon { - text-shadow: 0 -1px 0 rgba(0,0,0,.3); - } - } - span.counter { display: block; position: absolute; - top: 15px; - right: 15px; - padding: 2px 6px 3px 4px; + top: 1.071em; + right: 1.071em; + padding: .143em .429em .214em .286em; background-color: @color-sidebarnav-counter-bg; color: @color-sidebarnav-counter-text; - font-size: 11px; + font-size: .786em; line-height: 100%; .border-radius(3px); .opacity(1); @@ -104,9 +83,34 @@ } } +@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { + #layout-sidenav { + font-size: 12px; + } + .layout-sidenav-container { + width: 100px; + } +} + +@media (max-width: @screen-xs-max) { + #layout-sidenav { + font-size: 10px; + } + .layout-sidenav-container { + width: 80px; + } +} + +html.mobile { + #layout-sidenav ul { + overflow: auto; + -webkit-overflow-scrolling: touch; + } +} + #layout-sidenav.layout-sidenav ul.drag li:not(.active) a:hover, .touch #layout-sidenav.layout-sidenav li:not(.active) a:hover { color: @color-sidebarnav-inactive-text !important; i { color: @color-sidebarnav-inactive-icon !important; } &:after { display: none !important; } -} \ No newline at end of file +} diff --git a/modules/backend/assets/less/layout/sidepanel.less b/modules/backend/assets/less/layout/sidepanel.less index 5a04618..79d86ac 100644 --- a/modules/backend/assets/less/layout/sidepanel.less +++ b/modules/backend/assets/less/layout/sidepanel.less @@ -74,7 +74,7 @@ body.display-side-panel { // mouseout event fires and sidebar hides when opening a dropdown. z-index: @zindex-dropdown; width: 350px; - .box-shadow(2px 0px 2px 0 rgba(0, 0, 0, 0.3)); + .box-shadow(3px 0px 3px 0 rgba(0, 0, 0, 0.1)); } } diff --git a/modules/backend/assets/less/october.less b/modules/backend/assets/less/october.less index 753e2e6..0b2e297 100644 --- a/modules/backend/assets/less/october.less +++ b/modules/backend/assets/less/october.less @@ -23,7 +23,6 @@ @import "controls/tree-path.less"; @import "controls/namevaluelist.less"; @import "controls/scrollpad.less"; -@import "controls/autocomplete.less"; @import "controls/svg-icons.less"; // diff --git a/modules/backend/behaviors/FormController.php b/modules/backend/behaviors/FormController.php index 86d2495..1e1061f 100644 --- a/modules/backend/behaviors/FormController.php +++ b/modules/backend/behaviors/FormController.php @@ -14,9 +14,27 @@ use Exception; /** - * Form Controller Behavior - * Adds features for working with backend forms. + * Adds features for working with backend forms. This behavior + * will inject CRUD actions to the controller -- including create, + * update and preview -- along with some relevant AJAX handlers. * + * Each action supports a custom context code, allowing fields + * to be displayed or hidden on a contextual basis, as specified + * by the form field definitions or some other custom logic. + * + * This behavior is implemented in the controller like so: + * + * public $implement = [ + * 'Backend.Behaviors.FormController', + * ]; + * + * public $formConfig = 'config_form.yaml'; + * + * The `$formConfig` property makes reference to the form configuration + * values as either a YAML file, located in the controller view directory, + * or directly as a PHP array. + * + * @see http://octobercms.com/docs/backend/forms Back-end form documentation * @package october\backend * @author Alexey Bobkov, Samuel Georges */ @@ -50,7 +68,7 @@ class FormController extends ControllerBehavior protected $formWidget; /** - * {@inheritDoc} + * @inheritDoc */ protected $requiredProperties = ['formConfig']; @@ -87,14 +105,22 @@ public function __construct($controller) } /** - * Prepare the widgets used by this action - * @param Model $model + * Initialize the form configuration against a model and context value. + * This will process the configuration found in the `$formConfig` property + * and prepare the Form widget, which is the underlying tool used for + * actually rendering the form. The model used by this form is passed + * to this behavior via this method as the first argument. + * + * @see Backend\Widgets\Form + * @param October\Rain\Database\Model $model + * @param string $context Form context * @return void */ public function initForm($model, $context = null) { - if ($context !== null) + if ($context !== null) { $this->context = $context; + } $context = $this->formGetContext(); @@ -158,7 +184,8 @@ public function initForm($model, $context = null) } /** - * Prepares common form data + * Prepares commonly used view data. + * @param October\Rain\Database\Model $model */ protected function prepareVars($model) { @@ -172,8 +199,9 @@ protected function prepareVars($model) // /** - * Create Controller action - * @param string $context Explicitly define a form context. + * Controller "create" action used for creating new model records. + * + * @param string $context Form context * @return void */ public function create($context = null) @@ -196,7 +224,13 @@ public function create($context = null) } /** - * Ajax handler for saving from the creation form. + * AJAX handler "onSave" called from the create action and + * primarily used for creating new records. + * + * This handler will invoke the unique controller overrides + * `formBeforeCreate` and `formAfterCreate`. + * + * @param string $context Form context * @return mixed */ public function create_onSave($context = null) @@ -212,7 +246,7 @@ public function create_onSave($context = null) $this->controller->formBeforeCreate($model); $modelsToSave = $this->prepareModelsToSave($model, $this->formWidget->getSaveData()); - Db::transaction(function() use ($modelsToSave) { + Db::transaction(function () use ($modelsToSave) { foreach ($modelsToSave as $modelToSave) { $modelToSave->save(null, $this->formWidget->getSessionKey()); } @@ -233,9 +267,12 @@ public function create_onSave($context = null) // /** - * Edit Controller action - * @param int $recordId The model primary key to update. - * @param string $context Explicitly define a form context. + * Controller "update" action used for updating existing model records. + * This action takes a record identifier (primary key of the model) + * to locate the record used for sourcing the existing form values. + * + * @param int $recordId Record identifier + * @param string $context Form context * @return void */ public function update($recordId = null, $context = null) @@ -256,8 +293,14 @@ public function update($recordId = null, $context = null) } /** - * Ajax handler for updating the form. - * @param int $recordId The model primary key to update. + * AJAX handler "onSave" called from the update action and + * primarily used for updating existing records. + * + * This handler will invoke the unique controller overrides + * `formBeforeUpdate` and `formAfterUpdate`. + * + * @param int $recordId Record identifier + * @param string $context Form context * @return mixed */ public function update_onSave($recordId = null, $context = null) @@ -270,7 +313,7 @@ public function update_onSave($recordId = null, $context = null) $this->controller->formBeforeUpdate($model); $modelsToSave = $this->prepareModelsToSave($model, $this->formWidget->getSaveData()); - Db::transaction(function() use ($modelsToSave) { + Db::transaction(function () use ($modelsToSave) { foreach ($modelsToSave as $modelToSave) { $modelToSave->save(null, $this->formWidget->getSessionKey()); } @@ -287,8 +330,13 @@ public function update_onSave($recordId = null, $context = null) } /** - * Ajax handler for deleting the record. - * @param int $recordId The model primary key to delete. + * AJAX handler "onDelete" called from the update action and + * used for deleting existing records. + * + * This handler will invoke the unique controller override + * `formAfterDelete`. + * + * @param int $recordId Record identifier * @return mixed */ public function update_onDelete($recordId = null) @@ -313,9 +361,12 @@ public function update_onDelete($recordId = null) // /** - * Preview Controller action - * @param int $recordId The model primary key to preview. - * @param string $context Explicitly define a form context. + * Controller "preview" action used for viewing existing model records. + * This action takes a record identifier (primary key of the model) + * to locate the record used for sourcing the existing preview data. + * + * @param int $recordId Record identifier + * @param string $context Form context * @return void */ public function preview($recordId = null, $context = null) @@ -340,8 +391,18 @@ public function preview($recordId = null, $context = null) // /** - * Render the form. - * @param array $options Custom options to pass to the form widget. + * Method to render the prepared form markup. This method is usually + * called from a view file. + * + * formRender() ?> + * + * The first argument supports an array of render options. The supported + * options can be found via the `render` method of the Form widget class. + * + * formRender(['preview' => true, section' => 'primary']) ?> + * + * @see Backend\Widgets\Form + * @param array $options Render options * @return string Rendered HTML for the form. */ public function formRender($options = []) @@ -355,7 +416,10 @@ public function formRender($options = []) /** * Returns the model initialized by this form behavior. - * @return Model + * The model will be provided by one of the page actions or AJAX + * handlers via the `initForm` method. + * + * @return October\Rain\Database\Model */ public function formGetModel() { @@ -363,7 +427,10 @@ public function formGetModel() } /** - * Returns the form context from the postback or configuration. + * Returns the active form context, either obtained from the postback + * variable called `form_context` or detected from the configuration, + * or routing parameters. + * * @return string */ public function formGetContext() @@ -372,8 +439,9 @@ public function formGetContext() } /** - * Internal method, prepare the form model object - * @return Model + * Internal method used to prepare the form model object. + * + * @return October\Rain\Database\Model */ protected function createModel() { @@ -383,7 +451,9 @@ protected function createModel() } /** - * Returns a Redirect object based on supplied context and parses the model primary key. + * Returns a Redirect object based on supplied context and parses + * the model primary key. + * * @param string $context Redirect context, eg: create, update, delete * @param Model $model The active model to parse in it's ID and attributes. * @return Redirect @@ -396,7 +466,7 @@ public function makeRedirect($context = null, $model = null) } if (post('refresh', false)) { - return Redirect::refresh(); + return Redirect::refresh(); } if (post('redirect', true)) { @@ -411,8 +481,9 @@ public function makeRedirect($context = null, $model = null) } /** - * Internal method, returns a redirect URL from the config based on + * Internal method that returns a redirect URL from the config based on * supplied context. Otherwise the default redirect is used. + * * @param string $context Redirect context, eg: create, update, delete. * @return string */ @@ -436,6 +507,7 @@ protected function getRedirectUrl($context = null) /** * Parses in some default variables to a language string defined in config. + * * @param string $name Configuration property containing the language string * @param string $default A default language string to use if the config is not found * @param array $extras Any extra params to include in the language string variables @@ -456,9 +528,12 @@ protected function getLang($name, $default = null, $extras = []) // /** - * Renders a single form field. - * @param string Field name - * @return string The field HTML markup. + * View helper to render a single form field. + * + * formRenderField('field_name') ?> + * + * @param string $name Field name + * @return string HTML markup */ public function formRenderField($name) { @@ -466,7 +541,10 @@ public function formRenderField($name) } /** - * Renders the form in preview mode. + * View helper to render the form in preview mode. + * + * formRenderPreview() ?> + * * @return string The form HTML markup. */ public function formRenderPreview() @@ -475,7 +553,13 @@ public function formRenderPreview() } /** - * Helper to check if a form tab has fields. + * View helper to check if a form tab has fields in the + * non-tabbed section (outside fields). + * + * formHasOutsideFields()): ?> + * + * + * * @return bool */ public function formHasOutsideFields() @@ -484,8 +568,12 @@ public function formHasOutsideFields() } /** - * Helper for custom layouts. Renders Outside Fields. - * @return string The area HTML markup. + * View helper to render the form fields belonging to the + * non-tabbed section (outside form fields). + * + * formRenderOutsideFields() ?> + * + * @return string HTML markup */ public function formRenderOutsideFields() { @@ -493,7 +581,13 @@ public function formRenderOutsideFields() } /** - * Helper to check if a form tab has fields. + * View helper to check if a form tab has fields in the + * primary tab section. + * + * formHasPrimaryTabs()): ?> + * + * + * * @return bool */ public function formHasPrimaryTabs() @@ -502,8 +596,12 @@ public function formHasPrimaryTabs() } /** - * Helper for custom layouts. Renders Primary Tabs. - * @return string The tab HTML markup. + * View helper to render the form fields belonging to the + * primary tabs section. + * + * formRenderPrimaryTabs() ?> + * + * @return string HTML markup */ public function formRenderPrimaryTabs() { @@ -511,7 +609,13 @@ public function formRenderPrimaryTabs() } /** - * Helper to check if a form tab has fields. + * View helper to check if a form tab has fields in the + * secondary tab section. + * + * formHasSecondaryTabs()): ?> + * + * + * * @return bool */ public function formHasSecondaryTabs() @@ -520,8 +624,12 @@ public function formHasSecondaryTabs() } /** - * Helper for custom layouts. Renders Secondary Tabs. - * @return string The tab HTML markup. + * View helper to render the form fields belonging to the + * secondary tabs section. + * + * formRenderPrimaryTabs() ?> + * + * @return string HTML markup */ public function formRenderSecondaryTabs() { @@ -529,8 +637,9 @@ public function formRenderSecondaryTabs() } /** - * Returns the widget used by this behavior. - * @return Backend\Classes\WidgetBase + * Returns the form widget used by this behavior. + * + * @return Backend\Widgets\Form */ public function formGetWidget() { @@ -538,7 +647,17 @@ public function formGetWidget() } /** - * Helper to get a unique ID for the form widget. + * Returns a unique ID for the form widget used by this behavior. + * This is useful for dealing with identifiers in the markup. + * + *
    ...
    + * + * A suffix may be used passed as the first argument to reuse + * the identifier in other areas. + * + * + * + * @param string $suffix * @return string */ public function formGetId($suffix = null) @@ -548,9 +667,10 @@ public function formGetId($suffix = null) /** * Helper to get the form session key. + * * @return string */ - public function formGetSessionKey($suffix = null) + public function formGetSessionKey() { return $this->formWidget->getSessionKey(); } @@ -740,5 +860,4 @@ public static function extendFormFields($callback) call_user_func_array($callback, [$widget, $widget->model, $widget->getContext()]); }); } - } diff --git a/modules/backend/behaviors/ImportExportController.php b/modules/backend/behaviors/ImportExportController.php index 4cf14c3..3cba09c 100644 --- a/modules/backend/behaviors/ImportExportController.php +++ b/modules/backend/behaviors/ImportExportController.php @@ -16,9 +16,20 @@ use Exception; /** - * Import/Export Controller Behavior * Adds features for importing and exporting data. * + * This behavior is implemented in the controller like so: + * + * public $implement = [ + * 'Backend.Behaviors.ImportExportController', + * ]; + * + * public $importExportConfig = 'config_import_export.yaml'; + * + * The `$importExportConfig` property makes reference to the configuration + * values as either a YAML file, located in the controller view directory, + * or directly as a PHP array. + * * @package october\backend * @author Alexey Bobkov, Samuel Georges */ @@ -26,7 +37,7 @@ class ImportExportController extends ControllerBehavior { /** - * {@inheritDoc} + * @inheritDoc */ protected $requiredProperties = ['importExportConfig']; @@ -307,7 +318,7 @@ protected function getImportFileColumns() $firstRow = $reader->fetchOne(0); if (!post('first_row_titles')) { - array_walk($firstRow, function(&$value, $key) { + array_walk($firstRow, function (&$value, $key) { $value = 'Column #'.($key + 1); }); } @@ -334,7 +345,7 @@ protected function makeImportUploadFormWidget() $widget = $this->makeWidget('Backend\Widgets\Form', $widgetConfig); - $widget->bindEvent('form.beforeRefresh', function($holder) { + $widget->bindEvent('form.beforeRefresh', function ($holder) { $holder->data = []; }); @@ -492,7 +503,7 @@ protected function makeExportFormatFormWidget() $widget = $this->makeWidget('Backend\Widgets\Form', $widgetConfig); - $widget->bindEvent('form.beforeRefresh', function($holder) { + $widget->bindEvent('form.beforeRefresh', function ($holder) { $holder->data = []; }); @@ -721,8 +732,10 @@ protected function makeListColumns($config) protected function getRedirectUrlForType($type) { - if ($redirect = $this->getConfig($type.'[redirect]')) { - return Backend::url($redirect); + $redirect = $this->getConfig($type.'[redirect]'); + + if ($redirect !== null) { + return $redirect ? Backend::url($redirect) : 'javascript:;'; } return $this->controller->actionUrl($type); diff --git a/modules/backend/behaviors/ListController.php b/modules/backend/behaviors/ListController.php index 8f84b76..9882bb7 100644 --- a/modules/backend/behaviors/ListController.php +++ b/modules/backend/behaviors/ListController.php @@ -8,9 +8,20 @@ use Backend\Classes\ControllerBehavior; /** - * List Controller Behavior * Adds features for working with backend lists. * + * This behavior is implemented in the controller like so: + * + * public $implement = [ + * 'Backend.Behaviors.ListController', + * ]; + * + * public $listConfig = 'config_list.yaml'; + * + * The `$listConfig` property makes reference to the list configuration + * values as either a YAML file, located in the controller view directory, + * or directly as a PHP array. + * * @package october\backend * @author Alexey Bobkov, Samuel Georges */ @@ -47,7 +58,7 @@ class ListController extends ControllerBehavior protected $filterWidgets = []; /** - * {@inheritDoc} + * @inheritDoc */ protected $requiredProperties = ['listConfig']; @@ -163,6 +174,10 @@ public function makeList($definition = null) $this->controller->listExtendQuery($query, $definition); }); + $widget->bindEvent('list.extendRecords', function ($records) use ($definition) { + $this->controller->listExtendRecords($records, $definition); + }); + $widget->bindEvent('list.injectRowClass', function ($record) use ($definition) { return $this->controller->listInjectRowClass($record, $definition); }); @@ -226,10 +241,17 @@ public function makeList($definition = null) return $widget->onRefresh(); }); + /* + * Filter Widget with extensibility + */ + $filterWidget->bindEvent('filter.extendScopes', function () use ($filterWidget) { + $this->controller->listFilterExtendScopes($filterWidget); + }); + /* * Extend the query of the list of options */ - $filterWidget->bindEvent('filter.extendQuery', function($query, $scope) { + $filterWidget->bindEvent('filter.extendQuery', function ($query, $scope) { $this->controller->listFilterExtendQuery($query, $scope); }); @@ -426,15 +448,6 @@ public function listGetConfig($definition = null) // Overrides // - /** - * Called before the list columns are defined. - * @param Backend\Widgets\List $host The hosting list widget - * @return void - */ - // public function listExtendColumnsBefore($host) - // { - // } - /** * Called after the list columns are defined. * @param \Backend\Widgets\List $host The hosting list widget @@ -443,6 +456,15 @@ public function listGetConfig($definition = null) public function listExtendColumns($host) { } + + /** + * Called after the filter scopes are defined. + * @param \Backend\Widgets\Filter $host The hosting filter widget + * @return void + */ + public function listFilterExtendScopes($host) + { + } /** * Controller override: Extend supplied model @@ -473,7 +495,16 @@ public function listExtendQuery($query, $definition = null) } /** - * Controller override: Extend the query used for populating the filter + * Controller override: Extend the records used for populating the list + * after the query is processed. + * @param Illuminate\Contracts\Pagination\LengthAwarePaginator|Illuminate\Database\Eloquent\Collection $records + */ + public function listExtendRecords($records, $definition = null) + { + } + + /** + * Controller override: Extend the query used for populating the filter * options before the default query is processed. * @param \October\Rain\Database\Builder $query * @param array $scope @@ -486,7 +517,7 @@ public function listFilterExtendQuery($query, $scope) * Returns a CSS class name for a list row (). * @param Model $record The populated model used for the column * @param string $definition List definition (optional) - * @return string HTML view + * @return string CSS class name */ public function listInjectRowClass($record, $definition = null) { @@ -528,4 +559,20 @@ public static function extendListColumns($callback) call_user_func_array($callback, [$widget, $widget->model]); }); } + + /** + * Static helper for extending filter scopes. + * @param callable $callback + * @return void + */ + public static function extendListFilterScopes($callback) + { + $calledClass = self::getCalledExtensionClass(); + Event::listen('backend.filter.extendScopes', function ($widget) use ($calledClass, $callback) { + if (!is_a($widget->getController(), $calledClass)) { + return; + } + call_user_func_array($callback, [$widget]); + }); + } } diff --git a/modules/backend/behaviors/RelationController.php b/modules/backend/behaviors/RelationController.php index 657bdcb..aa683fd 100644 --- a/modules/backend/behaviors/RelationController.php +++ b/modules/backend/behaviors/RelationController.php @@ -10,9 +10,20 @@ use ApplicationException; /** - * Relation Controller Behavior * Uses a combination of lists and forms for managing Model relations. * + * This behavior is implemented in the controller like so: + * + * public $implement = [ + * 'Backend.Behaviors.RelationController', + * ]; + * + * public $relationConfig = 'config_relation.yaml'; + * + * The `$relationConfig` property makes reference to the configuration + * values as either a YAML file, located in the controller view directory, + * or directly as a PHP array. + * * @package october\backend * @author Alexey Bobkov, Samuel Georges */ @@ -36,12 +47,12 @@ class RelationController extends ControllerBehavior const PARAM_EXTRA_CONFIG = '_relation_extra_config'; /** - * @var Backend\Classes\WidgetBase Reference to the search widget object. + * @var Backend\Widgets\Search Reference to the search widget object. */ protected $searchWidget; /** - * @var Backend\Classes\WidgetBase Reference to the toolbar widget object. + * @var Backend\Widgets\Toolbar Reference to the toolbar widget object. */ protected $toolbarWidget; @@ -61,7 +72,7 @@ class RelationController extends ControllerBehavior protected $pivotWidget; /** - * {@inheritDoc} + * @inheritDoc */ protected $requiredProperties = ['relationConfig']; @@ -326,14 +337,14 @@ public function initRelation($model, $field = null) $this->relationObject = $this->model->{$field}(); $this->relationModel = $this->relationObject->getRelated(); + $this->manageId = post('manage_id'); + $this->foreignId = post('foreign_id'); $this->readOnly = $this->getConfig('readOnly'); $this->deferredBinding = $this->getConfig('deferredBinding') || !$this->model->exists; $this->toolbarButtons = $this->evalToolbarButtons(); $this->viewMode = $this->evalViewMode(); $this->manageMode = $this->evalManageMode(); $this->manageTitle = $this->evalManageTitle(); - $this->manageId = post('manage_id'); - $this->foreignId = post('foreign_id'); /* * Toolbar widget @@ -639,17 +650,17 @@ protected function makeViewWidget() * Apply defined constraints */ if ($sqlConditions = $this->getConfig('view[conditions]')) { - $widget->bindEvent('list.extendQueryBefore', function($query) use ($sqlConditions) { + $widget->bindEvent('list.extendQueryBefore', function ($query) use ($sqlConditions) { $query->whereRaw($sqlConditions); }); } elseif ($scopeMethod = $this->getConfig('view[scope]')) { - $widget->bindEvent('list.extendQueryBefore', function($query) use ($scopeMethod) { - $query->$scopeMethod(); + $widget->bindEvent('list.extendQueryBefore', function ($query) use ($scopeMethod) { + $query->$scopeMethod($this->model); }); } else { - $widget->bindEvent('list.extendQueryBefore', function($query) { + $widget->bindEvent('list.extendQueryBefore', function ($query) { $this->relationObject->addDefinedConstraintsToQuery($query); }); } @@ -769,17 +780,17 @@ protected function makeManageWidget() * Apply defined constraints */ if ($sqlConditions = $this->getConfig('manage[conditions]')) { - $widget->bindEvent('list.extendQueryBefore', function($query) use ($sqlConditions) { + $widget->bindEvent('list.extendQueryBefore', function ($query) use ($sqlConditions) { $query->whereRaw($sqlConditions); }); } elseif ($scopeMethod = $this->getConfig('manage[scope]')) { - $widget->bindEvent('list.extendQueryBefore', function($query) use ($scopeMethod) { - $query->$scopeMethod(); + $widget->bindEvent('list.extendQueryBefore', function ($query) use ($scopeMethod) { + $query->$scopeMethod($this->model); }); } else { - $widget->bindEvent('list.extendQueryBefore', function($query) { + $widget->bindEvent('list.extendQueryBefore', function ($query) { $this->relationObject->addDefinedConstraintsToQuery($query); }); } @@ -1000,7 +1011,7 @@ public function onRelationManageCreate() */ if (in_array($this->relationType, ['hasOne', 'hasMany'])) { $newModel->setAttribute( - $this->relationObject->getPlainForeignKey(), + $this->relationObject->getForeignKeyName(), $this->relationObject->getParentKey() ); } @@ -1058,10 +1069,10 @@ public function onRelationManageUpdate() } elseif ($this->viewMode == 'single') { $this->viewWidget->setFormValues($saveData); - $this->viewModel->save(); + $this->viewModel->save(null, $this->manageWidget->getSessionKey()); } - return ['#'.$this->relationGetId('view') => $this->relationRenderView()]; + return $this->relationRefresh(); } /** @@ -1243,10 +1254,10 @@ public function onRelationManagePivotCreate() * Save data to models */ $foreignKeyName = $this->relationModel->getQualifiedKeyName(); - $hyrdatedModels = $this->relationObject->whereIn($foreignKeyName, $foreignIds)->get(); + $hydratedModels = $this->relationObject->whereIn($foreignKeyName, $foreignIds)->get(); $saveData = $this->pivotWidget->getSaveData(); - foreach ($hyrdatedModels as $hydratedModel) { + foreach ($hydratedModels as $hydratedModel) { $modelsToSave = $this->prepareModelsToSave($hydratedModel, $saveData); foreach ($modelsToSave as $modelToSave) { $modelToSave->save(null, $this->pivotWidget->getSessionKey()); @@ -1435,9 +1446,12 @@ protected function evalManageTitle() if ($this->readOnly) { return 'backend::lang.relation.preview_name'; } - else { + elseif ($this->manageId) { return 'backend::lang.relation.update_name'; } + else { + return 'backend::lang.relation.create_name'; + } break; } } diff --git a/modules/backend/behaviors/ReorderController.php b/modules/backend/behaviors/ReorderController.php index aa74496..6acad5e 100644 --- a/modules/backend/behaviors/ReorderController.php +++ b/modules/backend/behaviors/ReorderController.php @@ -6,16 +6,27 @@ use Backend\Classes\ControllerBehavior; /** - * Reorder Controller Behavior * Used for reordering and sorting records. * + * This behavior is implemented in the controller like so: + * + * public $implement = [ + * 'Backend.Behaviors.ReorderController', + * ]; + * + * public $reorderConfig = 'config_reorder.yaml'; + * + * The `$reorderConfig` property makes reference to the configuration + * values as either a YAML file, located in the controller view directory, + * or directly as a PHP array. + * * @package october\backend * @author Alexey Bobkov, Samuel Georges */ class ReorderController extends ControllerBehavior { /** - * {@inheritDoc} + * @inheritDoc */ protected $requiredProperties = ['reorderConfig']; @@ -85,7 +96,7 @@ public function reorder() { $this->addJs('js/october.reorder.js', 'core'); - $this->controller->pageTitle = $this->controller->pageTitle + $this->controller->pageTitle = $this->controller->pageTitle ?: Lang::get($this->getConfig('title', 'backend::lang.reorder.default_title')); $this->validateModel(); diff --git a/modules/backend/behaviors/UserPreferencesModel.php b/modules/backend/behaviors/UserPreferencesModel.php index b817335..0c17d53 100644 --- a/modules/backend/behaviors/UserPreferencesModel.php +++ b/modules/backend/behaviors/UserPreferencesModel.php @@ -4,16 +4,14 @@ use Backend\Models\UserPreference; /** - * User Preferences model extension, identical to System.Behaviors.SettingsModel - * except values are set against the logged in user's preferences via Backend\Models\UserPreference. + * User Preferences model extension, identical to System\Behaviors\SettingsModel + * except values are set against the logged in user's preferences via Backend\Models\UserPreference * - * Usage: + * Add this the model class definition: * - * In the model class definition: - * - * public $implement = ['Backend.Behaviors.UserPreferencesModel']; - * public $settingsCode = 'author.plugin::code'; - * public $settingsFields = 'fields.yaml'; + * public $implement = ['Backend.Behaviors.UserPreferencesModel']; + * public $settingsCode = 'author.plugin::code'; + * public $settingsFields = 'fields.yaml'; * */ class UserPreferencesModel extends SettingsModel diff --git a/modules/backend/behaviors/importexportcontroller/TranscodeFilter.php b/modules/backend/behaviors/importexportcontroller/TranscodeFilter.php index e1d75e8..d684c91 100644 --- a/modules/backend/behaviors/importexportcontroller/TranscodeFilter.php +++ b/modules/backend/behaviors/importexportcontroller/TranscodeFilter.php @@ -50,7 +50,7 @@ public function onCreate() } $this->encodingTo = mb_internal_encoding(); - if (isset( $matches[3] )) { + if (isset($matches[3])) { $this->encodingTo = $matches[3]; } diff --git a/modules/backend/behaviors/relationcontroller/partials/_manage_form.htm b/modules/backend/behaviors/relationcontroller/partials/_manage_form.htm index c34ae0c..da2e695 100644 --- a/modules/backend/behaviors/relationcontroller/partials/_manage_form.htm +++ b/modules/backend/behaviors/relationcontroller/partials/_manage_form.htm @@ -57,7 +57,7 @@
    diff --git a/modules/backend/controllers/usergroups/config_list.yaml b/modules/backend/controllers/usergroups/config_list.yaml index 00ba207..e88b417 100644 --- a/modules/backend/controllers/usergroups/config_list.yaml +++ b/modules/backend/controllers/usergroups/config_list.yaml @@ -7,7 +7,8 @@ list: ~/modules/backend/models/usergroup/columns.yaml modelClass: Backend\Models\UserGroup recordUrl: backend/usergroups/update/:id noRecordsMessage: backend::lang.list.no_records -recordsPerPage: 5 +recordsPerPage: 25 +showSetup: true toolbar: buttons: list_toolbar diff --git a/modules/backend/controllers/usergroups/create.htm b/modules/backend/controllers/usergroups/create.htm index fcc5119..7e8cf36 100644 --- a/modules/backend/controllers/usergroups/create.htm +++ b/modules/backend/controllers/usergroups/create.htm @@ -41,4 +41,4 @@

    fatalError)) ?>

    - \ No newline at end of file + diff --git a/modules/backend/controllers/usergroups/update.htm b/modules/backend/controllers/usergroups/update.htm index 3b19df7..a262441 100644 --- a/modules/backend/controllers/usergroups/update.htm +++ b/modules/backend/controllers/usergroups/update.htm @@ -50,4 +50,4 @@

    fatalError)) ?>

    - \ No newline at end of file + diff --git a/modules/backend/controllers/userroles/_list_toolbar.htm b/modules/backend/controllers/userroles/_list_toolbar.htm new file mode 100644 index 0000000..29e5762 --- /dev/null +++ b/modules/backend/controllers/userroles/_list_toolbar.htm @@ -0,0 +1,8 @@ + diff --git a/modules/backend/controllers/userroles/config_form.yaml b/modules/backend/controllers/userroles/config_form.yaml new file mode 100644 index 0000000..68b4063 --- /dev/null +++ b/modules/backend/controllers/userroles/config_form.yaml @@ -0,0 +1,16 @@ +# =================================== +# Form Behavior Config +# =================================== + +name: backend::lang.user.role.name +form: ~/modules/backend/models/userrole/fields.yaml +modelClass: Backend\Models\UserRole +defaultRedirect: backend/userroles + +create: + redirect: backend/userroles/update/:id + redirectClose: backend/userroles + +update: + redirect: backend/userroles + redirectClose: backend/userroles diff --git a/modules/backend/controllers/userroles/config_list.yaml b/modules/backend/controllers/userroles/config_list.yaml new file mode 100644 index 0000000..520fb6e --- /dev/null +++ b/modules/backend/controllers/userroles/config_list.yaml @@ -0,0 +1,16 @@ +# =================================== +# List Behavior Config +# =================================== + +title: backend::lang.user.role.list_title +list: ~/modules/backend/models/userrole/columns.yaml +modelClass: Backend\Models\UserRole +recordUrl: backend/userroles/update/:id +noRecordsMessage: backend::lang.list.no_records +recordsPerPage: 25 +showSetup: true + +toolbar: + buttons: list_toolbar + search: + prompt: backend::lang.list.search_prompt diff --git a/modules/backend/controllers/userroles/create.htm b/modules/backend/controllers/userroles/create.htm new file mode 100644 index 0000000..07f55b3 --- /dev/null +++ b/modules/backend/controllers/userroles/create.htm @@ -0,0 +1,44 @@ + +
      +
    • +
    • +
    • pageTitle)) ?>
    • +
    + + +fatalError): ?> + + 'layout']) ?> + +
    + formRender() ?> +
    + +
    +
    + + +
    +
    + + + + +

    fatalError)) ?>

    +

    + diff --git a/modules/backend/controllers/userroles/index.htm b/modules/backend/controllers/userroles/index.htm new file mode 100644 index 0000000..ee75b85 --- /dev/null +++ b/modules/backend/controllers/userroles/index.htm @@ -0,0 +1,8 @@ + +
      +
    • +
    • pageTitle)) ?>
    • +
    + + +listRender() ?> diff --git a/modules/backend/controllers/userroles/update.htm b/modules/backend/controllers/userroles/update.htm new file mode 100644 index 0000000..7f1b977 --- /dev/null +++ b/modules/backend/controllers/userroles/update.htm @@ -0,0 +1,53 @@ + +
      +
    • +
    • +
    • pageTitle)) ?>
    • +
    + + +fatalError): ?> + + 'layout']) ?> + +
    + formRender() ?> +
    + +
    +
    + + + +
    +
    + + + + +

    fatalError)) ?>

    +

    + diff --git a/modules/backend/controllers/users/_list_toolbar.htm b/modules/backend/controllers/users/_list_toolbar.htm index 69ff34f..092dcd1 100644 --- a/modules/backend/controllers/users/_list_toolbar.htm +++ b/modules/backend/controllers/users/_list_toolbar.htm @@ -2,6 +2,11 @@ + user->isSuperUser()): ?> + + + + diff --git a/modules/backend/database/migrations/2013_10_01_000001_Db_Backend_Users.php b/modules/backend/database/migrations/2013_10_01_000001_Db_Backend_Users.php index 15069a1..caa9066 100644 --- a/modules/backend/database/migrations/2013_10_01_000001_Db_Backend_Users.php +++ b/modules/backend/database/migrations/2013_10_01_000001_Db_Backend_Users.php @@ -20,6 +20,7 @@ public function up() $table->string('reset_password_code')->nullable()->index('reset_code_index'); $table->text('permissions')->nullable(); $table->boolean('is_activated')->default(0); + $table->integer('role_id')->unsigned()->nullable()->index('admin_role_index'); $table->timestamp('activated_at')->nullable(); $table->timestamp('last_login')->nullable(); $table->timestamps(); diff --git a/modules/backend/database/migrations/2013_10_01_000002_Db_Backend_User_Groups.php b/modules/backend/database/migrations/2013_10_01_000002_Db_Backend_User_Groups.php index f656ab2..599707c 100644 --- a/modules/backend/database/migrations/2013_10_01_000002_Db_Backend_User_Groups.php +++ b/modules/backend/database/migrations/2013_10_01_000002_Db_Backend_User_Groups.php @@ -11,7 +11,6 @@ public function up() $table->engine = 'InnoDB'; $table->increments('id'); $table->string('name')->unique('name_unique'); - $table->text('permissions')->nullable(); $table->timestamps(); }); } diff --git a/modules/backend/database/migrations/2015_10_01_000008_Db_Backend_Add_Superuser_Flag.php b/modules/backend/database/migrations/2015_10_01_000008_Db_Backend_Add_Superuser_Flag.php index 596d320..2bc388b 100644 --- a/modules/backend/database/migrations/2015_10_01_000008_Db_Backend_Add_Superuser_Flag.php +++ b/modules/backend/database/migrations/2015_10_01_000008_Db_Backend_Add_Superuser_Flag.php @@ -12,7 +12,7 @@ public function up() $table->boolean('is_superuser')->default(false); }); - AdminModel::all()->each(function($user) { + AdminModel::all()->each(function ($user) { if ($user->hasPermission('superuser')) { $user->is_superuser = true; $user->save(); diff --git a/modules/backend/database/migrations/2017_10_01_000010_Db_Backend_User_Roles.php b/modules/backend/database/migrations/2017_10_01_000010_Db_Backend_User_Roles.php new file mode 100644 index 0000000..601893a --- /dev/null +++ b/modules/backend/database/migrations/2017_10_01_000010_Db_Backend_User_Roles.php @@ -0,0 +1,162 @@ +engine = 'InnoDB'; + $table->increments('id'); + $table->string('name')->unique('role_unique'); + $table->string('code')->nullable()->index('role_code_index'); + $table->text('description')->nullable(); + $table->text('permissions')->nullable(); + $table->boolean('is_system')->default(0); + $table->timestamps(); + }); + + // This detects older builds and performs a migration to include + // the new role system. This column will exist for new installs + // so this heavy migration process does not need to execute. + $this->migratePreviousBuild(); + } + + public function down() + { + Schema::dropIfExists('backend_user_roles'); + } + + protected function migratePreviousBuild() + { + // Role not found in the users table, perform a complete migration. + // Merging group permissions with the user and assigning the user + // with the first available role. + if (!Schema::hasColumn('backend_users', 'role_id')) { + Schema::table('backend_users', function (Blueprint $table) { + $table->integer('role_id')->unsigned()->nullable()->index('admin_role_index'); + }); + + $this->createSystemUserRoles(); + $this->migratePermissionsFromGroupsToRoles(); + } + + // Drop permissions column on groups table as it is no longer needed. + if (Schema::hasColumn('backend_user_groups', 'permissions')) { + Schema::table('backend_user_groups', function (Blueprint $table) { + $table->dropColumn('permissions'); + }); + } + } + + protected function createSystemUserRoles() + { + Db::table('backend_user_roles')->insert([ + 'name' => 'Publisher', + 'code' => UserRole::CODE_PUBLISHER, + 'description' => 'Site editor with access to publishing tools.', + ]); + + Db::table('backend_user_roles')->insert([ + 'name' => 'Developer', + 'code' => UserRole::CODE_DEVELOPER, + 'description' => 'Site administrator with access to developer tools.', + ]); + } + + protected function migratePermissionsFromGroupsToRoles() + { + $groups = Db::table('backend_user_groups')->get(); + $roles = []; + $permissions = []; + + /* + * Carbon copy groups to roles + */ + foreach ($groups as $group) { + if (!isset($group->name) || !$group->name) { + continue; + } + + try { + $roles[$group->id] = Db::table('backend_user_roles')->insertGetId([ + 'name' => $group->name, + 'description' => $group->description, + 'permissions' => $group->permissions ?? null + ]); + } + catch (Exception $ex) {} + + $permissions[$group->id] = $group->permissions ?? null; + } + + /* + * Assign a user with the first available role + */ + $found = []; + $joins = Db::table('backend_users_groups')->get(); + + foreach ($joins as $join) { + if (!$roleId = array_get($roles, $join->user_group_id)) { + continue; + } + + $userId = $join->user_id; + + if (!isset($found[$userId])) { + Db::table('backend_users')->where('id', $userId)->update([ + 'role_id' => $roleId + ]); + } + + $found[$userId][] = $join->user_group_id; + } + + /* + * Merge group permissions in to user + */ + foreach ($found as $userId => $groups) { + $userPerms = []; + + foreach ($groups as $groupId) { + if (!$permString = array_get($permissions, $groupId)) { + continue; + } + + try { + $perms = json_decode($permString, true); + $userPerms = array_merge($userPerms, $perms); + } + catch (Exception $ex) {} + } + + if (count($userPerms) > 0) { + $this->splicePermissionsForUser($userId, $userPerms); + } + } + } + + protected function splicePermissionsForUser($userId, $permissions) + { + /* + * Look up user and splice the provided permissions in + */ + $user = Db::table('backend_users')->where('id', $userId)->first(); + if (!$user) { + return; + } + + try { + $currentPerms = $user->permissions ? json_decode($user->permissions, true) : []; + $newPerms = array_merge($permissions, $currentPerms); + + Db::table('backend_users')->where('id', $userId)->update([ + 'permissions' => json_encode($newPerms) + ]); + } + catch (Exception $ex) {} + } +} diff --git a/modules/backend/database/seeds/DatabaseSeeder.php b/modules/backend/database/seeds/DatabaseSeeder.php index ce9b9df..7be5f98 100644 --- a/modules/backend/database/seeds/DatabaseSeeder.php +++ b/modules/backend/database/seeds/DatabaseSeeder.php @@ -5,7 +5,6 @@ class DatabaseSeeder extends Seeder { - /** * Run the database seeds. * diff --git a/modules/backend/database/seeds/SeedSetupAdmin.php b/modules/backend/database/seeds/SeedSetupAdmin.php index 64beb4b..e161a41 100644 --- a/modules/backend/database/seeds/SeedSetupAdmin.php +++ b/modules/backend/database/seeds/SeedSetupAdmin.php @@ -2,11 +2,11 @@ use Seeder; use Backend\Models\User; +use Backend\Models\UserRole; use Backend\Models\UserGroup; class SeedSetupAdmin extends Seeder { - public static $email = 'admin@domain.tld'; public static $login = 'admin'; public static $password = 'admin'; @@ -25,9 +25,21 @@ public function setDefaults($values) public function run() { + UserRole::create([ + 'name' => 'Publisher', + 'code' => UserRole::CODE_PUBLISHER, + 'description' => 'Site editor with access to publishing tools.', + ]); + + $role = UserRole::create([ + 'name' => 'Developer', + 'code' => UserRole::CODE_DEVELOPER, + 'description' => 'Site administrator with access to developer tools.', + ]); + $group = UserGroup::create([ 'name' => 'Owners', - 'code' => UserGroup::DEFAULT_CODE, + 'code' => UserGroup::CODE_OWNERS, 'description' => 'Default group for website owners.', 'is_new_user_default' => false ]); @@ -41,10 +53,10 @@ public function run() 'last_name' => static::$lastName, 'permissions' => [], 'is_superuser' => true, - 'is_activated' => true + 'is_activated' => true, + 'role_id' => $role->id ]); $user->addGroup($group); } - } diff --git a/modules/backend/facades/Backend.php b/modules/backend/facades/Backend.php index 8f9966e..4ca59f6 100644 --- a/modules/backend/facades/Backend.php +++ b/modules/backend/facades/Backend.php @@ -6,7 +6,7 @@ class Backend extends Facade { /** * Get the registered name of the component. - * + * * @see \Backend\Helpers\Backend * @return string */ diff --git a/modules/backend/facades/BackendAuth.php b/modules/backend/facades/BackendAuth.php index 2d676fd..99dde86 100644 --- a/modules/backend/facades/BackendAuth.php +++ b/modules/backend/facades/BackendAuth.php @@ -6,10 +6,10 @@ class BackendAuth extends Facade { /** * Get the registered name of the component. - * + * * Resolves to: * - Backend\Classes\AuthManager - * + * * @return string */ protected static function getFacadeAccessor() diff --git a/modules/backend/facades/BackendMenu.php b/modules/backend/facades/BackendMenu.php index 8ec2a43..eb93dff 100644 --- a/modules/backend/facades/BackendMenu.php +++ b/modules/backend/facades/BackendMenu.php @@ -6,10 +6,10 @@ class BackendMenu extends Facade { /** * Get the registered name of the component. - * + * * Resolves to: * - Backend\Classes\NavigationManager - * + * * @return string */ protected static function getFacadeAccessor() diff --git a/modules/backend/formwidgets/CodeEditor.php b/modules/backend/formwidgets/CodeEditor.php index ecf8228..e6dd6a1 100644 --- a/modules/backend/formwidgets/CodeEditor.php +++ b/modules/backend/formwidgets/CodeEditor.php @@ -107,17 +107,21 @@ class CodeEditor extends FormWidgetBase // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'codeeditor'; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { $this->applyEditorPreferences(); + if ($this->formField->disabled) { + $this->readOnly = true; + } + $this->fillFromConfig([ 'language', 'showGutter', @@ -140,7 +144,7 @@ public function init() } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -167,7 +171,6 @@ public function prepareVars() $this->vars['margin'] = $this->margin; $this->vars['stretch'] = $this->formField->stretch; $this->vars['size'] = $this->formField->size; - $this->vars['name'] = $this->formField->getName(); $this->vars['readOnly'] = $this->readOnly; $this->vars['autocompletion'] = $this->autocompletion; $this->vars['enableSnippets'] = $this->enableSnippets; @@ -176,10 +179,11 @@ public function prepareVars() // Double encode when escaping $this->vars['value'] = htmlentities($this->getLoadValue(), ENT_QUOTES, 'UTF-8', true); + $this->vars['name'] = $this->getFieldName(); } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { diff --git a/modules/backend/formwidgets/ColorPicker.php b/modules/backend/formwidgets/ColorPicker.php index 78c54cc..10ac582 100644 --- a/modules/backend/formwidgets/ColorPicker.php +++ b/modules/backend/formwidgets/ColorPicker.php @@ -31,27 +31,39 @@ class ColorPicker extends FormWidgetBase '#95a5a6', '#7f8c8d', ]; + /** + * @var bool Allow empty value + */ + public $allowEmpty = false; + + /** + * @var bool Show opacity slider + */ + public $showAlpha = false; + // // Object properties // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'colorpicker'; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { $this->fillFromConfig([ 'availableColors', + 'allowEmpty', + 'showAlpha', ]); } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -64,25 +76,27 @@ public function render() */ public function prepareVars() { - $this->vars['name'] = $this->formField->getName(); + $this->vars['name'] = $this->getFieldName(); $this->vars['value'] = $value = $this->getLoadValue(); $this->vars['availableColors'] = $this->availableColors; + $this->vars['allowEmpty'] = $this->allowEmpty; + $this->vars['showAlpha'] = $this->showAlpha; $this->vars['isCustomColor'] = !in_array($value, $this->availableColors); } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { - $this->addCss('vendor/colpick/css/colpick.css', 'core'); - $this->addJs('vendor/colpick/js/colpick.js', 'core'); + $this->addCss('vendor/spectrum/spectrum.css', 'core'); + $this->addJs('vendor/spectrum/spectrum.js', 'core'); $this->addCss('css/colorpicker.css', 'core'); $this->addJs('js/colorpicker.js', 'core'); } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { diff --git a/modules/backend/formwidgets/DataTable.php b/modules/backend/formwidgets/DataTable.php index 18767c2..faf9bc0 100644 --- a/modules/backend/formwidgets/DataTable.php +++ b/modules/backend/formwidgets/DataTable.php @@ -35,7 +35,7 @@ class DataTable extends FormWidgetBase // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'datatable'; @@ -45,7 +45,7 @@ class DataTable extends FormWidgetBase protected $table; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { @@ -67,7 +67,7 @@ public function getTable() } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -87,7 +87,7 @@ public function prepareVars() } /** - * {@inheritDoc} + * @inheritDoc */ public function getLoadValue() { @@ -103,7 +103,7 @@ public function getLoadValue() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { diff --git a/modules/backend/formwidgets/DatePicker.php b/modules/backend/formwidgets/DatePicker.php index 61d8405..b10789b 100644 --- a/modules/backend/formwidgets/DatePicker.php +++ b/modules/backend/formwidgets/DatePicker.php @@ -40,17 +40,29 @@ class DatePicker extends FormWidgetBase */ public $maxDate = null; + /** + * @var string number of years either side or array of upper/lower range + * eg: 10 or [1900,1999] + */ + public $yearRange = null; + + /** + * @var int first day of the week + * eg: 0 (Sunday), 1 (Monday), 2 (Tuesday), etc. + */ + public $firstDay = 0; + // // Object properties // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'datepicker'; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { @@ -59,6 +71,8 @@ public function init() 'mode', 'minDate', 'maxDate', + 'yearRange', + 'firstDay', ]); $this->mode = strtolower($this->mode); @@ -77,7 +91,7 @@ public function init() } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -98,19 +112,21 @@ public function prepareVars() $value = $value instanceof Carbon ? $value->toDateTimeString() : $value; } - $this->vars['name'] = $this->formField->getName(); + $this->vars['name'] = $this->getFieldName(); $this->vars['value'] = $value ?: ''; $this->vars['field'] = $this->formField; $this->vars['mode'] = $this->mode; $this->vars['minDate'] = $this->minDate; $this->vars['maxDate'] = $this->maxDate; + $this->vars['yearRange'] = $this->yearRange; + $this->vars['firstDay'] = $this->firstDay; $this->vars['format'] = $this->format; $this->vars['formatMoment'] = $this->getDateFormatMoment(); $this->vars['formatAlias'] = $this->getDateFormatAlias(); } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { diff --git a/modules/backend/formwidgets/FileUpload.php b/modules/backend/formwidgets/FileUpload.php index 40aa520..1e16dd3 100644 --- a/modules/backend/formwidgets/FileUpload.php +++ b/modules/backend/formwidgets/FileUpload.php @@ -13,7 +13,6 @@ use ValidationException; use Exception; - /** * File upload field * Renders a form file uploader field. @@ -77,12 +76,12 @@ class FileUpload extends FormWidgetBase // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'fileupload'; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { @@ -96,11 +95,15 @@ public function init() 'useCaption' ]); + if ($this->formField->disabled) { + $this->previewMode = true; + } + $this->checkUploadPostback(); } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -142,7 +145,7 @@ protected function getFileList() /* * Decorate each file with thumb and custom download path */ - $list->each(function($file) { + $list->each(function ($file) { $this->decorateFileAttributes($file); }); @@ -242,7 +245,7 @@ public function getAcceptedFileTypes($includeDot = false) $types = explode(',', $types); } - $types = array_map(function($value) use ($includeDot) { + $types = array_map(function ($value) use ($includeDot) { $value = trim($value); if (substr($value, 0, 1) == '.') { @@ -328,7 +331,7 @@ public function onSaveAttachmentConfig() } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { @@ -337,7 +340,7 @@ protected function loadAssets() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { diff --git a/modules/backend/formwidgets/MarkdownEditor.php b/modules/backend/formwidgets/MarkdownEditor.php index 4eb33d0..ec8a2e7 100644 --- a/modules/backend/formwidgets/MarkdownEditor.php +++ b/modules/backend/formwidgets/MarkdownEditor.php @@ -22,27 +22,33 @@ class MarkdownEditor extends FormWidgetBase */ public $mode = 'tab'; + /** + * @var bool Render preview with safe markdown. + */ + public $safe = false; + // // Object properties // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'markdown'; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { $this->fillFromConfig([ 'mode', + 'safe', ]); } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -58,12 +64,12 @@ public function prepareVars() $this->vars['mode'] = $this->mode; $this->vars['stretch'] = $this->formField->stretch; $this->vars['size'] = $this->formField->size; - $this->vars['name'] = $this->formField->getName(); + $this->vars['name'] = $this->getFieldName(); $this->vars['value'] = $this->getLoadValue(); } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { @@ -74,12 +80,13 @@ protected function loadAssets() public function onRefresh() { - $value = post($this->formField->getName()); - $previewHtml = Markdown::parse($value); + $value = post($this->getFieldName()); + $previewHtml = $this->safe + ? Markdown::parseSafe($value) + : Markdown::parse($value); return [ 'preview' => $previewHtml ]; } - } diff --git a/modules/backend/formwidgets/PermissionEditor.php b/modules/backend/formwidgets/PermissionEditor.php index a7bc8c8..51c66cf 100644 --- a/modules/backend/formwidgets/PermissionEditor.php +++ b/modules/backend/formwidgets/PermissionEditor.php @@ -12,20 +12,24 @@ */ class PermissionEditor extends FormWidgetBase { + protected $user; + public $mode; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { $this->fillFromConfig([ 'mode' ]); + + $this->user = BackendAuth::getUser(); } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -38,34 +42,36 @@ public function render() */ public function prepareVars() { - $this->vars['checkboxMode'] = $this->getControlMode() === 'checkbox'; + if ($this->formField->disabled) { + $this->previewMode = true; + } - $this->vars['permissions'] = BackendAuth::listTabbedPermissions(); - $this->vars['baseFieldName'] = $this->formField->getName(); $permissionsData = $this->formField->getValueFromData($this->model); - if (!is_array($permissionsData)) { $permissionsData = []; } + $this->vars['checkboxMode'] = $this->getControlMode() === 'checkbox'; + $this->vars['permissions'] = $this->getFilteredPermissions(); + $this->vars['baseFieldName'] = $this->getFieldName(); $this->vars['permissionsData'] = $permissionsData; $this->vars['field'] = $this->formField; } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { - if (is_array($value)) { - return $value; + if ($this->user->isSuperUser()) { + return is_array($value) ? $value : []; } - return []; + return $this->getSaveValueSecure($value); } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { @@ -77,4 +83,69 @@ protected function getControlMode() { return strlen($this->mode) ? $this->mode : 'radio'; } -} \ No newline at end of file + + /** + * Returns a safely parsed set of permissions, ensuring the user cannot elevate + * their own permissions or permissions of another user above their own. + * + * @param string $value + * @return array + */ + protected function getSaveValueSecure($value) + { + $newPermissions = is_array($value) ? array_map('intval', $value) : []; + + if (!empty($newPermissions)) { + $existingPermissions = $this->model->permissions; + + $allowedPermissions = array_map(function ($permissionObject) { + return $permissionObject->code; + }, array_flatten($this->getFilteredPermissions())); + + foreach ($newPermissions as $permission => $code) { + if ($code === 0) { + continue; + } + + if (in_array($permission, $allowedPermissions)) { + $existingPermissions[$permission] = $code; + } + } + + $newPermissions = $existingPermissions; + } + + return $newPermissions; + } + + /** + * Returns the available permissions; removing those that the logged-in user does not have access to + * + * @return array The permissions that the logged-in user does have access to + */ + protected function getFilteredPermissions() + { + $permissions = BackendAuth::listTabbedPermissions(); + + if ($this->user->isSuperUser()) { + return $permissions; + } + + foreach ($permissions as $tab => $permissionsArray) { + foreach ($permissionsArray as $index => $permission) { + if (!$this->user->hasAccess($permission->code)) { + unset($permissionsArray[$index]); + } + } + + if (empty($permissionsArray)) { + unset($permissions[$tab]); + } + else { + $permissions[$tab] = $permissionsArray; + } + } + + return $permissions; + } +} diff --git a/modules/backend/formwidgets/RecordFinder.php b/modules/backend/formwidgets/RecordFinder.php index 6342971..232010b 100644 --- a/modules/backend/formwidgets/RecordFinder.php +++ b/modules/backend/formwidgets/RecordFinder.php @@ -86,7 +86,7 @@ class RecordFinder extends FormWidgetBase // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'recordfinder'; @@ -106,7 +106,7 @@ class RecordFinder extends FormWidgetBase protected $searchWidget; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { @@ -143,7 +143,7 @@ public function init() } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -154,7 +154,16 @@ public function render() public function onRefresh() { list($model, $attribute) = $this->resolveModelAttribute($this->valueFrom); - $model->{$attribute} = post($this->formField->getName()); + $model->{$attribute} = post($this->getFieldName()); + + $this->prepareVars(); + return ['#'.$this->getId('container') => $this->makePartial('recordfinder')]; + } + + public function onClearRecord() + { + list($model, $attribute) = $this->resolveModelAttribute($this->valueFrom); + $model->{$attribute} = null; $this->prepareVars(); return ['#'.$this->getId('container') => $this->makePartial('recordfinder')]; @@ -167,6 +176,10 @@ public function prepareVars() { $this->relationModel = $this->getLoadValue(); + if ($this->formField->disabled) { + $this->previewMode = true; + } + $this->vars['value'] = $this->getKeyValue(); $this->vars['field'] = $this->formField; $this->vars['nameValue'] = $this->getNameValue(); @@ -178,7 +191,7 @@ public function prepareVars() } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { @@ -186,7 +199,7 @@ protected function loadAssets() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { @@ -194,7 +207,7 @@ public function getSaveValue($value) } /** - * {@inheritDoc} + * @inheritDoc */ public function getLoadValue() { @@ -266,17 +279,17 @@ protected function makeListWidget() ]); if ($sqlConditions = $this->conditions) { - $widget->bindEvent('list.extendQueryBefore', function($query) use ($sqlConditions) { + $widget->bindEvent('list.extendQueryBefore', function ($query) use ($sqlConditions) { $query->whereRaw($sqlConditions); }); } elseif ($scopeMethod = $this->scope) { - $widget->bindEvent('list.extendQueryBefore', function($query) use ($scopeMethod) { + $widget->bindEvent('list.extendQueryBefore', function ($query) use ($scopeMethod) { $query->$scopeMethod($this->model); }); } else { - $widget->bindEvent('list.extendQueryBefore', function($query) { + $widget->bindEvent('list.extendQueryBefore', function ($query) { $this->getRelationObject()->addDefinedConstraintsToQuery($query); }); } diff --git a/modules/backend/formwidgets/Relation.php b/modules/backend/formwidgets/Relation.php index 17aef5e..27f8259 100644 --- a/modules/backend/formwidgets/Relation.php +++ b/modules/backend/formwidgets/Relation.php @@ -28,11 +28,6 @@ class Relation extends FormWidgetBase */ public $nameFrom = 'name'; - /** - * @var string Model column to use for the description reference - */ - public $descriptionFrom = 'description'; - /** * @var string Custom SQL column selection to use for the name reference */ @@ -43,12 +38,17 @@ class Relation extends FormWidgetBase */ public $emptyOption; + /** + * @var string Use a custom scope method for the list query. + */ + public $scope; + // // Object properties // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'relation'; @@ -58,14 +58,14 @@ class Relation extends FormWidgetBase public $renderFormField; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { $this->fillFromConfig([ 'nameFrom', - 'descriptionFrom', 'emptyOption', + 'scope', ]); if (isset($this->config->select)) { @@ -74,7 +74,7 @@ public function init() } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -118,6 +118,10 @@ protected function makeRenderFormField() $query->where($relationModel->getKeyName(), '<>', $model->getKey()); } + if ($scopeMethod = $this->scope) { + $query->$scopeMethod($model); + } + // Even though "no constraints" is applied, belongsToMany constrains the query // by joining its pivot table. Remove all joins from the query. $query->getQuery()->getQuery()->joins = []; @@ -139,16 +143,22 @@ protected function makeRenderFormField() $result = $query->getQuery()->get(); } + // Some simpler relations can specify a custom local or foreign "other" key, + // which can be detected and implemented here automagically. + $primaryKeyName = in_array($relationType, ['hasMany', 'belongsTo', 'hasOne']) + ? $relationObject->getOtherKey() + : $relationModel->getKeyName(); + $field->options = $usesTree - ? $result->listsNested($nameFrom, $relationModel->getKeyName()) - : $result->lists($nameFrom, $relationModel->getKeyName()); + ? $result->listsNested($nameFrom, $primaryKeyName) + : $result->lists($nameFrom, $primaryKeyName); return $field; }); } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { diff --git a/modules/backend/formwidgets/Repeater.php b/modules/backend/formwidgets/Repeater.php index 42cc754..efec0c1 100644 --- a/modules/backend/formwidgets/Repeater.php +++ b/modules/backend/formwidgets/Repeater.php @@ -2,6 +2,7 @@ use Backend\Classes\FormField; use Backend\Classes\FormWidgetBase; +use ApplicationException; /** * Repeater Form Widget @@ -9,6 +10,7 @@ class Repeater extends FormWidgetBase { const INDEX_PREFIX = '___index_'; + const GROUP_PREFIX = '___group_'; // // Configurable properties @@ -29,32 +31,56 @@ class Repeater extends FormWidgetBase */ public $sortable = false; + /** + * @var int Maximum repeated items allowable. + */ + public $maxItems = null; + // // Object properties // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'repeater'; + /** + * @var string Form field name for capturing an index. + */ + protected $indexInputName; + /** * @var int Count of repeated items. */ protected $indexCount = 0; + /** + * @var array Meta data associated to each field, organised by index + */ + protected $indexMeta = []; + /** * @var array Collection of form widgets. */ protected $formWidgets = []; - /** - * @var bool Stops nested repeaters populating from previous sibling. - */ + /** + * @var bool Stops nested repeaters populating from previous sibling. + */ protected static $onAddItemCalled = false; + protected $useGroups = false; + /** - * {@inheritDoc} + * @var string Form field name for capturing an index. + */ + protected $groupInputName; + + protected $groupDefinitions = []; + + /** + * @inheritDoc */ public function init() { @@ -62,15 +88,26 @@ public function init() 'form', 'prompt', 'sortable', + 'maxItems', ]); + if ($this->formField->disabled) { + $this->previewMode = true; + } + + $fieldName = $this->formField->getName(false); + $this->indexInputName = self::INDEX_PREFIX.$fieldName; + $this->groupInputName = self::GROUP_PREFIX.$fieldName; + + $this->processGroupMode(); + if (!self::$onAddItemCalled) { $this->processExistingItems(); } } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -83,13 +120,25 @@ public function render() */ public function prepareVars() { - $this->vars['indexName'] = self::INDEX_PREFIX.$this->formField->getName(false).'[]'; + if ($this->previewMode) { + foreach ($this->formWidgets as $widget) { + $widget->previewMode = true; + } + } + + $this->vars['indexInputName'] = $this->indexInputName; + $this->vars['groupInputName'] = $this->groupInputName; + $this->vars['prompt'] = $this->prompt; $this->vars['formWidgets'] = $this->formWidgets; + $this->vars['maxItems'] = $this->maxItems; + + $this->vars['useGroups'] = $this->useGroups; + $this->vars['groupDefinitions'] = $this->groupDefinitions; } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { @@ -98,60 +147,124 @@ protected function loadAssets() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { - return (array) $value; + return (array) $this->processSaveValue($value); } + /** + * Splices in some meta data (group and index values) to the dataset. + * @param array $value + * @return array + */ + protected function processSaveValue($value) + { + if (!is_array($value) || !$value) { + return $value; + } + + if ($this->useGroups) { + foreach ($value as $index => &$data) { + $data['_group'] = $this->getGroupCodeFromIndex($index); + } + } + + return array_values($value); + } + + /** + * Processes existing form data and applies it to the form widgets. + * @return void + */ protected function processExistingItems() { + $loadedIndexes = $loadedGroups = []; $loadValue = $this->getLoadValue(); + if (is_array($loadValue)) { - $loadValue = array_keys($loadValue); + foreach ($loadValue as $index => $loadedValue) { + $loadedIndexes[] = $index; + $loadedGroups[] = array_get($loadedValue, '_group'); + } } - $itemIndexes = post(self::INDEX_PREFIX.$this->formField->getName(false), $loadValue); + $itemIndexes = post($this->indexInputName, $loadedIndexes); + $itemGroups = post($this->groupInputName, $loadedGroups); - if (!is_array($itemIndexes)) { + if (!count($itemIndexes)) { return; } - foreach ($itemIndexes as $itemIndex) { - $this->makeItemFormWidget($itemIndex); + $items = array_combine( + (array) $itemIndexes, + (array) ($this->useGroups ? $itemGroups : $itemIndexes) + ); + + foreach ($items as $itemIndex => $groupCode) { + $this->makeItemFormWidget($itemIndex, $groupCode); $this->indexCount = max((int) $itemIndex, $this->indexCount); } } - protected function makeItemFormWidget($index = 0) + /** + * Creates a form widget based on a field index and optional group code. + * @param int $index + * @param string $index + * @return \Backend\Widgets\Form + */ + protected function makeItemFormWidget($index = 0, $groupCode = null) { - $loadValue = $this->getLoadValue(); - if (!is_array($loadValue)) { - $loadValue = []; - } + $configDefinition = $this->useGroups + ? $this->getGroupFormFieldConfig($groupCode) + : $this->form; - $config = $this->makeConfig($this->form); + $config = $this->makeConfig($configDefinition); $config->model = $this->model; - $config->data = array_get($loadValue, $index, []); + $config->data = $this->getLoadValueFromIndex($index); $config->alias = $this->alias . 'Form'.$index; - $config->arrayName = $this->formField->getName().'['.$index.']'; + $config->arrayName = $this->getFieldName().'['.$index.']'; $config->isNested = true; $widget = $this->makeWidget('Backend\Widgets\Form', $config); $widget->bindToController(); + $this->indexMeta[$index] = [ + 'groupCode' => $groupCode + ]; + return $this->formWidgets[$index] = $widget; } + /** + * Returns the load data at a given index. + * @param int $index + */ + protected function getLoadValueFromIndex($index) + { + $loadValue = $this->getLoadValue(); + if (!is_array($loadValue)) { + $loadValue = []; + } + + return array_get($loadValue, $index, []); + } + + // + // AJAX handlers + // + public function onAddItem() { self::$onAddItemCalled = true; $this->indexCount++; + $groupCode = post('_repeater_group'); + $this->prepareVars(); - $this->vars['widget'] = $this->makeItemFormWidget($this->indexCount); + $this->vars['widget'] = $this->makeItemFormWidget($this->indexCount, $groupCode); $this->vars['indexValue'] = $this->indexCount; $itemContainer = '@#'.$this->getId('items'); @@ -166,9 +279,85 @@ public function onRemoveItem() public function onRefresh() { $index = post('_repeater_index'); + $group = post('_repeater_group'); - $widget = $this->makeItemFormWidget($index); + $widget = $this->makeItemFormWidget($index, $group); return $widget->onRefresh(); } + + // + // Group mode + // + + /** + * Returns the form field configuration for a group, identified by code. + * @param string $code + * @return array|null + */ + protected function getGroupFormFieldConfig($code) + { + if (!$code) { + return null; + } + + $fields = array_get($this->groupDefinitions, $code.'.fields'); + + if (!$fields) { + return null; + } + + return ['fields' => $fields]; + } + + /** + * Process features related to group mode. + * @return void + */ + protected function processGroupMode() + { + $palette = []; + + if (!$group = $this->getConfig('groups', [])) { + $this->useGroups = false; + return; + } + + if (is_string($group)) { + $group = $this->makeConfig($group); + } + + foreach ($group as $code => $config) { + $palette[$code] = [ + 'code' => $code, + 'name' => array_get($config, 'name'), + 'icon' => array_get($config, 'icon', 'icon-square-o'), + 'description' => array_get($config, 'description'), + 'fields' => array_get($config, 'fields') + ]; + } + + $this->groupDefinitions = $palette; + $this->useGroups = true; + } + + /** + * Returns a field group code from its index. + * @param $index int + * @return string + */ + public function getGroupCodeFromIndex($index) + { + return array_get($this->indexMeta, $index.'.groupCode'); + } + + /** + * Returns the group title from its unique code. + * @param $groupCode string + * @return string + */ + public function getGroupTitle($groupCode) + { + return array_get($this->groupDefinitions, $groupCode.'.name'); + } } diff --git a/modules/backend/formwidgets/RichEditor.php b/modules/backend/formwidgets/RichEditor.php index 753d004..75a291b 100644 --- a/modules/backend/formwidgets/RichEditor.php +++ b/modules/backend/formwidgets/RichEditor.php @@ -31,28 +31,38 @@ class RichEditor extends FormWidgetBase */ public $toolbarButtons = null; + /** + * @var boolean If true, the editor is set to read-only mode + */ + public $readOnly = false; + // // Object properties // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'richeditor'; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { + if ($this->formField->disabled) { + $this->readOnly = true; + } + $this->fillFromConfig([ 'fullPage', + 'readOnly', 'toolbarButtons', ]); } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -70,10 +80,12 @@ public function prepareVars() $this->vars['fullPage'] = $this->fullPage; $this->vars['stretch'] = $this->formField->stretch; $this->vars['size'] = $this->formField->size; - $this->vars['name'] = $this->formField->getName(); + $this->vars['readOnly'] = $this->readOnly; + $this->vars['name'] = $this->getFieldName(); $this->vars['value'] = $this->getLoadValue(); $this->vars['toolbarButtons'] = $this->evalToolbarButtons(); + $this->vars['globalToolbarButtons'] = EditorSetting::getConfigured('html_toolbar_buttons'); $this->vars['allowEmptyTags'] = EditorSetting::getConfigured('html_allow_empty_tags'); $this->vars['allowTags'] = EditorSetting::getConfigured('html_allow_tags'); $this->vars['noWrapTags'] = EditorSetting::getConfigured('html_no_wrap_tags'); @@ -95,7 +107,7 @@ protected function evalToolbarButtons() $buttons = $this->toolbarButtons; if (is_string($buttons)) { - $buttons = array_map(function($button) { + $buttons = array_map(function ($button) { return strlen($button) ? $button : '|'; }, explode('|', $buttons)); } @@ -110,7 +122,7 @@ public function onLoadPageLinksForm() } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { @@ -199,7 +211,7 @@ protected function getPageLinksArray() $links[] = ['name' => Lang::get('backend::lang.pagelist.select_page'), 'url' => false]; - $iterator = function($links, $level = 0) use (&$iterator) { + $iterator = function ($links, $level = 0) use (&$iterator) { $result = []; foreach ($links as $linkUrl => $link) { diff --git a/modules/backend/formwidgets/TagList.php b/modules/backend/formwidgets/TagList.php index 5aab761..b0f594f 100644 --- a/modules/backend/formwidgets/TagList.php +++ b/modules/backend/formwidgets/TagList.php @@ -47,12 +47,12 @@ class TagList extends FormWidgetBase // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'taglist'; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { @@ -66,7 +66,7 @@ public function init() } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { @@ -86,7 +86,7 @@ public function prepareVars() } /** - * {@inheritDoc} + * @inheritDoc */ public function getSaveValue($value) { @@ -122,14 +122,14 @@ protected function hydrateRelationSaveValue($names) foreach ($newTags as $newTag) { $newModel = $relationModel::create([$this->nameFrom => $newTag]); - $existingTags[$newModel->id] = $newTag; + $existingTags[$newModel->getKey()] = $newTag; } return array_keys($existingTags); } /** - * {@inheritDoc} + * @inheritDoc */ public function getLoadValue() { diff --git a/modules/backend/formwidgets/codeeditor/assets/css/codeeditor.css b/modules/backend/formwidgets/codeeditor/assets/css/codeeditor.css index efd37d4..a28b817 100644 --- a/modules/backend/formwidgets/codeeditor/assets/css/codeeditor.css +++ b/modules/backend/formwidgets/codeeditor/assets/css/codeeditor.css @@ -6,7 +6,7 @@ .field-codeeditor.size-large{min-height:200px} .field-codeeditor.size-huge{min-height:250px} .field-codeeditor.size-giant{min-height:350px} -.field-codeeditor .ace_search{font-family:sans-serif;font-size:14px;color:#333333;z-index:13} +.field-codeeditor .ace_search{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;color:#333333;z-index:13} .field-codeeditor .editor-code{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px} .field-codeeditor .editor-toolbar{position:absolute;top:10px;right:10px;z-index:10} .field-codeeditor .editor-toolbar > ul,.field-codeeditor .editor-toolbar ul > li{list-style-type:none;padding:0;margin:0} diff --git a/modules/backend/formwidgets/codeeditor/assets/js/build-min.js b/modules/backend/formwidgets/codeeditor/assets/js/build-min.js index e4a4dd3..69a59b7 100644 --- a/modules/backend/formwidgets/codeeditor/assets/js/build-min.js +++ b/modules/backend/formwidgets/codeeditor/assets/js/build-min.js @@ -1022,7 +1022,8 @@ toString=input.toString;if(typeof toString==="function"){val=toString.call(input throw new TypeError();} var toObject=function(o){if(o==null){throw new TypeError("can't convert "+o+" to object");} return Object(o);};});ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/regexp","ace/lib/es5-shim"],function(require,exports,module){"use strict";require("./regexp");require("./es5-shim");});ace.define("ace/lib/dom",["require","exports","module"],function(require,exports,module){"use strict";var XHTML_NS="http://www.w3.org/1999/xhtml";exports.getDocumentHead=function(doc){if(!doc) -doc=document;return doc.head||doc.getElementsByTagName("head")[0]||doc.documentElement;};exports.createElement=function(tag,ns){return document.createElementNS?document.createElementNS(ns||XHTML_NS,tag):document.createElement(tag);};exports.hasCssClass=function(el,name){var classes=(el.className||"").split(/\s+/g);return classes.indexOf(name)!==-1;};exports.addCssClass=function(el,name){if(!exports.hasCssClass(el,name)){el.className+=" "+name;}};exports.removeCssClass=function(el,name){var classes=el.className.split(/\s+/g);while(true){var index=classes.indexOf(name);if(index==-1){break;} +doc=document;return doc.head||doc.getElementsByTagName("head")[0]||doc.documentElement;} +exports.createElement=function(tag,ns){return document.createElementNS?document.createElementNS(ns||XHTML_NS,tag):document.createElement(tag);};exports.hasCssClass=function(el,name){var classes=(el.className+"").split(/\s+/g);return classes.indexOf(name)!==-1;};exports.addCssClass=function(el,name){if(!exports.hasCssClass(el,name)){el.className+=" "+name;}};exports.removeCssClass=function(el,name){var classes=el.className.split(/\s+/g);while(true){var index=classes.indexOf(name);if(index==-1){break;} classes.splice(index,1);} el.className=classes.join(" ");};exports.toggleCssClass=function(el,name){var classes=el.className.split(/\s+/g),add=true;while(true){var index=classes.indexOf(name);if(index==-1){break;} add=false;classes.splice(index,1);} @@ -1053,7 +1054,7 @@ return obj;};exports.implement=function(proto,mixin){exports.mixin(proto,mixin); for(i in ret.PRINTABLE_KEYS){name=ret.PRINTABLE_KEYS[i].toLowerCase();ret[name]=parseInt(i,10);} oop.mixin(ret,ret.MODIFIER_KEYS);oop.mixin(ret,ret.PRINTABLE_KEYS);oop.mixin(ret,ret.FUNCTION_KEYS);ret.enter=ret["return"];ret.escape=ret.esc;ret.del=ret["delete"];ret[173]='-';(function(){var mods=["cmd","ctrl","alt","shift"];for(var i=Math.pow(2,mods.length);i--;){ret.KEY_MODS[i]=mods.filter(function(x){return i&ret.KEY_MODS[x];}).join("-")+"-";}})();ret.KEY_MODS[0]="";ret.KEY_MODS[-1]="input-";return ret;})();oop.mixin(exports,Keys);exports.keyCodeToString=function(keyCode){var keyString=Keys[keyCode];if(typeof keyString!="string") keyString=String.fromCharCode(keyCode);return keyString.toLowerCase();};});ace.define("ace/lib/useragent",["require","exports","module"],function(require,exports,module){"use strict";exports.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"};exports.getOS=function(){if(exports.isMac){return exports.OS.MAC;}else if(exports.isLinux){return exports.OS.LINUX;}else{return exports.OS.WINDOWS;}};if(typeof navigator!="object") -return;var os=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var ua=navigator.userAgent;exports.isWin=(os=="win");exports.isMac=(os=="mac");exports.isLinux=(os=="linux");exports.isIE=(navigator.appName=="Microsoft Internet Explorer"||navigator.appName.indexOf("MSAppHost")>=0)?parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]);exports.isOldIE=exports.isIE&&exports.isIE<9;exports.isGecko=exports.isMozilla=(window.Controllers||window.controllers)&&window.navigator.product==="Gecko";exports.isOldGecko=exports.isGecko&&parseInt((ua.match(/rv\:(\d+)/)||[])[1],10)<4;exports.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]";exports.isWebKit=parseFloat(ua.split("WebKit/")[1])||undefined;exports.isChrome=parseFloat(ua.split(" Chrome/")[1])||undefined;exports.isAIR=ua.indexOf("AdobeAIR")>=0;exports.isIPad=ua.indexOf("iPad")>=0;exports.isTouchPad=ua.indexOf("TouchPad")>=0;exports.isChromeOS=ua.indexOf(" CrOS ")>=0;});ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(require,exports,module){"use strict";var keys=require("./keys");var useragent=require("./useragent");var pressedKeys=null;var ts=0;exports.addListener=function(elem,type,callback){if(elem.addEventListener){return elem.addEventListener(type,callback,false);} +return;var os=(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase();var ua=navigator.userAgent;exports.isWin=(os=="win");exports.isMac=(os=="mac");exports.isLinux=(os=="linux");exports.isIE=(navigator.appName=="Microsoft Internet Explorer"||navigator.appName.indexOf("MSAppHost")>=0)?parseFloat((ua.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((ua.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]);exports.isOldIE=exports.isIE&&exports.isIE<9;exports.isGecko=exports.isMozilla=(window.Controllers||window.controllers)&&window.navigator.product==="Gecko";exports.isOldGecko=exports.isGecko&&parseInt((ua.match(/rv:(\d+)/)||[])[1],10)<4;exports.isOpera=window.opera&&Object.prototype.toString.call(window.opera)=="[object Opera]";exports.isWebKit=parseFloat(ua.split("WebKit/")[1])||undefined;exports.isChrome=parseFloat(ua.split(" Chrome/")[1])||undefined;exports.isAIR=ua.indexOf("AdobeAIR")>=0;exports.isIPad=ua.indexOf("iPad")>=0;exports.isTouchPad=ua.indexOf("TouchPad")>=0;exports.isChromeOS=ua.indexOf(" CrOS ")>=0;});ace.define("ace/lib/event",["require","exports","module","ace/lib/keys","ace/lib/useragent"],function(require,exports,module){"use strict";var keys=require("./keys");var useragent=require("./useragent");var pressedKeys=null;var ts=0;exports.addListener=function(elem,type,callback){if(elem.addEventListener){return elem.addEventListener(type,callback,false);} if(elem.attachEvent){var wrapper=function(){callback.call(elem,window.event);};callback._wrapper=wrapper;elem.attachEvent("on"+type,wrapper);}};exports.removeListener=function(elem,type,callback){if(elem.removeEventListener){return elem.removeEventListener(type,callback,false);} if(elem.detachEvent){elem.detachEvent("on"+type,callback._wrapper||callback);}};exports.stopEvent=function(e){exports.stopPropagation(e);exports.preventDefault(e);return false;};exports.stopPropagation=function(e){if(e.stopPropagation) e.stopPropagation();else @@ -1078,7 +1079,7 @@ function onDblclick(e){clicks=2;if(timer) clearTimeout(timer);timer=setTimeout(function(){timer=null},timeouts[clicks-1]||600);eventHandler[callbackName]("mousedown",e);eventHandler[callbackName](eventNames[clicks],e);} if(!Array.isArray(elements)) elements=[elements];elements.forEach(function(el){exports.addListener(el,"mousedown",onMousedown);if(useragent.isOldIE) -exports.addListener(el,"dblclick",onDblclick);});};var getModifierHash=useragent.isMac&&useragent.isOpera&&!("KeyboardEvent"in window)?function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0);}:function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0);};exports.getModifierString=function(e){return keys.KEY_MODS[getModifierHash(e)];};function normalizeCommandKeys(callback,e,keyCode){var hashId=getModifierHash(e);if(!useragent.isMac&&pressedKeys){if(pressedKeys.OSKey) +exports.addListener(el,"dblclick",onDblclick);});};var getModifierHash=useragent.isMac&&useragent.isOpera&&!("KeyboardEvent"in window)?function(e){return 0|(e.metaKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.ctrlKey?8:0);}:function(e){return 0|(e.ctrlKey?1:0)|(e.altKey?2:0)|(e.shiftKey?4:0)|(e.metaKey?8:0);};exports.getModifierString=function(e){return keys.KEY_MODS[getModifierHash(e)];};function normalizeCommandKeys(callback,e,keyCode){var hashId=getModifierHash(e);if(!useragent.isMac&&pressedKeys){if(e.getModifierState&&(e.getModifierState("OS")||e.getModifierState("Win"))) hashId|=8;if(pressedKeys.altGr){if((3&hashId)!=3) pressedKeys.altGr=0;else return;} @@ -1094,12 +1095,7 @@ return;else hashId&=~8;} if(!hashId&&!(keyCode in keys.FUNCTION_KEYS)&&!(keyCode in keys.PRINTABLE_KEYS)){return false;} return callback(e,hashId,keyCode);} -exports.addCommandKeyListener=function(el,callback){var addListener=exports.addListener;if(useragent.isOldGecko||(useragent.isOpera&&!("KeyboardEvent"in window))){var lastKeyDownKeyCode=null;addListener(el,"keydown",function(e){lastKeyDownKeyCode=e.keyCode;});addListener(el,"keypress",function(e){return normalizeCommandKeys(callback,e,lastKeyDownKeyCode);});}else{var lastDefaultPrevented=null;addListener(el,"keydown",function(e){var keyCode=e.keyCode;pressedKeys[keyCode]=(pressedKeys[keyCode]||0)+1;if(keyCode==91||keyCode==92){pressedKeys.OSKey=true;}else if(pressedKeys.OSKey){if(e.timeStamp-pressedKeys.lastT>200&&pressedKeys.count==1) -resetPressedKeys();} -if(pressedKeys[keyCode]==1) -pressedKeys.count++;pressedKeys.lastT=e.timeStamp;var result=normalizeCommandKeys(callback,e,keyCode);lastDefaultPrevented=e.defaultPrevented;return result;});addListener(el,"keypress",function(e){if(lastDefaultPrevented&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)){exports.stopEvent(e);lastDefaultPrevented=null;}});addListener(el,"keyup",function(e){var keyCode=e.keyCode;if(!pressedKeys[keyCode]){resetPressedKeys();}else{pressedKeys.count=Math.max(pressedKeys.count-1,0);} -if(keyCode==91||keyCode==92){pressedKeys.OSKey=false;} -pressedKeys[keyCode]=null;});if(!pressedKeys){resetPressedKeys();addListener(window,"focus",resetPressedKeys);}}};function resetPressedKeys(){pressedKeys=Object.create(null);pressedKeys.count=0;pressedKeys.lastT=0;} +exports.addCommandKeyListener=function(el,callback){var addListener=exports.addListener;if(useragent.isOldGecko||(useragent.isOpera&&!("KeyboardEvent"in window))){var lastKeyDownKeyCode=null;addListener(el,"keydown",function(e){lastKeyDownKeyCode=e.keyCode;});addListener(el,"keypress",function(e){return normalizeCommandKeys(callback,e,lastKeyDownKeyCode);});}else{var lastDefaultPrevented=null;addListener(el,"keydown",function(e){pressedKeys[e.keyCode]=(pressedKeys[e.keyCode]||0)+1;var result=normalizeCommandKeys(callback,e,e.keyCode);lastDefaultPrevented=e.defaultPrevented;return result;});addListener(el,"keypress",function(e){if(lastDefaultPrevented&&(e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)){exports.stopEvent(e);lastDefaultPrevented=null;}});addListener(el,"keyup",function(e){pressedKeys[e.keyCode]=null;});if(!pressedKeys){resetPressedKeys();addListener(window,"focus",resetPressedKeys);}}};function resetPressedKeys(){pressedKeys=Object.create(null);} if(typeof window=="object"&&window.postMessage&&!useragent.isOldIE){var postMessageId=1;exports.nextTick=function(callback,win){win=win||window;var messageName="zero-timeout-message-"+postMessageId;exports.addListener(win,"message",function listener(e){if(e.data==messageName){exports.stopPropagation(e);exports.removeListener(win,"message",listener);callback();}});win.postMessage(messageName,"*");};} exports.nextFrame=typeof window=="object"&&(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame);if(exports.nextFrame) exports.nextFrame=exports.nextFrame.bind(window);else @@ -1113,9 +1109,9 @@ copy[i]=array[i];} return copy;};exports.deepCopy=function deepCopy(obj){if(typeof obj!=="object"||!obj) return obj;var copy;if(Array.isArray(obj)){copy=[];for(var key=0;key=53){onInput();}};var syncComposition=lang.delayedCall(onCompositionUpdate,50);event.addListener(text,"compositionstart",onCompositionStart);if(useragent.isGecko){event.addListener(text,"text",function(){syncComposition.schedule()});}else{event.addListener(text,"keyup",function(){syncComposition.schedule()});event.addListener(text,"keydown",function(){syncComposition.schedule()});} event.addListener(text,"compositionend",onCompositionEnd);this.getElement=function(){return text;};this.setReadOnly=function(readOnly){text.readOnly=readOnly;};this.onContextMenu=function(e){afterContextMenu=true;resetSelection(host.selection.isEmpty());host._emit("nativecontextmenu",{target:host,domEvent:e});this.moveToMouse(e,true);};this.moveToMouse=function(e,bringToFront){if(!bringToFront&&useragent.isOldIE) return;if(!tempStyle) tempStyle=text.style.cssText;text.style.cssText=(bringToFront?"z-index:100000;":"") @@ -1214,9 +1213,9 @@ mouseHandler.setState("selectByLines");mouseHandler.captureMouse(e);return e.pre return hideTooltip();var maxRow=editor.session.getLength();if(row==maxRow){var screenRow=editor.renderer.pixelToScreenCoordinates(0,mouseEvent.y).row;var pos=mouseEvent.$pos;if(screenRow>editor.session.documentToScreenRow(pos.row,pos.column)) return hideTooltip();} if(tooltipAnnotation==annotation) -return;tooltipAnnotation=annotation.text.join("
    ");tooltip.setHtml(tooltipAnnotation);tooltip.show();editor.on("mousewheel",hideTooltip);if(mouseHandler.$tooltipFollowsMouse){moveTooltip(mouseEvent);}else{var gutterElement=mouseEvent.domEvent.target;var rect=gutterElement.getBoundingClientRect();var style=tooltip.getElement().style;style.left=rect.right+"px";style.top=rect.bottom+"px";}} +return;tooltipAnnotation=annotation.text.join("
    ");tooltip.setHtml(tooltipAnnotation);tooltip.show();editor._signal("showGutterTooltip",tooltip);editor.on("mousewheel",hideTooltip);if(mouseHandler.$tooltipFollowsMouse){moveTooltip(mouseEvent);}else{var gutterElement=mouseEvent.domEvent.target;var rect=gutterElement.getBoundingClientRect();var style=tooltip.getElement().style;style.left=rect.right+"px";style.top=rect.bottom+"px";}} function hideTooltip(){if(tooltipTimeout) -tooltipTimeout=clearTimeout(tooltipTimeout);if(tooltipAnnotation){tooltip.hide();tooltipAnnotation=null;editor.removeEventListener("mousewheel",hideTooltip);}} +tooltipTimeout=clearTimeout(tooltipTimeout);if(tooltipAnnotation){tooltip.hide();tooltipAnnotation=null;editor._signal("hideGutterTooltip",tooltip);editor.removeEventListener("mousewheel",hideTooltip);}} function moveTooltip(e){tooltip.setPosition(e.x,e.y);} mouseHandler.editor.setDefaultHandler("guttermousemove",function(e){var target=e.domEvent.target||e.domEvent.srcElement;if(dom.hasCssClass(target,"ace_fold-widget")) return hideTooltip();if(tooltipAnnotation&&mouseHandler.$tooltipFollowsMouse) @@ -1370,7 +1369,7 @@ if(success&&e&&hashId!=-1&&toExecute.passEvent!=true&&toExecute.command.passEven if(success) break;} if(!success&&hashId==-1){toExecute={command:"insertstring"};success=commands.exec("insertstring",this.$editor,keyString);} -if(success) +if(success&&this.$editor._signal) this.$editor._signal("keyboardActivity",toExecute);return success;};this.onCommandKey=function(e,hashId,keyCode){var keyString=keyUtil.keyCodeToString(keyCode);this.$callKeyboardHandlers(hashId,keyString,keyCode,e);};this.onTextInput=function(text){this.$callKeyboardHandlers(-1,text);};}).call(KeyBinding.prototype);exports.KeyBinding=KeyBinding;});ace.define("ace/range",["require","exports","module"],function(require,exports,module){"use strict";var comparePoints=function(p1,p2){return p1.row-p2.row||p1.column-p2.column;};var Range=function(startRow,startColumn,endRow,endColumn){this.start={row:startRow,column:startColumn};this.end={row:endRow,column:endColumn};};(function(){this.isEqual=function(range){return this.start.row===range.start.row&&this.end.row===range.end.row&&this.start.column===range.start.column&&this.end.column===range.end.column;};this.toString=function(){return("Range: ["+this.start.row+"/"+this.start.column+"] -> ["+this.end.row+"/"+this.end.column+"]");};this.contains=function(row,column){return this.compare(row,column)==0;};this.compareRange=function(range){var cmp,end=range.end,start=range.start;cmp=this.compare(end.row,end.column);if(cmp==1){cmp=this.compare(start.row,start.column);if(cmp==1){return 2;}else if(cmp==0){return 1;}else{return 0;}}else if(cmp==-1){return-2;}else{cmp=this.compare(start.row,start.column);if(cmp==-1){return-1;}else if(cmp==1){return 42;}else{return 0;}}};this.comparePoint=function(p){return this.compare(p.row,p.column);};this.containsRange=function(range){return this.comparePoint(range.start)==0&&this.comparePoint(range.end)==0;};this.intersects=function(range){var cmp=this.compareRange(range);return(cmp==-1||cmp==0||cmp==1);};this.isEnd=function(row,column){return this.end.row==row&&this.end.column==column;};this.isStart=function(row,column){return this.start.row==row&&this.start.column==column;};this.setStart=function(row,column){if(typeof row=="object"){this.start.column=row.column;this.start.row=row.row;}else{this.start.row=row;this.start.column=column;}};this.setEnd=function(row,column){if(typeof row=="object"){this.end.column=row.column;this.end.row=row.row;}else{this.end.row=row;this.end.column=column;}};this.inside=function(row,column){if(this.compare(row,column)==0){if(this.isEnd(row,column)||this.isStart(row,column)){return false;}else{return true;}} return false;};this.insideStart=function(row,column){if(this.compare(row,column)==0){if(this.isEnd(row,column)){return false;}else{return true;}} return false;};this.insideEnd=function(row,column){if(this.compare(row,column)==0){if(this.isStart(row,column)){return false;}else{return true;}} @@ -1546,15 +1545,33 @@ this.inherit=function(mode,filter){if(typeof mode==="function"){var behaviours=n this.addBehaviours(behaviours);} this.getBehaviours=function(filter){if(!filter){return this.$behaviours;}else{var ret={} for(var i=0;i=this.$rowTokens.length){this.$row+=1;if(!rowCount) rowCount=this.$session.getLength();if(this.$row>=rowCount){this.$row=rowCount-1;return null;} this.$rowTokens=this.$session.getTokens(this.$row);this.$tokenIndex=0;} return this.$rowTokens[this.$tokenIndex];};this.getCurrentToken=function(){return this.$rowTokens[this.$tokenIndex];};this.getCurrentTokenRow=function(){return this.$row;};this.getCurrentTokenColumn=function(){var rowTokens=this.$rowTokens;var tokenIndex=this.$tokenIndex;var column=rowTokens[tokenIndex].start;if(column!==undefined) return column;column=0;while(tokenIndex>0){tokenIndex-=1;column+=rowTokens[tokenIndex].value.length;} -return column;};this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()};};}).call(TokenIterator.prototype);exports.TokenIterator=TokenIterator;});ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(require,exports,module){"use strict";var Tokenizer=require("../tokenizer").Tokenizer;var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var Behaviour=require("./behaviour").Behaviour;var unicode=require("../unicode");var lang=require("../lib/lang");var TokenIterator=require("../token_iterator").TokenIterator;var Range=require("../range").Range;var Mode=function(){this.HighlightRules=TextHighlightRules;this.$behaviour=new Behaviour();};(function(){this.tokenRe=new RegExp("^[" +return column;};this.getCurrentTokenPosition=function(){return{row:this.$row,column:this.getCurrentTokenColumn()};};}).call(TokenIterator.prototype);exports.TokenIterator=TokenIterator;});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var lang=require("../../lib/lang");var SAFE_INSERT_IN_TOKENS=["text","paren.rparen","punctuation.operator"];var SAFE_INSERT_BEFORE_TOKENS=["text","paren.rparen","punctuation.operator","comment"];var context;var contextCache={};var initContext=function(editor){var id=-1;if(editor.multiSelect){id=editor.selection.index;if(contextCache.rangeCount!=editor.multiSelect.rangeCount) +contextCache={rangeCount:editor.multiSelect.rangeCount};} +if(contextCache[id]) +return context=contextCache[id];context=contextCache[id]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""};};var getWrapped=function(selection,selected,opening,closing){var rowDiff=selection.end.row-selection.start.row;return{text:opening+selected+closing,selection:[0,selection.start.column+1,rowDiff,selection.end.column+(rowDiff?0:1)]};};var CstyleBehaviour=function(){this.add("braces","insertion",function(state,action,editor,session,text){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(text=='{'){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="{"&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'{','}');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){if(/[\]\}\)]/.test(line[cursor.column])||editor.inMultiSelectMode){CstyleBehaviour.recordAutoInsert(editor,session,"}");return{text:'{}',selection:[1,1]};}else{CstyleBehaviour.recordMaybeInsert(editor,session,"{");return{text:'{',selection:[1,1]};}}}else if(text=='}'){initContext(editor);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar=='}'){var matching=session.$findOpeningBracket('}',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}else if(text=="\n"||text=="\r\n"){initContext(editor);var closing="";if(CstyleBehaviour.isMaybeInsertedClosing(cursor,line)){closing=lang.stringRepeat("}",context.maybeInsertedBrackets);CstyleBehaviour.clearMaybeInsertedClosing();} +var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==='}'){var openBracePos=session.findMatchingBracket({row:cursor.row,column:cursor.column+1},'}');if(!openBracePos) +return null;var next_indent=this.$getIndent(session.getLine(openBracePos.row));}else if(closing){var next_indent=this.$getIndent(line);}else{CstyleBehaviour.clearMaybeInsertedClosing();return;} +var indent=next_indent+session.getTabString();return{text:'\n'+indent+'\n'+next_indent+closing,selection:[1,indent.length,1,indent.length]};}else{CstyleBehaviour.clearMaybeInsertedClosing();}});this.add("braces","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='{'){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar=='}'){range.end.column++;return range;}else{context.maybeInsertedBrackets--;}}});this.add("parens","insertion",function(state,action,editor,session,text){if(text=='('){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'(',')');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,")");return{text:'()',selection:[1,1]};}}else if(text==')'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==')'){var matching=session.$findOpeningBracket(')',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("parens","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='('){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==')'){range.end.column++;return range;}}});this.add("brackets","insertion",function(state,action,editor,session,text){if(text=='['){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'[',']');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,"]");return{text:'[]',selection:[1,1]};}}else if(text==']'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==']'){var matching=session.$findOpeningBracket(']',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("brackets","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='['){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==']'){range.end.column++;return range;}}});this.add("string_dquotes","insertion",function(state,action,editor,session,text){if(text=='"'||text=="'"){if(this.lineCommentStart&&this.lineCommentStart.indexOf(text)!=-1) +return;initContext(editor);var quote=text;var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="'"&&selected!='"'&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,quote,quote);}else if(!selected){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var leftChar=line.substring(cursor.column-1,cursor.column);var rightChar=line.substring(cursor.column,cursor.column+1);var token=session.getTokenAt(cursor.row,cursor.column);var rightToken=session.getTokenAt(cursor.row,cursor.column+1);if(leftChar=="\\"&&token&&/escape/.test(token.type)) +return null;var stringBefore=token&&/string|escape/.test(token.type);var stringAfter=!rightToken||/string|escape/.test(rightToken.type);var pair;if(rightChar==quote){pair=stringBefore!==stringAfter;if(pair&&/string\.end/.test(rightToken.type)) +pair=false;}else{if(stringBefore&&!stringAfter) +return null;if(stringBefore&&stringAfter) +return null;var wordRe=session.$mode.tokenRe;wordRe.lastIndex=0;var isWordBefore=wordRe.test(leftChar);wordRe.lastIndex=0;var isWordAfter=wordRe.test(leftChar);if(isWordBefore||isWordAfter) +return null;if(rightChar&&!/[\s;,.})\]\\]/.test(rightChar)) +return null;pair=true;} +return{text:pair?quote+quote:"",selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});};CstyleBehaviour.isSaneInsertion=function(editor,session){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);if(!this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)){var iterator2=new TokenIterator(session,cursor.row,cursor.column+1);if(!this.$matchTokenType(iterator2.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)) +return false;} +iterator.stepForward();return iterator.getCurrentTokenRow()!==cursor.row||this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_BEFORE_TOKENS);};CstyleBehaviour.$matchTokenType=function(token,types){return types.indexOf(token.type||token)>-1;};CstyleBehaviour.recordAutoInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isAutoInsertedClosing(cursor,line,context.autoInsertedLineEnd[0])) +context.autoInsertedBrackets=0;context.autoInsertedRow=cursor.row;context.autoInsertedLineEnd=bracket+line.substr(cursor.column);context.autoInsertedBrackets++;};CstyleBehaviour.recordMaybeInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isMaybeInsertedClosing(cursor,line)) +context.maybeInsertedBrackets=0;context.maybeInsertedRow=cursor.row;context.maybeInsertedLineStart=line.substr(0,cursor.column)+bracket;context.maybeInsertedLineEnd=line.substr(cursor.column);context.maybeInsertedBrackets++;};CstyleBehaviour.isAutoInsertedClosing=function(cursor,line,bracket){return context.autoInsertedBrackets>0&&cursor.row===context.autoInsertedRow&&bracket===context.autoInsertedLineEnd[0]&&line.substr(cursor.column)===context.autoInsertedLineEnd;};CstyleBehaviour.isMaybeInsertedClosing=function(cursor,line){return context.maybeInsertedBrackets>0&&cursor.row===context.maybeInsertedRow&&line.substr(cursor.column)===context.maybeInsertedLineEnd&&line.substr(0,cursor.column)==context.maybeInsertedLineStart;};CstyleBehaviour.popAutoInsertedClosing=function(){context.autoInsertedLineEnd=context.autoInsertedLineEnd.substr(1);context.autoInsertedBrackets--;};CstyleBehaviour.clearMaybeInsertedClosing=function(){if(context){context.maybeInsertedBrackets=0;context.maybeInsertedRow=-1;}};oop.inherits(CstyleBehaviour,Behaviour);exports.CstyleBehaviour=CstyleBehaviour;});ace.define("ace/unicode",["require","exports","module"],function(require,exports,module){"use strict";exports.packages={};addUnicodePackage({L:"0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",Ll:"0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A",Lu:"0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A",Lt:"01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC",Lm:"02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F",Lo:"01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC",M:"0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26",Mn:"0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26",Mc:"0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC",Me:"0488048906DE20DD-20E020E2-20E4A670-A672",N:"0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nd:"0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19",Nl:"16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF",No:"00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835",P:"0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65",Pd:"002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D",Ps:"0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62",Pe:"0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63",Pi:"00AB2018201B201C201F20392E022E042E092E0C2E1C2E20",Pf:"00BB2019201D203A2E032E052E0A2E0D2E1D2E21",Pc:"005F203F20402054FE33FE34FE4D-FE4FFF3F",Po:"0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65",S:"0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD",Sm:"002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC",Sc:"002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6",Sk:"005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3",So:"00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD",Z:"002000A01680180E2000-200A20282029202F205F3000",Zs:"002000A01680180E2000-200A202F205F3000",Zl:"2028",Zp:"2029",C:"0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF",Cc:"0000-001F007F-009F",Cf:"00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB",Co:"E000-F8FF",Cs:"D800-DFFF",Cn:"03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF"});function addUnicodePackage(pack){var codePoint=/\w{4}/g;for(var name in pack) +exports.packages[name]=pack[name].replace(codePoint,"\\u$&");}});ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"],function(require,exports,module){"use strict";var Tokenizer=require("../tokenizer").Tokenizer;var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var CstyleBehaviour=require("./behaviour/cstyle").CstyleBehaviour;var unicode=require("../unicode");var lang=require("../lib/lang");var TokenIterator=require("../token_iterator").TokenIterator;var Range=require("../range").Range;var Mode=function(){this.HighlightRules=TextHighlightRules;};(function(){this.$defaultBehaviour=new CstyleBehaviour();this.tokenRe=new RegExp("^[" +unicode.packages.L +unicode.packages.Mn+unicode.packages.Mc +unicode.packages.Nd @@ -1562,7 +1579,7 @@ return column;};this.getCurrentTokenPosition=function(){return{row:this.$row,col +unicode.packages.L +unicode.packages.Mn+unicode.packages.Mc +unicode.packages.Nd -+unicode.packages.Pc+"\\$_]|\\s])+","g");this.getTokenizer=function(){if(!this.$tokenizer){this.$highlightRules=this.$highlightRules||new this.HighlightRules();this.$tokenizer=new Tokenizer(this.$highlightRules.getRules());} ++unicode.packages.Pc+"\\$_]|\\s])+","g");this.getTokenizer=function(){if(!this.$tokenizer){this.$highlightRules=this.$highlightRules||new this.HighlightRules(this.$highlightRuleConfig);this.$tokenizer=new Tokenizer(this.$highlightRules.getRules());} return this.$tokenizer;};this.lineCommentStart="";this.blockComment="";this.toggleCommentLines=function(state,session,startRow,endRow){var doc=session.doc;var ignoreBlankLines=true;var shouldRemove=true;var minIndent=Infinity;var tabSize=session.getTabSize();var insertAtTabStop=false;if(!this.lineCommentStart){if(!this.blockComment) return false;var lineCommentStart=this.blockComment.start;var lineCommentEnd=this.blockComment.end;var regexpStart=new RegExp("^(\\s*)(?:"+lang.escapeRegExp(lineCommentStart)+")");var regexpEnd=new RegExp("(?:"+lang.escapeRegExp(lineCommentEnd)+")\\s*$");var comment=function(line,i){if(testRemove(line,i)) return;if(!ignoreBlankLines||/\S/.test(line)){doc.insertInLine({row:i,column:line.length},lineCommentEnd);doc.insertInLine({row:i,column:minIndent},lineCommentStart);}};var uncomment=function(line,i){var m;if(m=line.match(regexpEnd)) @@ -1633,7 +1650,7 @@ pos.column=0;return pos;};}).call(Anchor.prototype);});ace.define("ace/document" this.$detectNewLine=function(text){var match=text.match(/^.*?(\r\n|\r|\n)/m);this.$autoNewLine=match?match[1]:"\n";this._signal("changeNewLineMode");};this.getNewLineCharacter=function(){switch(this.$newLineMode){case"windows":return"\r\n";case"unix":return"\n";default:return this.$autoNewLine||"\n";}};this.$autoNewLine="";this.$newLineMode="auto";this.setNewLineMode=function(newLineMode){if(this.$newLineMode===newLineMode) return;this.$newLineMode=newLineMode;this._signal("changeNewLineMode");};this.getNewLineMode=function(){return this.$newLineMode;};this.isNewLine=function(text){return(text=="\r\n"||text=="\r"||text=="\n");};this.getLine=function(row){return this.$lines[row]||"";};this.getLines=function(firstRow,lastRow){return this.$lines.slice(firstRow,lastRow+1);};this.getAllLines=function(){return this.getLines(0,this.getLength());};this.getLength=function(){return this.$lines.length;};this.getTextRange=function(range){return this.getLinesForRange(range).join(this.getNewLineCharacter());};this.getLinesForRange=function(range){var lines;if(range.start.row===range.end.row){lines=[this.getLine(range.start.row).substring(range.start.column,range.end.column)];}else{lines=this.getLines(range.start.row,range.end.row);lines[0]=(lines[0]||"").substring(range.start.column);var l=lines.length-1;if(range.end.row-range.start.row==l) lines[l]=lines[l].substring(0,range.end.column);} -return lines;};this.insertLines=function(row,lines){console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");return this.insertFullLines(row,lines);};this.removeLines=function(firstRow,lastRow){console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");return this.removeFullLines(firstRow,lastRow);};this.insertNewLine=function(position){console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead.");return this.insertMergedLines(position,["",""]);};this.insert=function(position,text){if(this.getLength()<=1) +return lines;};this.insertLines=function(row,lines){console.warn("Use of document.insertLines is deprecated. Use the insertFullLines method instead.");return this.insertFullLines(row,lines);};this.removeLines=function(firstRow,lastRow){console.warn("Use of document.removeLines is deprecated. Use the removeFullLines method instead.");return this.removeFullLines(firstRow,lastRow);};this.insertNewLine=function(position){console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead.");return this.insertMergedLines(position,["",""]);};this.insert=function(position,text){if(this.getLength()<=1) this.$detectNewLine(text);return this.insertMergedLines(position,this.$split(text));};this.insertInLine=function(position,text){var start=this.clippedPos(position.row,position.column);var end=this.pos(position.row,position.column+text.length);this.applyDelta({start:start,end:end,action:"insert",lines:[text]},true);return this.clonePos(end);};this.clippedPos=function(row,column){var length=this.getLength();if(row===undefined){row=length;}else if(row<0){row=0;}else if(row>=length){row=length-1;column=undefined;} var line=this.getLine(row);if(column==undefined) column=line.length;column=Math.min(Math.max(column,0),line.length);return{row:row,column:column};};this.clonePos=function(pos){return{row:pos.row,column:pos.column};};this.pos=function(row,column){return{row:row,column:column};};this.$clipPosition=function(position){var length=this.getLength();if(position.row>=length){position.row=Math.max(0,length-1);position.column=this.getLine(length-1).length;}else{position.row=Math.max(0,position.row);position.column=Math.min(Math.max(position.column,0),this.getLine(position.row).length);} @@ -1817,8 +1834,8 @@ return{range:i!==-1&&range,firstRange:firstRange};};this.onFoldWidgetClick=funct el.className+=" ace_invalid";}};this.$toggleFoldWidget=function(row,options){if(!this.getFoldWidget) return;var type=this.getFoldWidget(row);var line=this.getLine(row);var dir=type==="end"?-1:1;var fold=this.getFoldAt(row,dir===-1?0:line.length,dir);if(fold){if(options.children||options.all) this.removeFold(fold);else -this.expandFold(fold);return;} -var range=this.getFoldWidgetRange(row,true);if(range&&!range.isMultiLine()){fold=this.getFoldAt(range.start.row,range.start.column,1);if(fold&&range.isEqual(fold.range)){this.removeFold(fold);return;}} +this.expandFold(fold);return fold;} +var range=this.getFoldWidgetRange(row,true);if(range&&!range.isMultiLine()){fold=this.getFoldAt(range.start.row,range.start.column,1);if(fold&&range.isEqual(fold.range)){this.removeFold(fold);return fold;}} if(options.siblings){var data=this.getParentFoldRangeData(row);if(data.range){var startRow=data.range.start.row+1;var endRow=data.range.end.row;} this.foldAll(startRow,endRow,options.all?10000:0);}else if(options.children){endRow=range?range.end.row:this.getLength();this.foldAll(row+1,endRow,options.all?10000:0);}else if(range){if(options.all) range.collapseChildren=10000;this.addFold("...",range);} @@ -1856,7 +1873,7 @@ valueIndex+=1;} do{token=iterator.stepForward();}while(token&&!typeRe.test(token.type));if(token==null) break;valueIndex=0;} return null;};} -exports.BracketMatch=BracketMatch;});ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(require,exports,module){"use strict";var oop=require("./lib/oop");var lang=require("./lib/lang");var config=require("./config");var EventEmitter=require("./lib/event_emitter").EventEmitter;var Selection=require("./selection").Selection;var TextMode=require("./mode/text").Mode;var Range=require("./range").Range;var Document=require("./document").Document;var BackgroundTokenizer=require("./background_tokenizer").BackgroundTokenizer;var SearchHighlight=require("./search_highlight").SearchHighlight;var EditSession=function(text,mode){this.$breakpoints=[];this.$decorations=[];this.$frontMarkers={};this.$backMarkers={};this.$markerId=1;this.$undoSelect=true;this.$foldData=[];this.$foldData.toString=function(){return this.join("\n");};this.on("changeFold",this.onChangeFold.bind(this));this.$onChange=this.onChange.bind(this);if(typeof text!="object"||!text.getLine) +exports.BracketMatch=BracketMatch;});ace.define("ace/edit_session",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/config","ace/lib/event_emitter","ace/selection","ace/mode/text","ace/range","ace/document","ace/background_tokenizer","ace/search_highlight","ace/edit_session/folding","ace/edit_session/bracket_match"],function(require,exports,module){"use strict";var oop=require("./lib/oop");var lang=require("./lib/lang");var config=require("./config");var EventEmitter=require("./lib/event_emitter").EventEmitter;var Selection=require("./selection").Selection;var TextMode=require("./mode/text").Mode;var Range=require("./range").Range;var Document=require("./document").Document;var BackgroundTokenizer=require("./background_tokenizer").BackgroundTokenizer;var SearchHighlight=require("./search_highlight").SearchHighlight;var EditSession=function(text,mode){this.$breakpoints=[];this.$decorations=[];this.$frontMarkers={};this.$backMarkers={};this.$markerId=1;this.$undoSelect=true;this.$foldData=[];this.id="session"+(++EditSession.$uid);this.$foldData.toString=function(){return this.join("\n");};this.on("changeFold",this.onChangeFold.bind(this));this.$onChange=this.onChange.bind(this);if(typeof text!="object"||!text.getLine) text=new Document(text);this.setDocument(text);this.selection=new Selection(this);config.resetOptions(this);this.setMode(mode);config._signal("session",this);};(function(){oop.implement(this,EventEmitter);this.setDocument=function(doc){if(this.doc) this.doc.removeListener("change",this.$onChange);this.doc=doc;doc.on("change",this.$onChange);if(this.bgTokenizer) this.bgTokenizer.setDocument(this.getDocument());this.resetCaches();};this.getDocument=function(){return this.doc;};this.$resetRowCache=function(docRow){if(!docRow){this.$docRowCache=[];this.$screenRowCache=[];return;} @@ -2072,7 +2089,7 @@ var lineIterator=this.$lineIterator(session,options);return{forEach:function(_ca return options.re=options.needle;var needle=options.needle;if(!options.needle) return options.re=false;if(!options.regExp) needle=lang.escapeRegExp(needle);if(options.wholeWord) -needle="\\b"+needle+"\\b";var modifier=options.caseSensitive?"gm":"gmi";options.$isMultiLine=!$disableFakeMultiline&&/[\n\r]/.test(needle);if(options.$isMultiLine) +needle=addWordBoundary(needle,options);var modifier=options.caseSensitive?"gm":"gmi";options.$isMultiLine=!$disableFakeMultiline&&/[\n\r]/.test(needle);if(options.$isMultiLine) return options.re=this.$assembleMultilineRegExp(needle,modifier);try{var re=new RegExp(needle,modifier);}catch(e){re=false;} return options.re=re;};this.$assembleMultilineRegExp=function(needle,modifier){var parts=needle.replace(/\r\n|\r|\n/g,"$\n^").split("\n");var re=[];for(var i=0;i0){editor.selection.moveCursorTo(selectionStart.row,selectionStart.column);editor.selection.selectTo(selectionStart.row,selectionStart.column+selectedCount);}else{firstLineEndCol=editor.session.doc.getLine(selectionStart.row).length>firstLineEndCol?(firstLineEndCol+1):firstLineEndCol;editor.selection.moveCursorTo(selectionStart.row,firstLineEndCol);}},multiSelectAction:"forEach",readOnly:true},{name:"invertSelection",bindKey:bindKey(null,null),exec:function(editor){var endRow=editor.session.doc.getLength()-1;var endCol=editor.session.doc.getLine(endRow).length;var ranges=editor.selection.rangeList.ranges;var newRanges=[];if(ranges.length<1){ranges=[editor.selection.getRange()];} @@ -2185,7 +2205,7 @@ if(token.type.indexOf("tag-open")!=-1){token=iterator.stepForward();if(!token) return;} var tag=token.value;var depth=0;var prevToken=iterator.stepBackward();if(prevToken.value=='<'){do{prevToken=token;token=iterator.stepForward();if(token&&token.value===tag&&token.type.indexOf('tag-name')!==-1){if(prevToken.value==='<'){depth++;}else if(prevToken.value==='=0);}else{do{token=prevToken;prevToken=iterator.stepBackward();if(token&&token.value===tag&&token.type.indexOf('tag-name')!==-1){if(prevToken.value==='<'){depth++;}else if(prevToken.value==='b.toLowerCase())return 1;return 0;});var deleteRange=new Range(0,0,0,0);for(var i=rows.first;i<=rows.last;i++){var line=session.getLine(i);deleteRange.start.row=i;deleteRange.end.row=i;deleteRange.end.column=line.length;session.replace(deleteRange,lines[i-rows.first]);}};this.toggleCommentLines=function(){var state=this.session.getState(this.getCursorPosition().row);var rows=this.$getSelectedRows();this.session.getMode().toggleCommentLines(state,this.session,rows.first,rows.last);};this.toggleBlockComment=function(){var cursor=this.getCursorPosition();var state=this.session.getState(cursor.row);var range=this.getSelectionRange();this.session.getMode().toggleBlockComment(state,this.session,range,cursor);};this.getNumberAt=function(row,column){var _numberRx=/[\-]?[0-9]+(?:\.[0-9]+)?/g;_numberRx.lastIndex=0;var s=this.session.getLine(row);while(_numberRx.lastIndex=column){var number={value:m[0],start:m.index,end:m.index+m[0].length};return number;}} @@ -2427,8 +2447,10 @@ var style=(this.cursors[cursorIndex++]||this.addCursor()).style;if(!this.drawCur while(this.cursors.length>cursorIndex) this.removeCursor();var overwrite=this.session.getOverwrite();this.$setOverwrite(overwrite);this.$pixelPos=pixelPos;this.restartTimer();};this.drawCursor=null;this.$setOverwrite=function(overwrite){if(overwrite!=this.overwrite){this.overwrite=overwrite;if(overwrite) dom.addCssClass(this.element,"ace_overwrite-cursors");else -dom.removeCssClass(this.element,"ace_overwrite-cursors");}};this.destroy=function(){clearInterval(this.intervalId);clearTimeout(this.timeoutId);};}).call(Cursor.prototype);exports.Cursor=Cursor;});ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(require,exports,module){"use strict";var oop=require("./lib/oop");var dom=require("./lib/dom");var event=require("./lib/event");var EventEmitter=require("./lib/event_emitter").EventEmitter;var ScrollBar=function(parent){this.element=dom.createElement("div");this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix;this.inner=dom.createElement("div");this.inner.className="ace_scrollbar-inner";this.element.appendChild(this.inner);parent.appendChild(this.element);this.setVisible(false);this.skipEvent=false;event.addListener(this.element,"scroll",this.onScroll.bind(this));event.addListener(this.element,"mousedown",event.preventDefault);};(function(){oop.implement(this,EventEmitter);this.setVisible=function(isVisible){this.element.style.display=isVisible?"":"none";this.isVisible=isVisible;};}).call(ScrollBar.prototype);var VScrollBar=function(parent,renderer){ScrollBar.call(this,parent);this.scrollTop=0;renderer.$scrollbarWidth=this.width=dom.scrollbarWidth(parent.ownerDocument);this.inner.style.width=this.element.style.width=(this.width||15)+5+"px";};oop.inherits(VScrollBar,ScrollBar);(function(){this.classSuffix='-v';this.onScroll=function(){if(!this.skipEvent){this.scrollTop=this.element.scrollTop;this._emit("scroll",{data:this.scrollTop});} -this.skipEvent=false;};this.getWidth=function(){return this.isVisible?this.width:0;};this.setHeight=function(height){this.element.style.height=height+"px";};this.setInnerHeight=function(height){this.inner.style.height=height+"px";};this.setScrollHeight=function(height){this.inner.style.height=height+"px";};this.setScrollTop=function(scrollTop){if(this.scrollTop!=scrollTop){this.skipEvent=true;this.scrollTop=this.element.scrollTop=scrollTop;}};}).call(VScrollBar.prototype);var HScrollBar=function(parent,renderer){ScrollBar.call(this,parent);this.scrollLeft=0;this.height=renderer.$scrollbarWidth;this.inner.style.height=this.element.style.height=(this.height||15)+5+"px";};oop.inherits(HScrollBar,ScrollBar);(function(){this.classSuffix='-h';this.onScroll=function(){if(!this.skipEvent){this.scrollLeft=this.element.scrollLeft;this._emit("scroll",{data:this.scrollLeft});} +dom.removeCssClass(this.element,"ace_overwrite-cursors");}};this.destroy=function(){clearInterval(this.intervalId);clearTimeout(this.timeoutId);};}).call(Cursor.prototype);exports.Cursor=Cursor;});ace.define("ace/scrollbar",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/event","ace/lib/event_emitter"],function(require,exports,module){"use strict";var oop=require("./lib/oop");var dom=require("./lib/dom");var event=require("./lib/event");var EventEmitter=require("./lib/event_emitter").EventEmitter;var MAX_SCROLL_H=0x8000;var ScrollBar=function(parent){this.element=dom.createElement("div");this.element.className="ace_scrollbar ace_scrollbar"+this.classSuffix;this.inner=dom.createElement("div");this.inner.className="ace_scrollbar-inner";this.element.appendChild(this.inner);parent.appendChild(this.element);this.setVisible(false);this.skipEvent=false;event.addListener(this.element,"scroll",this.onScroll.bind(this));event.addListener(this.element,"mousedown",event.preventDefault);};(function(){oop.implement(this,EventEmitter);this.setVisible=function(isVisible){this.element.style.display=isVisible?"":"none";this.isVisible=isVisible;this.coeff=1;};}).call(ScrollBar.prototype);var VScrollBar=function(parent,renderer){ScrollBar.call(this,parent);this.scrollTop=0;this.scrollHeight=0;renderer.$scrollbarWidth=this.width=dom.scrollbarWidth(parent.ownerDocument);this.inner.style.width=this.element.style.width=(this.width||15)+5+"px";};oop.inherits(VScrollBar,ScrollBar);(function(){this.classSuffix='-v';this.onScroll=function(){if(!this.skipEvent){this.scrollTop=this.element.scrollTop;if(this.coeff!=1){var h=this.element.clientHeight/this.scrollHeight;this.scrollTop=this.scrollTop*(1-h)/(this.coeff-h);} +this._emit("scroll",{data:this.scrollTop});} +this.skipEvent=false;};this.getWidth=function(){return this.isVisible?this.width:0;};this.setHeight=function(height){this.element.style.height=height+"px";};this.setInnerHeight=this.setScrollHeight=function(height){this.scrollHeight=height;if(height>MAX_SCROLL_H){this.coeff=MAX_SCROLL_H/height;height=MAX_SCROLL_H;}else if(this.coeff!=1){this.coeff=1} +this.inner.style.height=height+"px";};this.setScrollTop=function(scrollTop){if(this.scrollTop!=scrollTop){this.skipEvent=true;this.scrollTop=scrollTop;this.element.scrollTop=scrollTop*this.coeff;}};}).call(VScrollBar.prototype);var HScrollBar=function(parent,renderer){ScrollBar.call(this,parent);this.scrollLeft=0;this.height=renderer.$scrollbarWidth;this.inner.style.height=this.element.style.height=(this.height||15)+5+"px";};oop.inherits(HScrollBar,ScrollBar);(function(){this.classSuffix='-h';this.onScroll=function(){if(!this.skipEvent){this.scrollLeft=this.element.scrollLeft;this._emit("scroll",{data:this.scrollLeft});} this.skipEvent=false;};this.getHeight=function(){return this.isVisible?this.height:0;};this.setWidth=function(width){this.element.style.width=width+"px";};this.setInnerWidth=function(width){this.inner.style.width=width+"px";};this.setScrollWidth=function(width){this.inner.style.width=width+"px";};this.setScrollLeft=function(scrollLeft){if(this.scrollLeft!=scrollLeft){this.skipEvent=true;this.scrollLeft=this.element.scrollLeft=scrollLeft;}};}).call(HScrollBar.prototype);exports.ScrollBar=VScrollBar;exports.ScrollBarV=VScrollBar;exports.ScrollBarH=HScrollBar;exports.VScrollBar=VScrollBar;exports.HScrollBar=HScrollBar;});ace.define("ace/renderloop",["require","exports","module","ace/lib/event"],function(require,exports,module){"use strict";var event=require("./lib/event");var RenderLoop=function(onRender,win){this.onRender=onRender;this.pending=false;this.changes=0;this.window=win||window;};(function(){this.schedule=function(change){this.changes=this.changes|change;if(!this.pending&&this.changes){this.pending=true;var _self=this;event.nextFrame(function(){_self.pending=false;var changes;while(changes=_self.changes){_self.changes=0;_self.onRender(changes);}},this.window);}};}).call(RenderLoop.prototype);exports.RenderLoop=RenderLoop;});ace.define("ace/layer/font_metrics",["require","exports","module","ace/lib/oop","ace/lib/dom","ace/lib/lang","ace/lib/useragent","ace/lib/event_emitter"],function(require,exports,module){var oop=require("../lib/oop");var dom=require("../lib/dom");var lang=require("../lib/lang");var useragent=require("../lib/useragent");var EventEmitter=require("../lib/event_emitter").EventEmitter;var CHAR_COUNT=0;var FontMetrics=exports.FontMetrics=function(parentEl){this.el=dom.createElement("div");this.$setMeasureNodeStyles(this.el.style,true);this.$main=dom.createElement("div");this.$setMeasureNodeStyles(this.$main.style);this.$measureNode=dom.createElement("div");this.$setMeasureNodeStyles(this.$measureNode.style);this.el.appendChild(this.$main);this.el.appendChild(this.$measureNode);parentEl.appendChild(this.el);if(!CHAR_COUNT) this.$testFractionalRect();this.$measureNode.innerHTML=lang.stringRepeat("X",CHAR_COUNT);this.$characterSize={width:0,height:0};this.checkForSizeChanges();};(function(){oop.implement(this,EventEmitter);this.$characterSize={width:0,height:0};this.$testFractionalRect=function(){var el=dom.createElement("div");this.$setMeasureNodeStyles(el.style);el.style.width="0.2px";document.documentElement.appendChild(el);var w=el.getBoundingClientRect().width;if(w>0&&w<1) CHAR_COUNT=50;else @@ -2444,6 +2466,7 @@ position: relative;\ overflow: hidden;\ font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\ direction: ltr;\ +text-align: left;\ }\ .ace_scroller {\ position: absolute;\ @@ -2817,7 +2840,7 @@ _self.session.setScrollLeft(e.data-_self.scrollMargin.left);});this.scrollTop=0; this.layerConfig.characterWidth=this.characterWidth=this.$textLayer.getCharacterWidth();this.layerConfig.lineHeight=this.lineHeight=this.$textLayer.getLineHeight();this.$updatePrintMargin();};this.setSession=function(session){if(this.session) this.session.doc.off("changeNewLineMode",this.onChangeNewLineMode);this.session=session;if(session&&this.scrollMargin.top&&session.getScrollTop()<=0) session.setScrollTop(-this.scrollMargin.top);this.$cursorLayer.setSession(session);this.$markerBack.setSession(session);this.$markerFront.setSession(session);this.$gutterLayer.setSession(session);this.$textLayer.setSession(session);if(!session) -return;this.$loop.schedule(this.CHANGE_FULL);this.session.$setFontMetrics(this.$fontMetrics);this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this);this.onChangeNewLineMode() +return;this.$loop.schedule(this.CHANGE_FULL);this.session.$setFontMetrics(this.$fontMetrics);this.scrollBarV.scrollLeft=this.scrollBarV.scrollTop=null;this.onChangeNewLineMode=this.onChangeNewLineMode.bind(this);this.onChangeNewLineMode() this.session.doc.on("changeNewLineMode",this.onChangeNewLineMode);};this.updateLines=function(firstRow,lastRow,force){if(lastRow===undefined) lastRow=Infinity;if(!this.$changedLines){this.$changedLines={firstRow:firstRow,lastRow:lastRow};} else{if(this.$changedLines.firstRow>firstRow) @@ -2894,7 +2917,7 @@ firstRowScreen=session.documentToScreenRow(firstRow,0);firstRowHeight=session.ge firstRowHeight;offset=this.scrollTop-firstRowScreen*lineHeight;var changes=0;if(this.layerConfig.width!=longestLine) changes=this.CHANGE_H_SCROLL;if(hScrollChanged||vScrollChanged){changes=this.$updateCachedSize(true,this.gutterWidth,size.width,size.height);this._signal("scrollbarVisibilityChanged");if(vScrollChanged) longestLine=this.$getLongestLine();} -this.layerConfig={width:longestLine,padding:this.$padding,firstRow:firstRow,firstRowScreen:firstRowScreen,lastRow:lastRow,lineHeight:lineHeight,characterWidth:this.characterWidth,minHeight:minHeight,maxHeight:maxHeight,offset:offset,gutterOffset:Math.max(0,Math.ceil((offset+size.height-size.scrollerHeight)/lineHeight)),height:this.$size.scrollerHeight};return changes;};this.$updateLines=function(){var firstRow=this.$changedLines.firstRow;var lastRow=this.$changedLines.lastRow;this.$changedLines=null;var layerConfig=this.layerConfig;if(firstRow>layerConfig.lastRow+1){return;} +this.layerConfig={width:longestLine,padding:this.$padding,firstRow:firstRow,firstRowScreen:firstRowScreen,lastRow:lastRow,lineHeight:lineHeight,characterWidth:this.characterWidth,minHeight:minHeight,maxHeight:maxHeight,offset:offset,gutterOffset:lineHeight?Math.max(0,Math.ceil((offset+size.height-size.scrollerHeight)/lineHeight)):0,height:this.$size.scrollerHeight};return changes;};this.$updateLines=function(){var firstRow=this.$changedLines.firstRow;var lastRow=this.$changedLines.lastRow;this.$changedLines=null;var layerConfig=this.layerConfig;if(firstRow>layerConfig.lastRow+1){return;} if(lastRow1){column=lines[lines.length-1].length;row+=lines.length-1;}else column+=t.length;text+=t;}else{if(!t.start) t.start={row:row,column:column};else t.end={row:row,column:column};}});var range=editor.getSelectionRange();var end=editor.session.replace(range,text);var tabstopManager=new TabstopManager(editor);var selectionId=editor.inVirtualSelectionMode&&editor.selection.index;tabstopManager.addTabstops(tabstops,range.start,end,selectionId);};this.insertSnippet=function(editor,snippetText){var self=this;if(editor.inVirtualSelectionMode) @@ -3462,22 +3487,22 @@ point.column-=start.column;point.row-=start.row;};require("./lib/dom").importCss background: rgba(194, 193, 208, 0.09);\ border: 1px dotted rgba(211, 208, 235, 0.62);\ position: absolute;\ -}");exports.snippetManager=new SnippetManager();var Editor=require("./editor").Editor;(function(){this.insertSnippet=function(content,options){return exports.snippetManager.insertSnippet(this,content,options);};this.expandSnippet=function(options){return exports.snippetManager.expandWithTab(this,options);};}).call(Editor.prototype);});ace.define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","range","tabStops","resources","utils","actions","ace/config","ace/config"],function(require,exports,module){"use strict";var HashHandler=require("ace/keyboard/hash_handler").HashHandler;var Editor=require("ace/editor").Editor;var snippetManager=require("ace/snippets").snippetManager;var Range=require("ace/range").Range;var emmet,emmetPath;function AceEmmetEditor(){} +}");exports.snippetManager=new SnippetManager();var Editor=require("./editor").Editor;(function(){this.insertSnippet=function(content,options){return exports.snippetManager.insertSnippet(this,content,options);};this.expandSnippet=function(options){return exports.snippetManager.expandWithTab(this,options);};}).call(Editor.prototype);});ace.define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","tabStops","resources","utils","actions","ace/config","ace/config"],function(require,exports,module){"use strict";var HashHandler=require("ace/keyboard/hash_handler").HashHandler;var Editor=require("ace/editor").Editor;var snippetManager=require("ace/snippets").snippetManager;var Range=require("ace/range").Range;var emmet,emmetPath;function AceEmmetEditor(){} AceEmmetEditor.prototype={setupContext:function(editor){this.ace=editor;this.indentation=editor.session.getTabString();if(!emmet) -emmet=window.emmet;emmet.require("resources").setVariable("indentation",this.indentation);this.$syntax=null;this.$syntax=this.getSyntax();},getSelectionRange:function(){var range=this.ace.getSelectionRange();var doc=this.ace.session.doc;return{start:doc.positionToIndex(range.start),end:doc.positionToIndex(range.end)};},createSelection:function(start,end){var doc=this.ace.session.doc;this.ace.selection.setRange({start:doc.indexToPosition(start),end:doc.indexToPosition(end)});},getCurrentLineRange:function(){var ace=this.ace;var row=ace.getCursorPosition().row;var lineLength=ace.session.getLine(row).length;var index=ace.session.doc.positionToIndex({row:row,column:0});return{start:index,end:index+lineLength};},getCaretPos:function(){var pos=this.ace.getCursorPosition();return this.ace.session.doc.positionToIndex(pos);},setCaretPos:function(index){var pos=this.ace.session.doc.indexToPosition(index);this.ace.selection.moveToPosition(pos);},getCurrentLine:function(){var row=this.ace.getCursorPosition().row;return this.ace.session.getLine(row);},replaceContent:function(value,start,end,noIndent){if(end==null) +emmet=window.emmet;var resources=emmet.resources||emmet.require("resources");resources.setVariable("indentation",this.indentation);this.$syntax=null;this.$syntax=this.getSyntax();},getSelectionRange:function(){var range=this.ace.getSelectionRange();var doc=this.ace.session.doc;return{start:doc.positionToIndex(range.start),end:doc.positionToIndex(range.end)};},createSelection:function(start,end){var doc=this.ace.session.doc;this.ace.selection.setRange({start:doc.indexToPosition(start),end:doc.indexToPosition(end)});},getCurrentLineRange:function(){var ace=this.ace;var row=ace.getCursorPosition().row;var lineLength=ace.session.getLine(row).length;var index=ace.session.doc.positionToIndex({row:row,column:0});return{start:index,end:index+lineLength};},getCaretPos:function(){var pos=this.ace.getCursorPosition();return this.ace.session.doc.positionToIndex(pos);},setCaretPos:function(index){var pos=this.ace.session.doc.indexToPosition(index);this.ace.selection.moveToPosition(pos);},getCurrentLine:function(){var row=this.ace.getCursorPosition().row;return this.ace.session.getLine(row);},replaceContent:function(value,start,end,noIndent){if(end==null) end=start==null?this.getContent().length:start;if(start==null) start=0;var editor=this.ace;var doc=editor.session.doc;var range=Range.fromPoints(doc.indexToPosition(start),doc.indexToPosition(end));editor.session.remove(range);range.end=range.start;value=this.$updateTabstops(value);snippetManager.insertSnippet(editor,value);},getContent:function(){return this.ace.getValue();},getSyntax:function(){if(this.$syntax) return this.$syntax;var syntax=this.ace.session.$modeId.split("/").pop();if(syntax=="html"||syntax=="php"){var cursor=this.ace.getCursorPosition();var state=this.ace.session.getState(cursor.row);if(typeof state!="string") state=state[0];if(state){state=state.split("-");if(state.length>1) syntax=state[0];else if(syntax=="php") syntax="html";}} -return syntax;},getProfileName:function(){switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var profile=emmet.require("resources").getVariable("profile");if(!profile) -profile=this.ace.session.getLines(0,2).join("").search(/]+XHTML/i)!=-1?"xhtml":"html";return profile;default:var mode=this.ace.session.$mode;return mode.emmetConfig&&mode.emmetConfig.profile||"xhtml";}},prompt:function(title){return prompt(title);},getSelection:function(){return this.ace.session.getTextRange();},getFilePath:function(){return"";},$updateTabstops:function(value){var base=1000;var zeroBase=0;var lastZero=null;var range=emmet.require('range');var ts=emmet.require('tabStops');var settings=emmet.require('resources').getVocabulary("user");var tabstopOptions={tabstop:function(data){var group=parseInt(data.group,10);var isZero=group===0;if(isZero) +return syntax;},getProfileName:function(){var resources=emmet.resources||emmet.require("resources");switch(this.getSyntax()){case"css":return"css";case"xml":case"xsl":return"xml";case"html":var profile=resources.getVariable("profile");if(!profile) +profile=this.ace.session.getLines(0,2).join("").search(/]+XHTML/i)!=-1?"xhtml":"html";return profile;default:var mode=this.ace.session.$mode;return mode.emmetConfig&&mode.emmetConfig.profile||"xhtml";}},prompt:function(title){return prompt(title);},getSelection:function(){return this.ace.session.getTextRange();},getFilePath:function(){return"";},$updateTabstops:function(value){var base=1000;var zeroBase=0;var lastZero=null;var ts=emmet.tabStops||emmet.require('tabStops');var resources=emmet.resources||emmet.require("resources");var settings=resources.getVocabulary("user");var tabstopOptions={tabstop:function(data){var group=parseInt(data.group,10);var isZero=group===0;if(isZero) group=++zeroBase;else group+=base;var placeholder=data.placeholder;if(placeholder){placeholder=ts.processText(placeholder,tabstopOptions);} -var result='${'+group+(placeholder?':'+placeholder:'')+'}';if(isZero){lastZero=range.create(data.start,result);} -return result;},escape:function(ch){if(ch=='$')return'\\$';if(ch=='\\')return'\\\\';return ch;}};value=ts.processText(value,tabstopOptions);if(settings.variables['insert_final_tabstop']&&!/\$\{0\}$/.test(value)){value+='${0}';}else if(lastZero){value=emmet.require('utils').replaceSubstring(value,'${0}',lastZero);} -return value;}};var keymap={expand_abbreviation:{"mac":"ctrl+alt+e","win":"alt+e"},match_pair_outward:{"mac":"ctrl+d","win":"ctrl+,"},match_pair_inward:{"mac":"ctrl+j","win":"ctrl+shift+0"},matching_pair:{"mac":"ctrl+alt+j","win":"alt+j"},next_edit_point:"alt+right",prev_edit_point:"alt+left",toggle_comment:{"mac":"command+/","win":"ctrl+/"},split_join_tag:{"mac":"shift+command+'","win":"shift+ctrl+`"},remove_tag:{"mac":"command+'","win":"shift+ctrl+;"},evaluate_math_expression:{"mac":"shift+command+y","win":"shift+ctrl+y"},increment_number_by_1:"ctrl+up",decrement_number_by_1:"ctrl+down",increment_number_by_01:"alt+up",decrement_number_by_01:"alt+down",increment_number_by_10:{"mac":"alt+command+up","win":"shift+alt+up"},decrement_number_by_10:{"mac":"alt+command+down","win":"shift+alt+down"},select_next_item:{"mac":"shift+command+.","win":"shift+ctrl+."},select_previous_item:{"mac":"shift+command+,","win":"shift+ctrl+,"},reflect_css_value:{"mac":"shift+command+r","win":"shift+ctrl+r"},encode_decode_data_url:{"mac":"shift+ctrl+d","win":"ctrl+'"},expand_abbreviation_with_tab:"Tab",wrap_with_abbreviation:{"mac":"shift+ctrl+a","win":"shift+ctrl+a"}};var editorProxy=new AceEmmetEditor();exports.commands=new HashHandler();exports.runEmmetCommand=function runEmmetCommand(editor){try{editorProxy.setupContext(editor);var actions=emmet.require("actions");if(this.action=="expand_abbreviation_with_tab"){if(!editor.selection.isEmpty()) +var result='${'+group+(placeholder?':'+placeholder:'')+'}';if(isZero){lastZero=[data.start,result];} +return result;},escape:function(ch){if(ch=='$')return'\\$';if(ch=='\\')return'\\\\';return ch;}};value=ts.processText(value,tabstopOptions);if(settings.variables['insert_final_tabstop']&&!/\$\{0\}$/.test(value)){value+='${0}';}else if(lastZero){var common=emmet.utils?emmet.utils.common:emmet.require('utils');value=common.replaceSubstring(value,'${0}',lastZero[0],lastZero[1]);} +return value;}};var keymap={expand_abbreviation:{"mac":"ctrl+alt+e","win":"alt+e"},match_pair_outward:{"mac":"ctrl+d","win":"ctrl+,"},match_pair_inward:{"mac":"ctrl+j","win":"ctrl+shift+0"},matching_pair:{"mac":"ctrl+alt+j","win":"alt+j"},next_edit_point:"alt+right",prev_edit_point:"alt+left",toggle_comment:{"mac":"command+/","win":"ctrl+/"},split_join_tag:{"mac":"shift+command+'","win":"shift+ctrl+`"},remove_tag:{"mac":"command+'","win":"shift+ctrl+;"},evaluate_math_expression:{"mac":"shift+command+y","win":"shift+ctrl+y"},increment_number_by_1:"ctrl+up",decrement_number_by_1:"ctrl+down",increment_number_by_01:"alt+up",decrement_number_by_01:"alt+down",increment_number_by_10:{"mac":"alt+command+up","win":"shift+alt+up"},decrement_number_by_10:{"mac":"alt+command+down","win":"shift+alt+down"},select_next_item:{"mac":"shift+command+.","win":"shift+ctrl+."},select_previous_item:{"mac":"shift+command+,","win":"shift+ctrl+,"},reflect_css_value:{"mac":"shift+command+r","win":"shift+ctrl+r"},encode_decode_data_url:{"mac":"shift+ctrl+d","win":"ctrl+'"},expand_abbreviation_with_tab:"Tab",wrap_with_abbreviation:{"mac":"shift+ctrl+a","win":"shift+ctrl+a"}};var editorProxy=new AceEmmetEditor();exports.commands=new HashHandler();exports.runEmmetCommand=function runEmmetCommand(editor){try{editorProxy.setupContext(editor);var actions=emmet.actions||emmet.require("actions");if(this.action=="expand_abbreviation_with_tab"){if(!editor.selection.isEmpty()) return false;var pos=editor.selection.lead;var token=editor.session.getTokenAt(pos.row,pos.column);if(token&&/\btag\b/.test(token.type)) return false;} if(this.action=="wrap_with_abbreviation"){return setTimeout(function(){actions.run("wrap_with_abbreviation",editorProxy);},0);} @@ -3514,7 +3539,7 @@ gotoNext(ch);}}else if(ch.tabstopId!=null){result.push(ch);}else if(ch.changeCas function gotoNext(ch){var i1=snippet.indexOf(ch,i+1);if(i1!=-1) i=i1;} return result;};this.insertSnippetForSelection=function(editor,snippetText){var cursor=editor.getCursorPosition();var line=editor.session.getLine(cursor.row);var tabString=editor.session.getTabString();var indentString=line.match(/^\s*/)[0];if(cursor.column1){column=lines[lines.length-1].length;row+=lines.length-1;}else column+=t.length;text+=t;}else{if(!t.start) t.start={row:row,column:column};else t.end={row:row,column:column};}});var range=editor.getSelectionRange();var end=editor.session.replace(range,text);var tabstopManager=new TabstopManager(editor);var selectionId=editor.inVirtualSelectionMode&&editor.selection.index;tabstopManager.addTabstops(tabstops,range.start,end,selectionId);};this.insertSnippet=function(editor,snippetText){var self=this;if(editor.inVirtualSelectionMode) @@ -3698,7 +3723,8 @@ this.popup.hide();if(this.base) this.base.detach();this.activated=false;this.completions=this.base=null;};this.changeListener=function(e){var cursor=this.editor.selection.lead;if(cursor.row!=this.base.row||cursor.column=max?-1:row+1;break;case"start":row=0;break;case"end":row=max;break;} +this.detach();};this.blurListener=function(e){if(e.relatedTarget&&e.relatedTarget.nodeName=="A"&&e.relatedTarget.href){window.open(e.relatedTarget.href,"_blank");} +var el=document.activeElement;var text=this.editor.textInput.getElement();var fromTooltip=e.relatedTarget&&e.relatedTarget==this.tooltipNode;var container=this.popup&&this.popup.container;if(el!=text&&el.parentNode!=container&&!fromTooltip&&el!=this.tooltipNode&&e.relatedTarget!=text){this.detach();}};this.mousedownListener=function(e){this.detach();};this.mousewheelListener=function(e){this.detach();};this.goTo=function(where){var row=this.popup.getRow();var max=this.popup.session.getLength()-1;switch(where){case"up":row=row<=0?max:row-1;break;case"down":row=row>=max?-1:row+1;break;case"start":row=0;break;case"end":row=max;break;} this.popup.setRow(row);};this.insertMatch=function(data,options){if(!data) data=this.popup.getData(this.popup.getRow());if(!data) return false;if(data.completer&&data.completer.insertMatch){data.completer.insertMatch(this.editor,data);}else{if(this.completions.filterText){var ranges=this.editor.selection.getAllRanges();for(var i=0,range;range=ranges[i];i++){range.start.column-=this.completions.filterText.length;this.editor.session.remove(range);}} @@ -4063,10 +4089,10 @@ var keywordMapper=this.createKeywordMapper({"keyword.control.twig":tags,"support this.$rules["twig-comment"]=[{token:"comment.block.twig",regex:".*-?#\\}",next:"pop"}];this.$rules["twig-start"]=[{token:"variable.other.readwrite.local.twig",regex:"-?\\}\\}",next:"pop"},{token:"meta.tag.twig",regex:"-?%\\}",next:"pop"},{token:"string",regex:"'",next:"twig-qstring"},{token:"string",regex:'"',next:"twig-qqstring"},{token:"constant.numeric",regex:"0[xX][0-9a-fA-F]+\\b"},{token:"constant.numeric",regex:"[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"},{token:"constant.language.boolean",regex:"(?:true|false)\\b"},{token:keywordMapper,regex:"[a-zA-Z_$][a-zA-Z0-9_$]*\\b"},{token:"keyword.operator.assignment",regex:"=|~"},{token:"keyword.operator.comparison",regex:"==|!=|<|>|>=|<=|==="},{token:"keyword.operator.arithmetic",regex:"\\+|-|/|%|//|\\*|\\*\\*"},{token:"keyword.operator.other",regex:"\\.\\.|\\|"},{token:"punctuation.operator",regex:/\?|\:|\,|\;|\./},{token:"paren.lparen",regex:/[\[\({]/},{token:"paren.rparen",regex:/[\])}]/},{token:"text",regex:"\\s+"}];this.$rules["twig-qqstring"]=[{token:"constant.language.escape",regex:/\\[\\"$#ntr]|#{[^"}]*}/},{token:"string",regex:'"',next:"twig-start"},{defaultToken:"string"}];this.$rules["twig-qstring"]=[{token:"constant.language.escape",regex:/\\[\\'ntr]}/},{token:"string",regex:"'",next:"twig-start"},{defaultToken:"string"}];this.normalizeRules();};oop.inherits(TwigHighlightRules,TextHighlightRules);exports.TwigHighlightRules=TwigHighlightRules;});ace.define("ace/mode/twig",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/twig_highlight_rules","ace/mode/matching_brace_outdent"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var HtmlMode=require("./html").Mode;var TwigHighlightRules=require("./twig_highlight_rules").TwigHighlightRules;var MatchingBraceOutdent=require("./matching_brace_outdent").MatchingBraceOutdent;var Mode=function(){HtmlMode.call(this);this.HighlightRules=TwigHighlightRules;this.$outdent=new MatchingBraceOutdent();};oop.inherits(Mode,HtmlMode);(function(){this.blockComment={start:"{#",end:"#}"};this.getNextLineIndent=function(state,line,tab){var indent=this.$getIndent(line);var tokenizedLine=this.getTokenizer().getLineTokens(line,state);var tokens=tokenizedLine.tokens;var endState=tokenizedLine.state;if(tokens.length&&tokens[tokens.length-1].type=="comment"){return indent;} if(state=="start"){var match=line.match(/^.*[\{\(\[]\s*$/);if(match){indent+=tab;}} return indent;};this.checkOutdent=function(state,line,input){return this.$outdent.checkOutdent(line,input);};this.autoOutdent=function(state,doc,row){this.$outdent.autoOutdent(doc,row);};this.$id="ace/mode/twig";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var DocCommentHighlightRules=function(){this.$rules={"start":[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},DocCommentHighlightRules.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:true}]};};oop.inherits(DocCommentHighlightRules,TextHighlightRules);DocCommentHighlightRules.getTagRule=function(start){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"};} -DocCommentHighlightRules.getStartRule=function(start){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:start};};DocCommentHighlightRules.getEndRule=function(start){return{token:"comment.doc",regex:"\\*\\/",next:start};};exports.DocCommentHighlightRules=DocCommentHighlightRules;});ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var DocCommentHighlightRules=require("./doc_comment_highlight_rules").DocCommentHighlightRules;var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var identifierRe="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";var JavaScriptHighlightRules=function(options){var keywordMapper=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|"+"Namespace|QName|XML|XMLList|"+"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|"+"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|"+"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|"+"SyntaxError|TypeError|URIError|"+"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|"+"isNaN|parseFloat|parseInt|"+"JSON|Math|"+"this|arguments|prototype|window|document","keyword":"const|yield|import|get|set|async|await|"+"break|case|catch|continue|default|delete|do|else|finally|for|function|"+"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|"+"__parent__|__count__|escape|unescape|with|__proto__|"+"class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier");var kwBeforeRe="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";var escapedRe="\\\\(?:x[0-9a-fA-F]{2}|"+"u[0-9a-fA-F]{4}|"+"u{[0-9a-fA-F]{1,6}}|"+"[0-2][0-7]{0,2}|"+"3[0-7][0-7]?|"+"[4-7][0-7]?|"+".)";this.$rules={"no_regex":[DocCommentHighlightRules.getStartRule("doc-start"),comments("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+identifierRe+")(\\.)(prototype)(\\.)("+identifierRe+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+identifierRe+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+kwBeforeRe+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:keywordMapper,regex:identifierRe},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:identifierRe},{regex:"",token:"empty",next:"no_regex"}],"start":[DocCommentHighlightRules.getStartRule("doc-start"),comments("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],"regex":[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],"regex_character_class":[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],"function_arguments":[{token:"variable.parameter",regex:identifierRe},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],"qqstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],"qstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!options||!options.noES6){this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(val,state,stack){this.next=val=="{"?this.nextState:"";if(val=="{"&&stack.length){stack.unshift("start",state);} +DocCommentHighlightRules.getStartRule=function(start){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:start};};DocCommentHighlightRules.getEndRule=function(start){return{token:"comment.doc",regex:"\\*\\/",next:start};};exports.DocCommentHighlightRules=DocCommentHighlightRules;});ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var DocCommentHighlightRules=require("./doc_comment_highlight_rules").DocCommentHighlightRules;var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var identifierRe="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";var JavaScriptHighlightRules=function(options){var keywordMapper=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|"+"Namespace|QName|XML|XMLList|"+"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|"+"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|"+"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|"+"SyntaxError|TypeError|URIError|"+"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|"+"isNaN|parseFloat|parseInt|"+"JSON|Math|"+"this|arguments|prototype|window|document","keyword":"const|yield|import|get|set|async|await|"+"break|case|catch|continue|default|delete|do|else|finally|for|function|"+"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|"+"__parent__|__count__|escape|unescape|with|__proto__|"+"class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier");var kwBeforeRe="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";var escapedRe="\\\\(?:x[0-9a-fA-F]{2}|"+"u[0-9a-fA-F]{4}|"+"u{[0-9a-fA-F]{1,6}}|"+"[0-2][0-7]{0,2}|"+"3[0-7][0-7]?|"+"[4-7][0-7]?|"+".)";this.$rules={"no_regex":[DocCommentHighlightRules.getStartRule("doc-start"),comments("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+identifierRe+")(\\.)(prototype)(\\.)("+identifierRe+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+identifierRe+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+kwBeforeRe+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:keywordMapper,regex:identifierRe},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:identifierRe},{regex:"",token:"empty",next:"no_regex"}],"start":[DocCommentHighlightRules.getStartRule("doc-start"),comments("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],"regex":[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],"regex_character_class":[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],"function_arguments":[{token:"variable.parameter",regex:identifierRe},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],"qqstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],"qstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!options||!options.noES6){this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(val,state,stack){this.next=val=="{"?this.nextState:"";if(val=="{"&&stack.length){stack.unshift("start",state);} else if(val=="}"&&stack.length){stack.shift();this.next=stack.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1) return"paren.quasi.end";} -return val=="{"?"paren.lparen":"paren.rparen";},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:escapedRe},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]});if(!options||!options.noJSX) +return val=="{"?"paren.lparen":"paren.rparen";},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:escapedRe},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]});if(!options||options.jsx!=false) JSX.call(this);} this.embedRules(DocCommentHighlightRules,"doc-",[DocCommentHighlightRules.getEndRule("no_regex")]);this.normalizeRules();};oop.inherits(JavaScriptHighlightRules,TextHighlightRules);function JSX(){var tagRegex=identifierRe.replace("\\d","\\d\\-");var jsxTag={onMatch:function(val,state,stack){var offset=val.charAt(1)=="/"?2:1;if(offset==1){if(state!=this.nextState) stack.unshift(this.next,this.nextState,0);else @@ -4077,23 +4103,7 @@ stack[1]--;if(!stack[1]||stack[1]<0){stack.splice(0,2);}} this.next=stack[0]||"start";return[{type:this.token,value:value}];},nextState:"jsx"},jsxJsRule,comments("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:tagRegex},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},jsxTag];this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}];} function comments(next){return[{token:"comment",regex:/\/\*/,next:[DocCommentHighlightRules.getTagRule(),{token:"comment",regex:"\\*\\/",next:next||"pop"},{defaultToken:"comment",caseInsensitive:true}]},{token:"comment",regex:"\\/\\/",next:[DocCommentHighlightRules.getTagRule(),{token:"comment",regex:"$|^",next:next||"pop"},{defaultToken:"comment",caseInsensitive:true}]}];} exports.JavaScriptHighlightRules=JavaScriptHighlightRules;});ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(require,exports,module){"use strict";var Range=require("../range").Range;var MatchingBraceOutdent=function(){};(function(){this.checkOutdent=function(line,input){if(!/^\s+$/.test(line)) -return false;return/^\s*\}/.test(input);};this.autoOutdent=function(doc,row){var line=doc.getLine(row);var match=line.match(/^(\s*\})/);if(!match)return 0;var column=match[1].length;var openBracePos=doc.findMatchingBracket({row:row,column:column});if(!openBracePos||openBracePos.row==row)return 0;var indent=this.$getIndent(doc.getLine(openBracePos.row));doc.replace(new Range(row,0,row,column-1),indent);};this.$getIndent=function(line){return line.match(/^\s*/)[0];};}).call(MatchingBraceOutdent.prototype);exports.MatchingBraceOutdent=MatchingBraceOutdent;});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var lang=require("../../lib/lang");var SAFE_INSERT_IN_TOKENS=["text","paren.rparen","punctuation.operator"];var SAFE_INSERT_BEFORE_TOKENS=["text","paren.rparen","punctuation.operator","comment"];var context;var contextCache={};var initContext=function(editor){var id=-1;if(editor.multiSelect){id=editor.selection.index;if(contextCache.rangeCount!=editor.multiSelect.rangeCount) -contextCache={rangeCount:editor.multiSelect.rangeCount};} -if(contextCache[id]) -return context=contextCache[id];context=contextCache[id]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""};};var getWrapped=function(selection,selected,opening,closing){var rowDiff=selection.end.row-selection.start.row;return{text:opening+selected+closing,selection:[0,selection.start.column+1,rowDiff,selection.end.column+(rowDiff?0:1)]};};var CstyleBehaviour=function(){this.add("braces","insertion",function(state,action,editor,session,text){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(text=='{'){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="{"&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'{','}');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){if(/[\]\}\)]/.test(line[cursor.column])||editor.inMultiSelectMode){CstyleBehaviour.recordAutoInsert(editor,session,"}");return{text:'{}',selection:[1,1]};}else{CstyleBehaviour.recordMaybeInsert(editor,session,"{");return{text:'{',selection:[1,1]};}}}else if(text=='}'){initContext(editor);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar=='}'){var matching=session.$findOpeningBracket('}',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}else if(text=="\n"||text=="\r\n"){initContext(editor);var closing="";if(CstyleBehaviour.isMaybeInsertedClosing(cursor,line)){closing=lang.stringRepeat("}",context.maybeInsertedBrackets);CstyleBehaviour.clearMaybeInsertedClosing();} -var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==='}'){var openBracePos=session.findMatchingBracket({row:cursor.row,column:cursor.column+1},'}');if(!openBracePos) -return null;var next_indent=this.$getIndent(session.getLine(openBracePos.row));}else if(closing){var next_indent=this.$getIndent(line);}else{CstyleBehaviour.clearMaybeInsertedClosing();return;} -var indent=next_indent+session.getTabString();return{text:'\n'+indent+'\n'+next_indent+closing,selection:[1,indent.length,1,indent.length]};}else{CstyleBehaviour.clearMaybeInsertedClosing();}});this.add("braces","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='{'){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar=='}'){range.end.column++;return range;}else{context.maybeInsertedBrackets--;}}});this.add("parens","insertion",function(state,action,editor,session,text){if(text=='('){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'(',')');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,")");return{text:'()',selection:[1,1]};}}else if(text==')'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==')'){var matching=session.$findOpeningBracket(')',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("parens","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='('){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==')'){range.end.column++;return range;}}});this.add("brackets","insertion",function(state,action,editor,session,text){if(text=='['){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'[',']');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,"]");return{text:'[]',selection:[1,1]};}}else if(text==']'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==']'){var matching=session.$findOpeningBracket(']',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("brackets","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='['){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==']'){range.end.column++;return range;}}});this.add("string_dquotes","insertion",function(state,action,editor,session,text){if(text=='"'||text=="'"){initContext(editor);var quote=text;var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="'"&&selected!='"'&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,quote,quote);}else if(!selected){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var leftChar=line.substring(cursor.column-1,cursor.column);var rightChar=line.substring(cursor.column,cursor.column+1);var token=session.getTokenAt(cursor.row,cursor.column);var rightToken=session.getTokenAt(cursor.row,cursor.column+1);if(leftChar=="\\"&&token&&/escape/.test(token.type)) -return null;var stringBefore=token&&/string|escape/.test(token.type);var stringAfter=!rightToken||/string|escape/.test(rightToken.type);var pair;if(rightChar==quote){pair=stringBefore!==stringAfter;}else{if(stringBefore&&!stringAfter) -return null;if(stringBefore&&stringAfter) -return null;var wordRe=session.$mode.tokenRe;wordRe.lastIndex=0;var isWordBefore=wordRe.test(leftChar);wordRe.lastIndex=0;var isWordAfter=wordRe.test(leftChar);if(isWordBefore||isWordAfter) -return null;if(rightChar&&!/[\s;,.})\]\\]/.test(rightChar)) -return null;pair=true;} -return{text:pair?quote+quote:"",selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});};CstyleBehaviour.isSaneInsertion=function(editor,session){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);if(!this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)){var iterator2=new TokenIterator(session,cursor.row,cursor.column+1);if(!this.$matchTokenType(iterator2.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)) -return false;} -iterator.stepForward();return iterator.getCurrentTokenRow()!==cursor.row||this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_BEFORE_TOKENS);};CstyleBehaviour.$matchTokenType=function(token,types){return types.indexOf(token.type||token)>-1;};CstyleBehaviour.recordAutoInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isAutoInsertedClosing(cursor,line,context.autoInsertedLineEnd[0])) -context.autoInsertedBrackets=0;context.autoInsertedRow=cursor.row;context.autoInsertedLineEnd=bracket+line.substr(cursor.column);context.autoInsertedBrackets++;};CstyleBehaviour.recordMaybeInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isMaybeInsertedClosing(cursor,line)) -context.maybeInsertedBrackets=0;context.maybeInsertedRow=cursor.row;context.maybeInsertedLineStart=line.substr(0,cursor.column)+bracket;context.maybeInsertedLineEnd=line.substr(cursor.column);context.maybeInsertedBrackets++;};CstyleBehaviour.isAutoInsertedClosing=function(cursor,line,bracket){return context.autoInsertedBrackets>0&&cursor.row===context.autoInsertedRow&&bracket===context.autoInsertedLineEnd[0]&&line.substr(cursor.column)===context.autoInsertedLineEnd;};CstyleBehaviour.isMaybeInsertedClosing=function(cursor,line){return context.maybeInsertedBrackets>0&&cursor.row===context.maybeInsertedRow&&line.substr(cursor.column)===context.maybeInsertedLineEnd&&line.substr(0,cursor.column)==context.maybeInsertedLineStart;};CstyleBehaviour.popAutoInsertedClosing=function(){context.autoInsertedLineEnd=context.autoInsertedLineEnd.substr(1);context.autoInsertedBrackets--;};CstyleBehaviour.clearMaybeInsertedClosing=function(){if(context){context.maybeInsertedBrackets=0;context.maybeInsertedRow=-1;}};oop.inherits(CstyleBehaviour,Behaviour);exports.CstyleBehaviour=CstyleBehaviour;});ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Range=require("../../range").Range;var BaseFoldMode=require("./fold_mode").FoldMode;var FoldMode=exports.FoldMode=function(commentRegex){if(commentRegex){this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.start));this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.end));}};oop.inherits(FoldMode,BaseFoldMode);(function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/;this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/;this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/;this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/;this._getFoldWidgetBase=this.getFoldWidget;this.getFoldWidget=function(session,foldStyle,row){var line=session.getLine(row);if(this.singleLineBlockCommentRe.test(line)){if(!this.startRegionRe.test(line)&&!this.tripleStarBlockCommentRe.test(line)) +return false;return/^\s*\}/.test(input);};this.autoOutdent=function(doc,row){var line=doc.getLine(row);var match=line.match(/^(\s*\})/);if(!match)return 0;var column=match[1].length;var openBracePos=doc.findMatchingBracket({row:row,column:column});if(!openBracePos||openBracePos.row==row)return 0;var indent=this.$getIndent(doc.getLine(openBracePos.row));doc.replace(new Range(row,0,row,column-1),indent);};this.$getIndent=function(line){return line.match(/^\s*/)[0];};}).call(MatchingBraceOutdent.prototype);exports.MatchingBraceOutdent=MatchingBraceOutdent;});ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Range=require("../../range").Range;var BaseFoldMode=require("./fold_mode").FoldMode;var FoldMode=exports.FoldMode=function(commentRegex){if(commentRegex){this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.start));this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.end));}};oop.inherits(FoldMode,BaseFoldMode);(function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/;this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/;this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/;this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/;this._getFoldWidgetBase=this.getFoldWidget;this.getFoldWidget=function(session,foldStyle,row){var line=session.getLine(row);if(this.singleLineBlockCommentRe.test(line)){if(!this.startRegionRe.test(line)&&!this.tripleStarBlockCommentRe.test(line)) return"";} var fw=this._getFoldWidgetBase(session,foldStyle,row);if(!fw&&this.startRegionRe.test(line)) return"start";return fw;};this.getFoldWidgetRange=function(session,foldStyle,row,forceMultiline){var line=session.getLine(row);if(this.startRegionRe.test(line)) @@ -4108,8 +4118,8 @@ continue;if(startIndent>indent) break;var subRange=this.getFoldWidgetRange(session,"all",row);if(subRange){if(subRange.start.row<=startRow){break;}else if(subRange.isMultiLine()){row=subRange.end.row;}else if(startIndent==indent){break;}} endRow=row;} return new Range(startRow,startColumn,endRow,session.getLine(endRow).length);};this.getCommentRegionBlock=function(session,line,row){var startColumn=line.search(/\s*$/);var maxRow=session.getLength();var startRow=row;var re=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;var depth=1;while(++rowstartRow){return new Range(startRow,startColumn,endRow,line.length);}};}).call(FoldMode.prototype);});ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var MatchingBraceOutdent=require("./matching_brace_outdent").MatchingBraceOutdent;var Range=require("../range").Range;var WorkerClient=require("../worker/worker_client").WorkerClient;var CstyleBehaviour=require("./behaviour/cstyle").CstyleBehaviour;var CStyleFoldMode=require("./folding/cstyle").FoldMode;var Mode=function(){this.HighlightRules=JavaScriptHighlightRules;this.$outdent=new MatchingBraceOutdent();this.$behaviour=new CstyleBehaviour();this.foldingRules=new CStyleFoldMode();};oop.inherits(Mode,TextMode);(function(){this.lineCommentStart="//";this.blockComment={start:"/*",end:"*/"};this.getNextLineIndent=function(state,line,tab){var indent=this.$getIndent(line);var tokenizedLine=this.getTokenizer().getLineTokens(line,state);var tokens=tokenizedLine.tokens;var endState=tokenizedLine.state;if(tokens.length&&tokens[tokens.length-1].type=="comment"){return indent;} -if(state=="start"||state=="no_regex"){var match=line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);if(match){indent+=tab;}}else if(state=="doc-start"){if(endState=="start"||endState=="no_regex"){return"";} +var endRow=row;if(endRow>startRow){return new Range(startRow,startColumn,endRow,line.length);}};}).call(FoldMode.prototype);});ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var MatchingBraceOutdent=require("./matching_brace_outdent").MatchingBraceOutdent;var WorkerClient=require("../worker/worker_client").WorkerClient;var CstyleBehaviour=require("./behaviour/cstyle").CstyleBehaviour;var CStyleFoldMode=require("./folding/cstyle").FoldMode;var Mode=function(){this.HighlightRules=JavaScriptHighlightRules;this.$outdent=new MatchingBraceOutdent();this.$behaviour=new CstyleBehaviour();this.foldingRules=new CStyleFoldMode();};oop.inherits(Mode,TextMode);(function(){this.lineCommentStart="//";this.blockComment={start:"/*",end:"*/"};this.getNextLineIndent=function(state,line,tab){var indent=this.$getIndent(line);var tokenizedLine=this.getTokenizer().getLineTokens(line,state);var tokens=tokenizedLine.tokens;var endState=tokenizedLine.state;if(tokens.length&&tokens[tokens.length-1].type=="comment"){return indent;} +if(state=="start"||state=="no_regex"){var match=line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);if(match){indent+=tab;}}else if(state=="doc-start"){if(endState=="start"||endState=="no_regex"){return"";} var match=line.match(/^\s*(\/?)\*/);if(match){if(match[1]){indent+=" ";} indent+="* ";}} return indent;};this.checkOutdent=function(state,line,input){return this.$outdent.checkOutdent(line,input);};this.autoOutdent=function(state,doc,row){this.$outdent.autoOutdent(doc,row);};this.createWorker=function(session){var worker=new WorkerClient(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");worker.attachToDocument(session.getDocument());worker.on("annotate",function(results){session.setAnnotations(results.data);});worker.on("terminate",function(){session.clearAnnotations();});return worker;};this.$id="ace/mode/javascript";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var XmlHighlightRules=function(normalize){var tagRegex="[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.xml-decl.xml","keyword.xml-decl.xml"],regex:"(<\\?)(xml)(?=[\\s])",next:"xml_decl",caseInsensitive:true},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+tagRegex+")",next:"processing_instruction"},{token:"comment.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:true},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],processing_instruction:[{token:"punctuation.instruction.xml",regex:"\\?>",next:"start"},{defaultToken:"instruction.xml"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+tagRegex+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:"(?:"+tagRegex+":)?"+tagRegex+""},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]};if(this.constructor===XmlHighlightRules) @@ -4120,11 +4130,11 @@ var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);v if(!token) token=iterator.stepBackward();if(!token) return;while(is(token,"tag-whitespace")||is(token,"whitespace")){token=iterator.stepBackward();} -var rightSpace=!rightChar||rightChar.match(/\s/);if(is(token,"attribute-equals")&&(rightSpace||rightChar=='>')||(is(token,"decl-attribute-equals")&&(rightSpace||rightChar=='?'))){return{text:quote+quote,selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});this.add("autoclosing","insertion",function(state,action,editor,session,text){if(text=='>'){var position=editor.getCursorPosition();var iterator=new TokenIterator(session,position.row,position.column);var token=iterator.getCurrentToken()||iterator.stepBackward();if(!token||!(is(token,"tag-name")||is(token,"tag-whitespace")||is(token,"attribute-name")||is(token,"attribute-equals")||is(token,"attribute-value"))) +var rightSpace=!rightChar||rightChar.match(/\s/);if(is(token,"attribute-equals")&&(rightSpace||rightChar=='>')||(is(token,"decl-attribute-equals")&&(rightSpace||rightChar=='?'))){return{text:quote+quote,selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});this.add("autoclosing","insertion",function(state,action,editor,session,text){if(text=='>'){var position=editor.getSelectionRange().start;var iterator=new TokenIterator(session,position.row,position.column);var token=iterator.getCurrentToken()||iterator.stepBackward();if(!token||!(is(token,"tag-name")||is(token,"tag-whitespace")||is(token,"attribute-name")||is(token,"attribute-equals")||is(token,"attribute-value"))) return;if(is(token,"reference.attribute-value")) return;if(is(token,"attribute-value")){var firstChar=token.value.charAt(0);if(firstChar=='"'||firstChar=="'"){var lastChar=token.value.charAt(token.value.length-1);var tokenEnd=iterator.getCurrentTokenColumn()+token.value.length;if(tokenEnd>position.column||tokenEnd==position.column&&firstChar!=lastChar) return;}} -while(!is(token,"tag-name")){token=iterator.stepBackward();} +while(!is(token,"tag-name")){token=iterator.stepBackward();if(token.value=="<"){token=iterator.stepForward();break;}} var tokenRow=iterator.getCurrentTokenRow();var tokenColumn=iterator.getCurrentTokenColumn();if(is(iterator.stepBackward(),"end-tag-open")) return;var element=token.value;if(tokenRow==position.row) element=element.substring(0,position.column-tokenColumn);if(this.voidElements.hasOwnProperty(element.toLowerCase())) @@ -4174,7 +4184,7 @@ if(!line.substring(cursor.column).match(/^\s*;/)){return{text:':;',selection:[1, if(token&&token.type==='support.type'){var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar===';'){range.end.column++;return range;}}}});this.add("semicolon","insertion",function(state,action,editor,session,text){if(text===';'){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar===';'){return{text:'',selection:[1,1]}}}});} oop.inherits(CssBehaviour,CstyleBehaviour);exports.CssBehaviour=CssBehaviour;});ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var CssHighlightRules=require("./css_highlight_rules").CssHighlightRules;var MatchingBraceOutdent=require("./matching_brace_outdent").MatchingBraceOutdent;var WorkerClient=require("../worker/worker_client").WorkerClient;var CssCompletions=require("./css_completions").CssCompletions;var CssBehaviour=require("./behaviour/css").CssBehaviour;var CStyleFoldMode=require("./folding/cstyle").FoldMode;var Mode=function(){this.HighlightRules=CssHighlightRules;this.$outdent=new MatchingBraceOutdent();this.$behaviour=new CssBehaviour();this.$completer=new CssCompletions();this.foldingRules=new CStyleFoldMode();};oop.inherits(Mode,TextMode);(function(){this.foldingRules="cStyle";this.blockComment={start:"/*",end:"*/"};this.getNextLineIndent=function(state,line,tab){var indent=this.$getIndent(line);var tokens=this.getTokenizer().getLineTokens(line,state).tokens;if(tokens.length&&tokens[tokens.length-1].type=="comment"){return indent;} var match=line.match(/^.*\{\s*$/);if(match){indent+=tab;} -return indent;};this.checkOutdent=function(state,line,input){return this.$outdent.checkOutdent(line,input);};this.autoOutdent=function(state,doc,row){this.$outdent.autoOutdent(doc,row);};this.getCompletions=function(state,session,pos,prefix){return this.$completer.getCompletions(state,session,pos,prefix);};this.createWorker=function(session){var worker=new WorkerClient(["ace"],"ace/mode/css_worker","Worker");worker.attachToDocument(session.getDocument());worker.on("annotate",function(e){session.setAnnotations(e.data);});worker.on("terminate",function(){session.clearAnnotations();});return worker;};this.$id="ace/mode/css";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var lang=require("../lib/lang");var CssHighlightRules=require("./css_highlight_rules").CssHighlightRules;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var XmlHighlightRules=require("./xml_highlight_rules").XmlHighlightRules;var tagMap=lang.createMap({a:'anchor',button:'form',form:'form',img:'image',input:'form',label:'form',option:'form',script:'script',select:'form',textarea:'form',style:'style',table:'table',tbody:'table',td:'table',tfoot:'table',th:'table',tr:'table'});var HtmlHighlightRules=function(){XmlHighlightRules.call(this);this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(start,tag){var group=tagMap[tag];return["meta.tag.punctuation."+(start=="<"?"":"end-")+"tag-open.xml","meta.tag"+(group?"."+group:"")+".tag-name.xml"];},regex:"(",next:"start"}]});this.embedTagRules(CssHighlightRules,"css-","style");this.embedTagRules(new JavaScriptHighlightRules({noJSX:true}).getRules(),"js-","script");if(this.constructor===HtmlHighlightRules) +return indent;};this.checkOutdent=function(state,line,input){return this.$outdent.checkOutdent(line,input);};this.autoOutdent=function(state,doc,row){this.$outdent.autoOutdent(doc,row);};this.getCompletions=function(state,session,pos,prefix){return this.$completer.getCompletions(state,session,pos,prefix);};this.createWorker=function(session){var worker=new WorkerClient(["ace"],"ace/mode/css_worker","Worker");worker.attachToDocument(session.getDocument());worker.on("annotate",function(e){session.setAnnotations(e.data);});worker.on("terminate",function(){session.clearAnnotations();});return worker;};this.$id="ace/mode/css";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var lang=require("../lib/lang");var CssHighlightRules=require("./css_highlight_rules").CssHighlightRules;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var XmlHighlightRules=require("./xml_highlight_rules").XmlHighlightRules;var tagMap=lang.createMap({a:'anchor',button:'form',form:'form',img:'image',input:'form',label:'form',option:'form',script:'script',select:'form',textarea:'form',style:'style',table:'table',tbody:'table',td:'table',tfoot:'table',th:'table',tr:'table'});var HtmlHighlightRules=function(){XmlHighlightRules.call(this);this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(start,tag){var group=tagMap[tag];return["meta.tag.punctuation."+(start=="<"?"":"end-")+"tag-open.xml","meta.tag"+(group?"."+group:"")+".tag-name.xml"];},regex:"(",next:"start"}]});this.embedTagRules(CssHighlightRules,"css-","style");this.embedTagRules(new JavaScriptHighlightRules({jsx:false}).getRules(),"js-","script");if(this.constructor===HtmlHighlightRules) this.normalizeRules();};oop.inherits(HtmlHighlightRules,XmlHighlightRules);exports.HtmlHighlightRules=HtmlHighlightRules;});ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var BaseFoldMode=require("./fold_mode").FoldMode;var FoldMode=exports.FoldMode=function(defaultMode,subModes){this.defaultMode=defaultMode;this.subModes=subModes;};oop.inherits(FoldMode,BaseFoldMode);(function(){this.$getMode=function(state){if(typeof state!="string") state=state[0];for(var key in this.subModes){if(state.indexOf(key)===0) return this.subModes[key];} @@ -4191,7 +4201,7 @@ var HtmlCompletions=function(){};(function(){this.getCompletions=function(state, return[];if(is(token,"tag-name")||is(token,"tag-open")||is(token,"end-tag-open")) return this.getTagCompletions(state,session,pos,prefix);if(is(token,"tag-whitespace")||is(token,"attribute-name")) return this.getAttributeCompletions(state,session,pos,prefix);if(is(token,"attribute-value")) -return this.getAttributeValueCompletions(state,session,pos,prefix);var line=session.getLine(pos.row).substr(0,pos.column);if(/&[A-z]*$/i.test(line)) +return this.getAttributeValueCompletions(state,session,pos,prefix);var line=session.getLine(pos.row).substr(0,pos.column);if(/&[a-z]*$/i.test(line)) return this.getHTMLEntityCompletions(state,session,pos,prefix);return[];};this.getTagCompletions=function(state,session,pos,prefix){return elements.map(function(element){return{value:element,meta:"tag",score:Number.MAX_VALUE};});};this.getAttributeCompletions=function(state,session,pos,prefix){var tagName=findTagName(session,pos);if(!tagName) return[];var attributes=globalAttributes;if(tagName in attributeMap){attributes=attributes.concat(Object.keys(attributeMap[tagName]));} return attributes.map(function(attribute){return{caption:attribute,snippet:attribute+'="$0"',meta:"attribute",score:Number.MAX_VALUE};});};this.getAttributeValueCompletions=function(state,session,pos,prefix){var tagName=findTagName(session,pos);var attributeName=findAttributeName(session,pos);if(!tagName) @@ -4200,7 +4210,7 @@ return values.map(function(value){return{caption:value,snippet:value,meta:"attri return;var worker=new WorkerClient(["ace"],"ace/mode/html_worker","Worker");worker.attachToDocument(session.getDocument());if(this.fragmentContext) worker.call("setOptions",[{context:this.fragmentContext}]);worker.on("error",function(e){session.setAnnotations(e.data);});worker.on("terminate",function(){session.clearAnnotations();});return worker;};this.$id="ace/mode/html";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules","ace/mode/html_highlight_rules","ace/mode/css_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var lang=require("../lib/lang");var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var XmlHighlightRules=require("./xml_highlight_rules").XmlHighlightRules;var HtmlHighlightRules=require("./html_highlight_rules").HtmlHighlightRules;var CssHighlightRules=require("./css_highlight_rules").CssHighlightRules;var escaped=function(ch){return"(?:[^"+lang.escapeRegExp(ch)+"\\\\]|\\\\.)*";} function github_embed(tag,prefix){return{token:"support.function",regex:"^\\s*```"+tag+"\\s*$",push:prefix+"start"};} -var MarkdownHighlightRules=function(){HtmlHighlightRules.call(this);this.$rules["start"].unshift({token:"empty_line",regex:'^$',next:"allowBlock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(value){return"markup.heading."+value.length;},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},github_embed("(?:javascript|js)","jscode-"),github_embed("xml","xmlcode-"),github_embed("html","htmlcode-"),github_embed("css","csscode-"),{token:"support.function",regex:"^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"});this.addRules({"basic":[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:"^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"},{token:["text","string","text","constant","text"],regex:"(\\[)("+escaped("]")+")(\\]\s*\\[)("+escaped("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\[)("+ +var MarkdownHighlightRules=function(){HtmlHighlightRules.call(this);this.$rules["start"].unshift({token:"empty_line",regex:'^$',next:"allowBlock"},{token:"markup.heading.1",regex:"^=+(?=\\s*$)"},{token:"markup.heading.2",regex:"^\\-+(?=\\s*$)"},{token:function(value){return"markup.heading."+value.length;},regex:/^#{1,6}(?=\s*[^ #]|\s+#.)/,next:"header"},github_embed("(?:javascript|js)","jscode-"),github_embed("xml","xmlcode-"),github_embed("html","htmlcode-"),github_embed("css","csscode-"),{token:"support.function",regex:"^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",next:"githubblock"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{token:"constant",regex:"^ {0,2}(?:(?: ?\\* ?){3,}|(?: ?\\- ?){3,}|(?: ?\\_ ?){3,})\\s*$",next:"allowBlock"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic"});this.addRules({"basic":[{token:"constant.language.escape",regex:/\\[\\`*_{}\[\]()#+\-.!]/},{token:"support.function",regex:"(`+)(.*?[^`])(\\1)"},{token:["text","constant","text","url","string","text"],regex:"^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"},{token:["text","string","text","constant","text"],regex:"(\\[)("+escaped("]")+")(\\]\\s*\\[)("+escaped("]")+")(\\])"},{token:["text","string","text","markup.underline","string","text"],regex:"(\\[)("+ escaped("]")+")(\\]\\()"+'((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)'+'(\\s*"'+escaped('"')+'"\\s*)?'+"(\\))"},{token:"string.strong",regex:"([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"},{token:"string.emphasis",regex:"([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"},{token:["text","url","text"],regex:"(<)("+"(?:https?|ftp|dict):[^'\">\\s]+"+"|"+"(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+"+")(>)"}],"allowBlock":[{token:"support.function",regex:"^ {4}.+",next:"allowBlock"},{token:"empty_line",regex:'^$',next:"allowBlock"},{token:"empty",regex:"",next:"start"}],"header":[{regex:"$",next:"start"},{include:"basic"},{defaultToken:"heading"}],"listblock-start":[{token:"support.variable",regex:/(?:\[[ x]\])?/,next:"listblock"}],"listblock":[{token:"empty_line",regex:"^$",next:"start"},{token:"markup.list",regex:"^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",next:"listblock-start"},{include:"basic",noEscape:true},{token:"support.function",regex:"^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",next:"githubblock"},{defaultToken:"list"}],"blockquote":[{token:"empty_line",regex:"^\\s*$",next:"start"},{token:"string.blockquote",regex:"^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",next:"blockquote"},{include:"basic",noEscape:true},{defaultToken:"string.blockquote"}],"githubblock":[{token:"support.function",regex:"^\\s*```",next:"start"},{token:"support.function",regex:".+"}]});this.embedRules(JavaScriptHighlightRules,"jscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(HtmlHighlightRules,"htmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(CssHighlightRules,"csscode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.embedRules(XmlHighlightRules,"xmlcode-",[{token:"support.function",regex:"^\\s*```",next:"pop"}]);this.normalizeRules();};oop.inherits(MarkdownHighlightRules,TextHighlightRules);exports.MarkdownHighlightRules=MarkdownHighlightRules;});ace.define("ace/mode/folding/markdown",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var BaseFoldMode=require("./fold_mode").FoldMode;var Range=require("../../range").Range;var FoldMode=exports.FoldMode=function(){};oop.inherits(FoldMode,BaseFoldMode);(function(){this.foldingStartMarker=/^(?:[=-]+\s*$|#{1,6} |`{3})/;this.getFoldWidget=function(session,foldStyle,row){var line=session.getLine(row);if(!this.foldingStartMarker.test(line)) return"";if(line[0]=="`"){if(session.bgTokenizer.getState(row)=="start") return"end";return"start";} @@ -4217,13 +4227,13 @@ continue;var level=getLevel();if(level>=startHeadingLevel) break;} endRow=row-(!token||["=","-"].indexOf(token.value[0])==-1?1:2);if(endRow>startRow){while(endRow>startRow&&/^\s*$/.test(session.getLine(endRow))) endRow--;} -if(endRow>startRow){var endColumn=session.getLine(endRow).length;return new Range(startRow,startColumn,endRow,endColumn);}}};}).call(FoldMode.prototype);});ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var JavaScriptMode=require("./javascript").Mode;var XmlMode=require("./xml").Mode;var HtmlMode=require("./html").Mode;var MarkdownHighlightRules=require("./markdown_highlight_rules").MarkdownHighlightRules;var MarkdownFoldMode=require("./folding/markdown").FoldMode;var Mode=function(){this.HighlightRules=MarkdownHighlightRules;this.createModeDelegates({"js-":JavaScriptMode,"xml-":XmlMode,"html-":HtmlMode});this.foldingRules=new MarkdownFoldMode();};oop.inherits(Mode,TextMode);(function(){this.type="text";this.blockComment={start:""};this.getNextLineIndent=function(state,line,tab){if(state=="listblock"){var match=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);if(!match) +if(endRow>startRow){var endColumn=session.getLine(endRow).length;return new Range(startRow,startColumn,endRow,endColumn);}}};}).call(FoldMode.prototype);});ace.define("ace/mode/markdown",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript","ace/mode/xml","ace/mode/html","ace/mode/markdown_highlight_rules","ace/mode/folding/markdown"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var JavaScriptMode=require("./javascript").Mode;var XmlMode=require("./xml").Mode;var HtmlMode=require("./html").Mode;var MarkdownHighlightRules=require("./markdown_highlight_rules").MarkdownHighlightRules;var MarkdownFoldMode=require("./folding/markdown").FoldMode;var Mode=function(){this.HighlightRules=MarkdownHighlightRules;this.createModeDelegates({"js-":JavaScriptMode,"xml-":XmlMode,"html-":HtmlMode});this.foldingRules=new MarkdownFoldMode();this.$behaviour=this.$defaultBehaviour;};oop.inherits(Mode,TextMode);(function(){this.type="text";this.blockComment={start:""};this.getNextLineIndent=function(state,line,tab){if(state=="listblock"){var match=/^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);if(!match) return"";var marker=match[2];if(!marker) marker=parseInt(match[3],10)+1+".";return match[1]+marker+match[4];}else{return this.$getIndent(line);}};this.$id="ace/mode/markdown";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/plain_text",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/text_highlight_rules","ace/mode/behaviour"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var Behaviour=require("./behaviour").Behaviour;var Mode=function(){this.HighlightRules=TextHighlightRules;this.$behaviour=new Behaviour();};oop.inherits(Mode,TextMode);(function(){this.type="text";this.getNextLineIndent=function(state,line,tab){return'';};this.$id="ace/mode/plain_text";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var DocCommentHighlightRules=function(){this.$rules={"start":[{token:"comment.doc.tag",regex:"@[\\w\\d_]+"},DocCommentHighlightRules.getTagRule(),{defaultToken:"comment.doc",caseInsensitive:true}]};};oop.inherits(DocCommentHighlightRules,TextHighlightRules);DocCommentHighlightRules.getTagRule=function(start){return{token:"comment.doc.tag.storage.type",regex:"\\b(?:TODO|FIXME|XXX|HACK)\\b"};} -DocCommentHighlightRules.getStartRule=function(start){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:start};};DocCommentHighlightRules.getEndRule=function(start){return{token:"comment.doc",regex:"\\*\\/",next:start};};exports.DocCommentHighlightRules=DocCommentHighlightRules;});ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var DocCommentHighlightRules=require("./doc_comment_highlight_rules").DocCommentHighlightRules;var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var identifierRe="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";var JavaScriptHighlightRules=function(options){var keywordMapper=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|"+"Namespace|QName|XML|XMLList|"+"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|"+"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|"+"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|"+"SyntaxError|TypeError|URIError|"+"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|"+"isNaN|parseFloat|parseInt|"+"JSON|Math|"+"this|arguments|prototype|window|document","keyword":"const|yield|import|get|set|async|await|"+"break|case|catch|continue|default|delete|do|else|finally|for|function|"+"if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|"+"__parent__|__count__|escape|unescape|with|__proto__|"+"class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier");var kwBeforeRe="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";var escapedRe="\\\\(?:x[0-9a-fA-F]{2}|"+"u[0-9a-fA-F]{4}|"+"u{[0-9a-fA-F]{1,6}}|"+"[0-2][0-7]{0,2}|"+"3[0-7][0-7]?|"+"[4-7][0-7]?|"+".)";this.$rules={"no_regex":[DocCommentHighlightRules.getStartRule("doc-start"),comments("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+identifierRe+")(\\.)(prototype)(\\.)("+identifierRe+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+identifierRe+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+kwBeforeRe+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:keywordMapper,regex:identifierRe},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:identifierRe},{regex:"",token:"empty",next:"no_regex"}],"start":[DocCommentHighlightRules.getStartRule("doc-start"),comments("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],"regex":[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],"regex_character_class":[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],"function_arguments":[{token:"variable.parameter",regex:identifierRe},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],"qqstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],"qstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!options||!options.noES6){this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(val,state,stack){this.next=val=="{"?this.nextState:"";if(val=="{"&&stack.length){stack.unshift("start",state);} +DocCommentHighlightRules.getStartRule=function(start){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:start};};DocCommentHighlightRules.getEndRule=function(start){return{token:"comment.doc",regex:"\\*\\/",next:start};};exports.DocCommentHighlightRules=DocCommentHighlightRules;});ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var DocCommentHighlightRules=require("./doc_comment_highlight_rules").DocCommentHighlightRules;var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var identifierRe="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";var JavaScriptHighlightRules=function(options){var keywordMapper=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|"+"Namespace|QName|XML|XMLList|"+"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|"+"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|"+"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|"+"SyntaxError|TypeError|URIError|"+"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|"+"isNaN|parseFloat|parseInt|"+"JSON|Math|"+"this|arguments|prototype|window|document","keyword":"const|yield|import|get|set|async|await|"+"break|case|catch|continue|default|delete|do|else|finally|for|function|"+"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|"+"__parent__|__count__|escape|unescape|with|__proto__|"+"class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier");var kwBeforeRe="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";var escapedRe="\\\\(?:x[0-9a-fA-F]{2}|"+"u[0-9a-fA-F]{4}|"+"u{[0-9a-fA-F]{1,6}}|"+"[0-2][0-7]{0,2}|"+"3[0-7][0-7]?|"+"[4-7][0-7]?|"+".)";this.$rules={"no_regex":[DocCommentHighlightRules.getStartRule("doc-start"),comments("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+identifierRe+")(\\.)(prototype)(\\.)("+identifierRe+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+identifierRe+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+kwBeforeRe+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:keywordMapper,regex:identifierRe},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:identifierRe},{regex:"",token:"empty",next:"no_regex"}],"start":[DocCommentHighlightRules.getStartRule("doc-start"),comments("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],"regex":[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],"regex_character_class":[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],"function_arguments":[{token:"variable.parameter",regex:identifierRe},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],"qqstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],"qstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!options||!options.noES6){this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(val,state,stack){this.next=val=="{"?this.nextState:"";if(val=="{"&&stack.length){stack.unshift("start",state);} else if(val=="}"&&stack.length){stack.shift();this.next=stack.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1) return"paren.quasi.end";} -return val=="{"?"paren.lparen":"paren.rparen";},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:escapedRe},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]});if(!options||!options.noJSX) +return val=="{"?"paren.lparen":"paren.rparen";},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:escapedRe},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]});if(!options||options.jsx!=false) JSX.call(this);} this.embedRules(DocCommentHighlightRules,"doc-",[DocCommentHighlightRules.getEndRule("no_regex")]);this.normalizeRules();};oop.inherits(JavaScriptHighlightRules,TextHighlightRules);function JSX(){var tagRegex=identifierRe.replace("\\d","\\d\\-");var jsxTag={onMatch:function(val,state,stack){var offset=val.charAt(1)=="/"?2:1;if(offset==1){if(state!=this.nextState) stack.unshift(this.next,this.nextState,0);else @@ -4234,23 +4244,7 @@ stack[1]--;if(!stack[1]||stack[1]<0){stack.splice(0,2);}} this.next=stack[0]||"start";return[{type:this.token,value:value}];},nextState:"jsx"},jsxJsRule,comments("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:tagRegex},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},jsxTag];this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}];} function comments(next){return[{token:"comment",regex:/\/\*/,next:[DocCommentHighlightRules.getTagRule(),{token:"comment",regex:"\\*\\/",next:next||"pop"},{defaultToken:"comment",caseInsensitive:true}]},{token:"comment",regex:"\\/\\/",next:[DocCommentHighlightRules.getTagRule(),{token:"comment",regex:"$|^",next:next||"pop"},{defaultToken:"comment",caseInsensitive:true}]}];} exports.JavaScriptHighlightRules=JavaScriptHighlightRules;});ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(require,exports,module){"use strict";var Range=require("../range").Range;var MatchingBraceOutdent=function(){};(function(){this.checkOutdent=function(line,input){if(!/^\s+$/.test(line)) -return false;return/^\s*\}/.test(input);};this.autoOutdent=function(doc,row){var line=doc.getLine(row);var match=line.match(/^(\s*\})/);if(!match)return 0;var column=match[1].length;var openBracePos=doc.findMatchingBracket({row:row,column:column});if(!openBracePos||openBracePos.row==row)return 0;var indent=this.$getIndent(doc.getLine(openBracePos.row));doc.replace(new Range(row,0,row,column-1),indent);};this.$getIndent=function(line){return line.match(/^\s*/)[0];};}).call(MatchingBraceOutdent.prototype);exports.MatchingBraceOutdent=MatchingBraceOutdent;});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var lang=require("../../lib/lang");var SAFE_INSERT_IN_TOKENS=["text","paren.rparen","punctuation.operator"];var SAFE_INSERT_BEFORE_TOKENS=["text","paren.rparen","punctuation.operator","comment"];var context;var contextCache={};var initContext=function(editor){var id=-1;if(editor.multiSelect){id=editor.selection.index;if(contextCache.rangeCount!=editor.multiSelect.rangeCount) -contextCache={rangeCount:editor.multiSelect.rangeCount};} -if(contextCache[id]) -return context=contextCache[id];context=contextCache[id]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""};};var getWrapped=function(selection,selected,opening,closing){var rowDiff=selection.end.row-selection.start.row;return{text:opening+selected+closing,selection:[0,selection.start.column+1,rowDiff,selection.end.column+(rowDiff?0:1)]};};var CstyleBehaviour=function(){this.add("braces","insertion",function(state,action,editor,session,text){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(text=='{'){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="{"&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'{','}');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){if(/[\]\}\)]/.test(line[cursor.column])||editor.inMultiSelectMode){CstyleBehaviour.recordAutoInsert(editor,session,"}");return{text:'{}',selection:[1,1]};}else{CstyleBehaviour.recordMaybeInsert(editor,session,"{");return{text:'{',selection:[1,1]};}}}else if(text=='}'){initContext(editor);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar=='}'){var matching=session.$findOpeningBracket('}',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}else if(text=="\n"||text=="\r\n"){initContext(editor);var closing="";if(CstyleBehaviour.isMaybeInsertedClosing(cursor,line)){closing=lang.stringRepeat("}",context.maybeInsertedBrackets);CstyleBehaviour.clearMaybeInsertedClosing();} -var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==='}'){var openBracePos=session.findMatchingBracket({row:cursor.row,column:cursor.column+1},'}');if(!openBracePos) -return null;var next_indent=this.$getIndent(session.getLine(openBracePos.row));}else if(closing){var next_indent=this.$getIndent(line);}else{CstyleBehaviour.clearMaybeInsertedClosing();return;} -var indent=next_indent+session.getTabString();return{text:'\n'+indent+'\n'+next_indent+closing,selection:[1,indent.length,1,indent.length]};}else{CstyleBehaviour.clearMaybeInsertedClosing();}});this.add("braces","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='{'){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar=='}'){range.end.column++;return range;}else{context.maybeInsertedBrackets--;}}});this.add("parens","insertion",function(state,action,editor,session,text){if(text=='('){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'(',')');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,")");return{text:'()',selection:[1,1]};}}else if(text==')'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==')'){var matching=session.$findOpeningBracket(')',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("parens","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='('){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==')'){range.end.column++;return range;}}});this.add("brackets","insertion",function(state,action,editor,session,text){if(text=='['){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'[',']');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,"]");return{text:'[]',selection:[1,1]};}}else if(text==']'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==']'){var matching=session.$findOpeningBracket(']',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("brackets","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='['){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==']'){range.end.column++;return range;}}});this.add("string_dquotes","insertion",function(state,action,editor,session,text){if(text=='"'||text=="'"){initContext(editor);var quote=text;var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="'"&&selected!='"'&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,quote,quote);}else if(!selected){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var leftChar=line.substring(cursor.column-1,cursor.column);var rightChar=line.substring(cursor.column,cursor.column+1);var token=session.getTokenAt(cursor.row,cursor.column);var rightToken=session.getTokenAt(cursor.row,cursor.column+1);if(leftChar=="\\"&&token&&/escape/.test(token.type)) -return null;var stringBefore=token&&/string|escape/.test(token.type);var stringAfter=!rightToken||/string|escape/.test(rightToken.type);var pair;if(rightChar==quote){pair=stringBefore!==stringAfter;}else{if(stringBefore&&!stringAfter) -return null;if(stringBefore&&stringAfter) -return null;var wordRe=session.$mode.tokenRe;wordRe.lastIndex=0;var isWordBefore=wordRe.test(leftChar);wordRe.lastIndex=0;var isWordAfter=wordRe.test(leftChar);if(isWordBefore||isWordAfter) -return null;if(rightChar&&!/[\s;,.})\]\\]/.test(rightChar)) -return null;pair=true;} -return{text:pair?quote+quote:"",selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});};CstyleBehaviour.isSaneInsertion=function(editor,session){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);if(!this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)){var iterator2=new TokenIterator(session,cursor.row,cursor.column+1);if(!this.$matchTokenType(iterator2.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)) -return false;} -iterator.stepForward();return iterator.getCurrentTokenRow()!==cursor.row||this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_BEFORE_TOKENS);};CstyleBehaviour.$matchTokenType=function(token,types){return types.indexOf(token.type||token)>-1;};CstyleBehaviour.recordAutoInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isAutoInsertedClosing(cursor,line,context.autoInsertedLineEnd[0])) -context.autoInsertedBrackets=0;context.autoInsertedRow=cursor.row;context.autoInsertedLineEnd=bracket+line.substr(cursor.column);context.autoInsertedBrackets++;};CstyleBehaviour.recordMaybeInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isMaybeInsertedClosing(cursor,line)) -context.maybeInsertedBrackets=0;context.maybeInsertedRow=cursor.row;context.maybeInsertedLineStart=line.substr(0,cursor.column)+bracket;context.maybeInsertedLineEnd=line.substr(cursor.column);context.maybeInsertedBrackets++;};CstyleBehaviour.isAutoInsertedClosing=function(cursor,line,bracket){return context.autoInsertedBrackets>0&&cursor.row===context.autoInsertedRow&&bracket===context.autoInsertedLineEnd[0]&&line.substr(cursor.column)===context.autoInsertedLineEnd;};CstyleBehaviour.isMaybeInsertedClosing=function(cursor,line){return context.maybeInsertedBrackets>0&&cursor.row===context.maybeInsertedRow&&line.substr(cursor.column)===context.maybeInsertedLineEnd&&line.substr(0,cursor.column)==context.maybeInsertedLineStart;};CstyleBehaviour.popAutoInsertedClosing=function(){context.autoInsertedLineEnd=context.autoInsertedLineEnd.substr(1);context.autoInsertedBrackets--;};CstyleBehaviour.clearMaybeInsertedClosing=function(){if(context){context.maybeInsertedBrackets=0;context.maybeInsertedRow=-1;}};oop.inherits(CstyleBehaviour,Behaviour);exports.CstyleBehaviour=CstyleBehaviour;});ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Range=require("../../range").Range;var BaseFoldMode=require("./fold_mode").FoldMode;var FoldMode=exports.FoldMode=function(commentRegex){if(commentRegex){this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.start));this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.end));}};oop.inherits(FoldMode,BaseFoldMode);(function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/;this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/;this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/;this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/;this._getFoldWidgetBase=this.getFoldWidget;this.getFoldWidget=function(session,foldStyle,row){var line=session.getLine(row);if(this.singleLineBlockCommentRe.test(line)){if(!this.startRegionRe.test(line)&&!this.tripleStarBlockCommentRe.test(line)) +return false;return/^\s*\}/.test(input);};this.autoOutdent=function(doc,row){var line=doc.getLine(row);var match=line.match(/^(\s*\})/);if(!match)return 0;var column=match[1].length;var openBracePos=doc.findMatchingBracket({row:row,column:column});if(!openBracePos||openBracePos.row==row)return 0;var indent=this.$getIndent(doc.getLine(openBracePos.row));doc.replace(new Range(row,0,row,column-1),indent);};this.$getIndent=function(line){return line.match(/^\s*/)[0];};}).call(MatchingBraceOutdent.prototype);exports.MatchingBraceOutdent=MatchingBraceOutdent;});ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Range=require("../../range").Range;var BaseFoldMode=require("./fold_mode").FoldMode;var FoldMode=exports.FoldMode=function(commentRegex){if(commentRegex){this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.start));this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.end));}};oop.inherits(FoldMode,BaseFoldMode);(function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/;this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/;this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/;this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/;this._getFoldWidgetBase=this.getFoldWidget;this.getFoldWidget=function(session,foldStyle,row){var line=session.getLine(row);if(this.singleLineBlockCommentRe.test(line)){if(!this.startRegionRe.test(line)&&!this.tripleStarBlockCommentRe.test(line)) return"";} var fw=this._getFoldWidgetBase(session,foldStyle,row);if(!fw&&this.startRegionRe.test(line)) return"start";return fw;};this.getFoldWidgetRange=function(session,foldStyle,row,forceMultiline){var line=session.getLine(row);if(this.startRegionRe.test(line)) @@ -4265,8 +4259,8 @@ continue;if(startIndent>indent) break;var subRange=this.getFoldWidgetRange(session,"all",row);if(subRange){if(subRange.start.row<=startRow){break;}else if(subRange.isMultiLine()){row=subRange.end.row;}else if(startIndent==indent){break;}} endRow=row;} return new Range(startRow,startColumn,endRow,session.getLine(endRow).length);};this.getCommentRegionBlock=function(session,line,row){var startColumn=line.search(/\s*$/);var maxRow=session.getLength();var startRow=row;var re=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;var depth=1;while(++rowstartRow){return new Range(startRow,startColumn,endRow,line.length);}};}).call(FoldMode.prototype);});ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var MatchingBraceOutdent=require("./matching_brace_outdent").MatchingBraceOutdent;var Range=require("../range").Range;var WorkerClient=require("../worker/worker_client").WorkerClient;var CstyleBehaviour=require("./behaviour/cstyle").CstyleBehaviour;var CStyleFoldMode=require("./folding/cstyle").FoldMode;var Mode=function(){this.HighlightRules=JavaScriptHighlightRules;this.$outdent=new MatchingBraceOutdent();this.$behaviour=new CstyleBehaviour();this.foldingRules=new CStyleFoldMode();};oop.inherits(Mode,TextMode);(function(){this.lineCommentStart="//";this.blockComment={start:"/*",end:"*/"};this.getNextLineIndent=function(state,line,tab){var indent=this.$getIndent(line);var tokenizedLine=this.getTokenizer().getLineTokens(line,state);var tokens=tokenizedLine.tokens;var endState=tokenizedLine.state;if(tokens.length&&tokens[tokens.length-1].type=="comment"){return indent;} -if(state=="start"||state=="no_regex"){var match=line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);if(match){indent+=tab;}}else if(state=="doc-start"){if(endState=="start"||endState=="no_regex"){return"";} +var endRow=row;if(endRow>startRow){return new Range(startRow,startColumn,endRow,line.length);}};}).call(FoldMode.prototype);});ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var MatchingBraceOutdent=require("./matching_brace_outdent").MatchingBraceOutdent;var WorkerClient=require("../worker/worker_client").WorkerClient;var CstyleBehaviour=require("./behaviour/cstyle").CstyleBehaviour;var CStyleFoldMode=require("./folding/cstyle").FoldMode;var Mode=function(){this.HighlightRules=JavaScriptHighlightRules;this.$outdent=new MatchingBraceOutdent();this.$behaviour=new CstyleBehaviour();this.foldingRules=new CStyleFoldMode();};oop.inherits(Mode,TextMode);(function(){this.lineCommentStart="//";this.blockComment={start:"/*",end:"*/"};this.getNextLineIndent=function(state,line,tab){var indent=this.$getIndent(line);var tokenizedLine=this.getTokenizer().getLineTokens(line,state);var tokens=tokenizedLine.tokens;var endState=tokenizedLine.state;if(tokens.length&&tokens[tokens.length-1].type=="comment"){return indent;} +if(state=="start"||state=="no_regex"){var match=line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);if(match){indent+=tab;}}else if(state=="doc-start"){if(endState=="start"||endState=="no_regex"){return"";} var match=line.match(/^\s*(\/?)\*/);if(match){if(match[1]){indent+=" ";} indent+="* ";}} return indent;};this.checkOutdent=function(state,line,input){return this.$outdent.checkOutdent(line,input);};this.autoOutdent=function(state,doc,row){this.$outdent.autoOutdent(doc,row);};this.createWorker=function(session){var worker=new WorkerClient(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");worker.attachToDocument(session.getDocument());worker.on("annotate",function(results){session.setAnnotations(results.data);});worker.on("terminate",function(){session.clearAnnotations();});return worker;};this.$id="ace/mode/javascript";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var lang=require("../lib/lang");var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var supportType=exports.supportType="align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";var supportFunction=exports.supportFunction="rgb|rgba|url|attr|counter|counters";var supportConstant=exports.supportConstant="absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";var supportConstantColor=exports.supportConstantColor="aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";var supportConstantFonts=exports.supportConstantFonts="arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";var numRe=exports.numRe="\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";var pseudoElements=exports.pseudoElements="(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";var pseudoClasses=exports.pseudoClasses="(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b";var CssHighlightRules=function(){var keywordMapper=this.createKeywordMapper({"support.function":supportFunction,"support.constant":supportConstant,"support.type":supportType,"support.constant.color":supportConstantColor,"support.constant.fonts":supportConstantFonts},"text",true);this.$rules={"start":[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"@.*?{",push:"media"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:true}],"media":[{token:"comment",regex:"\\/\\*",push:"comment"},{token:"paren.lparen",regex:"\\{",push:"ruleset"},{token:"string",regex:"\\}",next:"pop"},{token:"keyword",regex:"#[a-z0-9-_]+"},{token:"variable",regex:"\\.[a-z0-9-_]+"},{token:"string",regex:":[a-z0-9-_]+"},{token:"constant",regex:"[a-z0-9-_]+"},{caseInsensitive:true}],"comment":[{token:"comment",regex:"\\*\\/",next:"pop"},{defaultToken:"comment"}],"ruleset":[{token:"paren.rparen",regex:"\\}",next:"pop"},{token:"comment",regex:"\\/\\*",push:"comment"},{token:"string",regex:'["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'},{token:"string",regex:"['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"},{token:["constant.numeric","keyword"],regex:"("+numRe+")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"},{token:"constant.numeric",regex:numRe},{token:"constant.numeric",regex:"#[a-f0-9]{6}"},{token:"constant.numeric",regex:"#[a-f0-9]{3}"},{token:["punctuation","entity.other.attribute-name.pseudo-element.css"],regex:pseudoElements},{token:["punctuation","entity.other.attribute-name.pseudo-class.css"],regex:pseudoClasses},{token:["support.function","string","support.function"],regex:"(url\\()(.*)(\\))"},{token:keywordMapper,regex:"\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"},{caseInsensitive:true}]};this.normalizeRules();};oop.inherits(CssHighlightRules,TextHighlightRules);exports.CssHighlightRules=CssHighlightRules;});ace.define("ace/mode/css_completions",["require","exports","module"],function(require,exports,module){"use strict";var propertyMap={"background":{"#$0":1},"background-color":{"#$0":1,"transparent":1,"fixed":1},"background-image":{"url('/$0')":1},"background-repeat":{"repeat":1,"repeat-x":1,"repeat-y":1,"no-repeat":1,"inherit":1},"background-position":{"bottom":2,"center":2,"left":2,"right":2,"top":2,"inherit":2},"background-attachment":{"scroll":1,"fixed":1},"background-size":{"cover":1,"contain":1},"background-clip":{"border-box":1,"padding-box":1,"content-box":1},"background-origin":{"border-box":1,"padding-box":1,"content-box":1},"border":{"solid $0":1,"dashed $0":1,"dotted $0":1,"#$0":1},"border-color":{"#$0":1},"border-style":{"solid":2,"dashed":2,"dotted":2,"double":2,"groove":2,"hidden":2,"inherit":2,"inset":2,"none":2,"outset":2,"ridged":2},"border-collapse":{"collapse":1,"separate":1},"bottom":{"px":1,"em":1,"%":1},"clear":{"left":1,"right":1,"both":1,"none":1},"color":{"#$0":1,"rgb(#$00,0,0)":1},"cursor":{"default":1,"pointer":1,"move":1,"text":1,"wait":1,"help":1,"progress":1,"n-resize":1,"ne-resize":1,"e-resize":1,"se-resize":1,"s-resize":1,"sw-resize":1,"w-resize":1,"nw-resize":1},"display":{"none":1,"block":1,"inline":1,"inline-block":1,"table-cell":1},"empty-cells":{"show":1,"hide":1},"float":{"left":1,"right":1,"none":1},"font-family":{"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2,"Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana":1},"font-size":{"px":1,"em":1,"%":1},"font-weight":{"bold":1,"normal":1},"font-style":{"italic":1,"normal":1},"font-variant":{"normal":1,"small-caps":1},"height":{"px":1,"em":1,"%":1},"left":{"px":1,"em":1,"%":1},"letter-spacing":{"normal":1},"line-height":{"normal":1},"list-style-type":{"none":1,"disc":1,"circle":1,"square":1,"decimal":1,"decimal-leading-zero":1,"lower-roman":1,"upper-roman":1,"lower-greek":1,"lower-latin":1,"upper-latin":1,"georgian":1,"lower-alpha":1,"upper-alpha":1},"margin":{"px":1,"em":1,"%":1},"margin-right":{"px":1,"em":1,"%":1},"margin-left":{"px":1,"em":1,"%":1},"margin-top":{"px":1,"em":1,"%":1},"margin-bottom":{"px":1,"em":1,"%":1},"max-height":{"px":1,"em":1,"%":1},"max-width":{"px":1,"em":1,"%":1},"min-height":{"px":1,"em":1,"%":1},"min-width":{"px":1,"em":1,"%":1},"overflow":{"hidden":1,"visible":1,"auto":1,"scroll":1},"overflow-x":{"hidden":1,"visible":1,"auto":1,"scroll":1},"overflow-y":{"hidden":1,"visible":1,"auto":1,"scroll":1},"padding":{"px":1,"em":1,"%":1},"padding-top":{"px":1,"em":1,"%":1},"padding-right":{"px":1,"em":1,"%":1},"padding-bottom":{"px":1,"em":1,"%":1},"padding-left":{"px":1,"em":1,"%":1},"page-break-after":{"auto":1,"always":1,"avoid":1,"left":1,"right":1},"page-break-before":{"auto":1,"always":1,"avoid":1,"left":1,"right":1},"position":{"absolute":1,"relative":1,"fixed":1,"static":1},"right":{"px":1,"em":1,"%":1},"table-layout":{"fixed":1,"auto":1},"text-decoration":{"none":1,"underline":1,"line-through":1,"blink":1},"text-align":{"left":1,"right":1,"center":1,"justify":1},"text-transform":{"capitalize":1,"uppercase":1,"lowercase":1,"none":1},"top":{"px":1,"em":1,"%":1},"vertical-align":{"top":1,"bottom":1},"visibility":{"hidden":1,"visible":1},"white-space":{"nowrap":1,"normal":1,"pre":1,"pre-line":1,"pre-wrap":1},"width":{"px":1,"em":1,"%":1},"word-spacing":{"normal":1},"filter":{"alpha(opacity=$0100)":1},"text-shadow":{"$02px 2px 2px #777":1},"text-overflow":{"ellipsis-word":1,"clip":1,"ellipsis":1},"-moz-border-radius":1,"-moz-border-radius-topright":1,"-moz-border-radius-bottomright":1,"-moz-border-radius-topleft":1,"-moz-border-radius-bottomleft":1,"-webkit-border-radius":1,"-webkit-border-top-right-radius":1,"-webkit-border-top-left-radius":1,"-webkit-border-bottom-right-radius":1,"-webkit-border-bottom-left-radius":1,"-moz-box-shadow":1,"-webkit-box-shadow":1,"transform":{"rotate($00deg)":1,"skew($00deg)":1},"-moz-transform":{"rotate($00deg)":1,"skew($00deg)":1},"-webkit-transform":{"rotate($00deg)":1,"skew($00deg)":1}};var CssCompletions=function(){};(function(){this.completionsDefined=false;this.defineCompletions=function(){if(document){var style=document.createElement('c').style;for(var i in style){if(typeof style[i]!=='string') @@ -4286,18 +4280,18 @@ oop.inherits(CssBehaviour,CstyleBehaviour);exports.CssBehaviour=CssBehaviour;}); var match=line.match(/^.*\{\s*$/);if(match){indent+=tab;} return indent;};this.checkOutdent=function(state,line,input){return this.$outdent.checkOutdent(line,input);};this.autoOutdent=function(state,doc,row){this.$outdent.autoOutdent(doc,row);};this.getCompletions=function(state,session,pos,prefix){return this.$completer.getCompletions(state,session,pos,prefix);};this.createWorker=function(session){var worker=new WorkerClient(["ace"],"ace/mode/css_worker","Worker");worker.attachToDocument(session.getDocument());worker.on("annotate",function(e){session.setAnnotations(e.data);});worker.on("terminate",function(){session.clearAnnotations();});return worker;};this.$id="ace/mode/css";}).call(Mode.prototype);exports.Mode=Mode;});ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var XmlHighlightRules=function(normalize){var tagRegex="[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.xml-decl.xml","keyword.xml-decl.xml"],regex:"(<\\?)(xml)(?=[\\s])",next:"xml_decl",caseInsensitive:true},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)("+tagRegex+")",next:"processing_instruction"},{token:"comment.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:true},{include:"tag"},{token:"text.end-tag-open.xml",regex:"",next:"start"}],processing_instruction:[{token:"punctuation.instruction.xml",regex:"\\?>",next:"start"},{defaultToken:"instruction.xml"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)("+tagRegex+")",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:"(?:"+tagRegex+":)?"+tagRegex+""},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]};if(this.constructor===XmlHighlightRules) this.normalizeRules();};(function(){this.embedTagRules=function(HighlightRules,prefix,tag){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+tag+".tag-name.xml"],regex:"(<)("+tag+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:prefix+"start"}]});this.$rules[tag+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(value,currentState,stack){stack.splice(0);return this.token;}}] -this.embedRules(HighlightRules,prefix,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+tag+".tag-name.xml"],regex:"(|$))",next:tag+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}]);};}).call(TextHighlightRules.prototype);oop.inherits(XmlHighlightRules,TextHighlightRules);exports.XmlHighlightRules=XmlHighlightRules;});ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var lang=require("../lib/lang");var CssHighlightRules=require("./css_highlight_rules").CssHighlightRules;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var XmlHighlightRules=require("./xml_highlight_rules").XmlHighlightRules;var tagMap=lang.createMap({a:'anchor',button:'form',form:'form',img:'image',input:'form',label:'form',option:'form',script:'script',select:'form',textarea:'form',style:'style',table:'table',tbody:'table',td:'table',tfoot:'table',th:'table',tr:'table'});var HtmlHighlightRules=function(){XmlHighlightRules.call(this);this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(start,tag){var group=tagMap[tag];return["meta.tag.punctuation."+(start=="<"?"":"end-")+"tag-open.xml","meta.tag"+(group?"."+group:"")+".tag-name.xml"];},regex:"(",next:"start"}]});this.embedTagRules(CssHighlightRules,"css-","style");this.embedTagRules(new JavaScriptHighlightRules({noJSX:true}).getRules(),"js-","script");if(this.constructor===HtmlHighlightRules) +this.embedRules(HighlightRules,prefix,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+tag+".tag-name.xml"],regex:"(|$))",next:tag+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}]);};}).call(TextHighlightRules.prototype);oop.inherits(XmlHighlightRules,TextHighlightRules);exports.XmlHighlightRules=XmlHighlightRules;});ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var lang=require("../lib/lang");var CssHighlightRules=require("./css_highlight_rules").CssHighlightRules;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var XmlHighlightRules=require("./xml_highlight_rules").XmlHighlightRules;var tagMap=lang.createMap({a:'anchor',button:'form',form:'form',img:'image',input:'form',label:'form',option:'form',script:'script',select:'form',textarea:'form',style:'style',table:'table',tbody:'table',td:'table',tfoot:'table',th:'table',tr:'table'});var HtmlHighlightRules=function(){XmlHighlightRules.call(this);this.addRules({attributes:[{include:"tag_whitespace"},{token:"entity.other.attribute-name.xml",regex:"[-_a-zA-Z0-9:.]+"},{token:"keyword.operator.attribute-equals.xml",regex:"=",push:[{include:"tag_whitespace"},{token:"string.unquoted.attribute-value.html",regex:"[^<>='\"`\\s]+",next:"pop"},{token:"empty",regex:"",next:"pop"}]},{include:"attribute_value"}],tag:[{token:function(start,tag){var group=tagMap[tag];return["meta.tag.punctuation."+(start=="<"?"":"end-")+"tag-open.xml","meta.tag"+(group?"."+group:"")+".tag-name.xml"];},regex:"(",next:"start"}]});this.embedTagRules(CssHighlightRules,"css-","style");this.embedTagRules(new JavaScriptHighlightRules({jsx:false}).getRules(),"js-","script");if(this.constructor===HtmlHighlightRules) this.normalizeRules();};oop.inherits(HtmlHighlightRules,XmlHighlightRules);exports.HtmlHighlightRules=HtmlHighlightRules;});ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var lang=require("../../lib/lang");function is(token,type){return token.type.lastIndexOf(type+".xml")>-1;} var XmlBehaviour=function(){this.add("string_dquotes","insertion",function(state,action,editor,session,text){if(text=='"'||text=="'"){var quote=text;var selected=session.doc.getTextRange(editor.getSelectionRange());if(selected!==""&&selected!=="'"&&selected!='"'&&editor.getWrapBehavioursEnabled()){return{text:quote+selected+quote,selection:false};} var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);var iterator=new TokenIterator(session,cursor.row,cursor.column);var token=iterator.getCurrentToken();if(rightChar==quote&&(is(token,"attribute-value")||is(token,"string"))){return{text:"",selection:[1,1]};} if(!token) token=iterator.stepBackward();if(!token) return;while(is(token,"tag-whitespace")||is(token,"whitespace")){token=iterator.stepBackward();} -var rightSpace=!rightChar||rightChar.match(/\s/);if(is(token,"attribute-equals")&&(rightSpace||rightChar=='>')||(is(token,"decl-attribute-equals")&&(rightSpace||rightChar=='?'))){return{text:quote+quote,selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});this.add("autoclosing","insertion",function(state,action,editor,session,text){if(text=='>'){var position=editor.getCursorPosition();var iterator=new TokenIterator(session,position.row,position.column);var token=iterator.getCurrentToken()||iterator.stepBackward();if(!token||!(is(token,"tag-name")||is(token,"tag-whitespace")||is(token,"attribute-name")||is(token,"attribute-equals")||is(token,"attribute-value"))) +var rightSpace=!rightChar||rightChar.match(/\s/);if(is(token,"attribute-equals")&&(rightSpace||rightChar=='>')||(is(token,"decl-attribute-equals")&&(rightSpace||rightChar=='?'))){return{text:quote+quote,selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});this.add("autoclosing","insertion",function(state,action,editor,session,text){if(text=='>'){var position=editor.getSelectionRange().start;var iterator=new TokenIterator(session,position.row,position.column);var token=iterator.getCurrentToken()||iterator.stepBackward();if(!token||!(is(token,"tag-name")||is(token,"tag-whitespace")||is(token,"attribute-name")||is(token,"attribute-equals")||is(token,"attribute-value"))) return;if(is(token,"reference.attribute-value")) return;if(is(token,"attribute-value")){var firstChar=token.value.charAt(0);if(firstChar=='"'||firstChar=="'"){var lastChar=token.value.charAt(token.value.length-1);var tokenEnd=iterator.getCurrentTokenColumn()+token.value.length;if(tokenEnd>position.column||tokenEnd==position.column&&firstChar!=lastChar) return;}} -while(!is(token,"tag-name")){token=iterator.stepBackward();} +while(!is(token,"tag-name")){token=iterator.stepBackward();if(token.value=="<"){token=iterator.stepForward();break;}} var tokenRow=iterator.getCurrentTokenRow();var tokenColumn=iterator.getCurrentTokenColumn();if(is(iterator.stepBackward(),"end-tag-open")) return;var element=token.value;if(tokenRow==position.row) element=element.substring(0,position.column-tokenColumn);if(this.voidElements.hasOwnProperty(element.toLowerCase())) @@ -4348,7 +4342,7 @@ var HtmlCompletions=function(){};(function(){this.getCompletions=function(state, return[];if(is(token,"tag-name")||is(token,"tag-open")||is(token,"end-tag-open")) return this.getTagCompletions(state,session,pos,prefix);if(is(token,"tag-whitespace")||is(token,"attribute-name")) return this.getAttributeCompletions(state,session,pos,prefix);if(is(token,"attribute-value")) -return this.getAttributeValueCompletions(state,session,pos,prefix);var line=session.getLine(pos.row).substr(0,pos.column);if(/&[A-z]*$/i.test(line)) +return this.getAttributeValueCompletions(state,session,pos,prefix);var line=session.getLine(pos.row).substr(0,pos.column);if(/&[a-z]*$/i.test(line)) return this.getHTMLEntityCompletions(state,session,pos,prefix);return[];};this.getTagCompletions=function(state,session,pos,prefix){return elements.map(function(element){return{value:element,meta:"tag",score:Number.MAX_VALUE};});};this.getAttributeCompletions=function(state,session,pos,prefix){var tagName=findTagName(session,pos);if(!tagName) return[];var attributes=globalAttributes;if(tagName in attributeMap){attributes=attributes.concat(Object.keys(attributeMap[tagName]));} return attributes.map(function(attribute){return{caption:attribute,snippet:attribute+'="$0"',meta:"attribute",score:Number.MAX_VALUE};});};this.getAttributeValueCompletions=function(state,session,pos,prefix){var tagName=findTagName(session,pos);var attributeName=findAttributeName(session,pos);if(!tagName) @@ -4359,23 +4353,7 @@ worker.call("setOptions",[{context:this.fragmentContext}]);worker.on("error",fun return"keyword";else return"variable";},regex:"[@\\$][a-z0-9_\\-@\\$]*\\b"},{token:"variable",regex:"[@\\$]\\{[a-z0-9_\\-@\\$]*\\}"},{token:function(first,second){if(properties.indexOf(first.toLowerCase())>-1){return["support.type.property","text"];} else{return["support.type.unknownProperty","text"];}},regex:"([a-z0-9-_]+)(\\s*:)"},{token:"keyword",regex:"&"},{token:keywordMapper,regex:"\\-?[@a-z_][@a-z0-9_\\-]*"},{token:"variable.language",regex:"#[a-z0-9-_]+"},{token:"variable.language",regex:"\\.[a-z0-9-_]+"},{token:"variable.language",regex:":[a-z_][a-z0-9-_]*"},{token:"constant",regex:"[a-z0-9-_]+"},{token:"keyword.operator",regex:"<|>|<=|>=|=|!=|-|%|\\+|\\*"},{token:"paren.lparen",regex:"[[({]"},{token:"paren.rparen",regex:"[\\])}]"},{token:"text",regex:"\\s+"},{caseInsensitive:true}],"comment":[{token:"comment",regex:".*?\\*\\/",next:"start"},{token:"comment",regex:".+"}]};this.normalizeRules();};oop.inherits(LessHighlightRules,TextHighlightRules);exports.LessHighlightRules=LessHighlightRules;});ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(require,exports,module){"use strict";var Range=require("../range").Range;var MatchingBraceOutdent=function(){};(function(){this.checkOutdent=function(line,input){if(!/^\s+$/.test(line)) -return false;return/^\s*\}/.test(input);};this.autoOutdent=function(doc,row){var line=doc.getLine(row);var match=line.match(/^(\s*\})/);if(!match)return 0;var column=match[1].length;var openBracePos=doc.findMatchingBracket({row:row,column:column});if(!openBracePos||openBracePos.row==row)return 0;var indent=this.$getIndent(doc.getLine(openBracePos.row));doc.replace(new Range(row,0,row,column-1),indent);};this.$getIndent=function(line){return line.match(/^\s*/)[0];};}).call(MatchingBraceOutdent.prototype);exports.MatchingBraceOutdent=MatchingBraceOutdent;});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var lang=require("../../lib/lang");var SAFE_INSERT_IN_TOKENS=["text","paren.rparen","punctuation.operator"];var SAFE_INSERT_BEFORE_TOKENS=["text","paren.rparen","punctuation.operator","comment"];var context;var contextCache={};var initContext=function(editor){var id=-1;if(editor.multiSelect){id=editor.selection.index;if(contextCache.rangeCount!=editor.multiSelect.rangeCount) -contextCache={rangeCount:editor.multiSelect.rangeCount};} -if(contextCache[id]) -return context=contextCache[id];context=contextCache[id]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""};};var getWrapped=function(selection,selected,opening,closing){var rowDiff=selection.end.row-selection.start.row;return{text:opening+selected+closing,selection:[0,selection.start.column+1,rowDiff,selection.end.column+(rowDiff?0:1)]};};var CstyleBehaviour=function(){this.add("braces","insertion",function(state,action,editor,session,text){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(text=='{'){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="{"&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'{','}');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){if(/[\]\}\)]/.test(line[cursor.column])||editor.inMultiSelectMode){CstyleBehaviour.recordAutoInsert(editor,session,"}");return{text:'{}',selection:[1,1]};}else{CstyleBehaviour.recordMaybeInsert(editor,session,"{");return{text:'{',selection:[1,1]};}}}else if(text=='}'){initContext(editor);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar=='}'){var matching=session.$findOpeningBracket('}',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}else if(text=="\n"||text=="\r\n"){initContext(editor);var closing="";if(CstyleBehaviour.isMaybeInsertedClosing(cursor,line)){closing=lang.stringRepeat("}",context.maybeInsertedBrackets);CstyleBehaviour.clearMaybeInsertedClosing();} -var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==='}'){var openBracePos=session.findMatchingBracket({row:cursor.row,column:cursor.column+1},'}');if(!openBracePos) -return null;var next_indent=this.$getIndent(session.getLine(openBracePos.row));}else if(closing){var next_indent=this.$getIndent(line);}else{CstyleBehaviour.clearMaybeInsertedClosing();return;} -var indent=next_indent+session.getTabString();return{text:'\n'+indent+'\n'+next_indent+closing,selection:[1,indent.length,1,indent.length]};}else{CstyleBehaviour.clearMaybeInsertedClosing();}});this.add("braces","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='{'){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar=='}'){range.end.column++;return range;}else{context.maybeInsertedBrackets--;}}});this.add("parens","insertion",function(state,action,editor,session,text){if(text=='('){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'(',')');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,")");return{text:'()',selection:[1,1]};}}else if(text==')'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==')'){var matching=session.$findOpeningBracket(')',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("parens","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='('){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==')'){range.end.column++;return range;}}});this.add("brackets","insertion",function(state,action,editor,session,text){if(text=='['){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'[',']');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,"]");return{text:'[]',selection:[1,1]};}}else if(text==']'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==']'){var matching=session.$findOpeningBracket(']',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("brackets","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='['){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==']'){range.end.column++;return range;}}});this.add("string_dquotes","insertion",function(state,action,editor,session,text){if(text=='"'||text=="'"){initContext(editor);var quote=text;var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="'"&&selected!='"'&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,quote,quote);}else if(!selected){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var leftChar=line.substring(cursor.column-1,cursor.column);var rightChar=line.substring(cursor.column,cursor.column+1);var token=session.getTokenAt(cursor.row,cursor.column);var rightToken=session.getTokenAt(cursor.row,cursor.column+1);if(leftChar=="\\"&&token&&/escape/.test(token.type)) -return null;var stringBefore=token&&/string|escape/.test(token.type);var stringAfter=!rightToken||/string|escape/.test(rightToken.type);var pair;if(rightChar==quote){pair=stringBefore!==stringAfter;}else{if(stringBefore&&!stringAfter) -return null;if(stringBefore&&stringAfter) -return null;var wordRe=session.$mode.tokenRe;wordRe.lastIndex=0;var isWordBefore=wordRe.test(leftChar);wordRe.lastIndex=0;var isWordAfter=wordRe.test(leftChar);if(isWordBefore||isWordAfter) -return null;if(rightChar&&!/[\s;,.})\]\\]/.test(rightChar)) -return null;pair=true;} -return{text:pair?quote+quote:"",selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});};CstyleBehaviour.isSaneInsertion=function(editor,session){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);if(!this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)){var iterator2=new TokenIterator(session,cursor.row,cursor.column+1);if(!this.$matchTokenType(iterator2.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)) -return false;} -iterator.stepForward();return iterator.getCurrentTokenRow()!==cursor.row||this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_BEFORE_TOKENS);};CstyleBehaviour.$matchTokenType=function(token,types){return types.indexOf(token.type||token)>-1;};CstyleBehaviour.recordAutoInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isAutoInsertedClosing(cursor,line,context.autoInsertedLineEnd[0])) -context.autoInsertedBrackets=0;context.autoInsertedRow=cursor.row;context.autoInsertedLineEnd=bracket+line.substr(cursor.column);context.autoInsertedBrackets++;};CstyleBehaviour.recordMaybeInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isMaybeInsertedClosing(cursor,line)) -context.maybeInsertedBrackets=0;context.maybeInsertedRow=cursor.row;context.maybeInsertedLineStart=line.substr(0,cursor.column)+bracket;context.maybeInsertedLineEnd=line.substr(cursor.column);context.maybeInsertedBrackets++;};CstyleBehaviour.isAutoInsertedClosing=function(cursor,line,bracket){return context.autoInsertedBrackets>0&&cursor.row===context.autoInsertedRow&&bracket===context.autoInsertedLineEnd[0]&&line.substr(cursor.column)===context.autoInsertedLineEnd;};CstyleBehaviour.isMaybeInsertedClosing=function(cursor,line){return context.maybeInsertedBrackets>0&&cursor.row===context.maybeInsertedRow&&line.substr(cursor.column)===context.maybeInsertedLineEnd&&line.substr(0,cursor.column)==context.maybeInsertedLineStart;};CstyleBehaviour.popAutoInsertedClosing=function(){context.autoInsertedLineEnd=context.autoInsertedLineEnd.substr(1);context.autoInsertedBrackets--;};CstyleBehaviour.clearMaybeInsertedClosing=function(){if(context){context.maybeInsertedBrackets=0;context.maybeInsertedRow=-1;}};oop.inherits(CstyleBehaviour,Behaviour);exports.CstyleBehaviour=CstyleBehaviour;});ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var CstyleBehaviour=require("./cstyle").CstyleBehaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var CssBehaviour=function(){this.inherit(CstyleBehaviour);this.add("colon","insertion",function(state,action,editor,session,text){if(text===':'){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);var token=iterator.getCurrentToken();if(token&&token.value.match(/\s+/)){token=iterator.stepBackward();} +return false;return/^\s*\}/.test(input);};this.autoOutdent=function(doc,row){var line=doc.getLine(row);var match=line.match(/^(\s*\})/);if(!match)return 0;var column=match[1].length;var openBracePos=doc.findMatchingBracket({row:row,column:column});if(!openBracePos||openBracePos.row==row)return 0;var indent=this.$getIndent(doc.getLine(openBracePos.row));doc.replace(new Range(row,0,row,column-1),indent);};this.$getIndent=function(line){return line.match(/^\s*/)[0];};}).call(MatchingBraceOutdent.prototype);exports.MatchingBraceOutdent=MatchingBraceOutdent;});ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var CstyleBehaviour=require("./cstyle").CstyleBehaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var CssBehaviour=function(){this.inherit(CstyleBehaviour);this.add("colon","insertion",function(state,action,editor,session,text){if(text===':'){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);var token=iterator.getCurrentToken();if(token&&token.value.match(/\s+/)){token=iterator.stepBackward();} if(token&&token.type==='support.type'){var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar===':'){return{text:'',selection:[1,1]}} if(!line.substring(cursor.column).match(/^\s*;/)){return{text:':;',selection:[1,1]}}}}});this.add("colon","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected===':'){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);var token=iterator.getCurrentToken();if(token&&token.value.match(/\s+/)){token=iterator.stepBackward();} if(token&&token.type==='support.type'){var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar===';'){range.end.column++;return range;}}}});this.add("semicolon","insertion",function(state,action,editor,session,text){if(text===';'){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar===';'){return{text:'',selection:[1,1]}}}});} @@ -4415,23 +4393,7 @@ var token=session.getTokenAt(pos.row,pos.column);if(!token) return[];if(state==='ruleset'){var line=session.getLine(pos.row).substr(0,pos.column);if(/:[^;]+$/.test(line)){/([\w\-]+):[^:]*$/.test(line);return this.getPropertyValueCompletions(state,session,pos,prefix);}else{return this.getPropertyCompletions(state,session,pos,prefix);}} return[];};this.getPropertyCompletions=function(state,session,pos,prefix){var properties=Object.keys(propertyMap);return properties.map(function(property){return{caption:property,snippet:property+': $0',meta:"property",score:Number.MAX_VALUE};});};this.getPropertyValueCompletions=function(state,session,pos,prefix){var line=session.getLine(pos.row).substr(0,pos.column);var property=(/([\w\-]+):[^:]*$/.exec(line)||{})[1];if(!property) return[];var values=[];if(property in propertyMap&&typeof propertyMap[property]==="object"){values=Object.keys(propertyMap[property]);} -return values.map(function(value){return{caption:value,snippet:value,meta:"property value",score:Number.MAX_VALUE};});};}).call(CssCompletions.prototype);exports.CssCompletions=CssCompletions;});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var lang=require("../../lib/lang");var SAFE_INSERT_IN_TOKENS=["text","paren.rparen","punctuation.operator"];var SAFE_INSERT_BEFORE_TOKENS=["text","paren.rparen","punctuation.operator","comment"];var context;var contextCache={};var initContext=function(editor){var id=-1;if(editor.multiSelect){id=editor.selection.index;if(contextCache.rangeCount!=editor.multiSelect.rangeCount) -contextCache={rangeCount:editor.multiSelect.rangeCount};} -if(contextCache[id]) -return context=contextCache[id];context=contextCache[id]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""};};var getWrapped=function(selection,selected,opening,closing){var rowDiff=selection.end.row-selection.start.row;return{text:opening+selected+closing,selection:[0,selection.start.column+1,rowDiff,selection.end.column+(rowDiff?0:1)]};};var CstyleBehaviour=function(){this.add("braces","insertion",function(state,action,editor,session,text){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(text=='{'){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="{"&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'{','}');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){if(/[\]\}\)]/.test(line[cursor.column])||editor.inMultiSelectMode){CstyleBehaviour.recordAutoInsert(editor,session,"}");return{text:'{}',selection:[1,1]};}else{CstyleBehaviour.recordMaybeInsert(editor,session,"{");return{text:'{',selection:[1,1]};}}}else if(text=='}'){initContext(editor);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar=='}'){var matching=session.$findOpeningBracket('}',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}else if(text=="\n"||text=="\r\n"){initContext(editor);var closing="";if(CstyleBehaviour.isMaybeInsertedClosing(cursor,line)){closing=lang.stringRepeat("}",context.maybeInsertedBrackets);CstyleBehaviour.clearMaybeInsertedClosing();} -var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==='}'){var openBracePos=session.findMatchingBracket({row:cursor.row,column:cursor.column+1},'}');if(!openBracePos) -return null;var next_indent=this.$getIndent(session.getLine(openBracePos.row));}else if(closing){var next_indent=this.$getIndent(line);}else{CstyleBehaviour.clearMaybeInsertedClosing();return;} -var indent=next_indent+session.getTabString();return{text:'\n'+indent+'\n'+next_indent+closing,selection:[1,indent.length,1,indent.length]};}else{CstyleBehaviour.clearMaybeInsertedClosing();}});this.add("braces","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='{'){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar=='}'){range.end.column++;return range;}else{context.maybeInsertedBrackets--;}}});this.add("parens","insertion",function(state,action,editor,session,text){if(text=='('){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'(',')');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,")");return{text:'()',selection:[1,1]};}}else if(text==')'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==')'){var matching=session.$findOpeningBracket(')',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("parens","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='('){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==')'){range.end.column++;return range;}}});this.add("brackets","insertion",function(state,action,editor,session,text){if(text=='['){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'[',']');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,"]");return{text:'[]',selection:[1,1]};}}else if(text==']'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==']'){var matching=session.$findOpeningBracket(']',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("brackets","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='['){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==']'){range.end.column++;return range;}}});this.add("string_dquotes","insertion",function(state,action,editor,session,text){if(text=='"'||text=="'"){initContext(editor);var quote=text;var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="'"&&selected!='"'&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,quote,quote);}else if(!selected){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var leftChar=line.substring(cursor.column-1,cursor.column);var rightChar=line.substring(cursor.column,cursor.column+1);var token=session.getTokenAt(cursor.row,cursor.column);var rightToken=session.getTokenAt(cursor.row,cursor.column+1);if(leftChar=="\\"&&token&&/escape/.test(token.type)) -return null;var stringBefore=token&&/string|escape/.test(token.type);var stringAfter=!rightToken||/string|escape/.test(rightToken.type);var pair;if(rightChar==quote){pair=stringBefore!==stringAfter;}else{if(stringBefore&&!stringAfter) -return null;if(stringBefore&&stringAfter) -return null;var wordRe=session.$mode.tokenRe;wordRe.lastIndex=0;var isWordBefore=wordRe.test(leftChar);wordRe.lastIndex=0;var isWordAfter=wordRe.test(leftChar);if(isWordBefore||isWordAfter) -return null;if(rightChar&&!/[\s;,.})\]\\]/.test(rightChar)) -return null;pair=true;} -return{text:pair?quote+quote:"",selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});};CstyleBehaviour.isSaneInsertion=function(editor,session){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);if(!this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)){var iterator2=new TokenIterator(session,cursor.row,cursor.column+1);if(!this.$matchTokenType(iterator2.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)) -return false;} -iterator.stepForward();return iterator.getCurrentTokenRow()!==cursor.row||this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_BEFORE_TOKENS);};CstyleBehaviour.$matchTokenType=function(token,types){return types.indexOf(token.type||token)>-1;};CstyleBehaviour.recordAutoInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isAutoInsertedClosing(cursor,line,context.autoInsertedLineEnd[0])) -context.autoInsertedBrackets=0;context.autoInsertedRow=cursor.row;context.autoInsertedLineEnd=bracket+line.substr(cursor.column);context.autoInsertedBrackets++;};CstyleBehaviour.recordMaybeInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isMaybeInsertedClosing(cursor,line)) -context.maybeInsertedBrackets=0;context.maybeInsertedRow=cursor.row;context.maybeInsertedLineStart=line.substr(0,cursor.column)+bracket;context.maybeInsertedLineEnd=line.substr(cursor.column);context.maybeInsertedBrackets++;};CstyleBehaviour.isAutoInsertedClosing=function(cursor,line,bracket){return context.autoInsertedBrackets>0&&cursor.row===context.autoInsertedRow&&bracket===context.autoInsertedLineEnd[0]&&line.substr(cursor.column)===context.autoInsertedLineEnd;};CstyleBehaviour.isMaybeInsertedClosing=function(cursor,line){return context.maybeInsertedBrackets>0&&cursor.row===context.maybeInsertedRow&&line.substr(cursor.column)===context.maybeInsertedLineEnd&&line.substr(0,cursor.column)==context.maybeInsertedLineStart;};CstyleBehaviour.popAutoInsertedClosing=function(){context.autoInsertedLineEnd=context.autoInsertedLineEnd.substr(1);context.autoInsertedBrackets--;};CstyleBehaviour.clearMaybeInsertedClosing=function(){if(context){context.maybeInsertedBrackets=0;context.maybeInsertedRow=-1;}};oop.inherits(CstyleBehaviour,Behaviour);exports.CstyleBehaviour=CstyleBehaviour;});ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var CstyleBehaviour=require("./cstyle").CstyleBehaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var CssBehaviour=function(){this.inherit(CstyleBehaviour);this.add("colon","insertion",function(state,action,editor,session,text){if(text===':'){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);var token=iterator.getCurrentToken();if(token&&token.value.match(/\s+/)){token=iterator.stepBackward();} +return values.map(function(value){return{caption:value,snippet:value,meta:"property value",score:Number.MAX_VALUE};});};}).call(CssCompletions.prototype);exports.CssCompletions=CssCompletions;});ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var CstyleBehaviour=require("./cstyle").CstyleBehaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var CssBehaviour=function(){this.inherit(CstyleBehaviour);this.add("colon","insertion",function(state,action,editor,session,text){if(text===':'){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);var token=iterator.getCurrentToken();if(token&&token.value.match(/\s+/)){token=iterator.stepBackward();} if(token&&token.type==='support.type'){var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar===':'){return{text:'',selection:[1,1]}} if(!line.substring(cursor.column).match(/^\s*;/)){return{text:':;',selection:[1,1]}}}}});this.add("colon","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected===':'){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);var token=iterator.getCurrentToken();if(token&&token.value.match(/\s+/)){token=iterator.stepBackward();} if(token&&token.type==='support.type'){var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar===';'){range.end.column++;return range;}}}});this.add("semicolon","insertion",function(state,action,editor,session,text){if(text===';'){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar===';'){return{text:'',selection:[1,1]}}}});} @@ -4534,10 +4496,10 @@ session.foldWidgets[row-1]="";if(indent+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:identifierRe},{regex:"",token:"empty",next:"no_regex"}],"start":[DocCommentHighlightRules.getStartRule("doc-start"),comments("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],"regex":[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],"regex_character_class":[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],"function_arguments":[{token:"variable.parameter",regex:identifierRe},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],"qqstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],"qstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!options||!options.noES6){this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(val,state,stack){this.next=val=="{"?this.nextState:"";if(val=="{"&&stack.length){stack.unshift("start",state);} +DocCommentHighlightRules.getStartRule=function(start){return{token:"comment.doc",regex:"\\/\\*(?=\\*)",next:start};};DocCommentHighlightRules.getEndRule=function(start){return{token:"comment.doc",regex:"\\*\\/",next:start};};exports.DocCommentHighlightRules=DocCommentHighlightRules;});ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var DocCommentHighlightRules=require("./doc_comment_highlight_rules").DocCommentHighlightRules;var TextHighlightRules=require("./text_highlight_rules").TextHighlightRules;var identifierRe="[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";var JavaScriptHighlightRules=function(options){var keywordMapper=this.createKeywordMapper({"variable.language":"Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|"+"Namespace|QName|XML|XMLList|"+"ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|"+"Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|"+"Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|"+"SyntaxError|TypeError|URIError|"+"decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|"+"isNaN|parseFloat|parseInt|"+"JSON|Math|"+"this|arguments|prototype|window|document","keyword":"const|yield|import|get|set|async|await|"+"break|case|catch|continue|default|delete|do|else|finally|for|function|"+"if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|"+"__parent__|__count__|escape|unescape|with|__proto__|"+"class|enum|extends|super|export|implements|private|public|interface|package|protected|static","storage.type":"const|let|var|function","constant.language":"null|Infinity|NaN|undefined","support.function":"alert","constant.language.boolean":"true|false"},"identifier");var kwBeforeRe="case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";var escapedRe="\\\\(?:x[0-9a-fA-F]{2}|"+"u[0-9a-fA-F]{4}|"+"u{[0-9a-fA-F]{1,6}}|"+"[0-2][0-7]{0,2}|"+"3[0-7][0-7]?|"+"[4-7][0-7]?|"+".)";this.$rules={"no_regex":[DocCommentHighlightRules.getStartRule("doc-start"),comments("no_regex"),{token:"string",regex:"'(?=.)",next:"qstring"},{token:"string",regex:'"(?=.)',next:"qqstring"},{token:"constant.numeric",regex:/0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/},{token:"constant.numeric",regex:/[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/},{token:["storage.type","punctuation.operator","support.function","punctuation.operator","entity.name.function","text","keyword.operator"],regex:"("+identifierRe+")(\\.)(prototype)(\\.)("+identifierRe+")(\\s*)(=)",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","keyword.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",next:"function_arguments"},{token:["storage.type","text","entity.name.function","text","paren.lparen"],regex:"(function)(\\s+)("+identifierRe+")(\\s*)(\\()",next:"function_arguments"},{token:["entity.name.function","text","punctuation.operator","text","storage.type","text","paren.lparen"],regex:"("+identifierRe+")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:["text","text","storage.type","text","paren.lparen"],regex:"(:)(\\s*)(function)(\\s*)(\\()",next:"function_arguments"},{token:"keyword",regex:"(?:"+kwBeforeRe+")\\b",next:"start"},{token:["support.constant"],regex:/that\b/},{token:["storage.type","punctuation.operator","support.function.firebug"],regex:/(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/},{token:keywordMapper,regex:identifierRe},{token:"punctuation.operator",regex:/[.](?![.])/,next:"property"},{token:"keyword.operator",regex:/--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,next:"start"},{token:"punctuation.operator",regex:/[?:,;.]/,next:"start"},{token:"paren.lparen",regex:/[\[({]/,next:"start"},{token:"paren.rparen",regex:/[\])}]/},{token:"comment",regex:/^#!.*$/}],property:[{token:"text",regex:"\\s+"},{token:["storage.type","punctuation.operator","entity.name.function","text","keyword.operator","text","storage.type","text","entity.name.function","text","paren.lparen"],regex:"("+identifierRe+")(\\.)("+identifierRe+")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",next:"function_arguments"},{token:"punctuation.operator",regex:/[.](?![.])/},{token:"support.function",regex:/(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/},{token:"support.function.dom",regex:/(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/},{token:"support.constant",regex:/(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/},{token:"identifier",regex:identifierRe},{regex:"",token:"empty",next:"no_regex"}],"start":[DocCommentHighlightRules.getStartRule("doc-start"),comments("start"),{token:"string.regexp",regex:"\\/",next:"regex"},{token:"text",regex:"\\s+|^$",next:"start"},{token:"empty",regex:"",next:"no_regex"}],"regex":[{token:"regexp.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"string.regexp",regex:"/[sxngimy]*",next:"no_regex"},{token:"invalid",regex:/\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/},{token:"constant.language.escape",regex:/\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/},{token:"constant.language.delimiter",regex:/\|/},{token:"constant.language.escape",regex:/\[\^?/,next:"regex_character_class"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp"}],"regex_character_class":[{token:"regexp.charclass.keyword.operator",regex:"\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"},{token:"constant.language.escape",regex:"]",next:"regex"},{token:"constant.language.escape",regex:"-"},{token:"empty",regex:"$",next:"no_regex"},{defaultToken:"string.regexp.charachterclass"}],"function_arguments":[{token:"variable.parameter",regex:identifierRe},{token:"punctuation.operator",regex:"[, ]+"},{token:"punctuation.operator",regex:"$"},{token:"empty",regex:"",next:"no_regex"}],"qqstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qqstring"},{token:"string",regex:'"|$',next:"no_regex"},{defaultToken:"string"}],"qstring":[{token:"constant.language.escape",regex:escapedRe},{token:"string",regex:"\\\\$",next:"qstring"},{token:"string",regex:"'|$",next:"no_regex"},{defaultToken:"string"}]};if(!options||!options.noES6){this.$rules.no_regex.unshift({regex:"[{}]",onMatch:function(val,state,stack){this.next=val=="{"?this.nextState:"";if(val=="{"&&stack.length){stack.unshift("start",state);} else if(val=="}"&&stack.length){stack.shift();this.next=stack.shift();if(this.next.indexOf("string")!=-1||this.next.indexOf("jsx")!=-1) return"paren.quasi.end";} -return val=="{"?"paren.lparen":"paren.rparen";},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:escapedRe},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]});if(!options||!options.noJSX) +return val=="{"?"paren.lparen":"paren.rparen";},nextState:"start"},{token:"string.quasi.start",regex:/`/,push:[{token:"constant.language.escape",regex:escapedRe},{token:"paren.quasi.start",regex:/\${/,push:"start"},{token:"string.quasi.end",regex:/`/,next:"pop"},{defaultToken:"string.quasi"}]});if(!options||options.jsx!=false) JSX.call(this);} this.embedRules(DocCommentHighlightRules,"doc-",[DocCommentHighlightRules.getEndRule("no_regex")]);this.normalizeRules();};oop.inherits(JavaScriptHighlightRules,TextHighlightRules);function JSX(){var tagRegex=identifierRe.replace("\\d","\\d\\-");var jsxTag={onMatch:function(val,state,stack){var offset=val.charAt(1)=="/"?2:1;if(offset==1){if(state!=this.nextState) stack.unshift(this.next,this.nextState,0);else @@ -4548,23 +4510,7 @@ stack[1]--;if(!stack[1]||stack[1]<0){stack.splice(0,2);}} this.next=stack[0]||"start";return[{type:this.token,value:value}];},nextState:"jsx"},jsxJsRule,comments("jsxAttributes"),{token:"entity.other.attribute-name.xml",regex:tagRegex},{token:"keyword.operator.attribute-equals.xml",regex:"="},{token:"text.tag-whitespace.xml",regex:"\\s+"},{token:"string.attribute-value.xml",regex:"'",stateName:"jsx_attr_q",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',stateName:"jsx_attr_qq",push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"reference"},{defaultToken:"string.attribute-value.xml"}]},jsxTag];this.$rules.reference=[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}];} function comments(next){return[{token:"comment",regex:/\/\*/,next:[DocCommentHighlightRules.getTagRule(),{token:"comment",regex:"\\*\\/",next:next||"pop"},{defaultToken:"comment",caseInsensitive:true}]},{token:"comment",regex:"\\/\\/",next:[DocCommentHighlightRules.getTagRule(),{token:"comment",regex:"$|^",next:next||"pop"},{defaultToken:"comment",caseInsensitive:true}]}];} exports.JavaScriptHighlightRules=JavaScriptHighlightRules;});ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"],function(require,exports,module){"use strict";var Range=require("../range").Range;var MatchingBraceOutdent=function(){};(function(){this.checkOutdent=function(line,input){if(!/^\s+$/.test(line)) -return false;return/^\s*\}/.test(input);};this.autoOutdent=function(doc,row){var line=doc.getLine(row);var match=line.match(/^(\s*\})/);if(!match)return 0;var column=match[1].length;var openBracePos=doc.findMatchingBracket({row:row,column:column});if(!openBracePos||openBracePos.row==row)return 0;var indent=this.$getIndent(doc.getLine(openBracePos.row));doc.replace(new Range(row,0,row,column-1),indent);};this.$getIndent=function(line){return line.match(/^\s*/)[0];};}).call(MatchingBraceOutdent.prototype);exports.MatchingBraceOutdent=MatchingBraceOutdent;});ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Behaviour=require("../behaviour").Behaviour;var TokenIterator=require("../../token_iterator").TokenIterator;var lang=require("../../lib/lang");var SAFE_INSERT_IN_TOKENS=["text","paren.rparen","punctuation.operator"];var SAFE_INSERT_BEFORE_TOKENS=["text","paren.rparen","punctuation.operator","comment"];var context;var contextCache={};var initContext=function(editor){var id=-1;if(editor.multiSelect){id=editor.selection.index;if(contextCache.rangeCount!=editor.multiSelect.rangeCount) -contextCache={rangeCount:editor.multiSelect.rangeCount};} -if(contextCache[id]) -return context=contextCache[id];context=contextCache[id]={autoInsertedBrackets:0,autoInsertedRow:-1,autoInsertedLineEnd:"",maybeInsertedBrackets:0,maybeInsertedRow:-1,maybeInsertedLineStart:"",maybeInsertedLineEnd:""};};var getWrapped=function(selection,selected,opening,closing){var rowDiff=selection.end.row-selection.start.row;return{text:opening+selected+closing,selection:[0,selection.start.column+1,rowDiff,selection.end.column+(rowDiff?0:1)]};};var CstyleBehaviour=function(){this.add("braces","insertion",function(state,action,editor,session,text){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(text=='{'){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="{"&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'{','}');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){if(/[\]\}\)]/.test(line[cursor.column])||editor.inMultiSelectMode){CstyleBehaviour.recordAutoInsert(editor,session,"}");return{text:'{}',selection:[1,1]};}else{CstyleBehaviour.recordMaybeInsert(editor,session,"{");return{text:'{',selection:[1,1]};}}}else if(text=='}'){initContext(editor);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar=='}'){var matching=session.$findOpeningBracket('}',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}else if(text=="\n"||text=="\r\n"){initContext(editor);var closing="";if(CstyleBehaviour.isMaybeInsertedClosing(cursor,line)){closing=lang.stringRepeat("}",context.maybeInsertedBrackets);CstyleBehaviour.clearMaybeInsertedClosing();} -var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==='}'){var openBracePos=session.findMatchingBracket({row:cursor.row,column:cursor.column+1},'}');if(!openBracePos) -return null;var next_indent=this.$getIndent(session.getLine(openBracePos.row));}else if(closing){var next_indent=this.$getIndent(line);}else{CstyleBehaviour.clearMaybeInsertedClosing();return;} -var indent=next_indent+session.getTabString();return{text:'\n'+indent+'\n'+next_indent+closing,selection:[1,indent.length,1,indent.length]};}else{CstyleBehaviour.clearMaybeInsertedClosing();}});this.add("braces","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='{'){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.end.column,range.end.column+1);if(rightChar=='}'){range.end.column++;return range;}else{context.maybeInsertedBrackets--;}}});this.add("parens","insertion",function(state,action,editor,session,text){if(text=='('){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'(',')');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,")");return{text:'()',selection:[1,1]};}}else if(text==')'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==')'){var matching=session.$findOpeningBracket(')',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("parens","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='('){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==')'){range.end.column++;return range;}}});this.add("brackets","insertion",function(state,action,editor,session,text){if(text=='['){initContext(editor);var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,'[',']');}else if(CstyleBehaviour.isSaneInsertion(editor,session)){CstyleBehaviour.recordAutoInsert(editor,session,"]");return{text:'[]',selection:[1,1]};}}else if(text==']'){initContext(editor);var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var rightChar=line.substring(cursor.column,cursor.column+1);if(rightChar==']'){var matching=session.$findOpeningBracket(']',{column:cursor.column+1,row:cursor.row});if(matching!==null&&CstyleBehaviour.isAutoInsertedClosing(cursor,line,text)){CstyleBehaviour.popAutoInsertedClosing();return{text:'',selection:[1,1]};}}}});this.add("brackets","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&selected=='['){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==']'){range.end.column++;return range;}}});this.add("string_dquotes","insertion",function(state,action,editor,session,text){if(text=='"'||text=="'"){initContext(editor);var quote=text;var selection=editor.getSelectionRange();var selected=session.doc.getTextRange(selection);if(selected!==""&&selected!=="'"&&selected!='"'&&editor.getWrapBehavioursEnabled()){return getWrapped(selection,selected,quote,quote);}else if(!selected){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);var leftChar=line.substring(cursor.column-1,cursor.column);var rightChar=line.substring(cursor.column,cursor.column+1);var token=session.getTokenAt(cursor.row,cursor.column);var rightToken=session.getTokenAt(cursor.row,cursor.column+1);if(leftChar=="\\"&&token&&/escape/.test(token.type)) -return null;var stringBefore=token&&/string|escape/.test(token.type);var stringAfter=!rightToken||/string|escape/.test(rightToken.type);var pair;if(rightChar==quote){pair=stringBefore!==stringAfter;}else{if(stringBefore&&!stringAfter) -return null;if(stringBefore&&stringAfter) -return null;var wordRe=session.$mode.tokenRe;wordRe.lastIndex=0;var isWordBefore=wordRe.test(leftChar);wordRe.lastIndex=0;var isWordAfter=wordRe.test(leftChar);if(isWordBefore||isWordAfter) -return null;if(rightChar&&!/[\s;,.})\]\\]/.test(rightChar)) -return null;pair=true;} -return{text:pair?quote+quote:"",selection:[1,1]};}}});this.add("string_dquotes","deletion",function(state,action,editor,session,range){var selected=session.doc.getTextRange(range);if(!range.isMultiLine()&&(selected=='"'||selected=="'")){initContext(editor);var line=session.doc.getLine(range.start.row);var rightChar=line.substring(range.start.column+1,range.start.column+2);if(rightChar==selected){range.end.column++;return range;}}});};CstyleBehaviour.isSaneInsertion=function(editor,session){var cursor=editor.getCursorPosition();var iterator=new TokenIterator(session,cursor.row,cursor.column);if(!this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)){var iterator2=new TokenIterator(session,cursor.row,cursor.column+1);if(!this.$matchTokenType(iterator2.getCurrentToken()||"text",SAFE_INSERT_IN_TOKENS)) -return false;} -iterator.stepForward();return iterator.getCurrentTokenRow()!==cursor.row||this.$matchTokenType(iterator.getCurrentToken()||"text",SAFE_INSERT_BEFORE_TOKENS);};CstyleBehaviour.$matchTokenType=function(token,types){return types.indexOf(token.type||token)>-1;};CstyleBehaviour.recordAutoInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isAutoInsertedClosing(cursor,line,context.autoInsertedLineEnd[0])) -context.autoInsertedBrackets=0;context.autoInsertedRow=cursor.row;context.autoInsertedLineEnd=bracket+line.substr(cursor.column);context.autoInsertedBrackets++;};CstyleBehaviour.recordMaybeInsert=function(editor,session,bracket){var cursor=editor.getCursorPosition();var line=session.doc.getLine(cursor.row);if(!this.isMaybeInsertedClosing(cursor,line)) -context.maybeInsertedBrackets=0;context.maybeInsertedRow=cursor.row;context.maybeInsertedLineStart=line.substr(0,cursor.column)+bracket;context.maybeInsertedLineEnd=line.substr(cursor.column);context.maybeInsertedBrackets++;};CstyleBehaviour.isAutoInsertedClosing=function(cursor,line,bracket){return context.autoInsertedBrackets>0&&cursor.row===context.autoInsertedRow&&bracket===context.autoInsertedLineEnd[0]&&line.substr(cursor.column)===context.autoInsertedLineEnd;};CstyleBehaviour.isMaybeInsertedClosing=function(cursor,line){return context.maybeInsertedBrackets>0&&cursor.row===context.maybeInsertedRow&&line.substr(cursor.column)===context.maybeInsertedLineEnd&&line.substr(0,cursor.column)==context.maybeInsertedLineStart;};CstyleBehaviour.popAutoInsertedClosing=function(){context.autoInsertedLineEnd=context.autoInsertedLineEnd.substr(1);context.autoInsertedBrackets--;};CstyleBehaviour.clearMaybeInsertedClosing=function(){if(context){context.maybeInsertedBrackets=0;context.maybeInsertedRow=-1;}};oop.inherits(CstyleBehaviour,Behaviour);exports.CstyleBehaviour=CstyleBehaviour;});ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Range=require("../../range").Range;var BaseFoldMode=require("./fold_mode").FoldMode;var FoldMode=exports.FoldMode=function(commentRegex){if(commentRegex){this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.start));this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.end));}};oop.inherits(FoldMode,BaseFoldMode);(function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/;this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/;this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/;this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/;this._getFoldWidgetBase=this.getFoldWidget;this.getFoldWidget=function(session,foldStyle,row){var line=session.getLine(row);if(this.singleLineBlockCommentRe.test(line)){if(!this.startRegionRe.test(line)&&!this.tripleStarBlockCommentRe.test(line)) +return false;return/^\s*\}/.test(input);};this.autoOutdent=function(doc,row){var line=doc.getLine(row);var match=line.match(/^(\s*\})/);if(!match)return 0;var column=match[1].length;var openBracePos=doc.findMatchingBracket({row:row,column:column});if(!openBracePos||openBracePos.row==row)return 0;var indent=this.$getIndent(doc.getLine(openBracePos.row));doc.replace(new Range(row,0,row,column-1),indent);};this.$getIndent=function(line){return line.match(/^\s*/)[0];};}).call(MatchingBraceOutdent.prototype);exports.MatchingBraceOutdent=MatchingBraceOutdent;});ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"],function(require,exports,module){"use strict";var oop=require("../../lib/oop");var Range=require("../../range").Range;var BaseFoldMode=require("./fold_mode").FoldMode;var FoldMode=exports.FoldMode=function(commentRegex){if(commentRegex){this.foldingStartMarker=new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.start));this.foldingStopMarker=new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/,"|"+commentRegex.end));}};oop.inherits(FoldMode,BaseFoldMode);(function(){this.foldingStartMarker=/(\{|\[)[^\}\]]*$|^\s*(\/\*)/;this.foldingStopMarker=/^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;this.singleLineBlockCommentRe=/^\s*(\/\*).*\*\/\s*$/;this.tripleStarBlockCommentRe=/^\s*(\/\*\*\*).*\*\/\s*$/;this.startRegionRe=/^\s*(\/\*|\/\/)#?region\b/;this._getFoldWidgetBase=this.getFoldWidget;this.getFoldWidget=function(session,foldStyle,row){var line=session.getLine(row);if(this.singleLineBlockCommentRe.test(line)){if(!this.startRegionRe.test(line)&&!this.tripleStarBlockCommentRe.test(line)) return"";} var fw=this._getFoldWidgetBase(session,foldStyle,row);if(!fw&&this.startRegionRe.test(line)) return"start";return fw;};this.getFoldWidgetRange=function(session,foldStyle,row,forceMultiline){var line=session.getLine(row);if(this.startRegionRe.test(line)) @@ -4579,8 +4525,8 @@ continue;if(startIndent>indent) break;var subRange=this.getFoldWidgetRange(session,"all",row);if(subRange){if(subRange.start.row<=startRow){break;}else if(subRange.isMultiLine()){row=subRange.end.row;}else if(startIndent==indent){break;}} endRow=row;} return new Range(startRow,startColumn,endRow,session.getLine(endRow).length);};this.getCommentRegionBlock=function(session,line,row){var startColumn=line.search(/\s*$/);var maxRow=session.getLength();var startRow=row;var re=/^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;var depth=1;while(++rowstartRow){return new Range(startRow,startColumn,endRow,line.length);}};}).call(FoldMode.prototype);});ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var MatchingBraceOutdent=require("./matching_brace_outdent").MatchingBraceOutdent;var Range=require("../range").Range;var WorkerClient=require("../worker/worker_client").WorkerClient;var CstyleBehaviour=require("./behaviour/cstyle").CstyleBehaviour;var CStyleFoldMode=require("./folding/cstyle").FoldMode;var Mode=function(){this.HighlightRules=JavaScriptHighlightRules;this.$outdent=new MatchingBraceOutdent();this.$behaviour=new CstyleBehaviour();this.foldingRules=new CStyleFoldMode();};oop.inherits(Mode,TextMode);(function(){this.lineCommentStart="//";this.blockComment={start:"/*",end:"*/"};this.getNextLineIndent=function(state,line,tab){var indent=this.$getIndent(line);var tokenizedLine=this.getTokenizer().getLineTokens(line,state);var tokens=tokenizedLine.tokens;var endState=tokenizedLine.state;if(tokens.length&&tokens[tokens.length-1].type=="comment"){return indent;} -if(state=="start"||state=="no_regex"){var match=line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/);if(match){indent+=tab;}}else if(state=="doc-start"){if(endState=="start"||endState=="no_regex"){return"";} +var endRow=row;if(endRow>startRow){return new Range(startRow,startColumn,endRow,line.length);}};}).call(FoldMode.prototype);});ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"],function(require,exports,module){"use strict";var oop=require("../lib/oop");var TextMode=require("./text").Mode;var JavaScriptHighlightRules=require("./javascript_highlight_rules").JavaScriptHighlightRules;var MatchingBraceOutdent=require("./matching_brace_outdent").MatchingBraceOutdent;var WorkerClient=require("../worker/worker_client").WorkerClient;var CstyleBehaviour=require("./behaviour/cstyle").CstyleBehaviour;var CStyleFoldMode=require("./folding/cstyle").FoldMode;var Mode=function(){this.HighlightRules=JavaScriptHighlightRules;this.$outdent=new MatchingBraceOutdent();this.$behaviour=new CstyleBehaviour();this.foldingRules=new CStyleFoldMode();};oop.inherits(Mode,TextMode);(function(){this.lineCommentStart="//";this.blockComment={start:"/*",end:"*/"};this.getNextLineIndent=function(state,line,tab){var indent=this.$getIndent(line);var tokenizedLine=this.getTokenizer().getLineTokens(line,state);var tokens=tokenizedLine.tokens;var endState=tokenizedLine.state;if(tokens.length&&tokens[tokens.length-1].type=="comment"){return indent;} +if(state=="start"||state=="no_regex"){var match=line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);if(match){indent+=tab;}}else if(state=="doc-start"){if(endState=="start"||endState=="no_regex"){return"";} var match=line.match(/^\s*(\/?)\*/);if(match){if(match[1]){indent+=" ";} indent+="* ";}} return indent;};this.checkOutdent=function(state,line,input){return this.$outdent.checkOutdent(line,input);};this.autoOutdent=function(state,doc,row){this.$outdent.autoOutdent(doc,row);};this.createWorker=function(session){var worker=new WorkerClient(["ace"],"ace/mode/javascript_worker","JavaScriptWorker");worker.attachToDocument(session.getDocument());worker.on("annotate",function(results){session.setAnnotations(results.data);});worker.on("terminate",function(){session.clearAnnotations();});return worker;};this.$id="ace/mode/javascript";}).call(Mode.prototype);exports.Mode=Mode;});+function($){"use strict";var Base=$.oc.foundation.base,BaseProto=Base.prototype diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ace.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ace.js index 1b8a059..bddd92f 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ace.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ace.js @@ -960,7 +960,7 @@ exports.getDocumentHead = function(doc) { if (!doc) doc = document; return doc.head || doc.getElementsByTagName("head")[0] || doc.documentElement; -}; +} exports.createElement = function(tag, ns) { return document.createElementNS ? @@ -969,7 +969,7 @@ exports.createElement = function(tag, ns) { }; exports.hasCssClass = function(el, name) { - var classes = (el.className || "").split(/\s+/g); + var classes = (el.className + "").split(/\s+/g); return classes.indexOf(name) !== -1; }; exports.addCssClass = function(el, name) { @@ -1360,7 +1360,7 @@ exports.isIE = exports.isOldIE = exports.isIE && exports.isIE < 9; exports.isGecko = exports.isMozilla = (window.Controllers || window.controllers) && window.navigator.product === "Gecko"; -exports.isOldGecko = exports.isGecko && parseInt((ua.match(/rv\:(\d+)/)||[])[1], 10) < 4; +exports.isOldGecko = exports.isGecko && parseInt((ua.match(/rv:(\d+)/)||[])[1], 10) < 4; exports.isOpera = window.opera && Object.prototype.toString.call(window.opera) == "[object Opera]"; exports.isWebKit = parseFloat(ua.split("WebKit/")[1]) || undefined; @@ -1597,7 +1597,7 @@ function normalizeCommandKeys(callback, e, keyCode) { var hashId = getModifierHash(e); if (!useragent.isMac && pressedKeys) { - if (pressedKeys.OSKey) + if (e.getModifierState && (e.getModifierState("OS") || e.getModifierState("Win"))) hashId |= 8; if (pressedKeys.altGr) { if ((3 & hashId) != 3) @@ -1663,18 +1663,8 @@ exports.addCommandKeyListener = function(el, callback) { var lastDefaultPrevented = null; addListener(el, "keydown", function(e) { - var keyCode = e.keyCode; - pressedKeys[keyCode] = (pressedKeys[keyCode] || 0) + 1; - if (keyCode == 91 || keyCode == 92) { - pressedKeys.OSKey = true; - } else if (pressedKeys.OSKey) { - if (e.timeStamp - pressedKeys.lastT > 200 && pressedKeys.count == 1) - resetPressedKeys(); - } - if (pressedKeys[keyCode] == 1) - pressedKeys.count++; - pressedKeys.lastT = e.timeStamp; - var result = normalizeCommandKeys(callback, e, keyCode); + pressedKeys[e.keyCode] = (pressedKeys[e.keyCode] || 0) + 1; + var result = normalizeCommandKeys(callback, e, e.keyCode); lastDefaultPrevented = e.defaultPrevented; return result; }); @@ -1687,16 +1677,7 @@ exports.addCommandKeyListener = function(el, callback) { }); addListener(el, "keyup", function(e) { - var keyCode = e.keyCode; - if (!pressedKeys[keyCode]) { - resetPressedKeys(); - } else { - pressedKeys.count = Math.max(pressedKeys.count - 1, 0); - } - if (keyCode == 91 || keyCode == 92) { - pressedKeys.OSKey = false; - } - pressedKeys[keyCode] = null; + pressedKeys[e.keyCode] = null; }); if (!pressedKeys) { @@ -1707,8 +1688,6 @@ exports.addCommandKeyListener = function(el, callback) { }; function resetPressedKeys() { pressedKeys = Object.create(null); - pressedKeys.count = 0; - pressedKeys.lastT = 0; } if (typeof window == "object" && window.postMessage && !useragent.isOldIE) { @@ -1788,7 +1767,7 @@ exports.copyArray = function(array){ var copy = []; for (var i=0, l=array.length; i= 53) { + onInput(); + } }; @@ -2775,6 +2762,7 @@ function GutterHandler(mouseHandler) { tooltip.setHtml(tooltipAnnotation); tooltip.show(); + editor._signal("showGutterTooltip", tooltip); editor.on("mousewheel", hideTooltip); if (mouseHandler.$tooltipFollowsMouse) { @@ -2794,6 +2782,7 @@ function GutterHandler(mouseHandler) { if (tooltipAnnotation) { tooltip.hide(); tooltipAnnotation = null; + editor._signal("hideGutterTooltip", tooltip); editor.removeEventListener("mousewheel", hideTooltip); } } @@ -4113,7 +4102,7 @@ var KeyBinding = function(editor) { success = commands.exec("insertstring", this.$editor, keyString); } - if (success) + if (success && this.$editor._signal) this.$editor._signal("keyboardActivity", toExecute); return success; @@ -5556,58 +5545,6 @@ var Behaviour = function() { exports.Behaviour = Behaviour; }); -ace.define("ace/unicode",["require","exports","module"], function(require, exports, module) { -"use strict"; -exports.packages = {}; - -addUnicodePackage({ - L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", - Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A", - Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A", - Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC", - Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F", - Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", - M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26", - Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26", - Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC", - Me: "0488048906DE20DD-20E020E2-20E4A670-A672", - N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", - Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", - Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF", - No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835", - P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65", - Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D", - Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62", - Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63", - Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20", - Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21", - Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F", - Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65", - S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD", - Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC", - Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6", - Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3", - So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD", - Z: "002000A01680180E2000-200A20282029202F205F3000", - Zs: "002000A01680180E2000-200A202F205F3000", - Zl: "2028", - Zp: "2029", - C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF", - Cc: "0000-001F007F-009F", - Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB", - Co: "E000-F8FF", - Cs: "D800-DFFF", - Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF" -}); - -function addUnicodePackage (pack) { - var codePoint = /\w{4}/g; - for (var name in pack) - exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); -} - -}); - ace.define("ace/token_iterator",["require","exports","module"], function(require, exports, module) { "use strict"; var TokenIterator = function(session, initialRow, initialColumn) { @@ -5684,12 +5621,425 @@ var TokenIterator = function(session, initialRow, initialColumn) { exports.TokenIterator = TokenIterator; }); -ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"], function(require, exports, module) { +ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { +"use strict"; + +var oop = require("../../lib/oop"); +var Behaviour = require("../behaviour").Behaviour; +var TokenIterator = require("../../token_iterator").TokenIterator; +var lang = require("../../lib/lang"); + +var SAFE_INSERT_IN_TOKENS = + ["text", "paren.rparen", "punctuation.operator"]; +var SAFE_INSERT_BEFORE_TOKENS = + ["text", "paren.rparen", "punctuation.operator", "comment"]; + +var context; +var contextCache = {}; +var initContext = function(editor) { + var id = -1; + if (editor.multiSelect) { + id = editor.selection.index; + if (contextCache.rangeCount != editor.multiSelect.rangeCount) + contextCache = {rangeCount: editor.multiSelect.rangeCount}; + } + if (contextCache[id]) + return context = contextCache[id]; + context = contextCache[id] = { + autoInsertedBrackets: 0, + autoInsertedRow: -1, + autoInsertedLineEnd: "", + maybeInsertedBrackets: 0, + maybeInsertedRow: -1, + maybeInsertedLineStart: "", + maybeInsertedLineEnd: "" + }; +}; + +var getWrapped = function(selection, selected, opening, closing) { + var rowDiff = selection.end.row - selection.start.row; + return { + text: opening + selected + closing, + selection: [ + 0, + selection.start.column + 1, + rowDiff, + selection.end.column + (rowDiff ? 0 : 1) + ] + }; +}; + +var CstyleBehaviour = function() { + this.add("braces", "insertion", function(state, action, editor, session, text) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (text == '{') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '{', '}'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { + CstyleBehaviour.recordAutoInsert(editor, session, "}"); + return { + text: '{}', + selection: [1, 1] + }; + } else { + CstyleBehaviour.recordMaybeInsert(editor, session, "{"); + return { + text: '{', + selection: [1, 1] + }; + } + } + } else if (text == '}') { + initContext(editor); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == '}') { + var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } else if (text == "\n" || text == "\r\n") { + initContext(editor); + var closing = ""; + if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { + closing = lang.stringRepeat("}", context.maybeInsertedBrackets); + CstyleBehaviour.clearMaybeInsertedClosing(); + } + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar === '}') { + var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); + if (!openBracePos) + return null; + var next_indent = this.$getIndent(session.getLine(openBracePos.row)); + } else if (closing) { + var next_indent = this.$getIndent(line); + } else { + CstyleBehaviour.clearMaybeInsertedClosing(); + return; + } + var indent = next_indent + session.getTabString(); + + return { + text: '\n' + indent + '\n' + next_indent + closing, + selection: [1, indent.length, 1, indent.length] + }; + } else { + CstyleBehaviour.clearMaybeInsertedClosing(); + } + }); + + this.add("braces", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '{') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.end.column, range.end.column + 1); + if (rightChar == '}') { + range.end.column++; + return range; + } else { + context.maybeInsertedBrackets--; + } + } + }); + + this.add("parens", "insertion", function(state, action, editor, session, text) { + if (text == '(') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '(', ')'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + CstyleBehaviour.recordAutoInsert(editor, session, ")"); + return { + text: '()', + selection: [1, 1] + }; + } + } else if (text == ')') { + initContext(editor); + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ')') { + var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } + }); + + this.add("parens", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '(') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ')') { + range.end.column++; + return range; + } + } + }); + + this.add("brackets", "insertion", function(state, action, editor, session, text) { + if (text == '[') { + initContext(editor); + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, '[', ']'); + } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { + CstyleBehaviour.recordAutoInsert(editor, session, "]"); + return { + text: '[]', + selection: [1, 1] + }; + } + } else if (text == ']') { + initContext(editor); + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var rightChar = line.substring(cursor.column, cursor.column + 1); + if (rightChar == ']') { + var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); + if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { + CstyleBehaviour.popAutoInsertedClosing(); + return { + text: '', + selection: [1, 1] + }; + } + } + } + }); + + this.add("brackets", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && selected == '[') { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == ']') { + range.end.column++; + return range; + } + } + }); + + this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { + if (text == '"' || text == "'") { + if (this.lineCommentStart && this.lineCommentStart.indexOf(text) != -1) + return; + initContext(editor); + var quote = text; + var selection = editor.getSelectionRange(); + var selected = session.doc.getTextRange(selection); + if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { + return getWrapped(selection, selected, quote, quote); + } else if (!selected) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + var leftChar = line.substring(cursor.column-1, cursor.column); + var rightChar = line.substring(cursor.column, cursor.column + 1); + + var token = session.getTokenAt(cursor.row, cursor.column); + var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); + if (leftChar == "\\" && token && /escape/.test(token.type)) + return null; + + var stringBefore = token && /string|escape/.test(token.type); + var stringAfter = !rightToken || /string|escape/.test(rightToken.type); + + var pair; + if (rightChar == quote) { + pair = stringBefore !== stringAfter; + if (pair && /string\.end/.test(rightToken.type)) + pair = false; + } else { + if (stringBefore && !stringAfter) + return null; // wrap string with different quote + if (stringBefore && stringAfter) + return null; // do not pair quotes inside strings + var wordRe = session.$mode.tokenRe; + wordRe.lastIndex = 0; + var isWordBefore = wordRe.test(leftChar); + wordRe.lastIndex = 0; + var isWordAfter = wordRe.test(leftChar); + if (isWordBefore || isWordAfter) + return null; // before or after alphanumeric + if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) + return null; // there is rightChar and it isn't closing + pair = true; + } + return { + text: pair ? quote + quote : "", + selection: [1,1] + }; + } + } + }); + + this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { + var selected = session.doc.getTextRange(range); + if (!range.isMultiLine() && (selected == '"' || selected == "'")) { + initContext(editor); + var line = session.doc.getLine(range.start.row); + var rightChar = line.substring(range.start.column + 1, range.start.column + 2); + if (rightChar == selected) { + range.end.column++; + return range; + } + } + }); + +}; + + +CstyleBehaviour.isSaneInsertion = function(editor, session) { + var cursor = editor.getCursorPosition(); + var iterator = new TokenIterator(session, cursor.row, cursor.column); + if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { + var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); + if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) + return false; + } + iterator.stepForward(); + return iterator.getCurrentTokenRow() !== cursor.row || + this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); +}; + +CstyleBehaviour.$matchTokenType = function(token, types) { + return types.indexOf(token.type || token) > -1; +}; + +CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) + context.autoInsertedBrackets = 0; + context.autoInsertedRow = cursor.row; + context.autoInsertedLineEnd = bracket + line.substr(cursor.column); + context.autoInsertedBrackets++; +}; + +CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { + var cursor = editor.getCursorPosition(); + var line = session.doc.getLine(cursor.row); + if (!this.isMaybeInsertedClosing(cursor, line)) + context.maybeInsertedBrackets = 0; + context.maybeInsertedRow = cursor.row; + context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; + context.maybeInsertedLineEnd = line.substr(cursor.column); + context.maybeInsertedBrackets++; +}; + +CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { + return context.autoInsertedBrackets > 0 && + cursor.row === context.autoInsertedRow && + bracket === context.autoInsertedLineEnd[0] && + line.substr(cursor.column) === context.autoInsertedLineEnd; +}; + +CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { + return context.maybeInsertedBrackets > 0 && + cursor.row === context.maybeInsertedRow && + line.substr(cursor.column) === context.maybeInsertedLineEnd && + line.substr(0, cursor.column) == context.maybeInsertedLineStart; +}; + +CstyleBehaviour.popAutoInsertedClosing = function() { + context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); + context.autoInsertedBrackets--; +}; + +CstyleBehaviour.clearMaybeInsertedClosing = function() { + if (context) { + context.maybeInsertedBrackets = 0; + context.maybeInsertedRow = -1; + } +}; + + + +oop.inherits(CstyleBehaviour, Behaviour); + +exports.CstyleBehaviour = CstyleBehaviour; +}); + +ace.define("ace/unicode",["require","exports","module"], function(require, exports, module) { +"use strict"; +exports.packages = {}; + +addUnicodePackage({ + L: "0041-005A0061-007A00AA00B500BA00C0-00D600D8-00F600F8-02C102C6-02D102E0-02E402EC02EE0370-037403760377037A-037D03860388-038A038C038E-03A103A3-03F503F7-0481048A-05250531-055605590561-058705D0-05EA05F0-05F20621-064A066E066F0671-06D306D506E506E606EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA07F407F507FA0800-0815081A082408280904-0939093D09500958-0961097109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E460E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EC60EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10A0-10C510D0-10FA10FC1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317D717DC1820-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541AA71B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C7D1CE9-1CEC1CEE-1CF11D00-1DBF1E00-1F151F18-1F1D1F20-1F451F48-1F4D1F50-1F571F591F5B1F5D1F5F-1F7D1F80-1FB41FB6-1FBC1FBE1FC2-1FC41FC6-1FCC1FD0-1FD31FD6-1FDB1FE0-1FEC1FF2-1FF41FF6-1FFC2071207F2090-209421022107210A-211321152119-211D212421262128212A-212D212F-2139213C-213F2145-2149214E218321842C00-2C2E2C30-2C5E2C60-2CE42CEB-2CEE2D00-2D252D30-2D652D6F2D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE2E2F300530063031-3035303B303C3041-3096309D-309F30A1-30FA30FC-30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A48CA4D0-A4FDA500-A60CA610-A61FA62AA62BA640-A65FA662-A66EA67F-A697A6A0-A6E5A717-A71FA722-A788A78BA78CA7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2A9CFAA00-AA28AA40-AA42AA44-AA4BAA60-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADB-AADDABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB00-FB06FB13-FB17FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF21-FF3AFF41-FF5AFF66-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", + Ll: "0061-007A00AA00B500BA00DF-00F600F8-00FF01010103010501070109010B010D010F01110113011501170119011B011D011F01210123012501270129012B012D012F01310133013501370138013A013C013E014001420144014601480149014B014D014F01510153015501570159015B015D015F01610163016501670169016B016D016F0171017301750177017A017C017E-0180018301850188018C018D019201950199-019B019E01A101A301A501A801AA01AB01AD01B001B401B601B901BA01BD-01BF01C601C901CC01CE01D001D201D401D601D801DA01DC01DD01DF01E101E301E501E701E901EB01ED01EF01F001F301F501F901FB01FD01FF02010203020502070209020B020D020F02110213021502170219021B021D021F02210223022502270229022B022D022F02310233-0239023C023F0240024202470249024B024D024F-02930295-02AF037103730377037B-037D039003AC-03CE03D003D103D5-03D703D903DB03DD03DF03E103E303E503E703E903EB03ED03EF-03F303F503F803FB03FC0430-045F04610463046504670469046B046D046F04710473047504770479047B047D047F0481048B048D048F04910493049504970499049B049D049F04A104A304A504A704A904AB04AD04AF04B104B304B504B704B904BB04BD04BF04C204C404C604C804CA04CC04CE04CF04D104D304D504D704D904DB04DD04DF04E104E304E504E704E904EB04ED04EF04F104F304F504F704F904FB04FD04FF05010503050505070509050B050D050F05110513051505170519051B051D051F0521052305250561-05871D00-1D2B1D62-1D771D79-1D9A1E011E031E051E071E091E0B1E0D1E0F1E111E131E151E171E191E1B1E1D1E1F1E211E231E251E271E291E2B1E2D1E2F1E311E331E351E371E391E3B1E3D1E3F1E411E431E451E471E491E4B1E4D1E4F1E511E531E551E571E591E5B1E5D1E5F1E611E631E651E671E691E6B1E6D1E6F1E711E731E751E771E791E7B1E7D1E7F1E811E831E851E871E891E8B1E8D1E8F1E911E931E95-1E9D1E9F1EA11EA31EA51EA71EA91EAB1EAD1EAF1EB11EB31EB51EB71EB91EBB1EBD1EBF1EC11EC31EC51EC71EC91ECB1ECD1ECF1ED11ED31ED51ED71ED91EDB1EDD1EDF1EE11EE31EE51EE71EE91EEB1EED1EEF1EF11EF31EF51EF71EF91EFB1EFD1EFF-1F071F10-1F151F20-1F271F30-1F371F40-1F451F50-1F571F60-1F671F70-1F7D1F80-1F871F90-1F971FA0-1FA71FB0-1FB41FB61FB71FBE1FC2-1FC41FC61FC71FD0-1FD31FD61FD71FE0-1FE71FF2-1FF41FF61FF7210A210E210F2113212F21342139213C213D2146-2149214E21842C30-2C5E2C612C652C662C682C6A2C6C2C712C732C742C76-2C7C2C812C832C852C872C892C8B2C8D2C8F2C912C932C952C972C992C9B2C9D2C9F2CA12CA32CA52CA72CA92CAB2CAD2CAF2CB12CB32CB52CB72CB92CBB2CBD2CBF2CC12CC32CC52CC72CC92CCB2CCD2CCF2CD12CD32CD52CD72CD92CDB2CDD2CDF2CE12CE32CE42CEC2CEE2D00-2D25A641A643A645A647A649A64BA64DA64FA651A653A655A657A659A65BA65DA65FA663A665A667A669A66BA66DA681A683A685A687A689A68BA68DA68FA691A693A695A697A723A725A727A729A72BA72DA72F-A731A733A735A737A739A73BA73DA73FA741A743A745A747A749A74BA74DA74FA751A753A755A757A759A75BA75DA75FA761A763A765A767A769A76BA76DA76FA771-A778A77AA77CA77FA781A783A785A787A78CFB00-FB06FB13-FB17FF41-FF5A", + Lu: "0041-005A00C0-00D600D8-00DE01000102010401060108010A010C010E01100112011401160118011A011C011E01200122012401260128012A012C012E01300132013401360139013B013D013F0141014301450147014A014C014E01500152015401560158015A015C015E01600162016401660168016A016C016E017001720174017601780179017B017D018101820184018601870189-018B018E-0191019301940196-0198019C019D019F01A001A201A401A601A701A901AC01AE01AF01B1-01B301B501B701B801BC01C401C701CA01CD01CF01D101D301D501D701D901DB01DE01E001E201E401E601E801EA01EC01EE01F101F401F6-01F801FA01FC01FE02000202020402060208020A020C020E02100212021402160218021A021C021E02200222022402260228022A022C022E02300232023A023B023D023E02410243-02460248024A024C024E03700372037603860388-038A038C038E038F0391-03A103A3-03AB03CF03D2-03D403D803DA03DC03DE03E003E203E403E603E803EA03EC03EE03F403F703F903FA03FD-042F04600462046404660468046A046C046E04700472047404760478047A047C047E0480048A048C048E04900492049404960498049A049C049E04A004A204A404A604A804AA04AC04AE04B004B204B404B604B804BA04BC04BE04C004C104C304C504C704C904CB04CD04D004D204D404D604D804DA04DC04DE04E004E204E404E604E804EA04EC04EE04F004F204F404F604F804FA04FC04FE05000502050405060508050A050C050E05100512051405160518051A051C051E0520052205240531-055610A0-10C51E001E021E041E061E081E0A1E0C1E0E1E101E121E141E161E181E1A1E1C1E1E1E201E221E241E261E281E2A1E2C1E2E1E301E321E341E361E381E3A1E3C1E3E1E401E421E441E461E481E4A1E4C1E4E1E501E521E541E561E581E5A1E5C1E5E1E601E621E641E661E681E6A1E6C1E6E1E701E721E741E761E781E7A1E7C1E7E1E801E821E841E861E881E8A1E8C1E8E1E901E921E941E9E1EA01EA21EA41EA61EA81EAA1EAC1EAE1EB01EB21EB41EB61EB81EBA1EBC1EBE1EC01EC21EC41EC61EC81ECA1ECC1ECE1ED01ED21ED41ED61ED81EDA1EDC1EDE1EE01EE21EE41EE61EE81EEA1EEC1EEE1EF01EF21EF41EF61EF81EFA1EFC1EFE1F08-1F0F1F18-1F1D1F28-1F2F1F38-1F3F1F48-1F4D1F591F5B1F5D1F5F1F68-1F6F1FB8-1FBB1FC8-1FCB1FD8-1FDB1FE8-1FEC1FF8-1FFB21022107210B-210D2110-211221152119-211D212421262128212A-212D2130-2133213E213F214521832C00-2C2E2C602C62-2C642C672C692C6B2C6D-2C702C722C752C7E-2C802C822C842C862C882C8A2C8C2C8E2C902C922C942C962C982C9A2C9C2C9E2CA02CA22CA42CA62CA82CAA2CAC2CAE2CB02CB22CB42CB62CB82CBA2CBC2CBE2CC02CC22CC42CC62CC82CCA2CCC2CCE2CD02CD22CD42CD62CD82CDA2CDC2CDE2CE02CE22CEB2CEDA640A642A644A646A648A64AA64CA64EA650A652A654A656A658A65AA65CA65EA662A664A666A668A66AA66CA680A682A684A686A688A68AA68CA68EA690A692A694A696A722A724A726A728A72AA72CA72EA732A734A736A738A73AA73CA73EA740A742A744A746A748A74AA74CA74EA750A752A754A756A758A75AA75CA75EA760A762A764A766A768A76AA76CA76EA779A77BA77DA77EA780A782A784A786A78BFF21-FF3A", + Lt: "01C501C801CB01F21F88-1F8F1F98-1F9F1FA8-1FAF1FBC1FCC1FFC", + Lm: "02B0-02C102C6-02D102E0-02E402EC02EE0374037A0559064006E506E607F407F507FA081A0824082809710E460EC610FC17D718431AA71C78-1C7D1D2C-1D611D781D9B-1DBF2071207F2090-20942C7D2D6F2E2F30053031-3035303B309D309E30FC-30FEA015A4F8-A4FDA60CA67FA717-A71FA770A788A9CFAA70AADDFF70FF9EFF9F", + Lo: "01BB01C0-01C3029405D0-05EA05F0-05F20621-063F0641-064A066E066F0671-06D306D506EE06EF06FA-06FC06FF07100712-072F074D-07A507B107CA-07EA0800-08150904-0939093D09500958-096109720979-097F0985-098C098F09900993-09A809AA-09B009B209B6-09B909BD09CE09DC09DD09DF-09E109F009F10A05-0A0A0A0F0A100A13-0A280A2A-0A300A320A330A350A360A380A390A59-0A5C0A5E0A72-0A740A85-0A8D0A8F-0A910A93-0AA80AAA-0AB00AB20AB30AB5-0AB90ABD0AD00AE00AE10B05-0B0C0B0F0B100B13-0B280B2A-0B300B320B330B35-0B390B3D0B5C0B5D0B5F-0B610B710B830B85-0B8A0B8E-0B900B92-0B950B990B9A0B9C0B9E0B9F0BA30BA40BA8-0BAA0BAE-0BB90BD00C05-0C0C0C0E-0C100C12-0C280C2A-0C330C35-0C390C3D0C580C590C600C610C85-0C8C0C8E-0C900C92-0CA80CAA-0CB30CB5-0CB90CBD0CDE0CE00CE10D05-0D0C0D0E-0D100D12-0D280D2A-0D390D3D0D600D610D7A-0D7F0D85-0D960D9A-0DB10DB3-0DBB0DBD0DC0-0DC60E01-0E300E320E330E40-0E450E810E820E840E870E880E8A0E8D0E94-0E970E99-0E9F0EA1-0EA30EA50EA70EAA0EAB0EAD-0EB00EB20EB30EBD0EC0-0EC40EDC0EDD0F000F40-0F470F49-0F6C0F88-0F8B1000-102A103F1050-1055105A-105D106110651066106E-10701075-1081108E10D0-10FA1100-1248124A-124D1250-12561258125A-125D1260-1288128A-128D1290-12B012B2-12B512B8-12BE12C012C2-12C512C8-12D612D8-13101312-13151318-135A1380-138F13A0-13F41401-166C166F-167F1681-169A16A0-16EA1700-170C170E-17111720-17311740-17511760-176C176E-17701780-17B317DC1820-18421844-18771880-18A818AA18B0-18F51900-191C1950-196D1970-19741980-19AB19C1-19C71A00-1A161A20-1A541B05-1B331B45-1B4B1B83-1BA01BAE1BAF1C00-1C231C4D-1C4F1C5A-1C771CE9-1CEC1CEE-1CF12135-21382D30-2D652D80-2D962DA0-2DA62DA8-2DAE2DB0-2DB62DB8-2DBE2DC0-2DC62DC8-2DCE2DD0-2DD62DD8-2DDE3006303C3041-3096309F30A1-30FA30FF3105-312D3131-318E31A0-31B731F0-31FF3400-4DB54E00-9FCBA000-A014A016-A48CA4D0-A4F7A500-A60BA610-A61FA62AA62BA66EA6A0-A6E5A7FB-A801A803-A805A807-A80AA80C-A822A840-A873A882-A8B3A8F2-A8F7A8FBA90A-A925A930-A946A960-A97CA984-A9B2AA00-AA28AA40-AA42AA44-AA4BAA60-AA6FAA71-AA76AA7AAA80-AAAFAAB1AAB5AAB6AAB9-AABDAAC0AAC2AADBAADCABC0-ABE2AC00-D7A3D7B0-D7C6D7CB-D7FBF900-FA2DFA30-FA6DFA70-FAD9FB1DFB1F-FB28FB2A-FB36FB38-FB3CFB3EFB40FB41FB43FB44FB46-FBB1FBD3-FD3DFD50-FD8FFD92-FDC7FDF0-FDFBFE70-FE74FE76-FEFCFF66-FF6FFF71-FF9DFFA0-FFBEFFC2-FFC7FFCA-FFCFFFD2-FFD7FFDA-FFDC", + M: "0300-036F0483-04890591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DE-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0903093C093E-094E0951-0955096209630981-098309BC09BE-09C409C709C809CB-09CD09D709E209E30A01-0A030A3C0A3E-0A420A470A480A4B-0A4D0A510A700A710A750A81-0A830ABC0ABE-0AC50AC7-0AC90ACB-0ACD0AE20AE30B01-0B030B3C0B3E-0B440B470B480B4B-0B4D0B560B570B620B630B820BBE-0BC20BC6-0BC80BCA-0BCD0BD70C01-0C030C3E-0C440C46-0C480C4A-0C4D0C550C560C620C630C820C830CBC0CBE-0CC40CC6-0CC80CCA-0CCD0CD50CD60CE20CE30D020D030D3E-0D440D46-0D480D4A-0D4D0D570D620D630D820D830DCA0DCF-0DD40DD60DD8-0DDF0DF20DF30E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F3E0F3F0F71-0F840F860F870F90-0F970F99-0FBC0FC6102B-103E1056-1059105E-10601062-10641067-106D1071-10741082-108D108F109A-109D135F1712-17141732-1734175217531772177317B6-17D317DD180B-180D18A91920-192B1930-193B19B0-19C019C819C91A17-1A1B1A55-1A5E1A60-1A7C1A7F1B00-1B041B34-1B441B6B-1B731B80-1B821BA1-1BAA1C24-1C371CD0-1CD21CD4-1CE81CED1CF21DC0-1DE61DFD-1DFF20D0-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66F-A672A67CA67DA6F0A6F1A802A806A80BA823-A827A880A881A8B4-A8C4A8E0-A8F1A926-A92DA947-A953A980-A983A9B3-A9C0AA29-AA36AA43AA4CAA4DAA7BAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE3-ABEAABECABEDFB1EFE00-FE0FFE20-FE26", + Mn: "0300-036F0483-04870591-05BD05BF05C105C205C405C505C70610-061A064B-065E067006D6-06DC06DF-06E406E706E806EA-06ED07110730-074A07A6-07B007EB-07F30816-0819081B-08230825-08270829-082D0900-0902093C0941-0948094D0951-095509620963098109BC09C1-09C409CD09E209E30A010A020A3C0A410A420A470A480A4B-0A4D0A510A700A710A750A810A820ABC0AC1-0AC50AC70AC80ACD0AE20AE30B010B3C0B3F0B41-0B440B4D0B560B620B630B820BC00BCD0C3E-0C400C46-0C480C4A-0C4D0C550C560C620C630CBC0CBF0CC60CCC0CCD0CE20CE30D41-0D440D4D0D620D630DCA0DD2-0DD40DD60E310E34-0E3A0E47-0E4E0EB10EB4-0EB90EBB0EBC0EC8-0ECD0F180F190F350F370F390F71-0F7E0F80-0F840F860F870F90-0F970F99-0FBC0FC6102D-10301032-10371039103A103D103E10581059105E-10601071-1074108210851086108D109D135F1712-17141732-1734175217531772177317B7-17BD17C617C9-17D317DD180B-180D18A91920-19221927192819321939-193B1A171A181A561A58-1A5E1A601A621A65-1A6C1A73-1A7C1A7F1B00-1B031B341B36-1B3A1B3C1B421B6B-1B731B801B811BA2-1BA51BA81BA91C2C-1C331C361C371CD0-1CD21CD4-1CE01CE2-1CE81CED1DC0-1DE61DFD-1DFF20D0-20DC20E120E5-20F02CEF-2CF12DE0-2DFF302A-302F3099309AA66FA67CA67DA6F0A6F1A802A806A80BA825A826A8C4A8E0-A8F1A926-A92DA947-A951A980-A982A9B3A9B6-A9B9A9BCAA29-AA2EAA31AA32AA35AA36AA43AA4CAAB0AAB2-AAB4AAB7AAB8AABEAABFAAC1ABE5ABE8ABEDFB1EFE00-FE0FFE20-FE26", + Mc: "0903093E-09400949-094C094E0982098309BE-09C009C709C809CB09CC09D70A030A3E-0A400A830ABE-0AC00AC90ACB0ACC0B020B030B3E0B400B470B480B4B0B4C0B570BBE0BBF0BC10BC20BC6-0BC80BCA-0BCC0BD70C01-0C030C41-0C440C820C830CBE0CC0-0CC40CC70CC80CCA0CCB0CD50CD60D020D030D3E-0D400D46-0D480D4A-0D4C0D570D820D830DCF-0DD10DD8-0DDF0DF20DF30F3E0F3F0F7F102B102C10311038103B103C105610571062-10641067-106D108310841087-108C108F109A-109C17B617BE-17C517C717C81923-19261929-192B193019311933-193819B0-19C019C819C91A19-1A1B1A551A571A611A631A641A6D-1A721B041B351B3B1B3D-1B411B431B441B821BA11BA61BA71BAA1C24-1C2B1C341C351CE11CF2A823A824A827A880A881A8B4-A8C3A952A953A983A9B4A9B5A9BAA9BBA9BD-A9C0AA2FAA30AA33AA34AA4DAA7BABE3ABE4ABE6ABE7ABE9ABEAABEC", + Me: "0488048906DE20DD-20E020E2-20E4A670-A672", + N: "0030-003900B200B300B900BC-00BE0660-066906F0-06F907C0-07C90966-096F09E6-09EF09F4-09F90A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BF20C66-0C6F0C78-0C7E0CE6-0CEF0D66-0D750E50-0E590ED0-0ED90F20-0F331040-10491090-10991369-137C16EE-16F017E0-17E917F0-17F91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C5920702074-20792080-20892150-21822185-21892460-249B24EA-24FF2776-27932CFD30073021-30293038-303A3192-31953220-32293251-325F3280-328932B1-32BFA620-A629A6E6-A6EFA830-A835A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", + Nd: "0030-00390660-066906F0-06F907C0-07C90966-096F09E6-09EF0A66-0A6F0AE6-0AEF0B66-0B6F0BE6-0BEF0C66-0C6F0CE6-0CEF0D66-0D6F0E50-0E590ED0-0ED90F20-0F291040-10491090-109917E0-17E91810-18191946-194F19D0-19DA1A80-1A891A90-1A991B50-1B591BB0-1BB91C40-1C491C50-1C59A620-A629A8D0-A8D9A900-A909A9D0-A9D9AA50-AA59ABF0-ABF9FF10-FF19", + Nl: "16EE-16F02160-21822185-218830073021-30293038-303AA6E6-A6EF", + No: "00B200B300B900BC-00BE09F4-09F90BF0-0BF20C78-0C7E0D70-0D750F2A-0F331369-137C17F0-17F920702074-20792080-20892150-215F21892460-249B24EA-24FF2776-27932CFD3192-31953220-32293251-325F3280-328932B1-32BFA830-A835", + P: "0021-00230025-002A002C-002F003A003B003F0040005B-005D005F007B007D00A100AB00B700BB00BF037E0387055A-055F0589058A05BE05C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F3A-0F3D0F850FD0-0FD4104A-104F10FB1361-13681400166D166E169B169C16EB-16ED1735173617D4-17D617D8-17DA1800-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD32010-20272030-20432045-20512053-205E207D207E208D208E2329232A2768-277527C527C627E6-27EF2983-299829D8-29DB29FC29FD2CF9-2CFC2CFE2CFF2E00-2E2E2E302E313001-30033008-30113014-301F3030303D30A030FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFD3EFD3FFE10-FE19FE30-FE52FE54-FE61FE63FE68FE6AFE6BFF01-FF03FF05-FF0AFF0C-FF0FFF1AFF1BFF1FFF20FF3B-FF3DFF3FFF5BFF5DFF5F-FF65", + Pd: "002D058A05BE140018062010-20152E172E1A301C303030A0FE31FE32FE58FE63FF0D", + Ps: "0028005B007B0F3A0F3C169B201A201E2045207D208D23292768276A276C276E27702772277427C527E627E827EA27EC27EE2983298529872989298B298D298F299129932995299729D829DA29FC2E222E242E262E283008300A300C300E3010301430163018301A301DFD3EFE17FE35FE37FE39FE3BFE3DFE3FFE41FE43FE47FE59FE5BFE5DFF08FF3BFF5BFF5FFF62", + Pe: "0029005D007D0F3B0F3D169C2046207E208E232A2769276B276D276F27712773277527C627E727E927EB27ED27EF298429862988298A298C298E2990299229942996299829D929DB29FD2E232E252E272E293009300B300D300F3011301530173019301B301E301FFD3FFE18FE36FE38FE3AFE3CFE3EFE40FE42FE44FE48FE5AFE5CFE5EFF09FF3DFF5DFF60FF63", + Pi: "00AB2018201B201C201F20392E022E042E092E0C2E1C2E20", + Pf: "00BB2019201D203A2E032E052E0A2E0D2E1D2E21", + Pc: "005F203F20402054FE33FE34FE4D-FE4FFF3F", + Po: "0021-00230025-0027002A002C002E002F003A003B003F0040005C00A100B700BF037E0387055A-055F058905C005C305C605F305F40609060A060C060D061B061E061F066A-066D06D40700-070D07F7-07F90830-083E0964096509700DF40E4F0E5A0E5B0F04-0F120F850FD0-0FD4104A-104F10FB1361-1368166D166E16EB-16ED1735173617D4-17D617D8-17DA1800-18051807-180A1944194519DE19DF1A1E1A1F1AA0-1AA61AA8-1AAD1B5A-1B601C3B-1C3F1C7E1C7F1CD3201620172020-20272030-2038203B-203E2041-20432047-205120532055-205E2CF9-2CFC2CFE2CFF2E002E012E06-2E082E0B2E0E-2E162E182E192E1B2E1E2E1F2E2A-2E2E2E302E313001-3003303D30FBA4FEA4FFA60D-A60FA673A67EA6F2-A6F7A874-A877A8CEA8CFA8F8-A8FAA92EA92FA95FA9C1-A9CDA9DEA9DFAA5C-AA5FAADEAADFABEBFE10-FE16FE19FE30FE45FE46FE49-FE4CFE50-FE52FE54-FE57FE5F-FE61FE68FE6AFE6BFF01-FF03FF05-FF07FF0AFF0CFF0EFF0FFF1AFF1BFF1FFF20FF3CFF61FF64FF65", + S: "0024002B003C-003E005E0060007C007E00A2-00A900AC00AE-00B100B400B600B800D700F702C2-02C502D2-02DF02E5-02EB02ED02EF-02FF03750384038503F604820606-0608060B060E060F06E906FD06FE07F609F209F309FA09FB0AF10B700BF3-0BFA0C7F0CF10CF20D790E3F0F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-139917DB194019E0-19FF1B61-1B6A1B74-1B7C1FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE20442052207A-207C208A-208C20A0-20B8210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B2140-2144214A-214D214F2190-2328232B-23E82400-24262440-244A249C-24E92500-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE27C0-27C427C7-27CA27CC27D0-27E527F0-29822999-29D729DC-29FB29FE-2B4C2B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F309B309C319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A700-A716A720A721A789A78AA828-A82BA836-A839AA77-AA79FB29FDFCFDFDFE62FE64-FE66FE69FF04FF0BFF1C-FF1EFF3EFF40FF5CFF5EFFE0-FFE6FFE8-FFEEFFFCFFFD", + Sm: "002B003C-003E007C007E00AC00B100D700F703F60606-060820442052207A-207C208A-208C2140-2144214B2190-2194219A219B21A021A321A621AE21CE21CF21D221D421F4-22FF2308-230B23202321237C239B-23B323DC-23E125B725C125F8-25FF266F27C0-27C427C7-27CA27CC27D0-27E527F0-27FF2900-29822999-29D729DC-29FB29FE-2AFF2B30-2B442B47-2B4CFB29FE62FE64-FE66FF0BFF1C-FF1EFF5CFF5EFFE2FFE9-FFEC", + Sc: "002400A2-00A5060B09F209F309FB0AF10BF90E3F17DB20A0-20B8A838FDFCFE69FF04FFE0FFE1FFE5FFE6", + Sk: "005E006000A800AF00B400B802C2-02C502D2-02DF02E5-02EB02ED02EF-02FF0375038403851FBD1FBF-1FC11FCD-1FCF1FDD-1FDF1FED-1FEF1FFD1FFE309B309CA700-A716A720A721A789A78AFF3EFF40FFE3", + So: "00A600A700A900AE00B000B60482060E060F06E906FD06FE07F609FA0B700BF3-0BF80BFA0C7F0CF10CF20D790F01-0F030F13-0F170F1A-0F1F0F340F360F380FBE-0FC50FC7-0FCC0FCE0FCF0FD5-0FD8109E109F13601390-1399194019E0-19FF1B61-1B6A1B74-1B7C210021012103-21062108210921142116-2118211E-2123212521272129212E213A213B214A214C214D214F2195-2199219C-219F21A121A221A421A521A7-21AD21AF-21CD21D021D121D321D5-21F32300-2307230C-231F2322-2328232B-237B237D-239A23B4-23DB23E2-23E82400-24262440-244A249C-24E92500-25B625B8-25C025C2-25F72600-266E2670-26CD26CF-26E126E326E8-26FF2701-27042706-2709270C-27272729-274B274D274F-27522756-275E2761-276727942798-27AF27B1-27BE2800-28FF2B00-2B2F2B452B462B50-2B592CE5-2CEA2E80-2E992E9B-2EF32F00-2FD52FF0-2FFB300430123013302030363037303E303F319031913196-319F31C0-31E33200-321E322A-32503260-327F328A-32B032C0-32FE3300-33FF4DC0-4DFFA490-A4C6A828-A82BA836A837A839AA77-AA79FDFDFFE4FFE8FFEDFFEEFFFCFFFD", + Z: "002000A01680180E2000-200A20282029202F205F3000", + Zs: "002000A01680180E2000-200A202F205F3000", + Zl: "2028", + Zp: "2029", + C: "0000-001F007F-009F00AD03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-0605061C061D0620065F06DD070E070F074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17B417B517DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF200B-200F202A-202E2060-206F20722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-F8FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFD-FF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFFBFFFEFFFF", + Cc: "0000-001F007F-009F", + Cf: "00AD0600-060306DD070F17B417B5200B-200F202A-202E2060-2064206A-206FFEFFFFF9-FFFB", + Co: "E000-F8FF", + Cs: "D800-DFFF", + Cn: "03780379037F-0383038B038D03A20526-05300557055805600588058B-059005C8-05CF05EB-05EF05F5-05FF06040605061C061D0620065F070E074B074C07B2-07BF07FB-07FF082E082F083F-08FF093A093B094F095609570973-097809800984098D098E0991099209A909B109B3-09B509BA09BB09C509C609C909CA09CF-09D609D8-09DB09DE09E409E509FC-0A000A040A0B-0A0E0A110A120A290A310A340A370A3A0A3B0A3D0A43-0A460A490A4A0A4E-0A500A52-0A580A5D0A5F-0A650A76-0A800A840A8E0A920AA90AB10AB40ABA0ABB0AC60ACA0ACE0ACF0AD1-0ADF0AE40AE50AF00AF2-0B000B040B0D0B0E0B110B120B290B310B340B3A0B3B0B450B460B490B4A0B4E-0B550B58-0B5B0B5E0B640B650B72-0B810B840B8B-0B8D0B910B96-0B980B9B0B9D0BA0-0BA20BA5-0BA70BAB-0BAD0BBA-0BBD0BC3-0BC50BC90BCE0BCF0BD1-0BD60BD8-0BE50BFB-0C000C040C0D0C110C290C340C3A-0C3C0C450C490C4E-0C540C570C5A-0C5F0C640C650C70-0C770C800C810C840C8D0C910CA90CB40CBA0CBB0CC50CC90CCE-0CD40CD7-0CDD0CDF0CE40CE50CF00CF3-0D010D040D0D0D110D290D3A-0D3C0D450D490D4E-0D560D58-0D5F0D640D650D76-0D780D800D810D840D97-0D990DB20DBC0DBE0DBF0DC7-0DC90DCB-0DCE0DD50DD70DE0-0DF10DF5-0E000E3B-0E3E0E5C-0E800E830E850E860E890E8B0E8C0E8E-0E930E980EA00EA40EA60EA80EA90EAC0EBA0EBE0EBF0EC50EC70ECE0ECF0EDA0EDB0EDE-0EFF0F480F6D-0F700F8C-0F8F0F980FBD0FCD0FD9-0FFF10C6-10CF10FD-10FF1249124E124F12571259125E125F1289128E128F12B112B612B712BF12C112C612C712D7131113161317135B-135E137D-137F139A-139F13F5-13FF169D-169F16F1-16FF170D1715-171F1737-173F1754-175F176D17711774-177F17DE17DF17EA-17EF17FA-17FF180F181A-181F1878-187F18AB-18AF18F6-18FF191D-191F192C-192F193C-193F1941-1943196E196F1975-197F19AC-19AF19CA-19CF19DB-19DD1A1C1A1D1A5F1A7D1A7E1A8A-1A8F1A9A-1A9F1AAE-1AFF1B4C-1B4F1B7D-1B7F1BAB-1BAD1BBA-1BFF1C38-1C3A1C4A-1C4C1C80-1CCF1CF3-1CFF1DE7-1DFC1F161F171F1E1F1F1F461F471F4E1F4F1F581F5A1F5C1F5E1F7E1F7F1FB51FC51FD41FD51FDC1FF01FF11FF51FFF2065-206920722073208F2095-209F20B9-20CF20F1-20FF218A-218F23E9-23FF2427-243F244B-245F26CE26E226E4-26E727002705270A270B2728274C274E2753-2755275F27602795-279727B027BF27CB27CD-27CF2B4D-2B4F2B5A-2BFF2C2F2C5F2CF2-2CF82D26-2D2F2D66-2D6E2D70-2D7F2D97-2D9F2DA72DAF2DB72DBF2DC72DCF2DD72DDF2E32-2E7F2E9A2EF4-2EFF2FD6-2FEF2FFC-2FFF3040309730983100-3104312E-3130318F31B8-31BF31E4-31EF321F32FF4DB6-4DBF9FCC-9FFFA48D-A48FA4C7-A4CFA62C-A63FA660A661A674-A67BA698-A69FA6F8-A6FFA78D-A7FAA82C-A82FA83A-A83FA878-A87FA8C5-A8CDA8DA-A8DFA8FC-A8FFA954-A95EA97D-A97FA9CEA9DA-A9DDA9E0-A9FFAA37-AA3FAA4EAA4FAA5AAA5BAA7C-AA7FAAC3-AADAAAE0-ABBFABEEABEFABFA-ABFFD7A4-D7AFD7C7-D7CAD7FC-D7FFFA2EFA2FFA6EFA6FFADA-FAFFFB07-FB12FB18-FB1CFB37FB3DFB3FFB42FB45FBB2-FBD2FD40-FD4FFD90FD91FDC8-FDEFFDFEFDFFFE1A-FE1FFE27-FE2FFE53FE67FE6C-FE6FFE75FEFDFEFEFF00FFBF-FFC1FFC8FFC9FFD0FFD1FFD8FFD9FFDD-FFDFFFE7FFEF-FFF8FFFEFFFF" +}); + +function addUnicodePackage (pack) { + var codePoint = /\w{4}/g; + for (var name in pack) + exports.packages[name] = pack[name].replace(codePoint, "\\u$&"); +} + +}); + +ace.define("ace/mode/text",["require","exports","module","ace/tokenizer","ace/mode/text_highlight_rules","ace/mode/behaviour/cstyle","ace/unicode","ace/lib/lang","ace/token_iterator","ace/range"], function(require, exports, module) { "use strict"; var Tokenizer = require("../tokenizer").Tokenizer; var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; -var Behaviour = require("./behaviour").Behaviour; +var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var unicode = require("../unicode"); var lang = require("../lib/lang"); var TokenIterator = require("../token_iterator").TokenIterator; @@ -5697,10 +6047,10 @@ var Range = require("../range").Range; var Mode = function() { this.HighlightRules = TextHighlightRules; - this.$behaviour = new Behaviour(); }; (function() { + this.$defaultBehaviour = new CstyleBehaviour(); this.tokenRe = new RegExp("^[" + unicode.packages.L @@ -5718,7 +6068,7 @@ var Mode = function() { this.getTokenizer = function() { if (!this.$tokenizer) { - this.$highlightRules = this.$highlightRules || new this.HighlightRules(); + this.$highlightRules = this.$highlightRules || new this.HighlightRules(this.$highlightRuleConfig); this.$tokenizer = new Tokenizer(this.$highlightRules.getRules()); } return this.$tokenizer; @@ -6340,7 +6690,7 @@ var Document = function(textOrLines) { return this.removeFullLines(firstRow, lastRow); }; this.insertNewLine = function(position) { - console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, [\'\', \'\']) instead."); + console.warn("Use of document.insertNewLine is deprecated. Use insertMergedLines(position, ['', '']) instead."); return this.insertMergedLines(position, ["", ""]); }; this.insert = function(position, text) { @@ -7962,7 +8312,7 @@ function Folding() { this.removeFold(fold); else this.expandFold(fold); - return; + return fold; } var range = this.getFoldWidgetRange(row, true); @@ -7970,7 +8320,7 @@ function Folding() { fold = this.getFoldAt(range.start.row, range.start.column, 1); if (fold && range.isEqual(fold.range)) { this.removeFold(fold); - return; + return fold; } } @@ -8249,6 +8599,7 @@ var EditSession = function(text, mode) { this.$undoSelect = true; this.$foldData = []; + this.id = "session" + (++EditSession.$uid); this.$foldData.toString = function() { return this.join("\n"); }; @@ -10185,7 +10536,7 @@ var Search = function() { needle = lang.escapeRegExp(needle); if (options.wholeWord) - needle = "\\b" + needle + "\\b"; + needle = addWordBoundary(needle, options); var modifier = options.caseSensitive ? "gm" : "gmi"; @@ -10274,6 +10625,15 @@ var Search = function() { }).call(Search.prototype); +function addWordBoundary(needle, options) { + function wordBoundary(c) { + if (/\w/.test(c) || options.regExp) return "\\b"; + return ""; + } + return wordBoundary(needle[0]) + needle + + wordBoundary(needle[needle.length - 1]); +} + exports.Search = Search; }); @@ -10628,7 +10988,7 @@ exports.commands = [{ readOnly: true }, { name: "goToNextError", - bindKey: bindKey("Alt-E", "Ctrl-E"), + bindKey: bindKey("Alt-E", "F4"), exec: function(editor) { config.loadModule("ace/ext/error_marker", function(module) { module.showErrorMarker(editor, 1); @@ -10638,7 +10998,7 @@ exports.commands = [{ readOnly: true }, { name: "goToPreviousError", - bindKey: bindKey("Alt-Shift-E", "Ctrl-Shift-E"), + bindKey: bindKey("Alt-Shift-E", "Shift-F4"), exec: function(editor) { config.loadModule("ace/ext/error_marker", function(module) { module.showErrorMarker(editor, -1); @@ -10763,7 +11123,7 @@ exports.commands = [{ readOnly: true }, { name: "selecttostart", - bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Up"), + bindKey: bindKey("Ctrl-Shift-Home", "Command-Shift-Home|Command-Shift-Up"), exec: function(editor) { editor.getSelection().selectFileStart(); }, multiSelectAction: "forEach", readOnly: true, @@ -10779,7 +11139,7 @@ exports.commands = [{ aceCommandGroup: "fileJump" }, { name: "selectup", - bindKey: bindKey("Shift-Up", "Shift-Up"), + bindKey: bindKey("Shift-Up", "Shift-Up|Ctrl-Shift-P"), exec: function(editor) { editor.getSelection().selectUp(); }, multiSelectAction: "forEach", scrollIntoView: "cursor", @@ -10793,7 +11153,7 @@ exports.commands = [{ readOnly: true }, { name: "selecttoend", - bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-Down"), + bindKey: bindKey("Ctrl-Shift-End", "Command-Shift-End|Command-Shift-Down"), exec: function(editor) { editor.getSelection().selectFileEnd(); }, multiSelectAction: "forEach", readOnly: true, @@ -10809,7 +11169,7 @@ exports.commands = [{ aceCommandGroup: "fileJump" }, { name: "selectdown", - bindKey: bindKey("Shift-Down", "Shift-Down"), + bindKey: bindKey("Shift-Down", "Shift-Down|Ctrl-Shift-N"), exec: function(editor) { editor.getSelection().selectDown(); }, multiSelectAction: "forEach", scrollIntoView: "cursor", @@ -10837,7 +11197,7 @@ exports.commands = [{ readOnly: true }, { name: "selecttolinestart", - bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left"), + bindKey: bindKey("Alt-Shift-Left", "Command-Shift-Left|Ctrl-Shift-A"), exec: function(editor) { editor.getSelection().selectLineStart(); }, multiSelectAction: "forEach", scrollIntoView: "cursor", @@ -10851,7 +11211,7 @@ exports.commands = [{ readOnly: true }, { name: "selectleft", - bindKey: bindKey("Shift-Left", "Shift-Left"), + bindKey: bindKey("Shift-Left", "Shift-Left|Ctrl-Shift-B"), exec: function(editor) { editor.getSelection().selectLeft(); }, multiSelectAction: "forEach", scrollIntoView: "cursor", @@ -10879,7 +11239,7 @@ exports.commands = [{ readOnly: true }, { name: "selecttolineend", - bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right"), + bindKey: bindKey("Alt-Shift-Right", "Command-Shift-Right|Shift-End|Ctrl-Shift-E"), exec: function(editor) { editor.getSelection().selectLineEnd(); }, multiSelectAction: "forEach", scrollIntoView: "cursor", @@ -11743,7 +12103,8 @@ var Editor = function(renderer, session) { var row = iterator.getCurrentTokenRow(); var column = iterator.getCurrentTokenColumn(); var range = new Range(row, column, row, column+token.value.length); - if (session.$tagHighlight && range.compareRange(session.$backMarkers[session.$tagHighlight].range)!==0) { + var sbm = session.$backMarkers[session.$tagHighlight]; + if (session.$tagHighlight && sbm != undefined && range.compareRange(sbm.range) !== 0) { session.removeMarker(session.$tagHighlight); session.$tagHighlight = null; } @@ -12320,7 +12681,7 @@ var Editor = function(renderer, session) { var indentString = lang.stringRepeat(" ", count); } else { var count = column % size; - while (line[range.start.column] == " " && count) { + while (line[range.start.column - 1] == " " && count) { range.start.column--; count--; } @@ -14438,6 +14799,7 @@ var oop = require("./lib/oop"); var dom = require("./lib/dom"); var event = require("./lib/event"); var EventEmitter = require("./lib/event_emitter").EventEmitter; +var MAX_SCROLL_H = 0x8000; var ScrollBar = function(parent) { this.element = dom.createElement("div"); this.element.className = "ace_scrollbar ace_scrollbar" + this.classSuffix; @@ -14461,11 +14823,13 @@ var ScrollBar = function(parent) { this.setVisible = function(isVisible) { this.element.style.display = isVisible ? "" : "none"; this.isVisible = isVisible; + this.coeff = 1; }; }).call(ScrollBar.prototype); var VScrollBar = function(parent, renderer) { ScrollBar.call(this, parent); this.scrollTop = 0; + this.scrollHeight = 0; renderer.$scrollbarWidth = this.width = dom.scrollbarWidth(parent.ownerDocument); this.inner.style.width = @@ -14480,6 +14844,10 @@ oop.inherits(VScrollBar, ScrollBar); this.onScroll = function() { if (!this.skipEvent) { this.scrollTop = this.element.scrollTop; + if (this.coeff != 1) { + var h = this.element.clientHeight / this.scrollHeight; + this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h); + } this._emit("scroll", {data: this.scrollTop}); } this.skipEvent = false; @@ -14490,16 +14858,22 @@ oop.inherits(VScrollBar, ScrollBar); this.setHeight = function(height) { this.element.style.height = height + "px"; }; - this.setInnerHeight = function(height) { - this.inner.style.height = height + "px"; - }; + this.setInnerHeight = this.setScrollHeight = function(height) { + this.scrollHeight = height; + if (height > MAX_SCROLL_H) { + this.coeff = MAX_SCROLL_H / height; + height = MAX_SCROLL_H; + } else if (this.coeff != 1) { + this.coeff = 1 + } this.inner.style.height = height + "px"; }; this.setScrollTop = function(scrollTop) { if (this.scrollTop != scrollTop) { this.skipEvent = true; - this.scrollTop = this.element.scrollTop = scrollTop; + this.scrollTop = scrollTop; + this.element.scrollTop = scrollTop * this.coeff; } }; @@ -14757,6 +15131,7 @@ position: relative;\ overflow: hidden;\ font: 12px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;\ direction: ltr;\ +text-align: left;\ }\ .ace_scroller {\ position: absolute;\ @@ -15282,6 +15657,7 @@ var VirtualRenderer = function(container, theme) { this.$loop.schedule(this.CHANGE_FULL); this.session.$setFontMetrics(this.$fontMetrics); + this.scrollBarV.scrollLeft = this.scrollBarV.scrollTop = null; this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this); this.onChangeNewLineMode() @@ -15876,7 +16252,7 @@ var VirtualRenderer = function(container, theme) { minHeight : minHeight, maxHeight : maxHeight, offset : offset, - gutterOffset : Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)), + gutterOffset : lineHeight ? Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)) : 0, height : this.$size.scrollerHeight }; @@ -16187,8 +16563,8 @@ var VirtualRenderer = function(container, theme) { function afterLoad(module) { if (_self.$themeId != theme) return cb && cb(); - if (!module.cssClass) - return; + if (!module || !module.cssClass) + throw new Error("couldn't load module " + theme + " or it didn't call define"); dom.importCssString( module.cssText, module.cssClass, @@ -18250,7 +18626,7 @@ function LineWidgets(session) { if (!w.coverGutter) { w.el.style.zIndex = 3; } - if (!w.pixelHeight) { + if (w.pixelHeight == null) { w.pixelHeight = w.el.offsetHeight; } if (w.rowCount == null) { @@ -18625,6 +19001,9 @@ require("./ext/error_marker"); exports.config = require("./config"); exports.require = require; + +if (typeof define === "function") + exports.define = define; exports.edit = function(el) { if (typeof el == "string") { var _id = el; @@ -18673,11 +19052,14 @@ exports.createEditSession = function(text, mode) { } exports.EditSession = EditSession; exports.UndoManager = UndoManager; -exports.version = "1.2.3"; +exports.version = "1.2.6"; }); (function() { ace.require(["ace/ace"], function(a) { - a && a.config.init(true); + if (a) { + a.config.init(true); + a.define = ace.define; + } if (!window.ace) window.ace = a; for (var key in a) if (a.hasOwnProperty(key)) diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-emmet.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-emmet.js index 2eeabe2..c2f2d1a 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-emmet.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-emmet.js @@ -243,6 +243,7 @@ var SnippetManager = function() { if (cursor.column < indentString.length) indentString = indentString.slice(0, cursor.column); + snippetText = snippetText.replace(/\r/g, ""); var tokens = this.tokenizeTmSnippet(snippetText); tokens = this.resolveVariables(tokens, editor); tokens = tokens.map(function(x) { @@ -320,9 +321,10 @@ var SnippetManager = function() { var text = ""; tokens.forEach(function(t) { if (typeof t === "string") { - if (t[0] === "\n"){ - column = t.length - 1; - row ++; + var lines = t.split("\n"); + if (lines.length > 1){ + column = lines[lines.length - 1].length; + row += lines.length - 1; } else column += t.length; text += t; @@ -904,7 +906,7 @@ var Editor = require("./editor").Editor; }); -ace.define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","range","tabStops","resources","utils","actions","ace/config","ace/config"], function(require, exports, module) { +ace.define("ace/ext/emmet",["require","exports","module","ace/keyboard/hash_handler","ace/editor","ace/snippets","ace/range","resources","resources","tabStops","resources","utils","actions","ace/config","ace/config"], function(require, exports, module) { "use strict"; var HashHandler = require("ace/keyboard/hash_handler").HashHandler; var Editor = require("ace/editor").Editor; @@ -919,7 +921,8 @@ AceEmmetEditor.prototype = { this.indentation = editor.session.getTabString(); if (!emmet) emmet = window.emmet; - emmet.require("resources").setVariable("indentation", this.indentation); + var resources = emmet.resources || emmet.require("resources"); + resources.setVariable("indentation", this.indentation); this.$syntax = null; this.$syntax = this.getSyntax(); }, @@ -999,13 +1002,14 @@ AceEmmetEditor.prototype = { return syntax; }, getProfileName: function() { + var resources = emmet.resources || emmet.require("resources"); switch (this.getSyntax()) { case "css": return "css"; case "xml": case "xsl": return "xml"; case "html": - var profile = emmet.require("resources").getVariable("profile"); + var profile = resources.getVariable("profile"); if (!profile) profile = this.ace.session.getLines(0,2).join("").search(/]+XHTML/i) != -1 ? "xhtml": "html"; return profile; @@ -1027,9 +1031,9 @@ AceEmmetEditor.prototype = { var base = 1000; var zeroBase = 0; var lastZero = null; - var range = emmet.require('range'); - var ts = emmet.require('tabStops'); - var settings = emmet.require('resources').getVocabulary("user"); + var ts = emmet.tabStops || emmet.require('tabStops'); + var resources = emmet.resources || emmet.require("resources"); + var settings = resources.getVocabulary("user"); var tabstopOptions = { tabstop: function(data) { var group = parseInt(data.group, 10); @@ -1047,7 +1051,7 @@ AceEmmetEditor.prototype = { var result = '${' + group + (placeholder ? ':' + placeholder : '') + '}'; if (isZero) { - lastZero = range.create(data.start, result); + lastZero = [data.start, result]; } return result; @@ -1064,7 +1068,8 @@ AceEmmetEditor.prototype = { if (settings.variables['insert_final_tabstop'] && !/\$\{0\}$/.test(value)) { value += '${0}'; } else if (lastZero) { - value = emmet.require('utils').replaceSubstring(value, '${0}', lastZero); + var common = emmet.utils ? emmet.utils.common : emmet.require('utils'); + value = common.replaceSubstring(value, '${0}', lastZero[0], lastZero[1]); } return value; @@ -1103,7 +1108,7 @@ exports.commands = new HashHandler(); exports.runEmmetCommand = function runEmmetCommand(editor) { try { editorProxy.setupContext(editor); - var actions = emmet.require("actions"); + var actions = emmet.actions || emmet.require("actions"); if (this.action == "expand_abbreviation_with_tab") { if (!editor.selection.isEmpty()) diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-language_tools.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-language_tools.js index 355f60e..d94ce50 100644 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-language_tools.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-language_tools.js @@ -243,6 +243,7 @@ var SnippetManager = function() { if (cursor.column < indentString.length) indentString = indentString.slice(0, cursor.column); + snippetText = snippetText.replace(/\r/g, ""); var tokens = this.tokenizeTmSnippet(snippetText); tokens = this.resolveVariables(tokens, editor); tokens = tokens.map(function(x) { @@ -320,9 +321,10 @@ var SnippetManager = function() { var text = ""; tokens.forEach(function(t) { if (typeof t === "string") { - if (t[0] === "\n"){ - column = t.length - 1; - row ++; + var lines = t.split("\n"); + if (lines.length > 1){ + column = lines[lines.length - 1].length; + row += lines.length - 1; } else column += t.length; text += t; @@ -1388,6 +1390,9 @@ var Autocomplete = function() { }; this.blurListener = function(e) { + if (e.relatedTarget && e.relatedTarget.nodeName == "A" && e.relatedTarget.href) { + window.open(e.relatedTarget.href, "_blank"); + } var el = document.activeElement; var text = this.editor.textInput.getElement(); var fromTooltip = e.relatedTarget && e.relatedTarget == this.tooltipNode; diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-searchbox.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-searchbox.js index ef31f69..0793942 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-searchbox.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/ext-searchbox.js @@ -42,6 +42,7 @@ outline: 1px solid red;\ }\ .ace_search_field {\ background-color: white;\ +color: black;\ border-right: 1px solid #cbcbcb;\ border: 0 none;\ -webkit-box-sizing: border-box;\ diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-css.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-css.js index 200bf01..f8fdea2 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-css.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-css.js @@ -356,363 +356,6 @@ var CssCompletions = function() { exports.CssCompletions = CssCompletions; }); -ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {}; -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.index; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var getWrapped = function(selection, selected, opening, closing) { - var rowDiff = selection.end.row - selection.start.row; - return { - text: opening + selected + closing, - selection: [ - 0, - selection.start.column + 1, - rowDiff, - selection.end.column + (rowDiff ? 0 : 1) - ] - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '{', '}'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '(', ')'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '[', ']'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, quote, quote); - } else if (!selected) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - var rightChar = line.substring(cursor.column, cursor.column + 1); - - var token = session.getTokenAt(cursor.row, cursor.column); - var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); - if (leftChar == "\\" && token && /escape/.test(token.type)) - return null; - - var stringBefore = token && /string|escape/.test(token.type); - var stringAfter = !rightToken || /string|escape/.test(rightToken.type); - - var pair; - if (rightChar == quote) { - pair = stringBefore !== stringAfter; - } else { - if (stringBefore && !stringAfter) - return null; // wrap string with different quote - if (stringBefore && stringAfter) - return null; // do not pair quotes inside strings - var wordRe = session.$mode.tokenRe; - wordRe.lastIndex = 0; - var isWordBefore = wordRe.test(leftChar); - wordRe.lastIndex = 0; - var isWordAfter = wordRe.test(leftChar); - if (isWordBefore || isWordAfter) - return null; // before or after alphanumeric - if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) - return null; // there is rightChar and it isn't closing - pair = true; - } - return { - text: pair ? quote + quote : "", - selection: [1,1] - }; - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { "use strict"; diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-html.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-html.js index 94216ca..aa85ed7 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-html.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-html.js @@ -72,7 +72,7 @@ var JavaScriptHighlightRules = function(options) { "keyword": "const|yield|import|get|set|async|await|" + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + "__parent__|__count__|escape|unescape|with|__proto__|" + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", "storage.type": @@ -178,7 +178,7 @@ var JavaScriptHighlightRules = function(options) { next : "property" }, { token : "keyword.operator", - regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/, + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, next : "start" }, { token : "punctuation.operator", @@ -379,7 +379,7 @@ var JavaScriptHighlightRules = function(options) { }] }); - if (!options || !options.noJSX) + if (!options || options.jsx != false) JSX.call(this); } @@ -555,363 +555,6 @@ var MatchingBraceOutdent = function() {}; exports.MatchingBraceOutdent = MatchingBraceOutdent; }); -ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {}; -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.index; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var getWrapped = function(selection, selected, opening, closing) { - var rowDiff = selection.end.row - selection.start.row; - return { - text: opening + selected + closing, - selection: [ - 0, - selection.start.column + 1, - rowDiff, - selection.end.column + (rowDiff ? 0 : 1) - ] - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '{', '}'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '(', ')'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '[', ']'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, quote, quote); - } else if (!selected) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - var rightChar = line.substring(cursor.column, cursor.column + 1); - - var token = session.getTokenAt(cursor.row, cursor.column); - var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); - if (leftChar == "\\" && token && /escape/.test(token.type)) - return null; - - var stringBefore = token && /string|escape/.test(token.type); - var stringAfter = !rightToken || /string|escape/.test(rightToken.type); - - var pair; - if (rightChar == quote) { - pair = stringBefore !== stringAfter; - } else { - if (stringBefore && !stringAfter) - return null; // wrap string with different quote - if (stringBefore && stringAfter) - return null; // do not pair quotes inside strings - var wordRe = session.$mode.tokenRe; - wordRe.lastIndex = 0; - var isWordBefore = wordRe.test(leftChar); - wordRe.lastIndex = 0; - var isWordAfter = wordRe.test(leftChar); - if (isWordBefore || isWordAfter) - return null; // before or after alphanumeric - if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) - return null; // there is rightChar and it isn't closing - pair = true; - } - return { - text: pair ? quote + quote : "", - selection: [1,1] - }; - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { "use strict"; @@ -1052,14 +695,13 @@ oop.inherits(FoldMode, BaseFoldMode); }); -ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextMode = require("./text").Mode; var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; var WorkerClient = require("../worker/worker_client").WorkerClient; var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; @@ -1090,7 +732,7 @@ oop.inherits(Mode, TextMode); } if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); if (match) { indent += tab; } @@ -1894,7 +1536,7 @@ var HtmlHighlightRules = function() { }); this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); if (this.constructor === HtmlHighlightRules) this.normalizeRules(); @@ -1976,7 +1618,7 @@ var XmlBehaviour = function () { this.add("autoclosing", "insertion", function (state, action, editor, session, text) { if (text == '>') { - var position = editor.getCursorPosition(); + var position = editor.getSelectionRange().start; var iterator = new TokenIterator(session, position.row, position.column); var token = iterator.getCurrentToken() || iterator.stepBackward(); if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) @@ -1994,6 +1636,10 @@ var XmlBehaviour = function () { } while (!is(token, "tag-name")) { token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } } var tokenRow = iterator.getCurrentTokenRow(); @@ -2632,7 +2278,7 @@ var HtmlCompletions = function() { if (is(token, "attribute-value")) return this.getAttributeValueCompletions(state, session, pos, prefix); var line = session.getLine(pos.row).substr(0, pos.column); - if (/&[A-z]*$/i.test(line)) + if (/&[a-z]*$/i.test(line)) return this.getHTMLEntityCompletions(state, session, pos, prefix); return []; diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-javascript.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-javascript.js index 4f47633..92bc27c 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-javascript.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-javascript.js @@ -72,7 +72,7 @@ var JavaScriptHighlightRules = function(options) { "keyword": "const|yield|import|get|set|async|await|" + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + "__parent__|__count__|escape|unescape|with|__proto__|" + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", "storage.type": @@ -178,7 +178,7 @@ var JavaScriptHighlightRules = function(options) { next : "property" }, { token : "keyword.operator", - regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/, + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, next : "start" }, { token : "punctuation.operator", @@ -379,7 +379,7 @@ var JavaScriptHighlightRules = function(options) { }] }); - if (!options || !options.noJSX) + if (!options || options.jsx != false) JSX.call(this); } @@ -555,363 +555,6 @@ var MatchingBraceOutdent = function() {}; exports.MatchingBraceOutdent = MatchingBraceOutdent; }); -ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {}; -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.index; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var getWrapped = function(selection, selected, opening, closing) { - var rowDiff = selection.end.row - selection.start.row; - return { - text: opening + selected + closing, - selection: [ - 0, - selection.start.column + 1, - rowDiff, - selection.end.column + (rowDiff ? 0 : 1) - ] - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '{', '}'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '(', ')'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '[', ']'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, quote, quote); - } else if (!selected) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - var rightChar = line.substring(cursor.column, cursor.column + 1); - - var token = session.getTokenAt(cursor.row, cursor.column); - var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); - if (leftChar == "\\" && token && /escape/.test(token.type)) - return null; - - var stringBefore = token && /string|escape/.test(token.type); - var stringAfter = !rightToken || /string|escape/.test(rightToken.type); - - var pair; - if (rightChar == quote) { - pair = stringBefore !== stringAfter; - } else { - if (stringBefore && !stringAfter) - return null; // wrap string with different quote - if (stringBefore && stringAfter) - return null; // do not pair quotes inside strings - var wordRe = session.$mode.tokenRe; - wordRe.lastIndex = 0; - var isWordBefore = wordRe.test(leftChar); - wordRe.lastIndex = 0; - var isWordAfter = wordRe.test(leftChar); - if (isWordBefore || isWordAfter) - return null; // before or after alphanumeric - if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) - return null; // there is rightChar and it isn't closing - pair = true; - } - return { - text: pair ? quote + quote : "", - selection: [1,1] - }; - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { "use strict"; @@ -1052,14 +695,13 @@ oop.inherits(FoldMode, BaseFoldMode); }); -ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextMode = require("./text").Mode; var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; var WorkerClient = require("../worker/worker_client").WorkerClient; var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; @@ -1090,7 +732,7 @@ oop.inherits(Mode, TextMode); } if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); if (match) { indent += tab; } diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-less.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-less.js index 8c6c022..43ea2e3 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-less.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-less.js @@ -318,363 +318,6 @@ var MatchingBraceOutdent = function() {}; exports.MatchingBraceOutdent = MatchingBraceOutdent; }); -ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {}; -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.index; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var getWrapped = function(selection, selected, opening, closing) { - var rowDiff = selection.end.row - selection.start.row; - return { - text: opening + selected + closing, - selection: [ - 0, - selection.start.column + 1, - rowDiff, - selection.end.column + (rowDiff ? 0 : 1) - ] - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '{', '}'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '(', ')'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '[', ']'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, quote, quote); - } else if (!selected) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - var rightChar = line.substring(cursor.column, cursor.column + 1); - - var token = session.getTokenAt(cursor.row, cursor.column); - var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); - if (leftChar == "\\" && token && /escape/.test(token.type)) - return null; - - var stringBefore = token && /string|escape/.test(token.type); - var stringAfter = !rightToken || /string|escape/.test(rightToken.type); - - var pair; - if (rightChar == quote) { - pair = stringBefore !== stringAfter; - } else { - if (stringBefore && !stringAfter) - return null; // wrap string with different quote - if (stringBefore && stringAfter) - return null; // do not pair quotes inside strings - var wordRe = session.$mode.tokenRe; - wordRe.lastIndex = 0; - var isWordBefore = wordRe.test(leftChar); - wordRe.lastIndex = 0; - var isWordAfter = wordRe.test(leftChar); - if (isWordBefore || isWordAfter) - return null; // before or after alphanumeric - if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) - return null; // there is rightChar and it isn't closing - pair = true; - } - return { - text: pair ? quote + quote : "", - selection: [1,1] - }; - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { "use strict"; diff --git a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-markdown.js b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-markdown.js index 274edfe..5649baf 100755 --- a/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-markdown.js +++ b/modules/backend/formwidgets/codeeditor/assets/vendor/ace/mode-markdown.js @@ -72,7 +72,7 @@ var JavaScriptHighlightRules = function(options) { "keyword": "const|yield|import|get|set|async|await|" + "break|case|catch|continue|default|delete|do|else|finally|for|function|" + - "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + + "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" + "__parent__|__count__|escape|unescape|with|__proto__|" + "class|enum|extends|super|export|implements|private|public|interface|package|protected|static", "storage.type": @@ -178,7 +178,7 @@ var JavaScriptHighlightRules = function(options) { next : "property" }, { token : "keyword.operator", - regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/, + regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/, next : "start" }, { token : "punctuation.operator", @@ -379,7 +379,7 @@ var JavaScriptHighlightRules = function(options) { }] }); - if (!options || !options.noJSX) + if (!options || options.jsx != false) JSX.call(this); } @@ -555,363 +555,6 @@ var MatchingBraceOutdent = function() {}; exports.MatchingBraceOutdent = MatchingBraceOutdent; }); -ace.define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) { -"use strict"; - -var oop = require("../../lib/oop"); -var Behaviour = require("../behaviour").Behaviour; -var TokenIterator = require("../../token_iterator").TokenIterator; -var lang = require("../../lib/lang"); - -var SAFE_INSERT_IN_TOKENS = - ["text", "paren.rparen", "punctuation.operator"]; -var SAFE_INSERT_BEFORE_TOKENS = - ["text", "paren.rparen", "punctuation.operator", "comment"]; - -var context; -var contextCache = {}; -var initContext = function(editor) { - var id = -1; - if (editor.multiSelect) { - id = editor.selection.index; - if (contextCache.rangeCount != editor.multiSelect.rangeCount) - contextCache = {rangeCount: editor.multiSelect.rangeCount}; - } - if (contextCache[id]) - return context = contextCache[id]; - context = contextCache[id] = { - autoInsertedBrackets: 0, - autoInsertedRow: -1, - autoInsertedLineEnd: "", - maybeInsertedBrackets: 0, - maybeInsertedRow: -1, - maybeInsertedLineStart: "", - maybeInsertedLineEnd: "" - }; -}; - -var getWrapped = function(selection, selected, opening, closing) { - var rowDiff = selection.end.row - selection.start.row; - return { - text: opening + selected + closing, - selection: [ - 0, - selection.start.column + 1, - rowDiff, - selection.end.column + (rowDiff ? 0 : 1) - ] - }; -}; - -var CstyleBehaviour = function() { - this.add("braces", "insertion", function(state, action, editor, session, text) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (text == '{') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '{', '}'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) { - CstyleBehaviour.recordAutoInsert(editor, session, "}"); - return { - text: '{}', - selection: [1, 1] - }; - } else { - CstyleBehaviour.recordMaybeInsert(editor, session, "{"); - return { - text: '{', - selection: [1, 1] - }; - } - } - } else if (text == '}') { - initContext(editor); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == '}') { - var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } else if (text == "\n" || text == "\r\n") { - initContext(editor); - var closing = ""; - if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { - closing = lang.stringRepeat("}", context.maybeInsertedBrackets); - CstyleBehaviour.clearMaybeInsertedClosing(); - } - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar === '}') { - var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}'); - if (!openBracePos) - return null; - var next_indent = this.$getIndent(session.getLine(openBracePos.row)); - } else if (closing) { - var next_indent = this.$getIndent(line); - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - return; - } - var indent = next_indent + session.getTabString(); - - return { - text: '\n' + indent + '\n' + next_indent + closing, - selection: [1, indent.length, 1, indent.length] - }; - } else { - CstyleBehaviour.clearMaybeInsertedClosing(); - } - }); - - this.add("braces", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '{') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.end.column, range.end.column + 1); - if (rightChar == '}') { - range.end.column++; - return range; - } else { - context.maybeInsertedBrackets--; - } - } - }); - - this.add("parens", "insertion", function(state, action, editor, session, text) { - if (text == '(') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '(', ')'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, ")"); - return { - text: '()', - selection: [1, 1] - }; - } - } else if (text == ')') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ')') { - var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("parens", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '(') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ')') { - range.end.column++; - return range; - } - } - }); - - this.add("brackets", "insertion", function(state, action, editor, session, text) { - if (text == '[') { - initContext(editor); - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, '[', ']'); - } else if (CstyleBehaviour.isSaneInsertion(editor, session)) { - CstyleBehaviour.recordAutoInsert(editor, session, "]"); - return { - text: '[]', - selection: [1, 1] - }; - } - } else if (text == ']') { - initContext(editor); - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var rightChar = line.substring(cursor.column, cursor.column + 1); - if (rightChar == ']') { - var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row}); - if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) { - CstyleBehaviour.popAutoInsertedClosing(); - return { - text: '', - selection: [1, 1] - }; - } - } - } - }); - - this.add("brackets", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && selected == '[') { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == ']') { - range.end.column++; - return range; - } - } - }); - - this.add("string_dquotes", "insertion", function(state, action, editor, session, text) { - if (text == '"' || text == "'") { - initContext(editor); - var quote = text; - var selection = editor.getSelectionRange(); - var selected = session.doc.getTextRange(selection); - if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) { - return getWrapped(selection, selected, quote, quote); - } else if (!selected) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - var leftChar = line.substring(cursor.column-1, cursor.column); - var rightChar = line.substring(cursor.column, cursor.column + 1); - - var token = session.getTokenAt(cursor.row, cursor.column); - var rightToken = session.getTokenAt(cursor.row, cursor.column + 1); - if (leftChar == "\\" && token && /escape/.test(token.type)) - return null; - - var stringBefore = token && /string|escape/.test(token.type); - var stringAfter = !rightToken || /string|escape/.test(rightToken.type); - - var pair; - if (rightChar == quote) { - pair = stringBefore !== stringAfter; - } else { - if (stringBefore && !stringAfter) - return null; // wrap string with different quote - if (stringBefore && stringAfter) - return null; // do not pair quotes inside strings - var wordRe = session.$mode.tokenRe; - wordRe.lastIndex = 0; - var isWordBefore = wordRe.test(leftChar); - wordRe.lastIndex = 0; - var isWordAfter = wordRe.test(leftChar); - if (isWordBefore || isWordAfter) - return null; // before or after alphanumeric - if (rightChar && !/[\s;,.})\]\\]/.test(rightChar)) - return null; // there is rightChar and it isn't closing - pair = true; - } - return { - text: pair ? quote + quote : "", - selection: [1,1] - }; - } - } - }); - - this.add("string_dquotes", "deletion", function(state, action, editor, session, range) { - var selected = session.doc.getTextRange(range); - if (!range.isMultiLine() && (selected == '"' || selected == "'")) { - initContext(editor); - var line = session.doc.getLine(range.start.row); - var rightChar = line.substring(range.start.column + 1, range.start.column + 2); - if (rightChar == selected) { - range.end.column++; - return range; - } - } - }); - -}; - - -CstyleBehaviour.isSaneInsertion = function(editor, session) { - var cursor = editor.getCursorPosition(); - var iterator = new TokenIterator(session, cursor.row, cursor.column); - if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) { - var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1); - if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) - return false; - } - iterator.stepForward(); - return iterator.getCurrentTokenRow() !== cursor.row || - this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS); -}; - -CstyleBehaviour.$matchTokenType = function(token, types) { - return types.indexOf(token.type || token) > -1; -}; - -CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0])) - context.autoInsertedBrackets = 0; - context.autoInsertedRow = cursor.row; - context.autoInsertedLineEnd = bracket + line.substr(cursor.column); - context.autoInsertedBrackets++; -}; - -CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) { - var cursor = editor.getCursorPosition(); - var line = session.doc.getLine(cursor.row); - if (!this.isMaybeInsertedClosing(cursor, line)) - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = cursor.row; - context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket; - context.maybeInsertedLineEnd = line.substr(cursor.column); - context.maybeInsertedBrackets++; -}; - -CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) { - return context.autoInsertedBrackets > 0 && - cursor.row === context.autoInsertedRow && - bracket === context.autoInsertedLineEnd[0] && - line.substr(cursor.column) === context.autoInsertedLineEnd; -}; - -CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) { - return context.maybeInsertedBrackets > 0 && - cursor.row === context.maybeInsertedRow && - line.substr(cursor.column) === context.maybeInsertedLineEnd && - line.substr(0, cursor.column) == context.maybeInsertedLineStart; -}; - -CstyleBehaviour.popAutoInsertedClosing = function() { - context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1); - context.autoInsertedBrackets--; -}; - -CstyleBehaviour.clearMaybeInsertedClosing = function() { - if (context) { - context.maybeInsertedBrackets = 0; - context.maybeInsertedRow = -1; - } -}; - - - -oop.inherits(CstyleBehaviour, Behaviour); - -exports.CstyleBehaviour = CstyleBehaviour; -}); - ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { "use strict"; @@ -1052,14 +695,13 @@ oop.inherits(FoldMode, BaseFoldMode); }); -ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { +ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextMode = require("./text").Mode; var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; -var Range = require("../range").Range; var WorkerClient = require("../worker/worker_client").WorkerClient; var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour; var CStyleFoldMode = require("./folding/cstyle").FoldMode; @@ -1090,7 +732,7 @@ oop.inherits(Mode, TextMode); } if (state == "start" || state == "no_regex") { - var match = line.match(/^.*(?:\bcase\b.*\:|[\{\(\[])\s*$/); + var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/); if (match) { indent += tab; } @@ -1422,7 +1064,7 @@ var XmlBehaviour = function () { this.add("autoclosing", "insertion", function (state, action, editor, session, text) { if (text == '>') { - var position = editor.getCursorPosition(); + var position = editor.getSelectionRange().start; var iterator = new TokenIterator(session, position.row, position.column); var token = iterator.getCurrentToken() || iterator.stepBackward(); if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value"))) @@ -1440,6 +1082,10 @@ var XmlBehaviour = function () { } while (!is(token, "tag-name")) { token = iterator.stepBackward(); + if (token.value == "<") { + token = iterator.stepForward(); + break; + } } var tokenRow = iterator.getCurrentTokenRow(); @@ -2344,7 +1990,7 @@ var HtmlHighlightRules = function() { }); this.embedTagRules(CssHighlightRules, "css-", "style"); - this.embedTagRules(new JavaScriptHighlightRules({noJSX: true}).getRules(), "js-", "script"); + this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script"); if (this.constructor === HtmlHighlightRules) this.normalizeRules(); @@ -2678,7 +2324,7 @@ var HtmlCompletions = function() { if (is(token, "attribute-value")) return this.getAttributeValueCompletions(state, session, pos, prefix); var line = session.getLine(pos.row).substr(0, pos.column); - if (/&[A-z]*$/i.test(line)) + if (/&[a-z]*$/i.test(line)) return this.getHTMLEntityCompletions(state, session, pos, prefix); return []; @@ -2904,7 +2550,7 @@ var MarkdownHighlightRules = function() { regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$" }, { // link by reference token : ["text", "string", "text", "constant", "text"], - regex : "(\\[)(" + escaped("]") + ")(\\]\s*\\[)("+ escaped("]") + ")(\\])" + regex : "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)("+ escaped("]") + ")(\\])" }, { // link by url token : ["text", "string", "text", "markup.underline", "string", "text"], regex : "(\\[)(" + // [ @@ -3138,6 +2784,7 @@ var Mode = function() { }); this.foldingRules = new MarkdownFoldMode(); + this.$behaviour = this.$defaultBehaviour; }; oop.inherits(Mode, TextMode); diff --git a/modules/backend/formwidgets/codeeditor/partials/_codeeditor.htm b/modules/backend/formwidgets/codeeditor/partials/_codeeditor.htm index 3a754ff..d8609f6 100644 --- a/modules/backend/formwidgets/codeeditor/partials/_codeeditor.htm +++ b/modules/backend/formwidgets/codeeditor/partials/_codeeditor.htm @@ -1,5 +1,7 @@ previewMode): ?> -
    +
    +
    +
    + data-vendor-path="">
    • @@ -65,4 +67,4 @@
    - \ No newline at end of file + diff --git a/modules/backend/formwidgets/colorpicker/assets/css/colorpicker.css b/modules/backend/formwidgets/colorpicker/assets/css/colorpicker.css index bc37a0b..fc82aaa 100644 --- a/modules/backend/formwidgets/colorpicker/assets/css/colorpicker.css +++ b/modules/backend/formwidgets/colorpicker/assets/css/colorpicker.css @@ -57,10 +57,205 @@ bottom: 3px; right: 3px; } -.colpick { +.sp-hue, +.sp-slider { + cursor: row-resize; +} +.sp-color, +.sp-dragger { + cursor: crosshair; +} +.sp-alpha-inner, +.sp-alpha-handle { + cursor: col-resize; +} +.sp-hue { + left: 90%; +} +.sp-color { + right: 15%; +} +.sp-container { border: none; border-radius: 3px; z-index: 10100; -webkit-box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.12), 0 1px 4px rgba(0, 0, 0, 0.24); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; +} +.sp-picker-container { + border: none; +} +.sp-alpha-handle { + background-color: #ccc; + border: 1px solid #666; + width: 4px; +} +.sp-color, +.sp-hue { + border: 1px solid #ccc; +} +.sp-slider { + background-color: #ccc; + border: 1px solid #666; + height: 3px; + left: -4px; + width: 22px; +} +.sp-dragger { + background: transparent; + box-shadow: 0 0 0 1px #111; +} +.sp-input { + outline: none !important; + -webkit-appearance: none; + border: 1px solid #d1d6d9; + -webkit-box-shadow: inset 0 1px 0 rgba(209, 214, 217, 0.25), 0 1px 0 rgba(255,255,255,.5); + box-shadow: inset 0 1px 0 rgba(209, 214, 217, 0.25), 0 1px 0 rgba(255,255,255,.5); + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.sp-input:focus { + border: 1px solid #d1d6d9; +} +.sp-button-container { + width: 100%; + position: relative; + text-align: right; + padding-top: 4px; +} +.sp-container button, +.sp-container button:hover, +.sp-container button:active { + text-shadow: none; + font-size: 13px; + text-align: left; + outline: none !important; + font-weight: normal; + -webkit-box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); + box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); + border: 1px solid transparent; + color: #ffffff; + border: none; + background: #656d79; + padding: 1px 7.5px; + font-size: 12px; + line-height: 1.5; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} +.sp-container button:hover, +.sp-container button:hover:hover, +.sp-container button:active:hover, +.sp-container button:focus, +.sp-container button:hover:focus, +.sp-container button:active:focus, +.sp-container button:active, +.sp-container button:hover:active, +.sp-container button:active:active, +.sp-container button.active, +.sp-container button:hover.active, +.sp-container button:active.active, +.open .dropdown-toggle.sp-container button, +.open .dropdown-toggle.sp-container button:hover, +.open .dropdown-toggle.sp-container button:active { + color: #ffffff; + background: #1681ba; + border-color: #1681ba; +} +.sp-container button:active, +.sp-container button:hover:active, +.sp-container button:active:active, +.sp-container button.active, +.sp-container button:hover.active, +.sp-container button:active.active, +.open .dropdown-toggle.sp-container button, +.open .dropdown-toggle.sp-container button:hover, +.open .dropdown-toggle.sp-container button:active { + background: #126896; + border-color: #105b83; + background-image: none; +} +.sp-container button.on, +.sp-container button:hover.on, +.sp-container button:active.on { + background: #494f58; + border-color: #40454d; + background-image: none; +} +.sp-container button.disabled, +.sp-container button:hover.disabled, +.sp-container button:active.disabled, +.sp-container button[disabled], +.sp-container button:hover[disabled], +.sp-container button:active[disabled], +.sp-container button.disabled:hover, +.sp-container button:hover.disabled:hover, +.sp-container button:active.disabled:hover, +.sp-container button[disabled]:hover, +.sp-container button:hover[disabled]:hover, +.sp-container button:active[disabled]:hover, +.sp-container button.disabled:focus, +.sp-container button:hover.disabled:focus, +.sp-container button:active.disabled:focus, +.sp-container button[disabled]:focus, +.sp-container button:hover[disabled]:focus, +.sp-container button:active[disabled]:focus, +.sp-container button.disabled:active, +.sp-container button:hover.disabled:active, +.sp-container button:active.disabled:active, +.sp-container button[disabled]:active, +.sp-container button:hover[disabled]:active, +.sp-container button:active[disabled]:active, +.sp-container button.disabled.active, +.sp-container button:hover.disabled.active, +.sp-container button:active.disabled.active, +.sp-container button[disabled].active, +.sp-container button:hover[disabled].active, +.sp-container button:active[disabled].active { + background: #656d79; + border-color: #656d79; +} +.sp-container button .badge, +.sp-container button:hover .badge, +.sp-container button:active .badge { + color: #656d79; + background: #ffffff; +} +.sp-cancel { + bottom: -3px; + left: 0; + position: absolute; + text-decoration: none; + font-family: serif; + font-size: 21px; + font-weight: bold; + line-height: 1; + color: #000000 !important; + text-shadow: 0 1px 0 #ffffff; + opacity: 0.2; + filter: alpha(opacity=20); +} +.sp-cancel:hover, +.sp-cancel:focus { + text-decoration: none; + cursor: pointer; + opacity: 0.5; + filter: alpha(opacity=50); +} +.sp-palette-container { + border: none; + float: none; + margin: 0; + padding: 5px 10px 0; +} +.sp-palette .sp-thumb-el, +.sp-palette .sp-thumb-el:hover { + border: 1px solid rgba(0, 0, 0, 0.9); +} +.sp-palette .sp-thumb-el:hover, +.sp-palette .sp-thumb-el.sp-thumb-active { + border-color: rgba(0, 0, 0, 0.9); } diff --git a/modules/backend/formwidgets/colorpicker/assets/js/colorpicker.js b/modules/backend/formwidgets/colorpicker/assets/js/colorpicker.js index 812ee16..fb72568 100644 --- a/modules/backend/formwidgets/colorpicker/assets/js/colorpicker.js +++ b/modules/backend/formwidgets/colorpicker/assets/js/colorpicker.js @@ -26,6 +26,8 @@ } ColorPicker.DEFAULTS = { + showAlpha: false, + allowEmpty: false, dataLocker: null } @@ -34,31 +36,52 @@ this.$dataLocker = $(this.options.dataLocker, this.$el) this.$colorList = $('>ul', this.$el) this.$customColor = $('[data-custom-color]', this.$el) + this.$customColorSpan = $('>span', this.$customColor) + this.originalColor = this.$customColor.data('hexColor') this.$colorList.on('click', '>li', function(){ self.selectColor(this) + self.$dataLocker.trigger('change') }) /* * Custom color */ if (this.$customColor.length) { - this.$customColor.colpick({ - layout: 'hex', - submit: 0, + this.$customColor.spectrum({ + preferredFormat: 'hex', + showInput: true, + showAlpha: this.options.showAlpha, + allowEmpty: this.options.allowEmpty, color: this.$customColor.data('hexColor'), - onShow: function(cal) { - var el = $(cal).data('colpick').el - self.selectColor(el) + chooseText: $.oc.lang.get('colorpicker.choose', 'Ok'), + cancelText: '⨯', + hide: function(color) { + var hex = color ? color.toHexString() : '' + self.$customColorSpan.css('background', hex) }, - onChange: function(hsb, hex, rgb, el, bySetColor) { - $('>span', el).css('background', '#'+hex) - $(el).data('hexColor', '#'+hex) - self.setColor('#'+hex) + show: function(color) { + self.selectColor(self.$customColor) + }, + move: function(color) { + var hex = color ? color.toHexString() : '' + self.$customColorSpan.css('background', hex) + }, + change: function(color) { + var hex = color ? color.toHexString() : '' + self.setCustomColor(hex) } }) } + } + + ColorPicker.prototype.setCustomColor = function(hexColor) { + if (this.$customColor.length) { + this.$customColor.data('hexColor', hexColor) + this.$customColor.spectrum('set', hexColor) + } + this.setColor(hexColor) } ColorPicker.prototype.setColor = function(hexColor) { @@ -111,4 +134,4 @@ $('[data-control="colorpicker"]').colorPicker() }) -}(window.jQuery); \ No newline at end of file +}(window.jQuery); diff --git a/modules/backend/formwidgets/colorpicker/assets/less/colorpicker.less b/modules/backend/formwidgets/colorpicker/assets/less/colorpicker.less index 9072450..b64dca6 100644 --- a/modules/backend/formwidgets/colorpicker/assets/less/colorpicker.less +++ b/modules/backend/formwidgets/colorpicker/assets/less/colorpicker.less @@ -71,9 +71,118 @@ } -.colpick { +// +// Spectrum +// + +.sp-hue, .sp-slider { cursor: row-resize } +.sp-color, .sp-dragger { cursor: crosshair } +.sp-alpha-inner, .sp-alpha-handle { cursor: col-resize } + +.sp-hue { left: 90%; } +.sp-color { right: 15%; } + +.sp-container { border: none; border-radius: @border-radius-base; z-index: @zindex-datepicker; .box-shadow(@overlay-box-shadow); + font-family: @font-family-base; +} + +.sp-picker-container { + border: none; +} + +.sp-alpha-handle { + background-color: #ccc; + border: 1px solid #666; + width: 4px; +} + +.sp-color, .sp-hue { + border: 1px solid #ccc; +} + +.sp-slider { + background-color: #ccc; + border: 1px solid #666; + height: 3px; + left: -4px; + width: 22px; +} +.sp-dragger { + background:transparent; + box-shadow: 0 0 0 1px #111; +} + +.sp-input { + outline: none !important; + -webkit-appearance: none; + border: 1px solid @input-border; + .box-shadow(@input-box-shadow); + .border-radius(@input-border-radius); + + &:focus { + border: 1px solid @color-form-field-border-focus; + } +} + +.sp-button-container { + width: 100%; + position: relative; + text-align: right; + padding-top: 4px; +} + +.sp-container button, +.sp-container button:hover, +.sp-container button:active { + text-shadow: none; + font-size: @font-size-base - 1; + text-align: left; + outline: none !important; + font-weight: @btn-font-weight; + .box-shadow(~"inset 0 -2px 0 rgba(0,0,0,.15)"); + border: 1px solid transparent; + .button-variant(@btn-default-color; @btn-default-bg; @btn-default-border; @btn-primary-bg; @btn-primary-bg); + .button-size(@padding-xs-vertical; @padding-xs-horizontal; @font-size-small; @line-height-small; @border-radius-small); +} + +.sp-cancel { + bottom: -3px; + left: 0; + position: absolute; + text-decoration: none; + + font-family: serif; + font-size: (@font-size-base * 1.5); + font-weight: @close-font-weight; + line-height: 1; + color: @close-color !important; + text-shadow: @close-text-shadow; + .opacity(.2); + + &:hover, + &:focus { + text-decoration: none; + cursor: pointer; + .opacity(.5); + } +} + +.sp-palette-container { + border: none; + float: none; + margin: 0; + padding: 5px 10px 0; +} +.sp-palette .sp-thumb-el, +.sp-palette .sp-thumb-el:hover { + border: 1px solid rgba(0, 0, 0, 0.9); +} + +.sp-palette .sp-thumb-el:hover, +.sp-palette .sp-thumb-el.sp-thumb-active { + border-color: rgba(0, 0, 0, 0.9); } diff --git a/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/LICENSE b/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/LICENSE new file mode 100644 index 0000000..212de3c --- /dev/null +++ b/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/LICENSE @@ -0,0 +1,18 @@ +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/README.md b/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/README.md new file mode 100644 index 0000000..0de67ec --- /dev/null +++ b/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/README.md @@ -0,0 +1,69 @@ +# Spectrum +## The No Hassle Colorpicker + +See the demo and docs: http://bgrins.github.io/spectrum. + +I wanted a colorpicker that didn't require images, and that had an API that made sense to me as a developer who has worked with color in a number of applications. I had tried a number of existing plugins, but decided to try and make a smaller, simpler one. + +I started using canvas, then switched to CSS gradients, since it turned out to be easier to manage, and provided better cross browser support. + +### Basic Usage + +Head over to the [docs](http://bgrins.github.io/spectrum) for more information. There is a visual demo of the different options hosted at: http://bgrins.github.io/spectrum. + + + + + + + + +### npm + +Spectrum is registered as package with npm. It can be installed with: + + npm install spectrum-colorpicker + +### Bower + +Spectrum is registered as a package with [Bower](http://bower.io/), so it can be pulled down using: + + bower install spectrum + +### Using spectrum with a CDN + +CDN provided by [cdnjs](https://cdnjs.com/libraries/spectrum) + + + + +### Continuous Integration + +[![Build Status](https://secure.travis-ci.org/bgrins/spectrum.png?branch=master)](http://travis-ci.org/bgrins/spectrum) + +Visit https://travis-ci.org/bgrins/spectrum to view the status of the automated tests. + +### Building Spectrum Locally + +If you'd like to download and use the plugin, head over to http://bgrins.github.io/spectrum/ and click the 'Download Zip' button. + +If you'd like to run the development version, spectrum uses Grunt to automate the testing, linting, and building. Head over to http://gruntjs.com/getting-started for more information. First, clone the repository, then run: + + npm install -g grunt-cli + npm install + + # runs jshint and the unit test suite + grunt + + # runs jshint, the unit test suite, and builds a minified version of the file. + grunt build + +### Internationalization + +If you are able to translate the text in the UI to another language, please do! You can do so by either [filing a pull request](https://github.com/bgrins/spectrum/pulls) or [opening an issue]( https://github.com/bgrins/spectrum/issues) with the translation. The existing languages are listed at: https://github.com/bgrins/spectrum/tree/master/i18n. + +For an example, see the [Dutch translation](i18n/jquery.spectrum-nl.js). diff --git a/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/spectrum.css b/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/spectrum.css new file mode 100644 index 0000000..a8ad9e4 --- /dev/null +++ b/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/spectrum.css @@ -0,0 +1,507 @@ +/*** +Spectrum Colorpicker v1.8.0 +https://github.com/bgrins/spectrum +Author: Brian Grinstead +License: MIT +***/ + +.sp-container { + position:absolute; + top:0; + left:0; + display:inline-block; + *display: inline; + *zoom: 1; + /* https://github.com/bgrins/spectrum/issues/40 */ + z-index: 9999994; + overflow: hidden; +} +.sp-container.sp-flat { + position: relative; +} + +/* Fix for * { box-sizing: border-box; } */ +.sp-container, +.sp-container * { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +/* http://ansciath.tumblr.com/post/7347495869/css-aspect-ratio */ +.sp-top { + position:relative; + width: 100%; + display:inline-block; +} +.sp-top-inner { + position:absolute; + top:0; + left:0; + bottom:0; + right:0; +} +.sp-color { + position: absolute; + top:0; + left:0; + bottom:0; + right:20%; +} +.sp-hue { + position: absolute; + top:0; + right:0; + bottom:0; + left:84%; + height: 100%; +} + +.sp-clear-enabled .sp-hue { + top:33px; + height: 77.5%; +} + +.sp-fill { + padding-top: 80%; +} +.sp-sat, .sp-val { + position: absolute; + top:0; + left:0; + right:0; + bottom:0; +} + +.sp-alpha-enabled .sp-top { + margin-bottom: 18px; +} +.sp-alpha-enabled .sp-alpha { + display: block; +} +.sp-alpha-handle { + position:absolute; + top:-4px; + bottom: -4px; + width: 6px; + left: 50%; + cursor: pointer; + border: 1px solid black; + background: white; + opacity: .8; +} +.sp-alpha { + display: none; + position: absolute; + bottom: -14px; + right: 0; + left: 0; + height: 8px; +} +.sp-alpha-inner { + border: solid 1px #333; +} + +.sp-clear { + display: none; +} + +.sp-clear.sp-clear-display { + background-position: center; +} + +.sp-clear-enabled .sp-clear { + display: block; + position:absolute; + top:0px; + right:0; + bottom:0; + left:84%; + height: 28px; +} + +/* Don't allow text selection */ +.sp-container, .sp-replacer, .sp-preview, .sp-dragger, .sp-slider, .sp-alpha, .sp-clear, .sp-alpha-handle, .sp-container.sp-dragging .sp-input, .sp-container button { + -webkit-user-select:none; + -moz-user-select: -moz-none; + -o-user-select:none; + user-select: none; +} + +.sp-container.sp-input-disabled .sp-input-container { + display: none; +} +.sp-container.sp-buttons-disabled .sp-button-container { + display: none; +} +.sp-container.sp-palette-buttons-disabled .sp-palette-button-container { + display: none; +} +.sp-palette-only .sp-picker-container { + display: none; +} +.sp-palette-disabled .sp-palette-container { + display: none; +} + +.sp-initial-disabled .sp-initial { + display: none; +} + + +/* Gradients for hue, saturation and value instead of images. Not pretty... but it works */ +.sp-sat { + background-image: -webkit-gradient(linear, 0 0, 100% 0, from(#FFF), to(rgba(204, 154, 129, 0))); + background-image: -webkit-linear-gradient(left, #FFF, rgba(204, 154, 129, 0)); + background-image: -moz-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); + background-image: -o-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); + background-image: -ms-linear-gradient(left, #fff, rgba(204, 154, 129, 0)); + background-image: linear-gradient(to right, #fff, rgba(204, 154, 129, 0)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)"; + filter : progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81'); +} +.sp-val { + background-image: -webkit-gradient(linear, 0 100%, 0 0, from(#000000), to(rgba(204, 154, 129, 0))); + background-image: -webkit-linear-gradient(bottom, #000000, rgba(204, 154, 129, 0)); + background-image: -moz-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); + background-image: -o-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); + background-image: -ms-linear-gradient(bottom, #000, rgba(204, 154, 129, 0)); + background-image: linear-gradient(to top, #000, rgba(204, 154, 129, 0)); + -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)"; + filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000'); +} + +.sp-hue { + background: -moz-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); + background: -ms-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); + background: -o-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); + background: -webkit-gradient(linear, left top, left bottom, from(#ff0000), color-stop(0.17, #ffff00), color-stop(0.33, #00ff00), color-stop(0.5, #00ffff), color-stop(0.67, #0000ff), color-stop(0.83, #ff00ff), to(#ff0000)); + background: -webkit-linear-gradient(top, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); + background: linear-gradient(to bottom, #ff0000 0%, #ffff00 17%, #00ff00 33%, #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%); +} + +/* IE filters do not support multiple color stops. + Generate 6 divs, line them up, and do two color gradients for each. + Yes, really. + */ +.sp-1 { + height:17%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00'); +} +.sp-2 { + height:16%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00'); +} +.sp-3 { + height:17%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff'); +} +.sp-4 { + height:17%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff'); +} +.sp-5 { + height:16%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff'); +} +.sp-6 { + height:17%; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000'); +} + +.sp-hidden { + display: none !important; +} + +/* Clearfix hack */ +.sp-cf:before, .sp-cf:after { content: ""; display: table; } +.sp-cf:after { clear: both; } +.sp-cf { *zoom: 1; } + +/* Mobile devices, make hue slider bigger so it is easier to slide */ +@media (max-device-width: 480px) { + .sp-color { right: 40%; } + .sp-hue { left: 63%; } + .sp-fill { padding-top: 60%; } +} +.sp-dragger { + border-radius: 5px; + height: 5px; + width: 5px; + border: 1px solid #fff; + background: #000; + cursor: pointer; + position:absolute; + top:0; + left: 0; +} +.sp-slider { + position: absolute; + top:0; + cursor:pointer; + height: 3px; + left: -1px; + right: -1px; + border: 1px solid #000; + background: white; + opacity: .8; +} + +/* +Theme authors: +Here are the basic themeable display options (colors, fonts, global widths). +See http://bgrins.github.io/spectrum/themes/ for instructions. +*/ + +.sp-container { + border-radius: 0; + background-color: #ECECEC; + border: solid 1px #f0c49B; + padding: 0; +} +.sp-container, .sp-container button, .sp-container input, .sp-color, .sp-hue, .sp-clear { + font: normal 12px "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Geneva, Verdana, sans-serif; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; +} +.sp-top { + margin-bottom: 3px; +} +.sp-color, .sp-hue, .sp-clear { + border: solid 1px #666; +} + +/* Input */ +.sp-input-container { + float:right; + width: 100px; + margin-bottom: 4px; +} +.sp-initial-disabled .sp-input-container { + width: 100%; +} +.sp-input { + font-size: 12px !important; + border: 1px inset; + padding: 4px 5px; + margin: 0; + width: 100%; + background:transparent; + border-radius: 3px; + color: #222; +} +.sp-input:focus { + border: 1px solid orange; +} +.sp-input.sp-validation-error { + border: 1px solid red; + background: #fdd; +} +.sp-picker-container , .sp-palette-container { + float:left; + position: relative; + padding: 10px; + padding-bottom: 300px; + margin-bottom: -290px; +} +.sp-picker-container { + width: 172px; + border-left: solid 1px #fff; +} + +/* Palettes */ +.sp-palette-container { + border-right: solid 1px #ccc; +} + +.sp-palette-only .sp-palette-container { + border: 0; +} + +.sp-palette .sp-thumb-el { + display: block; + position:relative; + float:left; + width: 24px; + height: 15px; + margin: 3px; + cursor: pointer; + border:solid 2px transparent; +} +.sp-palette .sp-thumb-el:hover, .sp-palette .sp-thumb-el.sp-thumb-active { + border-color: orange; +} +.sp-thumb-el { + position:relative; +} + +/* Initial */ +.sp-initial { + float: left; + border: solid 1px #333; +} +.sp-initial span { + width: 30px; + height: 25px; + border:none; + display:block; + float:left; + margin:0; +} + +.sp-initial .sp-clear-display { + background-position: center; +} + +/* Buttons */ +.sp-palette-button-container, +.sp-button-container { + float: right; +} + +/* Replacer (the little preview div that shows up instead of the ) */ +.sp-replacer { + margin:0; + overflow:hidden; + cursor:pointer; + padding: 4px; + display:inline-block; + *zoom: 1; + *display: inline; + border: solid 1px #91765d; + background: #eee; + color: #333; + vertical-align: middle; +} +.sp-replacer:hover, .sp-replacer.sp-active { + border-color: #F0C49B; + color: #111; +} +.sp-replacer.sp-disabled { + cursor:default; + border-color: silver; + color: silver; +} +.sp-dd { + padding: 2px 0; + height: 16px; + line-height: 16px; + float:left; + font-size:10px; +} +.sp-preview { + position:relative; + width:25px; + height: 20px; + border: solid 1px #222; + margin-right: 5px; + float:left; + z-index: 0; +} + +.sp-palette { + *width: 220px; + max-width: 220px; +} +.sp-palette .sp-thumb-el { + width:16px; + height: 16px; + margin:2px 1px; + border: solid 1px #d0d0d0; +} + +.sp-container { + padding-bottom:0; +} + + +/* Buttons: http://hellohappy.org/css3-buttons/ */ +.sp-container button { + background-color: #eeeeee; + background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc); + background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); + background-image: -ms-linear-gradient(top, #eeeeee, #cccccc); + background-image: -o-linear-gradient(top, #eeeeee, #cccccc); + background-image: linear-gradient(to bottom, #eeeeee, #cccccc); + border: 1px solid #ccc; + border-bottom: 1px solid #bbb; + border-radius: 3px; + color: #333; + font-size: 14px; + line-height: 1; + padding: 5px 4px; + text-align: center; + text-shadow: 0 1px 0 #eee; + vertical-align: middle; +} +.sp-container button:hover { + background-color: #dddddd; + background-image: -webkit-linear-gradient(top, #dddddd, #bbbbbb); + background-image: -moz-linear-gradient(top, #dddddd, #bbbbbb); + background-image: -ms-linear-gradient(top, #dddddd, #bbbbbb); + background-image: -o-linear-gradient(top, #dddddd, #bbbbbb); + background-image: linear-gradient(to bottom, #dddddd, #bbbbbb); + border: 1px solid #bbb; + border-bottom: 1px solid #999; + cursor: pointer; + text-shadow: 0 1px 0 #ddd; +} +.sp-container button:active { + border: 1px solid #aaa; + border-bottom: 1px solid #888; + -webkit-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee; + -moz-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee; + -ms-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee; + -o-box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee; + box-shadow: inset 0 0 5px 2px #aaaaaa, 0 1px 0 0 #eeeeee; +} +.sp-cancel { + font-size: 11px; + color: #d93f3f !important; + margin:0; + padding:2px; + margin-right: 5px; + vertical-align: middle; + text-decoration:none; + +} +.sp-cancel:hover { + color: #d93f3f !important; + text-decoration: underline; +} + + +.sp-palette span:hover, .sp-palette span.sp-thumb-active { + border-color: #000; +} + +.sp-preview, .sp-alpha, .sp-thumb-el { + position:relative; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==); +} +.sp-preview-inner, .sp-alpha-inner, .sp-thumb-inner { + display:block; + position:absolute; + top:0;left:0;bottom:0;right:0; +} + +.sp-palette .sp-thumb-inner { + background-position: 50% 50%; + background-repeat: no-repeat; +} + +.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=); +} + +.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=); +} + +.sp-clear-display { + background-repeat:no-repeat; + background-position: center; + background-image: url(data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAJmZmZ2dnZ6enqKioqOjo6SkpKWlpaampqenp6ioqKmpqaqqqqurq/Hx8fLy8vT09PX19ff39/j4+Pn5+fr6+vv7+wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAP8ALAAAAAAUABQAAAihAP9FoPCvoMGDBy08+EdhQAIJCCMybCDAAYUEARBAlFiQQoMABQhKUJBxY0SPICEYHBnggEmDKAuoPMjS5cGYMxHW3IiT478JJA8M/CjTZ0GgLRekNGpwAsYABHIypcAgQMsITDtWJYBR6NSqMico9cqR6tKfY7GeBCuVwlipDNmefAtTrkSzB1RaIAoXodsABiZAEFB06gIBWC1mLVgBa0AAOw==); +} diff --git a/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/spectrum.js b/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/spectrum.js new file mode 100644 index 0000000..7200978 --- /dev/null +++ b/modules/backend/formwidgets/colorpicker/assets/vendor/spectrum/spectrum.js @@ -0,0 +1,2323 @@ +// Spectrum Colorpicker v1.8.0 +// https://github.com/bgrins/spectrum +// Author: Brian Grinstead +// License: MIT + +(function (factory) { + "use strict"; + + if (typeof define === 'function' && define.amd) { // AMD + define(['jquery'], factory); + } + else if (typeof exports == "object" && typeof module == "object") { // CommonJS + module.exports = factory(require('jquery')); + } + else { // Browser + factory(jQuery); + } +})(function($, undefined) { + "use strict"; + + var defaultOpts = { + + // Callbacks + beforeShow: noop, + move: noop, + change: noop, + show: noop, + hide: noop, + + // Options + color: false, + flat: false, + showInput: false, + allowEmpty: false, + showButtons: true, + clickoutFiresChange: true, + showInitial: false, + showPalette: false, + showPaletteOnly: false, + hideAfterPaletteSelect: false, + togglePaletteOnly: false, + showSelectionPalette: true, + localStorageKey: false, + appendTo: "body", + maxSelectionSize: 7, + cancelText: "cancel", + chooseText: "choose", + togglePaletteMoreText: "more", + togglePaletteLessText: "less", + clearText: "Clear Color Selection", + noColorSelectedText: "No Color Selected", + preferredFormat: false, + className: "", // Deprecated - use containerClassName and replacerClassName instead. + containerClassName: "", + replacerClassName: "", + showAlpha: false, + theme: "sp-light", + palette: [["#ffffff", "#000000", "#ff0000", "#ff8000", "#ffff00", "#008000", "#0000ff", "#4b0082", "#9400d3"]], + selectionPalette: [], + disabled: false, + offset: null + }, + spectrums = [], + IE = !!/msie/i.exec( window.navigator.userAgent ), + rgbaSupport = (function() { + function contains( str, substr ) { + return !!~('' + str).indexOf(substr); + } + + var elem = document.createElement('div'); + var style = elem.style; + style.cssText = 'background-color:rgba(0,0,0,.5)'; + return contains(style.backgroundColor, 'rgba') || contains(style.backgroundColor, 'hsla'); + })(), + replaceInput = [ + "
    ", + "
    ", + "
    ", + "
    " + ].join(''), + markup = (function () { + + // IE does not support gradients with multiple stops, so we need to simulate + // that for the rainbow slider with 8 divs that each have a single gradient + var gradientFix = ""; + if (IE) { + for (var i = 1; i <= 6; i++) { + gradientFix += "
    "; + } + } + + return [ + "
    ", + "
    ", + "
    ", + "
    ", + "", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + gradientFix, + "
    ", + "
    ", + "
    ", + "
    ", + "
    ", + "", + "
    ", + "
    ", + "
    ", + "", + "", + "
    ", + "
    ", + "
    " + ].join(""); + })(); + + function paletteTemplate (p, color, className, opts) { + var html = []; + for (var i = 0; i < p.length; i++) { + var current = p[i]; + if(current) { + var tiny = tinycolor(current); + var c = tiny.toHsl().l < 0.5 ? "sp-thumb-el sp-thumb-dark" : "sp-thumb-el sp-thumb-light"; + c += (tinycolor.equals(color, current)) ? " sp-thumb-active" : ""; + var formattedString = tiny.toString(opts.preferredFormat || "rgb"); + var swatchStyle = rgbaSupport ? ("background-color:" + tiny.toRgbString()) : "filter:" + tiny.toFilter(); + html.push(''); + } else { + var cls = 'sp-clear-display'; + html.push($('
    ') + .append($('') + .attr('title', opts.noColorSelectedText) + ) + .html() + ); + } + } + return "
    " + html.join('') + "
    "; + } + + function hideAll() { + for (var i = 0; i < spectrums.length; i++) { + if (spectrums[i]) { + spectrums[i].hide(); + } + } + } + + function instanceOptions(o, callbackContext) { + var opts = $.extend({}, defaultOpts, o); + opts.callbacks = { + 'move': bind(opts.move, callbackContext), + 'change': bind(opts.change, callbackContext), + 'show': bind(opts.show, callbackContext), + 'hide': bind(opts.hide, callbackContext), + 'beforeShow': bind(opts.beforeShow, callbackContext) + }; + + return opts; + } + + function spectrum(element, o) { + + var opts = instanceOptions(o, element), + flat = opts.flat, + showSelectionPalette = opts.showSelectionPalette, + localStorageKey = opts.localStorageKey, + theme = opts.theme, + callbacks = opts.callbacks, + resize = throttle(reflow, 10), + visible = false, + isDragging = false, + dragWidth = 0, + dragHeight = 0, + dragHelperHeight = 0, + slideHeight = 0, + slideWidth = 0, + alphaWidth = 0, + alphaSlideHelperWidth = 0, + slideHelperHeight = 0, + currentHue = 0, + currentSaturation = 0, + currentValue = 0, + currentAlpha = 1, + palette = [], + paletteArray = [], + paletteLookup = {}, + selectionPalette = opts.selectionPalette.slice(0), + maxSelectionSize = opts.maxSelectionSize, + draggingClass = "sp-dragging", + shiftMovementDirection = null; + + var doc = element.ownerDocument, + body = doc.body, + boundElement = $(element), + disabled = false, + container = $(markup, doc).addClass(theme), + pickerContainer = container.find(".sp-picker-container"), + dragger = container.find(".sp-color"), + dragHelper = container.find(".sp-dragger"), + slider = container.find(".sp-hue"), + slideHelper = container.find(".sp-slider"), + alphaSliderInner = container.find(".sp-alpha-inner"), + alphaSlider = container.find(".sp-alpha"), + alphaSlideHelper = container.find(".sp-alpha-handle"), + textInput = container.find(".sp-input"), + paletteContainer = container.find(".sp-palette"), + initialColorContainer = container.find(".sp-initial"), + cancelButton = container.find(".sp-cancel"), + clearButton = container.find(".sp-clear"), + chooseButton = container.find(".sp-choose"), + toggleButton = container.find(".sp-palette-toggle"), + isInput = boundElement.is("input"), + isInputTypeColor = isInput && boundElement.attr("type") === "color" && inputTypeColorSupport(), + shouldReplace = isInput && !flat, + replacer = (shouldReplace) ? $(replaceInput).addClass(theme).addClass(opts.className).addClass(opts.replacerClassName) : $([]), + offsetElement = (shouldReplace) ? replacer : boundElement, + previewElement = replacer.find(".sp-preview-inner"), + initialColor = opts.color || (isInput && boundElement.val()), + colorOnShow = false, + currentPreferredFormat = opts.preferredFormat, + clickoutFiresChange = !opts.showButtons || opts.clickoutFiresChange, + isEmpty = !initialColor, + allowEmpty = opts.allowEmpty && !isInputTypeColor; + + function applyOptions() { + + if (opts.showPaletteOnly) { + opts.showPalette = true; + } + + toggleButton.text(opts.showPaletteOnly ? opts.togglePaletteMoreText : opts.togglePaletteLessText); + + if (opts.palette) { + palette = opts.palette.slice(0); + paletteArray = $.isArray(palette[0]) ? palette : [palette]; + paletteLookup = {}; + for (var i = 0; i < paletteArray.length; i++) { + for (var j = 0; j < paletteArray[i].length; j++) { + var rgb = tinycolor(paletteArray[i][j]).toRgbString(); + paletteLookup[rgb] = true; + } + } + } + + container.toggleClass("sp-flat", flat); + container.toggleClass("sp-input-disabled", !opts.showInput); + container.toggleClass("sp-alpha-enabled", opts.showAlpha); + container.toggleClass("sp-clear-enabled", allowEmpty); + container.toggleClass("sp-buttons-disabled", !opts.showButtons); + container.toggleClass("sp-palette-buttons-disabled", !opts.togglePaletteOnly); + container.toggleClass("sp-palette-disabled", !opts.showPalette); + container.toggleClass("sp-palette-only", opts.showPaletteOnly); + container.toggleClass("sp-initial-disabled", !opts.showInitial); + container.addClass(opts.className).addClass(opts.containerClassName); + + reflow(); + } + + function initialize() { + + if (IE) { + container.find("*:not(input)").attr("unselectable", "on"); + } + + applyOptions(); + + if (shouldReplace) { + boundElement.after(replacer).hide(); + } + + if (!allowEmpty) { + clearButton.hide(); + } + + if (flat) { + boundElement.after(container).hide(); + } + else { + + var appendTo = opts.appendTo === "parent" ? boundElement.parent() : $(opts.appendTo); + if (appendTo.length !== 1) { + appendTo = $("body"); + } + + appendTo.append(container); + } + + updateSelectionPaletteFromStorage(); + + offsetElement.bind("click.spectrum touchstart.spectrum", function (e) { + if (!disabled) { + toggle(); + } + + e.stopPropagation(); + + if (!$(e.target).is("input")) { + e.preventDefault(); + } + }); + + if(boundElement.is(":disabled") || (opts.disabled === true)) { + disable(); + } + + // Prevent clicks from bubbling up to document. This would cause it to be hidden. + container.click(stopPropagation); + + // Handle user typed input + textInput.change(setFromTextInput); + textInput.bind("paste", function () { + setTimeout(setFromTextInput, 1); + }); + textInput.keydown(function (e) { if (e.keyCode == 13) { setFromTextInput(); } }); + + cancelButton.text(opts.cancelText); + cancelButton.bind("click.spectrum", function (e) { + e.stopPropagation(); + e.preventDefault(); + revert(); + hide(); + }); + + clearButton.attr("title", opts.clearText); + clearButton.bind("click.spectrum", function (e) { + e.stopPropagation(); + e.preventDefault(); + isEmpty = true; + move(); + + if(flat) { + //for the flat style, this is a change event + updateOriginalInput(true); + } + }); + + chooseButton.text(opts.chooseText); + chooseButton.bind("click.spectrum", function (e) { + e.stopPropagation(); + e.preventDefault(); + + if (IE && textInput.is(":focus")) { + textInput.trigger('change'); + } + + if (isValid()) { + updateOriginalInput(true); + hide(); + } + }); + + toggleButton.text(opts.showPaletteOnly ? opts.togglePaletteMoreText : opts.togglePaletteLessText); + toggleButton.bind("click.spectrum", function (e) { + e.stopPropagation(); + e.preventDefault(); + + opts.showPaletteOnly = !opts.showPaletteOnly; + + // To make sure the Picker area is drawn on the right, next to the + // Palette area (and not below the palette), first move the Palette + // to the left to make space for the picker, plus 5px extra. + // The 'applyOptions' function puts the whole container back into place + // and takes care of the button-text and the sp-palette-only CSS class. + if (!opts.showPaletteOnly && !flat) { + container.css('left', '-=' + (pickerContainer.outerWidth(true) + 5)); + } + applyOptions(); + }); + + draggable(alphaSlider, function (dragX, dragY, e) { + currentAlpha = (dragX / alphaWidth); + isEmpty = false; + if (e.shiftKey) { + currentAlpha = Math.round(currentAlpha * 10) / 10; + } + + move(); + }, dragStart, dragStop); + + draggable(slider, function (dragX, dragY) { + currentHue = parseFloat(dragY / slideHeight); + isEmpty = false; + if (!opts.showAlpha) { + currentAlpha = 1; + } + move(); + }, dragStart, dragStop); + + draggable(dragger, function (dragX, dragY, e) { + + // shift+drag should snap the movement to either the x or y axis. + if (!e.shiftKey) { + shiftMovementDirection = null; + } + else if (!shiftMovementDirection) { + var oldDragX = currentSaturation * dragWidth; + var oldDragY = dragHeight - (currentValue * dragHeight); + var furtherFromX = Math.abs(dragX - oldDragX) > Math.abs(dragY - oldDragY); + + shiftMovementDirection = furtherFromX ? "x" : "y"; + } + + var setSaturation = !shiftMovementDirection || shiftMovementDirection === "x"; + var setValue = !shiftMovementDirection || shiftMovementDirection === "y"; + + if (setSaturation) { + currentSaturation = parseFloat(dragX / dragWidth); + } + if (setValue) { + currentValue = parseFloat((dragHeight - dragY) / dragHeight); + } + + isEmpty = false; + if (!opts.showAlpha) { + currentAlpha = 1; + } + + move(); + + }, dragStart, dragStop); + + if (!!initialColor) { + set(initialColor); + + // In case color was black - update the preview UI and set the format + // since the set function will not run (default color is black). + updateUI(); + currentPreferredFormat = opts.preferredFormat || tinycolor(initialColor).format; + + addColorToSelectionPalette(initialColor); + } + else { + updateUI(); + } + + if (flat) { + show(); + } + + function paletteElementClick(e) { + if (e.data && e.data.ignore) { + set($(e.target).closest(".sp-thumb-el").data("color")); + move(); + } + else { + set($(e.target).closest(".sp-thumb-el").data("color")); + move(); + updateOriginalInput(true); + if (opts.hideAfterPaletteSelect) { + hide(); + } + } + + return false; + } + + var paletteEvent = IE ? "mousedown.spectrum" : "click.spectrum touchstart.spectrum"; + paletteContainer.delegate(".sp-thumb-el", paletteEvent, paletteElementClick); + initialColorContainer.delegate(".sp-thumb-el:nth-child(1)", paletteEvent, { ignore: true }, paletteElementClick); + } + + function updateSelectionPaletteFromStorage() { + + if (localStorageKey && window.localStorage) { + + // Migrate old palettes over to new format. May want to remove this eventually. + try { + var oldPalette = window.localStorage[localStorageKey].split(",#"); + if (oldPalette.length > 1) { + delete window.localStorage[localStorageKey]; + $.each(oldPalette, function(i, c) { + addColorToSelectionPalette(c); + }); + } + } + catch(e) { } + + try { + selectionPalette = window.localStorage[localStorageKey].split(";"); + } + catch (e) { } + } + } + + function addColorToSelectionPalette(color) { + if (showSelectionPalette) { + var rgb = tinycolor(color).toRgbString(); + if (!paletteLookup[rgb] && $.inArray(rgb, selectionPalette) === -1) { + selectionPalette.push(rgb); + while(selectionPalette.length > maxSelectionSize) { + selectionPalette.shift(); + } + } + + if (localStorageKey && window.localStorage) { + try { + window.localStorage[localStorageKey] = selectionPalette.join(";"); + } + catch(e) { } + } + } + } + + function getUniqueSelectionPalette() { + var unique = []; + if (opts.showPalette) { + for (var i = 0; i < selectionPalette.length; i++) { + var rgb = tinycolor(selectionPalette[i]).toRgbString(); + + if (!paletteLookup[rgb]) { + unique.push(selectionPalette[i]); + } + } + } + + return unique.reverse().slice(0, opts.maxSelectionSize); + } + + function drawPalette() { + + var currentColor = get(); + + var html = $.map(paletteArray, function (palette, i) { + return paletteTemplate(palette, currentColor, "sp-palette-row sp-palette-row-" + i, opts); + }); + + updateSelectionPaletteFromStorage(); + + if (selectionPalette) { + html.push(paletteTemplate(getUniqueSelectionPalette(), currentColor, "sp-palette-row sp-palette-row-selection", opts)); + } + + paletteContainer.html(html.join("")); + } + + function drawInitial() { + if (opts.showInitial) { + var initial = colorOnShow; + var current = get(); + initialColorContainer.html(paletteTemplate([initial, current], current, "sp-palette-row-initial", opts)); + } + } + + function dragStart() { + if (dragHeight <= 0 || dragWidth <= 0 || slideHeight <= 0) { + reflow(); + } + isDragging = true; + container.addClass(draggingClass); + shiftMovementDirection = null; + boundElement.trigger('dragstart.spectrum', [ get() ]); + } + + function dragStop() { + isDragging = false; + container.removeClass(draggingClass); + boundElement.trigger('dragstop.spectrum', [ get() ]); + } + + function setFromTextInput() { + + var value = textInput.val(); + + if ((value === null || value === "") && allowEmpty) { + set(null); + updateOriginalInput(true); + } + else { + var tiny = tinycolor(value); + if (tiny.isValid()) { + set(tiny); + updateOriginalInput(true); + } + else { + textInput.addClass("sp-validation-error"); + } + } + } + + function toggle() { + if (visible) { + hide(); + } + else { + show(); + } + } + + function show() { + var event = $.Event('beforeShow.spectrum'); + + if (visible) { + reflow(); + return; + } + + boundElement.trigger(event, [ get() ]); + + if (callbacks.beforeShow(get()) === false || event.isDefaultPrevented()) { + return; + } + + hideAll(); + visible = true; + + $(doc).bind("keydown.spectrum", onkeydown); + $(doc).bind("click.spectrum", clickout); + $(window).bind("resize.spectrum", resize); + replacer.addClass("sp-active"); + container.removeClass("sp-hidden"); + + reflow(); + updateUI(); + + colorOnShow = get(); + + drawInitial(); + callbacks.show(colorOnShow); + boundElement.trigger('show.spectrum', [ colorOnShow ]); + } + + function onkeydown(e) { + // Close on ESC + if (e.keyCode === 27) { + hide(); + } + } + + function clickout(e) { + // Return on right click. + if (e.button == 2) { return; } + + // If a drag event was happening during the mouseup, don't hide + // on click. + if (isDragging) { return; } + + if (clickoutFiresChange) { + updateOriginalInput(true); + } + else { + revert(); + } + hide(); + } + + function hide() { + // Return if hiding is unnecessary + if (!visible || flat) { return; } + visible = false; + + $(doc).unbind("keydown.spectrum", onkeydown); + $(doc).unbind("click.spectrum", clickout); + $(window).unbind("resize.spectrum", resize); + + replacer.removeClass("sp-active"); + container.addClass("sp-hidden"); + + callbacks.hide(get()); + boundElement.trigger('hide.spectrum', [ get() ]); + } + + function revert() { + set(colorOnShow, true); + } + + function set(color, ignoreFormatChange) { + if (tinycolor.equals(color, get())) { + // Update UI just in case a validation error needs + // to be cleared. + updateUI(); + return; + } + + var newColor, newHsv; + if (!color && allowEmpty) { + isEmpty = true; + } else { + isEmpty = false; + newColor = tinycolor(color); + newHsv = newColor.toHsv(); + + currentHue = (newHsv.h % 360) / 360; + currentSaturation = newHsv.s; + currentValue = newHsv.v; + currentAlpha = newHsv.a; + } + updateUI(); + + if (newColor && newColor.isValid() && !ignoreFormatChange) { + currentPreferredFormat = opts.preferredFormat || newColor.getFormat(); + } + } + + function get(opts) { + opts = opts || { }; + + if (allowEmpty && isEmpty) { + return null; + } + + return tinycolor.fromRatio({ + h: currentHue, + s: currentSaturation, + v: currentValue, + a: Math.round(currentAlpha * 100) / 100 + }, { format: opts.format || currentPreferredFormat }); + } + + function isValid() { + return !textInput.hasClass("sp-validation-error"); + } + + function move() { + updateUI(); + + callbacks.move(get()); + boundElement.trigger('move.spectrum', [ get() ]); + } + + function updateUI() { + + textInput.removeClass("sp-validation-error"); + + updateHelperLocations(); + + // Update dragger background color (gradients take care of saturation and value). + var flatColor = tinycolor.fromRatio({ h: currentHue, s: 1, v: 1 }); + dragger.css("background-color", flatColor.toHexString()); + + // Get a format that alpha will be included in (hex and names ignore alpha) + var format = currentPreferredFormat; + if (currentAlpha < 1 && !(currentAlpha === 0 && format === "name")) { + if (format === "hex" || format === "hex3" || format === "hex6" || format === "name") { + format = "rgb"; + } + } + + var realColor = get({ format: format }), + displayColor = ''; + + //reset background info for preview element + previewElement.removeClass("sp-clear-display"); + previewElement.css('background-color', 'transparent'); + + if (!realColor && allowEmpty) { + // Update the replaced elements background with icon indicating no color selection + previewElement.addClass("sp-clear-display"); + } + else { + var realHex = realColor.toHexString(), + realRgb = realColor.toRgbString(); + + // Update the replaced elements background color (with actual selected color) + if (rgbaSupport || realColor.alpha === 1) { + previewElement.css("background-color", realRgb); + } + else { + previewElement.css("background-color", "transparent"); + previewElement.css("filter", realColor.toFilter()); + } + + if (opts.showAlpha) { + var rgb = realColor.toRgb(); + rgb.a = 0; + var realAlpha = tinycolor(rgb).toRgbString(); + var gradient = "linear-gradient(left, " + realAlpha + ", " + realHex + ")"; + + if (IE) { + alphaSliderInner.css("filter", tinycolor(realAlpha).toFilter({ gradientType: 1 }, realHex)); + } + else { + alphaSliderInner.css("background", "-webkit-" + gradient); + alphaSliderInner.css("background", "-moz-" + gradient); + alphaSliderInner.css("background", "-ms-" + gradient); + // Use current syntax gradient on unprefixed property. + alphaSliderInner.css("background", + "linear-gradient(to right, " + realAlpha + ", " + realHex + ")"); + } + } + + displayColor = realColor.toString(format); + } + + // Update the text entry input as it changes happen + if (opts.showInput) { + textInput.val(displayColor); + } + + if (opts.showPalette) { + drawPalette(); + } + + drawInitial(); + } + + function updateHelperLocations() { + var s = currentSaturation; + var v = currentValue; + + if(allowEmpty && isEmpty) { + //if selected color is empty, hide the helpers + alphaSlideHelper.hide(); + slideHelper.hide(); + dragHelper.hide(); + } + else { + //make sure helpers are visible + alphaSlideHelper.show(); + slideHelper.show(); + dragHelper.show(); + + // Where to show the little circle in that displays your current selected color + var dragX = s * dragWidth; + var dragY = dragHeight - (v * dragHeight); + dragX = Math.max( + -dragHelperHeight, + Math.min(dragWidth - dragHelperHeight, dragX - dragHelperHeight) + ); + dragY = Math.max( + -dragHelperHeight, + Math.min(dragHeight - dragHelperHeight, dragY - dragHelperHeight) + ); + dragHelper.css({ + "top": dragY + "px", + "left": dragX + "px" + }); + + var alphaX = currentAlpha * alphaWidth; + alphaSlideHelper.css({ + "left": (alphaX - (alphaSlideHelperWidth / 2)) + "px" + }); + + // Where to show the bar that displays your current selected hue + var slideY = (currentHue) * slideHeight; + slideHelper.css({ + "top": (slideY - slideHelperHeight) + "px" + }); + } + } + + function updateOriginalInput(fireCallback) { + var color = get(), + displayColor = '', + hasChanged = !tinycolor.equals(color, colorOnShow); + + if (color) { + displayColor = color.toString(currentPreferredFormat); + // Update the selection palette with the current color + addColorToSelectionPalette(color); + } + + if (isInput) { + boundElement.val(displayColor); + } + + if (fireCallback && hasChanged) { + callbacks.change(color); + boundElement.trigger('change', [ color ]); + } + } + + function reflow() { + if (!visible) { + return; // Calculations would be useless and wouldn't be reliable anyways + } + dragWidth = dragger.width(); + dragHeight = dragger.height(); + dragHelperHeight = dragHelper.height(); + slideWidth = slider.width(); + slideHeight = slider.height(); + slideHelperHeight = slideHelper.height(); + alphaWidth = alphaSlider.width(); + alphaSlideHelperWidth = alphaSlideHelper.width(); + + if (!flat) { + container.css("position", "absolute"); + if (opts.offset) { + container.offset(opts.offset); + } else { + container.offset(getOffset(container, offsetElement)); + } + } + + updateHelperLocations(); + + if (opts.showPalette) { + drawPalette(); + } + + boundElement.trigger('reflow.spectrum'); + } + + function destroy() { + boundElement.show(); + offsetElement.unbind("click.spectrum touchstart.spectrum"); + container.remove(); + replacer.remove(); + spectrums[spect.id] = null; + } + + function option(optionName, optionValue) { + if (optionName === undefined) { + return $.extend({}, opts); + } + if (optionValue === undefined) { + return opts[optionName]; + } + + opts[optionName] = optionValue; + + if (optionName === "preferredFormat") { + currentPreferredFormat = opts.preferredFormat; + } + applyOptions(); + } + + function enable() { + disabled = false; + boundElement.attr("disabled", false); + offsetElement.removeClass("sp-disabled"); + } + + function disable() { + hide(); + disabled = true; + boundElement.attr("disabled", true); + offsetElement.addClass("sp-disabled"); + } + + function setOffset(coord) { + opts.offset = coord; + reflow(); + } + + initialize(); + + var spect = { + show: show, + hide: hide, + toggle: toggle, + reflow: reflow, + option: option, + enable: enable, + disable: disable, + offset: setOffset, + set: function (c) { + set(c); + updateOriginalInput(); + }, + get: get, + destroy: destroy, + container: container + }; + + spect.id = spectrums.push(spect) - 1; + + return spect; + } + + /** + * checkOffset - get the offset below/above and left/right element depending on screen position + * Thanks https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.datepicker.js + */ + function getOffset(picker, input) { + var extraY = 0; + var dpWidth = picker.outerWidth(); + var dpHeight = picker.outerHeight(); + var inputHeight = input.outerHeight(); + var doc = picker[0].ownerDocument; + var docElem = doc.documentElement; + var viewWidth = docElem.clientWidth + $(doc).scrollLeft(); + var viewHeight = docElem.clientHeight + $(doc).scrollTop(); + var offset = input.offset(); + offset.top += inputHeight; + + offset.left -= + Math.min(offset.left, (offset.left + dpWidth > viewWidth && viewWidth > dpWidth) ? + Math.abs(offset.left + dpWidth - viewWidth) : 0); + + offset.top -= + Math.min(offset.top, ((offset.top + dpHeight > viewHeight && viewHeight > dpHeight) ? + Math.abs(dpHeight + inputHeight - extraY) : extraY)); + + return offset; + } + + /** + * noop - do nothing + */ + function noop() { + + } + + /** + * stopPropagation - makes the code only doing this a little easier to read in line + */ + function stopPropagation(e) { + e.stopPropagation(); + } + + /** + * Create a function bound to a given object + * Thanks to underscore.js + */ + function bind(func, obj) { + var slice = Array.prototype.slice; + var args = slice.call(arguments, 2); + return function () { + return func.apply(obj, args.concat(slice.call(arguments))); + }; + } + + /** + * Lightweight drag helper. Handles containment within the element, so that + * when dragging, the x is within [0,element.width] and y is within [0,element.height] + */ + function draggable(element, onmove, onstart, onstop) { + onmove = onmove || function () { }; + onstart = onstart || function () { }; + onstop = onstop || function () { }; + var doc = document; + var dragging = false; + var offset = {}; + var maxHeight = 0; + var maxWidth = 0; + var hasTouch = ('ontouchstart' in window); + + var duringDragEvents = {}; + duringDragEvents["selectstart"] = prevent; + duringDragEvents["dragstart"] = prevent; + duringDragEvents["touchmove mousemove"] = move; + duringDragEvents["touchend mouseup"] = stop; + + function prevent(e) { + if (e.stopPropagation) { + e.stopPropagation(); + } + if (e.preventDefault) { + e.preventDefault(); + } + e.returnValue = false; + } + + function move(e) { + if (dragging) { + // Mouseup happened outside of window + if (IE && doc.documentMode < 9 && !e.button) { + return stop(); + } + + var t0 = e.originalEvent && e.originalEvent.touches && e.originalEvent.touches[0]; + var pageX = t0 && t0.pageX || e.pageX; + var pageY = t0 && t0.pageY || e.pageY; + + var dragX = Math.max(0, Math.min(pageX - offset.left, maxWidth)); + var dragY = Math.max(0, Math.min(pageY - offset.top, maxHeight)); + + if (hasTouch) { + // Stop scrolling in iOS + prevent(e); + } + + onmove.apply(element, [dragX, dragY, e]); + } + } + + function start(e) { + var rightclick = (e.which) ? (e.which == 3) : (e.button == 2); + + if (!rightclick && !dragging) { + if (onstart.apply(element, arguments) !== false) { + dragging = true; + maxHeight = $(element).height(); + maxWidth = $(element).width(); + offset = $(element).offset(); + + $(doc).bind(duringDragEvents); + $(doc.body).addClass("sp-dragging"); + + move(e); + + prevent(e); + } + } + } + + function stop() { + if (dragging) { + $(doc).unbind(duringDragEvents); + $(doc.body).removeClass("sp-dragging"); + + // Wait a tick before notifying observers to allow the click event + // to fire in Chrome. + setTimeout(function() { + onstop.apply(element, arguments); + }, 0); + } + dragging = false; + } + + $(element).bind("touchstart mousedown", start); + } + + function throttle(func, wait, debounce) { + var timeout; + return function () { + var context = this, args = arguments; + var throttler = function () { + timeout = null; + func.apply(context, args); + }; + if (debounce) clearTimeout(timeout); + if (debounce || !timeout) timeout = setTimeout(throttler, wait); + }; + } + + function inputTypeColorSupport() { + return $.fn.spectrum.inputTypeColorSupport(); + } + + /** + * Define a jQuery plugin + */ + var dataID = "spectrum.id"; + $.fn.spectrum = function (opts, extra) { + + if (typeof opts == "string") { + + var returnValue = this; + var args = Array.prototype.slice.call( arguments, 1 ); + + this.each(function () { + var spect = spectrums[$(this).data(dataID)]; + if (spect) { + var method = spect[opts]; + if (!method) { + throw new Error( "Spectrum: no such method: '" + opts + "'" ); + } + + if (opts == "get") { + returnValue = spect.get(); + } + else if (opts == "container") { + returnValue = spect.container; + } + else if (opts == "option") { + returnValue = spect.option.apply(spect, args); + } + else if (opts == "destroy") { + spect.destroy(); + $(this).removeData(dataID); + } + else { + method.apply(spect, args); + } + } + }); + + return returnValue; + } + + // Initializing a new instance of spectrum + return this.spectrum("destroy").each(function () { + var options = $.extend({}, opts, $(this).data()); + var spect = spectrum(this, options); + $(this).data(dataID, spect.id); + }); + }; + + $.fn.spectrum.load = true; + $.fn.spectrum.loadOpts = {}; + $.fn.spectrum.draggable = draggable; + $.fn.spectrum.defaults = defaultOpts; + $.fn.spectrum.inputTypeColorSupport = function inputTypeColorSupport() { + if (typeof inputTypeColorSupport._cachedResult === "undefined") { + var colorInput = $("")[0]; // if color element is supported, value will default to not null + inputTypeColorSupport._cachedResult = colorInput.type === "color" && colorInput.value !== ""; + } + return inputTypeColorSupport._cachedResult; + }; + + $.spectrum = { }; + $.spectrum.localization = { }; + $.spectrum.palettes = { }; + + $.fn.spectrum.processNativeColorInputs = function () { + var colorInputs = $("input[type=color]"); + if (colorInputs.length && !inputTypeColorSupport()) { + colorInputs.spectrum({ + preferredFormat: "hex6" + }); + } + }; + + // TinyColor v1.1.2 + // https://github.com/bgrins/TinyColor + // Brian Grinstead, MIT License + + (function() { + + var trimLeft = /^[\s,#]+/, + trimRight = /\s+$/, + tinyCounter = 0, + math = Math, + mathRound = math.round, + mathMin = math.min, + mathMax = math.max, + mathRandom = math.random; + + var tinycolor = function(color, opts) { + + color = (color) ? color : ''; + opts = opts || { }; + + // If input is already a tinycolor, return itself + if (color instanceof tinycolor) { + return color; + } + // If we are called as a function, call using new instead + if (!(this instanceof tinycolor)) { + return new tinycolor(color, opts); + } + + var rgb = inputToRGB(color); + this._originalInput = color, + this._r = rgb.r, + this._g = rgb.g, + this._b = rgb.b, + this._a = rgb.a, + this._roundA = mathRound(100*this._a) / 100, + this._format = opts.format || rgb.format; + this._gradientType = opts.gradientType; + + // Don't let the range of [0,255] come back in [0,1]. + // Potentially lose a little bit of precision here, but will fix issues where + // .5 gets interpreted as half of the total, instead of half of 1 + // If it was supposed to be 128, this was already taken care of by `inputToRgb` + if (this._r < 1) { this._r = mathRound(this._r); } + if (this._g < 1) { this._g = mathRound(this._g); } + if (this._b < 1) { this._b = mathRound(this._b); } + + this._ok = rgb.ok; + this._tc_id = tinyCounter++; + }; + + tinycolor.prototype = { + isDark: function() { + return this.getBrightness() < 128; + }, + isLight: function() { + return !this.isDark(); + }, + isValid: function() { + return this._ok; + }, + getOriginalInput: function() { + return this._originalInput; + }, + getFormat: function() { + return this._format; + }, + getAlpha: function() { + return this._a; + }, + getBrightness: function() { + var rgb = this.toRgb(); + return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; + }, + setAlpha: function(value) { + this._a = boundAlpha(value); + this._roundA = mathRound(100*this._a) / 100; + return this; + }, + toHsv: function() { + var hsv = rgbToHsv(this._r, this._g, this._b); + return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; + }, + toHsvString: function() { + var hsv = rgbToHsv(this._r, this._g, this._b); + var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); + return (this._a == 1) ? + "hsv(" + h + ", " + s + "%, " + v + "%)" : + "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")"; + }, + toHsl: function() { + var hsl = rgbToHsl(this._r, this._g, this._b); + return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; + }, + toHslString: function() { + var hsl = rgbToHsl(this._r, this._g, this._b); + var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); + return (this._a == 1) ? + "hsl(" + h + ", " + s + "%, " + l + "%)" : + "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")"; + }, + toHex: function(allow3Char) { + return rgbToHex(this._r, this._g, this._b, allow3Char); + }, + toHexString: function(allow3Char) { + return '#' + this.toHex(allow3Char); + }, + toHex8: function() { + return rgbaToHex(this._r, this._g, this._b, this._a); + }, + toHex8String: function() { + return '#' + this.toHex8(); + }, + toRgb: function() { + return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; + }, + toRgbString: function() { + return (this._a == 1) ? + "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : + "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; + }, + toPercentageRgb: function() { + return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a }; + }, + toPercentageRgbString: function() { + return (this._a == 1) ? + "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : + "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; + }, + toName: function() { + if (this._a === 0) { + return "transparent"; + } + + if (this._a < 1) { + return false; + } + + return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; + }, + toFilter: function(secondColor) { + var hex8String = '#' + rgbaToHex(this._r, this._g, this._b, this._a); + var secondHex8String = hex8String; + var gradientType = this._gradientType ? "GradientType = 1, " : ""; + + if (secondColor) { + var s = tinycolor(secondColor); + secondHex8String = s.toHex8String(); + } + + return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; + }, + toString: function(format) { + var formatSet = !!format; + format = format || this._format; + + var formattedString = false; + var hasAlpha = this._a < 1 && this._a >= 0; + var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "name"); + + if (needsAlphaFormat) { + // Special case for "transparent", all other non-alpha formats + // will return rgba when there is transparency. + if (format === "name" && this._a === 0) { + return this.toName(); + } + return this.toRgbString(); + } + if (format === "rgb") { + formattedString = this.toRgbString(); + } + if (format === "prgb") { + formattedString = this.toPercentageRgbString(); + } + if (format === "hex" || format === "hex6") { + formattedString = this.toHexString(); + } + if (format === "hex3") { + formattedString = this.toHexString(true); + } + if (format === "hex8") { + formattedString = this.toHex8String(); + } + if (format === "name") { + formattedString = this.toName(); + } + if (format === "hsl") { + formattedString = this.toHslString(); + } + if (format === "hsv") { + formattedString = this.toHsvString(); + } + + return formattedString || this.toHexString(); + }, + + _applyModification: function(fn, args) { + var color = fn.apply(null, [this].concat([].slice.call(args))); + this._r = color._r; + this._g = color._g; + this._b = color._b; + this.setAlpha(color._a); + return this; + }, + lighten: function() { + return this._applyModification(lighten, arguments); + }, + brighten: function() { + return this._applyModification(brighten, arguments); + }, + darken: function() { + return this._applyModification(darken, arguments); + }, + desaturate: function() { + return this._applyModification(desaturate, arguments); + }, + saturate: function() { + return this._applyModification(saturate, arguments); + }, + greyscale: function() { + return this._applyModification(greyscale, arguments); + }, + spin: function() { + return this._applyModification(spin, arguments); + }, + + _applyCombination: function(fn, args) { + return fn.apply(null, [this].concat([].slice.call(args))); + }, + analogous: function() { + return this._applyCombination(analogous, arguments); + }, + complement: function() { + return this._applyCombination(complement, arguments); + }, + monochromatic: function() { + return this._applyCombination(monochromatic, arguments); + }, + splitcomplement: function() { + return this._applyCombination(splitcomplement, arguments); + }, + triad: function() { + return this._applyCombination(triad, arguments); + }, + tetrad: function() { + return this._applyCombination(tetrad, arguments); + } + }; + + // If input is an object, force 1 into "1.0" to handle ratios properly + // String input requires "1.0" as input, so 1 will be treated as 1 + tinycolor.fromRatio = function(color, opts) { + if (typeof color == "object") { + var newColor = {}; + for (var i in color) { + if (color.hasOwnProperty(i)) { + if (i === "a") { + newColor[i] = color[i]; + } + else { + newColor[i] = convertToPercentage(color[i]); + } + } + } + color = newColor; + } + + return tinycolor(color, opts); + }; + + // Given a string or object, convert that input to RGB + // Possible string inputs: + // + // "red" + // "#f00" or "f00" + // "#ff0000" or "ff0000" + // "#ff000000" or "ff000000" + // "rgb 255 0 0" or "rgb (255, 0, 0)" + // "rgb 1.0 0 0" or "rgb (1, 0, 0)" + // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" + // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" + // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" + // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" + // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" + // + function inputToRGB(color) { + + var rgb = { r: 0, g: 0, b: 0 }; + var a = 1; + var ok = false; + var format = false; + + if (typeof color == "string") { + color = stringInputToObject(color); + } + + if (typeof color == "object") { + if (color.hasOwnProperty("r") && color.hasOwnProperty("g") && color.hasOwnProperty("b")) { + rgb = rgbToRgb(color.r, color.g, color.b); + ok = true; + format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; + } + else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("v")) { + color.s = convertToPercentage(color.s); + color.v = convertToPercentage(color.v); + rgb = hsvToRgb(color.h, color.s, color.v); + ok = true; + format = "hsv"; + } + else if (color.hasOwnProperty("h") && color.hasOwnProperty("s") && color.hasOwnProperty("l")) { + color.s = convertToPercentage(color.s); + color.l = convertToPercentage(color.l); + rgb = hslToRgb(color.h, color.s, color.l); + ok = true; + format = "hsl"; + } + + if (color.hasOwnProperty("a")) { + a = color.a; + } + } + + a = boundAlpha(a); + + return { + ok: ok, + format: color.format || format, + r: mathMin(255, mathMax(rgb.r, 0)), + g: mathMin(255, mathMax(rgb.g, 0)), + b: mathMin(255, mathMax(rgb.b, 0)), + a: a + }; + } + + + // Conversion Functions + // -------------------- + + // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from: + // + + // `rgbToRgb` + // Handle bounds / percentage checking to conform to CSS color spec + // + // *Assumes:* r, g, b in [0, 255] or [0, 1] + // *Returns:* { r, g, b } in [0, 255] + function rgbToRgb(r, g, b){ + return { + r: bound01(r, 255) * 255, + g: bound01(g, 255) * 255, + b: bound01(b, 255) * 255 + }; + } + + // `rgbToHsl` + // Converts an RGB color value to HSL. + // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] + // *Returns:* { h, s, l } in [0,1] + function rgbToHsl(r, g, b) { + + r = bound01(r, 255); + g = bound01(g, 255); + b = bound01(b, 255); + + var max = mathMax(r, g, b), min = mathMin(r, g, b); + var h, s, l = (max + min) / 2; + + if(max == min) { + h = s = 0; // achromatic + } + else { + var d = max - min; + s = l > 0.5 ? d / (2 - max - min) : d / (max + min); + switch(max) { + case r: h = (g - b) / d + (g < b ? 6 : 0); break; + case g: h = (b - r) / d + 2; break; + case b: h = (r - g) / d + 4; break; + } + + h /= 6; + } + + return { h: h, s: s, l: l }; + } + + // `hslToRgb` + // Converts an HSL color value to RGB. + // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] + // *Returns:* { r, g, b } in the set [0, 255] + function hslToRgb(h, s, l) { + var r, g, b; + + h = bound01(h, 360); + s = bound01(s, 100); + l = bound01(l, 100); + + function hue2rgb(p, q, t) { + if(t < 0) t += 1; + if(t > 1) t -= 1; + if(t < 1/6) return p + (q - p) * 6 * t; + if(t < 1/2) return q; + if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; + return p; + } + + if(s === 0) { + r = g = b = l; // achromatic + } + else { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + r = hue2rgb(p, q, h + 1/3); + g = hue2rgb(p, q, h); + b = hue2rgb(p, q, h - 1/3); + } + + return { r: r * 255, g: g * 255, b: b * 255 }; + } + + // `rgbToHsv` + // Converts an RGB color value to HSV + // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] + // *Returns:* { h, s, v } in [0,1] + function rgbToHsv(r, g, b) { + + r = bound01(r, 255); + g = bound01(g, 255); + b = bound01(b, 255); + + var max = mathMax(r, g, b), min = mathMin(r, g, b); + var h, s, v = max; + + var d = max - min; + s = max === 0 ? 0 : d / max; + + if(max == min) { + h = 0; // achromatic + } + else { + switch(max) { + case r: h = (g - b) / d + (g < b ? 6 : 0); break; + case g: h = (b - r) / d + 2; break; + case b: h = (r - g) / d + 4; break; + } + h /= 6; + } + return { h: h, s: s, v: v }; + } + + // `hsvToRgb` + // Converts an HSV color value to RGB. + // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] + // *Returns:* { r, g, b } in the set [0, 255] + function hsvToRgb(h, s, v) { + + h = bound01(h, 360) * 6; + s = bound01(s, 100); + v = bound01(v, 100); + + var i = math.floor(h), + f = h - i, + p = v * (1 - s), + q = v * (1 - f * s), + t = v * (1 - (1 - f) * s), + mod = i % 6, + r = [v, q, p, p, t, v][mod], + g = [t, v, v, q, p, p][mod], + b = [p, p, t, v, v, q][mod]; + + return { r: r * 255, g: g * 255, b: b * 255 }; + } + + // `rgbToHex` + // Converts an RGB color to hex + // Assumes r, g, and b are contained in the set [0, 255] + // Returns a 3 or 6 character hex + function rgbToHex(r, g, b, allow3Char) { + + var hex = [ + pad2(mathRound(r).toString(16)), + pad2(mathRound(g).toString(16)), + pad2(mathRound(b).toString(16)) + ]; + + // Return a 3 character hex if possible + if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { + return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); + } + + return hex.join(""); + } + // `rgbaToHex` + // Converts an RGBA color plus alpha transparency to hex + // Assumes r, g, b and a are contained in the set [0, 255] + // Returns an 8 character hex + function rgbaToHex(r, g, b, a) { + + var hex = [ + pad2(convertDecimalToHex(a)), + pad2(mathRound(r).toString(16)), + pad2(mathRound(g).toString(16)), + pad2(mathRound(b).toString(16)) + ]; + + return hex.join(""); + } + + // `equals` + // Can be called with any tinycolor input + tinycolor.equals = function (color1, color2) { + if (!color1 || !color2) { return false; } + return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); + }; + tinycolor.random = function() { + return tinycolor.fromRatio({ + r: mathRandom(), + g: mathRandom(), + b: mathRandom() + }); + }; + + + // Modification Functions + // ---------------------- + // Thanks to less.js for some of the basics here + // + + function desaturate(color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var hsl = tinycolor(color).toHsl(); + hsl.s -= amount / 100; + hsl.s = clamp01(hsl.s); + return tinycolor(hsl); + } + + function saturate(color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var hsl = tinycolor(color).toHsl(); + hsl.s += amount / 100; + hsl.s = clamp01(hsl.s); + return tinycolor(hsl); + } + + function greyscale(color) { + return tinycolor(color).desaturate(100); + } + + function lighten (color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var hsl = tinycolor(color).toHsl(); + hsl.l += amount / 100; + hsl.l = clamp01(hsl.l); + return tinycolor(hsl); + } + + function brighten(color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var rgb = tinycolor(color).toRgb(); + rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100)))); + rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100)))); + rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100)))); + return tinycolor(rgb); + } + + function darken (color, amount) { + amount = (amount === 0) ? 0 : (amount || 10); + var hsl = tinycolor(color).toHsl(); + hsl.l -= amount / 100; + hsl.l = clamp01(hsl.l); + return tinycolor(hsl); + } + + // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue. + // Values outside of this range will be wrapped into this range. + function spin(color, amount) { + var hsl = tinycolor(color).toHsl(); + var hue = (mathRound(hsl.h) + amount) % 360; + hsl.h = hue < 0 ? 360 + hue : hue; + return tinycolor(hsl); + } + + // Combination Functions + // --------------------- + // Thanks to jQuery xColor for some of the ideas behind these + // + + function complement(color) { + var hsl = tinycolor(color).toHsl(); + hsl.h = (hsl.h + 180) % 360; + return tinycolor(hsl); + } + + function triad(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) + ]; + } + + function tetrad(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), + tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) + ]; + } + + function splitcomplement(color) { + var hsl = tinycolor(color).toHsl(); + var h = hsl.h; + return [ + tinycolor(color), + tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), + tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) + ]; + } + + function analogous(color, results, slices) { + results = results || 6; + slices = slices || 30; + + var hsl = tinycolor(color).toHsl(); + var part = 360 / slices; + var ret = [tinycolor(color)]; + + for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { + hsl.h = (hsl.h + part) % 360; + ret.push(tinycolor(hsl)); + } + return ret; + } + + function monochromatic(color, results) { + results = results || 6; + var hsv = tinycolor(color).toHsv(); + var h = hsv.h, s = hsv.s, v = hsv.v; + var ret = []; + var modification = 1 / results; + + while (results--) { + ret.push(tinycolor({ h: h, s: s, v: v})); + v = (v + modification) % 1; + } + + return ret; + } + + // Utility Functions + // --------------------- + + tinycolor.mix = function(color1, color2, amount) { + amount = (amount === 0) ? 0 : (amount || 50); + + var rgb1 = tinycolor(color1).toRgb(); + var rgb2 = tinycolor(color2).toRgb(); + + var p = amount / 100; + var w = p * 2 - 1; + var a = rgb2.a - rgb1.a; + + var w1; + + if (w * a == -1) { + w1 = w; + } else { + w1 = (w + a) / (1 + w * a); + } + + w1 = (w1 + 1) / 2; + + var w2 = 1 - w1; + + var rgba = { + r: rgb2.r * w1 + rgb1.r * w2, + g: rgb2.g * w1 + rgb1.g * w2, + b: rgb2.b * w1 + rgb1.b * w2, + a: rgb2.a * p + rgb1.a * (1 - p) + }; + + return tinycolor(rgba); + }; + + + // Readability Functions + // --------------------- + // + + // `readability` + // Analyze the 2 colors and returns an object with the following properties: + // `brightness`: difference in brightness between the two colors + // `color`: difference in color/hue between the two colors + tinycolor.readability = function(color1, color2) { + var c1 = tinycolor(color1); + var c2 = tinycolor(color2); + var rgb1 = c1.toRgb(); + var rgb2 = c2.toRgb(); + var brightnessA = c1.getBrightness(); + var brightnessB = c2.getBrightness(); + var colorDiff = ( + Math.max(rgb1.r, rgb2.r) - Math.min(rgb1.r, rgb2.r) + + Math.max(rgb1.g, rgb2.g) - Math.min(rgb1.g, rgb2.g) + + Math.max(rgb1.b, rgb2.b) - Math.min(rgb1.b, rgb2.b) + ); + + return { + brightness: Math.abs(brightnessA - brightnessB), + color: colorDiff + }; + }; + + // `readable` + // http://www.w3.org/TR/AERT#color-contrast + // Ensure that foreground and background color combinations provide sufficient contrast. + // *Example* + // tinycolor.isReadable("#000", "#111") => false + tinycolor.isReadable = function(color1, color2) { + var readability = tinycolor.readability(color1, color2); + return readability.brightness > 125 && readability.color > 500; + }; + + // `mostReadable` + // Given a base color and a list of possible foreground or background + // colors for that base, returns the most readable color. + // *Example* + // tinycolor.mostReadable("#123", ["#fff", "#000"]) => "#000" + tinycolor.mostReadable = function(baseColor, colorList) { + var bestColor = null; + var bestScore = 0; + var bestIsReadable = false; + for (var i=0; i < colorList.length; i++) { + + // We normalize both around the "acceptable" breaking point, + // but rank brightness constrast higher than hue. + + var readability = tinycolor.readability(baseColor, colorList[i]); + var readable = readability.brightness > 125 && readability.color > 500; + var score = 3 * (readability.brightness / 125) + (readability.color / 500); + + if ((readable && ! bestIsReadable) || + (readable && bestIsReadable && score > bestScore) || + ((! readable) && (! bestIsReadable) && score > bestScore)) { + bestIsReadable = readable; + bestScore = score; + bestColor = tinycolor(colorList[i]); + } + } + return bestColor; + }; + + + // Big List of Colors + // ------------------ + // + var names = tinycolor.names = { + aliceblue: "f0f8ff", + antiquewhite: "faebd7", + aqua: "0ff", + aquamarine: "7fffd4", + azure: "f0ffff", + beige: "f5f5dc", + bisque: "ffe4c4", + black: "000", + blanchedalmond: "ffebcd", + blue: "00f", + blueviolet: "8a2be2", + brown: "a52a2a", + burlywood: "deb887", + burntsienna: "ea7e5d", + cadetblue: "5f9ea0", + chartreuse: "7fff00", + chocolate: "d2691e", + coral: "ff7f50", + cornflowerblue: "6495ed", + cornsilk: "fff8dc", + crimson: "dc143c", + cyan: "0ff", + darkblue: "00008b", + darkcyan: "008b8b", + darkgoldenrod: "b8860b", + darkgray: "a9a9a9", + darkgreen: "006400", + darkgrey: "a9a9a9", + darkkhaki: "bdb76b", + darkmagenta: "8b008b", + darkolivegreen: "556b2f", + darkorange: "ff8c00", + darkorchid: "9932cc", + darkred: "8b0000", + darksalmon: "e9967a", + darkseagreen: "8fbc8f", + darkslateblue: "483d8b", + darkslategray: "2f4f4f", + darkslategrey: "2f4f4f", + darkturquoise: "00ced1", + darkviolet: "9400d3", + deeppink: "ff1493", + deepskyblue: "00bfff", + dimgray: "696969", + dimgrey: "696969", + dodgerblue: "1e90ff", + firebrick: "b22222", + floralwhite: "fffaf0", + forestgreen: "228b22", + fuchsia: "f0f", + gainsboro: "dcdcdc", + ghostwhite: "f8f8ff", + gold: "ffd700", + goldenrod: "daa520", + gray: "808080", + green: "008000", + greenyellow: "adff2f", + grey: "808080", + honeydew: "f0fff0", + hotpink: "ff69b4", + indianred: "cd5c5c", + indigo: "4b0082", + ivory: "fffff0", + khaki: "f0e68c", + lavender: "e6e6fa", + lavenderblush: "fff0f5", + lawngreen: "7cfc00", + lemonchiffon: "fffacd", + lightblue: "add8e6", + lightcoral: "f08080", + lightcyan: "e0ffff", + lightgoldenrodyellow: "fafad2", + lightgray: "d3d3d3", + lightgreen: "90ee90", + lightgrey: "d3d3d3", + lightpink: "ffb6c1", + lightsalmon: "ffa07a", + lightseagreen: "20b2aa", + lightskyblue: "87cefa", + lightslategray: "789", + lightslategrey: "789", + lightsteelblue: "b0c4de", + lightyellow: "ffffe0", + lime: "0f0", + limegreen: "32cd32", + linen: "faf0e6", + magenta: "f0f", + maroon: "800000", + mediumaquamarine: "66cdaa", + mediumblue: "0000cd", + mediumorchid: "ba55d3", + mediumpurple: "9370db", + mediumseagreen: "3cb371", + mediumslateblue: "7b68ee", + mediumspringgreen: "00fa9a", + mediumturquoise: "48d1cc", + mediumvioletred: "c71585", + midnightblue: "191970", + mintcream: "f5fffa", + mistyrose: "ffe4e1", + moccasin: "ffe4b5", + navajowhite: "ffdead", + navy: "000080", + oldlace: "fdf5e6", + olive: "808000", + olivedrab: "6b8e23", + orange: "ffa500", + orangered: "ff4500", + orchid: "da70d6", + palegoldenrod: "eee8aa", + palegreen: "98fb98", + paleturquoise: "afeeee", + palevioletred: "db7093", + papayawhip: "ffefd5", + peachpuff: "ffdab9", + peru: "cd853f", + pink: "ffc0cb", + plum: "dda0dd", + powderblue: "b0e0e6", + purple: "800080", + rebeccapurple: "663399", + red: "f00", + rosybrown: "bc8f8f", + royalblue: "4169e1", + saddlebrown: "8b4513", + salmon: "fa8072", + sandybrown: "f4a460", + seagreen: "2e8b57", + seashell: "fff5ee", + sienna: "a0522d", + silver: "c0c0c0", + skyblue: "87ceeb", + slateblue: "6a5acd", + slategray: "708090", + slategrey: "708090", + snow: "fffafa", + springgreen: "00ff7f", + steelblue: "4682b4", + tan: "d2b48c", + teal: "008080", + thistle: "d8bfd8", + tomato: "ff6347", + turquoise: "40e0d0", + violet: "ee82ee", + wheat: "f5deb3", + white: "fff", + whitesmoke: "f5f5f5", + yellow: "ff0", + yellowgreen: "9acd32" + }; + + // Make it easy to access colors via `hexNames[hex]` + var hexNames = tinycolor.hexNames = flip(names); + + + // Utilities + // --------- + + // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` + function flip(o) { + var flipped = { }; + for (var i in o) { + if (o.hasOwnProperty(i)) { + flipped[o[i]] = i; + } + } + return flipped; + } + + // Return a valid alpha value [0,1] with all invalid values being set to 1 + function boundAlpha(a) { + a = parseFloat(a); + + if (isNaN(a) || a < 0 || a > 1) { + a = 1; + } + + return a; + } + + // Take input from [0, n] and return it as [0, 1] + function bound01(n, max) { + if (isOnePointZero(n)) { n = "100%"; } + + var processPercent = isPercentage(n); + n = mathMin(max, mathMax(0, parseFloat(n))); + + // Automatically convert percentage into number + if (processPercent) { + n = parseInt(n * max, 10) / 100; + } + + // Handle floating point rounding errors + if ((math.abs(n - max) < 0.000001)) { + return 1; + } + + // Convert into [0, 1] range if it isn't already + return (n % max) / parseFloat(max); + } + + // Force a number between 0 and 1 + function clamp01(val) { + return mathMin(1, mathMax(0, val)); + } + + // Parse a base-16 hex value into a base-10 integer + function parseIntFromHex(val) { + return parseInt(val, 16); + } + + // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 + // + function isOnePointZero(n) { + return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; + } + + // Check to see if string passed in is a percentage + function isPercentage(n) { + return typeof n === "string" && n.indexOf('%') != -1; + } + + // Force a hex value to have 2 characters + function pad2(c) { + return c.length == 1 ? '0' + c : '' + c; + } + + // Replace a decimal with it's percentage value + function convertToPercentage(n) { + if (n <= 1) { + n = (n * 100) + "%"; + } + + return n; + } + + // Converts a decimal to a hex value + function convertDecimalToHex(d) { + return Math.round(parseFloat(d) * 255).toString(16); + } + // Converts a hex value to a decimal + function convertHexToDecimal(h) { + return (parseIntFromHex(h) / 255); + } + + var matchers = (function() { + + // + var CSS_INTEGER = "[-\\+]?\\d+%?"; + + // + var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; + + // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. + var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; + + // Actual matching. + // Parentheses and commas are optional, but not required. + // Whitespace can take the place of commas or opening paren + var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + + return { + rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), + rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), + hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), + hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), + hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), + hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), + hex3: /^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex6: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, + hex8: /^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ + }; + })(); + + // `stringInputToObject` + // Permissive string parsing. Take in a number of formats, and output an object + // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` + function stringInputToObject(color) { + + color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase(); + var named = false; + if (names[color]) { + color = names[color]; + named = true; + } + else if (color == 'transparent') { + return { r: 0, g: 0, b: 0, a: 0, format: "name" }; + } + + // Try to match string input using regular expressions. + // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] + // Just return an object and let the conversion functions handle that. + // This way the result will be the same whether the tinycolor is initialized with string or object. + var match; + if ((match = matchers.rgb.exec(color))) { + return { r: match[1], g: match[2], b: match[3] }; + } + if ((match = matchers.rgba.exec(color))) { + return { r: match[1], g: match[2], b: match[3], a: match[4] }; + } + if ((match = matchers.hsl.exec(color))) { + return { h: match[1], s: match[2], l: match[3] }; + } + if ((match = matchers.hsla.exec(color))) { + return { h: match[1], s: match[2], l: match[3], a: match[4] }; + } + if ((match = matchers.hsv.exec(color))) { + return { h: match[1], s: match[2], v: match[3] }; + } + if ((match = matchers.hsva.exec(color))) { + return { h: match[1], s: match[2], v: match[3], a: match[4] }; + } + if ((match = matchers.hex8.exec(color))) { + return { + a: convertHexToDecimal(match[1]), + r: parseIntFromHex(match[2]), + g: parseIntFromHex(match[3]), + b: parseIntFromHex(match[4]), + format: named ? "name" : "hex8" + }; + } + if ((match = matchers.hex6.exec(color))) { + return { + r: parseIntFromHex(match[1]), + g: parseIntFromHex(match[2]), + b: parseIntFromHex(match[3]), + format: named ? "name" : "hex" + }; + } + if ((match = matchers.hex3.exec(color))) { + return { + r: parseIntFromHex(match[1] + '' + match[1]), + g: parseIntFromHex(match[2] + '' + match[2]), + b: parseIntFromHex(match[3] + '' + match[3]), + format: named ? "name" : "hex" + }; + } + + return false; + } + + window.tinycolor = tinycolor; + })(); + + $(function () { + if ($.fn.spectrum.load) { + $.fn.spectrum.processNativeColorInputs(); + } + }); + +}); diff --git a/modules/backend/formwidgets/colorpicker/partials/_colorpicker.htm b/modules/backend/formwidgets/colorpicker/partials/_colorpicker.htm index 18ad301..9eb4d4e 100644 --- a/modules/backend/formwidgets/colorpicker/partials/_colorpicker.htm +++ b/modules/backend/formwidgets/colorpicker/partials/_colorpicker.htm @@ -5,6 +5,8 @@ id="getId() ?>" class="field-colorpicker" data-control="colorpicker" + data-show-alpha="" + data-allow-empty="" data-data-locker="#getId('input') ?>">
      @@ -31,4 +33,4 @@ value="" />
    - \ No newline at end of file + diff --git a/modules/backend/formwidgets/datepicker/partials/_datepicker.htm b/modules/backend/formwidgets/datepicker/partials/_datepicker.htm index cb80a81..090c9a0 100644 --- a/modules/backend/formwidgets/datepicker/partials/_datepicker.htm +++ b/modules/backend/formwidgets/datepicker/partials/_datepicker.htm @@ -13,6 +13,8 @@ data-format="" data-min-date="" data-max-date="" + data-year-range="" + data-first-day="" > diff --git a/modules/backend/formwidgets/fileupload/partials/_config_form.htm b/modules/backend/formwidgets/fileupload/partials/_config_form.htm index 733fcf0..621c516 100644 --- a/modules/backend/formwidgets/fileupload/partials/_config_form.htm +++ b/modules/backend/formwidgets/fileupload/partials/_config_form.htm @@ -28,7 +28,7 @@
    @@ -36,7 +36,7 @@ - \ No newline at end of file + diff --git a/modules/backend/widgets/reportcontainer/assets/css/reportcontainer.css b/modules/backend/widgets/reportcontainer/assets/css/reportcontainer.css index a1e1c9b..401799e 100644 --- a/modules/backend/widgets/reportcontainer/assets/css/reportcontainer.css +++ b/modules/backend/widgets/reportcontainer/assets/css/reportcontainer.css @@ -1,3 +1,6 @@ +.report-container { + margin-bottom: 15px; +} .report-container > ul { list-style: none; padding: 0; @@ -120,9 +123,9 @@ width: 100%; } .report-container > ul .item.dragged { - -webkit-transition-duration: 0!important; - -moz-transition-duration: 0!important; - transition-duration: 0!important; + -webkit-transition-duration: 0s !important; + -moz-transition-duration: 0s !important; + transition-duration: 0s !important; -webkit-transform: translate3d(0, 0, 0) !important; transform: translate3d(0, 0, 0) !important; position: absolute; @@ -152,7 +155,6 @@ -moz-border-radius: 3px; border-radius: 3px; margin-left: 5px; - margin-bottom: 15px; } .report-container .manage-widgets i { margin-right: 5px; diff --git a/modules/backend/widgets/reportcontainer/assets/less/reportcontainer.less b/modules/backend/widgets/reportcontainer/assets/less/reportcontainer.less index 57da059..28ba91a 100644 --- a/modules/backend/widgets/reportcontainer/assets/less/reportcontainer.less +++ b/modules/backend/widgets/reportcontainer/assets/less/reportcontainer.less @@ -1,6 +1,7 @@ @import "../../../../assets/less/core/boot.less"; .report-container { + margin-bottom: 15px; > ul { list-style: none; padding: 0; @@ -106,12 +107,8 @@ &.width-10 {width: 100%;} &.dragged { - -webkit-transition-duration: 0!important; - -moz-transition-duration: 0!important; - transition-duration: 0!important; - - .translate3d(0, 0, 0)!important; - + .transition-duration(0s) !important; + .translate3d(0, 0, 0) !important; position: absolute; opacity: 0.5; z-index: 2000; @@ -146,7 +143,6 @@ border: 1px dashed #bcc3c7; .border-radius(@border-radius-base); margin-left: 5px; - margin-bottom: 15px; i { margin-right: 5px; @@ -173,16 +169,11 @@ &.isotope, &.isotope .isotope-item { - -webkit-transition-duration: 0.8s; - -moz-transition-duration: 0.8s; - transition-duration: 0.8s; - + .transition-duration(0.8s); } &.isotope { - -webkit-transition-property: height, width; - -moz-transition-property: height, width; - transition-property: height, width; + .transition-property(height, width); } &.isotope .isotope-item { @@ -198,7 +189,7 @@ // The breakpoint should be defined in the CSS and JS, // otherwise some widgets can't calculate the width properly, // as the JS is applied too late. - width: 100%!important; + width: 100% !important; } } } \ No newline at end of file diff --git a/modules/backend/widgets/table/ClientMemoryDataSource.php b/modules/backend/widgets/table/ClientMemoryDataSource.php index cb1436f..790ca62 100644 --- a/modules/backend/widgets/table/ClientMemoryDataSource.php +++ b/modules/backend/widgets/table/ClientMemoryDataSource.php @@ -59,4 +59,4 @@ public function getAllRecords() { return $this->data; } -} \ No newline at end of file +} diff --git a/modules/backend/widgets/table/DataSourceBase.php b/modules/backend/widgets/table/DataSourceBase.php index 80bfcca..b404183 100644 --- a/modules/backend/widgets/table/DataSourceBase.php +++ b/modules/backend/widgets/table/DataSourceBase.php @@ -6,7 +6,7 @@ abstract class DataSourceBase { /** - * @var string Specifies a name of record's key column + * @var string Specifies a name of record's key column */ protected $keyColumn; @@ -53,6 +53,14 @@ abstract public function purge(); */ abstract public function getRecords($offset, $count); + /** + * Identical to getRecords except provided with a search query. + */ + public function searchRecords($query, $offset, $count) + { + return $this->getRecords($offset, $count); + } + /** * Rewinds the the data source to the first record. * Use this method with the readRecords() method. @@ -75,4 +83,4 @@ public function readRecords($count = 10) return $result; } -} \ No newline at end of file +} diff --git a/modules/backend/widgets/table/ServerEventDataSource.php b/modules/backend/widgets/table/ServerEventDataSource.php index 91862cb..cfc4006 100644 --- a/modules/backend/widgets/table/ServerEventDataSource.php +++ b/modules/backend/widgets/table/ServerEventDataSource.php @@ -19,6 +19,14 @@ public function getRecords($offset, $count) return $this->fireEvent('data.getRecords', [$offset, $count], true); } + /** + * Identical to getRecords except provided with a search query. + */ + public function searchRecords($query, $offset, $count) + { + return $this->fireEvent('data.searchRecords', [$query, $offset, $count], true); + } + /** * Returns a total number of records in the data source. * @return integer @@ -80,4 +88,4 @@ public function purge() public function getAllRecords() { } -} \ No newline at end of file +} diff --git a/modules/backend/widgets/table/assets/css/table.css b/modules/backend/widgets/table/assets/css/table.css index c52253e..c0682ee 100644 --- a/modules/backend/widgets/table/assets/css/table.css +++ b/modules/backend/widgets/table/assets/css/table.css @@ -72,16 +72,16 @@ padding: 1px; } .control-table table.data td.active { - border-color: #3498db !important; + border-color: #34495e !important; } .control-table table.data td.active .content-container { padding: 0; - border: 1px solid #3498db; + border: 1px solid #34495e; } .control-table table.data td.active .content-container:before, .control-table table.data td.active .content-container:after { content: ' '; - background: #3498db; + background: #34495e; position: absolute; left: -2px; top: -2px; @@ -150,6 +150,14 @@ opacity: 1; filter: alpha(opacity=100); } +.control-table .toolbar .table-search { + float: right; + margin: 3px 3px 0 0; +} +.control-table .toolbar .table-search .table-search-input { + height: auto; + padding: 5px 13px 5px; +} .control-table .toolbar a.table-icon:before { display: inline-block; content: ' '; @@ -158,8 +166,7 @@ margin-right: 8px; position: relative; top: 3px; - background: transparent url(../images/table-icons.gif) no-repeat; - background-position: 0 0; + background: transparent url(../images/table-icons.gif) no-repeat 0 0; background-size: 32px auto; } .control-table .toolbar a.table-icon.add-table-row-above:before { @@ -221,11 +228,21 @@ border: none; padding: 6px 10px 7px; } +html.chrome .control-table td[data-column-type=string] input[type=text], +html.chrome .control-table td[data-column-type=autocomplete] input[type=text] { + padding: 6px 10px 7px!important; +} +html.safari .control-table td[data-column-type=string] input[type=text], +html.gecko .control-table td[data-column-type=string] input[type=text], +html.safari .control-table td[data-column-type=autocomplete] input[type=text], +html.gecko .control-table td[data-column-type=autocomplete] input[type=text] { + padding: 5px 10px 5px; +} ul.table-widget-autocomplete { background: white; font-size: 13px; margin-top: 0; - border: 1px solid #e0e0e0; + border: 1px solid #808c8d; border-top: 1px solid #ecf0f1; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; @@ -270,7 +287,7 @@ ul.table-widget-autocomplete li a { top: -4px; } .control-table td[data-column-type=checkbox] div[data-checkbox-element]:focus { - border-color: #3498db; + border-color: #34495e; outline: none; } /* @@ -334,9 +351,8 @@ ul.table-widget-autocomplete li a { } /* Frameless control styles end */ html.cssanimations .control-table td[data-column-type=dropdown] [data-view-container].loading:after { - background-image: url('../../../../../../modules/system/assets/ui/images/loader-transparent.svg'); + background: url('../../../../../../modules/system/assets/ui/images/loader-transparent.svg') 50% 50%; background-size: 15px 15px; - background-position: 50% 50%; position: absolute; width: 15px; height: 15px; @@ -382,6 +398,6 @@ html.cssanimations .control-table td[data-column-type=dropdown] [data-view-conta .table-control-dropdown-list li:hover, .table-control-dropdown-list li:focus, .table-control-dropdown-list li.selected { - background: #3498db; + background: #34495e; color: white; } diff --git a/modules/backend/widgets/table/assets/js/build-min.js b/modules/backend/widgets/table/assets/js/build-min.js index fe1eb12..c952a6c 100644 --- a/modules/backend/widgets/table/assets/js/build-min.js +++ b/modules/backend/widgets/table/assets/js/build-min.js @@ -24,6 +24,7 @@ this.toolbarClickHandler=this.onToolbarClick.bind(this) if(this.options.postback&&this.options.clientDataSourceClass=='client') this.formSubmitHandler=this.onFormSubmit.bind(this) this.navigation=null +this.search=null this.recordsAddedOrDeleted=0 this.disposeBound=this.dispose.bind(this) this.init() @@ -31,6 +32,7 @@ $.oc.foundation.controlUtils.markDisposable(element)} Table.prototype.init=function(){this.createDataSource() this.initCellProcessors() this.navigation=new $.oc.table.helper.navigation(this) +this.search=new $.oc.table.helper.search(this) this.buildUi() this.registerHandlers()} Table.prototype.disposeCellProcessors=function(){for(var i=0,len=this.options.columns.length;i-1?this.options.fieldName+'[TableData]':this.options.fieldName+'TableData' data.options.data[fieldName]=this.dataSource.getAllData()}} Table.prototype.onToolbarClick=function(ev){var target=this.getEventTarget(ev),cmd=target.getAttribute('data-cmd') -if(!cmd) -return -switch(cmd){case'record-add-below':this.addRecord('below') +if(!cmd){return} +switch(cmd){case'record-add':case'record-add-below':this.addRecord('below') break case'record-add-above':this.addRecord('above') break @@ -397,7 +385,7 @@ if(dataContainer.value!=value){dataContainer.value=value this.markCellRowDirty(cellElement) this.notifyRowProcessorsOnChange(cellElement) if(suppressEvents===undefined||!suppressEvents){this.$el.trigger('oc.tableCellChanged',[this.getCellColumnName(cellElement),value,this.getCellRowIndex(cellElement)])}}} -Table.DEFAULTS={clientDataSourceClass:'client',keyColumn:'id',recordsPerPage:false,data:null,postback:true,postbackHandlerName:'onSave',adding:true,deleting:true,toolbar:true,rowSorting:false,height:false,dynamicHeight:false,btnAddRowLabel:'Add row',btnAddRowBelowLabel:'Add row below',btnDeleteRowLabel:'Delete row'} +Table.DEFAULTS={clientDataSourceClass:'client',keyColumn:'id',recordsPerPage:false,data:null,postback:true,postbackHandlerName:'onSave',adding:true,deleting:true,toolbar:true,searching:false,rowSorting:false,height:false,dynamicHeight:false} var old=$.fn.table $.fn.table=function(option){var args=Array.prototype.slice.call(arguments,1),result=undefined this.each(function(){var $this=$(this) @@ -561,11 +549,43 @@ this.gotoPage(pageIndex) this.tableObj.stopEvent(ev) return false} $.oc.table.helper.navigation=Navigation;}(window.jQuery);+function($){"use strict";if($.oc.table===undefined) +throw new Error("The $.oc.table namespace is not defined. Make sure that the table.js script is loaded.");if($.oc.table.helper===undefined) +$.oc.table.helper={} +var Search=function(tableObj){this.tableObj=tableObj +this.searchForm=null +this.searchInput=null +this.inputTrackTimer=null +this.activeQuery=null +this.isActive=false +this.init()};Search.prototype.init=function(){} +Search.prototype.dispose=function(){this.tableObj=null +this.searchForm=null +this.searchInput=null} +Search.prototype.buildSearchForm=function(){if(!this.searchEnabled()) +return +var el=this.tableObj.getElement(),toolbar=this.tableObj.getToolbar(),searchForm=toolbar.querySelector('.table-search') +if(!searchForm){this.searchForm=$($('[data-table-toolbar-search]',el).html()).appendTo(toolbar).get(0) +this.searchInput=$('.table-search-input',this.searchForm).get(0)}} +Search.prototype.getQuery=function(){return $.trim(this.activeQuery)} +Search.prototype.hasQuery=function(){return this.searchEnabled()&&$.trim(this.activeQuery).length>0} +Search.prototype.searchEnabled=function(){return this.tableObj.options.searching} +Search.prototype.performSearch=function(query,onSuccess){var isDirty=this.activeQuery!=query +this.activeQuery=query +if(isDirty){this.tableObj.updateDataTable(onSuccess)}} +Search.prototype.onKeydown=function(ev){if(ev.keyCode==9){this.onClick(ev) +return} +if(!this.isActive){return} +var self=this +this.inputTrackTimer=window.setTimeout(function(){self.performSearch(self.searchInput.value)},300)} +Search.prototype.onClick=function(ev){var target=this.tableObj.getEventTarget(ev,'INPUT') +this.isActive=target&&$(target).hasClass('table-search-input')} +$.oc.table.helper.search=Search;}(window.jQuery);+function($){"use strict";if($.oc.table===undefined) throw new Error("The $.oc.table namespace is not defined. Make sure that the table.js script is loaded.");if($.oc.table.datasource===undefined) $.oc.table.datasource={} var Base=function(tableObj){this.tableObj=tableObj} Base.prototype.dispose=function(){this.tableObj=null} Base.prototype.getRecords=function(offset,count,onSuccess){onSuccess([])} +Base.prototype.searchRecords=function(query,offset,count,onSuccess){onSuccess([])} Base.prototype.createRecord=function(recordData,placement,relativeToKey,offset,count,onSuccess){onSuccess([],0)} Base.prototype.updateRecord=function(key,recordData){} Base.prototype.deleteRecord=function(key,newRecordData,offset,count,onSuccess){onSuccess([],0)} @@ -614,6 +634,8 @@ Server.prototype.dispose=function(){BaseProto.dispose.call(this) this.data=null} Server.prototype.getRecords=function(offset,count,onSuccess){var handlerName=this.tableObj.getAlias()+'::onServerGetRecords' this.tableObj.$el.request(handlerName,{data:{offset:offset,count:count}}).done(function(data){onSuccess(data.records,data.count)})} +Server.prototype.searchRecords=function(query,offset,count,onSuccess){var handlerName=this.tableObj.getAlias()+'::onServerSearchRecords' +this.tableObj.$el.request(handlerName,{data:{query:query,offset:offset,count:count}}).done(function(data){onSuccess(data.records,data.count)})} Server.prototype.createRecord=function(recordData,placement,relativeToKey,offset,count,onSuccess){var handlerName=this.tableObj.getAlias()+'::onServerCreateRecord' this.tableObj.$el.request(handlerName,{data:{recordData:recordData,placement:placement,relativeToKey:relativeToKey,offset:offset,count:count}}).done(function(data){onSuccess(data.records,data.count)})} Server.prototype.updateRecord=function(key,recordData){var handlerName=this.tableObj.getAlias()+'::onServerUpdateRecord' @@ -646,7 +668,7 @@ Base.prototype.isCellFocusable=function(){return true} Base.prototype.getCellContentContainer=function(cellElement){return cellElement.querySelector('.content-container')} Base.prototype.createViewContainer=function(cellContentContainer,value){var viewContainer=document.createElement('div') viewContainer.setAttribute('data-view-container','data-view-container') -viewContainer.textContent=value +viewContainer.textContent=value===undefined?'':value cellContentContainer.appendChild(viewContainer) return viewContainer} Base.prototype.getViewContainer=function(cellElement){return cellElement.querySelector('[data-view-container]')} diff --git a/modules/backend/widgets/table/assets/js/build.js b/modules/backend/widgets/table/assets/js/build.js index ab2e95d..7e1638d 100644 --- a/modules/backend/widgets/table/assets/js/build.js +++ b/modules/backend/widgets/table/assets/js/build.js @@ -9,6 +9,7 @@ =require table.js =require table.helper.navigation.js +=require table.helper.search.js =require table.datasource.base.js =require table.datasource.client.js =require table.datasource.server.js diff --git a/modules/backend/widgets/table/assets/js/table.datasource.base.js b/modules/backend/widgets/table/assets/js/table.datasource.base.js index 07d936e..07f1c02 100644 --- a/modules/backend/widgets/table/assets/js/table.datasource.base.js +++ b/modules/backend/widgets/table/assets/js/table.datasource.base.js @@ -39,6 +39,13 @@ onSuccess([]) } + /* + * Identical to getRecords except using a search query. + */ + Base.prototype.searchRecords = function(query, offset, count, onSuccess) { + onSuccess([]) + } + /* * Creates a record with the passed data and returns the updated page records * to the onSuccess callback function. diff --git a/modules/backend/widgets/table/assets/js/table.datasource.server.js b/modules/backend/widgets/table/assets/js/table.datasource.server.js index 860e360..acb9f5c 100644 --- a/modules/backend/widgets/table/assets/js/table.datasource.server.js +++ b/modules/backend/widgets/table/assets/js/table.datasource.server.js @@ -57,6 +57,22 @@ }) } + /* + * Identical to getRecords except using a search query. + */ + Server.prototype.searchRecords = function(query, offset, count, onSuccess) { + var handlerName = this.tableObj.getAlias()+'::onServerSearchRecords' + this.tableObj.$el.request(handlerName, { + data: { + query: query, + offset: offset, + count: count + } + }).done(function(data) { + onSuccess(data.records, data.count) + }) + } + /* * Creates a record with the passed data and returns the updated page records * to the onSuccess callback function. diff --git a/modules/backend/widgets/table/assets/js/table.helper.navigation.js b/modules/backend/widgets/table/assets/js/table.helper.navigation.js index 0483ba2..a062c21 100644 --- a/modules/backend/widgets/table/assets/js/table.helper.navigation.js +++ b/modules/backend/widgets/table/assets/js/table.helper.navigation.js @@ -231,7 +231,7 @@ if (this.pageIndex < this.pageCount - 1) { var self = this - this.gotoPage(this.pageIndex + 1, function navDownPageSuccess(){ + this.gotoPage(this.pageIndex + 1, function navDownPageSuccess() { self.focusCell('top', cellIndex) self = null }) @@ -421,4 +421,5 @@ } $.oc.table.helper.navigation = Navigation; -}(window.jQuery); \ No newline at end of file + +}(window.jQuery); diff --git a/modules/backend/widgets/table/assets/js/table.helper.search.js b/modules/backend/widgets/table/assets/js/table.helper.search.js new file mode 100644 index 0000000..16501a2 --- /dev/null +++ b/modules/backend/widgets/table/assets/js/table.helper.search.js @@ -0,0 +1,116 @@ +/* + * Search helper for the table widget. + * Implements searching within the table. + */ ++function ($) { "use strict"; + + // NAMESPACE CHECK + // ============================ + + if ($.oc.table === undefined) + throw new Error("The $.oc.table namespace is not defined. Make sure that the table.js script is loaded."); + + if ($.oc.table.helper === undefined) + $.oc.table.helper = {} + + // SEARCH CLASS DEFINITION + // ============================ + + var Search = function(tableObj) { + // Reference to the table object + this.tableObj = tableObj + + // The search form element + this.searchForm = null + this.searchInput = null + + // Timer used for tracking input changes + this.inputTrackTimer = null + + // Event handlers + + // Active search query + this.activeQuery = null + + this.isActive = false + + this.init() + }; + + Search.prototype.init = function() { + } + + Search.prototype.dispose = function() { + // Remove the reference to the table object + this.tableObj = null + this.searchForm = null + this.searchInput = null + } + + Search.prototype.buildSearchForm = function() { + if (!this.searchEnabled()) + return + + var el = this.tableObj.getElement(), + toolbar = this.tableObj.getToolbar(), + searchForm = toolbar.querySelector('.table-search') + + if (!searchForm) { + this.searchForm = $($('[data-table-toolbar-search]', el).html()).appendTo(toolbar).get(0) + this.searchInput = $('.table-search-input', this.searchForm).get(0) + } + } + + Search.prototype.getQuery = function() { + return $.trim(this.activeQuery) + } + + Search.prototype.hasQuery = function() { + return this.searchEnabled() && $.trim(this.activeQuery).length > 0 + } + + Search.prototype.searchEnabled = function() { + return this.tableObj.options.searching + } + + Search.prototype.performSearch = function(query, onSuccess) { + var isDirty = this.activeQuery != query + + this.activeQuery = query + + if (isDirty) { + this.tableObj.updateDataTable(onSuccess) + } + } + + // EVENT HANDLERS + // ============================ + + Search.prototype.onKeydown = function(ev) { + // The navigation object uses the table's keydown handler + // and doesn't register own handler. + + // Tab pressed + if (ev.keyCode == 9) { + this.onClick(ev) + return + } + + if (!this.isActive) { + return + } + + var self = this + this.inputTrackTimer = window.setTimeout(function() { + self.performSearch(self.searchInput.value) + }, 300) + } + + Search.prototype.onClick = function(ev) { + var target = this.tableObj.getEventTarget(ev, 'INPUT') + this.isActive = target && $(target).hasClass('table-search-input') + } + + $.oc.table.helper.search = Search; + +}(window.jQuery); diff --git a/modules/backend/widgets/table/assets/js/table.js b/modules/backend/widgets/table/assets/js/table.js index 791093f..2e89e0d 100644 --- a/modules/backend/widgets/table/assets/js/table.js +++ b/modules/backend/widgets/table/assets/js/table.js @@ -75,6 +75,9 @@ // Navigation helper this.navigation = null + // Search helper + this.search = null + // Number of records added or deleted during the session this.recordsAddedOrDeleted = 0 @@ -102,6 +105,7 @@ // Initialize helpers this.navigation = new $.oc.table.helper.navigation(this) + this.search = new $.oc.table.helper.search(this) // Create the UI this.buildUi() @@ -204,8 +208,9 @@ this.tableContainer.setAttribute('class', 'table-container') // Build the toolbar - if (this.options.toolbar) + if (this.options.toolbar) { this.buildToolbar() + } // Build the headers table this.tableContainer.appendChild(this.buildHeaderTable()) @@ -213,56 +218,42 @@ // Append the table container to the element this.el.insertBefore(this.tableContainer, this.el.children[0]) - if (!this.options.height) + if (!this.options.height) { this.dataTableContainer = this.tableContainer - else + } + else { this.dataTableContainer = this.buildScrollbar() + } // Build the data table this.updateDataTable() } Table.prototype.buildToolbar = function() { - if (!this.options.adding && !this.options.deleting) + if (!this.options.adding && !this.options.deleting) { return + } - this.toolbar = document.createElement('div') - this.toolbar.setAttribute('class', 'toolbar') - - if (this.options.adding) { - var addBelowButton = document.createElement('a') - addBelowButton.setAttribute('class', 'btn table-icon add-table-row-below') - addBelowButton.setAttribute('data-cmd', 'record-add-below') - this.toolbar.appendChild(addBelowButton) + this.toolbar = $($('[data-table-toolbar]', this.el).html()).appendTo(this.tableContainer).get(0) + if (!this.options.adding) { + $('[data-cmd^="record-add"]', this.toolbar).remove() + } + else { if (this.navigation.paginationEnabled() || !this.options.rowSorting) { // When the pagination is enabled, or sorting is disabled, // new records can only be added to the bottom of the - // table. - addBelowButton.textContent = this.options.btnAddRowLabel + // table, so just show the general "Add row" button. + $('[data-cmd=record-add-below], [data-cmd=record-add-above]', this.toolbar).remove() } else { - addBelowButton.textContent = this.options.btnAddRowBelowLabel - - var addAboveButton = document.createElement('a') - addAboveButton.setAttribute('class', 'btn table-icon add-table-row-above') - addAboveButton.textContent = 'Add row above' - addAboveButton.setAttribute('data-cmd', 'record-add-above') - this.toolbar.appendChild(addAboveButton) + $('[data-cmd=record-add]', this.toolbar).remove() } } - if (this.options.deleting) { - var deleteButton = document.createElement('a') - - deleteButton.setAttribute('class', 'btn table-icon delete-table-row') - deleteButton.textContent = this.options.btnDeleteRowLabel - - deleteButton.setAttribute('data-cmd', 'record-delete') - this.toolbar.appendChild(deleteButton) + if (!this.options.deleting) { + $('[data-cmd="record-delete"]', this.toolbar).remove() } - - this.tableContainer.appendChild(this.toolbar) } Table.prototype.buildScrollbar = function() { @@ -314,7 +305,6 @@ this.unfocusTable() - this.fetchRecords(function onUpdateDataTableSuccess(records, totalCount) { self.buildDataTable(records, totalCount) @@ -402,6 +392,9 @@ // Update the pagination links this.navigation.buildPagination(totalCount) + + // Update the search form + this.search.buildSearchForm() } Table.prototype.formatDataContainerValue = function(value) { @@ -417,11 +410,21 @@ } Table.prototype.fetchRecords = function(onSuccess) { - this.dataSource.getRecords( - this.navigation.getPageFirstRowOffset(), - this.options.recordsPerPage, - onSuccess - ) + if (this.search.hasQuery()) { + this.dataSource.searchRecords( + this.search.getQuery(), + this.navigation.getPageFirstRowOffset(), + this.options.recordsPerPage, + onSuccess + ) + } + else { + this.dataSource.getRecords( + this.navigation.getPageFirstRowOffset(), + this.options.recordsPerPage, + onSuccess + ) + } } Table.prototype.updateScrollbar = function() { @@ -728,6 +731,9 @@ if (this.navigation.onClick(ev) === false) return + if (this.search.onClick(ev) === false) + return + for (var i = 0, len = this.options.columns.length; i < len; i++) { var column = this.options.columns[i].key @@ -750,7 +756,8 @@ if (!ev.shiftKey) { // alt+a - add record below this.addRecord('below') - } else { + } + else { // alt+shift+a - add record above this.addRecord('above') } @@ -773,8 +780,13 @@ this.cellProcessors[column].onKeyDown(ev) } - if (this.navigation.onKeydown(ev) === false) + if (this.navigation.onKeydown(ev) === false) { return + } + + if (this.search.onKeydown(ev) === false) { + return + } } Table.prototype.onFormSubmit = function(ev, data) { @@ -798,10 +810,12 @@ var target = this.getEventTarget(ev), cmd = target.getAttribute('data-cmd') - if (!cmd) + if (!cmd) { return + } switch (cmd) { + case 'record-add': case 'record-add-below': this.addRecord('below') break @@ -1096,12 +1110,10 @@ adding: true, deleting: true, toolbar: true, + searching: false, rowSorting: false, height: false, - dynamicHeight: false, - btnAddRowLabel: 'Add row', - btnAddRowBelowLabel: 'Add row below', - btnDeleteRowLabel: 'Delete row' + dynamicHeight: false } // TABLE PLUGIN DEFINITION @@ -1121,7 +1133,7 @@ if (typeof option == 'string') result = data[option].apply(data, args) if (typeof result != 'undefined') return false }) - + return result ? result : this } diff --git a/modules/backend/widgets/table/assets/js/table.processor.base.js b/modules/backend/widgets/table/assets/js/table.processor.base.js index 0d63d66..c6627bc 100644 --- a/modules/backend/widgets/table/assets/js/table.processor.base.js +++ b/modules/backend/widgets/table/assets/js/table.processor.base.js @@ -137,7 +137,7 @@ var viewContainer = document.createElement('div') viewContainer.setAttribute('data-view-container', 'data-view-container') - viewContainer.textContent = value + viewContainer.textContent = value === undefined ? '' : value cellContentContainer.appendChild(viewContainer) diff --git a/modules/backend/widgets/table/assets/less/table.less b/modules/backend/widgets/table/assets/less/table.less index f33458f..4cef3e9 100644 --- a/modules/backend/widgets/table/assets/less/table.less +++ b/modules/backend/widgets/table/assets/less/table.less @@ -189,6 +189,16 @@ } } + .table-search { + float: right; + margin: 3px 3px 0 0; + + .table-search-input { + height: auto; + padding: 5px 13px 5px; + } + } + a.table-icon { &:before { display: inline-block; @@ -198,8 +208,7 @@ margin-right: 8px; position: relative; top: 3px; - background: transparent url(../images/table-icons.gif) no-repeat; - background-position: 0 0; + background: transparent url(../images/table-icons.gif) no-repeat 0 0; background-size: 32px auto; } @@ -284,6 +293,28 @@ } } +html.chrome { + .control-table { + td[data-column-type=string], + td[data-column-type=autocomplete] { + input[type=text] { + padding: 6px 10px 7px!important; + } + } + } +} + +html.safari, html.gecko { + .control-table { + td[data-column-type=string], + td[data-column-type=autocomplete] { + input[type=text] { + padding: 5px 10px 5px; + } + } + } +} + ul.table-widget-autocomplete { background: white; font-size: 13px; @@ -404,9 +435,8 @@ ul.table-widget-autocomplete { html.cssanimations { .control-table td[data-column-type=dropdown] { [data-view-container].loading:after { - background-image: url('../../../../../../modules/system/assets/ui/images/loader-transparent.svg'); + background: url('../../../../../../modules/system/assets/ui/images/loader-transparent.svg') 50% 50%; background-size: 15px 15px; - background-position: 50% 50%; position: absolute; width: 15px; height: 15px; diff --git a/modules/backend/widgets/table/partials/_table.htm b/modules/backend/widgets/table/partials/_table.htm index c24fa4c..d7eedac 100644 --- a/modules/backend/widgets/table/partials/_table.htm +++ b/modules/backend/widgets/table/partials/_table.htm @@ -8,6 +8,7 @@ data-field-name="fieldName) ?>" data-postback-handler-name="" data-adding="" + data-searching="" data-deleting="" data-toolbar="" data-height="" @@ -15,7 +16,33 @@ data-key-column="" data-client-data-source-class="" data-dynamic-height="" - data-btn-add-row-label="" - data-btn-add-row-below-label="" - data-btn-delete-row-label="" -> \ No newline at end of file +> + + + diff --git a/modules/cms/ServiceProvider.php b/modules/cms/ServiceProvider.php index f163a25..f6f5080 100644 --- a/modules/cms/ServiceProvider.php +++ b/modules/cms/ServiceProvider.php @@ -6,13 +6,16 @@ use Backend; use BackendMenu; use BackendAuth; +use Backend\Models\UserRole; use Backend\Classes\WidgetManager; use October\Rain\Support\ModuleServiceProvider; use System\Classes\SettingsManager; use System\Classes\CombineAssets; use Cms\Classes\ComponentManager; use Cms\Classes\Page as CmsPage; +use Cms\Classes\CmsObject; use Cms\Models\ThemeData; +use Cms\Models\ThemeLog; class ServiceProvider extends ModuleServiceProvider { @@ -26,6 +29,7 @@ public function register() parent::register('cms'); $this->registerComponents(); + $this->registerThemeLogging(); $this->registerAssetBundles(); $this->registerCombinerEvents(); @@ -55,24 +59,35 @@ public function boot() } /** - * Register components + * Register components. */ protected function registerComponents() { ComponentManager::instance()->registerComponents(function ($manager) { - $manager->registerComponent('Cms\Classes\ViewBag', 'viewBag'); + $manager->registerComponent(\Cms\Components\ViewBag::class, 'viewBag'); + $manager->registerComponent(\Cms\Components\Resources::class, 'resources'); }); } /** - * Register asset bundles + * Registers theme logging on templates. + */ + protected function registerThemeLogging() + { + CmsObject::extend(function ($model) { + ThemeLog::bindEventsToModel($model); + }); + } + + /** + * Register asset bundles. */ protected function registerAssetBundles() { /* * Register asset bundles */ - CombineAssets::registerCallback(function($combiner) { + CombineAssets::registerCallback(function ($combiner) { $combiner->registerBundle('~/modules/cms/widgets/mediamanager/assets/js/mediamanager-browser.js'); $combiner->registerBundle('~/modules/cms/widgets/mediamanager/assets/less/mediamanager.less'); }); @@ -109,6 +124,7 @@ protected function registerBackendNavigation() 'icon' => 'icon-magic', 'iconSvg' => 'modules/cms/assets/images/cms-icon.svg', 'url' => Backend::url('cms'), + 'order' => 100, 'permissions' => [ 'cms.manage_content', 'cms.manage_assets', @@ -116,7 +132,6 @@ protected function registerBackendNavigation() 'cms.manage_layouts', 'cms.manage_partials' ], - 'order' => 10, 'sideMenu' => [ 'pages' => [ 'label' => 'cms::lang.page.menu_label', @@ -173,7 +188,7 @@ protected function registerBackendNavigation() 'iconSvg' => 'modules/cms/assets/images/media-icon.svg', 'url' => Backend::url('cms/media'), 'permissions' => ['media.*'], - 'order' => 20 + 'order' => 200 ] ]); }); @@ -185,7 +200,7 @@ protected function registerBackendNavigation() protected function registerBackendReportWidgets() { WidgetManager::instance()->registerReportWidgets(function ($manager) { - $manager->registerReportWidget('Cms\ReportWidgets\ActiveTheme', [ + $manager->registerReportWidget(\Cms\ReportWidgets\ActiveTheme::class, [ 'label' => 'cms::lang.dashboard.active_theme.widget_title_default', 'context' => 'dashboard' ]); @@ -202,31 +217,42 @@ protected function registerBackendPermissions() 'cms.manage_content' => [ 'label' => 'cms::lang.permissions.manage_content', 'tab' => 'cms::lang.permissions.name', + 'roles' => UserRole::CODE_DEVELOPER, 'order' => 100 ], 'cms.manage_assets' => [ 'label' => 'cms::lang.permissions.manage_assets', 'tab' => 'cms::lang.permissions.name', + 'roles' => UserRole::CODE_DEVELOPER, 'order' => 100 ], 'cms.manage_pages' => [ 'label' => 'cms::lang.permissions.manage_pages', 'tab' => 'cms::lang.permissions.name', + 'roles' => UserRole::CODE_DEVELOPER, 'order' => 100 ], 'cms.manage_layouts' => [ 'label' => 'cms::lang.permissions.manage_layouts', 'tab' => 'cms::lang.permissions.name', + 'roles' => UserRole::CODE_DEVELOPER, 'order' => 100 ], 'cms.manage_partials' => [ 'label' => 'cms::lang.permissions.manage_partials', 'tab' => 'cms::lang.permissions.name', + 'roles' => UserRole::CODE_DEVELOPER, 'order' => 100 ], 'cms.manage_themes' => [ 'label' => 'cms::lang.permissions.manage_themes', 'tab' => 'cms::lang.permissions.name', + 'roles' => UserRole::CODE_DEVELOPER, + 'order' => 100 + ], + 'cms.manage_theme_options' => [ + 'label' => 'cms::lang.permissions.manage_theme_options', + 'tab' => 'cms::lang.permissions.name', 'order' => 100 ], 'media.manage_media' => [ @@ -261,8 +287,8 @@ protected function registerBackendSettings() 'description' => 'cms::lang.theme.settings_menu_description', 'category' => SettingsManager::CATEGORY_CMS, 'icon' => 'icon-picture-o', - 'url' => Backend::URL('cms/themes'), - 'permissions' => ['cms.manage_themes'], + 'url' => Backend::url('cms/themes'), + 'permissions' => ['cms.manage_themes', 'cms.manage_theme_options'], 'order' => 200 ], 'maintenance_settings' => [ @@ -274,6 +300,16 @@ protected function registerBackendSettings() 'permissions' => ['cms.manage_themes'], 'order' => 300 ], + 'theme_logs' => [ + 'label' => 'cms::lang.theme_log.menu_label', + 'description' => 'cms::lang.theme_log.menu_description', + 'category' => SettingsManager::CATEGORY_LOGS, + 'icon' => 'icon-magic', + 'url' => Backend::url('cms/themelogs'), + 'permissions' => ['system.access_logs'], + 'order' => 910, + 'keywords' => 'theme change log' + ] ]); }); } diff --git a/modules/cms/assets/css/themelogs/template-diff.css b/modules/cms/assets/css/themelogs/template-diff.css new file mode 100644 index 0000000..e97c8af --- /dev/null +++ b/modules/cms/assets/css/themelogs/template-diff.css @@ -0,0 +1,10 @@ +del { + text-decoration: none; + color: #b30000; + background: #fadad7; +} +ins { + background: #eaf2c2; + color: #406619; + text-decoration: none; +} diff --git a/modules/cms/assets/js/october.cmspage.js b/modules/cms/assets/js/october.cmspage.js index 5058c0a..6692e27 100644 --- a/modules/cms/assets/js/october.cmspage.js +++ b/modules/cms/assets/js/october.cmspage.js @@ -209,10 +209,7 @@ var $primaryCollapseIcon = $(''), $primaryPanel = $('.control-tabs.primary-tabs', data.pane), - $secondaryPanel = $('.control-tabs.secondary-tabs', data.pane), - $primaryTabContainer = $('.nav-tabs', $primaryPanel) - - $primaryTabContainer.addClass('master-area') + $secondaryPanel = $('.control-tabs.secondary-tabs', data.pane) if ($primaryPanel.length > 0) { $secondaryPanel.append($primaryCollapseIcon); @@ -318,7 +315,7 @@ } } - CmsPage.prototype.onAjaxError = function(ev, context, data, jqXHR) { + CmsPage.prototype.onAjaxError = function(ev, context, message, data, jqXHR) { if (context.handler == 'onSave') { if (jqXHR.responseText == 'mtime-mismatch') { ev.preventDefault() diff --git a/modules/cms/assets/js/themelogs/template-diff.js b/modules/cms/assets/js/themelogs/template-diff.js new file mode 100644 index 0000000..53cbd3c --- /dev/null +++ b/modules/cms/assets/js/themelogs/template-diff.js @@ -0,0 +1,113 @@ +/* + * Template Diff plugin + * + * Data attributes: + * - data-plugin="template-diff" - enables the plugin on an element + * + * JavaScript API: + * $('pre').templateDiff({ option: 'value' }) + * + * Dependences: + * - jsdiff (diff.js) + */ + ++function ($) { "use strict"; + + // TEMPALTE DIFF CLASS DEFINITION + // ============================ + + var TemplateDiff = function(element, options) { + this.options = options + this.$el = $(element) + + // Init + this.init() + } + + TemplateDiff.DEFAULTS = { + oldFieldName: null, + newFieldName: null, + contentTag: '', + diffType: 'lines' // chars, words, lines + } + + TemplateDiff.prototype.init = function() { + var + oldValue = $('[data-field-name="'+this.options.oldFieldName+'"] .form-control '+this.options.contentTag).html(), + newValue = $('[data-field-name="'+this.options.newFieldName+'"] .form-control '+this.options.contentTag).html() + + oldValue = $('
    ').html(oldValue).text() + newValue = $('
    ').html(newValue).text() + + this.diffStrings(oldValue, newValue) + } + + TemplateDiff.prototype.diffStrings = function(oldValue, newValue) { + var result = this.$el.get(0) + var diffType = 'diff' + this.options.diffType[0].toUpperCase() + this.options.diffType.slice(1) + var diff = JsDiff[diffType](oldValue, newValue) + var fragment = document.createDocumentFragment(); + for (var i=0; i < diff.length; i++) { + + if (diff[i].added && diff[i + 1] && diff[i + 1].removed) { + var swap = diff[i]; + diff[i] = diff[i + 1]; + diff[i + 1] = swap; + } + + var node; + if (diff[i].removed) { + node = document.createElement('del'); + node.appendChild(document.createTextNode(diff[i].value)); + } + else if (diff[i].added) { + node = document.createElement('ins'); + node.appendChild(document.createTextNode(diff[i].value)); + } + else { + node = document.createTextNode(diff[i].value); + } + fragment.appendChild(node); + } + + result.textContent = ''; + result.appendChild(fragment); + } + + // TEMPALTE DIFF PLUGIN DEFINITION + // ============================ + + var old = $.fn.templateDiff + + $.fn.templateDiff = function (option) { + var args = Array.prototype.slice.call(arguments, 1), result + this.each(function () { + var $this = $(this) + var data = $this.data('oc.example') + var options = $.extend({}, TemplateDiff.DEFAULTS, $this.data(), typeof option == 'object' && option) + if (!data) $this.data('oc.example', (data = new TemplateDiff(this, options))) + if (typeof option == 'string') result = data[option].apply(data, args) + if (typeof result != 'undefined') return false + }) + + return result ? result : this + } + + $.fn.templateDiff.Constructor = TemplateDiff + + // TEMPALTE DIFF NO CONFLICT + // ================= + + $.fn.templateDiff.noConflict = function () { + $.fn.templateDiff = old + return this + } + + // TEMPALTE DIFF DATA-API + // =============== + + $(document).render(function () { + $('[data-plugin="template-diff"]').templateDiff() + }); + +}(window.jQuery); diff --git a/modules/cms/assets/less/october.components.less b/modules/cms/assets/less/october.components.less index 21b94da..fc18f69 100644 --- a/modules/cms/assets/less/october.components.less +++ b/modules/cms/assets/less/october.components.less @@ -85,7 +85,7 @@ div.control-componentlist div.components div.layout-cell { &.description { padding: 0 15px 10px; margin-top: 8px; - font-weight: 100; + font-weight: 400; font-size: @font-size-base - 3; line-height: 150%; } diff --git a/modules/cms/assets/vendor/jsdiff/diff.js b/modules/cms/assets/vendor/jsdiff/diff.js new file mode 100644 index 0000000..d3be759 --- /dev/null +++ b/modules/cms/assets/vendor/jsdiff/diff.js @@ -0,0 +1,1407 @@ +/*! + + diff v3.2.0 + +Software License Agreement (BSD License) + +Copyright (c) 2009-2015, Kevin Decker + +All rights reserved. + +Redistribution and use of this software in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above + copyright notice, this list of conditions and the + following disclaimer. + +* Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the + following disclaimer in the documentation and/or other + materials provided with the distribution. + +* Neither the name of Kevin Decker nor the names of its + contributors may be used to endorse or promote products + derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +@license +*/ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["JsDiff"] = factory(); + else + root["JsDiff"] = factory(); +})(this, function() { +return (function(modules) { // webpackBootstrap + // The module cache + var installedModules = {}; + + // The require function + function __webpack_require__(moduleId) { + + // Check if module is in cache + if(installedModules[moduleId]) + return installedModules[moduleId].exports; + + // Create a new module (and put it into the cache) + var module = installedModules[moduleId] = { + exports: {}, + id: moduleId, + loaded: false + }; + + // Execute the module function + modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + + // Flag the module as loaded + module.loaded = true; + + // Return the exports of the module + return module.exports; + } + + + // expose the modules object (__webpack_modules__) + __webpack_require__.m = modules; + + // expose the module cache + __webpack_require__.c = installedModules; + + // __webpack_public_path__ + __webpack_require__.p = ""; + + // Load entry module and return exports + return __webpack_require__(0); +}) +/************************************************************************/ +([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffArrays = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined; + + var _base = __webpack_require__(1) ; + + + var _base2 = _interopRequireDefault(_base); + + + var _character = __webpack_require__(2) ; + + var _word = __webpack_require__(3) ; + + var _line = __webpack_require__(5) ; + + var _sentence = __webpack_require__(6) ; + + var _css = __webpack_require__(7) ; + + var _json = __webpack_require__(8) ; + + var _array = __webpack_require__(9) ; + + var _apply = __webpack_require__(10) ; + + var _parse = __webpack_require__(11) ; + + var _create = __webpack_require__(13) ; + + var _dmp = __webpack_require__(14) ; + + var _xml = __webpack_require__(15) ; + + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + exports. Diff = _base2['default']; + exports. diffChars = _character.diffChars; + exports. diffWords = _word.diffWords; + exports. diffWordsWithSpace = _word.diffWordsWithSpace; + exports. diffLines = _line.diffLines; + exports. diffTrimmedLines = _line.diffTrimmedLines; + exports. diffSentences = _sentence.diffSentences; + exports. diffCss = _css.diffCss; + exports. diffJson = _json.diffJson; + exports. diffArrays = _array.diffArrays; + exports. structuredPatch = _create.structuredPatch; + exports. createTwoFilesPatch = _create.createTwoFilesPatch; + exports. createPatch = _create.createPatch; + exports. applyPatch = _apply.applyPatch; + exports. applyPatches = _apply.applyPatches; + exports. parsePatch = _parse.parsePatch; + exports. convertChangesToDMP = _dmp.convertChangesToDMP; + exports. convertChangesToXML = _xml.convertChangesToXML; + exports. canonicalize = _json.canonicalize; /* See LICENSE file for terms of use */ + + /* + * Text diff implementation. + * + * This library supports the following APIS: + * JsDiff.diffChars: Character by character diff + * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace + * JsDiff.diffLines: Line based diff + * + * JsDiff.diffCss: Diff targeted at CSS content + * + * These methods are based on the implementation proposed in + * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). + * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 + */ + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQWdCQSxJLHlCQUFBLDhCLHdCQUFBOzs7Ozs7QUFDQSxJLHlCQUFBLHdDLHdCQUFBOztBQUNBLEkseUJBQUEsOEIsd0JBQUE7O0FBQ0EsSSx5QkFBQSw4Qix3QkFBQTs7QUFDQSxJLHlCQUFBLHNDLHdCQUFBOztBQUVBLEkseUJBQUEsNEIsd0JBQUE7O0FBQ0EsSSx5QkFBQSw4Qix3QkFBQTs7QUFFQSxJLHlCQUFBLGdDLHdCQUFBOztBQUVBLEkseUJBQUEsaUMsd0JBQUE7O0FBQ0EsSSx5QkFBQSxpQyx3QkFBQTs7QUFDQSxJLHlCQUFBLG1DLHdCQUFBOztBQUVBLEkseUJBQUEsK0Isd0JBQUE7O0FBQ0EsSSx5QkFBQSwrQix3QkFBQTs7Ozs7Z0NBR0UsSTt5REFFQSxTO3lEQUNBLFM7eURBQ0Esa0I7eURBQ0EsUzt5REFDQSxnQjt5REFDQSxhO3lEQUVBLE87eURBQ0EsUTt5REFFQSxVO3lEQUVBLGU7eURBQ0EsbUI7eURBQ0EsVzt5REFDQSxVO3lEQUNBLFk7eURBQ0EsVTt5REFDQSxtQjt5REFDQSxtQjt5REFDQSxZIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyogU2VlIExJQ0VOU0UgZmlsZSBmb3IgdGVybXMgb2YgdXNlICovXG5cbi8qXG4gKiBUZXh0IGRpZmYgaW1wbGVtZW50YXRpb24uXG4gKlxuICogVGhpcyBsaWJyYXJ5IHN1cHBvcnRzIHRoZSBmb2xsb3dpbmcgQVBJUzpcbiAqIEpzRGlmZi5kaWZmQ2hhcnM6IENoYXJhY3RlciBieSBjaGFyYWN0ZXIgZGlmZlxuICogSnNEaWZmLmRpZmZXb3JkczogV29yZCAoYXMgZGVmaW5lZCBieSBcXGIgcmVnZXgpIGRpZmYgd2hpY2ggaWdub3JlcyB3aGl0ZXNwYWNlXG4gKiBKc0RpZmYuZGlmZkxpbmVzOiBMaW5lIGJhc2VkIGRpZmZcbiAqXG4gKiBKc0RpZmYuZGlmZkNzczogRGlmZiB0YXJnZXRlZCBhdCBDU1MgY29udGVudFxuICpcbiAqIFRoZXNlIG1ldGhvZHMgYXJlIGJhc2VkIG9uIHRoZSBpbXBsZW1lbnRhdGlvbiBwcm9wb3NlZCBpblxuICogXCJBbiBPKE5EKSBEaWZmZXJlbmNlIEFsZ29yaXRobSBhbmQgaXRzIFZhcmlhdGlvbnNcIiAoTXllcnMsIDE5ODYpLlxuICogaHR0cDovL2NpdGVzZWVyeC5pc3QucHN1LmVkdS92aWV3ZG9jL3N1bW1hcnk/ZG9pPTEwLjEuMS40LjY5MjdcbiAqL1xuaW1wb3J0IERpZmYgZnJvbSAnLi9kaWZmL2Jhc2UnO1xuaW1wb3J0IHtkaWZmQ2hhcnN9IGZyb20gJy4vZGlmZi9jaGFyYWN0ZXInO1xuaW1wb3J0IHtkaWZmV29yZHMsIGRpZmZXb3Jkc1dpdGhTcGFjZX0gZnJvbSAnLi9kaWZmL3dvcmQnO1xuaW1wb3J0IHtkaWZmTGluZXMsIGRpZmZUcmltbWVkTGluZXN9IGZyb20gJy4vZGlmZi9saW5lJztcbmltcG9ydCB7ZGlmZlNlbnRlbmNlc30gZnJvbSAnLi9kaWZmL3NlbnRlbmNlJztcblxuaW1wb3J0IHtkaWZmQ3NzfSBmcm9tICcuL2RpZmYvY3NzJztcbmltcG9ydCB7ZGlmZkpzb24sIGNhbm9uaWNhbGl6ZX0gZnJvbSAnLi9kaWZmL2pzb24nO1xuXG5pbXBvcnQge2RpZmZBcnJheXN9IGZyb20gJy4vZGlmZi9hcnJheSc7XG5cbmltcG9ydCB7YXBwbHlQYXRjaCwgYXBwbHlQYXRjaGVzfSBmcm9tICcuL3BhdGNoL2FwcGx5JztcbmltcG9ydCB7cGFyc2VQYXRjaH0gZnJvbSAnLi9wYXRjaC9wYXJzZSc7XG5pbXBvcnQge3N0cnVjdHVyZWRQYXRjaCwgY3JlYXRlVHdvRmlsZXNQYXRjaCwgY3JlYXRlUGF0Y2h9IGZyb20gJy4vcGF0Y2gvY3JlYXRlJztcblxuaW1wb3J0IHtjb252ZXJ0Q2hhbmdlc1RvRE1QfSBmcm9tICcuL2NvbnZlcnQvZG1wJztcbmltcG9ydCB7Y29udmVydENoYW5nZXNUb1hNTH0gZnJvbSAnLi9jb252ZXJ0L3htbCc7XG5cbmV4cG9ydCB7XG4gIERpZmYsXG5cbiAgZGlmZkNoYXJzLFxuICBkaWZmV29yZHMsXG4gIGRpZmZXb3Jkc1dpdGhTcGFjZSxcbiAgZGlmZkxpbmVzLFxuICBkaWZmVHJpbW1lZExpbmVzLFxuICBkaWZmU2VudGVuY2VzLFxuXG4gIGRpZmZDc3MsXG4gIGRpZmZKc29uLFxuXG4gIGRpZmZBcnJheXMsXG5cbiAgc3RydWN0dXJlZFBhdGNoLFxuICBjcmVhdGVUd29GaWxlc1BhdGNoLFxuICBjcmVhdGVQYXRjaCxcbiAgYXBwbHlQYXRjaCxcbiAgYXBwbHlQYXRjaGVzLFxuICBwYXJzZVBhdGNoLFxuICBjb252ZXJ0Q2hhbmdlc1RvRE1QLFxuICBjb252ZXJ0Q2hhbmdlc1RvWE1MLFxuICBjYW5vbmljYWxpemVcbn07XG4iXX0= + + +/***/ }, +/* 1 */ +/***/ function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + exports['default'] = Diff; + function Diff() {} + + Diff.prototype = { + diff: function diff(oldString, newString) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + var callback = options.callback; + if (typeof options === 'function') { + callback = options; + options = {}; + } + this.options = options; + + var self = this; + + function done(value) { + if (callback) { + setTimeout(function () { + callback(undefined, value); + }, 0); + return true; + } else { + return value; + } + } + + // Allow subclasses to massage the input prior to running + oldString = this.castInput(oldString); + newString = this.castInput(newString); + + oldString = this.removeEmpty(this.tokenize(oldString)); + newString = this.removeEmpty(this.tokenize(newString)); + + var newLen = newString.length, + oldLen = oldString.length; + var editLength = 1; + var maxEditLength = newLen + oldLen; + var bestPath = [{ newPos: -1, components: [] }]; + + // Seed editLength = 0, i.e. the content starts with the same values + var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0); + if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) { + // Identity per the equality and tokenizer + return done([{ value: this.join(newString), count: newString.length }]); + } + + // Main worker method. checks all permutations of a given edit length for acceptance. + function execEditLength() { + for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) { + var basePath = void 0 ; + var addPath = bestPath[diagonalPath - 1], + removePath = bestPath[diagonalPath + 1], + _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath; + if (addPath) { + // No one else is going to attempt to use this value, clear it + bestPath[diagonalPath - 1] = undefined; + } + + var canAdd = addPath && addPath.newPos + 1 < newLen, + canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen; + if (!canAdd && !canRemove) { + // If this path is a terminal then prune + bestPath[diagonalPath] = undefined; + continue; + } + + // Select the diagonal that we want to branch from. We select the prior + // path whose position in the new string is the farthest from the origin + // and does not pass the bounds of the diff graph + if (!canAdd || canRemove && addPath.newPos < removePath.newPos) { + basePath = clonePath(removePath); + self.pushComponent(basePath.components, undefined, true); + } else { + basePath = addPath; // No need to clone, we've pulled it from the list + basePath.newPos++; + self.pushComponent(basePath.components, true, undefined); + } + + _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); + + // If we have hit the end of both strings, then we are done + if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) { + return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken)); + } else { + // Otherwise track this path as a potential candidate and continue. + bestPath[diagonalPath] = basePath; + } + } + + editLength++; + } + + // Performs the length of edit iteration. Is a bit fugly as this has to support the + // sync and async mode which is never fun. Loops over execEditLength until a value + // is produced. + if (callback) { + (function exec() { + setTimeout(function () { + // This should not happen, but we want to be safe. + /* istanbul ignore next */ + if (editLength > maxEditLength) { + return callback(); + } + + if (!execEditLength()) { + exec(); + } + }, 0); + })(); + } else { + while (editLength <= maxEditLength) { + var ret = execEditLength(); + if (ret) { + return ret; + } + } + } + }, + pushComponent: function pushComponent(components, added, removed) { + var last = components[components.length - 1]; + if (last && last.added === added && last.removed === removed) { + // We need to clone here as the component clone operation is just + // as shallow array clone + components[components.length - 1] = { count: last.count + 1, added: added, removed: removed }; + } else { + components.push({ count: 1, added: added, removed: removed }); + } + }, + extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) { + var newLen = newString.length, + oldLen = oldString.length, + newPos = basePath.newPos, + oldPos = newPos - diagonalPath, + commonCount = 0; + while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) { + newPos++; + oldPos++; + commonCount++; + } + + if (commonCount) { + basePath.components.push({ count: commonCount }); + } + + basePath.newPos = newPos; + return oldPos; + }, + equals: function equals(left, right) { + return left === right; + }, + removeEmpty: function removeEmpty(array) { + var ret = []; + for (var i = 0; i < array.length; i++) { + if (array[i]) { + ret.push(array[i]); + } + } + return ret; + }, + castInput: function castInput(value) { + return value; + }, + tokenize: function tokenize(value) { + return value.split(''); + }, + join: function join(chars) { + return chars.join(''); + } + }; + + function buildValues(diff, components, newString, oldString, useLongestToken) { + var componentPos = 0, + componentLen = components.length, + newPos = 0, + oldPos = 0; + + for (; componentPos < componentLen; componentPos++) { + var component = components[componentPos]; + if (!component.removed) { + if (!component.added && useLongestToken) { + var value = newString.slice(newPos, newPos + component.count); + value = value.map(function (value, i) { + var oldValue = oldString[oldPos + i]; + return oldValue.length > value.length ? oldValue : value; + }); + + component.value = diff.join(value); + } else { + component.value = diff.join(newString.slice(newPos, newPos + component.count)); + } + newPos += component.count; + + // Common case + if (!component.added) { + oldPos += component.count; + } + } else { + component.value = diff.join(oldString.slice(oldPos, oldPos + component.count)); + oldPos += component.count; + + // Reverse add and remove so removes are output first to match common convention + // The diffing algorithm is tied to add then remove output and this is the simplest + // route to get the desired output with minimal overhead. + if (componentPos && components[componentPos - 1].added) { + var tmp = components[componentPos - 1]; + components[componentPos - 1] = components[componentPos]; + components[componentPos] = tmp; + } + } + } + + // Special case handle for when one terminal is ignored. For this case we merge the + // terminal into the prior string and drop the change. + var lastComponent = components[componentLen - 1]; + if (componentLen > 1 && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) { + components[componentLen - 2].value += lastComponent.value; + components.pop(); + } + + return components; + } + + function clonePath(path) { + return { newPos: path.newPos, components: path.components.slice(0) }; + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OzRDQUF3QixJO0FBQVQsU0FBUyxJQUFULEdBQWdCLENBQUU7O0FBRWpDLEtBQUssU0FBTCxHQUFpQixFO3lCQUNmLElBRGUsZ0JBQ1YsU0FEVSxFQUNDLFNBREQsRUFDMEI7NkJBQUEsSSx1QkFBZCxPQUFjLHlEQUFKLEVBQUk7O0FBQ3ZDLFFBQUksV0FBVyxRQUFRLFFBQXZCO0FBQ0EsUUFBSSxPQUFPLE9BQVAsS0FBbUIsVUFBdkIsRUFBbUM7QUFDakMsaUJBQVcsT0FBWDtBQUNBLGdCQUFVLEVBQVY7QUFDRDtBQUNELFNBQUssT0FBTCxHQUFlLE9BQWY7O0FBRUEsUUFBSSxPQUFPLElBQVg7O0FBRUEsYUFBUyxJQUFULENBQWMsS0FBZCxFQUFxQjtBQUNuQixVQUFJLFFBQUosRUFBYztBQUNaLG1CQUFXLFlBQVc7QUFBRSxtQkFBUyxTQUFULEVBQW9CLEtBQXBCO0FBQTZCLFNBQXJELEVBQXVELENBQXZEO0FBQ0EsZUFBTyxJQUFQO0FBQ0QsT0FIRCxNQUdPO0FBQ0wsZUFBTyxLQUFQO0FBQ0Q7QUFDRjs7O0FBR0QsZ0JBQVksS0FBSyxTQUFMLENBQWUsU0FBZixDQUFaO0FBQ0EsZ0JBQVksS0FBSyxTQUFMLENBQWUsU0FBZixDQUFaOztBQUVBLGdCQUFZLEtBQUssV0FBTCxDQUFpQixLQUFLLFFBQUwsQ0FBYyxTQUFkLENBQWpCLENBQVo7QUFDQSxnQkFBWSxLQUFLLFdBQUwsQ0FBaUIsS0FBSyxRQUFMLENBQWMsU0FBZCxDQUFqQixDQUFaOztBQUVBLFFBQUksU0FBUyxVQUFVLE1BQXZCO0FBQUEsUUFBK0IsU0FBUyxVQUFVLE1BQWxEO0FBQ0EsUUFBSSxhQUFhLENBQWpCO0FBQ0EsUUFBSSxnQkFBZ0IsU0FBUyxNQUE3QjtBQUNBLFFBQUksV0FBVyxDQUFDLEVBQUUsUUFBUSxDQUFDLENBQVgsRUFBYyxZQUFZLEVBQTFCLEVBQUQsQ0FBZjs7O0FBR0EsUUFBSSxTQUFTLEtBQUssYUFBTCxDQUFtQixTQUFTLENBQVQsQ0FBbkIsRUFBZ0MsU0FBaEMsRUFBMkMsU0FBM0MsRUFBc0QsQ0FBdEQsQ0FBYjtBQUNBLFFBQUksU0FBUyxDQUFULEVBQVksTUFBWixHQUFxQixDQUFyQixJQUEwQixNQUExQixJQUFvQyxTQUFTLENBQVQsSUFBYyxNQUF0RCxFQUE4RDs7QUFFNUQsYUFBTyxLQUFLLENBQUMsRUFBQyxPQUFPLEtBQUssSUFBTCxDQUFVLFNBQVYsQ0FBUixFQUE4QixPQUFPLFVBQVUsTUFBL0MsRUFBRCxDQUFMLENBQVA7QUFDRDs7O0FBR0QsYUFBUyxjQUFULEdBQTBCO0FBQ3hCLFdBQUssSUFBSSxlQUFlLENBQUMsQ0FBRCxHQUFLLFVBQTdCLEVBQXlDLGdCQUFnQixVQUF6RCxFQUFxRSxnQkFBZ0IsQ0FBckYsRUFBd0Y7QUFDdEYsWUFBSSxXLHlCQUFBLE0sd0JBQUo7QUFDQSxZQUFJLFVBQVUsU0FBUyxlQUFlLENBQXhCLENBQWQ7QUFBQSxZQUNJLGFBQWEsU0FBUyxlQUFlLENBQXhCLENBRGpCO0FBQUEsWUFFSSxVQUFTLENBQUMsYUFBYSxXQUFXLE1BQXhCLEdBQWlDLENBQWxDLElBQXVDLFlBRnBEO0FBR0EsWUFBSSxPQUFKLEVBQWE7O0FBRVgsbUJBQVMsZUFBZSxDQUF4QixJQUE2QixTQUE3QjtBQUNEOztBQUVELFlBQUksU0FBUyxXQUFXLFFBQVEsTUFBUixHQUFpQixDQUFqQixHQUFxQixNQUE3QztBQUFBLFlBQ0ksWUFBWSxjQUFjLEtBQUssT0FBbkIsSUFBNkIsVUFBUyxNQUR0RDtBQUVBLFlBQUksQ0FBQyxNQUFELElBQVcsQ0FBQyxTQUFoQixFQUEyQjs7QUFFekIsbUJBQVMsWUFBVCxJQUF5QixTQUF6QjtBQUNBO0FBQ0Q7Ozs7O0FBS0QsWUFBSSxDQUFDLE1BQUQsSUFBWSxhQUFhLFFBQVEsTUFBUixHQUFpQixXQUFXLE1BQXpELEVBQWtFO0FBQ2hFLHFCQUFXLFVBQVUsVUFBVixDQUFYO0FBQ0EsZUFBSyxhQUFMLENBQW1CLFNBQVMsVUFBNUIsRUFBd0MsU0FBeEMsRUFBbUQsSUFBbkQ7QUFDRCxTQUhELE1BR087QUFDTCxxQkFBVyxPQUFYLEM7QUFDQSxtQkFBUyxNQUFUO0FBQ0EsZUFBSyxhQUFMLENBQW1CLFNBQVMsVUFBNUIsRUFBd0MsSUFBeEMsRUFBOEMsU0FBOUM7QUFDRDs7QUFFRCxrQkFBUyxLQUFLLGFBQUwsQ0FBbUIsUUFBbkIsRUFBNkIsU0FBN0IsRUFBd0MsU0FBeEMsRUFBbUQsWUFBbkQsQ0FBVDs7O0FBR0EsWUFBSSxTQUFTLE1BQVQsR0FBa0IsQ0FBbEIsSUFBdUIsTUFBdkIsSUFBaUMsVUFBUyxDQUFULElBQWMsTUFBbkQsRUFBMkQ7QUFDekQsaUJBQU8sS0FBSyxZQUFZLElBQVosRUFBa0IsU0FBUyxVQUEzQixFQUF1QyxTQUF2QyxFQUFrRCxTQUFsRCxFQUE2RCxLQUFLLGVBQWxFLENBQUwsQ0FBUDtBQUNELFNBRkQsTUFFTzs7QUFFTCxtQkFBUyxZQUFULElBQXlCLFFBQXpCO0FBQ0Q7QUFDRjs7QUFFRDtBQUNEOzs7OztBQUtELFFBQUksUUFBSixFQUFjO0FBQ1gsZ0JBQVMsSUFBVCxHQUFnQjtBQUNmLG1CQUFXLFlBQVc7OztBQUdwQixjQUFJLGFBQWEsYUFBakIsRUFBZ0M7QUFDOUIsbUJBQU8sVUFBUDtBQUNEOztBQUVELGNBQUksQ0FBQyxnQkFBTCxFQUF1QjtBQUNyQjtBQUNEO0FBQ0YsU0FWRCxFQVVHLENBVkg7QUFXRCxPQVpBLEdBQUQ7QUFhRCxLQWRELE1BY087QUFDTCxhQUFPLGNBQWMsYUFBckIsRUFBb0M7QUFDbEMsWUFBSSxNQUFNLGdCQUFWO0FBQ0EsWUFBSSxHQUFKLEVBQVM7QUFDUCxpQkFBTyxHQUFQO0FBQ0Q7QUFDRjtBQUNGO0FBQ0YsR0E5R2M7bURBZ0hmLGFBaEhlLHlCQWdIRCxVQWhIQyxFQWdIVyxLQWhIWCxFQWdIa0IsT0FoSGxCLEVBZ0gyQjtBQUN4QyxRQUFJLE9BQU8sV0FBVyxXQUFXLE1BQVgsR0FBb0IsQ0FBL0IsQ0FBWDtBQUNBLFFBQUksUUFBUSxLQUFLLEtBQUwsS0FBZSxLQUF2QixJQUFnQyxLQUFLLE9BQUwsS0FBaUIsT0FBckQsRUFBOEQ7OztBQUc1RCxpQkFBVyxXQUFXLE1BQVgsR0FBb0IsQ0FBL0IsSUFBb0MsRUFBQyxPQUFPLEtBQUssS0FBTCxHQUFhLENBQXJCLEVBQXdCLE9BQU8sS0FBL0IsRUFBc0MsU0FBUyxPQUEvQyxFQUFwQztBQUNELEtBSkQsTUFJTztBQUNMLGlCQUFXLElBQVgsQ0FBZ0IsRUFBQyxPQUFPLENBQVIsRUFBVyxPQUFPLEtBQWxCLEVBQXlCLFNBQVMsT0FBbEMsRUFBaEI7QUFDRDtBQUNGLEdBekhjO21EQTBIZixhQTFIZSx5QkEwSEQsUUExSEMsRUEwSFMsU0ExSFQsRUEwSG9CLFNBMUhwQixFQTBIK0IsWUExSC9CLEVBMEg2QztBQUMxRCxRQUFJLFNBQVMsVUFBVSxNQUF2QjtBQUFBLFFBQ0ksU0FBUyxVQUFVLE1BRHZCO0FBQUEsUUFFSSxTQUFTLFNBQVMsTUFGdEI7QUFBQSxRQUdJLFNBQVMsU0FBUyxZQUh0QjtBQUFBLFFBS0ksY0FBYyxDQUxsQjtBQU1BLFdBQU8sU0FBUyxDQUFULEdBQWEsTUFBYixJQUF1QixTQUFTLENBQVQsR0FBYSxNQUFwQyxJQUE4QyxLQUFLLE1BQUwsQ0FBWSxVQUFVLFNBQVMsQ0FBbkIsQ0FBWixFQUFtQyxVQUFVLFNBQVMsQ0FBbkIsQ0FBbkMsQ0FBckQsRUFBZ0g7QUFDOUc7QUFDQTtBQUNBO0FBQ0Q7O0FBRUQsUUFBSSxXQUFKLEVBQWlCO0FBQ2YsZUFBUyxVQUFULENBQW9CLElBQXBCLENBQXlCLEVBQUMsT0FBTyxXQUFSLEVBQXpCO0FBQ0Q7O0FBRUQsYUFBUyxNQUFULEdBQWtCLE1BQWxCO0FBQ0EsV0FBTyxNQUFQO0FBQ0QsR0E3SWM7bURBK0lmLE1BL0llLGtCQStJUixJQS9JUSxFQStJRixLQS9JRSxFQStJSztBQUNsQixXQUFPLFNBQVMsS0FBaEI7QUFDRCxHQWpKYzttREFrSmYsV0FsSmUsdUJBa0pILEtBbEpHLEVBa0pJO0FBQ2pCLFFBQUksTUFBTSxFQUFWO0FBQ0EsU0FBSyxJQUFJLElBQUksQ0FBYixFQUFnQixJQUFJLE1BQU0sTUFBMUIsRUFBa0MsR0FBbEMsRUFBdUM7QUFDckMsVUFBSSxNQUFNLENBQU4sQ0FBSixFQUFjO0FBQ1osWUFBSSxJQUFKLENBQVMsTUFBTSxDQUFOLENBQVQ7QUFDRDtBQUNGO0FBQ0QsV0FBTyxHQUFQO0FBQ0QsR0ExSmM7bURBMkpmLFNBM0plLHFCQTJKTCxLQTNKSyxFQTJKRTtBQUNmLFdBQU8sS0FBUDtBQUNELEdBN0pjO21EQThKZixRQTlKZSxvQkE4Sk4sS0E5Sk0sRUE4SkM7QUFDZCxXQUFPLE1BQU0sS0FBTixDQUFZLEVBQVosQ0FBUDtBQUNELEdBaEtjO21EQWlLZixJQWpLZSxnQkFpS1YsS0FqS1UsRUFpS0g7QUFDVixXQUFPLE1BQU0sSUFBTixDQUFXLEVBQVgsQ0FBUDtBQUNEO0FBbktjLENBQWpCOztBQXNLQSxTQUFTLFdBQVQsQ0FBcUIsSUFBckIsRUFBMkIsVUFBM0IsRUFBdUMsU0FBdkMsRUFBa0QsU0FBbEQsRUFBNkQsZUFBN0QsRUFBOEU7QUFDNUUsTUFBSSxlQUFlLENBQW5CO0FBQUEsTUFDSSxlQUFlLFdBQVcsTUFEOUI7QUFBQSxNQUVJLFNBQVMsQ0FGYjtBQUFBLE1BR0ksU0FBUyxDQUhiOztBQUtBLFNBQU8sZUFBZSxZQUF0QixFQUFvQyxjQUFwQyxFQUFvRDtBQUNsRCxRQUFJLFlBQVksV0FBVyxZQUFYLENBQWhCO0FBQ0EsUUFBSSxDQUFDLFVBQVUsT0FBZixFQUF3QjtBQUN0QixVQUFJLENBQUMsVUFBVSxLQUFYLElBQW9CLGVBQXhCLEVBQXlDO0FBQ3ZDLFlBQUksUUFBUSxVQUFVLEtBQVYsQ0FBZ0IsTUFBaEIsRUFBd0IsU0FBUyxVQUFVLEtBQTNDLENBQVo7QUFDQSxnQkFBUSxNQUFNLEdBQU4sQ0FBVSxVQUFTLEtBQVQsRUFBZ0IsQ0FBaEIsRUFBbUI7QUFDbkMsY0FBSSxXQUFXLFVBQVUsU0FBUyxDQUFuQixDQUFmO0FBQ0EsaUJBQU8sU0FBUyxNQUFULEdBQWtCLE1BQU0sTUFBeEIsR0FBaUMsUUFBakMsR0FBNEMsS0FBbkQ7QUFDRCxTQUhPLENBQVI7O0FBS0Esa0JBQVUsS0FBVixHQUFrQixLQUFLLElBQUwsQ0FBVSxLQUFWLENBQWxCO0FBQ0QsT0FSRCxNQVFPO0FBQ0wsa0JBQVUsS0FBVixHQUFrQixLQUFLLElBQUwsQ0FBVSxVQUFVLEtBQVYsQ0FBZ0IsTUFBaEIsRUFBd0IsU0FBUyxVQUFVLEtBQTNDLENBQVYsQ0FBbEI7QUFDRDtBQUNELGdCQUFVLFVBQVUsS0FBcEI7OztBQUdBLFVBQUksQ0FBQyxVQUFVLEtBQWYsRUFBc0I7QUFDcEIsa0JBQVUsVUFBVSxLQUFwQjtBQUNEO0FBQ0YsS0FsQkQsTUFrQk87QUFDTCxnQkFBVSxLQUFWLEdBQWtCLEtBQUssSUFBTCxDQUFVLFVBQVUsS0FBVixDQUFnQixNQUFoQixFQUF3QixTQUFTLFVBQVUsS0FBM0MsQ0FBVixDQUFsQjtBQUNBLGdCQUFVLFVBQVUsS0FBcEI7Ozs7O0FBS0EsVUFBSSxnQkFBZ0IsV0FBVyxlQUFlLENBQTFCLEVBQTZCLEtBQWpELEVBQXdEO0FBQ3RELFlBQUksTUFBTSxXQUFXLGVBQWUsQ0FBMUIsQ0FBVjtBQUNBLG1CQUFXLGVBQWUsQ0FBMUIsSUFBK0IsV0FBVyxZQUFYLENBQS9CO0FBQ0EsbUJBQVcsWUFBWCxJQUEyQixHQUEzQjtBQUNEO0FBQ0Y7QUFDRjs7OztBQUlELE1BQUksZ0JBQWdCLFdBQVcsZUFBZSxDQUExQixDQUFwQjtBQUNBLE1BQUksZUFBZSxDQUFmLEtBQ0ksY0FBYyxLQUFkLElBQXVCLGNBQWMsT0FEekMsS0FFRyxLQUFLLE1BQUwsQ0FBWSxFQUFaLEVBQWdCLGNBQWMsS0FBOUIsQ0FGUCxFQUU2QztBQUMzQyxlQUFXLGVBQWUsQ0FBMUIsRUFBNkIsS0FBN0IsSUFBc0MsY0FBYyxLQUFwRDtBQUNBLGVBQVcsR0FBWDtBQUNEOztBQUVELFNBQU8sVUFBUDtBQUNEOztBQUVELFNBQVMsU0FBVCxDQUFtQixJQUFuQixFQUF5QjtBQUN2QixTQUFPLEVBQUUsUUFBUSxLQUFLLE1BQWYsRUFBdUIsWUFBWSxLQUFLLFVBQUwsQ0FBZ0IsS0FBaEIsQ0FBc0IsQ0FBdEIsQ0FBbkMsRUFBUDtBQUNEIiwiZmlsZSI6ImJhc2UuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBEaWZmKCkge31cblxuRGlmZi5wcm90b3R5cGUgPSB7XG4gIGRpZmYob2xkU3RyaW5nLCBuZXdTdHJpbmcsIG9wdGlvbnMgPSB7fSkge1xuICAgIGxldCBjYWxsYmFjayA9IG9wdGlvbnMuY2FsbGJhY2s7XG4gICAgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICBjYWxsYmFjayA9IG9wdGlvbnM7XG4gICAgICBvcHRpb25zID0ge307XG4gICAgfVxuICAgIHRoaXMub3B0aW9ucyA9IG9wdGlvbnM7XG5cbiAgICBsZXQgc2VsZiA9IHRoaXM7XG5cbiAgICBmdW5jdGlvbiBkb25lKHZhbHVlKSB7XG4gICAgICBpZiAoY2FsbGJhY2spIHtcbiAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpIHsgY2FsbGJhY2sodW5kZWZpbmVkLCB2YWx1ZSk7IH0sIDApO1xuICAgICAgICByZXR1cm4gdHJ1ZTtcbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIHJldHVybiB2YWx1ZTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBBbGxvdyBzdWJjbGFzc2VzIHRvIG1hc3NhZ2UgdGhlIGlucHV0IHByaW9yIHRvIHJ1bm5pbmdcbiAgICBvbGRTdHJpbmcgPSB0aGlzLmNhc3RJbnB1dChvbGRTdHJpbmcpO1xuICAgIG5ld1N0cmluZyA9IHRoaXMuY2FzdElucHV0KG5ld1N0cmluZyk7XG5cbiAgICBvbGRTdHJpbmcgPSB0aGlzLnJlbW92ZUVtcHR5KHRoaXMudG9rZW5pemUob2xkU3RyaW5nKSk7XG4gICAgbmV3U3RyaW5nID0gdGhpcy5yZW1vdmVFbXB0eSh0aGlzLnRva2VuaXplKG5ld1N0cmluZykpO1xuXG4gICAgbGV0IG5ld0xlbiA9IG5ld1N0cmluZy5sZW5ndGgsIG9sZExlbiA9IG9sZFN0cmluZy5sZW5ndGg7XG4gICAgbGV0IGVkaXRMZW5ndGggPSAxO1xuICAgIGxldCBtYXhFZGl0TGVuZ3RoID0gbmV3TGVuICsgb2xkTGVuO1xuICAgIGxldCBiZXN0UGF0aCA9IFt7IG5ld1BvczogLTEsIGNvbXBvbmVudHM6IFtdIH1dO1xuXG4gICAgLy8gU2VlZCBlZGl0TGVuZ3RoID0gMCwgaS5lLiB0aGUgY29udGVudCBzdGFydHMgd2l0aCB0aGUgc2FtZSB2YWx1ZXNcbiAgICBsZXQgb2xkUG9zID0gdGhpcy5leHRyYWN0Q29tbW9uKGJlc3RQYXRoWzBdLCBuZXdTdHJpbmcsIG9sZFN0cmluZywgMCk7XG4gICAgaWYgKGJlc3RQYXRoWzBdLm5ld1BvcyArIDEgPj0gbmV3TGVuICYmIG9sZFBvcyArIDEgPj0gb2xkTGVuKSB7XG4gICAgICAvLyBJZGVudGl0eSBwZXIgdGhlIGVxdWFsaXR5IGFuZCB0b2tlbml6ZXJcbiAgICAgIHJldHVybiBkb25lKFt7dmFsdWU6IHRoaXMuam9pbihuZXdTdHJpbmcpLCBjb3VudDogbmV3U3RyaW5nLmxlbmd0aH1dKTtcbiAgICB9XG5cbiAgICAvLyBNYWluIHdvcmtlciBtZXRob2QuIGNoZWNrcyBhbGwgcGVybXV0YXRpb25zIG9mIGEgZ2l2ZW4gZWRpdCBsZW5ndGggZm9yIGFjY2VwdGFuY2UuXG4gICAgZnVuY3Rpb24gZXhlY0VkaXRMZW5ndGgoKSB7XG4gICAgICBmb3IgKGxldCBkaWFnb25hbFBhdGggPSAtMSAqIGVkaXRMZW5ndGg7IGRpYWdvbmFsUGF0aCA8PSBlZGl0TGVuZ3RoOyBkaWFnb25hbFBhdGggKz0gMikge1xuICAgICAgICBsZXQgYmFzZVBhdGg7XG4gICAgICAgIGxldCBhZGRQYXRoID0gYmVzdFBhdGhbZGlhZ29uYWxQYXRoIC0gMV0sXG4gICAgICAgICAgICByZW1vdmVQYXRoID0gYmVzdFBhdGhbZGlhZ29uYWxQYXRoICsgMV0sXG4gICAgICAgICAgICBvbGRQb3MgPSAocmVtb3ZlUGF0aCA/IHJlbW92ZVBhdGgubmV3UG9zIDogMCkgLSBkaWFnb25hbFBhdGg7XG4gICAgICAgIGlmIChhZGRQYXRoKSB7XG4gICAgICAgICAgLy8gTm8gb25lIGVsc2UgaXMgZ29pbmcgdG8gYXR0ZW1wdCB0byB1c2UgdGhpcyB2YWx1ZSwgY2xlYXIgaXRcbiAgICAgICAgICBiZXN0UGF0aFtkaWFnb25hbFBhdGggLSAxXSA9IHVuZGVmaW5lZDtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBjYW5BZGQgPSBhZGRQYXRoICYmIGFkZFBhdGgubmV3UG9zICsgMSA8IG5ld0xlbixcbiAgICAgICAgICAgIGNhblJlbW92ZSA9IHJlbW92ZVBhdGggJiYgMCA8PSBvbGRQb3MgJiYgb2xkUG9zIDwgb2xkTGVuO1xuICAgICAgICBpZiAoIWNhbkFkZCAmJiAhY2FuUmVtb3ZlKSB7XG4gICAgICAgICAgLy8gSWYgdGhpcyBwYXRoIGlzIGEgdGVybWluYWwgdGhlbiBwcnVuZVxuICAgICAgICAgIGJlc3RQYXRoW2RpYWdvbmFsUGF0aF0gPSB1bmRlZmluZWQ7XG4gICAgICAgICAgY29udGludWU7XG4gICAgICAgIH1cblxuICAgICAgICAvLyBTZWxlY3QgdGhlIGRpYWdvbmFsIHRoYXQgd2Ugd2FudCB0byBicmFuY2ggZnJvbS4gV2Ugc2VsZWN0IHRoZSBwcmlvclxuICAgICAgICAvLyBwYXRoIHdob3NlIHBvc2l0aW9uIGluIHRoZSBuZXcgc3RyaW5nIGlzIHRoZSBmYXJ0aGVzdCBmcm9tIHRoZSBvcmlnaW5cbiAgICAgICAgLy8gYW5kIGRvZXMgbm90IHBhc3MgdGhlIGJvdW5kcyBvZiB0aGUgZGlmZiBncmFwaFxuICAgICAgICBpZiAoIWNhbkFkZCB8fCAoY2FuUmVtb3ZlICYmIGFkZFBhdGgubmV3UG9zIDwgcmVtb3ZlUGF0aC5uZXdQb3MpKSB7XG4gICAgICAgICAgYmFzZVBhdGggPSBjbG9uZVBhdGgocmVtb3ZlUGF0aCk7XG4gICAgICAgICAgc2VsZi5wdXNoQ29tcG9uZW50KGJhc2VQYXRoLmNvbXBvbmVudHMsIHVuZGVmaW5lZCwgdHJ1ZSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgYmFzZVBhdGggPSBhZGRQYXRoOyAgIC8vIE5vIG5lZWQgdG8gY2xvbmUsIHdlJ3ZlIHB1bGxlZCBpdCBmcm9tIHRoZSBsaXN0XG4gICAgICAgICAgYmFzZVBhdGgubmV3UG9zKys7XG4gICAgICAgICAgc2VsZi5wdXNoQ29tcG9uZW50KGJhc2VQYXRoLmNvbXBvbmVudHMsIHRydWUsIHVuZGVmaW5lZCk7XG4gICAgICAgIH1cblxuICAgICAgICBvbGRQb3MgPSBzZWxmLmV4dHJhY3RDb21tb24oYmFzZVBhdGgsIG5ld1N0cmluZywgb2xkU3RyaW5nLCBkaWFnb25hbFBhdGgpO1xuXG4gICAgICAgIC8vIElmIHdlIGhhdmUgaGl0IHRoZSBlbmQgb2YgYm90aCBzdHJpbmdzLCB0aGVuIHdlIGFyZSBkb25lXG4gICAgICAgIGlmIChiYXNlUGF0aC5uZXdQb3MgKyAxID49IG5ld0xlbiAmJiBvbGRQb3MgKyAxID49IG9sZExlbikge1xuICAgICAgICAgIHJldHVybiBkb25lKGJ1aWxkVmFsdWVzKHNlbGYsIGJhc2VQYXRoLmNvbXBvbmVudHMsIG5ld1N0cmluZywgb2xkU3RyaW5nLCBzZWxmLnVzZUxvbmdlc3RUb2tlbikpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIC8vIE90aGVyd2lzZSB0cmFjayB0aGlzIHBhdGggYXMgYSBwb3RlbnRpYWwgY2FuZGlkYXRlIGFuZCBjb250aW51ZS5cbiAgICAgICAgICBiZXN0UGF0aFtkaWFnb25hbFBhdGhdID0gYmFzZVBhdGg7XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgZWRpdExlbmd0aCsrO1xuICAgIH1cblxuICAgIC8vIFBlcmZvcm1zIHRoZSBsZW5ndGggb2YgZWRpdCBpdGVyYXRpb24uIElzIGEgYml0IGZ1Z2x5IGFzIHRoaXMgaGFzIHRvIHN1cHBvcnQgdGhlXG4gICAgLy8gc3luYyBhbmQgYXN5bmMgbW9kZSB3aGljaCBpcyBuZXZlciBmdW4uIExvb3BzIG92ZXIgZXhlY0VkaXRMZW5ndGggdW50aWwgYSB2YWx1ZVxuICAgIC8vIGlzIHByb2R1Y2VkLlxuICAgIGlmIChjYWxsYmFjaykge1xuICAgICAgKGZ1bmN0aW9uIGV4ZWMoKSB7XG4gICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKSB7XG4gICAgICAgICAgLy8gVGhpcyBzaG91bGQgbm90IGhhcHBlbiwgYnV0IHdlIHdhbnQgdG8gYmUgc2FmZS5cbiAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgbmV4dCAqL1xuICAgICAgICAgIGlmIChlZGl0TGVuZ3RoID4gbWF4RWRpdExlbmd0aCkge1xuICAgICAgICAgICAgcmV0dXJuIGNhbGxiYWNrKCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgaWYgKCFleGVjRWRpdExlbmd0aCgpKSB7XG4gICAgICAgICAgICBleGVjKCk7XG4gICAgICAgICAgfVxuICAgICAgICB9LCAwKTtcbiAgICAgIH0oKSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHdoaWxlIChlZGl0TGVuZ3RoIDw9IG1heEVkaXRMZW5ndGgpIHtcbiAgICAgICAgbGV0IHJldCA9IGV4ZWNFZGl0TGVuZ3RoKCk7XG4gICAgICAgIGlmIChyZXQpIHtcbiAgICAgICAgICByZXR1cm4gcmV0O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICB9LFxuXG4gIHB1c2hDb21wb25lbnQoY29tcG9uZW50cywgYWRkZWQsIHJlbW92ZWQpIHtcbiAgICBsZXQgbGFzdCA9IGNvbXBvbmVudHNbY29tcG9uZW50cy5sZW5ndGggLSAxXTtcbiAgICBpZiAobGFzdCAmJiBsYXN0LmFkZGVkID09PSBhZGRlZCAmJiBsYXN0LnJlbW92ZWQgPT09IHJlbW92ZWQpIHtcbiAgICAgIC8vIFdlIG5lZWQgdG8gY2xvbmUgaGVyZSBhcyB0aGUgY29tcG9uZW50IGNsb25lIG9wZXJhdGlvbiBpcyBqdXN0XG4gICAgICAvLyBhcyBzaGFsbG93IGFycmF5IGNsb25lXG4gICAgICBjb21wb25lbnRzW2NvbXBvbmVudHMubGVuZ3RoIC0gMV0gPSB7Y291bnQ6IGxhc3QuY291bnQgKyAxLCBhZGRlZDogYWRkZWQsIHJlbW92ZWQ6IHJlbW92ZWQgfTtcbiAgICB9IGVsc2Uge1xuICAgICAgY29tcG9uZW50cy5wdXNoKHtjb3VudDogMSwgYWRkZWQ6IGFkZGVkLCByZW1vdmVkOiByZW1vdmVkIH0pO1xuICAgIH1cbiAgfSxcbiAgZXh0cmFjdENvbW1vbihiYXNlUGF0aCwgbmV3U3RyaW5nLCBvbGRTdHJpbmcsIGRpYWdvbmFsUGF0aCkge1xuICAgIGxldCBuZXdMZW4gPSBuZXdTdHJpbmcubGVuZ3RoLFxuICAgICAgICBvbGRMZW4gPSBvbGRTdHJpbmcubGVuZ3RoLFxuICAgICAgICBuZXdQb3MgPSBiYXNlUGF0aC5uZXdQb3MsXG4gICAgICAgIG9sZFBvcyA9IG5ld1BvcyAtIGRpYWdvbmFsUGF0aCxcblxuICAgICAgICBjb21tb25Db3VudCA9IDA7XG4gICAgd2hpbGUgKG5ld1BvcyArIDEgPCBuZXdMZW4gJiYgb2xkUG9zICsgMSA8IG9sZExlbiAmJiB0aGlzLmVxdWFscyhuZXdTdHJpbmdbbmV3UG9zICsgMV0sIG9sZFN0cmluZ1tvbGRQb3MgKyAxXSkpIHtcbiAgICAgIG5ld1BvcysrO1xuICAgICAgb2xkUG9zKys7XG4gICAgICBjb21tb25Db3VudCsrO1xuICAgIH1cblxuICAgIGlmIChjb21tb25Db3VudCkge1xuICAgICAgYmFzZVBhdGguY29tcG9uZW50cy5wdXNoKHtjb3VudDogY29tbW9uQ291bnR9KTtcbiAgICB9XG5cbiAgICBiYXNlUGF0aC5uZXdQb3MgPSBuZXdQb3M7XG4gICAgcmV0dXJuIG9sZFBvcztcbiAgfSxcblxuICBlcXVhbHMobGVmdCwgcmlnaHQpIHtcbiAgICByZXR1cm4gbGVmdCA9PT0gcmlnaHQ7XG4gIH0sXG4gIHJlbW92ZUVtcHR5KGFycmF5KSB7XG4gICAgbGV0IHJldCA9IFtdO1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgIGlmIChhcnJheVtpXSkge1xuICAgICAgICByZXQucHVzaChhcnJheVtpXSk7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXQ7XG4gIH0sXG4gIGNhc3RJbnB1dCh2YWx1ZSkge1xuICAgIHJldHVybiB2YWx1ZTtcbiAgfSxcbiAgdG9rZW5pemUodmFsdWUpIHtcbiAgICByZXR1cm4gdmFsdWUuc3BsaXQoJycpO1xuICB9LFxuICBqb2luKGNoYXJzKSB7XG4gICAgcmV0dXJuIGNoYXJzLmpvaW4oJycpO1xuICB9XG59O1xuXG5mdW5jdGlvbiBidWlsZFZhbHVlcyhkaWZmLCBjb21wb25lbnRzLCBuZXdTdHJpbmcsIG9sZFN0cmluZywgdXNlTG9uZ2VzdFRva2VuKSB7XG4gIGxldCBjb21wb25lbnRQb3MgPSAwLFxuICAgICAgY29tcG9uZW50TGVuID0gY29tcG9uZW50cy5sZW5ndGgsXG4gICAgICBuZXdQb3MgPSAwLFxuICAgICAgb2xkUG9zID0gMDtcblxuICBmb3IgKDsgY29tcG9uZW50UG9zIDwgY29tcG9uZW50TGVuOyBjb21wb25lbnRQb3MrKykge1xuICAgIGxldCBjb21wb25lbnQgPSBjb21wb25lbnRzW2NvbXBvbmVudFBvc107XG4gICAgaWYgKCFjb21wb25lbnQucmVtb3ZlZCkge1xuICAgICAgaWYgKCFjb21wb25lbnQuYWRkZWQgJiYgdXNlTG9uZ2VzdFRva2VuKSB7XG4gICAgICAgIGxldCB2YWx1ZSA9IG5ld1N0cmluZy5zbGljZShuZXdQb3MsIG5ld1BvcyArIGNvbXBvbmVudC5jb3VudCk7XG4gICAgICAgIHZhbHVlID0gdmFsdWUubWFwKGZ1bmN0aW9uKHZhbHVlLCBpKSB7XG4gICAgICAgICAgbGV0IG9sZFZhbHVlID0gb2xkU3RyaW5nW29sZFBvcyArIGldO1xuICAgICAgICAgIHJldHVybiBvbGRWYWx1ZS5sZW5ndGggPiB2YWx1ZS5sZW5ndGggPyBvbGRWYWx1ZSA6IHZhbHVlO1xuICAgICAgICB9KTtcblxuICAgICAgICBjb21wb25lbnQudmFsdWUgPSBkaWZmLmpvaW4odmFsdWUpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY29tcG9uZW50LnZhbHVlID0gZGlmZi5qb2luKG5ld1N0cmluZy5zbGljZShuZXdQb3MsIG5ld1BvcyArIGNvbXBvbmVudC5jb3VudCkpO1xuICAgICAgfVxuICAgICAgbmV3UG9zICs9IGNvbXBvbmVudC5jb3VudDtcblxuICAgICAgLy8gQ29tbW9uIGNhc2VcbiAgICAgIGlmICghY29tcG9uZW50LmFkZGVkKSB7XG4gICAgICAgIG9sZFBvcyArPSBjb21wb25lbnQuY291bnQ7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGNvbXBvbmVudC52YWx1ZSA9IGRpZmYuam9pbihvbGRTdHJpbmcuc2xpY2Uob2xkUG9zLCBvbGRQb3MgKyBjb21wb25lbnQuY291bnQpKTtcbiAgICAgIG9sZFBvcyArPSBjb21wb25lbnQuY291bnQ7XG5cbiAgICAgIC8vIFJldmVyc2UgYWRkIGFuZCByZW1vdmUgc28gcmVtb3ZlcyBhcmUgb3V0cHV0IGZpcnN0IHRvIG1hdGNoIGNvbW1vbiBjb252ZW50aW9uXG4gICAgICAvLyBUaGUgZGlmZmluZyBhbGdvcml0aG0gaXMgdGllZCB0byBhZGQgdGhlbiByZW1vdmUgb3V0cHV0IGFuZCB0aGlzIGlzIHRoZSBzaW1wbGVzdFxuICAgICAgLy8gcm91dGUgdG8gZ2V0IHRoZSBkZXNpcmVkIG91dHB1dCB3aXRoIG1pbmltYWwgb3ZlcmhlYWQuXG4gICAgICBpZiAoY29tcG9uZW50UG9zICYmIGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV0uYWRkZWQpIHtcbiAgICAgICAgbGV0IHRtcCA9IGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV07XG4gICAgICAgIGNvbXBvbmVudHNbY29tcG9uZW50UG9zIC0gMV0gPSBjb21wb25lbnRzW2NvbXBvbmVudFBvc107XG4gICAgICAgIGNvbXBvbmVudHNbY29tcG9uZW50UG9zXSA9IHRtcDtcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvLyBTcGVjaWFsIGNhc2UgaGFuZGxlIGZvciB3aGVuIG9uZSB0ZXJtaW5hbCBpcyBpZ25vcmVkLiBGb3IgdGhpcyBjYXNlIHdlIG1lcmdlIHRoZVxuICAvLyB0ZXJtaW5hbCBpbnRvIHRoZSBwcmlvciBzdHJpbmcgYW5kIGRyb3AgdGhlIGNoYW5nZS5cbiAgbGV0IGxhc3RDb21wb25lbnQgPSBjb21wb25lbnRzW2NvbXBvbmVudExlbiAtIDFdO1xuICBpZiAoY29tcG9uZW50TGVuID4gMVxuICAgICAgJiYgKGxhc3RDb21wb25lbnQuYWRkZWQgfHwgbGFzdENvbXBvbmVudC5yZW1vdmVkKVxuICAgICAgJiYgZGlmZi5lcXVhbHMoJycsIGxhc3RDb21wb25lbnQudmFsdWUpKSB7XG4gICAgY29tcG9uZW50c1tjb21wb25lbnRMZW4gLSAyXS52YWx1ZSArPSBsYXN0Q29tcG9uZW50LnZhbHVlO1xuICAgIGNvbXBvbmVudHMucG9wKCk7XG4gIH1cblxuICByZXR1cm4gY29tcG9uZW50cztcbn1cblxuZnVuY3Rpb24gY2xvbmVQYXRoKHBhdGgpIHtcbiAgcmV0dXJuIHsgbmV3UG9zOiBwYXRoLm5ld1BvcywgY29tcG9uZW50czogcGF0aC5jb21wb25lbnRzLnNsaWNlKDApIH07XG59XG4iXX0= + + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.characterDiff = undefined; + exports. diffChars = diffChars; + + var _base = __webpack_require__(1) ; + + + var _base2 = _interopRequireDefault(_base); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var characterDiff = exports. characterDiff = new _base2['default']() ; + function diffChars(oldStr, newStr, callback) { + return characterDiff.diff(oldStr, newStr, callback); + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O2dDQUdnQixTLEdBQUEsUzs7QUFIaEIsSSx5QkFBQSx5Qix3QkFBQTs7Ozs7Ozt1QkFFTyxJQUFNLGdCLHlCQUFBLFEsd0JBQUEsZ0JBQWdCLEkseUJBQUEsbUIsd0JBQXRCO0FBQ0EsU0FBUyxTQUFULENBQW1CLE1BQW5CLEVBQTJCLE1BQTNCLEVBQW1DLFFBQW5DLEVBQTZDO0FBQUUsU0FBTyxjQUFjLElBQWQsQ0FBbUIsTUFBbkIsRUFBMkIsTUFBM0IsRUFBbUMsUUFBbkMsQ0FBUDtBQUFzRCIsImZpbGUiOiJjaGFyYWN0ZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuXG5leHBvcnQgY29uc3QgY2hhcmFjdGVyRGlmZiA9IG5ldyBEaWZmKCk7XG5leHBvcnQgZnVuY3Rpb24gZGlmZkNoYXJzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gY2hhcmFjdGVyRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ== + + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.wordDiff = undefined; + exports. diffWords = diffWords; + exports. diffWordsWithSpace = diffWordsWithSpace; + + var _base = __webpack_require__(1) ; + + + var _base2 = _interopRequireDefault(_base); + + + var _params = __webpack_require__(4) ; + + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + + + // Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode + // + // Ranges and exceptions: + // Latin-1 Supplement, 0080–00FF + // - U+00D7 × Multiplication sign + // - U+00F7 ÷ Division sign + // Latin Extended-A, 0100–017F + // Latin Extended-B, 0180–024F + // IPA Extensions, 0250–02AF + // Spacing Modifier Letters, 02B0–02FF + // - U+02C7 ˇ ˇ Caron + // - U+02D8 ˘ ˘ Breve + // - U+02D9 ˙ ˙ Dot Above + // - U+02DA ˚ ˚ Ring Above + // - U+02DB ˛ ˛ Ogonek + // - U+02DC ˜ ˜ Small Tilde + // - U+02DD ˝ ˝ Double Acute Accent + // Latin Extended Additional, 1E00–1EFF + var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/; + + var reWhitespace = /\S/; + + var wordDiff = exports. wordDiff = new _base2['default']() ; + wordDiff.equals = function (left, right) { + return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right); + }; + wordDiff.tokenize = function (value) { + var tokens = value.split(/(\s+|\b)/); + + // Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set. + for (var i = 0; i < tokens.length - 1; i++) { + // If we have an empty string in the next field and we have only word chars before and after, merge + if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) { + tokens[i] += tokens[i + 2]; + tokens.splice(i + 1, 2); + i--; + } + } + + return tokens; + }; + + function diffWords(oldStr, newStr, callback) { + var options = (0, _params.generateOptions) (callback, { ignoreWhitespace: true }); + return wordDiff.diff(oldStr, newStr, options); + } + function diffWordsWithSpace(oldStr, newStr, callback) { + return wordDiff.diff(oldStr, newStr, callback); + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztnQ0ErQ2dCLFMsR0FBQSxTO3lEQUlBLGtCLEdBQUEsa0I7O0FBbkRoQixJLHlCQUFBLHlCLHdCQUFBOzs7Ozs7QUFDQSxJLHlCQUFBLG1DLHdCQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0JBLElBQU0sb0JBQW9CLCtEQUExQjs7QUFFQSxJQUFNLGVBQWUsSUFBckI7O0FBRU8sSUFBTSxXLHlCQUFBLFEsd0JBQUEsV0FBVyxJLHlCQUFBLG1CLHdCQUFqQjtBQUNQLFNBQVMsTUFBVCxHQUFrQixVQUFTLElBQVQsRUFBZSxLQUFmLEVBQXNCO0FBQ3RDLFNBQU8sU0FBUyxLQUFULElBQW1CLEtBQUssT0FBTCxDQUFhLGdCQUFiLElBQWlDLENBQUMsYUFBYSxJQUFiLENBQWtCLElBQWxCLENBQWxDLElBQTZELENBQUMsYUFBYSxJQUFiLENBQWtCLEtBQWxCLENBQXhGO0FBQ0QsQ0FGRDtBQUdBLFNBQVMsUUFBVCxHQUFvQixVQUFTLEtBQVQsRUFBZ0I7QUFDbEMsTUFBSSxTQUFTLE1BQU0sS0FBTixDQUFZLFVBQVosQ0FBYjs7O0FBR0EsT0FBSyxJQUFJLElBQUksQ0FBYixFQUFnQixJQUFJLE9BQU8sTUFBUCxHQUFnQixDQUFwQyxFQUF1QyxHQUF2QyxFQUE0Qzs7QUFFMUMsUUFBSSxDQUFDLE9BQU8sSUFBSSxDQUFYLENBQUQsSUFBa0IsT0FBTyxJQUFJLENBQVgsQ0FBbEIsSUFDSyxrQkFBa0IsSUFBbEIsQ0FBdUIsT0FBTyxDQUFQLENBQXZCLENBREwsSUFFSyxrQkFBa0IsSUFBbEIsQ0FBdUIsT0FBTyxJQUFJLENBQVgsQ0FBdkIsQ0FGVCxFQUVnRDtBQUM5QyxhQUFPLENBQVAsS0FBYSxPQUFPLElBQUksQ0FBWCxDQUFiO0FBQ0EsYUFBTyxNQUFQLENBQWMsSUFBSSxDQUFsQixFQUFxQixDQUFyQjtBQUNBO0FBQ0Q7QUFDRjs7QUFFRCxTQUFPLE1BQVA7QUFDRCxDQWhCRDs7QUFrQk8sU0FBUyxTQUFULENBQW1CLE1BQW5CLEVBQTJCLE1BQTNCLEVBQW1DLFFBQW5DLEVBQTZDO0FBQ2xELE1BQUksVSx5QkFBVSw0Qix3QkFBQSxDQUFnQixRQUFoQixFQUEwQixFQUFDLGtCQUFrQixJQUFuQixFQUExQixDQUFkO0FBQ0EsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLE9BQTlCLENBQVA7QUFDRDtBQUNNLFNBQVMsa0JBQVQsQ0FBNEIsTUFBNUIsRUFBb0MsTUFBcEMsRUFBNEMsUUFBNUMsRUFBc0Q7QUFDM0QsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLFFBQTlCLENBQVA7QUFDRCIsImZpbGUiOiJ3b3JkLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcbmltcG9ydCB7Z2VuZXJhdGVPcHRpb25zfSBmcm9tICcuLi91dGlsL3BhcmFtcyc7XG5cbi8vIEJhc2VkIG9uIGh0dHBzOi8vZW4ud2lraXBlZGlhLm9yZy93aWtpL0xhdGluX3NjcmlwdF9pbl9Vbmljb2RlXG4vL1xuLy8gUmFuZ2VzIGFuZCBleGNlcHRpb25zOlxuLy8gTGF0aW4tMSBTdXBwbGVtZW50LCAwMDgw4oCTMDBGRlxuLy8gIC0gVSswMEQ3ICDDlyBNdWx0aXBsaWNhdGlvbiBzaWduXG4vLyAgLSBVKzAwRjcgIMO3IERpdmlzaW9uIHNpZ25cbi8vIExhdGluIEV4dGVuZGVkLUEsIDAxMDDigJMwMTdGXG4vLyBMYXRpbiBFeHRlbmRlZC1CLCAwMTgw4oCTMDI0RlxuLy8gSVBBIEV4dGVuc2lvbnMsIDAyNTDigJMwMkFGXG4vLyBTcGFjaW5nIE1vZGlmaWVyIExldHRlcnMsIDAyQjDigJMwMkZGXG4vLyAgLSBVKzAyQzcgIMuHICYjNzExOyAgQ2Fyb25cbi8vICAtIFUrMDJEOCAgy5ggJiM3Mjg7ICBCcmV2ZVxuLy8gIC0gVSswMkQ5ICDLmSAmIzcyOTsgIERvdCBBYm92ZVxuLy8gIC0gVSswMkRBICDLmiAmIzczMDsgIFJpbmcgQWJvdmVcbi8vICAtIFUrMDJEQiAgy5sgJiM3MzE7ICBPZ29uZWtcbi8vICAtIFUrMDJEQyAgy5wgJiM3MzI7ICBTbWFsbCBUaWxkZVxuLy8gIC0gVSswMkREICDLnSAmIzczMzsgIERvdWJsZSBBY3V0ZSBBY2NlbnRcbi8vIExhdGluIEV4dGVuZGVkIEFkZGl0aW9uYWwsIDFFMDDigJMxRUZGXG5jb25zdCBleHRlbmRlZFdvcmRDaGFycyA9IC9eW2EtekEtWlxcdXtDMH0tXFx1e0ZGfVxcdXtEOH0tXFx1e0Y2fVxcdXtGOH0tXFx1ezJDNn1cXHV7MkM4fS1cXHV7MkQ3fVxcdXsyREV9LVxcdXsyRkZ9XFx1ezFFMDB9LVxcdXsxRUZGfV0rJC91O1xuXG5jb25zdCByZVdoaXRlc3BhY2UgPSAvXFxTLztcblxuZXhwb3J0IGNvbnN0IHdvcmREaWZmID0gbmV3IERpZmYoKTtcbndvcmREaWZmLmVxdWFscyA9IGZ1bmN0aW9uKGxlZnQsIHJpZ2h0KSB7XG4gIHJldHVybiBsZWZ0ID09PSByaWdodCB8fCAodGhpcy5vcHRpb25zLmlnbm9yZVdoaXRlc3BhY2UgJiYgIXJlV2hpdGVzcGFjZS50ZXN0KGxlZnQpICYmICFyZVdoaXRlc3BhY2UudGVzdChyaWdodCkpO1xufTtcbndvcmREaWZmLnRva2VuaXplID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgbGV0IHRva2VucyA9IHZhbHVlLnNwbGl0KC8oXFxzK3xcXGIpLyk7XG5cbiAgLy8gSm9pbiB0aGUgYm91bmRhcnkgc3BsaXRzIHRoYXQgd2UgZG8gbm90IGNvbnNpZGVyIHRvIGJlIGJvdW5kYXJpZXMuIFRoaXMgaXMgcHJpbWFyaWx5IHRoZSBleHRlbmRlZCBMYXRpbiBjaGFyYWN0ZXIgc2V0LlxuICBmb3IgKGxldCBpID0gMDsgaSA8IHRva2Vucy5sZW5ndGggLSAxOyBpKyspIHtcbiAgICAvLyBJZiB3ZSBoYXZlIGFuIGVtcHR5IHN0cmluZyBpbiB0aGUgbmV4dCBmaWVsZCBhbmQgd2UgaGF2ZSBvbmx5IHdvcmQgY2hhcnMgYmVmb3JlIGFuZCBhZnRlciwgbWVyZ2VcbiAgICBpZiAoIXRva2Vuc1tpICsgMV0gJiYgdG9rZW5zW2kgKyAyXVxuICAgICAgICAgICYmIGV4dGVuZGVkV29yZENoYXJzLnRlc3QodG9rZW5zW2ldKVxuICAgICAgICAgICYmIGV4dGVuZGVkV29yZENoYXJzLnRlc3QodG9rZW5zW2kgKyAyXSkpIHtcbiAgICAgIHRva2Vuc1tpXSArPSB0b2tlbnNbaSArIDJdO1xuICAgICAgdG9rZW5zLnNwbGljZShpICsgMSwgMik7XG4gICAgICBpLS07XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHRva2Vucztcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmV29yZHMob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7XG4gIGxldCBvcHRpb25zID0gZ2VuZXJhdGVPcHRpb25zKGNhbGxiYWNrLCB7aWdub3JlV2hpdGVzcGFjZTogdHJ1ZX0pO1xuICByZXR1cm4gd29yZERpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG59XG5leHBvcnQgZnVuY3Rpb24gZGlmZldvcmRzV2l0aFNwYWNlKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykge1xuICByZXR1cm4gd29yZERpZmYuZGlmZihvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spO1xufVxuIl19 + + +/***/ }, +/* 4 */ +/***/ function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + exports. generateOptions = generateOptions; + function generateOptions(options, defaults) { + if (typeof options === 'function') { + defaults.callback = options; + } else if (options) { + for (var name in options) { + /* istanbul ignore else */ + if (options.hasOwnProperty(name)) { + defaults[name] = options[name]; + } + } + } + return defaults; + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCLGUsR0FBQSxlO0FBQVQsU0FBUyxlQUFULENBQXlCLE9BQXpCLEVBQWtDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBTyxPQUFQLEtBQW1CLFVBQXZCLEVBQW1DO0FBQ2pDLGFBQVMsUUFBVCxHQUFvQixPQUFwQjtBQUNELEdBRkQsTUFFTyxJQUFJLE9BQUosRUFBYTtBQUNsQixTQUFLLElBQUksSUFBVCxJQUFpQixPQUFqQixFQUEwQjs7QUFFeEIsVUFBSSxRQUFRLGNBQVIsQ0FBdUIsSUFBdkIsQ0FBSixFQUFrQztBQUNoQyxpQkFBUyxJQUFULElBQWlCLFFBQVEsSUFBUixDQUFqQjtBQUNEO0FBQ0Y7QUFDRjtBQUNELFNBQU8sUUFBUDtBQUNEIiwiZmlsZSI6InBhcmFtcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBnZW5lcmF0ZU9wdGlvbnMob3B0aW9ucywgZGVmYXVsdHMpIHtcbiAgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgZGVmYXVsdHMuY2FsbGJhY2sgPSBvcHRpb25zO1xuICB9IGVsc2UgaWYgKG9wdGlvbnMpIHtcbiAgICBmb3IgKGxldCBuYW1lIGluIG9wdGlvbnMpIHtcbiAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICBpZiAob3B0aW9ucy5oYXNPd25Qcm9wZXJ0eShuYW1lKSkge1xuICAgICAgICBkZWZhdWx0c1tuYW1lXSA9IG9wdGlvbnNbbmFtZV07XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBkZWZhdWx0cztcbn1cbiJdfQ== + + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.lineDiff = undefined; + exports. diffLines = diffLines; + exports. diffTrimmedLines = diffTrimmedLines; + + var _base = __webpack_require__(1) ; + + + var _base2 = _interopRequireDefault(_base); + + + var _params = __webpack_require__(4) ; + + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var lineDiff = exports. lineDiff = new _base2['default']() ; + lineDiff.tokenize = function (value) { + var retLines = [], + linesAndNewlines = value.split(/(\n|\r\n)/); + + // Ignore the final empty token that occurs if the string ends with a new line + if (!linesAndNewlines[linesAndNewlines.length - 1]) { + linesAndNewlines.pop(); + } + + // Merge the content and line separators into single tokens + for (var i = 0; i < linesAndNewlines.length; i++) { + var line = linesAndNewlines[i]; + + if (i % 2 && !this.options.newlineIsToken) { + retLines[retLines.length - 1] += line; + } else { + if (this.options.ignoreWhitespace) { + line = line.trim(); + } + retLines.push(line); + } + } + + return retLines; + }; + + function diffLines(oldStr, newStr, callback) { + return lineDiff.diff(oldStr, newStr, callback); + } + function diffTrimmedLines(oldStr, newStr, callback) { + var options = (0, _params.generateOptions) (callback, { ignoreWhitespace: true }); + return lineDiff.diff(oldStr, newStr, options); + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztnQ0E4QmdCLFMsR0FBQSxTO3lEQUNBLGdCLEdBQUEsZ0I7O0FBL0JoQixJLHlCQUFBLHlCLHdCQUFBOzs7Ozs7QUFDQSxJLHlCQUFBLG1DLHdCQUFBOzs7Ozt1QkFFTyxJQUFNLFcseUJBQUEsUSx3QkFBQSxXQUFXLEkseUJBQUEsbUIsd0JBQWpCO0FBQ1AsU0FBUyxRQUFULEdBQW9CLFVBQVMsS0FBVCxFQUFnQjtBQUNsQyxNQUFJLFdBQVcsRUFBZjtBQUFBLE1BQ0ksbUJBQW1CLE1BQU0sS0FBTixDQUFZLFdBQVosQ0FEdkI7OztBQUlBLE1BQUksQ0FBQyxpQkFBaUIsaUJBQWlCLE1BQWpCLEdBQTBCLENBQTNDLENBQUwsRUFBb0Q7QUFDbEQscUJBQWlCLEdBQWpCO0FBQ0Q7OztBQUdELE9BQUssSUFBSSxJQUFJLENBQWIsRUFBZ0IsSUFBSSxpQkFBaUIsTUFBckMsRUFBNkMsR0FBN0MsRUFBa0Q7QUFDaEQsUUFBSSxPQUFPLGlCQUFpQixDQUFqQixDQUFYOztBQUVBLFFBQUksSUFBSSxDQUFKLElBQVMsQ0FBQyxLQUFLLE9BQUwsQ0FBYSxjQUEzQixFQUEyQztBQUN6QyxlQUFTLFNBQVMsTUFBVCxHQUFrQixDQUEzQixLQUFpQyxJQUFqQztBQUNELEtBRkQsTUFFTztBQUNMLFVBQUksS0FBSyxPQUFMLENBQWEsZ0JBQWpCLEVBQW1DO0FBQ2pDLGVBQU8sS0FBSyxJQUFMLEVBQVA7QUFDRDtBQUNELGVBQVMsSUFBVCxDQUFjLElBQWQ7QUFDRDtBQUNGOztBQUVELFNBQU8sUUFBUDtBQUNELENBeEJEOztBQTBCTyxTQUFTLFNBQVQsQ0FBbUIsTUFBbkIsRUFBMkIsTUFBM0IsRUFBbUMsUUFBbkMsRUFBNkM7QUFBRSxTQUFPLFNBQVMsSUFBVCxDQUFjLE1BQWQsRUFBc0IsTUFBdEIsRUFBOEIsUUFBOUIsQ0FBUDtBQUFpRDtBQUNoRyxTQUFTLGdCQUFULENBQTBCLE1BQTFCLEVBQWtDLE1BQWxDLEVBQTBDLFFBQTFDLEVBQW9EO0FBQ3pELE1BQUksVSx5QkFBVSw0Qix3QkFBQSxDQUFnQixRQUFoQixFQUEwQixFQUFDLGtCQUFrQixJQUFuQixFQUExQixDQUFkO0FBQ0EsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLE9BQTlCLENBQVA7QUFDRCIsImZpbGUiOiJsaW5lLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcbmltcG9ydCB7Z2VuZXJhdGVPcHRpb25zfSBmcm9tICcuLi91dGlsL3BhcmFtcyc7XG5cbmV4cG9ydCBjb25zdCBsaW5lRGlmZiA9IG5ldyBEaWZmKCk7XG5saW5lRGlmZi50b2tlbml6ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gIGxldCByZXRMaW5lcyA9IFtdLFxuICAgICAgbGluZXNBbmROZXdsaW5lcyA9IHZhbHVlLnNwbGl0KC8oXFxufFxcclxcbikvKTtcblxuICAvLyBJZ25vcmUgdGhlIGZpbmFsIGVtcHR5IHRva2VuIHRoYXQgb2NjdXJzIGlmIHRoZSBzdHJpbmcgZW5kcyB3aXRoIGEgbmV3IGxpbmVcbiAgaWYgKCFsaW5lc0FuZE5ld2xpbmVzW2xpbmVzQW5kTmV3bGluZXMubGVuZ3RoIC0gMV0pIHtcbiAgICBsaW5lc0FuZE5ld2xpbmVzLnBvcCgpO1xuICB9XG5cbiAgLy8gTWVyZ2UgdGhlIGNvbnRlbnQgYW5kIGxpbmUgc2VwYXJhdG9ycyBpbnRvIHNpbmdsZSB0b2tlbnNcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBsaW5lc0FuZE5ld2xpbmVzLmxlbmd0aDsgaSsrKSB7XG4gICAgbGV0IGxpbmUgPSBsaW5lc0FuZE5ld2xpbmVzW2ldO1xuXG4gICAgaWYgKGkgJSAyICYmICF0aGlzLm9wdGlvbnMubmV3bGluZUlzVG9rZW4pIHtcbiAgICAgIHJldExpbmVzW3JldExpbmVzLmxlbmd0aCAtIDFdICs9IGxpbmU7XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmICh0aGlzLm9wdGlvbnMuaWdub3JlV2hpdGVzcGFjZSkge1xuICAgICAgICBsaW5lID0gbGluZS50cmltKCk7XG4gICAgICB9XG4gICAgICByZXRMaW5lcy5wdXNoKGxpbmUpO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiByZXRMaW5lcztcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmTGluZXMob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7IHJldHVybiBsaW5lRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbmV4cG9ydCBmdW5jdGlvbiBkaWZmVHJpbW1lZExpbmVzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykge1xuICBsZXQgb3B0aW9ucyA9IGdlbmVyYXRlT3B0aW9ucyhjYWxsYmFjaywge2lnbm9yZVdoaXRlc3BhY2U6IHRydWV9KTtcbiAgcmV0dXJuIGxpbmVEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIG9wdGlvbnMpO1xufVxuIl19 + + +/***/ }, +/* 6 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.sentenceDiff = undefined; + exports. diffSentences = diffSentences; + + var _base = __webpack_require__(1) ; + + + var _base2 = _interopRequireDefault(_base); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var sentenceDiff = exports. sentenceDiff = new _base2['default']() ; + sentenceDiff.tokenize = function (value) { + return value.split(/(\S.+?[.!?])(?=\s+|$)/); + }; + + function diffSentences(oldStr, newStr, callback) { + return sentenceDiff.diff(oldStr, newStr, callback); + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3NlbnRlbmNlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Z0NBUWdCLGEsR0FBQSxhOztBQVJoQixJLHlCQUFBLHlCLHdCQUFBOzs7Ozs7O3VCQUdPLElBQU0sZSx5QkFBQSxRLHdCQUFBLGVBQWUsSSx5QkFBQSxtQix3QkFBckI7QUFDUCxhQUFhLFFBQWIsR0FBd0IsVUFBUyxLQUFULEVBQWdCO0FBQ3RDLFNBQU8sTUFBTSxLQUFOLENBQVksdUJBQVosQ0FBUDtBQUNELENBRkQ7O0FBSU8sU0FBUyxhQUFULENBQXVCLE1BQXZCLEVBQStCLE1BQS9CLEVBQXVDLFFBQXZDLEVBQWlEO0FBQUUsU0FBTyxhQUFhLElBQWIsQ0FBa0IsTUFBbEIsRUFBMEIsTUFBMUIsRUFBa0MsUUFBbEMsQ0FBUDtBQUFxRCIsImZpbGUiOiJzZW50ZW5jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cblxuZXhwb3J0IGNvbnN0IHNlbnRlbmNlRGlmZiA9IG5ldyBEaWZmKCk7XG5zZW50ZW5jZURpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhcXFMuKz9bLiE/XSkoPz1cXHMrfCQpLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZlNlbnRlbmNlcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIHNlbnRlbmNlRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ== + + +/***/ }, +/* 7 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.cssDiff = undefined; + exports. diffCss = diffCss; + + var _base = __webpack_require__(1) ; + + + var _base2 = _interopRequireDefault(_base); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var cssDiff = exports. cssDiff = new _base2['default']() ; + cssDiff.tokenize = function (value) { + return value.split(/([{}:;,]|\s+)/); + }; + + function diffCss(oldStr, newStr, callback) { + return cssDiff.diff(oldStr, newStr, callback); + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O2dDQU9nQixPLEdBQUEsTzs7QUFQaEIsSSx5QkFBQSx5Qix3QkFBQTs7Ozs7Ozt1QkFFTyxJQUFNLFUseUJBQUEsUSx3QkFBQSxVQUFVLEkseUJBQUEsbUIsd0JBQWhCO0FBQ1AsUUFBUSxRQUFSLEdBQW1CLFVBQVMsS0FBVCxFQUFnQjtBQUNqQyxTQUFPLE1BQU0sS0FBTixDQUFZLGVBQVosQ0FBUDtBQUNELENBRkQ7O0FBSU8sU0FBUyxPQUFULENBQWlCLE1BQWpCLEVBQXlCLE1BQXpCLEVBQWlDLFFBQWpDLEVBQTJDO0FBQUUsU0FBTyxRQUFRLElBQVIsQ0FBYSxNQUFiLEVBQXFCLE1BQXJCLEVBQTZCLFFBQTdCLENBQVA7QUFBZ0QiLCJmaWxlIjoiY3NzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IERpZmYgZnJvbSAnLi9iYXNlJztcblxuZXhwb3J0IGNvbnN0IGNzc0RpZmYgPSBuZXcgRGlmZigpO1xuY3NzRGlmZi50b2tlbml6ZSA9IGZ1bmN0aW9uKHZhbHVlKSB7XG4gIHJldHVybiB2YWx1ZS5zcGxpdCgvKFt7fTo7LF18XFxzKykvKTtcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmQ3NzKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjaykgeyByZXR1cm4gY3NzRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ== + + +/***/ }, +/* 8 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.jsonDiff = undefined; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; + + exports. diffJson = diffJson; + exports. canonicalize = canonicalize; + + var _base = __webpack_require__(1) ; + + + var _base2 = _interopRequireDefault(_base); + + + var _line = __webpack_require__(5) ; + + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + + + var objectPrototypeToString = Object.prototype.toString; + + var jsonDiff = exports. jsonDiff = new _base2['default']() ; + // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a + // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output: + jsonDiff.useLongestToken = true; + + jsonDiff.tokenize = _line.lineDiff. tokenize; + jsonDiff.castInput = function (value) { + var undefinedReplacement = this.options.undefinedReplacement; + + + return typeof value === 'string' ? value : JSON.stringify(canonicalize(value), function (k, v) { + if (typeof v === 'undefined') { + return undefinedReplacement; + } + + return v; + }, ' '); + }; + jsonDiff.equals = function (left, right) { + return (_base2['default']. prototype.equals(left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1')) + ); + }; + + function diffJson(oldObj, newObj, options) { + return jsonDiff.diff(oldObj, newObj, options); + } + + // This function handles the presence of circular references by bailing out when encountering an + // object that is already on the "stack" of items being processed. + function canonicalize(obj, stack, replacementStack) { + stack = stack || []; + replacementStack = replacementStack || []; + + var i = void 0 ; + + for (i = 0; i < stack.length; i += 1) { + if (stack[i] === obj) { + return replacementStack[i]; + } + } + + var canonicalizedObj = void 0 ; + + if ('[object Array]' === objectPrototypeToString.call(obj)) { + stack.push(obj); + canonicalizedObj = new Array(obj.length); + replacementStack.push(canonicalizedObj); + for (i = 0; i < obj.length; i += 1) { + canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack); + } + stack.pop(); + replacementStack.pop(); + return canonicalizedObj; + } + + if (obj && obj.toJSON) { + obj = obj.toJSON(); + } + + if ( (typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) { + stack.push(obj); + canonicalizedObj = {}; + replacementStack.push(canonicalizedObj); + var sortedKeys = [], + key = void 0 ; + for (key in obj) { + /* istanbul ignore else */ + if (obj.hasOwnProperty(key)) { + sortedKeys.push(key); + } + } + sortedKeys.sort(); + for (i = 0; i < sortedKeys.length; i += 1) { + key = sortedKeys[i]; + canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack); + } + stack.pop(); + replacementStack.pop(); + } else { + canonicalizedObj = obj; + } + return canonicalizedObj; + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztnQ0EyQmdCLFEsR0FBQSxRO3lEQUlBLFksR0FBQSxZOztBQS9CaEIsSSx5QkFBQSx5Qix3QkFBQTs7Ozs7O0FBQ0EsSSx5QkFBQSx5Qix3QkFBQTs7Ozs7OztBQUVBLElBQU0sMEJBQTBCLE9BQU8sU0FBUCxDQUFpQixRQUFqRDs7QUFHTyxJQUFNLFcseUJBQUEsUSx3QkFBQSxXQUFXLEkseUJBQUEsbUIsd0JBQWpCOzs7QUFHUCxTQUFTLGVBQVQsR0FBMkIsSUFBM0I7O0FBRUEsU0FBUyxRQUFULEcseUJBQW9CLGUsd0JBQVMsUUFBN0I7QUFDQSxTQUFTLFNBQVQsR0FBcUIsVUFBUyxLQUFULEVBQWdCOzJCQUFBLEksdUJBQzVCLG9CQUQ0QixHQUNKLEtBQUssT0FERCxDQUM1QixvQkFENEI7OztBQUduQyxTQUFPLE9BQU8sS0FBUCxLQUFpQixRQUFqQixHQUE0QixLQUE1QixHQUFvQyxLQUFLLFNBQUwsQ0FBZSxhQUFhLEtBQWIsQ0FBZixFQUFvQyxVQUFTLENBQVQsRUFBWSxDQUFaLEVBQWU7QUFDNUYsUUFBSSxPQUFPLENBQVAsS0FBYSxXQUFqQixFQUE4QjtBQUM1QixhQUFPLG9CQUFQO0FBQ0Q7O0FBRUQsV0FBTyxDQUFQO0FBQ0QsR0FOMEMsRUFNeEMsSUFOd0MsQ0FBM0M7QUFPRCxDQVZEO0FBV0EsU0FBUyxNQUFULEdBQWtCLFVBQVMsSUFBVCxFQUFlLEtBQWYsRUFBc0I7QUFDdEMsUywwQkFBTyxrQix3QkFBSyxTQUFMLENBQWUsTUFBZixDQUFzQixLQUFLLE9BQUwsQ0FBYSxZQUFiLEVBQTJCLElBQTNCLENBQXRCLEVBQXdELE1BQU0sT0FBTixDQUFjLFlBQWQsRUFBNEIsSUFBNUIsQ0FBeEQ7QUFBUDtBQUNELENBRkQ7O0FBSU8sU0FBUyxRQUFULENBQWtCLE1BQWxCLEVBQTBCLE1BQTFCLEVBQWtDLE9BQWxDLEVBQTJDO0FBQUUsU0FBTyxTQUFTLElBQVQsQ0FBYyxNQUFkLEVBQXNCLE1BQXRCLEVBQThCLE9BQTlCLENBQVA7QUFBZ0Q7Ozs7QUFJN0YsU0FBUyxZQUFULENBQXNCLEdBQXRCLEVBQTJCLEtBQTNCLEVBQWtDLGdCQUFsQyxFQUFvRDtBQUN6RCxVQUFRLFNBQVMsRUFBakI7QUFDQSxxQkFBbUIsb0JBQW9CLEVBQXZDOztBQUVBLE1BQUksSSx5QkFBQSxNLHdCQUFKOztBQUVBLE9BQUssSUFBSSxDQUFULEVBQVksSUFBSSxNQUFNLE1BQXRCLEVBQThCLEtBQUssQ0FBbkMsRUFBc0M7QUFDcEMsUUFBSSxNQUFNLENBQU4sTUFBYSxHQUFqQixFQUFzQjtBQUNwQixhQUFPLGlCQUFpQixDQUFqQixDQUFQO0FBQ0Q7QUFDRjs7QUFFRCxNQUFJLG1CLHlCQUFBLE0sd0JBQUo7O0FBRUEsTUFBSSxxQkFBcUIsd0JBQXdCLElBQXhCLENBQTZCLEdBQTdCLENBQXpCLEVBQTREO0FBQzFELFVBQU0sSUFBTixDQUFXLEdBQVg7QUFDQSx1QkFBbUIsSUFBSSxLQUFKLENBQVUsSUFBSSxNQUFkLENBQW5CO0FBQ0EscUJBQWlCLElBQWpCLENBQXNCLGdCQUF0QjtBQUNBLFNBQUssSUFBSSxDQUFULEVBQVksSUFBSSxJQUFJLE1BQXBCLEVBQTRCLEtBQUssQ0FBakMsRUFBb0M7QUFDbEMsdUJBQWlCLENBQWpCLElBQXNCLGFBQWEsSUFBSSxDQUFKLENBQWIsRUFBcUIsS0FBckIsRUFBNEIsZ0JBQTVCLENBQXRCO0FBQ0Q7QUFDRCxVQUFNLEdBQU47QUFDQSxxQkFBaUIsR0FBakI7QUFDQSxXQUFPLGdCQUFQO0FBQ0Q7O0FBRUQsTUFBSSxPQUFPLElBQUksTUFBZixFQUF1QjtBQUNyQixVQUFNLElBQUksTUFBSixFQUFOO0FBQ0Q7O0FBRUQsTSwwQkFBSSxRLHVCQUFPLEdBQVAseUNBQU8sR0FBUCxPQUFlLFFBQWYsSUFBMkIsUUFBUSxJQUF2QyxFQUE2QztBQUMzQyxVQUFNLElBQU4sQ0FBVyxHQUFYO0FBQ0EsdUJBQW1CLEVBQW5CO0FBQ0EscUJBQWlCLElBQWpCLENBQXNCLGdCQUF0QjtBQUNBLFFBQUksYUFBYSxFQUFqQjtBQUFBLFFBQ0ksTSx5QkFBQSxNLHdCQURKO0FBRUEsU0FBSyxHQUFMLElBQVksR0FBWixFQUFpQjs7QUFFZixVQUFJLElBQUksY0FBSixDQUFtQixHQUFuQixDQUFKLEVBQTZCO0FBQzNCLG1CQUFXLElBQVgsQ0FBZ0IsR0FBaEI7QUFDRDtBQUNGO0FBQ0QsZUFBVyxJQUFYO0FBQ0EsU0FBSyxJQUFJLENBQVQsRUFBWSxJQUFJLFdBQVcsTUFBM0IsRUFBbUMsS0FBSyxDQUF4QyxFQUEyQztBQUN6QyxZQUFNLFdBQVcsQ0FBWCxDQUFOO0FBQ0EsdUJBQWlCLEdBQWpCLElBQXdCLGFBQWEsSUFBSSxHQUFKLENBQWIsRUFBdUIsS0FBdkIsRUFBOEIsZ0JBQTlCLENBQXhCO0FBQ0Q7QUFDRCxVQUFNLEdBQU47QUFDQSxxQkFBaUIsR0FBakI7QUFDRCxHQW5CRCxNQW1CTztBQUNMLHVCQUFtQixHQUFuQjtBQUNEO0FBQ0QsU0FBTyxnQkFBUDtBQUNEIiwiZmlsZSI6Impzb24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuaW1wb3J0IHtsaW5lRGlmZn0gZnJvbSAnLi9saW5lJztcblxuY29uc3Qgb2JqZWN0UHJvdG90eXBlVG9TdHJpbmcgPSBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nO1xuXG5cbmV4cG9ydCBjb25zdCBqc29uRGlmZiA9IG5ldyBEaWZmKCk7XG4vLyBEaXNjcmltaW5hdGUgYmV0d2VlbiB0d28gbGluZXMgb2YgcHJldHR5LXByaW50ZWQsIHNlcmlhbGl6ZWQgSlNPTiB3aGVyZSBvbmUgb2YgdGhlbSBoYXMgYVxuLy8gZGFuZ2xpbmcgY29tbWEgYW5kIHRoZSBvdGhlciBkb2Vzbid0LiBUdXJucyBvdXQgaW5jbHVkaW5nIHRoZSBkYW5nbGluZyBjb21tYSB5aWVsZHMgdGhlIG5pY2VzdCBvdXRwdXQ6XG5qc29uRGlmZi51c2VMb25nZXN0VG9rZW4gPSB0cnVlO1xuXG5qc29uRGlmZi50b2tlbml6ZSA9IGxpbmVEaWZmLnRva2VuaXplO1xuanNvbkRpZmYuY2FzdElucHV0ID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgY29uc3Qge3VuZGVmaW5lZFJlcGxhY2VtZW50fSA9IHRoaXMub3B0aW9ucztcblxuICByZXR1cm4gdHlwZW9mIHZhbHVlID09PSAnc3RyaW5nJyA/IHZhbHVlIDogSlNPTi5zdHJpbmdpZnkoY2Fub25pY2FsaXplKHZhbHVlKSwgZnVuY3Rpb24oaywgdikge1xuICAgIGlmICh0eXBlb2YgdiA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICAgIHJldHVybiB1bmRlZmluZWRSZXBsYWNlbWVudDtcbiAgICB9XG5cbiAgICByZXR1cm4gdjtcbiAgfSwgJyAgJyk7XG59O1xuanNvbkRpZmYuZXF1YWxzID0gZnVuY3Rpb24obGVmdCwgcmlnaHQpIHtcbiAgcmV0dXJuIERpZmYucHJvdG90eXBlLmVxdWFscyhsZWZ0LnJlcGxhY2UoLywoW1xcclxcbl0pL2csICckMScpLCByaWdodC5yZXBsYWNlKC8sKFtcXHJcXG5dKS9nLCAnJDEnKSk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZkpzb24ob2xkT2JqLCBuZXdPYmosIG9wdGlvbnMpIHsgcmV0dXJuIGpzb25EaWZmLmRpZmYob2xkT2JqLCBuZXdPYmosIG9wdGlvbnMpOyB9XG5cbi8vIFRoaXMgZnVuY3Rpb24gaGFuZGxlcyB0aGUgcHJlc2VuY2Ugb2YgY2lyY3VsYXIgcmVmZXJlbmNlcyBieSBiYWlsaW5nIG91dCB3aGVuIGVuY291bnRlcmluZyBhblxuLy8gb2JqZWN0IHRoYXQgaXMgYWxyZWFkeSBvbiB0aGUgXCJzdGFja1wiIG9mIGl0ZW1zIGJlaW5nIHByb2Nlc3NlZC5cbmV4cG9ydCBmdW5jdGlvbiBjYW5vbmljYWxpemUob2JqLCBzdGFjaywgcmVwbGFjZW1lbnRTdGFjaykge1xuICBzdGFjayA9IHN0YWNrIHx8IFtdO1xuICByZXBsYWNlbWVudFN0YWNrID0gcmVwbGFjZW1lbnRTdGFjayB8fCBbXTtcblxuICBsZXQgaTtcblxuICBmb3IgKGkgPSAwOyBpIDwgc3RhY2subGVuZ3RoOyBpICs9IDEpIHtcbiAgICBpZiAoc3RhY2tbaV0gPT09IG9iaikge1xuICAgICAgcmV0dXJuIHJlcGxhY2VtZW50U3RhY2tbaV07XG4gICAgfVxuICB9XG5cbiAgbGV0IGNhbm9uaWNhbGl6ZWRPYmo7XG5cbiAgaWYgKCdbb2JqZWN0IEFycmF5XScgPT09IG9iamVjdFByb3RvdHlwZVRvU3RyaW5nLmNhbGwob2JqKSkge1xuICAgIHN0YWNrLnB1c2gob2JqKTtcbiAgICBjYW5vbmljYWxpemVkT2JqID0gbmV3IEFycmF5KG9iai5sZW5ndGgpO1xuICAgIHJlcGxhY2VtZW50U3RhY2sucHVzaChjYW5vbmljYWxpemVkT2JqKTtcbiAgICBmb3IgKGkgPSAwOyBpIDwgb2JqLmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICBjYW5vbmljYWxpemVkT2JqW2ldID0gY2Fub25pY2FsaXplKG9ialtpXSwgc3RhY2ssIHJlcGxhY2VtZW50U3RhY2spO1xuICAgIH1cbiAgICBzdGFjay5wb3AoKTtcbiAgICByZXBsYWNlbWVudFN0YWNrLnBvcCgpO1xuICAgIHJldHVybiBjYW5vbmljYWxpemVkT2JqO1xuICB9XG5cbiAgaWYgKG9iaiAmJiBvYmoudG9KU09OKSB7XG4gICAgb2JqID0gb2JqLnRvSlNPTigpO1xuICB9XG5cbiAgaWYgKHR5cGVvZiBvYmogPT09ICdvYmplY3QnICYmIG9iaiAhPT0gbnVsbCkge1xuICAgIHN0YWNrLnB1c2gob2JqKTtcbiAgICBjYW5vbmljYWxpemVkT2JqID0ge307XG4gICAgcmVwbGFjZW1lbnRTdGFjay5wdXNoKGNhbm9uaWNhbGl6ZWRPYmopO1xuICAgIGxldCBzb3J0ZWRLZXlzID0gW10sXG4gICAgICAgIGtleTtcbiAgICBmb3IgKGtleSBpbiBvYmopIHtcbiAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICBpZiAob2JqLmhhc093blByb3BlcnR5KGtleSkpIHtcbiAgICAgICAgc29ydGVkS2V5cy5wdXNoKGtleSk7XG4gICAgICB9XG4gICAgfVxuICAgIHNvcnRlZEtleXMuc29ydCgpO1xuICAgIGZvciAoaSA9IDA7IGkgPCBzb3J0ZWRLZXlzLmxlbmd0aDsgaSArPSAxKSB7XG4gICAgICBrZXkgPSBzb3J0ZWRLZXlzW2ldO1xuICAgICAgY2Fub25pY2FsaXplZE9ialtrZXldID0gY2Fub25pY2FsaXplKG9ialtrZXldLCBzdGFjaywgcmVwbGFjZW1lbnRTdGFjayk7XG4gICAgfVxuICAgIHN0YWNrLnBvcCgpO1xuICAgIHJlcGxhY2VtZW50U3RhY2sucG9wKCk7XG4gIH0gZWxzZSB7XG4gICAgY2Fub25pY2FsaXplZE9iaiA9IG9iajtcbiAgfVxuICByZXR1cm4gY2Fub25pY2FsaXplZE9iajtcbn1cbiJdfQ== + + +/***/ }, +/* 9 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports.arrayDiff = undefined; + exports. diffArrays = diffArrays; + + var _base = __webpack_require__(1) ; + + + var _base2 = _interopRequireDefault(_base); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var arrayDiff = exports. arrayDiff = new _base2['default']() ; + arrayDiff.tokenize = arrayDiff.join = function (value) { + return value.slice(); + }; + + function diffArrays(oldArr, newArr, callback) { + return arrayDiff.diff(oldArr, newArr, callback); + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2FycmF5LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Z0NBT2dCLFUsR0FBQSxVOztBQVBoQixJLHlCQUFBLHlCLHdCQUFBOzs7Ozs7O3VCQUVPLElBQU0sWSx5QkFBQSxRLHdCQUFBLFlBQVksSSx5QkFBQSxtQix3QkFBbEI7QUFDUCxVQUFVLFFBQVYsR0FBcUIsVUFBVSxJQUFWLEdBQWlCLFVBQVMsS0FBVCxFQUFnQjtBQUNwRCxTQUFPLE1BQU0sS0FBTixFQUFQO0FBQ0QsQ0FGRDs7QUFJTyxTQUFTLFVBQVQsQ0FBb0IsTUFBcEIsRUFBNEIsTUFBNUIsRUFBb0MsUUFBcEMsRUFBOEM7QUFBRSxTQUFPLFVBQVUsSUFBVixDQUFlLE1BQWYsRUFBdUIsTUFBdkIsRUFBK0IsUUFBL0IsQ0FBUDtBQUFrRCIsImZpbGUiOiJhcnJheS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBhcnJheURpZmYgPSBuZXcgRGlmZigpO1xuYXJyYXlEaWZmLnRva2VuaXplID0gYXJyYXlEaWZmLmpvaW4gPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc2xpY2UoKTtcbn07XG5cbmV4cG9ydCBmdW5jdGlvbiBkaWZmQXJyYXlzKG9sZEFyciwgbmV3QXJyLCBjYWxsYmFjaykgeyByZXR1cm4gYXJyYXlEaWZmLmRpZmYob2xkQXJyLCBuZXdBcnIsIGNhbGxiYWNrKTsgfVxuIl19 + + +/***/ }, +/* 10 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports. applyPatch = applyPatch; + exports. applyPatches = applyPatches; + + var _parse = __webpack_require__(11) ; + + var _distanceIterator = __webpack_require__(12) ; + + + var _distanceIterator2 = _interopRequireDefault(_distanceIterator); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + function applyPatch(source, uniDiff) { + var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2]; + + if (typeof uniDiff === 'string') { + uniDiff = (0, _parse.parsePatch) (uniDiff); + } + + if (Array.isArray(uniDiff)) { + if (uniDiff.length > 1) { + throw new Error('applyPatch only works with a single input.'); + } + + uniDiff = uniDiff[0]; + } + + // Apply the diff to the input + var lines = source.split(/\r\n|[\n\v\f\r\x85]/), + delimiters = source.match(/\r\n|[\n\v\f\r\x85]/g) || [], + hunks = uniDiff.hunks, + compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) { + return (line === patchContent + ); + }, + errorCount = 0, + fuzzFactor = options.fuzzFactor || 0, + minLine = 0, + offset = 0, + removeEOFNL = void 0 , + addEOFNL = void 0 ; + + /** + * Checks if the hunk exactly fits on the provided location + */ + function hunkFits(hunk, toPos) { + for (var j = 0; j < hunk.lines.length; j++) { + var line = hunk.lines[j], + operation = line[0], + content = line.substr(1); + + if (operation === ' ' || operation === '-') { + // Context sanity check + if (!compareLine(toPos + 1, lines[toPos], operation, content)) { + errorCount++; + + if (errorCount > fuzzFactor) { + return false; + } + } + toPos++; + } + } + + return true; + } + + // Search best fit offsets for each hunk based on the previous ones + for (var i = 0; i < hunks.length; i++) { + var hunk = hunks[i], + maxLine = lines.length - hunk.oldLines, + localOffset = 0, + toPos = offset + hunk.oldStart - 1; + + var iterator = (0, _distanceIterator2['default']) (toPos, minLine, maxLine); + + for (; localOffset !== undefined; localOffset = iterator()) { + if (hunkFits(hunk, toPos + localOffset)) { + hunk.offset = offset += localOffset; + break; + } + } + + if (localOffset === undefined) { + return false; + } + + // Set lower text limit to end of the current hunk, so next ones don't try + // to fit over already patched text + minLine = hunk.offset + hunk.oldStart + hunk.oldLines; + } + + // Apply patch hunks + for (var _i = 0; _i < hunks.length; _i++) { + var _hunk = hunks[_i], + _toPos = _hunk.offset + _hunk.newStart - 1; + if (_hunk.newLines == 0) { + _toPos++; + } + + for (var j = 0; j < _hunk.lines.length; j++) { + var line = _hunk.lines[j], + operation = line[0], + content = line.substr(1), + delimiter = _hunk.linedelimiters[j]; + + if (operation === ' ') { + _toPos++; + } else if (operation === '-') { + lines.splice(_toPos, 1); + delimiters.splice(_toPos, 1); + /* istanbul ignore else */ + } else if (operation === '+') { + lines.splice(_toPos, 0, content); + delimiters.splice(_toPos, 0, delimiter); + _toPos++; + } else if (operation === '\\') { + var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null; + if (previousOperation === '+') { + removeEOFNL = true; + } else if (previousOperation === '-') { + addEOFNL = true; + } + } + } + } + + // Handle EOFNL insertion/removal + if (removeEOFNL) { + while (!lines[lines.length - 1]) { + lines.pop(); + delimiters.pop(); + } + } else if (addEOFNL) { + lines.push(''); + delimiters.push('\n'); + } + for (var _k = 0; _k < lines.length - 1; _k++) { + lines[_k] = lines[_k] + delimiters[_k]; + } + return lines.join(''); + } + + // Wrapper that supports multiple file patches via callbacks. + function applyPatches(uniDiff, options) { + if (typeof uniDiff === 'string') { + uniDiff = (0, _parse.parsePatch) (uniDiff); + } + + var currentIndex = 0; + function processIndex() { + var index = uniDiff[currentIndex++]; + if (!index) { + return options.complete(); + } + + options.loadFile(index, function (err, data) { + if (err) { + return options.complete(err); + } + + var updatedContent = applyPatch(data, index, options); + options.patched(index, updatedContent, function (err) { + if (err) { + return options.complete(err); + } + + processIndex(); + }); + }); + } + processIndex(); + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBR2dCLFUsR0FBQSxVO3lEQStIQSxZLEdBQUEsWTs7QUFsSWhCLEkseUJBQUEsMkIsd0JBQUE7O0FBQ0EsSSx5QkFBQSx3RCx3QkFBQTs7Ozs7Ozt1QkFFTyxTQUFTLFVBQVQsQ0FBb0IsTUFBcEIsRUFBNEIsT0FBNUIsRUFBbUQ7MkJBQUEsSSx1QkFBZCxPQUFjLHlEQUFKLEVBQUk7O0FBQ3hELE1BQUksT0FBTyxPQUFQLEtBQW1CLFFBQXZCLEVBQWlDO0FBQy9CLGMseUJBQVUsc0Isd0JBQUEsQ0FBVyxPQUFYLENBQVY7QUFDRDs7QUFFRCxNQUFJLE1BQU0sT0FBTixDQUFjLE9BQWQsQ0FBSixFQUE0QjtBQUMxQixRQUFJLFFBQVEsTUFBUixHQUFpQixDQUFyQixFQUF3QjtBQUN0QixZQUFNLElBQUksS0FBSixDQUFVLDRDQUFWLENBQU47QUFDRDs7QUFFRCxjQUFVLFFBQVEsQ0FBUixDQUFWO0FBQ0Q7OztBQUdELE1BQUksUUFBUSxPQUFPLEtBQVAsQ0FBYSxxQkFBYixDQUFaO0FBQUEsTUFDSSxhQUFhLE9BQU8sS0FBUCxDQUFhLHNCQUFiLEtBQXdDLEVBRHpEO0FBQUEsTUFFSSxRQUFRLFFBQVEsS0FGcEI7QUFBQSxNQUlJLGNBQWMsUUFBUSxXQUFSLElBQXdCLFVBQUMsVUFBRCxFQUFhLElBQWIsRUFBbUIsU0FBbkIsRUFBOEIsWUFBOUIsRSx5QkFBQTtBQUFBLFcsd0JBQStDLFNBQVM7QUFBeEQ7QUFBQSxHQUoxQztBQUFBLE1BS0ksYUFBYSxDQUxqQjtBQUFBLE1BTUksYUFBYSxRQUFRLFVBQVIsSUFBc0IsQ0FOdkM7QUFBQSxNQU9JLFVBQVUsQ0FQZDtBQUFBLE1BUUksU0FBUyxDQVJiO0FBQUEsTUFVSSxjLHlCQUFBLE0sd0JBVko7QUFBQSxNQVdJLFcseUJBQUEsTSx3QkFYSjs7Ozs7QUFnQkEsV0FBUyxRQUFULENBQWtCLElBQWxCLEVBQXdCLEtBQXhCLEVBQStCO0FBQzdCLFNBQUssSUFBSSxJQUFJLENBQWIsRUFBZ0IsSUFBSSxLQUFLLEtBQUwsQ0FBVyxNQUEvQixFQUF1QyxHQUF2QyxFQUE0QztBQUMxQyxVQUFJLE9BQU8sS0FBSyxLQUFMLENBQVcsQ0FBWCxDQUFYO0FBQUEsVUFDSSxZQUFZLEtBQUssQ0FBTCxDQURoQjtBQUFBLFVBRUksVUFBVSxLQUFLLE1BQUwsQ0FBWSxDQUFaLENBRmQ7O0FBSUEsVUFBSSxjQUFjLEdBQWQsSUFBcUIsY0FBYyxHQUF2QyxFQUE0Qzs7QUFFMUMsWUFBSSxDQUFDLFlBQVksUUFBUSxDQUFwQixFQUF1QixNQUFNLEtBQU4sQ0FBdkIsRUFBcUMsU0FBckMsRUFBZ0QsT0FBaEQsQ0FBTCxFQUErRDtBQUM3RDs7QUFFQSxjQUFJLGFBQWEsVUFBakIsRUFBNkI7QUFDM0IsbUJBQU8sS0FBUDtBQUNEO0FBQ0Y7QUFDRDtBQUNEO0FBQ0Y7O0FBRUQsV0FBTyxJQUFQO0FBQ0Q7OztBQUdELE9BQUssSUFBSSxJQUFJLENBQWIsRUFBZ0IsSUFBSSxNQUFNLE1BQTFCLEVBQWtDLEdBQWxDLEVBQXVDO0FBQ3JDLFFBQUksT0FBTyxNQUFNLENBQU4sQ0FBWDtBQUFBLFFBQ0ksVUFBVSxNQUFNLE1BQU4sR0FBZSxLQUFLLFFBRGxDO0FBQUEsUUFFSSxjQUFjLENBRmxCO0FBQUEsUUFHSSxRQUFRLFNBQVMsS0FBSyxRQUFkLEdBQXlCLENBSHJDOztBQUtBLFFBQUksVyx5QkFBVyxrQyx3QkFBQSxDQUFpQixLQUFqQixFQUF3QixPQUF4QixFQUFpQyxPQUFqQyxDQUFmOztBQUVBLFdBQU8sZ0JBQWdCLFNBQXZCLEVBQWtDLGNBQWMsVUFBaEQsRUFBNEQ7QUFDMUQsVUFBSSxTQUFTLElBQVQsRUFBZSxRQUFRLFdBQXZCLENBQUosRUFBeUM7QUFDdkMsYUFBSyxNQUFMLEdBQWMsVUFBVSxXQUF4QjtBQUNBO0FBQ0Q7QUFDRjs7QUFFRCxRQUFJLGdCQUFnQixTQUFwQixFQUErQjtBQUM3QixhQUFPLEtBQVA7QUFDRDs7OztBQUlELGNBQVUsS0FBSyxNQUFMLEdBQWMsS0FBSyxRQUFuQixHQUE4QixLQUFLLFFBQTdDO0FBQ0Q7OztBQUdELE9BQUssSUFBSSxLQUFJLENBQWIsRUFBZ0IsS0FBSSxNQUFNLE1BQTFCLEVBQWtDLElBQWxDLEVBQXVDO0FBQ3JDLFFBQUksUUFBTyxNQUFNLEVBQU4sQ0FBWDtBQUFBLFFBQ0ksU0FBUSxNQUFLLE1BQUwsR0FBYyxNQUFLLFFBQW5CLEdBQThCLENBRDFDO0FBRUEsUUFBSSxNQUFLLFFBQUwsSUFBaUIsQ0FBckIsRUFBd0I7QUFBRTtBQUFVOztBQUVwQyxTQUFLLElBQUksSUFBSSxDQUFiLEVBQWdCLElBQUksTUFBSyxLQUFMLENBQVcsTUFBL0IsRUFBdUMsR0FBdkMsRUFBNEM7QUFDMUMsVUFBSSxPQUFPLE1BQUssS0FBTCxDQUFXLENBQVgsQ0FBWDtBQUFBLFVBQ0ksWUFBWSxLQUFLLENBQUwsQ0FEaEI7QUFBQSxVQUVJLFVBQVUsS0FBSyxNQUFMLENBQVksQ0FBWixDQUZkO0FBQUEsVUFHSSxZQUFZLE1BQUssY0FBTCxDQUFvQixDQUFwQixDQUhoQjs7QUFLQSxVQUFJLGNBQWMsR0FBbEIsRUFBdUI7QUFDckI7QUFDRCxPQUZELE1BRU8sSUFBSSxjQUFjLEdBQWxCLEVBQXVCO0FBQzVCLGNBQU0sTUFBTixDQUFhLE1BQWIsRUFBb0IsQ0FBcEI7QUFDQSxtQkFBVyxNQUFYLENBQWtCLE1BQWxCLEVBQXlCLENBQXpCOztBQUVELE9BSk0sTUFJQSxJQUFJLGNBQWMsR0FBbEIsRUFBdUI7QUFDNUIsZ0JBQU0sTUFBTixDQUFhLE1BQWIsRUFBb0IsQ0FBcEIsRUFBdUIsT0FBdkI7QUFDQSxxQkFBVyxNQUFYLENBQWtCLE1BQWxCLEVBQXlCLENBQXpCLEVBQTRCLFNBQTVCO0FBQ0E7QUFDRCxTQUpNLE1BSUEsSUFBSSxjQUFjLElBQWxCLEVBQXdCO0FBQzdCLGNBQUksb0JBQW9CLE1BQUssS0FBTCxDQUFXLElBQUksQ0FBZixJQUFvQixNQUFLLEtBQUwsQ0FBVyxJQUFJLENBQWYsRUFBa0IsQ0FBbEIsQ0FBcEIsR0FBMkMsSUFBbkU7QUFDQSxjQUFJLHNCQUFzQixHQUExQixFQUErQjtBQUM3QiwwQkFBYyxJQUFkO0FBQ0QsV0FGRCxNQUVPLElBQUksc0JBQXNCLEdBQTFCLEVBQStCO0FBQ3BDLHVCQUFXLElBQVg7QUFDRDtBQUNGO0FBQ0Y7QUFDRjs7O0FBR0QsTUFBSSxXQUFKLEVBQWlCO0FBQ2YsV0FBTyxDQUFDLE1BQU0sTUFBTSxNQUFOLEdBQWUsQ0FBckIsQ0FBUixFQUFpQztBQUMvQixZQUFNLEdBQU47QUFDQSxpQkFBVyxHQUFYO0FBQ0Q7QUFDRixHQUxELE1BS08sSUFBSSxRQUFKLEVBQWM7QUFDbkIsVUFBTSxJQUFOLENBQVcsRUFBWDtBQUNBLGVBQVcsSUFBWCxDQUFnQixJQUFoQjtBQUNEO0FBQ0QsT0FBSyxJQUFJLEtBQUssQ0FBZCxFQUFpQixLQUFLLE1BQU0sTUFBTixHQUFlLENBQXJDLEVBQXdDLElBQXhDLEVBQThDO0FBQzVDLFVBQU0sRUFBTixJQUFZLE1BQU0sRUFBTixJQUFZLFdBQVcsRUFBWCxDQUF4QjtBQUNEO0FBQ0QsU0FBTyxNQUFNLElBQU4sQ0FBVyxFQUFYLENBQVA7QUFDRDs7O0FBR00sU0FBUyxZQUFULENBQXNCLE9BQXRCLEVBQStCLE9BQS9CLEVBQXdDO0FBQzdDLE1BQUksT0FBTyxPQUFQLEtBQW1CLFFBQXZCLEVBQWlDO0FBQy9CLGMseUJBQVUsc0Isd0JBQUEsQ0FBVyxPQUFYLENBQVY7QUFDRDs7QUFFRCxNQUFJLGVBQWUsQ0FBbkI7QUFDQSxXQUFTLFlBQVQsR0FBd0I7QUFDdEIsUUFBSSxRQUFRLFFBQVEsY0FBUixDQUFaO0FBQ0EsUUFBSSxDQUFDLEtBQUwsRUFBWTtBQUNWLGFBQU8sUUFBUSxRQUFSLEVBQVA7QUFDRDs7QUFFRCxZQUFRLFFBQVIsQ0FBaUIsS0FBakIsRUFBd0IsVUFBUyxHQUFULEVBQWMsSUFBZCxFQUFvQjtBQUMxQyxVQUFJLEdBQUosRUFBUztBQUNQLGVBQU8sUUFBUSxRQUFSLENBQWlCLEdBQWpCLENBQVA7QUFDRDs7QUFFRCxVQUFJLGlCQUFpQixXQUFXLElBQVgsRUFBaUIsS0FBakIsRUFBd0IsT0FBeEIsQ0FBckI7QUFDQSxjQUFRLE9BQVIsQ0FBZ0IsS0FBaEIsRUFBdUIsY0FBdkIsRUFBdUMsVUFBUyxHQUFULEVBQWM7QUFDbkQsWUFBSSxHQUFKLEVBQVM7QUFDUCxpQkFBTyxRQUFRLFFBQVIsQ0FBaUIsR0FBakIsQ0FBUDtBQUNEOztBQUVEO0FBQ0QsT0FORDtBQU9ELEtBYkQ7QUFjRDtBQUNEO0FBQ0QiLCJmaWxlIjoiYXBwbHkuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge3BhcnNlUGF0Y2h9IGZyb20gJy4vcGFyc2UnO1xuaW1wb3J0IGRpc3RhbmNlSXRlcmF0b3IgZnJvbSAnLi4vdXRpbC9kaXN0YW5jZS1pdGVyYXRvcic7XG5cbmV4cG9ydCBmdW5jdGlvbiBhcHBseVBhdGNoKHNvdXJjZSwgdW5pRGlmZiwgb3B0aW9ucyA9IHt9KSB7XG4gIGlmICh0eXBlb2YgdW5pRGlmZiA9PT0gJ3N0cmluZycpIHtcbiAgICB1bmlEaWZmID0gcGFyc2VQYXRjaCh1bmlEaWZmKTtcbiAgfVxuXG4gIGlmIChBcnJheS5pc0FycmF5KHVuaURpZmYpKSB7XG4gICAgaWYgKHVuaURpZmYubGVuZ3RoID4gMSkge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKCdhcHBseVBhdGNoIG9ubHkgd29ya3Mgd2l0aCBhIHNpbmdsZSBpbnB1dC4nKTtcbiAgICB9XG5cbiAgICB1bmlEaWZmID0gdW5pRGlmZlswXTtcbiAgfVxuXG4gIC8vIEFwcGx5IHRoZSBkaWZmIHRvIHRoZSBpbnB1dFxuICBsZXQgbGluZXMgPSBzb3VyY2Uuc3BsaXQoL1xcclxcbnxbXFxuXFx2XFxmXFxyXFx4ODVdLyksXG4gICAgICBkZWxpbWl0ZXJzID0gc291cmNlLm1hdGNoKC9cXHJcXG58W1xcblxcdlxcZlxcclxceDg1XS9nKSB8fCBbXSxcbiAgICAgIGh1bmtzID0gdW5pRGlmZi5odW5rcyxcblxuICAgICAgY29tcGFyZUxpbmUgPSBvcHRpb25zLmNvbXBhcmVMaW5lIHx8ICgobGluZU51bWJlciwgbGluZSwgb3BlcmF0aW9uLCBwYXRjaENvbnRlbnQpID0+IGxpbmUgPT09IHBhdGNoQ29udGVudCksXG4gICAgICBlcnJvckNvdW50ID0gMCxcbiAgICAgIGZ1enpGYWN0b3IgPSBvcHRpb25zLmZ1enpGYWN0b3IgfHwgMCxcbiAgICAgIG1pbkxpbmUgPSAwLFxuICAgICAgb2Zmc2V0ID0gMCxcblxuICAgICAgcmVtb3ZlRU9GTkwsXG4gICAgICBhZGRFT0ZOTDtcblxuICAvKipcbiAgICogQ2hlY2tzIGlmIHRoZSBodW5rIGV4YWN0bHkgZml0cyBvbiB0aGUgcHJvdmlkZWQgbG9jYXRpb25cbiAgICovXG4gIGZ1bmN0aW9uIGh1bmtGaXRzKGh1bmssIHRvUG9zKSB7XG4gICAgZm9yIChsZXQgaiA9IDA7IGogPCBodW5rLmxpbmVzLmxlbmd0aDsgaisrKSB7XG4gICAgICBsZXQgbGluZSA9IGh1bmsubGluZXNbal0sXG4gICAgICAgICAgb3BlcmF0aW9uID0gbGluZVswXSxcbiAgICAgICAgICBjb250ZW50ID0gbGluZS5zdWJzdHIoMSk7XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICcgJyB8fCBvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICAvLyBDb250ZXh0IHNhbml0eSBjaGVja1xuICAgICAgICBpZiAoIWNvbXBhcmVMaW5lKHRvUG9zICsgMSwgbGluZXNbdG9Qb3NdLCBvcGVyYXRpb24sIGNvbnRlbnQpKSB7XG4gICAgICAgICAgZXJyb3JDb3VudCsrO1xuXG4gICAgICAgICAgaWYgKGVycm9yQ291bnQgPiBmdXp6RmFjdG9yKSB7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIHRvUG9zKys7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIHRydWU7XG4gIH1cblxuICAvLyBTZWFyY2ggYmVzdCBmaXQgb2Zmc2V0cyBmb3IgZWFjaCBodW5rIGJhc2VkIG9uIHRoZSBwcmV2aW91cyBvbmVzXG4gIGZvciAobGV0IGkgPSAwOyBpIDwgaHVua3MubGVuZ3RoOyBpKyspIHtcbiAgICBsZXQgaHVuayA9IGh1bmtzW2ldLFxuICAgICAgICBtYXhMaW5lID0gbGluZXMubGVuZ3RoIC0gaHVuay5vbGRMaW5lcyxcbiAgICAgICAgbG9jYWxPZmZzZXQgPSAwLFxuICAgICAgICB0b1BvcyA9IG9mZnNldCArIGh1bmsub2xkU3RhcnQgLSAxO1xuXG4gICAgbGV0IGl0ZXJhdG9yID0gZGlzdGFuY2VJdGVyYXRvcih0b1BvcywgbWluTGluZSwgbWF4TGluZSk7XG5cbiAgICBmb3IgKDsgbG9jYWxPZmZzZXQgIT09IHVuZGVmaW5lZDsgbG9jYWxPZmZzZXQgPSBpdGVyYXRvcigpKSB7XG4gICAgICBpZiAoaHVua0ZpdHMoaHVuaywgdG9Qb3MgKyBsb2NhbE9mZnNldCkpIHtcbiAgICAgICAgaHVuay5vZmZzZXQgPSBvZmZzZXQgKz0gbG9jYWxPZmZzZXQ7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChsb2NhbE9mZnNldCA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuXG4gICAgLy8gU2V0IGxvd2VyIHRleHQgbGltaXQgdG8gZW5kIG9mIHRoZSBjdXJyZW50IGh1bmssIHNvIG5leHQgb25lcyBkb24ndCB0cnlcbiAgICAvLyB0byBmaXQgb3ZlciBhbHJlYWR5IHBhdGNoZWQgdGV4dFxuICAgIG1pbkxpbmUgPSBodW5rLm9mZnNldCArIGh1bmsub2xkU3RhcnQgKyBodW5rLm9sZExpbmVzO1xuICB9XG5cbiAgLy8gQXBwbHkgcGF0Y2ggaHVua3NcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBodW5rcy5sZW5ndGg7IGkrKykge1xuICAgIGxldCBodW5rID0gaHVua3NbaV0sXG4gICAgICAgIHRvUG9zID0gaHVuay5vZmZzZXQgKyBodW5rLm5ld1N0YXJ0IC0gMTtcbiAgICBpZiAoaHVuay5uZXdMaW5lcyA9PSAwKSB7IHRvUG9zKys7IH1cblxuICAgIGZvciAobGV0IGogPSAwOyBqIDwgaHVuay5saW5lcy5sZW5ndGg7IGorKykge1xuICAgICAgbGV0IGxpbmUgPSBodW5rLmxpbmVzW2pdLFxuICAgICAgICAgIG9wZXJhdGlvbiA9IGxpbmVbMF0sXG4gICAgICAgICAgY29udGVudCA9IGxpbmUuc3Vic3RyKDEpLFxuICAgICAgICAgIGRlbGltaXRlciA9IGh1bmsubGluZWRlbGltaXRlcnNbal07XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICcgJykge1xuICAgICAgICB0b1BvcysrO1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICBsaW5lcy5zcGxpY2UodG9Qb3MsIDEpO1xuICAgICAgICBkZWxpbWl0ZXJzLnNwbGljZSh0b1BvcywgMSk7XG4gICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICcrJykge1xuICAgICAgICBsaW5lcy5zcGxpY2UodG9Qb3MsIDAsIGNvbnRlbnQpO1xuICAgICAgICBkZWxpbWl0ZXJzLnNwbGljZSh0b1BvcywgMCwgZGVsaW1pdGVyKTtcbiAgICAgICAgdG9Qb3MrKztcbiAgICAgIH0gZWxzZSBpZiAob3BlcmF0aW9uID09PSAnXFxcXCcpIHtcbiAgICAgICAgbGV0IHByZXZpb3VzT3BlcmF0aW9uID0gaHVuay5saW5lc1tqIC0gMV0gPyBodW5rLmxpbmVzW2ogLSAxXVswXSA6IG51bGw7XG4gICAgICAgIGlmIChwcmV2aW91c09wZXJhdGlvbiA9PT0gJysnKSB7XG4gICAgICAgICAgcmVtb3ZlRU9GTkwgPSB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKHByZXZpb3VzT3BlcmF0aW9uID09PSAnLScpIHtcbiAgICAgICAgICBhZGRFT0ZOTCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvLyBIYW5kbGUgRU9GTkwgaW5zZXJ0aW9uL3JlbW92YWxcbiAgaWYgKHJlbW92ZUVPRk5MKSB7XG4gICAgd2hpbGUgKCFsaW5lc1tsaW5lcy5sZW5ndGggLSAxXSkge1xuICAgICAgbGluZXMucG9wKCk7XG4gICAgICBkZWxpbWl0ZXJzLnBvcCgpO1xuICAgIH1cbiAgfSBlbHNlIGlmIChhZGRFT0ZOTCkge1xuICAgIGxpbmVzLnB1c2goJycpO1xuICAgIGRlbGltaXRlcnMucHVzaCgnXFxuJyk7XG4gIH1cbiAgZm9yIChsZXQgX2sgPSAwOyBfayA8IGxpbmVzLmxlbmd0aCAtIDE7IF9rKyspIHtcbiAgICBsaW5lc1tfa10gPSBsaW5lc1tfa10gKyBkZWxpbWl0ZXJzW19rXTtcbiAgfVxuICByZXR1cm4gbGluZXMuam9pbignJyk7XG59XG5cbi8vIFdyYXBwZXIgdGhhdCBzdXBwb3J0cyBtdWx0aXBsZSBmaWxlIHBhdGNoZXMgdmlhIGNhbGxiYWNrcy5cbmV4cG9ydCBmdW5jdGlvbiBhcHBseVBhdGNoZXModW5pRGlmZiwgb3B0aW9ucykge1xuICBpZiAodHlwZW9mIHVuaURpZmYgPT09ICdzdHJpbmcnKSB7XG4gICAgdW5pRGlmZiA9IHBhcnNlUGF0Y2godW5pRGlmZik7XG4gIH1cblxuICBsZXQgY3VycmVudEluZGV4ID0gMDtcbiAgZnVuY3Rpb24gcHJvY2Vzc0luZGV4KCkge1xuICAgIGxldCBpbmRleCA9IHVuaURpZmZbY3VycmVudEluZGV4KytdO1xuICAgIGlmICghaW5kZXgpIHtcbiAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKCk7XG4gICAgfVxuXG4gICAgb3B0aW9ucy5sb2FkRmlsZShpbmRleCwgZnVuY3Rpb24oZXJyLCBkYXRhKSB7XG4gICAgICBpZiAoZXJyKSB7XG4gICAgICAgIHJldHVybiBvcHRpb25zLmNvbXBsZXRlKGVycik7XG4gICAgICB9XG5cbiAgICAgIGxldCB1cGRhdGVkQ29udGVudCA9IGFwcGx5UGF0Y2goZGF0YSwgaW5kZXgsIG9wdGlvbnMpO1xuICAgICAgb3B0aW9ucy5wYXRjaGVkKGluZGV4LCB1cGRhdGVkQ29udGVudCwgZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgIGlmIChlcnIpIHtcbiAgICAgICAgICByZXR1cm4gb3B0aW9ucy5jb21wbGV0ZShlcnIpO1xuICAgICAgICB9XG5cbiAgICAgICAgcHJvY2Vzc0luZGV4KCk7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfVxuICBwcm9jZXNzSW5kZXgoKTtcbn1cbiJdfQ== + + +/***/ }, +/* 11 */ +/***/ function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + exports. parsePatch = parsePatch; + function parsePatch(uniDiff) { + var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; + + var diffstr = uniDiff.split(/\r\n|[\n\v\f\r\x85]/), + delimiters = uniDiff.match(/\r\n|[\n\v\f\r\x85]/g) || [], + list = [], + i = 0; + + function parseIndex() { + var index = {}; + list.push(index); + + // Parse diff metadata + while (i < diffstr.length) { + var line = diffstr[i]; + + // File header found, end parsing diff metadata + if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) { + break; + } + + // Diff index + var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line); + if (header) { + index.index = header[1]; + } + + i++; + } + + // Parse file headers if they are defined. Unified diff requires them, but + // there's no technical issues to have an isolated hunk without file header + parseFileHeader(index); + parseFileHeader(index); + + // Parse hunks + index.hunks = []; + + while (i < diffstr.length) { + var _line = diffstr[i]; + + if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) { + break; + } else if (/^@@/.test(_line)) { + index.hunks.push(parseHunk()); + } else if (_line && options.strict) { + // Ignore unexpected content unless in strict mode + throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line)); + } else { + i++; + } + } + } + + // Parses the --- and +++ headers, if none are found, no lines + // are consumed. + function parseFileHeader(index) { + var headerPattern = /^(---|\+\+\+)\s+([\S ]*)(?:\t(.*?)\s*)?$/; + var fileHeader = headerPattern.exec(diffstr[i]); + if (fileHeader) { + var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new'; + index[keyPrefix + 'FileName'] = fileHeader[2]; + index[keyPrefix + 'Header'] = fileHeader[3]; + + i++; + } + } + + // Parses a hunk + // This assumes that we are at the start of a hunk. + function parseHunk() { + var chunkHeaderIndex = i, + chunkHeaderLine = diffstr[i++], + chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/); + + var hunk = { + oldStart: +chunkHeader[1], + oldLines: +chunkHeader[2] || 1, + newStart: +chunkHeader[3], + newLines: +chunkHeader[4] || 1, + lines: [], + linedelimiters: [] + }; + + var addCount = 0, + removeCount = 0; + for (; i < diffstr.length; i++) { + // Lines starting with '---' could be mistaken for the "remove line" operation + // But they could be the header for the next file. Therefore prune such cases out. + if (diffstr[i].indexOf('--- ') === 0 && i + 2 < diffstr.length && diffstr[i + 1].indexOf('+++ ') === 0 && diffstr[i + 2].indexOf('@@') === 0) { + break; + } + var operation = diffstr[i][0]; + + if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') { + hunk.lines.push(diffstr[i]); + hunk.linedelimiters.push(delimiters[i] || '\n'); + + if (operation === '+') { + addCount++; + } else if (operation === '-') { + removeCount++; + } else if (operation === ' ') { + addCount++; + removeCount++; + } + } else { + break; + } + } + + // Handle the empty block count case + if (!addCount && hunk.newLines === 1) { + hunk.newLines = 0; + } + if (!removeCount && hunk.oldLines === 1) { + hunk.oldLines = 0; + } + + // Perform optional sanity checking + if (options.strict) { + if (addCount !== hunk.newLines) { + throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + if (removeCount !== hunk.oldLines) { + throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1)); + } + } + + return hunk; + } + + while (i < diffstr.length) { + parseIndex(); + } + + return list; + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9wYXJzZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCLFUsR0FBQSxVO0FBQVQsU0FBUyxVQUFULENBQW9CLE9BQXBCLEVBQTJDOzJCQUFBLEksdUJBQWQsT0FBYyx5REFBSixFQUFJOztBQUNoRCxNQUFJLFVBQVUsUUFBUSxLQUFSLENBQWMscUJBQWQsQ0FBZDtBQUFBLE1BQ0ksYUFBYSxRQUFRLEtBQVIsQ0FBYyxzQkFBZCxLQUF5QyxFQUQxRDtBQUFBLE1BRUksT0FBTyxFQUZYO0FBQUEsTUFHSSxJQUFJLENBSFI7O0FBS0EsV0FBUyxVQUFULEdBQXNCO0FBQ3BCLFFBQUksUUFBUSxFQUFaO0FBQ0EsU0FBSyxJQUFMLENBQVUsS0FBVjs7O0FBR0EsV0FBTyxJQUFJLFFBQVEsTUFBbkIsRUFBMkI7QUFDekIsVUFBSSxPQUFPLFFBQVEsQ0FBUixDQUFYOzs7QUFHQSxVQUFJLHdCQUF3QixJQUF4QixDQUE2QixJQUE3QixDQUFKLEVBQXdDO0FBQ3RDO0FBQ0Q7OztBQUdELFVBQUksU0FBVSwwQ0FBRCxDQUE2QyxJQUE3QyxDQUFrRCxJQUFsRCxDQUFiO0FBQ0EsVUFBSSxNQUFKLEVBQVk7QUFDVixjQUFNLEtBQU4sR0FBYyxPQUFPLENBQVAsQ0FBZDtBQUNEOztBQUVEO0FBQ0Q7Ozs7QUFJRCxvQkFBZ0IsS0FBaEI7QUFDQSxvQkFBZ0IsS0FBaEI7OztBQUdBLFVBQU0sS0FBTixHQUFjLEVBQWQ7O0FBRUEsV0FBTyxJQUFJLFFBQVEsTUFBbkIsRUFBMkI7QUFDekIsVUFBSSxRQUFPLFFBQVEsQ0FBUixDQUFYOztBQUVBLFVBQUksaUNBQWlDLElBQWpDLENBQXNDLEtBQXRDLENBQUosRUFBaUQ7QUFDL0M7QUFDRCxPQUZELE1BRU8sSUFBSSxNQUFNLElBQU4sQ0FBVyxLQUFYLENBQUosRUFBc0I7QUFDM0IsY0FBTSxLQUFOLENBQVksSUFBWixDQUFpQixXQUFqQjtBQUNELE9BRk0sTUFFQSxJQUFJLFNBQVEsUUFBUSxNQUFwQixFQUE0Qjs7QUFFakMsY0FBTSxJQUFJLEtBQUosQ0FBVSxtQkFBbUIsSUFBSSxDQUF2QixJQUE0QixHQUE1QixHQUFrQyxLQUFLLFNBQUwsQ0FBZSxLQUFmLENBQTVDLENBQU47QUFDRCxPQUhNLE1BR0E7QUFDTDtBQUNEO0FBQ0Y7QUFDRjs7OztBQUlELFdBQVMsZUFBVCxDQUF5QixLQUF6QixFQUFnQztBQUM5QixRQUFNLGdCQUFnQiwwQ0FBdEI7QUFDQSxRQUFNLGFBQWEsY0FBYyxJQUFkLENBQW1CLFFBQVEsQ0FBUixDQUFuQixDQUFuQjtBQUNBLFFBQUksVUFBSixFQUFnQjtBQUNkLFVBQUksWUFBWSxXQUFXLENBQVgsTUFBa0IsS0FBbEIsR0FBMEIsS0FBMUIsR0FBa0MsS0FBbEQ7QUFDQSxZQUFNLFlBQVksVUFBbEIsSUFBZ0MsV0FBVyxDQUFYLENBQWhDO0FBQ0EsWUFBTSxZQUFZLFFBQWxCLElBQThCLFdBQVcsQ0FBWCxDQUE5Qjs7QUFFQTtBQUNEO0FBQ0Y7Ozs7QUFJRCxXQUFTLFNBQVQsR0FBcUI7QUFDbkIsUUFBSSxtQkFBbUIsQ0FBdkI7QUFBQSxRQUNJLGtCQUFrQixRQUFRLEdBQVIsQ0FEdEI7QUFBQSxRQUVJLGNBQWMsZ0JBQWdCLEtBQWhCLENBQXNCLDRDQUF0QixDQUZsQjs7QUFJQSxRQUFJLE9BQU87QUFDVCxnQkFBVSxDQUFDLFlBQVksQ0FBWixDQURGO0FBRVQsZ0JBQVUsQ0FBQyxZQUFZLENBQVosQ0FBRCxJQUFtQixDQUZwQjtBQUdULGdCQUFVLENBQUMsWUFBWSxDQUFaLENBSEY7QUFJVCxnQkFBVSxDQUFDLFlBQVksQ0FBWixDQUFELElBQW1CLENBSnBCO0FBS1QsYUFBTyxFQUxFO0FBTVQsc0JBQWdCO0FBTlAsS0FBWDs7QUFTQSxRQUFJLFdBQVcsQ0FBZjtBQUFBLFFBQ0ksY0FBYyxDQURsQjtBQUVBLFdBQU8sSUFBSSxRQUFRLE1BQW5CLEVBQTJCLEdBQTNCLEVBQWdDOzs7QUFHOUIsVUFBSSxRQUFRLENBQVIsRUFBVyxPQUFYLENBQW1CLE1BQW5CLE1BQStCLENBQS9CLElBQ00sSUFBSSxDQUFKLEdBQVEsUUFBUSxNQUR0QixJQUVLLFFBQVEsSUFBSSxDQUFaLEVBQWUsT0FBZixDQUF1QixNQUF2QixNQUFtQyxDQUZ4QyxJQUdLLFFBQVEsSUFBSSxDQUFaLEVBQWUsT0FBZixDQUF1QixJQUF2QixNQUFpQyxDQUgxQyxFQUc2QztBQUN6QztBQUNIO0FBQ0QsVUFBSSxZQUFZLFFBQVEsQ0FBUixFQUFXLENBQVgsQ0FBaEI7O0FBRUEsVUFBSSxjQUFjLEdBQWQsSUFBcUIsY0FBYyxHQUFuQyxJQUEwQyxjQUFjLEdBQXhELElBQStELGNBQWMsSUFBakYsRUFBdUY7QUFDckYsYUFBSyxLQUFMLENBQVcsSUFBWCxDQUFnQixRQUFRLENBQVIsQ0FBaEI7QUFDQSxhQUFLLGNBQUwsQ0FBb0IsSUFBcEIsQ0FBeUIsV0FBVyxDQUFYLEtBQWlCLElBQTFDOztBQUVBLFlBQUksY0FBYyxHQUFsQixFQUF1QjtBQUNyQjtBQUNELFNBRkQsTUFFTyxJQUFJLGNBQWMsR0FBbEIsRUFBdUI7QUFDNUI7QUFDRCxTQUZNLE1BRUEsSUFBSSxjQUFjLEdBQWxCLEVBQXVCO0FBQzVCO0FBQ0E7QUFDRDtBQUNGLE9BWkQsTUFZTztBQUNMO0FBQ0Q7QUFDRjs7O0FBR0QsUUFBSSxDQUFDLFFBQUQsSUFBYSxLQUFLLFFBQUwsS0FBa0IsQ0FBbkMsRUFBc0M7QUFDcEMsV0FBSyxRQUFMLEdBQWdCLENBQWhCO0FBQ0Q7QUFDRCxRQUFJLENBQUMsV0FBRCxJQUFnQixLQUFLLFFBQUwsS0FBa0IsQ0FBdEMsRUFBeUM7QUFDdkMsV0FBSyxRQUFMLEdBQWdCLENBQWhCO0FBQ0Q7OztBQUdELFFBQUksUUFBUSxNQUFaLEVBQW9CO0FBQ2xCLFVBQUksYUFBYSxLQUFLLFFBQXRCLEVBQWdDO0FBQzlCLGNBQU0sSUFBSSxLQUFKLENBQVUsc0RBQXNELG1CQUFtQixDQUF6RSxDQUFWLENBQU47QUFDRDtBQUNELFVBQUksZ0JBQWdCLEtBQUssUUFBekIsRUFBbUM7QUFDakMsY0FBTSxJQUFJLEtBQUosQ0FBVSx3REFBd0QsbUJBQW1CLENBQTNFLENBQVYsQ0FBTjtBQUNEO0FBQ0Y7O0FBRUQsV0FBTyxJQUFQO0FBQ0Q7O0FBRUQsU0FBTyxJQUFJLFFBQVEsTUFBbkIsRUFBMkI7QUFDekI7QUFDRDs7QUFFRCxTQUFPLElBQVA7QUFDRCIsImZpbGUiOiJwYXJzZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBwYXJzZVBhdGNoKHVuaURpZmYsIG9wdGlvbnMgPSB7fSkge1xuICBsZXQgZGlmZnN0ciA9IHVuaURpZmYuc3BsaXQoL1xcclxcbnxbXFxuXFx2XFxmXFxyXFx4ODVdLyksXG4gICAgICBkZWxpbWl0ZXJzID0gdW5pRGlmZi5tYXRjaCgvXFxyXFxufFtcXG5cXHZcXGZcXHJcXHg4NV0vZykgfHwgW10sXG4gICAgICBsaXN0ID0gW10sXG4gICAgICBpID0gMDtcblxuICBmdW5jdGlvbiBwYXJzZUluZGV4KCkge1xuICAgIGxldCBpbmRleCA9IHt9O1xuICAgIGxpc3QucHVzaChpbmRleCk7XG5cbiAgICAvLyBQYXJzZSBkaWZmIG1ldGFkYXRhXG4gICAgd2hpbGUgKGkgPCBkaWZmc3RyLmxlbmd0aCkge1xuICAgICAgbGV0IGxpbmUgPSBkaWZmc3RyW2ldO1xuXG4gICAgICAvLyBGaWxlIGhlYWRlciBmb3VuZCwgZW5kIHBhcnNpbmcgZGlmZiBtZXRhZGF0YVxuICAgICAgaWYgKC9eKFxcLVxcLVxcLXxcXCtcXCtcXCt8QEApXFxzLy50ZXN0KGxpbmUpKSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfVxuXG4gICAgICAvLyBEaWZmIGluZGV4XG4gICAgICBsZXQgaGVhZGVyID0gKC9eKD86SW5kZXg6fGRpZmYoPzogLXIgXFx3KykrKVxccysoLis/KVxccyokLykuZXhlYyhsaW5lKTtcbiAgICAgIGlmIChoZWFkZXIpIHtcbiAgICAgICAgaW5kZXguaW5kZXggPSBoZWFkZXJbMV07XG4gICAgICB9XG5cbiAgICAgIGkrKztcbiAgICB9XG5cbiAgICAvLyBQYXJzZSBmaWxlIGhlYWRlcnMgaWYgdGhleSBhcmUgZGVmaW5lZC4gVW5pZmllZCBkaWZmIHJlcXVpcmVzIHRoZW0sIGJ1dFxuICAgIC8vIHRoZXJlJ3Mgbm8gdGVjaG5pY2FsIGlzc3VlcyB0byBoYXZlIGFuIGlzb2xhdGVkIGh1bmsgd2l0aG91dCBmaWxlIGhlYWRlclxuICAgIHBhcnNlRmlsZUhlYWRlcihpbmRleCk7XG4gICAgcGFyc2VGaWxlSGVhZGVyKGluZGV4KTtcblxuICAgIC8vIFBhcnNlIGh1bmtzXG4gICAgaW5kZXguaHVua3MgPSBbXTtcblxuICAgIHdoaWxlIChpIDwgZGlmZnN0ci5sZW5ndGgpIHtcbiAgICAgIGxldCBsaW5lID0gZGlmZnN0cltpXTtcblxuICAgICAgaWYgKC9eKEluZGV4OnxkaWZmfFxcLVxcLVxcLXxcXCtcXCtcXCspXFxzLy50ZXN0KGxpbmUpKSB7XG4gICAgICAgIGJyZWFrO1xuICAgICAgfSBlbHNlIGlmICgvXkBALy50ZXN0KGxpbmUpKSB7XG4gICAgICAgIGluZGV4Lmh1bmtzLnB1c2gocGFyc2VIdW5rKCkpO1xuICAgICAgfSBlbHNlIGlmIChsaW5lICYmIG9wdGlvbnMuc3RyaWN0KSB7XG4gICAgICAgIC8vIElnbm9yZSB1bmV4cGVjdGVkIGNvbnRlbnQgdW5sZXNzIGluIHN0cmljdCBtb2RlXG4gICAgICAgIHRocm93IG5ldyBFcnJvcignVW5rbm93biBsaW5lICcgKyAoaSArIDEpICsgJyAnICsgSlNPTi5zdHJpbmdpZnkobGluZSkpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgaSsrO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIC8vIFBhcnNlcyB0aGUgLS0tIGFuZCArKysgaGVhZGVycywgaWYgbm9uZSBhcmUgZm91bmQsIG5vIGxpbmVzXG4gIC8vIGFyZSBjb25zdW1lZC5cbiAgZnVuY3Rpb24gcGFyc2VGaWxlSGVhZGVyKGluZGV4KSB7XG4gICAgY29uc3QgaGVhZGVyUGF0dGVybiA9IC9eKC0tLXxcXCtcXCtcXCspXFxzKyhbXFxTIF0qKSg/OlxcdCguKj8pXFxzKik/JC87XG4gICAgY29uc3QgZmlsZUhlYWRlciA9IGhlYWRlclBhdHRlcm4uZXhlYyhkaWZmc3RyW2ldKTtcbiAgICBpZiAoZmlsZUhlYWRlcikge1xuICAgICAgbGV0IGtleVByZWZpeCA9IGZpbGVIZWFkZXJbMV0gPT09ICctLS0nID8gJ29sZCcgOiAnbmV3JztcbiAgICAgIGluZGV4W2tleVByZWZpeCArICdGaWxlTmFtZSddID0gZmlsZUhlYWRlclsyXTtcbiAgICAgIGluZGV4W2tleVByZWZpeCArICdIZWFkZXInXSA9IGZpbGVIZWFkZXJbM107XG5cbiAgICAgIGkrKztcbiAgICB9XG4gIH1cblxuICAvLyBQYXJzZXMgYSBodW5rXG4gIC8vIFRoaXMgYXNzdW1lcyB0aGF0IHdlIGFyZSBhdCB0aGUgc3RhcnQgb2YgYSBodW5rLlxuICBmdW5jdGlvbiBwYXJzZUh1bmsoKSB7XG4gICAgbGV0IGNodW5rSGVhZGVySW5kZXggPSBpLFxuICAgICAgICBjaHVua0hlYWRlckxpbmUgPSBkaWZmc3RyW2krK10sXG4gICAgICAgIGNodW5rSGVhZGVyID0gY2h1bmtIZWFkZXJMaW5lLnNwbGl0KC9AQCAtKFxcZCspKD86LChcXGQrKSk/IFxcKyhcXGQrKSg/OiwoXFxkKykpPyBAQC8pO1xuXG4gICAgbGV0IGh1bmsgPSB7XG4gICAgICBvbGRTdGFydDogK2NodW5rSGVhZGVyWzFdLFxuICAgICAgb2xkTGluZXM6ICtjaHVua0hlYWRlclsyXSB8fCAxLFxuICAgICAgbmV3U3RhcnQ6ICtjaHVua0hlYWRlclszXSxcbiAgICAgIG5ld0xpbmVzOiArY2h1bmtIZWFkZXJbNF0gfHwgMSxcbiAgICAgIGxpbmVzOiBbXSxcbiAgICAgIGxpbmVkZWxpbWl0ZXJzOiBbXVxuICAgIH07XG5cbiAgICBsZXQgYWRkQ291bnQgPSAwLFxuICAgICAgICByZW1vdmVDb3VudCA9IDA7XG4gICAgZm9yICg7IGkgPCBkaWZmc3RyLmxlbmd0aDsgaSsrKSB7XG4gICAgICAvLyBMaW5lcyBzdGFydGluZyB3aXRoICctLS0nIGNvdWxkIGJlIG1pc3Rha2VuIGZvciB0aGUgXCJyZW1vdmUgbGluZVwiIG9wZXJhdGlvblxuICAgICAgLy8gQnV0IHRoZXkgY291bGQgYmUgdGhlIGhlYWRlciBmb3IgdGhlIG5leHQgZmlsZS4gVGhlcmVmb3JlIHBydW5lIHN1Y2ggY2FzZXMgb3V0LlxuICAgICAgaWYgKGRpZmZzdHJbaV0uaW5kZXhPZignLS0tICcpID09PSAwXG4gICAgICAgICAgICAmJiAoaSArIDIgPCBkaWZmc3RyLmxlbmd0aClcbiAgICAgICAgICAgICYmIGRpZmZzdHJbaSArIDFdLmluZGV4T2YoJysrKyAnKSA9PT0gMFxuICAgICAgICAgICAgJiYgZGlmZnN0cltpICsgMl0uaW5kZXhPZignQEAnKSA9PT0gMCkge1xuICAgICAgICAgIGJyZWFrO1xuICAgICAgfVxuICAgICAgbGV0IG9wZXJhdGlvbiA9IGRpZmZzdHJbaV1bMF07XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICcrJyB8fCBvcGVyYXRpb24gPT09ICctJyB8fCBvcGVyYXRpb24gPT09ICcgJyB8fCBvcGVyYXRpb24gPT09ICdcXFxcJykge1xuICAgICAgICBodW5rLmxpbmVzLnB1c2goZGlmZnN0cltpXSk7XG4gICAgICAgIGh1bmsubGluZWRlbGltaXRlcnMucHVzaChkZWxpbWl0ZXJzW2ldIHx8ICdcXG4nKTtcblxuICAgICAgICBpZiAob3BlcmF0aW9uID09PSAnKycpIHtcbiAgICAgICAgICBhZGRDb3VudCsrO1xuICAgICAgICB9IGVsc2UgaWYgKG9wZXJhdGlvbiA9PT0gJy0nKSB7XG4gICAgICAgICAgcmVtb3ZlQ291bnQrKztcbiAgICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICcgJykge1xuICAgICAgICAgIGFkZENvdW50Kys7XG4gICAgICAgICAgcmVtb3ZlQ291bnQrKztcbiAgICAgICAgfVxuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYnJlYWs7XG4gICAgICB9XG4gICAgfVxuXG4gICAgLy8gSGFuZGxlIHRoZSBlbXB0eSBibG9jayBjb3VudCBjYXNlXG4gICAgaWYgKCFhZGRDb3VudCAmJiBodW5rLm5ld0xpbmVzID09PSAxKSB7XG4gICAgICBodW5rLm5ld0xpbmVzID0gMDtcbiAgICB9XG4gICAgaWYgKCFyZW1vdmVDb3VudCAmJiBodW5rLm9sZExpbmVzID09PSAxKSB7XG4gICAgICBodW5rLm9sZExpbmVzID0gMDtcbiAgICB9XG5cbiAgICAvLyBQZXJmb3JtIG9wdGlvbmFsIHNhbml0eSBjaGVja2luZ1xuICAgIGlmIChvcHRpb25zLnN0cmljdCkge1xuICAgICAgaWYgKGFkZENvdW50ICE9PSBodW5rLm5ld0xpbmVzKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcignQWRkZWQgbGluZSBjb3VudCBkaWQgbm90IG1hdGNoIGZvciBodW5rIGF0IGxpbmUgJyArIChjaHVua0hlYWRlckluZGV4ICsgMSkpO1xuICAgICAgfVxuICAgICAgaWYgKHJlbW92ZUNvdW50ICE9PSBodW5rLm9sZExpbmVzKSB7XG4gICAgICAgIHRocm93IG5ldyBFcnJvcignUmVtb3ZlZCBsaW5lIGNvdW50IGRpZCBub3QgbWF0Y2ggZm9yIGh1bmsgYXQgbGluZSAnICsgKGNodW5rSGVhZGVySW5kZXggKyAxKSk7XG4gICAgICB9XG4gICAgfVxuXG4gICAgcmV0dXJuIGh1bms7XG4gIH1cblxuICB3aGlsZSAoaSA8IGRpZmZzdHIubGVuZ3RoKSB7XG4gICAgcGFyc2VJbmRleCgpO1xuICB9XG5cbiAgcmV0dXJuIGxpc3Q7XG59XG4iXX0= + + +/***/ }, +/* 12 */ +/***/ function(module, exports) { + + "use strict"; + + exports.__esModule = true; + + exports["default"] = function (start, minLine, maxLine) { + var wantForward = true, + backwardExhausted = false, + forwardExhausted = false, + localOffset = 1; + + return function iterator() { + if (wantForward && !forwardExhausted) { + if (backwardExhausted) { + localOffset++; + } else { + wantForward = false; + } + + // Check if trying to fit beyond text length, and if not, check it fits + // after offset location (or desired location on first iteration) + if (start + localOffset <= maxLine) { + return localOffset; + } + + forwardExhausted = true; + } + + if (!backwardExhausted) { + if (!forwardExhausted) { + wantForward = true; + } + + // Check if trying to fit before text beginning, and if not, check it fits + // before offset location + if (minLine <= start - localOffset) { + return -localOffset++; + } + + backwardExhausted = true; + return iterator(); + } + + // We tried to fit hunk before text beginning and beyond text lenght, then + // hunk can't fit on the text. Return undefined + }; + }; + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7NENBR2UsVUFBUyxLQUFULEVBQWdCLE9BQWhCLEVBQXlCLE9BQXpCLEVBQWtDO0FBQy9DLE1BQUksY0FBYyxJQUFsQjtBQUFBLE1BQ0ksb0JBQW9CLEtBRHhCO0FBQUEsTUFFSSxtQkFBbUIsS0FGdkI7QUFBQSxNQUdJLGNBQWMsQ0FIbEI7O0FBS0EsU0FBTyxTQUFTLFFBQVQsR0FBb0I7QUFDekIsUUFBSSxlQUFlLENBQUMsZ0JBQXBCLEVBQXNDO0FBQ3BDLFVBQUksaUJBQUosRUFBdUI7QUFDckI7QUFDRCxPQUZELE1BRU87QUFDTCxzQkFBYyxLQUFkO0FBQ0Q7Ozs7QUFJRCxVQUFJLFFBQVEsV0FBUixJQUF1QixPQUEzQixFQUFvQztBQUNsQyxlQUFPLFdBQVA7QUFDRDs7QUFFRCx5QkFBbUIsSUFBbkI7QUFDRDs7QUFFRCxRQUFJLENBQUMsaUJBQUwsRUFBd0I7QUFDdEIsVUFBSSxDQUFDLGdCQUFMLEVBQXVCO0FBQ3JCLHNCQUFjLElBQWQ7QUFDRDs7OztBQUlELFVBQUksV0FBVyxRQUFRLFdBQXZCLEVBQW9DO0FBQ2xDLGVBQU8sQ0FBQyxhQUFSO0FBQ0Q7O0FBRUQsMEJBQW9CLElBQXBCO0FBQ0EsYUFBTyxVQUFQO0FBQ0Q7Ozs7QUFJRixHQWxDRDtBQW1DRCxDIiwiZmlsZSI6ImRpc3RhbmNlLWl0ZXJhdG9yLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLy8gSXRlcmF0b3IgdGhhdCB0cmF2ZXJzZXMgaW4gdGhlIHJhbmdlIG9mIFttaW4sIG1heF0sIHN0ZXBwaW5nXG4vLyBieSBkaXN0YW5jZSBmcm9tIGEgZ2l2ZW4gc3RhcnQgcG9zaXRpb24uIEkuZS4gZm9yIFswLCA0XSwgd2l0aFxuLy8gc3RhcnQgb2YgMiwgdGhpcyB3aWxsIGl0ZXJhdGUgMiwgMywgMSwgNCwgMC5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uKHN0YXJ0LCBtaW5MaW5lLCBtYXhMaW5lKSB7XG4gIGxldCB3YW50Rm9yd2FyZCA9IHRydWUsXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IGZhbHNlLFxuICAgICAgZm9yd2FyZEV4aGF1c3RlZCA9IGZhbHNlLFxuICAgICAgbG9jYWxPZmZzZXQgPSAxO1xuXG4gIHJldHVybiBmdW5jdGlvbiBpdGVyYXRvcigpIHtcbiAgICBpZiAod2FudEZvcndhcmQgJiYgIWZvcndhcmRFeGhhdXN0ZWQpIHtcbiAgICAgIGlmIChiYWNrd2FyZEV4aGF1c3RlZCkge1xuICAgICAgICBsb2NhbE9mZnNldCsrO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgd2FudEZvcndhcmQgPSBmYWxzZTtcbiAgICAgIH1cblxuICAgICAgLy8gQ2hlY2sgaWYgdHJ5aW5nIHRvIGZpdCBiZXlvbmQgdGV4dCBsZW5ndGgsIGFuZCBpZiBub3QsIGNoZWNrIGl0IGZpdHNcbiAgICAgIC8vIGFmdGVyIG9mZnNldCBsb2NhdGlvbiAob3IgZGVzaXJlZCBsb2NhdGlvbiBvbiBmaXJzdCBpdGVyYXRpb24pXG4gICAgICBpZiAoc3RhcnQgKyBsb2NhbE9mZnNldCA8PSBtYXhMaW5lKSB7XG4gICAgICAgIHJldHVybiBsb2NhbE9mZnNldDtcbiAgICAgIH1cblxuICAgICAgZm9yd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgfVxuXG4gICAgaWYgKCFiYWNrd2FyZEV4aGF1c3RlZCkge1xuICAgICAgaWYgKCFmb3J3YXJkRXhoYXVzdGVkKSB7XG4gICAgICAgIHdhbnRGb3J3YXJkID0gdHJ1ZTtcbiAgICAgIH1cblxuICAgICAgLy8gQ2hlY2sgaWYgdHJ5aW5nIHRvIGZpdCBiZWZvcmUgdGV4dCBiZWdpbm5pbmcsIGFuZCBpZiBub3QsIGNoZWNrIGl0IGZpdHNcbiAgICAgIC8vIGJlZm9yZSBvZmZzZXQgbG9jYXRpb25cbiAgICAgIGlmIChtaW5MaW5lIDw9IHN0YXJ0IC0gbG9jYWxPZmZzZXQpIHtcbiAgICAgICAgcmV0dXJuIC1sb2NhbE9mZnNldCsrO1xuICAgICAgfVxuXG4gICAgICBiYWNrd2FyZEV4aGF1c3RlZCA9IHRydWU7XG4gICAgICByZXR1cm4gaXRlcmF0b3IoKTtcbiAgICB9XG5cbiAgICAvLyBXZSB0cmllZCB0byBmaXQgaHVuayBiZWZvcmUgdGV4dCBiZWdpbm5pbmcgYW5kIGJleW9uZCB0ZXh0IGxlbmdodCwgdGhlblxuICAgIC8vIGh1bmsgY2FuJ3QgZml0IG9uIHRoZSB0ZXh0LiBSZXR1cm4gdW5kZWZpbmVkXG4gIH07XG59XG4iXX0= + + +/***/ }, +/* 13 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + exports.__esModule = true; + exports. structuredPatch = structuredPatch; + exports. createTwoFilesPatch = createTwoFilesPatch; + exports. createPatch = createPatch; + + var _line = __webpack_require__(5) ; + + + function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + + function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + if (!options) { + options = {}; + } + if (typeof options.context === 'undefined') { + options.context = 4; + } + + var diff = (0, _line.diffLines) (oldStr, newStr, options); + diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier + + function contextLines(lines) { + return lines.map(function (entry) { + return ' ' + entry; + }); + } + + var hunks = []; + var oldRangeStart = 0, + newRangeStart = 0, + curRange = [], + oldLine = 1, + newLine = 1; + + var _loop = function _loop( i) { + var current = diff[i], + lines = current.lines || current.value.replace(/\n$/, '').split('\n'); + current.lines = lines; + + if (current.added || current.removed) { + + var _curRange; + + + // If we have previous context, start with that + if (!oldRangeStart) { + var prev = diff[i - 1]; + oldRangeStart = oldLine; + newRangeStart = newLine; + + if (prev) { + curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : []; + oldRangeStart -= curRange.length; + newRangeStart -= curRange.length; + } + } + + // Output our changes + (_curRange = curRange).push. apply ( _curRange , _toConsumableArray( lines.map(function (entry) { + return (current.added ? '+' : '-') + entry; + }))); + + // Track the updated file position + if (current.added) { + newLine += lines.length; + } else { + oldLine += lines.length; + } + } else { + // Identical context lines. Track line changes + if (oldRangeStart) { + // Close out any changes that have been output (or join overlapping) + if (lines.length <= options.context * 2 && i < diff.length - 2) { + + var _curRange2; + + + // Overlapping + (_curRange2 = curRange).push. apply ( _curRange2 , _toConsumableArray( contextLines(lines))); + } else { + + var _curRange3; + + + // end the range and output + var contextSize = Math.min(lines.length, options.context); + (_curRange3 = curRange).push. apply ( _curRange3 , _toConsumableArray( contextLines(lines.slice(0, contextSize)))); + + var hunk = { + oldStart: oldRangeStart, + oldLines: oldLine - oldRangeStart + contextSize, + newStart: newRangeStart, + newLines: newLine - newRangeStart + contextSize, + lines: curRange + }; + if (i >= diff.length - 2 && lines.length <= options.context) { + // EOF is inside this hunk + var oldEOFNewline = /\n$/.test(oldStr); + var newEOFNewline = /\n$/.test(newStr); + if (lines.length == 0 && !oldEOFNewline) { + // special case: old has no eol and no trailing context; no-nl can end up before adds + curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file'); + } else if (!oldEOFNewline || !newEOFNewline) { + curRange.push('\\ No newline at end of file'); + } + } + hunks.push(hunk); + + oldRangeStart = 0; + newRangeStart = 0; + curRange = []; + } + } + oldLine += lines.length; + newLine += lines.length; + } + }; + + for (var i = 0; i < diff.length; i++) { + + _loop( i); + } + + return { + oldFileName: oldFileName, newFileName: newFileName, + oldHeader: oldHeader, newHeader: newHeader, + hunks: hunks + }; + } + + function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) { + var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options); + + var ret = []; + if (oldFileName == newFileName) { + ret.push('Index: ' + oldFileName); + } + ret.push('==================================================================='); + ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader)); + ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader)); + + for (var i = 0; i < diff.hunks.length; i++) { + var hunk = diff.hunks[i]; + ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@'); + ret.push.apply(ret, hunk.lines); + } + + return ret.join('\n') + '\n'; + } + + function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) { + return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options); + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9jcmVhdGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O2dDQUVnQixlLEdBQUEsZTt5REFpR0EsbUIsR0FBQSxtQjt5REF3QkEsVyxHQUFBLFc7O0FBM0hoQixJLHlCQUFBLCtCLHdCQUFBOzs7Ozt1QkFFTyxTQUFTLGVBQVQsQ0FBeUIsV0FBekIsRUFBc0MsV0FBdEMsRUFBbUQsTUFBbkQsRUFBMkQsTUFBM0QsRUFBbUUsU0FBbkUsRUFBOEUsU0FBOUUsRUFBeUYsT0FBekYsRUFBa0c7QUFDdkcsTUFBSSxDQUFDLE9BQUwsRUFBYztBQUNaLGNBQVUsRUFBVjtBQUNEO0FBQ0QsTUFBSSxPQUFPLFFBQVEsT0FBZixLQUEyQixXQUEvQixFQUE0QztBQUMxQyxZQUFRLE9BQVIsR0FBa0IsQ0FBbEI7QUFDRDs7QUFFRCxNQUFNLE8seUJBQU8sb0Isd0JBQUEsQ0FBVSxNQUFWLEVBQWtCLE1BQWxCLEVBQTBCLE9BQTFCLENBQWI7QUFDQSxPQUFLLElBQUwsQ0FBVSxFQUFDLE9BQU8sRUFBUixFQUFZLE9BQU8sRUFBbkIsRUFBVixFOztBQUVBLFdBQVMsWUFBVCxDQUFzQixLQUF0QixFQUE2QjtBQUMzQixXQUFPLE1BQU0sR0FBTixDQUFVLFVBQVMsS0FBVCxFQUFnQjtBQUFFLGFBQU8sTUFBTSxLQUFiO0FBQXFCLEtBQWpELENBQVA7QUFDRDs7QUFFRCxNQUFJLFFBQVEsRUFBWjtBQUNBLE1BQUksZ0JBQWdCLENBQXBCO0FBQUEsTUFBdUIsZ0JBQWdCLENBQXZDO0FBQUEsTUFBMEMsV0FBVyxFQUFyRDtBQUFBLE1BQ0ksVUFBVSxDQURkO0FBQUEsTUFDaUIsVUFBVSxDQUQzQjs7QUFoQnVHLDZCLHdCQWtCOUYsQ0FsQjhGO0FBbUJyRyxRQUFNLFVBQVUsS0FBSyxDQUFMLENBQWhCO0FBQUEsUUFDTSxRQUFRLFFBQVEsS0FBUixJQUFpQixRQUFRLEtBQVIsQ0FBYyxPQUFkLENBQXNCLEtBQXRCLEVBQTZCLEVBQTdCLEVBQWlDLEtBQWpDLENBQXVDLElBQXZDLENBRC9CO0FBRUEsWUFBUSxLQUFSLEdBQWdCLEtBQWhCOztBQUVBLFFBQUksUUFBUSxLQUFSLElBQWlCLFFBQVEsT0FBN0IsRUFBc0M7O0FBQUE7Ozs7QUFFcEMsVUFBSSxDQUFDLGFBQUwsRUFBb0I7QUFDbEIsWUFBTSxPQUFPLEtBQUssSUFBSSxDQUFULENBQWI7QUFDQSx3QkFBZ0IsT0FBaEI7QUFDQSx3QkFBZ0IsT0FBaEI7O0FBRUEsWUFBSSxJQUFKLEVBQVU7QUFDUixxQkFBVyxRQUFRLE9BQVIsR0FBa0IsQ0FBbEIsR0FBc0IsYUFBYSxLQUFLLEtBQUwsQ0FBVyxLQUFYLENBQWlCLENBQUMsUUFBUSxPQUExQixDQUFiLENBQXRCLEdBQXlFLEVBQXBGO0FBQ0EsMkJBQWlCLFNBQVMsTUFBMUI7QUFDQSwyQkFBaUIsU0FBUyxNQUExQjtBQUNEO0FBQ0Y7OzsrQkFHRCxhLHVCQUFBLFVBQVMsSUFBVCxDLDBCQUFBLEssd0JBQUEsQywwQkFBQSxTLHdCQUFBLEUseUJBQUEsbUIsd0JBQWtCLE1BQU0sR0FBTixDQUFVLFVBQVMsS0FBVCxFQUFnQjtBQUMxQyxlQUFPLENBQUMsUUFBUSxLQUFSLEdBQWdCLEdBQWhCLEdBQXNCLEdBQXZCLElBQThCLEtBQXJDO0FBQ0QsT0FGaUIsQ0FBbEI7OztBQUtBLFVBQUksUUFBUSxLQUFaLEVBQW1CO0FBQ2pCLG1CQUFXLE1BQU0sTUFBakI7QUFDRCxPQUZELE1BRU87QUFDTCxtQkFBVyxNQUFNLE1BQWpCO0FBQ0Q7QUFDRixLQXpCRCxNQXlCTzs7QUFFTCxVQUFJLGFBQUosRUFBbUI7O0FBRWpCLFlBQUksTUFBTSxNQUFOLElBQWdCLFFBQVEsT0FBUixHQUFrQixDQUFsQyxJQUF1QyxJQUFJLEtBQUssTUFBTCxHQUFjLENBQTdELEVBQWdFOztBQUFBOzs7O21DQUU5RCxjLHVCQUFBLFVBQVMsSUFBVCxDLDBCQUFBLEssd0JBQUEsQywwQkFBQSxVLHdCQUFBLEUseUJBQUEsbUIsd0JBQWtCLGFBQWEsS0FBYixDQUFsQjtBQUNELFNBSEQsTUFHTzs7QUFBQTs7OztBQUVMLGNBQUksY0FBYyxLQUFLLEdBQUwsQ0FBUyxNQUFNLE1BQWYsRUFBdUIsUUFBUSxPQUEvQixDQUFsQjttQ0FDQSxjLHVCQUFBLFVBQVMsSUFBVCxDLDBCQUFBLEssd0JBQUEsQywwQkFBQSxVLHdCQUFBLEUseUJBQUEsbUIsd0JBQWtCLGFBQWEsTUFBTSxLQUFOLENBQVksQ0FBWixFQUFlLFdBQWYsQ0FBYixDQUFsQjs7QUFFQSxjQUFJLE9BQU87QUFDVCxzQkFBVSxhQUREO0FBRVQsc0JBQVcsVUFBVSxhQUFWLEdBQTBCLFdBRjVCO0FBR1Qsc0JBQVUsYUFIRDtBQUlULHNCQUFXLFVBQVUsYUFBVixHQUEwQixXQUo1QjtBQUtULG1CQUFPO0FBTEUsV0FBWDtBQU9BLGNBQUksS0FBSyxLQUFLLE1BQUwsR0FBYyxDQUFuQixJQUF3QixNQUFNLE1BQU4sSUFBZ0IsUUFBUSxPQUFwRCxFQUE2RDs7QUFFM0QsZ0JBQUksZ0JBQWlCLE1BQU0sSUFBTixDQUFXLE1BQVgsQ0FBckI7QUFDQSxnQkFBSSxnQkFBaUIsTUFBTSxJQUFOLENBQVcsTUFBWCxDQUFyQjtBQUNBLGdCQUFJLE1BQU0sTUFBTixJQUFnQixDQUFoQixJQUFxQixDQUFDLGFBQTFCLEVBQXlDOztBQUV2Qyx1QkFBUyxNQUFULENBQWdCLEtBQUssUUFBckIsRUFBK0IsQ0FBL0IsRUFBa0MsOEJBQWxDO0FBQ0QsYUFIRCxNQUdPLElBQUksQ0FBQyxhQUFELElBQWtCLENBQUMsYUFBdkIsRUFBc0M7QUFDM0MsdUJBQVMsSUFBVCxDQUFjLDhCQUFkO0FBQ0Q7QUFDRjtBQUNELGdCQUFNLElBQU4sQ0FBVyxJQUFYOztBQUVBLDBCQUFnQixDQUFoQjtBQUNBLDBCQUFnQixDQUFoQjtBQUNBLHFCQUFXLEVBQVg7QUFDRDtBQUNGO0FBQ0QsaUJBQVcsTUFBTSxNQUFqQjtBQUNBLGlCQUFXLE1BQU0sTUFBakI7QUFDRDtBQXZGb0c7O0FBa0J2RyxPQUFLLElBQUksSUFBSSxDQUFiLEVBQWdCLElBQUksS0FBSyxNQUF6QixFQUFpQyxHQUFqQyxFQUFzQzs7QUFBQSxVLHdCQUE3QixDQUE2QjtBQXNFckM7O0FBRUQsU0FBTztBQUNMLGlCQUFhLFdBRFIsRUFDcUIsYUFBYSxXQURsQztBQUVMLGVBQVcsU0FGTixFQUVpQixXQUFXLFNBRjVCO0FBR0wsV0FBTztBQUhGLEdBQVA7QUFLRDs7QUFFTSxTQUFTLG1CQUFULENBQTZCLFdBQTdCLEVBQTBDLFdBQTFDLEVBQXVELE1BQXZELEVBQStELE1BQS9ELEVBQXVFLFNBQXZFLEVBQWtGLFNBQWxGLEVBQTZGLE9BQTdGLEVBQXNHO0FBQzNHLE1BQU0sT0FBTyxnQkFBZ0IsV0FBaEIsRUFBNkIsV0FBN0IsRUFBMEMsTUFBMUMsRUFBa0QsTUFBbEQsRUFBMEQsU0FBMUQsRUFBcUUsU0FBckUsRUFBZ0YsT0FBaEYsQ0FBYjs7QUFFQSxNQUFNLE1BQU0sRUFBWjtBQUNBLE1BQUksZUFBZSxXQUFuQixFQUFnQztBQUM5QixRQUFJLElBQUosQ0FBUyxZQUFZLFdBQXJCO0FBQ0Q7QUFDRCxNQUFJLElBQUosQ0FBUyxxRUFBVDtBQUNBLE1BQUksSUFBSixDQUFTLFNBQVMsS0FBSyxXQUFkLElBQTZCLE9BQU8sS0FBSyxTQUFaLEtBQTBCLFdBQTFCLEdBQXdDLEVBQXhDLEdBQTZDLE9BQU8sS0FBSyxTQUF0RixDQUFUO0FBQ0EsTUFBSSxJQUFKLENBQVMsU0FBUyxLQUFLLFdBQWQsSUFBNkIsT0FBTyxLQUFLLFNBQVosS0FBMEIsV0FBMUIsR0FBd0MsRUFBeEMsR0FBNkMsT0FBTyxLQUFLLFNBQXRGLENBQVQ7O0FBRUEsT0FBSyxJQUFJLElBQUksQ0FBYixFQUFnQixJQUFJLEtBQUssS0FBTCxDQUFXLE1BQS9CLEVBQXVDLEdBQXZDLEVBQTRDO0FBQzFDLFFBQU0sT0FBTyxLQUFLLEtBQUwsQ0FBVyxDQUFYLENBQWI7QUFDQSxRQUFJLElBQUosQ0FDRSxTQUFTLEtBQUssUUFBZCxHQUF5QixHQUF6QixHQUErQixLQUFLLFFBQXBDLEdBQ0UsSUFERixHQUNTLEtBQUssUUFEZCxHQUN5QixHQUR6QixHQUMrQixLQUFLLFFBRHBDLEdBRUUsS0FISjtBQUtBLFFBQUksSUFBSixDQUFTLEtBQVQsQ0FBZSxHQUFmLEVBQW9CLEtBQUssS0FBekI7QUFDRDs7QUFFRCxTQUFPLElBQUksSUFBSixDQUFTLElBQVQsSUFBaUIsSUFBeEI7QUFDRDs7QUFFTSxTQUFTLFdBQVQsQ0FBcUIsUUFBckIsRUFBK0IsTUFBL0IsRUFBdUMsTUFBdkMsRUFBK0MsU0FBL0MsRUFBMEQsU0FBMUQsRUFBcUUsT0FBckUsRUFBOEU7QUFDbkYsU0FBTyxvQkFBb0IsUUFBcEIsRUFBOEIsUUFBOUIsRUFBd0MsTUFBeEMsRUFBZ0QsTUFBaEQsRUFBd0QsU0FBeEQsRUFBbUUsU0FBbkUsRUFBOEUsT0FBOUUsQ0FBUDtBQUNEIiwiZmlsZSI6ImNyZWF0ZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7ZGlmZkxpbmVzfSBmcm9tICcuLi9kaWZmL2xpbmUnO1xuXG5leHBvcnQgZnVuY3Rpb24gc3RydWN0dXJlZFBhdGNoKG9sZEZpbGVOYW1lLCBuZXdGaWxlTmFtZSwgb2xkU3RyLCBuZXdTdHIsIG9sZEhlYWRlciwgbmV3SGVhZGVyLCBvcHRpb25zKSB7XG4gIGlmICghb3B0aW9ucykge1xuICAgIG9wdGlvbnMgPSB7fTtcbiAgfVxuICBpZiAodHlwZW9mIG9wdGlvbnMuY29udGV4dCA9PT0gJ3VuZGVmaW5lZCcpIHtcbiAgICBvcHRpb25zLmNvbnRleHQgPSA0O1xuICB9XG5cbiAgY29uc3QgZGlmZiA9IGRpZmZMaW5lcyhvbGRTdHIsIG5ld1N0ciwgb3B0aW9ucyk7XG4gIGRpZmYucHVzaCh7dmFsdWU6ICcnLCBsaW5lczogW119KTsgICAvLyBBcHBlbmQgYW4gZW1wdHkgdmFsdWUgdG8gbWFrZSBjbGVhbnVwIGVhc2llclxuXG4gIGZ1bmN0aW9uIGNvbnRleHRMaW5lcyhsaW5lcykge1xuICAgIHJldHVybiBsaW5lcy5tYXAoZnVuY3Rpb24oZW50cnkpIHsgcmV0dXJuICcgJyArIGVudHJ5OyB9KTtcbiAgfVxuXG4gIGxldCBodW5rcyA9IFtdO1xuICBsZXQgb2xkUmFuZ2VTdGFydCA9IDAsIG5ld1JhbmdlU3RhcnQgPSAwLCBjdXJSYW5nZSA9IFtdLFxuICAgICAgb2xkTGluZSA9IDEsIG5ld0xpbmUgPSAxO1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGRpZmYubGVuZ3RoOyBpKyspIHtcbiAgICBjb25zdCBjdXJyZW50ID0gZGlmZltpXSxcbiAgICAgICAgICBsaW5lcyA9IGN1cnJlbnQubGluZXMgfHwgY3VycmVudC52YWx1ZS5yZXBsYWNlKC9cXG4kLywgJycpLnNwbGl0KCdcXG4nKTtcbiAgICBjdXJyZW50LmxpbmVzID0gbGluZXM7XG5cbiAgICBpZiAoY3VycmVudC5hZGRlZCB8fCBjdXJyZW50LnJlbW92ZWQpIHtcbiAgICAgIC8vIElmIHdlIGhhdmUgcHJldmlvdXMgY29udGV4dCwgc3RhcnQgd2l0aCB0aGF0XG4gICAgICBpZiAoIW9sZFJhbmdlU3RhcnQpIHtcbiAgICAgICAgY29uc3QgcHJldiA9IGRpZmZbaSAtIDFdO1xuICAgICAgICBvbGRSYW5nZVN0YXJ0ID0gb2xkTGluZTtcbiAgICAgICAgbmV3UmFuZ2VTdGFydCA9IG5ld0xpbmU7XG5cbiAgICAgICAgaWYgKHByZXYpIHtcbiAgICAgICAgICBjdXJSYW5nZSA9IG9wdGlvbnMuY29udGV4dCA+IDAgPyBjb250ZXh0TGluZXMocHJldi5saW5lcy5zbGljZSgtb3B0aW9ucy5jb250ZXh0KSkgOiBbXTtcbiAgICAgICAgICBvbGRSYW5nZVN0YXJ0IC09IGN1clJhbmdlLmxlbmd0aDtcbiAgICAgICAgICBuZXdSYW5nZVN0YXJ0IC09IGN1clJhbmdlLmxlbmd0aDtcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICAvLyBPdXRwdXQgb3VyIGNoYW5nZXNcbiAgICAgIGN1clJhbmdlLnB1c2goLi4uIGxpbmVzLm1hcChmdW5jdGlvbihlbnRyeSkge1xuICAgICAgICByZXR1cm4gKGN1cnJlbnQuYWRkZWQgPyAnKycgOiAnLScpICsgZW50cnk7XG4gICAgICB9KSk7XG5cbiAgICAgIC8vIFRyYWNrIHRoZSB1cGRhdGVkIGZpbGUgcG9zaXRpb25cbiAgICAgIGlmIChjdXJyZW50LmFkZGVkKSB7XG4gICAgICAgIG5ld0xpbmUgKz0gbGluZXMubGVuZ3RoO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgb2xkTGluZSArPSBsaW5lcy5sZW5ndGg7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIC8vIElkZW50aWNhbCBjb250ZXh0IGxpbmVzLiBUcmFjayBsaW5lIGNoYW5nZXNcbiAgICAgIGlmIChvbGRSYW5nZVN0YXJ0KSB7XG4gICAgICAgIC8vIENsb3NlIG91dCBhbnkgY2hhbmdlcyB0aGF0IGhhdmUgYmVlbiBvdXRwdXQgKG9yIGpvaW4gb3ZlcmxhcHBpbmcpXG4gICAgICAgIGlmIChsaW5lcy5sZW5ndGggPD0gb3B0aW9ucy5jb250ZXh0ICogMiAmJiBpIDwgZGlmZi5sZW5ndGggLSAyKSB7XG4gICAgICAgICAgLy8gT3ZlcmxhcHBpbmdcbiAgICAgICAgICBjdXJSYW5nZS5wdXNoKC4uLiBjb250ZXh0TGluZXMobGluZXMpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAvLyBlbmQgdGhlIHJhbmdlIGFuZCBvdXRwdXRcbiAgICAgICAgICBsZXQgY29udGV4dFNpemUgPSBNYXRoLm1pbihsaW5lcy5sZW5ndGgsIG9wdGlvbnMuY29udGV4dCk7XG4gICAgICAgICAgY3VyUmFuZ2UucHVzaCguLi4gY29udGV4dExpbmVzKGxpbmVzLnNsaWNlKDAsIGNvbnRleHRTaXplKSkpO1xuXG4gICAgICAgICAgbGV0IGh1bmsgPSB7XG4gICAgICAgICAgICBvbGRTdGFydDogb2xkUmFuZ2VTdGFydCxcbiAgICAgICAgICAgIG9sZExpbmVzOiAob2xkTGluZSAtIG9sZFJhbmdlU3RhcnQgKyBjb250ZXh0U2l6ZSksXG4gICAgICAgICAgICBuZXdTdGFydDogbmV3UmFuZ2VTdGFydCxcbiAgICAgICAgICAgIG5ld0xpbmVzOiAobmV3TGluZSAtIG5ld1JhbmdlU3RhcnQgKyBjb250ZXh0U2l6ZSksXG4gICAgICAgICAgICBsaW5lczogY3VyUmFuZ2VcbiAgICAgICAgICB9O1xuICAgICAgICAgIGlmIChpID49IGRpZmYubGVuZ3RoIC0gMiAmJiBsaW5lcy5sZW5ndGggPD0gb3B0aW9ucy5jb250ZXh0KSB7XG4gICAgICAgICAgICAvLyBFT0YgaXMgaW5zaWRlIHRoaXMgaHVua1xuICAgICAgICAgICAgbGV0IG9sZEVPRk5ld2xpbmUgPSAoL1xcbiQvLnRlc3Qob2xkU3RyKSk7XG4gICAgICAgICAgICBsZXQgbmV3RU9GTmV3bGluZSA9ICgvXFxuJC8udGVzdChuZXdTdHIpKTtcbiAgICAgICAgICAgIGlmIChsaW5lcy5sZW5ndGggPT0gMCAmJiAhb2xkRU9GTmV3bGluZSkge1xuICAgICAgICAgICAgICAvLyBzcGVjaWFsIGNhc2U6IG9sZCBoYXMgbm8gZW9sIGFuZCBubyB0cmFpbGluZyBjb250ZXh0OyBuby1ubCBjYW4gZW5kIHVwIGJlZm9yZSBhZGRzXG4gICAgICAgICAgICAgIGN1clJhbmdlLnNwbGljZShodW5rLm9sZExpbmVzLCAwLCAnXFxcXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlJyk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKCFvbGRFT0ZOZXdsaW5lIHx8ICFuZXdFT0ZOZXdsaW5lKSB7XG4gICAgICAgICAgICAgIGN1clJhbmdlLnB1c2goJ1xcXFwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZScpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBodW5rcy5wdXNoKGh1bmspO1xuXG4gICAgICAgICAgb2xkUmFuZ2VTdGFydCA9IDA7XG4gICAgICAgICAgbmV3UmFuZ2VTdGFydCA9IDA7XG4gICAgICAgICAgY3VyUmFuZ2UgPSBbXTtcbiAgICAgICAgfVxuICAgICAgfVxuICAgICAgb2xkTGluZSArPSBsaW5lcy5sZW5ndGg7XG4gICAgICBuZXdMaW5lICs9IGxpbmVzLmxlbmd0aDtcbiAgICB9XG4gIH1cblxuICByZXR1cm4ge1xuICAgIG9sZEZpbGVOYW1lOiBvbGRGaWxlTmFtZSwgbmV3RmlsZU5hbWU6IG5ld0ZpbGVOYW1lLFxuICAgIG9sZEhlYWRlcjogb2xkSGVhZGVyLCBuZXdIZWFkZXI6IG5ld0hlYWRlcixcbiAgICBodW5rczogaHVua3NcbiAgfTtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGNyZWF0ZVR3b0ZpbGVzUGF0Y2gob2xkRmlsZU5hbWUsIG5ld0ZpbGVOYW1lLCBvbGRTdHIsIG5ld1N0ciwgb2xkSGVhZGVyLCBuZXdIZWFkZXIsIG9wdGlvbnMpIHtcbiAgY29uc3QgZGlmZiA9IHN0cnVjdHVyZWRQYXRjaChvbGRGaWxlTmFtZSwgbmV3RmlsZU5hbWUsIG9sZFN0ciwgbmV3U3RyLCBvbGRIZWFkZXIsIG5ld0hlYWRlciwgb3B0aW9ucyk7XG5cbiAgY29uc3QgcmV0ID0gW107XG4gIGlmIChvbGRGaWxlTmFtZSA9PSBuZXdGaWxlTmFtZSkge1xuICAgIHJldC5wdXNoKCdJbmRleDogJyArIG9sZEZpbGVOYW1lKTtcbiAgfVxuICByZXQucHVzaCgnPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PScpO1xuICByZXQucHVzaCgnLS0tICcgKyBkaWZmLm9sZEZpbGVOYW1lICsgKHR5cGVvZiBkaWZmLm9sZEhlYWRlciA9PT0gJ3VuZGVmaW5lZCcgPyAnJyA6ICdcXHQnICsgZGlmZi5vbGRIZWFkZXIpKTtcbiAgcmV0LnB1c2goJysrKyAnICsgZGlmZi5uZXdGaWxlTmFtZSArICh0eXBlb2YgZGlmZi5uZXdIZWFkZXIgPT09ICd1bmRlZmluZWQnID8gJycgOiAnXFx0JyArIGRpZmYubmV3SGVhZGVyKSk7XG5cbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBkaWZmLmh1bmtzLmxlbmd0aDsgaSsrKSB7XG4gICAgY29uc3QgaHVuayA9IGRpZmYuaHVua3NbaV07XG4gICAgcmV0LnB1c2goXG4gICAgICAnQEAgLScgKyBodW5rLm9sZFN0YXJ0ICsgJywnICsgaHVuay5vbGRMaW5lc1xuICAgICAgKyAnICsnICsgaHVuay5uZXdTdGFydCArICcsJyArIGh1bmsubmV3TGluZXNcbiAgICAgICsgJyBAQCdcbiAgICApO1xuICAgIHJldC5wdXNoLmFwcGx5KHJldCwgaHVuay5saW5lcyk7XG4gIH1cblxuICByZXR1cm4gcmV0LmpvaW4oJ1xcbicpICsgJ1xcbic7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBjcmVhdGVQYXRjaChmaWxlTmFtZSwgb2xkU3RyLCBuZXdTdHIsIG9sZEhlYWRlciwgbmV3SGVhZGVyLCBvcHRpb25zKSB7XG4gIHJldHVybiBjcmVhdGVUd29GaWxlc1BhdGNoKGZpbGVOYW1lLCBmaWxlTmFtZSwgb2xkU3RyLCBuZXdTdHIsIG9sZEhlYWRlciwgbmV3SGVhZGVyLCBvcHRpb25zKTtcbn1cbiJdfQ== + + +/***/ }, +/* 14 */ +/***/ function(module, exports) { + + "use strict"; + + exports.__esModule = true; + exports. convertChangesToDMP = convertChangesToDMP; + // See: http://code.google.com/p/google-diff-match-patch/wiki/API + function convertChangesToDMP(changes) { + var ret = [], + change = void 0 , + operation = void 0 ; + for (var i = 0; i < changes.length; i++) { + change = changes[i]; + if (change.added) { + operation = 1; + } else if (change.removed) { + operation = -1; + } else { + operation = 0; + } + + ret.push([operation, change.value]); + } + return ret; + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L2RtcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQ2dCLG1CLEdBQUEsbUI7O0FBQVQsU0FBUyxtQkFBVCxDQUE2QixPQUE3QixFQUFzQztBQUMzQyxNQUFJLE1BQU0sRUFBVjtBQUFBLE1BQ0ksUyx5QkFBQSxNLHdCQURKO0FBQUEsTUFFSSxZLHlCQUFBLE0sd0JBRko7QUFHQSxPQUFLLElBQUksSUFBSSxDQUFiLEVBQWdCLElBQUksUUFBUSxNQUE1QixFQUFvQyxHQUFwQyxFQUF5QztBQUN2QyxhQUFTLFFBQVEsQ0FBUixDQUFUO0FBQ0EsUUFBSSxPQUFPLEtBQVgsRUFBa0I7QUFDaEIsa0JBQVksQ0FBWjtBQUNELEtBRkQsTUFFTyxJQUFJLE9BQU8sT0FBWCxFQUFvQjtBQUN6QixrQkFBWSxDQUFDLENBQWI7QUFDRCxLQUZNLE1BRUE7QUFDTCxrQkFBWSxDQUFaO0FBQ0Q7O0FBRUQsUUFBSSxJQUFKLENBQVMsQ0FBQyxTQUFELEVBQVksT0FBTyxLQUFuQixDQUFUO0FBQ0Q7QUFDRCxTQUFPLEdBQVA7QUFDRCIsImZpbGUiOiJkbXAuanMiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTZWU6IGh0dHA6Ly9jb2RlLmdvb2dsZS5jb20vcC9nb29nbGUtZGlmZi1tYXRjaC1wYXRjaC93aWtpL0FQSVxuZXhwb3J0IGZ1bmN0aW9uIGNvbnZlcnRDaGFuZ2VzVG9ETVAoY2hhbmdlcykge1xuICBsZXQgcmV0ID0gW10sXG4gICAgICBjaGFuZ2UsXG4gICAgICBvcGVyYXRpb247XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgIGNoYW5nZSA9IGNoYW5nZXNbaV07XG4gICAgaWYgKGNoYW5nZS5hZGRlZCkge1xuICAgICAgb3BlcmF0aW9uID0gMTtcbiAgICB9IGVsc2UgaWYgKGNoYW5nZS5yZW1vdmVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAtMTtcbiAgICB9IGVsc2Uge1xuICAgICAgb3BlcmF0aW9uID0gMDtcbiAgICB9XG5cbiAgICByZXQucHVzaChbb3BlcmF0aW9uLCBjaGFuZ2UudmFsdWVdKTtcbiAgfVxuICByZXR1cm4gcmV0O1xufVxuIl19 + + +/***/ }, +/* 15 */ +/***/ function(module, exports) { + + 'use strict'; + + exports.__esModule = true; + exports. convertChangesToXML = convertChangesToXML; + function convertChangesToXML(changes) { + var ret = []; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + if (change.added) { + ret.push(''); + } else if (change.removed) { + ret.push(''); + } + + ret.push(escapeHTML(change.value)); + + if (change.added) { + ret.push(''); + } else if (change.removed) { + ret.push(''); + } + } + return ret.join(''); + } + + function escapeHTML(s) { + var n = s; + n = n.replace(/&/g, '&'); + n = n.replace(//g, '>'); + n = n.replace(/"/g, '"'); + + return n; + } + //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCLG1CLEdBQUEsbUI7QUFBVCxTQUFTLG1CQUFULENBQTZCLE9BQTdCLEVBQXNDO0FBQzNDLE1BQUksTUFBTSxFQUFWO0FBQ0EsT0FBSyxJQUFJLElBQUksQ0FBYixFQUFnQixJQUFJLFFBQVEsTUFBNUIsRUFBb0MsR0FBcEMsRUFBeUM7QUFDdkMsUUFBSSxTQUFTLFFBQVEsQ0FBUixDQUFiO0FBQ0EsUUFBSSxPQUFPLEtBQVgsRUFBa0I7QUFDaEIsVUFBSSxJQUFKLENBQVMsT0FBVDtBQUNELEtBRkQsTUFFTyxJQUFJLE9BQU8sT0FBWCxFQUFvQjtBQUN6QixVQUFJLElBQUosQ0FBUyxPQUFUO0FBQ0Q7O0FBRUQsUUFBSSxJQUFKLENBQVMsV0FBVyxPQUFPLEtBQWxCLENBQVQ7O0FBRUEsUUFBSSxPQUFPLEtBQVgsRUFBa0I7QUFDaEIsVUFBSSxJQUFKLENBQVMsUUFBVDtBQUNELEtBRkQsTUFFTyxJQUFJLE9BQU8sT0FBWCxFQUFvQjtBQUN6QixVQUFJLElBQUosQ0FBUyxRQUFUO0FBQ0Q7QUFDRjtBQUNELFNBQU8sSUFBSSxJQUFKLENBQVMsRUFBVCxDQUFQO0FBQ0Q7O0FBRUQsU0FBUyxVQUFULENBQW9CLENBQXBCLEVBQXVCO0FBQ3JCLE1BQUksSUFBSSxDQUFSO0FBQ0EsTUFBSSxFQUFFLE9BQUYsQ0FBVSxJQUFWLEVBQWdCLE9BQWhCLENBQUo7QUFDQSxNQUFJLEVBQUUsT0FBRixDQUFVLElBQVYsRUFBZ0IsTUFBaEIsQ0FBSjtBQUNBLE1BQUksRUFBRSxPQUFGLENBQVUsSUFBVixFQUFnQixNQUFoQixDQUFKO0FBQ0EsTUFBSSxFQUFFLE9BQUYsQ0FBVSxJQUFWLEVBQWdCLFFBQWhCLENBQUo7O0FBRUEsU0FBTyxDQUFQO0FBQ0QiLCJmaWxlIjoieG1sLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGNvbnZlcnRDaGFuZ2VzVG9YTUwoY2hhbmdlcykge1xuICBsZXQgcmV0ID0gW107XG4gIGZvciAobGV0IGkgPSAwOyBpIDwgY2hhbmdlcy5sZW5ndGg7IGkrKykge1xuICAgIGxldCBjaGFuZ2UgPSBjaGFuZ2VzW2ldO1xuICAgIGlmIChjaGFuZ2UuYWRkZWQpIHtcbiAgICAgIHJldC5wdXNoKCc8aW5zPicpO1xuICAgIH0gZWxzZSBpZiAoY2hhbmdlLnJlbW92ZWQpIHtcbiAgICAgIHJldC5wdXNoKCc8ZGVsPicpO1xuICAgIH1cblxuICAgIHJldC5wdXNoKGVzY2FwZUhUTUwoY2hhbmdlLnZhbHVlKSk7XG5cbiAgICBpZiAoY2hhbmdlLmFkZGVkKSB7XG4gICAgICByZXQucHVzaCgnPC9pbnM+Jyk7XG4gICAgfSBlbHNlIGlmIChjaGFuZ2UucmVtb3ZlZCkge1xuICAgICAgcmV0LnB1c2goJzwvZGVsPicpO1xuICAgIH1cbiAgfVxuICByZXR1cm4gcmV0LmpvaW4oJycpO1xufVxuXG5mdW5jdGlvbiBlc2NhcGVIVE1MKHMpIHtcbiAgbGV0IG4gPSBzO1xuICBuID0gbi5yZXBsYWNlKC8mL2csICcmYW1wOycpO1xuICBuID0gbi5yZXBsYWNlKC88L2csICcmbHQ7Jyk7XG4gIG4gPSBuLnJlcGxhY2UoLz4vZywgJyZndDsnKTtcbiAgbiA9IG4ucmVwbGFjZSgvXCIvZywgJyZxdW90OycpO1xuXG4gIHJldHVybiBuO1xufVxuIl19 + + +/***/ } +]) +}); diff --git a/modules/cms/classes/Asset.php b/modules/cms/classes/Asset.php index 93bfd93..ff2712c 100644 --- a/modules/cms/classes/Asset.php +++ b/modules/cms/classes/Asset.php @@ -238,6 +238,14 @@ protected function validateFileName($fileName = null) ]) ]); } + + if (!FileHelper::validatePath($fileName, null)) { + throw new ValidationException(['fileName' => + Lang::get('cms::lang.cms_object.invalid_file', [ + 'name' => $fileName + ]) + ]); + } } /** diff --git a/modules/cms/classes/CmsCompoundObject.php b/modules/cms/classes/CmsCompoundObject.php index 9aa36b2..32a7e7b 100644 --- a/modules/cms/classes/CmsCompoundObject.php +++ b/modules/cms/classes/CmsCompoundObject.php @@ -6,8 +6,10 @@ use Config; use Cms\Twig\Loader as TwigLoader; use Cms\Twig\Extension as CmsTwigExtension; +use Cms\Components\ViewBag; use System\Twig\Extension as SystemTwigExtension; use October\Rain\Halcyon\Processors\SectionParser; +use Twig_Source; use Twig_Environment; use ApplicationException; @@ -206,7 +208,7 @@ protected function parseComponentSettings() /** * Returns a component by its name. - * This method is used only in the back-end and for internal system needs when + * This method is used only in the back-end and for internal system needs when * the standard way to access components is not an option. * @param string $componentName Specifies the component name. * @return \Cms\Classes\ComponentBase Returns the component instance or null. @@ -269,7 +271,7 @@ public function hasComponent($componentName) */ public function getComponentProperties($componentName) { - $key = crc32($this->theme->getPath()).'component-properties'; + $key = md5($this->theme->getPath()).'component-properties'; if (self::$objectComponentPropertyMap !== null) { $objectComponentMap = self::$objectComponentPropertyMap; @@ -336,7 +338,7 @@ public function getComponentProperties($componentName) */ public static function clearCache($theme) { - $key = crc32($theme->getPath()).'component-properties'; + $key = md5($theme->getPath()).'component-properties'; Cache::forget($key); } @@ -346,9 +348,9 @@ public static function clearCache($theme) /** * Returns the configured view bag component. - * This method is used only in the back-end and for internal system needs when + * This method is used only in the back-end and for internal system needs when * the standard way to access components is not an option. - * @return \Cms\Classes\ViewBag Returns the view bag component instance. + * @return \Cms\Components\ViewBag Returns the view bag component instance. */ public function getViewBag() { @@ -412,7 +414,7 @@ public function getTwigNodeTree($markup = false) $twig->addExtension(new CmsTwigExtension()); $twig->addExtension(new SystemTwigExtension); - $stream = $twig->tokenize($markup === false ? $this->markup : $markup, 'getTwigNodeTree'); + $stream = $twig->tokenize(new Twig_Source($markup === false ? $this->markup : $markup, 'getTwigNodeTree')); return $twig->parse($stream); } @@ -488,5 +490,4 @@ public function __call($method, $parameters) return parent::__call($method, $parameters); } - -} \ No newline at end of file +} diff --git a/modules/cms/classes/CmsController.php b/modules/cms/classes/CmsController.php index a9b9e55..565004d 100644 --- a/modules/cms/classes/CmsController.php +++ b/modules/cms/classes/CmsController.php @@ -5,9 +5,11 @@ use Closure; /** - * The CMS controller class. - * The base controller services front end pages. + * This is the master controller for all front-end pages. + * All requests that have not been picked up already by the router will end up here, + * then the URL is passed to the front-end controller for processing. * + * @see Cms\Classes\Controller Front-end controller class * @package october\cms * @author Alexey Bobkov, Samuel Georges */ diff --git a/modules/cms/classes/CmsObject.php b/modules/cms/classes/CmsObject.php index 7e7dff0..5f7d682 100644 --- a/modules/cms/classes/CmsObject.php +++ b/modules/cms/classes/CmsObject.php @@ -319,5 +319,4 @@ protected function throwHalcyonSaveException(Exception $ex) throw $ex; } } - -} \ No newline at end of file +} diff --git a/modules/cms/classes/CmsObjectCollection.php b/modules/cms/classes/CmsObjectCollection.php index 6904625..57fcb7b 100644 --- a/modules/cms/classes/CmsObjectCollection.php +++ b/modules/cms/classes/CmsObjectCollection.php @@ -19,7 +19,7 @@ class CmsObjectCollection extends CollectionBase */ public function withComponent($components, $callback = null) { - return $this->filter(function($object) use ($components, $callback) { + return $this->filter(function ($object) use ($components, $callback) { $hasComponent = false; @@ -47,7 +47,7 @@ public function withComponent($components, $callback = null) */ public function where($property, $value, $strict = true) { - return $this->filter(function($object) use ($property, $value, $strict) { + return $this->filter(function ($object) use ($property, $value, $strict) { if (!array_key_exists($property, $object->settings)) { return false; @@ -69,7 +69,7 @@ public function where($property, $value, $strict = true) */ public function whereComponent($components, $property, $value, $strict = false) { - return $this->filter(function($object) use ($components, $property, $value, $strict) { + return $this->filter(function ($object) use ($components, $property, $value, $strict) { $hasComponent = false; diff --git a/modules/cms/classes/CodeParser.php b/modules/cms/classes/CodeParser.php index 13e8b2d..651fc51 100644 --- a/modules/cms/classes/CodeParser.php +++ b/modules/cms/classes/CodeParser.php @@ -27,7 +27,7 @@ class CodeParser /** * @var mixed The internal cache, keeps parsed object information during a request. */ - static protected $cache = []; + protected static $cache = []; /** * @var string Key for the parsed PHP file information cache. @@ -121,7 +121,7 @@ public function parse() */ protected function rebuild($path) { - $uniqueName = str_replace('.', '', uniqid('', true)).'_'.abs(crc32(mt_rand())); + $uniqueName = str_replace('.', '', uniqid('', true)).'_'.md5(mt_rand()); $className = 'Cms'.$uniqueName.'Class'; $body = $this->object->code; @@ -150,13 +150,9 @@ protected function rebuild($path) $this->validate($fileContents); - $this->makeDirectoryForPath($path); + $this->makeDirectorySafe(dirname($path)); - if (!@file_put_contents($path, $fileContents, LOCK_EX)) { - throw new SystemException(Lang::get('system::lang.file.create_fail', ['name'=>$path])); - } - - File::chmod($path); + $this->writeContentSafe($path, $fileContents); return $className; } @@ -236,7 +232,7 @@ protected function storeCachedInfo($result) */ protected function getCacheFilePath() { - $hash = abs(crc32($this->filePath)); + $hash = md5($this->filePath); $result = storage_path().'/cms/cache/'; $result .= substr($hash, 0, 2).'/'; $result .= substr($hash, 2, 2).'/'; @@ -312,13 +308,48 @@ protected function extractClassFromFile($path) return null; } + /** + * Writes content with concurrency support and cache busting + * This work is based on the Twig_Cache_Filesystem class + */ + protected function writeContentSafe($path, $content) + { + $count = 0; + $tmpFile = tempnam(dirname($path), basename($path)); + + if (@file_put_contents($tmpFile, $content) === false) { + throw new SystemException(Lang::get('system::lang.file.create_fail', ['name'=>$tmpFile])); + } + + while (!@rename($tmpFile, $path)) { + usleep(rand(50000, 200000)); + + if ($count++ > 10) { + throw new SystemException(Lang::get('system::lang.file.create_fail', ['name'=>$path])); + } + } + + File::chmod($path); + + /* + * Compile cached file into bytecode cache + */ + if (Config::get('cms.forceBytecodeInvalidation', false)) { + if (function_exists('opcache_invalidate')) { + opcache_invalidate($path, true); + } + elseif (function_exists('apc_compile_file')) { + apc_compile_file($path); + } + } + } + /** * Make directory with concurrency support */ - protected function makeDirectoryForPath($path) + protected function makeDirectorySafe($dir) { $count = 0; - $dir = dirname($path); if (is_dir($dir)) { if (!is_writable($dir)) { @@ -336,7 +367,6 @@ protected function makeDirectoryForPath($path) } } - File::chmodRecursive($path); + File::chmodRecursive($dir); } - } diff --git a/modules/cms/classes/ComponentBase.php b/modules/cms/classes/ComponentBase.php index d9dbcbf..9546cd4 100644 --- a/modules/cms/classes/ComponentBase.php +++ b/modules/cms/classes/ComponentBase.php @@ -2,7 +2,6 @@ use Str; use Lang; -use Event; use Config; use Cms\Classes\CodeBase; use Cms\Classes\CmsException; @@ -18,8 +17,8 @@ abstract class ComponentBase extends Extendable { use \System\Traits\AssetMaker; + use \System\Traits\EventEmitter; use \System\Traits\PropertyContainer; - use \October\Rain\Support\Traits\Emitter; /** * @var string A unique identifier for this component. @@ -42,7 +41,7 @@ abstract class ComponentBase extends Extendable public $isHidden = false; /** - * @var string Icon of the plugin that defines the component. + * @var string Icon of the plugin that defines the component. * This field is used by the CMS internally. */ public $pluginIcon; @@ -122,7 +121,7 @@ public function init() } /** - * Executed when this component is bound to a page or layout, part of + * Executed when this component is bound to a page or layout, part of * the page life cycle. */ public function onRun() @@ -157,10 +156,7 @@ public function runAjaxHandler($handler) /* * Extensibility */ - if ( - ($event = $this->fireEvent('component.beforeRunAjaxHandler', [$handler], true)) || - ($event = Event::fire('cms.component.beforeRunAjaxHandler', [$this, $handler], true)) - ) { + if ($event = $this->fireSystemEvent('cms.component.beforeRunAjaxHandler', [$handler])) { return $event; } @@ -169,10 +165,7 @@ public function runAjaxHandler($handler) /* * Extensibility */ - if ( - ($event = $this->fireEvent('component.runAjaxHandler', [$handler, $result], true)) || - ($event = Event::fire('cms.component.runAjaxHandler', [$this, $handler, $result], true)) - ) { + if ($event = $this->fireSystemEvent('cms.component.runAjaxHandler', [$handler, $result])) { return $event; } @@ -267,7 +260,7 @@ public function paramName($name, $default = null) public function __call($method, $parameters) { try { - parent::__call($method, $parameters); + return parent::__call($method, $parameters); } catch (BadMethodCallException $ex) {} diff --git a/modules/cms/classes/ComponentHelpers.php b/modules/cms/classes/ComponentHelpers.php index 6153009..bdb44a5 100644 --- a/modules/cms/classes/ComponentHelpers.php +++ b/modules/cms/classes/ComponentHelpers.php @@ -54,7 +54,7 @@ public static function getComponentsPropertyConfig($component, $addAliasProperty /* * Translate human values */ - $translate = ['title', 'description', 'options', 'group']; + $translate = ['title', 'description', 'options', 'group', 'validationMessage']; foreach ($property as $name => $value) { if (!in_array($name, $translate)) { continue; diff --git a/modules/cms/classes/ComponentManager.php b/modules/cms/classes/ComponentManager.php index 6afbaed..2b35835 100644 --- a/modules/cms/classes/ComponentManager.php +++ b/modules/cms/classes/ComponentManager.php @@ -72,13 +72,12 @@ protected function loadComponents() } /** - * Manually registers a widget for consideration. + * Manually registers a component for consideration. * Usage: - *
    -     *   ComponentManager::registerComponents(function($manager){
    -     *       $manager->registerComponent('October\Demo\Components\Test', 'testComponent');
    -     *   });
    -     * 
    + * + * ComponentManager::registerComponents(function($manager){ + * $manager->registerComponent('October\Demo\Components\Test', 'testComponent'); + * }); * * @param callable $definitions * @return array Array values are class names. @@ -105,7 +104,7 @@ public function registerComponent($className, $code = null, $plugin = null) $code = Str::getClassId($className); } - if ($code == 'viewBag' && $className != 'Cms\Classes\ViewBag') { + if ($code == 'viewBag' && $className != 'Cms\Components\ViewBag') { throw new SystemException(sprintf( 'The component code viewBag is reserved. Please use another code for the component class %s.', $className diff --git a/modules/cms/classes/ComponentPartial.php b/modules/cms/classes/ComponentPartial.php index fb61c9c..68a444b 100644 --- a/modules/cms/classes/ComponentPartial.php +++ b/modules/cms/classes/ComponentPartial.php @@ -88,6 +88,28 @@ public static function loadCached($component, $fileName) return static::load($component, $fileName); } + /** + * Checks if a partial override exists in the supplied theme and returns it. + * Since the beginning of time, October inconsistently checked for overrides + * using the component alias exactly, resulting in a folder with uppercase + * characters, subsequently this method checks for both variants. + * + * @param \Cms\Classes\Theme $theme + * @param \Cms\Classes\ComponentBase $component + * @param string $fileName + * @return mixed + */ + public static function loadOverrideCached($theme, $component, $fileName) + { + $partial = Partial::loadCached($theme, strtolower($component->alias) . '/' . $fileName); + + if ($partial === null) { + $partial = Partial::loadCached($theme, $component->alias . '/' . $fileName); + } + + return $partial; + } + /** * Find a single template by its file name. * diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index 0890035..5c6fdbd 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -8,7 +8,6 @@ use View; use Lang; use Flash; -use Event; use Config; use Session; use Request; @@ -16,6 +15,7 @@ use Exception; use BackendAuth; use Twig_Environment; +use Twig_Cache_Filesystem; use Cms\Twig\Loader as TwigLoader; use Cms\Twig\DebugExtension; use Cms\Twig\Extension as CmsTwigExtension; @@ -42,7 +42,7 @@ class Controller { use \System\Traits\AssetMaker; - use \October\Rain\Support\Traits\Emitter; + use \System\Traits\EventEmitter; /** * @var \Cms\Classes\Theme A reference to the CMS theme processed by the controller. @@ -180,10 +180,7 @@ public function run($url = '/') /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.beforeDisplay', [$url, $page], true)) || - ($event = Event::fire('cms.page.beforeDisplay', [$this, $url, $page], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.beforeDisplay', [$url, $page])) { if ($event instanceof Page) { $page = $event; } @@ -223,10 +220,7 @@ public function run($url = '/') /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.display', [$url, $page, $result], true)) || - ($event = Event::fire('cms.page.display', [$this, $url, $page, $result], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.display', [$url, $page, $result])) { return $event; } @@ -326,10 +320,7 @@ public function runPage($page, $useAjax = true) /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.init', [$page], true)) || - ($event = Event::fire('cms.page.init', [$this, $page], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.init', [$page])) { return $event; } @@ -362,10 +353,7 @@ public function runPage($page, $useAjax = true) /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.beforeRenderPage', [$page], true)) || - ($event = Event::fire('cms.page.beforeRenderPage', [$this, $page], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.beforeRenderPage', [$page])) { $this->pageContents = $event; } else { @@ -410,10 +398,7 @@ protected function execPageCycle() /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.start', [], true)) || - ($event = Event::fire('cms.page.start', [$this], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.start')) { return $event; } @@ -422,9 +407,11 @@ protected function execPageCycle() */ if ($this->layoutObj) { CmsException::mask($this->layout, 300); - $response = (($result = $this->layoutObj->onStart()) || + $response = ( + ($result = $this->layoutObj->onStart()) || ($result = $this->layout->runComponents()) || - ($result = $this->layoutObj->onBeforePageStart())) ? $result: null; + ($result = $this->layoutObj->onBeforePageStart()) + ) ? $result : null; CmsException::unmask(); if ($response) { @@ -436,9 +423,11 @@ protected function execPageCycle() * Run page functions */ CmsException::mask($this->page, 300); - $response = (($result = $this->pageObj->onStart()) || + $response = ( + ($result = $this->pageObj->onStart()) || ($result = $this->page->runComponents()) || - ($result = $this->pageObj->onEnd())) ? $result : null; + ($result = $this->pageObj->onEnd()) + ) ? $result : null; CmsException::unmask(); if ($response) { @@ -457,10 +446,7 @@ protected function execPageCycle() /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.end', [], true)) || - ($event = Event::fire('cms.page.end', [$this], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.end')) { return $event; } @@ -481,7 +467,7 @@ protected function postProcessResult($page, $url, $content) $dataHolder = (object) ['content' => $content]; - Event::fire('cms.page.postprocess', [$this, $url, $page, $dataHolder]); + $this->fireSystemEvent('cms.page.postprocess', [$url, $page, $dataHolder]); return $dataHolder->content; } @@ -499,14 +485,20 @@ protected function initTwigEnvironment() { $this->loader = new TwigLoader; + $useCache = !Config::get('cms.twigNoCache'); $isDebugMode = Config::get('app.debug', false); + $forceBytecode = Config::get('cms.forceBytecodeInvalidation', false); $options = [ 'auto_reload' => true, 'debug' => $isDebugMode, ]; - if (!Config::get('cms.twigNoCache')) { - $options['cache'] = storage_path().'/cms/twig'; + + if ($useCache) { + $options['cache'] = new Twig_Cache_Filesystem( + storage_path().'/cms/twig', + $forceBytecode ? Twig_Cache_Filesystem::FORCE_BYTECODE_INVALIDATION : 0 + ); } $this->twig = new Twig_Environment($this->loader, $options); @@ -566,8 +558,7 @@ protected function initComponents() /* * Extensibility */ - $this->fireEvent('page.initComponents', [$this->page, $this->layout]); - Event::fire('cms.page.initComponents', [$this, $this->page, $this->layout]); + $this->fireSystemEvent('cms.page.initComponents', [$this->page, $this->layout]); } // @@ -750,10 +741,7 @@ public function renderPage() /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.render', [$contents], true)) || - ($event = Event::fire('cms.page.render', [$this, $contents], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.render', [$contents])) { return $event; } @@ -780,10 +768,16 @@ public function renderPartial($name, $parameters = [], $throwException = true) $name = '::' . substr($name, 1); } + /* + * Extensibility + */ + if ($event = $this->fireSystemEvent('cms.page.beforeRenderPartial', [$name])) { + $partial = $event; + } /* * Process Component partial */ - if (strpos($name, '::') !== false) { + elseif (strpos($name, '::') !== false) { list($componentAlias, $partialName) = explode('::', $name); @@ -802,10 +796,10 @@ public function renderPartial($name, $parameters = [], $throwException = true) return false; } } + } /* * Component alias is supplied */ - } else { if (($componentObj = $this->findComponentByName($componentAlias)) === null) { if ($throwException) { @@ -824,8 +818,7 @@ public function renderPartial($name, $parameters = [], $throwException = true) * Check if the theme has an override */ if (strpos($partialName, '/') === false) { - $overrideName = $componentObj->alias . '/' . $partialName; - $partial = Partial::loadCached($this->theme, $overrideName); + $partial = ComponentPartial::loadOverrideCached($this->theme, $componentObj, $partialName); } /* @@ -866,7 +859,6 @@ public function renderPartial($name, $parameters = [], $throwException = true) /* * Run functions for CMS partials only (Cms\Classes\Partial) */ - if ($partial instanceof Partial) { $this->partialStack->stackPartial(); @@ -875,10 +867,11 @@ public function renderPartial($name, $parameters = [], $throwException = true) foreach ($partial->settings['components'] as $component => $properties) { // Do not inject the viewBag component to the environment. // Not sure if they're needed there by the requirements, - // but there were problems with array-typed properties used by Static Pages + // but there were problems with array-typed properties used by Static Pages // snippets and setComponentPropertiesFromParams(). --ab - if ($component == 'viewBag') + if ($component == 'viewBag') { continue; + } list($name, $alias) = strpos($component, ' ') ? explode(' ', $component) @@ -915,7 +908,7 @@ public function renderPartial($name, $parameters = [], $throwException = true) CmsException::mask($partial, 400); $this->loader->setObject($partial); $template = $this->twig->loadTemplate($partial->getFilePath()); - $result = $template->render(array_merge($this->vars, $parameters)); + $partialContent = $template->render(array_merge($this->vars, $parameters)); CmsException::unmask(); if ($partial instanceof Partial) { @@ -923,7 +916,15 @@ public function renderPartial($name, $parameters = [], $throwException = true) } $this->vars = $vars; - return $result; + + /* + * Extensibility + */ + if ($event = $this->fireSystemEvent('cms.page.renderPartial', [$name, &$partialContent])) { + return $event; + } + + return $partialContent; } /** @@ -938,10 +939,7 @@ public function renderContent($name, $parameters = []) /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.beforeRenderContent', [$name], true)) || - ($event = Event::fire('cms.page.beforeRenderContent', [$this, $name], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.beforeRenderContent', [$name])) { $content = $event; } /* @@ -971,10 +969,7 @@ public function renderContent($name, $parameters = []) /* * Extensibility */ - if ( - ($event = $this->fireEvent('page.renderContent', [$name, $fileContent], true)) || - ($event = Event::fire('cms.page.renderContent', [$this, $name, $fileContent], true)) - ) { + if ($event = $this->fireSystemEvent('cms.page.renderContent', [$name, &$fileContent])) { return $event; } @@ -982,22 +977,29 @@ public function renderContent($name, $parameters = []) } /** - * Renders a component's default content. + * Renders a component's default content, preserves the previous component context. * @param $name * @param array $parameters * @return string Returns the component default contents. */ public function renderComponent($name, $parameters = []) { + $result = null; + $previousContext = $this->componentContext; + if ($componentObj = $this->findComponentByName($name)) { $componentObj->id = uniqid($name); $componentObj->setProperties(array_merge($componentObj->getProperties(), $parameters)); - if ($result = $componentObj->onRender()) { - return $result; - } + $this->componentContext = $componentObj; + $result = $componentObj->onRender(); + } + + if (!$result) { + $result = $this->renderPartial($name.'::default', [], false); } - return $this->renderPartial($name.'::default', [], false); + $this->componentContext = $previousContext; + return $result; } // @@ -1019,6 +1021,15 @@ public function setStatusCode($code) // Getters // + /** + * Returns the status code for the current web response. + * @return int Status code + */ + public function getStatusCode() + { + return $this->statusCode; + } + /** * Returns an existing instance of the controller. * If the controller doesn't exists, returns null. diff --git a/modules/cms/classes/LayoutCode.php b/modules/cms/classes/LayoutCode.php index 18c737d..c6a4d4b 100644 --- a/modules/cms/classes/LayoutCode.php +++ b/modules/cms/classes/LayoutCode.php @@ -9,7 +9,7 @@ class LayoutCode extends CodeBase { /** - * This event is triggered after the layout components are executed, + * This event is triggered after the layout components are executed, * but before the page's onStart event. */ public function onBeforePageStart() diff --git a/modules/cms/classes/MediaLibrary.php b/modules/cms/classes/MediaLibrary.php index 1626f8f..6ea0ec6 100644 --- a/modules/cms/classes/MediaLibrary.php +++ b/modules/cms/classes/MediaLibrary.php @@ -47,6 +47,12 @@ class MediaLibrary */ protected $ignoreNames; + /** + * @var array Contains a list of regex patterns to ignore in files and directories. + * The list can be customized with cms.storage.media.ignorePatterns configuration option. + */ + protected $ignorePatterns; + /** * @var int Cache for the storage folder name length. */ @@ -66,6 +72,8 @@ protected function init() $this->ignoreNames = Config::get('cms.storage.media.ignore', FileDefinitions::get('ignoreFiles')); + $this->ignorePatterns = Config::get('cms.storage.media.ignorePatterns', ['^\..*']); + $this->storageFolderNameLength = strlen($this->storageFolder); } @@ -76,9 +84,10 @@ protected function init() * Supported values are 'title', 'size', 'lastModified' (see SORT_BY_XXX class constants) and FALSE. * @param string $filter Determines the document type filtering preference. * Supported values are 'image', 'video', 'audio', 'document' (see FILE_TYPE_XXX constants of MediaLibraryItem class). + * @param boolean $ignoreFolders Determines whether folders should be suppressed in the result list. * @return array Returns an array of MediaLibraryItem objects. */ - public function listFolderContents($folder = '/', $sortBy = 'title', $filter = null) + public function listFolderContents($folder = '/', $sortBy = 'title', $filter = null, $ignoreFolders = false) { $folder = self::validatePath($folder); $fullFolderPath = $this->getMediaPath($folder); @@ -119,7 +128,12 @@ public function listFolderContents($folder = '/', $sortBy = 'title', $filter = n $this->filterItemList($folderContents['files'], $filter); - $folderContents = array_merge($folderContents['folders'], $folderContents['files']); + if (!$ignoreFolders) { + $folderContents = array_merge($folderContents['folders'], $folderContents['files']); + } + else { + $folderContents = $folderContents['files']; + } return $folderContents; } @@ -138,15 +152,16 @@ public function findFiles($searchTerm, $sortBy = 'title', $filter = null) $words = explode(' ', Str::lower($searchTerm)); $result = []; - $findInFolder = function($folder) use (&$findInFolder, $words, &$result, $sortBy, $filter) { + $findInFolder = function ($folder) use (&$findInFolder, $words, &$result, $sortBy, $filter) { $folderContents = $this->listFolderContents($folder, $sortBy, $filter); foreach ($folderContents as $item) { - if ($item->type == MediaLibraryItem::TYPE_FOLDER) + if ($item->type == MediaLibraryItem::TYPE_FOLDER) { $findInFolder($item->path); - else - if ($this->pathMatchesSearch($item->path, $words)) - $result[] = $item; + } + elseif ($this->pathMatchesSearch($item->path, $words)) { + $result[] = $item; + } } }; @@ -211,8 +226,9 @@ public function folderExists($path) $folders = $this->getStorageDisk()->directories($fullPath); foreach ($folders as $folder) { - if (basename($folder) == $folderName) + if (basename($folder) == $folderName) { return true; + } } return false; @@ -306,28 +322,31 @@ public function copyFolder($originalPath, $newPath) { $disk = $this->getStorageDisk(); - $copyDirectory = function($srcPath, $destPath) use (&$copyDirectory, $disk) { + $copyDirectory = function ($srcPath, $destPath) use (&$copyDirectory, $disk) { $srcPath = self::validatePath($srcPath); $fullSrcPath = $this->getMediaPath($srcPath); $destPath = self::validatePath($destPath); $fullDestPath = $this->getMediaPath($destPath); - if (!$disk->makeDirectory($fullDestPath)) + if (!$disk->makeDirectory($fullDestPath)) { return false; + } $folderContents = $this->scanFolderContents($fullSrcPath); foreach ($folderContents['folders'] as $dirInfo) { - if (!$copyDirectory($dirInfo->path, $destPath.'/'.basename($dirInfo->path))) + if (!$copyDirectory($dirInfo->path, $destPath.'/'.basename($dirInfo->path))) { return false; + } } foreach ($folderContents['files'] as $fileInfo) { $fullFileSrcPath = $this->getMediaPath($fileInfo->path); - if (!$disk->copy($fullFileSrcPath, $fullDestPath.'/'.basename($fileInfo->path))) + if (!$disk->copy($fullFileSrcPath, $fullDestPath.'/'.basename($fileInfo->path))) { return false; + } } return true; @@ -346,7 +365,7 @@ public function moveFolder($originalPath, $newPath) { if (Str::lower($originalPath) !== Str::lower($newPath)) { // If there is no risk that the directory was renamed - // by just changing the letter case in the name - + // by just changing the letter case in the name - // copy the directory to the destination path and delete // the source directory. @@ -355,7 +374,8 @@ public function moveFolder($originalPath, $newPath) } $this->deleteFolder($originalPath); - } else { + } + else { // If there's a risk that the directory name was updated // by changing the letter case - swap source and destination // using a temporary directory with random name. @@ -483,8 +503,9 @@ protected function getMediaRelativePath($path) { $path = self::validatePath($path, true); - if (substr($path, 0, $this->storageFolderNameLength) == $this->storageFolder) + if (substr($path, 0, $this->storageFolderNameLength) == $this->storageFolder) { return substr($path, $this->storageFolderNameLength); + } throw new SystemException(sprintf('Cannot convert Media Library path "%s" to a path relative to the Library root.', $path)); } @@ -496,7 +517,19 @@ protected function getMediaRelativePath($path) */ protected function isVisible($path) { - return !in_array(basename($path), $this->ignoreNames); + $baseName = basename($path); + + if (in_array($baseName, $this->ignoreNames)) { + return false; + } + + foreach ($this->ignorePatterns as $pattern) { + if (preg_match('/'.$pattern.'/', $baseName)) { + return false; + } + } + + return true; } /** @@ -509,8 +542,9 @@ protected function initLibraryItem($path, $itemType) { $relativePath = $this->getMediaRelativePath($path); - if (!$this->isVisible($relativePath)) + if (!$this->isVisible($relativePath)) { return; + } /* * S3 doesn't allow getting the last modified timestamp for folders, @@ -571,14 +605,16 @@ protected function scanFolderContents($fullFolderPath) $files = $this->getStorageDisk()->files($fullFolderPath); foreach ($files as $file) { - if ($libraryItem = $this->initLibraryItem($file, MediaLibraryItem::TYPE_FILE)) + if ($libraryItem = $this->initLibraryItem($file, MediaLibraryItem::TYPE_FILE)) { $result['files'][] = $libraryItem; + } } $folders = $this->getStorageDisk()->directories($fullFolderPath); foreach ($folders as $folder) { - if ($libraryItem = $this->initLibraryItem($folder, MediaLibraryItem::TYPE_FOLDER)) + if ($libraryItem = $this->initLibraryItem($folder, MediaLibraryItem::TYPE_FOLDER)) { $result['folders'][] = $libraryItem; + } } return $result; @@ -595,7 +631,7 @@ protected function sortItemList(&$itemList, $sortBy) $files = []; $folders = []; - usort($itemList, function($a, $b) use ($sortBy) { + usort($itemList, function ($a, $b) use ($sortBy) { switch ($sortBy) { case self::SORT_BY_TITLE: return strcasecmp($a->path, $b->path); case self::SORT_BY_SIZE: @@ -627,8 +663,9 @@ protected function filterItemList(&$itemList, $filter) $result = []; foreach ($itemList as $item) { - if ($item->getFileType() == $filter) + if ($item->getFileType() == $filter) { $result[] = $item; + } } $itemList = $result; @@ -643,8 +680,9 @@ protected function filterItemList(&$itemList, $filter) */ protected function getStorageDisk() { - if ($this->storageDisk) + if ($this->storageDisk) { return $this->storageDisk; + } return $this->storageDisk = Storage::disk( Config::get('cms.storage.media.disk', 'local') @@ -663,11 +701,13 @@ protected function pathMatchesSearch($path, $words) foreach ($words as $word) { $word = trim($word); - if (!strlen($word)) + if (!strlen($word)) { continue; + } - if (!Str::contains($path, $word)) + if (!Str::contains($path, $word)) { return false; + } } return true; diff --git a/modules/cms/classes/MediaViewHelper.php b/modules/cms/classes/MediaViewHelper.php index e3955e4..be11ce1 100644 --- a/modules/cms/classes/MediaViewHelper.php +++ b/modules/cms/classes/MediaViewHelper.php @@ -28,7 +28,7 @@ public function processHtml($html) $mediaTags = $this->extractMediaTags($html); foreach ($mediaTags as $tagInfo) { $pattern = preg_quote($tagInfo['declaration']); - $generatedMarkup = $this->generateMediaTagaMarkup($tagInfo['type'], $tagInfo['src']); + $generatedMarkup = $this->generateMediaTagMarkup($tagInfo['type'], $tagInfo['src']); $html = mb_ereg_replace($pattern, $generatedMarkup, $html); } @@ -63,7 +63,7 @@ protected function extractMediaTags($html) return $result; } - protected function generateMediaTagaMarkup($type, $src) + protected function generateMediaTagMarkup($type, $src) { $partialName = $type == 'audio' ? 'oc-audio-player' : 'oc-video-player'; @@ -94,13 +94,13 @@ protected function getDefaultPlayerMarkup($type, $src) { switch ($type) { case 'video': - return ''; + return ''; break; case 'audio': - return ''; + return ''; break; } } -} \ No newline at end of file +} diff --git a/modules/cms/classes/Page.php b/modules/cms/classes/Page.php index b25c550..2a44312 100644 --- a/modules/cms/classes/Page.php +++ b/modules/cms/classes/Page.php @@ -4,6 +4,7 @@ use Cms\Classes\Theme; use Cms\Classes\Layout; use ApplicationException; +use October\Rain\Filesystem\Definitions as FileDefinitions; /** * The CMS page class. @@ -88,8 +89,14 @@ public function getLayoutOptions() $layouts = Layout::listInTheme($theme, true); $result = []; $result[null] = Lang::get('cms::lang.page.no_layout'); + foreach ($layouts as $layout) { $baseName = $layout->getBaseFileName(); + + if (FileDefinitions::isPathIgnored($baseName)) { + continue; + } + $result[$baseName] = strlen($layout->name) ? $layout->name : $baseName; } @@ -174,10 +181,10 @@ public static function getMenuTypeInfo($type) * with the following keys: * - url - the menu item URL. Not required for menu item types that return all available records. * The URL should be returned relative to the website root and include the subdirectory, if any. - * Use the URL::to() helper to generate the URLs. - * - isActive - determines whether the menu item is active. Not required for menu item types that + * Use the Url::to() helper to generate the URLs. + * - isActive - determines whether the menu item is active. Not required for menu item types that * return all available records. - * - items - an array of arrays with the same keys (url, isActive, items) + the title key. + * - items - an array of arrays with the same keys (url, isActive, items) + the title key. * The items array should be added only if the $item's $nesting property value is TRUE. * @param \RainLab\Pages\Classes\MenuItem $item Specifies the menu item. * @param string $url Specifies the current page URL, normalized, in lower case diff --git a/modules/cms/classes/Router.php b/modules/cms/classes/Router.php index 44bfa60..f971db9 100644 --- a/modules/cms/classes/Router.php +++ b/modules/cms/classes/Router.php @@ -21,11 +21,11 @@ *
    /blog/:post_id?/comments - although the :post_id parameter is marked as optional,
      * it will be processed as required.
    * Optional parameters can have default values which are used as fallback values in case if the real - * parameter value is not presented in the URL. Default values cannot contain the pipe symbols and question marks. + * parameter value is not presented in the URL. Default values cannot contain the pipe symbols and question marks. * Specify the default value after the question mark: *
    /blog/category/:category_id?10 - The category_id parameter would be 10 for this URL: /blog/category
    * You can also add regular expression validation to parameters. To add a validation expression - * add the pipe symbol after the parameter name (or the question mark) and specify the expression. + * add the pipe symbol after the parameter name (or the question mark) and specify the expression. * The forward slash symbol is not allowed in the expressions. Examples: *
    /blog/:post_id|^[0-9]+$/comments - this will match /blog/post/10/comments
      * /blog/:post_id|^[0-9]+$ - this will match /blog/post/3
    @@ -209,7 +209,7 @@ protected function getUrlMap()
         /**
          * Loads the URL map - a list of page file names and corresponding URL patterns.
          * The URL map can is cached. The clearUrlMap() method resets the cache. By default
    -     * the map is updated every time when a page is saved in the back-end, or 
    +     * the map is updated every time when a page is saved in the back-end, or
          * when the interval defined with the cms.urlCacheTtl expires.
          * @return boolean Returns true if the URL map was loaded from the cache. Otherwise returns false.
          */
    @@ -308,7 +308,7 @@ public function getParameter($name, $default = null)
          */
         protected function getCacheKey($keyName)
         {
    -        return crc32($this->theme->getPath()).$keyName;
    +        return md5($this->theme->getPath()).$keyName.Lang::getLocale();
         }
     
         /**
    diff --git a/modules/cms/classes/Theme.php b/modules/cms/classes/Theme.php
    index d82bf9a..8e7c290 100644
    --- a/modules/cms/classes/Theme.php
    +++ b/modules/cms/classes/Theme.php
    @@ -58,6 +58,7 @@ public static function load($dirName)
             $theme = new static;
             $theme->setDirName($dirName);
             $theme->registerHalyconDatasource();
    +
             return $theme;
         }
     
    @@ -133,13 +134,14 @@ public function listPages($skipCache = false)
         public function isActiveTheme()
         {
             $activeTheme = self::getActiveTheme();
    +
             return $activeTheme && $activeTheme->getDirName() == $this->getDirName();
         }
     
         /**
          * Returns the active theme code.
          * By default the active theme is loaded from the cms.activeTheme parameter,
    -     * but this behavior can be overridden by the cms.theme.getActiveTheme event listeners.
    +     * but this behavior can be overridden by the cms.theme.getActiveTheme event listener.
          * @return string
          * If the theme doesn't exist, returns null.
          */
    @@ -150,13 +152,13 @@ public static function getActiveThemeCode()
             if (App::hasDatabase()) {
                 try {
                     try {
    -                    $dbResult = Cache::remember(self::ACTIVE_KEY, 1440, function() {
    -                        return Parameter::applyKey(self::ACTIVE_KEY)->pluck('value');
    +                    $dbResult = Cache::remember(self::ACTIVE_KEY, 1440, function () {
    +                        return Parameter::applyKey(self::ACTIVE_KEY)->value('value');
                         });
                     }
                     catch (Exception $ex) {
                         // Cache failed
    -                    $dbResult = Parameter::applyKey(self::ACTIVE_KEY)->pluck('value');
    +                    $dbResult = Parameter::applyKey(self::ACTIVE_KEY)->value('value');
                     }
                 }
                 catch (Exception $ex) {
    @@ -169,6 +171,16 @@ public static function getActiveThemeCode()
                 }
             }
     
    +        /**
    +         * @event cms.theme.getActiveTheme
    +         * Overrides the active theme code.
    +         *
    +         * If a value is returned from this halting event, it will be used as the active
    +         * theme code. Example usage:
    +         *
    +         *     Event::listen('cms.theme.getActiveTheme', function() { return 'mytheme'; });
    +         *
    +         */
             $apiResult = Event::fire('cms.theme.getActiveTheme', [], true);
             if ($apiResult !== null) {
                 $activeTheme = $apiResult;
    @@ -204,7 +216,7 @@ public static function getActiveTheme()
     
         /**
          * Sets the active theme.
    -     * The active theme code is stored in the database and overrides the configuration cms.activeTheme parameter. 
    +     * The active theme code is stored in the database and overrides the configuration cms.activeTheme parameter.
          * @param string $code Specifies the  active theme code.
          */
         public static function setActiveTheme($code)
    @@ -374,9 +386,10 @@ public function writeConfig($values = [], $overwrite = false)
          */
         public function getPreviewImageUrl()
         {
    -        $previewPath = '/assets/images/theme-preview.png';
    -        if (File::exists($this->getPath().$previewPath)) {
    -            return Url::asset('themes/'.$this->getDirName().$previewPath);
    +        $previewPath = $this->getConfigValue('previewImage', 'assets/images/theme-preview.png');
    +
    +        if (File::exists($this->getPath().'/'.$previewPath)) {
    +            return Url::asset('themes/'.$this->getDirName().'/'.$previewPath);
             }
     
             return Url::asset('modules/cms/assets/images/default-theme-preview.png');
    @@ -390,6 +403,7 @@ public static function resetCache()
         {
             self::$activeThemeCache = false;
             self::$editThemeCache = false;
    +
             Cache::forget(self::ACTIVE_KEY);
             Cache::forget(self::EDIT_KEY);
         }
    diff --git a/modules/cms/classes/ThemeManager.php b/modules/cms/classes/ThemeManager.php
    index 98ad0d9..d7035a0 100644
    --- a/modules/cms/classes/ThemeManager.php
    +++ b/modules/cms/classes/ThemeManager.php
    @@ -122,6 +122,4 @@ public function deleteTheme($theme)
                 $this->setUninstalled($themeCode);
             }
         }
    -
    -
    -}
    \ No newline at end of file
    +}
    diff --git a/modules/cms/classes/asset/fields.yaml b/modules/cms/classes/asset/fields.yaml
    index e6e962d..7935713 100644
    --- a/modules/cms/classes/asset/fields.yaml
    +++ b/modules/cms/classes/asset/fields.yaml
    @@ -13,6 +13,9 @@ fields:
             path: content_toolbar
             cssClass: collapse-visible
     
    +tabs:
    +    cssClass: master-area
    +
     secondaryTabs:
         stretch: true
         fields:
    diff --git a/modules/cms/classes/content/fields.yaml b/modules/cms/classes/content/fields.yaml
    index 702f70b..ed13c79 100644
    --- a/modules/cms/classes/content/fields.yaml
    +++ b/modules/cms/classes/content/fields.yaml
    @@ -15,6 +15,9 @@ fields:
     
         components: Cms\FormWidgets\Components
     
    +tabs:
    +    cssClass: master-area
    +
     secondaryTabs:
         stretch: true
         fields:
    diff --git a/modules/cms/classes/layout/fields.yaml b/modules/cms/classes/layout/fields.yaml
    index 5bd467b..3c02f16 100644
    --- a/modules/cms/classes/layout/fields.yaml
    +++ b/modules/cms/classes/layout/fields.yaml
    @@ -20,6 +20,9 @@ fields:
     
         components: Cms\FormWidgets\Components
     
    +tabs:
    +    cssClass: master-area
    +
     secondaryTabs:
         stretch: true
         fields:
    diff --git a/modules/cms/classes/page/fields.yaml b/modules/cms/classes/page/fields.yaml
    index e2b23c9..44c56a5 100644
    --- a/modules/cms/classes/page/fields.yaml
    +++ b/modules/cms/classes/page/fields.yaml
    @@ -26,6 +26,7 @@ fields:
         components: Cms\FormWidgets\Components
     
     tabs:
    +    cssClass: master-area
         fields:
             fileName:
                 tab: cms::lang.editor.settings
    diff --git a/modules/cms/classes/partial/fields.yaml b/modules/cms/classes/partial/fields.yaml
    index 7abb039..4d23dba 100644
    --- a/modules/cms/classes/partial/fields.yaml
    +++ b/modules/cms/classes/partial/fields.yaml
    @@ -20,6 +20,9 @@ fields:
     
         components: Cms\FormWidgets\Components
     
    +tabs:
    +    cssClass: master-area
    +
     secondaryTabs:
         stretch: true
         fields:
    diff --git a/modules/cms/components/Resources.php b/modules/cms/components/Resources.php
    new file mode 100644
    index 0000000..251e930
    --- /dev/null
    +++ b/modules/cms/components/Resources.php
    @@ -0,0 +1,192 @@
    + 'Resources',
    +            'description'    => 'Easily reference theme assets for inclusion on a page.',
    +        ];
    +    }
    +
    +    /**
    +     * @return array
    +     */
    +    public function defineProperties()
    +    {
    +        return [
    +            'js' => [
    +                'title'             => 'JavaScript',
    +                'description'       => 'JavaScript file(s) in the assets/js folder',
    +                'type'              => 'stringList',
    +                'showExternalParam' => false
    +            ],
    +            'less' => [
    +                'title'             => 'LESS',
    +                'description'       => 'LESS file(s) in the assets/less folder',
    +                'type'              => 'stringList',
    +                'showExternalParam' => false
    +            ],
    +            'sass' => [
    +                'title'             => 'SASS',
    +                'description'       => 'SASS file(s) in the assets/sass folder',
    +                'type'              => 'stringList',
    +                'showExternalParam' => false
    +            ],
    +            'css' => [
    +                'title'             => 'CSS',
    +                'description'       => 'Stylesheet file(s) in the assets/css folder',
    +                'type'              => 'stringList',
    +                'showExternalParam' => false
    +            ],
    +            'vars' => [
    +                'title'             => 'Variables',
    +                'description'       => 'Page variables name(s) and value(s)',
    +                'type'              => 'dictionary',
    +                'showExternalParam' => false
    +            ]
    +        ];
    +    }
    +
    +    public function init()
    +    {
    +        $this->assetPath = $this->guessAssetPath();
    +        $this->jsDir = $this->guessAssetDirectory(['js', 'javascript'], $this->jsDir);
    +        $this->sassDir = $this->guessAssetDirectory(['sass', 'scss'], $this->sassDir);
    +    }
    +
    +    public function onRun()
    +    {
    +        /*
    +         * JavaScript
    +         */
    +        $js = [];
    +        if ($assets = $this->property('js')) {
    +            $js += array_map([$this, 'prefixJs'], (array) $assets);
    +        }
    +
    +        /*
    +         * LESS
    +         */
    +        $less = [];
    +        if ($assets = $this->property('less')) {
    +            $less += array_map([$this, 'prefixLess'], (array) $assets);
    +        }
    +
    +        /*
    +         * SASS
    +         */
    +        $sass = [];
    +        if ($assets = $this->property('sass')) {
    +            $sass += array_map([$this, 'prefixSass'], (array) $assets);
    +        }
    +
    +        /*
    +         * CSS
    +         */
    +        $css = [];
    +        if ($assets = $this->property('css')) {
    +            $css += array_map([$this, 'prefixCss'], (array) $assets);
    +        }
    +
    +        if (count($js)) {
    +            $this->addJs(CombineAssets::combine($js, $this->assetPath));
    +        }
    +
    +        if (count($less)) {
    +            $this->addCss(CombineAssets::combine($less, $this->assetPath));
    +        }
    +
    +        if (count($sass)) {
    +            $this->addCss(CombineAssets::combine($sass, $this->assetPath));
    +        }
    +
    +        if (count($css)) {
    +            $this->addCss(CombineAssets::combine($css, $this->assetPath));
    +        }
    +
    +        /*
    +         * Variables
    +         */
    +        if ($vars = $this->property('vars')) {
    +            foreach ((array) $vars as $key => $value) {
    +                $this->page[$key] = $value;
    +            }
    +        }
    +    }
    +
    +    protected function prefixJs($value)
    +    {
    +        return $this->jsDir.'/'.trim($value);
    +    }
    +
    +    protected function prefixCss($value)
    +    {
    +        return $this->cssDir.'/'.trim($value);
    +    }
    +
    +    protected function prefixLess($value)
    +    {
    +        return $this->lessDir.'/'.trim($value);
    +    }
    +
    +    protected function prefixSass($value)
    +    {
    +        return $this->sassDir.'/'.trim($value);
    +    }
    +
    +    protected function guessAssetDirectory(array $possible, $default = null)
    +    {
    +        foreach ($possible as $option) {
    +            if (File::isDirectory($this->assetPath.'/'.$option)) {
    +                return $option;
    +            }
    +        }
    +
    +        return $default;
    +    }
    +
    +    protected function guessAssetPath()
    +    {
    +        $baseTheme = themes_path().'/'.$this->getTheme()->getDirName();
    +
    +        if (File::isDirectory($baseTheme.'/assets')) {
    +            return $baseTheme.'/assets';
    +        }
    +        else {
    +            return $baseTheme.'/resources';
    +        }
    +    }
    +}
    diff --git a/modules/cms/components/UnknownComponent.php b/modules/cms/components/UnknownComponent.php
    new file mode 100644
    index 0000000..aa2b6bc
    --- /dev/null
    +++ b/modules/cms/components/UnknownComponent.php
    @@ -0,0 +1,35 @@
    +errorMessage = $errorMessage;
    +        $this->componentCssClass = 'error-component';
    +        $this->inspectorEnabled = false;
    +
    +        parent::__construct($cmsObject, $properties);
    +    }
    +
    +    /**
    +     * @return array
    +     */
    +    public function componentDetails()
    +    {
    +        return [
    +            'name'        => 'Unknown component',
    +            'description' => $this->errorMessage
    +        ];
    +    }
    +}
    diff --git a/modules/cms/components/ViewBag.php b/modules/cms/components/ViewBag.php
    new file mode 100644
    index 0000000..ece5cd9
    --- /dev/null
    +++ b/modules/cms/components/ViewBag.php
    @@ -0,0 +1,83 @@
    + 'viewBag',
    +            'description' => 'Stores custom template properties.'
    +        ];
    +    }
    +
    +    /**
    +     * @param array $properties
    +     * @return array
    +     */
    +    public function validateProperties(array $properties)
    +    {
    +        return $properties;
    +    }
    +
    +    /**
    +     * Implements the getter functionality.
    +     * @param  string  $name
    +     * @return void
    +     */
    +    public function __get($name)
    +    {
    +        if (array_key_exists($name, $this->properties)) {
    +            return $this->properties[$name];
    +        }
    +
    +        return null;
    +    }
    +
    +    /**
    +     * Determine if an attribute exists on the object.
    +     * @param  string  $key
    +     * @return void
    +     */
    +    public function __isset($key)
    +    {
    +        if (array_key_exists($key, $this->properties)) {
    +            return true;
    +        }
    +
    +        return false;
    +    }
    +
    +    /**
    +     * @return array
    +     */
    +    public function defineProperties()
    +    {
    +        $result = [];
    +
    +        foreach ($this->properties as $name => $value) {
    +            $result[$name] = [
    +                'title' => $name,
    +                'type' => 'string'
    +            ];
    +        }
    +
    +        return $result;
    +    }
    +}
    diff --git a/modules/cms/composer.json b/modules/cms/composer.json
    index 18d6c14..2f9d851 100644
    --- a/modules/cms/composer.json
    +++ b/modules/cms/composer.json
    @@ -16,9 +16,9 @@
             }
         ],
         "require": {
    -        "php": ">=5.5.9",
    +        "php": ">=7.0",
             "composer/installers": "~1.0",
    -        "october/rain": "~1.0"
    +        "october/rain": "dev-develop"
         },
         "autoload": {
             "psr-4": {
    diff --git a/modules/cms/controllers/Index.php b/modules/cms/controllers/Index.php
    index 861d44d..d0c7c44 100644
    --- a/modules/cms/controllers/Index.php
    +++ b/modules/cms/controllers/Index.php
    @@ -3,14 +3,11 @@
     use Url;
     use Lang;
     use Flash;
    -use Event;
     use Config;
     use Request;
     use Response;
     use Exception;
     use BackendMenu;
    -use Backend\Classes\Controller;
    -use Backend\Classes\WidgetManager;
     use Cms\Widgets\AssetList;
     use Cms\Widgets\TemplateList;
     use Cms\Widgets\ComponentList;
    @@ -23,9 +20,10 @@
     use Cms\Classes\CmsCompoundObject;
     use Cms\Classes\ComponentManager;
     use Cms\Classes\ComponentPartial;
    -use ApplicationException;
    -use Backend\Traits\InspectableContainer;
    +use Backend\Classes\Controller;
    +use Backend\Classes\WidgetManager;
     use October\Rain\Router\Router as RainRouter;
    +use ApplicationException;
     
     /**
      * CMS index
    @@ -35,10 +33,16 @@
      */
     class Index extends Controller
     {
    -    use InspectableContainer;
    +    use \Backend\Traits\InspectableContainer;
     
    +    /**
    +     * @var Cms\Classes\Theme
    +     */
         protected $theme;
     
    +    /**
    +     * @var array Permissions required to view this page.
    +     */
         public $requiredPermissions = [
             'cms.manage_content',
             'cms.manage_assets',
    @@ -189,8 +193,7 @@ public function onSave()
             /*
              * Extensibility
              */
    -        Event::fire('cms.template.save', [$this, $template, $type]);
    -        $this->fireEvent('template.save', [$template, $type]);
    +        $this->fireSystemEvent('cms.template.save', [$template, $type]);
     
             Flash::success(Lang::get('cms::lang.template.saved'));
     
    @@ -263,8 +266,7 @@ public function onDeleteTemplates()
             /*
              * Extensibility
              */
    -        Event::fire('cms.template.delete', [$this, $type]);
    -        $this->fireEvent('template.delete', [$type]);
    +        $this->fireSystemEvent('cms.template.delete', [$type]);
     
             return [
                 'deleted' => $deleted,
    @@ -284,8 +286,7 @@ public function onDelete()
             /*
              * Extensibility
              */
    -        Event::fire('cms.template.delete', [$this, $type]);
    -        $this->fireEvent('template.delete', [$type]);
    +        $this->fireSystemEvent('cms.template.delete', [$type]);
         }
     
         public function onGetTemplateList()
    @@ -366,7 +367,10 @@ protected function loadTemplate($type, $path)
                 throw new ApplicationException(trans('cms::lang.template.not_found'));
             }
     
    -        Event::fire('cms.template.processSettingsAfterLoad', [$this, $template]);
    +        /*
    +         * Extensibility
    +         */
    +        $this->fireSystemEvent('cms.template.processSettingsAfterLoad', [$template]);
     
             return $template;
         }
    @@ -475,11 +479,9 @@ protected function upgradeSettings($settings)
             /*
              * Extensibility
              */
    -        $dataHolder = (object)[
    -            'settings' => $settings
    -        ];
    +        $dataHolder = (object) ['settings' => $settings];
     
    -        Event::fire('cms.template.processSettingsBeforeSave', [$this, $dataHolder]);
    +        $this->fireSystemEvent('cms.template.processSettingsBeforeSave', [$dataHolder]);
     
             return $dataHolder->settings;
         }
    diff --git a/modules/cms/controllers/Media.php b/modules/cms/controllers/Media.php
    index c84046f..9d7b6d0 100644
    --- a/modules/cms/controllers/Media.php
    +++ b/modules/cms/controllers/Media.php
    @@ -12,6 +12,9 @@
      */
     class Media extends Controller
     {
    +    /**
    +     * @var array Permissions required to view this page.
    +     */
         public $requiredPermissions = ['media.*'];
     
         /**
    @@ -32,4 +35,4 @@ public function index()
         {
             $this->bodyClass = 'compact-container';
         }
    -}
    \ No newline at end of file
    +}
    diff --git a/modules/cms/controllers/ThemeLogs.php b/modules/cms/controllers/ThemeLogs.php
    new file mode 100644
    index 0000000..03bd0cd
    --- /dev/null
    +++ b/modules/cms/controllers/ThemeLogs.php
    @@ -0,0 +1,96 @@
    +listRefresh();
    +    }
    +
    +    public function index_onEmptyLog()
    +    {
    +        ThemeLog::truncate();
    +        Flash::success(Lang::get('cms::lang.theme_log.empty_success'));
    +        return $this->listRefresh();
    +    }
    +
    +    public function index_onDelete()
    +    {
    +        if (($checkedIds = post('checked')) && is_array($checkedIds) && count($checkedIds)) {
    +
    +            foreach ($checkedIds as $recordId) {
    +                if (!$record = ThemeLog::find($recordId)) continue;
    +                $record->delete();
    +            }
    +
    +            Flash::success(Lang::get('backend::lang.list.delete_selected_success'));
    +        }
    +        else {
    +            Flash::error(Lang::get('backend::lang.list.delete_selected_empty'));
    +        }
    +
    +        return $this->listRefresh();
    +    }
    +
    +    public function preview($id)
    +    {
    +        $this->addCss('/modules/cms/assets/css/themelogs/template-diff.css', 'core');
    +        $this->addJs('/modules/cms/assets/vendor/jsdiff/diff.js', 'core');
    +        $this->addJs('/modules/cms/assets/js/themelogs/template-diff.js', 'core');
    +
    +        return $this->asExtension('FormController')->preview($id);
    +    }
    +}
    diff --git a/modules/cms/controllers/ThemeOptions.php b/modules/cms/controllers/ThemeOptions.php
    new file mode 100644
    index 0000000..6f44476
    --- /dev/null
    +++ b/modules/cms/controllers/ThemeOptions.php
    @@ -0,0 +1,151 @@
    +pageTitle = 'cms::lang.theme.settings_menu';
    +
    +        BackendMenu::setContext('October.System', 'system', 'settings');
    +        SettingsManager::setContext('October.Cms', 'theme');
    +    }
    +
    +    public function update($dirName = null)
    +    {
    +        $dirName = $this->getDirName($dirName);
    +
    +        try {
    +            $model = $this->getThemeData($dirName);
    +
    +            $this->asExtension('FormController')->update($model->id);
    +
    +            $this->vars['hasCustomData'] = $this->hasThemeData($dirName);
    +        }
    +        catch (Exception $ex) {
    +            $this->handleError($ex);
    +        }
    +    }
    +
    +    public function update_onSave($dirName = null)
    +    {
    +        $model = $this->getThemeData($this->getDirName($dirName));
    +        $this->asExtension('FormController')->update_onSave($model->id);
    +    }
    +
    +    public function update_onResetDefault($dirName = null)
    +    {
    +        $model = $this->getThemeData($this->getDirName($dirName));
    +        $model->delete();
    +
    +        return Backend::redirect('cms/themeoptions/update/'.$dirName);
    +    }
    +
    +    /**
    +     * Add form fields defined in theme.yaml
    +     */
    +    public function formExtendFields($form)
    +    {
    +        $model = $form->model;
    +        $theme = $this->findThemeObject($model->theme);
    +        $config = $theme->getConfigArray('form');
    +
    +        if ($fields = array_get($config, 'fields')) {
    +            $form->addFields($fields);
    +        }
    +
    +        if ($fields = array_get($config, 'tabs.fields')) {
    +            $form->addTabFields($fields);
    +        }
    +
    +        if ($fields = array_get($config, 'secondaryTabs.fields')) {
    +            $form->addSecondaryTabFields($fields);
    +        }
    +    }
    +
    +    //
    +    // Helpers
    +    //
    +
    +    /**
    +     * Default to the active theme if user doesn't have access to manage all themes
    +     */
    +    protected function getDirName($dirName = null)
    +    {
    +        /*
    +         * Only the active theme can be managed without this permission
    +         */
    +        if ($dirName && !$this->user->hasAccess('cms.manage_themes')) {
    +            $dirName = null;
    +        }
    +
    +        if ($dirName === null) {
    +            $dirName = CmsTheme::getActiveThemeCode();
    +        }
    +
    +        return $dirName;
    +    }
    +
    +    protected function hasThemeData($dirName)
    +    {
    +        return $this->findThemeObject($dirName)->hasCustomData();
    +    }
    +
    +    protected function getThemeData($dirName)
    +    {
    +        $theme = $this->findThemeObject($dirName);
    +        $model = ThemeData::forTheme($theme);
    +        return $model;
    +    }
    +
    +    protected function findThemeObject($name = null)
    +    {
    +        if ($name === null) {
    +            $name = post('theme');
    +        }
    +
    +        if (!$name || (!$theme = CmsTheme::load($name))) {
    +            throw new ApplicationException(trans('cms::lang.theme.not_found_name', ['name' => $name]));
    +        }
    +
    +        return $theme;
    +    }
    +}
    diff --git a/modules/cms/controllers/Themes.php b/modules/cms/controllers/Themes.php
    index 8848fbc..378ab66 100644
    --- a/modules/cms/controllers/Themes.php
    +++ b/modules/cms/controllers/Themes.php
    @@ -27,12 +27,9 @@
      */
     class Themes extends Controller
     {
    -    public $implement = [
    -        'Backend.Behaviors.FormController'
    -    ];
    -
    -    public $formConfig = 'config_form.yaml';
    -
    +    /**
    +     * @var array Permissions required to view this page.
    +     */
         public $requiredPermissions = ['cms.manage_themes'];
     
         /**
    @@ -48,6 +45,15 @@ public function __construct()
             BackendMenu::setContext('October.System', 'system', 'settings');
             SettingsManager::setContext('October.Cms', 'theme');
     
    +        /*
    +         * Custom redirect for unauthorized request
    +         */
    +        $this->bindEvent('page.beforeDisplay', function() {
    +            if (!$this->user->hasAnyAccess($this->requiredPermissions)) {
    +                return Backend::redirect('cms/themeoptions/update');
    +            }
    +        });
    +
             /*
              * Enable AJAX for Form widgets
              */
    @@ -208,64 +214,6 @@ public function index_onDuplicateTheme()
             return Redirect::refresh();
         }
     
    -    //
    -    // Theme customization
    -    //
    -
    -    public function update($dirName)
    -    {
    -        try {
    -            $model = $this->getThemeData($dirName);
    -            $this->asExtension('FormController')->update($model->id);
    -        }
    -        catch (Exception $ex) {
    -            $this->handleError($ex);
    -        }
    -    }
    -
    -    public function update_onSave($dirName)
    -    {
    -        $model = $this->getThemeData($dirName);
    -        $this->asExtension('FormController')->update_onSave($model->id);
    -    }
    -
    -    public function update_onResetDefault($dirName)
    -    {
    -        $model = $this->getThemeData($dirName);
    -        $model->delete();
    -
    -        return Backend::redirect('cms/themes/update/'.$dirName);
    -    }
    -
    -    protected function getThemeData($dirName)
    -    {
    -        $theme = $this->findThemeObject($dirName);
    -        $model = ThemeData::forTheme($theme);
    -        return $model;
    -    }
    -
    -    /**
    -     * Add form fields defined in theme.yaml
    -     */
    -    public function formExtendFields($form)
    -    {
    -        $model = $form->model;
    -        $theme = $this->findThemeObject($model->theme);
    -        $config = $theme->getConfigArray('form');
    -
    -        if ($fields = array_get($config, 'fields')) {
    -            $form->addFields($fields);
    -        }
    -
    -        if ($fields = array_get($config, 'tabs.fields')) {
    -            $form->addTabFields($fields);
    -        }
    -
    -        if ($fields = array_get($config, 'secondaryTabs.fields')) {
    -            $form->addSecondaryTabFields($fields);
    -        }
    -    }
    -
         //
         // Theme export
         //
    @@ -366,5 +314,4 @@ protected function findThemeObject($name = null)
     
             return $theme;
         }
    -
     }
    diff --git a/modules/cms/controllers/index/_page_toolbar.htm b/modules/cms/controllers/index/_page_toolbar.htm
    index b7ff59f..857d644 100644
    --- a/modules/cms/controllers/index/_page_toolbar.htm
    +++ b/modules/cms/controllers/index/_page_toolbar.htm
    @@ -12,7 +12,7 @@
             $pageUrl = isset($pageUrl) ? $pageUrl : null;
         ?>
         
    diff --git a/modules/cms/controllers/index/config_page_list.yaml b/modules/cms/controllers/index/config_page_list.yaml
    index c2205e1..b250218 100644
    --- a/modules/cms/controllers/index/config_page_list.yaml
    +++ b/modules/cms/controllers/index/config_page_list.yaml
    @@ -9,3 +9,7 @@ descriptionProperties:
     noRecordsMessage: 'cms::lang.page.no_list_records'
     deleteConfirmation: 'cms::lang.page.delete_confirm_multiple'
     itemType: page
    +sortingProperties:
    +    url: 'cms::lang.page.url'
    +    title: 'cms::lang.page.title'
    +    fileName: 'cms::lang.page.file_name'
    diff --git a/modules/cms/controllers/themelogs/_field_content.htm b/modules/cms/controllers/themelogs/_field_content.htm
    new file mode 100644
    index 0000000..3154caa
    --- /dev/null
    +++ b/modules/cms/controllers/themelogs/_field_content.htm
    @@ -0,0 +1,3 @@
    +
    +
    +
    diff --git a/modules/cms/controllers/themelogs/_field_diff_content.htm b/modules/cms/controllers/themelogs/_field_diff_content.htm new file mode 100644 index 0000000..0e7a78e --- /dev/null +++ b/modules/cms/controllers/themelogs/_field_diff_content.htm @@ -0,0 +1,7 @@ +
    +
    
    +
    diff --git a/modules/cms/controllers/themelogs/_field_diff_template.htm b/modules/cms/controllers/themelogs/_field_diff_template.htm new file mode 100644 index 0000000..47ca899 --- /dev/null +++ b/modules/cms/controllers/themelogs/_field_diff_template.htm @@ -0,0 +1,7 @@ +
    +
    diff --git a/modules/cms/controllers/themelogs/_field_template.htm b/modules/cms/controllers/themelogs/_field_template.htm new file mode 100644 index 0000000..75d1610 --- /dev/null +++ b/modules/cms/controllers/themelogs/_field_template.htm @@ -0,0 +1 @@ +
    diff --git a/modules/cms/controllers/themelogs/_hint.htm b/modules/cms/controllers/themelogs/_hint.htm new file mode 100644 index 0000000..78591ed --- /dev/null +++ b/modules/cms/controllers/themelogs/_hint.htm @@ -0,0 +1,4 @@ + +

    + +

    \ No newline at end of file diff --git a/modules/cms/controllers/themelogs/_hint_preview.htm b/modules/cms/controllers/themelogs/_hint_preview.htm new file mode 100644 index 0000000..298de0e --- /dev/null +++ b/modules/cms/controllers/themelogs/_hint_preview.htm @@ -0,0 +1,22 @@ +type == $formModel::TYPE_DELETE): ?> +
    +
    + +

    +
    +
    +type == $formModel::TYPE_CREATE): ?> +
    +
    + +

    +
    +
    + +
    +
    + +

    +
    +
    + diff --git a/modules/cms/controllers/themelogs/_list_toolbar.htm b/modules/cms/controllers/themelogs/_list_toolbar.htm new file mode 100644 index 0000000..6e8f19f --- /dev/null +++ b/modules/cms/controllers/themelogs/_list_toolbar.htm @@ -0,0 +1,31 @@ +
    diff --git a/modules/cms/controllers/themelogs/_preview_scoreboard.htm b/modules/cms/controllers/themelogs/_preview_scoreboard.htm new file mode 100644 index 0000000..abcf44d --- /dev/null +++ b/modules/cms/controllers/themelogs/_preview_scoreboard.htm @@ -0,0 +1,18 @@ +
    +

    +

    #id) ?>

    +
    +user): ?> +
    +

    +

    user->full_name) ?>

    +
    + +
    +

    +

    created_at->toDayDateTimeString()) ?>

    +
    +
    +

    +

    theme_name) ?>

    +
    diff --git a/modules/cms/controllers/themelogs/config_form.yaml b/modules/cms/controllers/themelogs/config_form.yaml new file mode 100644 index 0000000..be54c6e --- /dev/null +++ b/modules/cms/controllers/themelogs/config_form.yaml @@ -0,0 +1,19 @@ +# =================================== +# Form Behavior Config +# =================================== + +# Record name +name: system::lang.event_log.menu_label + +# Model Form Field configuration +form: ~/modules/cms/models/themelog/fields.yaml + +# Model Class name +modelClass: Cms\Models\ThemeLog + +# Default redirect location +defaultRedirect: cms/themelogs + +# Preview page +preview: + title: cms::lang.theme_log.preview_title \ No newline at end of file diff --git a/modules/cms/controllers/themelogs/config_list.yaml b/modules/cms/controllers/themelogs/config_list.yaml new file mode 100644 index 0000000..3e0f852 --- /dev/null +++ b/modules/cms/controllers/themelogs/config_list.yaml @@ -0,0 +1,20 @@ +# =================================== +# List Behavior Config +# =================================== + +title: cms::lang.theme_log.menu_label +list: ~/modules/cms/models/themelog/columns.yaml +modelClass: Cms\Models\ThemeLog +recordUrl: cms/themelogs/preview/:id +noRecordsMessage: backend::lang.list.no_records +recordsPerPage: 30 +showSetup: true +showCheckboxes: true +defaultSort: + column: count + direction: desc + +toolbar: + buttons: list_toolbar + search: + prompt: backend::lang.list.search_prompt diff --git a/modules/cms/controllers/themelogs/index.htm b/modules/cms/controllers/themelogs/index.htm new file mode 100644 index 0000000..d20ced2 --- /dev/null +++ b/modules/cms/controllers/themelogs/index.htm @@ -0,0 +1,5 @@ +
    + makeHintPartial('system_requestlogs_hint', 'hint') ?> +
    + +listRender() ?> \ No newline at end of file diff --git a/modules/cms/controllers/themelogs/preview.htm b/modules/cms/controllers/themelogs/preview.htm new file mode 100644 index 0000000..5c8aae8 --- /dev/null +++ b/modules/cms/controllers/themelogs/preview.htm @@ -0,0 +1,34 @@ + +
      +
    • +
    • pageTitle)) ?>
    • +
    + + +fatalError): ?> + +
    +
    + makePartial('preview_scoreboard') ?> +
    +
    + +
    + makePartial('hint_preview') ?> +
    + +
    + formRenderPreview() ?> +
    + + + +

    fatalError)) ?>

    + + + +

    + + + +

    diff --git a/modules/cms/controllers/themeoptions/config_form.yaml b/modules/cms/controllers/themeoptions/config_form.yaml new file mode 100644 index 0000000..a26cac1 --- /dev/null +++ b/modules/cms/controllers/themeoptions/config_form.yaml @@ -0,0 +1,21 @@ +# =================================== +# Form Behavior Config +# =================================== + +# Record name +name: cms::lang.theme.theme_label + +# Fields are defined by extension +form: [] + +# Model Class name +modelClass: Cms\Models\ThemeData + +# Default redirect location +defaultRedirect: cms/themes + +# Update page +update: + title: cms::lang.theme.customize_theme + redirect: cms/themes + redirectClose: cms/themes diff --git a/modules/cms/controllers/themeoptions/update.htm b/modules/cms/controllers/themeoptions/update.htm new file mode 100644 index 0000000..3413609 --- /dev/null +++ b/modules/cms/controllers/themeoptions/update.htm @@ -0,0 +1,68 @@ + +
      +
    • +
    • pageTitle)) ?>
    • +
    + + +fatalError): ?> + + + 'layout']) ?> + +
    + formRender() ?> +
    + +
    +
    + + + + + + + + +
    +
    + + + + +
    +
    +

    There are no theme options available to customize.

    +
    +
    + + + + +

    fatalError) ?>

    +

    + + diff --git a/modules/cms/controllers/themes/_theme_list_item.htm b/modules/cms/controllers/themes/_theme_list_item.htm index 1e058c3..206d30a 100644 --- a/modules/cms/controllers/themes/_theme_list_item.htm +++ b/modules/cms/controllers/themes/_theme_list_item.htm @@ -8,7 +8,7 @@

    getConfigValue('name', $theme->getDirName())) ?>

    -

    by

    +

    ''.e($author).'']) ?>

    getConfigValue('description', 'The theme description is not provided.')) ?> @@ -36,7 +36,7 @@

    getConfigValue('name', $theme->getDirName())) ?>

    hasCustomData()): ?> @@ -73,7 +73,7 @@

    getConfigValue('name', $theme->getDirName())) ?>

    href="javascript:;" class="oc-icon-copy"> - +
  • diff --git a/modules/cms/database/migrations/2016_10_01_000002_Db_Cms_Timestamp_Fix.php b/modules/cms/database/migrations/2016_10_01_000002_Db_Cms_Timestamp_Fix.php index 765397c..327640e 100644 --- a/modules/cms/database/migrations/2016_10_01_000002_Db_Cms_Timestamp_Fix.php +++ b/modules/cms/database/migrations/2016_10_01_000002_Db_Cms_Timestamp_Fix.php @@ -15,16 +15,6 @@ public function up() DbDongle::disableStrictMode(); DbDongle::convertTimestamps('cms_theme_data'); - - // Use this opportunity to patch the theme.yaml file for stable - $demoTheme = base_path('themes/demo/theme.yaml'); - if (file_exists($demoTheme) && is_writable($demoTheme)) { - $contents = file_get_contents($demoTheme); - $search = "description: Demo OctoberCMS theme. Demonstrates the basic concepts of the front-end theming: layouts, pages, partials, components, content blocks, AJAX framework."; - $replace = "description: 'Demo OctoberCMS theme. Demonstrates the basic concepts of the front-end theming: layouts, pages, partials, components, content blocks, AJAX framework.'"; - $contents = str_replace($search, $replace, $contents); - file_put_contents($demoTheme, $contents); - } } public function down() diff --git a/modules/cms/database/migrations/2017_10_01_000003_Db_Cms_Theme_Logs.php b/modules/cms/database/migrations/2017_10_01_000003_Db_Cms_Theme_Logs.php new file mode 100644 index 0000000..4e0b684 --- /dev/null +++ b/modules/cms/database/migrations/2017_10_01_000003_Db_Cms_Theme_Logs.php @@ -0,0 +1,28 @@ +engine = 'InnoDB'; + $table->increments('id'); + $table->string('type', 20)->index(); + $table->string('theme')->nullable()->index(); + $table->string('template')->nullable(); + $table->string('old_template')->nullable(); + $table->longText('content')->nullable(); + $table->longText('old_content')->nullable(); + $table->integer('user_id')->index()->nullable(); + $table->timestamps(); + }); + } + + public function down() + { + Schema::dropIfExists('cms_theme_logs'); + } +} diff --git a/modules/cms/facades/Cms.php b/modules/cms/facades/Cms.php index 21ac2b1..81931d8 100644 --- a/modules/cms/facades/Cms.php +++ b/modules/cms/facades/Cms.php @@ -6,7 +6,7 @@ class Cms extends Facade { /** * Get the registered name of the component. - * + * * @see \Cms\Helpers\Cms * @return string */ diff --git a/modules/cms/formwidgets/Components.php b/modules/cms/formwidgets/Components.php index 0a9b4dc..5963fd3 100644 --- a/modules/cms/formwidgets/Components.php +++ b/modules/cms/formwidgets/Components.php @@ -4,7 +4,7 @@ use Backend\Classes\FormWidgetBase; use Cms\Classes\ComponentManager; use Cms\Classes\ComponentHelpers; -use Cms\Classes\UnknownComponent; +use Cms\Components\UnknownComponent; use Exception; /** @@ -17,7 +17,7 @@ class Components extends FormWidgetBase { /** - * {@inheritDoc} + * @inheritDoc */ public function render() { diff --git a/modules/cms/formwidgets/MediaFinder.php b/modules/cms/formwidgets/MediaFinder.php index 55d0142..778fb57 100644 --- a/modules/cms/formwidgets/MediaFinder.php +++ b/modules/cms/formwidgets/MediaFinder.php @@ -3,6 +3,7 @@ use Lang; use ApplicationException; use Cms\Classes\MediaLibrary; +use Backend\Classes\FormField; use Backend\Classes\FormWidgetBase; /** @@ -13,7 +14,7 @@ * label: Some image * type: media * prompt: Click the %s button to find a user - * + * * @package october\cms * @author Alexey Bobkov, Samuel Georges */ @@ -33,32 +34,49 @@ class MediaFinder extends FormWidgetBase */ public $mode = 'file'; + /** + * @var int Preview image width + */ + public $imageWidth = null; + + /** + * @var int Preview image height + */ + public $imageHeight = null; + // // Object properties // /** - * {@inheritDoc} + * @inheritDoc */ protected $defaultAlias = 'media'; /** - * {@inheritDoc} + * @inheritDoc */ public function init() { $this->fillFromConfig([ 'mode', - 'prompt' + 'prompt', + 'imageWidth', + 'imageHeight' ]); + + if ($this->formField->disabled) { + $this->previewMode = true; + } } /** - * {@inheritDoc} + * @inheritDoc */ public function render() { $this->prepareVars(); + return $this->makePartial('mediafinder'); } @@ -73,14 +91,28 @@ public function prepareVars() $this->vars['field'] = $this->formField; $this->vars['prompt'] = str_replace('%s', '', trans($this->prompt)); $this->vars['mode'] = $this->mode; + $this->vars['imageWidth'] = $this->imageWidth; + $this->vars['imageHeight'] = $this->imageHeight; + } + + /** + * @inheritDoc + */ + public function getSaveValue($value) + { + if ($this->formField->disabled || $this->formField->hidden) { + return FormField::NO_SAVE_DATA; + } + + return $value; } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { $this->addJs('js/mediafinder.js', 'core'); $this->addCss('css/mediafinder.css', 'core'); } -} \ No newline at end of file +} diff --git a/modules/cms/formwidgets/mediafinder/assets/css/mediafinder.css b/modules/cms/formwidgets/mediafinder/assets/css/mediafinder.css index 3f78d46..70e87a0 100644 --- a/modules/cms/formwidgets/mediafinder/assets/css/mediafinder.css +++ b/modules/cms/formwidgets/mediafinder/assets/css/mediafinder.css @@ -50,6 +50,10 @@ .field-mediafinder.is-populated .find-object:hover .meta .find-remove-button { display: block; } +.field-mediafinder.is-preview .find-button, +.field-mediafinder.is-preview .find-remove-button { + display: none !important; +} @media (max-width: 1024px) { .field-fileupload.is-populated .find-object h4 a, .field-fileupload.is-populated .find-object .meta .find-remove-button { diff --git a/modules/cms/formwidgets/mediafinder/assets/js/mediafinder.js b/modules/cms/formwidgets/mediafinder/assets/js/mediafinder.js index f3eb76c..be0030c 100644 --- a/modules/cms/formwidgets/mediafinder/assets/js/mediafinder.js +++ b/modules/cms/formwidgets/mediafinder/assets/js/mediafinder.js @@ -33,13 +33,31 @@ this.options.isMulti = this.$el.hasClass('is-multi') } + if (this.options.isPreview === null) { + this.options.isPreview = this.$el.hasClass('is-preview') + } + if (this.options.isImage === null) { this.options.isImage = this.$el.hasClass('is-image') } + this.$el.one('dispose-control', this.proxy(this.dispose)) + + if (this.options.thumbnailWidth > 0) { + this.$el.css('maxWidth', this.options.thumbnailWidth + 'px') + } + + else if (this.options.thumbnailHeight > 0) { + this.$el.css('maxHeight', this.options.thumbnailHeight + 'px') + } + + // Stop here for preview mode + if (this.options.isPreview) { + return + } + this.$el.on('click', '.find-button', this.proxy(this.onClickFindButton)) this.$el.on('click', '.find-remove-button', this.proxy(this.onClickRemoveButton)) - this.$el.one('dispose-control', this.proxy(this.dispose)) this.$findValue = $('[data-find-value]', this.$el) } @@ -99,7 +117,6 @@ this.hide() } }) - } MediaFinder.prototype.evalIsPopulated = function() { @@ -110,6 +127,7 @@ MediaFinder.DEFAULTS = { isMulti: null, + isPreview: null, isImage: null } @@ -118,10 +136,10 @@ var old = $.fn.mediaFinder - $.fn.mediaFinder = function (option) { + $.fn.mediaFinder = function(option) { var args = arguments; - return this.each(function () { + return this.each(function() { var $this = $(this) var data = $this.data('oc.mediaFinder') var options = $.extend({}, MediaFinder.DEFAULTS, $this.data(), typeof option == 'object' && option) @@ -132,12 +150,12 @@ $.fn.mediaFinder.Constructor = MediaFinder - $.fn.mediaFinder.noConflict = function () { + $.fn.mediaFinder.noConflict = function() { $.fn.mediaFinder = old return this } - $(document).render(function (){ + $(document).render(function() { $('[data-control="mediafinder"]').mediaFinder() }) diff --git a/modules/cms/formwidgets/mediafinder/assets/less/mediafinder.base.less b/modules/cms/formwidgets/mediafinder/assets/less/mediafinder.base.less index 3ff37b7..1b524a1 100644 --- a/modules/cms/formwidgets/mediafinder/assets/less/mediafinder.base.less +++ b/modules/cms/formwidgets/mediafinder/assets/less/mediafinder.base.less @@ -117,6 +117,16 @@ } } + // + // Preview mode + // + + &.is-preview { + .find-button, + .find-remove-button { + display: none !important; + } + } } // diff --git a/modules/cms/formwidgets/mediafinder/partials/_file_single.htm b/modules/cms/formwidgets/mediafinder/partials/_file_single.htm index 59734ba..8a774a1 100644 --- a/modules/cms/formwidgets/mediafinder/partials/_file_single.htm +++ b/modules/cms/formwidgets/mediafinder/partials/_file_single.htm @@ -1,6 +1,6 @@
    @@ -39,4 +39,4 @@

    value="" data-find-value /> -

    \ No newline at end of file +
  • diff --git a/modules/cms/formwidgets/mediafinder/partials/_image_single.htm b/modules/cms/formwidgets/mediafinder/partials/_image_single.htm index 2a1af44..a56dceb 100644 --- a/modules/cms/formwidgets/mediafinder/partials/_image_single.htm +++ b/modules/cms/formwidgets/mediafinder/partials/_image_single.htm @@ -1,7 +1,9 @@
    @@ -32,4 +34,4 @@

    value="" data-find-value /> -

    \ No newline at end of file +
    diff --git a/modules/cms/formwidgets/mediafinder/partials/_mediafinder.htm b/modules/cms/formwidgets/mediafinder/partials/_mediafinder.htm index 48ec20a..b4b7035 100644 --- a/modules/cms/formwidgets/mediafinder/partials/_mediafinder.htm +++ b/modules/cms/formwidgets/mediafinder/partials/_mediafinder.htm @@ -1,11 +1,19 @@ -previewMode && !$value): ?> - case 'image': ?> - makePartial('image_single') ?> - + - - makePartial('file_single') ?> - + - + + makePartial('image_single') ?> + + + + makePartial('file_single') ?> + + + + + diff --git a/modules/cms/helpers/Cms.php b/modules/cms/helpers/Cms.php index 22a162d..566ce4c 100644 --- a/modules/cms/helpers/Cms.php +++ b/modules/cms/helpers/Cms.php @@ -36,4 +36,4 @@ public function url($path = null) return Url::to($path); } } -} \ No newline at end of file +} diff --git a/modules/cms/lang/be/lang.php b/modules/cms/lang/be/lang.php new file mode 100644 index 0000000..61b64fe --- /dev/null +++ b/modules/cms/lang/be/lang.php @@ -0,0 +1,322 @@ + [ + 'invalid_file' => "Няправільнае імя файла: \":name\". Імёны файлаў могуць утрымліваць толькі літарна-лічбавыя знакі, знакі падкрэслення, працяжнік і кропкі. Некаторыя прыклады правільных імёнаў файлаў: page.htm, page, subdirectory/page", + 'invalid_property' => "Ўласцівасць \":name\" не можа быць ўстаноўлена", + 'file_already_exists' => "Файл \":name\" ужо існуе", + 'error_saving' => "Памылка падчас захавання файла \":name\". Калі ласка, праверце дазволы на запіс", + 'error_creating_directory' => "Памылка падчас стварэння каталогу \":name\". Калі ласка, праверце дазволы на запіс", + 'invalid_file_extension' => "Няправільнае пашырэнне файла: :invalid. Дазволеныя пашырэнні: :allowed", + 'error_deleting' => "Памылка падчас выдалення файла шаблону \":name\". Калі ласка, праверце дазволы на запіс", + 'delete_success' => "Выдалена шаблонаў: :count", + 'file_name_required' => "Патрабуецца імя файла", + 'safe_mode_enabled' => "Бяспечны рэжым ужо уключаны", + ], + 'dashboard' => [ + 'active_theme' => [ + 'widget_title_default' => "Вэбсайт", + 'online' => "Анлайн", + 'maintenance' => "У абслугоўванні", + 'manage_themes' => "Кіраванне тэмамі", + ] + ], + 'theme' => [ + 'not_found_name' => "Тэма \":name\" не знойдзена", + 'active' => [ + 'not_set' => "Актыўная тэма не ўстаноўлена", + 'not_found' => "Актыўная тэма не знойдзена" + ], + 'edit' => [ + 'not_set' => "Тэма для рэдагавання не ўстаноўлена", + 'not_found' => "Тэма для рэдагавання не знойдзена", + 'not_match' => "Аб'ект, які Вы спрабуеце адкрыць, не належыць рэдагуемай тэме. Калі ласка, перазагрузіце старонку" + ], + 'settings_menu' => "Інтэрфейсная тэма", + 'settings_menu_description' => "Прагляд усталяваных тэм і выбар актыўнай тэмы", + 'default_tab' => "Уласцівасці", + 'name_label' => "Імя", + 'name_create_placeholder' => "Новае імя тэмы", + 'author_label' => "Аўтар", + 'author_placeholder' => "Імя чалавека або назва кампаніі", + 'description_label' => "Апісанне", + 'description_placeholder' => "Апісанне тэмы", + 'homepage_label' => "Хатняя старонка", + 'homepage_placeholder' => "Адрас вэбсайта", + 'code_label' => "Код", + 'code_placeholder' => "Унікальны код гэтай тэмы, які можа быць выкарыстаны для распаўсюджвання", + 'dir_name_label' => "Назва каталогу", + 'dir_name_create_label' => "Каталог прызначэння для тэмы", + 'theme_label' => "Тэма", + 'theme_title' => "Тэмы", + 'activate_button' => "Актываваць", + 'active_button' => "Актыўная", + 'customize_theme' => "Наладзіць тэму", + 'customize_button' => "Налады", + 'duplicate_button' => "Капіраваць", + 'duplicate_title' => "Скапіраваць тэму", + 'duplicate_theme_success' => "Тэма скапіравана!", + 'manage_button' => "Кіраванне", + 'manage_title' => "Кіраваць тэмай", + 'edit_properties_title' => "Тэма", + 'edit_properties_button' => "Рэдагаваць налады", + 'save_properties' => "Захаваць налады", + 'import_button' => "Імпарт", + 'import_title' => "Імпартаваць тэму", + 'import_theme_success' => "Тэма імпартавана!", + 'import_uploaded_file' => "Архіў тэмы", + 'import_overwrite_label' => "Перапісаць файлы, што існуюць", + 'import_overwrite_comment' => "Зніміце гэтую пазнаку, каб імпартаваць толькі новыя файлы", + 'import_folders_label' => "Каталогі", + 'import_folders_comment' => "Калі ласка, выберыце каталогі тэмы, якія Вы жадаеце імпартаваць", + 'export_button' => "Экспарт", + 'export_title' => "Экспартаваць тэму", + 'export_folders_label' => "Каталогі", + 'export_folders_comment' => "Калі ласка, выберыце каталогі тэмы, якія Вы жадаеце экспартаваць", + 'delete_button' => "Выдаліць", + 'delete_confirm' => "Вы ўпэўнены, што жадаеце выдаліць гэтую тэму? Гэта нельга адмяніць!", + 'delete_active_theme_failed' => "Немагчыма выдаліць актыўную тэму, паспрабуйце спачатку зрабіць іншую тэму актыўнай", + 'delete_theme_success' => "Тэма была выдалена!", + 'create_title' => "Стварыць тэму", + 'create_button' => "Стварыць", + 'create_new_blank_theme' => "Стварыць новую пустую тэму", + 'create_theme_success' => "Тэма была створана!", + 'create_theme_required_name' => "Калі ласка, укажыце імя тэмы", + 'new_directory_name_label' => "Каталог тэмы", + 'new_directory_name_comment' => "Вызначце новае імя каталога для скапіраванай тэмы", + 'dir_name_invalid' => "Імя можа складацца толькі з лічбаў, лацінскіх літараў і наступных сімвалаў: _-", + 'dir_name_taken' => "Пажаданае імя ўжо існуе", + 'find_more_themes' => "Знайсці больш тэм", + 'saving' => "Захаванне тэмы...", + 'return' => "Вярнуцца да спісу тэм", + ], + 'maintenance' => [ + 'settings_menu' => "Рэжым абслугоўвання", + 'settings_menu_description' => "Наладзіць старонку рэжыма абслугоўвання і пераключыць наладу", + 'is_enabled' => "Уключыць рэжым абслугоўвання", + 'is_enabled_comment' => "Выберыце старонку, якую неабходна паказваць, калі ўключаны рэжым абслугоўвання", + 'hint' => "Рэжым абслугоўвання будзе паказваць абраную старонку наведвальнікам, якія не ўвайшлі ў панэль кіравання", + ], + 'page' => [ + 'not_found_name' => "Старонка \":name\" не знойдзена", + 'not_found' => [ + 'label' => "Старонка не знойдзена", + 'help' => "Запрошаная старонка не можа быць знойдзена" + ], + 'custom_error' => [ + 'label' => "Памылка на старонцы", + 'help' => "Прабачце, але нешта здарылася і старонка не можа быць адлюстравана" + ], + 'menu_label' => "Старонкі", + 'unsaved_label' => "Незахаваныя старонкі", + 'no_list_records' => "Няма старонак", + 'new' => "Новая старонка", + 'invalid_url' => "Няправільны фармат URL. URL павінен пачынацца з \"\\/\" і складацца з лацінскіх літараў, лічбаў і наступных сімвалаў: ._-[]:?|/+*^$", + 'delete_confirm_multiple' => "Выдаліць абраныя старонкі?", + 'delete_confirm_single' => "Выдаліць гэтую старонку?", + 'no_layout' => "-- няма макету --", + 'cms_page' => "Старонка CMS" + ], + 'layout' => [ + 'not_found_name' => "Макет \":name\" не знойдзены", + 'menu_label' => "Макеты", + 'unsaved_label' => "Незахаваныя макеты", + 'no_list_records' => "Няма макетаў", + 'new' => "Новы макет", + 'delete_confirm_multiple' => "Выдаліць абраныя макеты?", + 'delete_confirm_single' => "Выдаліць гэты макет?" + ], + 'partial' => [ + 'not_found_name' => "Частковы шаблон \":name\" не знойдзены", + 'invalid_name' => "Няправільная назва частковага шаблона: \":name\"", + 'menu_label' => "Частковыя шаблоны", + 'unsaved_label' => "Незахаваныя частковыя шаблоны", + 'no_list_records' => "Няма частковых шаблонаў", + 'delete_confirm_multiple' => "Выдаліць абраныя шаблоны?", + 'delete_confirm_single' => "Выдаліць гэты частковы шаблон?", + 'new' => "Новы частковы шаблон" + ], + 'content' => [ + 'not_found_name' => "Зместавы файл \":name\" не знойдзены", + 'menu_label' => "Змест", + 'unsaved_label' => "Незахаваны змест", + 'no_list_records' => "Зместавыя файлы не знойдзены", + 'delete_confirm_multiple' => "Выдаліць абраныя зместавыя файлы альбо каталогі?", + 'delete_confirm_single' => "Выдаліць гэты зместавы файл?", + 'new' => "Новы зместавы файл" + ], + 'ajax_handler' => [ + 'invalid_name' => "Няправільнае імя апрацоўшчыка AJAX: \":name\"", + 'not_found' => "AJAX апрацоўшчык \":name\" не знойдзены" + ], + 'cms' => [ + 'menu_label' => "CMS" + ], + 'sidebar' => [ + 'add' => "Дадаць", + 'search' => "Знайсці..." + ], + 'editor' => [ + 'settings' => "Налады", + 'title' => "Назва", + 'new_title' => "Назва новай старонкі", + 'url' => "URL", + 'filename' => "Імя файла", + 'layout' => "Макет", + 'description' => "Апісанне", + 'preview' => "Папярэдні прагляд", + 'meta' => "Мета", + 'meta_title' => "Назва мета-дадзеных", + 'meta_description' => "Апісанне мета-дадзеных", + 'markup' => "Макет", + 'code' => "Код", + 'content' => "Змест", + 'hidden' => "Схаваная", + 'hidden_comment' => "Схаваная старонка бачная толькі для карыстальнікаў панэлі кіравання, якія ўвайшлі ў сістэму", + 'enter_fullscreen' => "Ўключыць паўнаэкранны рэжым", + 'exit_fullscreen' => "Выключыць паўнаэкранны рэжым", + 'open_searchbox' => "Адчыніць пошук", + 'close_searchbox' => "Зачыніць пошук", + 'open_replacebox' => "Адчыніць налады для замены", + 'close_replacebox' => "Зачыніць налады для замены" + ], + 'asset' => [ + 'menu_label' => "Рэсурсы", + 'unsaved_label' => "Незахаваныя рэсурсы", + 'drop_down_add_title' => "Дадаць...", + 'drop_down_operation_title' => "Дзеянне...", + 'upload_files' => "Загрузіць файлы", + 'create_file' => "Стварыць файл", + 'create_directory' => "Стварыць каталог", + 'directory_popup_title' => "Новы каталог", + 'directory_name' => "Назва каталогу", + 'rename' => "Пераіменаваць", + 'delete' => "Выдаліць", + 'move' => "Перамясціць", + 'select' => "Выбраць", + 'new' => "Новы файл", + 'rename_popup_title' => "Пераіменаваць", + 'rename_new_name' => "Новае імя", + 'invalid_path' => "Шлях можа ўтрымліваць толькі лічбы, лацінскія літары, прабелы і наступныя сімвалы: ._-/", + 'error_deleting_file' => "Памылка падчас выдалення файлу \":name\"", + 'error_deleting_dir_not_empty' => "Памылка падчас выдалення каталогу \":name\". Каталог не пусты", + 'error_deleting_dir' => "Памылка падчас выдалення каталогу \":name\"", + 'invalid_name' => "Імя можа ўтрымліваць толькі лічбы, лацінскія літары, прабелы і наступныя сімвалы: ._-", + 'original_not_found' => "Арыгінальныя файл альбо каталог не былі знойдзены", + 'already_exists' => "Файл альбо каталог з такім імем ужо існуе", + 'error_renaming' => "Памылка падчас пераіменавання файла ільбо каталога", + 'name_cant_be_empty' => "Імя не можа быць пустым", + 'too_large' => "Файл занадта вялікі. Найбольы дазволеы памер :max_size", + 'type_not_allowed' => "Дазволеныя толькі наступныя тыпы файлаў: :allowed_types", + 'file_not_valid' => "Файл няправільны", + 'error_uploading_file' => "Памылка падчас загрузкі файла \":name\": :error", + 'move_please_select' => "калі ласка, выберыце", + 'move_destination' => "Каталог прызначэння", + 'move_popup_title' => "Перамясціць рэсурсы", + 'move_button' => "Перамясціць", + 'selected_files_not_found' => "Абраныя файлы не былі знойдзеныя", + 'select_destination_dir' => "Калі ласка, вызначце каталог прызначэння", + 'destination_not_found' => "Каталог прызначэння не знойдзены", + 'error_moving_file' => "Памылка падчас перамяшчэння файла \":file\"", + 'error_moving_directory' => "Памылка падчас перамяшчэння каталогу \":dir\"", + 'error_deleting_directory' => "Памылка падчас выдалення зыходнага каталогу \":dir\"", + 'no_list_records' => "Файлы не знойдзены", + 'delete_confirm' => "Выдаліць абраныя файлы альбо каталогі?", + 'path' => "Шлях" + ], + 'component' => [ + 'menu_label' => "Кампаненты", + 'unnamed' => "Неназваны", + 'no_description' => "Няма апісання", + 'alias' => "Псеўданім", + 'alias_description' => "Унікальнае імя макету, каб ужываць яго на старонцы альбо ў макеце", + 'validation_message' => "Псеўданімы для кампанентаў з'яўляюцца неабходнымі і могуць складацца толькі з лацінскіх сімвалаў, лічбаў і знакаў падкрэслівання. Пачынацца павінны з лацінскага сімвала", + 'invalid_request' => "Шаблон не можа быць захаваны з-за няправільных дадзеных кампаненту", + 'no_records' => "Няма кампанентаў", + 'not_found' => "Кампанент \":name\" не знойдзены", + 'method_not_found' => "Кампанент \":name\" не мае метада \":method\"" + ], + 'template' => [ + 'invalid_type' => "Невядомы тып шаблону", + 'not_found' => "Шаблон не знойдзены", + 'saved' => "Шаблон захаваны", + 'no_list_records' => "Запісы не знойдзены", + 'delete_confirm' => "Выдаліць абраныя шаблоны?" + ], + 'permissions' => [ + 'name' => "CMS", + 'manage_content' => "Кіраванне зместавымі файламі сайту", + 'manage_assets' => "Кіраванне рэсурсамі сайту - малюнкамі, файламі JavaScript, CSS", + 'manage_pages' => "Стварэнне, змяненне і выдаленне старонак сайту", + 'manage_layouts' => "Стварэнне, змяненне і выдаленне CMS макетаў", + 'manage_partials' => "Стварэнне, змяненне і выдаленне частковых шаблонаў CMS", + 'manage_themes' => "Актывацыя, дэактывацыя і налады тэмаў CMS", + 'manage_media' => "Загрузка і кіраванне медыя зместам - выявы, відэа, гукі, дакументы" + ], + 'mediafinder' => [ + 'label' => "Медыя каталог", + 'default_prompt' => "Націсніце %s кнопку, каб адшукаць медыя файлы" + ], + 'media' => [ + 'invalid_path' => "Няправільны шлях да файлу: \":path\"", + 'menu_label' => "Медыя", + 'upload' => "Загрузіць", + 'move' => "Перамясціць", + 'delete' => "Выдаліць", + 'add_folder' => "Дадаць каталог", + 'search' => "Пошук", + 'display' => "Паказаць", + 'filter_everything' => "Усё", + 'filter_images' => "Выявы", + 'filter_video' => "Відэа", + 'filter_audio' => "Аўдыё", + 'filter_documents' => "Дакументы", + 'library' => "Бібліятэка", + 'folder_size_items' => "аб'ект(аў)", + 'size' => "Памер", + 'title' => "Назва", + 'last_modified' => "Час апошняй мадыфікацыі", + 'public_url' => "Публічны URL", + 'click_here' => "Націсніце сюды", + 'thumbnail_error' => "Памылка падчас генерацыі мініяцюры", + 'return_to_parent' => "Вярнуцца да бацькоўскага каталогу", + 'return_to_parent_label' => "Падняцца ..", + 'nothing_selected' => "Нічога не выбрана", + 'multiple_selected' => "Шматлікія аб'екты выбраны", + 'uploading_file_num' => "Загрузка :number файла(аў)...", + 'uploading_complete' => "Загрузка скончаная", + 'uploading_error' => "Не атымалася загрузіць", + 'type_blocked' => "Гэты тып файлу заблакіраваны з-за небяспекі", + 'order_by' => "Сартаваць па", + 'folder' => "Каталог", + 'no_files_found' => "Не знойдзена файлаў па Вашым запыце", + 'delete_empty' => "Калі ласка, вызначце файлы для выдалення", + 'delete_confirm' => "Выдаліць абраныя аб'екты?", + 'error_renaming_file' => "Памылка падчас пераіменавання аб'екту", + 'new_folder_title' => "Новы каталог", + 'folder_name' => "Імя каталогу", + 'error_creating_folder' => "Памылка падчас стварэння каталогу", + 'folder_or_file_exist' => "Каталог альбо файл з такім імем ужо існуе", + 'move_empty' => "Калі ласка, выберыце аб'екты для перамяшчэння", + 'move_popup_title' => "Перамясціць файлы альбо каталогі", + 'move_destination' => "Каталог прызначэння", + 'please_select_move_dest' => "Калі ласка, выберыце каталог прызначэння", + 'move_dest_src_match' => "Калі ласка, выберыце іншы каталог прызначэння", + 'empty_library' => "Медыя бібліятэка пустая. Загрузіце файлы альбо стварыце каталогі, каб пачаць", + 'insert' => "Уставіць", + 'crop_and_insert' => "Абрэзаць і ўставіць", + 'select_single_image' => "Калі ласка, выберыце адну выяву", + 'selection_not_image' => "Абраны аб'ект не з'яўляецца файлам", + 'restore' => "Адмяніць усе змяненні", + 'resize' => "Змяніць памер...", + 'selection_mode_normal' => "Нармальны", + 'selection_mode_fixed_ratio' => "Фіксіраваныя суадносіны старонак", + 'selection_mode_fixed_size' => "Фіксіраваны памер", + 'height' => "Вышыня", + 'width' => "Шырыня", + 'selection_mode' => "Рэжым выбару", + 'resize_image' => "Змяніць памер", + 'image_size' => "Памер выявы:", + 'selected_size' => "Выбрана:" + ] +]; diff --git a/modules/cms/lang/el/lang.php b/modules/cms/lang/el/lang.php index 8563eb7..23178dc 100644 --- a/modules/cms/lang/el/lang.php +++ b/modules/cms/lang/el/lang.php @@ -1,5 +1,5 @@ [ 'invalid_file' => 'Μη έγκυρο όνομα αρχείου: :name. Τα ονόματα αρχείων μπορούν να περιέχουν μόνο αλφαριθμητικά σύμβολα, κάτω παύλες, παύλες και τελείες. Μερικά παραδείγματα σωστών ονομάτων αρχείων: page.htm, page, subdirectory/page', @@ -161,7 +161,7 @@ 'new_title' => 'Νέος τίτλος σελίδας', 'url' => 'URL', 'filename' => 'Όνομα Αρχείου', - 'layout' => 'Διάταξη', + 'layout' => 'Διάταξη', 'description' => 'Περιγραφή', 'preview' => 'Προεπισκόπηση', 'meta' => 'Meta', @@ -171,17 +171,17 @@ 'code' => 'Κώδικας', 'content' => 'Περιεχόμενο', 'hidden' => 'Κρυφό', - 'hidden_comment' => 'Οι κρυφες σελιδες ειναι προσβασημες μονο απο τους συνδεδεμενους back-end χρηστες.', - 'enter_fullscreen' => 'Μεταβαση σε λειτουργια πληρους οθονης', - 'exit_fullscreen' => 'Εξοδος απο την λειτουργια πληρους οθονης', + 'hidden_comment' => 'Οι κρυφές σελίδες είναι προσβάσημες μόνο από τους συνδεδεμένους back-end χρήστες.', + 'enter_fullscreen' => 'Μετάβαση σε λειτουργία πλήρους οθόνης', + 'exit_fullscreen' => 'Έξοδος από την λειτουργία πλήρους οθόνης', 'open_searchbox' => 'Άνοιγμα του πλαισίου Αναζήτησης', 'close_searchbox' => 'Κλείσιμο του πλαισίου Αναζήτησης', 'open_replacebox' => 'Άνοιγμα του πλαισίου Αντικατάστασης', 'close_replacebox' => 'Κλείσιμο του πλαισίου Αντικατάστασης', ], 'asset' => [ - 'menu_label' => 'Ποροι', - 'unsaved_label' => 'Μη αποθηκευμενοι ποροι', + 'menu_label' => 'Πόροι', + 'unsaved_label' => 'Μη αποθηκευμένοι πόροι', 'drop_down_add_title' => 'Προσθήκη...', 'drop_down_operation_title' => 'Ενέργια...', 'upload_files' => 'Ανέβασμα αρχείου(α)', diff --git a/modules/cms/lang/en/lang.php b/modules/cms/lang/en/lang.php index 5d9aee3..8ef0c15 100644 --- a/modules/cms/lang/en/lang.php +++ b/modules/cms/lang/en/lang.php @@ -7,11 +7,11 @@ 'file_already_exists' => "File ':name' already exists.", 'error_saving' => "Error saving file ':name'. Please check write permissions.", 'error_creating_directory' => 'Error creating directory :name. Please check write permissions.', - 'invalid_file_extension'=>'Invalid file extension: :invalid. Allowed extensions are: :allowed.', + 'invalid_file_extension' => 'Invalid file extension: :invalid. Allowed extensions are: :allowed.', 'error_deleting' => "Error deleting the template file ':name'. Please check write permissions.", 'delete_success' => 'Templates deleted: :count.', 'file_name_required' => 'The File Name field is required.', - 'safe_mode_enabled' => 'Safe mode is currently enabled.', + 'safe_mode_enabled' => 'Safe mode is currently enabled.' ], 'dashboard' => [ 'active_theme' => [ @@ -19,10 +19,12 @@ 'online' => 'Online', 'maintenance' => 'In maintenance', 'manage_themes' => 'Manage themes', + 'customize_theme' => 'Customize theme' ] ], 'theme' => [ 'not_found_name' => "The theme ':name' is not found.", + 'by_author' => 'By :name', 'active' => [ 'not_set' => 'The active theme is not set.', 'not_found' => 'The active theme is not found.' @@ -33,7 +35,7 @@ 'not_match' => "The object you're trying to access doesn't belong to the theme being edited. Please reload the page." ], 'settings_menu' => 'Front-end theme', - 'settings_menu_description' => 'Preview the list of installed themes and select an active theme.', + 'settings_menu_description' => 'Manage the front-end theme and customization options.', 'default_tab' => 'Properties', 'name_label' => 'Name', 'name_create_placeholder' => 'New theme name', @@ -45,6 +47,8 @@ 'homepage_placeholder' => 'Website URL', 'code_label' => 'Code', 'code_placeholder' => 'A unique code for this theme used for distribution', + 'preview_image_label' => 'Preview image', + 'preview_image_placeholder' => 'The path of theme preview image.', 'dir_name_label' => 'Directory name', 'dir_name_create_label' => 'The destination theme directory', 'theme_label' => 'Theme', @@ -74,7 +78,7 @@ 'export_folders_label' => 'Folders', 'export_folders_comment' => 'Please select the theme folders you would like to export', 'delete_button' => 'Delete', - 'delete_confirm' => 'Are you sure you want to delete this theme? It cannot be undone!', + 'delete_confirm' => 'Delete this theme? It cannot be undone!', 'delete_active_theme_failed' => 'Cannot delete the active theme, try making another theme active first.', 'delete_theme_success' => 'Theme deleted!', 'create_title' => 'Create theme', @@ -88,14 +92,14 @@ 'dir_name_taken' => 'Desired theme directory already exists.', 'find_more_themes' => 'Find more themes', 'saving' => 'Saving theme...', - 'return' => 'Return to themes list', + 'return' => 'Return to themes list' ], 'maintenance' => [ 'settings_menu' => 'Maintenance mode', 'settings_menu_description' => 'Configure the maintenance mode page and toggle the setting.', 'is_enabled' => 'Enable maintenance mode', 'is_enabled_comment' => 'Select the page to show when maintenance mode is activated.', - 'hint' => 'Maintenance mode will display the maintenance page to visitors who are not signed in to the back-end area.', + 'hint' => 'Maintenance mode will display the maintenance page to visitors who are not signed in to the back-end area.' ], 'page' => [ 'not_found_name' => "The page ':name' is not found", @@ -115,7 +119,10 @@ 'delete_confirm_multiple' => 'Delete selected pages?', 'delete_confirm_single' => 'Delete this page?', 'no_layout' => '-- no layout --', - 'cms_page' => 'CMS page' + 'cms_page' => 'CMS page', + 'title' => 'Page title', + 'url' => 'Page URL', + 'file_name' => 'Page file name' ], 'layout' => [ 'not_found_name' => "The layout ':name' is not found", @@ -200,7 +207,7 @@ 'invalid_path' => 'Path can contain only digits, Latin letters, spaces and the following symbols: ._-/', 'error_deleting_file' => 'Error deleting file :name.', 'error_deleting_dir_not_empty' => 'Error deleting directory :name. The directory is not empty.', - 'error_deleting_dir' => 'Error deleting file :name.', + 'error_deleting_dir' => 'Error deleting directory :name.', 'invalid_name' => 'Name can contain only digits, Latin letters, spaces and the following symbols: ._-', 'original_not_found' => 'Original file or directory not found', 'already_exists' => 'File or directory with this name already exists', @@ -241,7 +248,8 @@ 'not_found' => 'Template not found.', 'saved' => 'Template saved.', 'no_list_records' => 'No records found', - 'delete_confirm' => 'Delete selected templates?' + 'delete_confirm' => 'Delete selected templates?', + 'order_by' => 'Order by' ], 'permissions' => [ 'name' => 'CMS', @@ -251,6 +259,7 @@ 'manage_layouts' => 'Create, modify and delete CMS layouts', 'manage_partials' => 'Create, modify and delete CMS partials', 'manage_themes' => 'Activate, deactivate and configure CMS themes', + 'manage_theme_options' => 'Configure customization options for the active theme', 'manage_media' => 'Upload and manage media contents - images, videos, sounds, documents' ], 'mediafinder' => [ @@ -276,7 +285,7 @@ 'size' => 'Size', 'title' => 'Title', 'last_modified' => 'Last modified', - 'public_url' => 'Public URL', + 'public_url' => 'URL', 'click_here' => 'Click here', 'thumbnail_error' => 'Error generating thumbnail.', 'return_to_parent' => 'Return to the parent folder', @@ -302,7 +311,7 @@ 'move_destination' => 'Destination folder', 'please_select_move_dest' => 'Please select a destination folder.', 'move_dest_src_match' => 'Please select another destination folder.', - 'empty_library' => 'The Media Library is empty. Upload files or create folders to get started.', + 'empty_library' => 'It looks a bit empty here. Upload files or create folders to get started.', 'insert' => 'Insert', 'crop_and_insert' => 'Crop & Insert', 'select_single_image' => 'Please select a single image.', @@ -318,5 +327,34 @@ 'resize_image' => 'Resize image', 'image_size' => 'Image size:', 'selected_size' => 'Selected:' - ] + ], + 'theme_log' => [ + 'hint' => 'This log displays any changes made to the theme by administrators in the back-end area.', + 'menu_label' => 'Theme log', + 'menu_description' => 'View changes made to the active theme.', + 'empty_link' => 'Empty theme log', + 'empty_loading' => 'Emptying theme log...', + 'empty_success' => 'Theme log emptied', + 'return_link' => 'Return to theme log', + 'id' => 'ID', + 'id_label' => 'Log ID', + 'created_at' => 'Date & Time', + 'user' => 'User', + 'type' => 'Type', + 'type_create' => 'Create', + 'type_update' => 'Update', + 'type_delete' => 'Delete', + 'theme_name' => 'Theme', + 'theme_code' => 'Theme code', + 'old_template' => 'Template (Old)', + 'new_template' => 'Template (New)', + 'template' => 'Template', + 'diff' => 'Changes', + 'old_value' => 'Old value', + 'new_value' => 'New value', + 'preview_title' => 'Template changes', + 'template_updated' => 'Template was updated', + 'template_created' => 'Template was created', + 'template_deleted' => 'Template was deleted', + ], ]; diff --git a/modules/cms/lang/es/lang.php b/modules/cms/lang/es/lang.php index 63551e1..82ed409 100644 --- a/modules/cms/lang/es/lang.php +++ b/modules/cms/lang/es/lang.php @@ -2,27 +2,28 @@ return [ 'cms_object' => [ - 'invalid_file' => 'Nombre inválido del archivo: :name. El nombre del archivo debe contener solamente caracteres alfanuméricos, guiones bajos, barras y puntos. Algunos ejemplos de nombres correctos son: archivo.htm, archivo, subdirectorio/archivo', - 'invalid_property' => "La propiedad ':name' no puede establecerse", - 'file_already_exists' => "Archivo ':name' ya existe.", + 'invalid_file' => 'Nombre inválido del archivo: :name. El nombre del archivo puede contener solo caracteres alfanuméricos, guiones bajos, barras y puntos. Algunos ejemplos de nombres correctos son: pagina.htm, pagina, subdirectorio/pagina', + 'invalid_property' => "La propiedad ':name' no se puede establecer", + 'file_already_exists' => "El archivo ':name' ya existe.", 'error_saving' => "Error guardando archivo ':name'. Por favor, revisa los permisos de escritura.", 'error_creating_directory' => 'Error creando el directorio :name. Por favor, revisa los permisos de escritura.', 'invalid_file_extension' => 'Extensión de archivo inválida: :invalid. Las extensiones permitidas son: :allowed.', - 'error_deleting' => 'Error borrando el archivo template ":name". Por favor, revisa los permisos de escritura.', - 'delete_success' => 'Los templates fueron borrados satisfactoriamente: :count.', - 'file_name_required' => 'Falta el nombre del campo del archivo.', - 'safe_mode_enabled' => 'Modo seguro esta actualmente activado.' + 'error_deleting' => 'Error eliminando el archivo de plantilla ":name". Por favor, revisa los permisos de escritura.', + 'delete_success' => 'Las plantillas fueron eliminadas satisfactoriamente: :count.', + 'file_name_required' => 'El campo Nombre es obligatorio.', + 'safe_mode_enabled' => 'El modo seguro está activado actualmente.' ], 'dashboard' => [ 'active_theme' => [ 'widget_title_default' => 'Sitio Web', 'online' => 'en línea', 'maintenance' => 'en mantenimiento', - 'manage_themes' => 'Gestionar plantilla' + 'manage_themes' => 'Gestionar temas', + 'customize_theme' => 'Personalizar tema' ] ], 'theme' => [ - 'not_found_name' => "El tema ':name' no se ha encontrado.", + 'not_found_name' => "El tema ':name' no se encuentra.", 'active' => [ 'not_set' => 'El tema activo no se ha establecido.', 'not_found' => 'El tema activo no se encuentra.' @@ -30,32 +31,34 @@ 'edit' => [ 'not_set' => 'El tema de edición no se ha establecido.', 'not_found' => 'El tema de edición no se encuentra.', - 'not_match' => 'El objeto que está intentando acceder no pertenece al tema que se está editando. Vuelve a cargar la página.' + 'not_match' => 'El objeto que está intentando acceder no pertenece al tema que se está editando. Porfavor recarga la página.' ], 'settings_menu' => 'Tema para el Front-end', 'settings_menu_description' => 'Previsualiza la lista de temas instalados y selecciona un tema activo.', - 'default_tab' => 'Propiedades', + 'default_tab' => 'Propiedades', 'name_label' => 'Nombre', 'name_create_placeholder' => 'Nombre del nuevo tema', 'author_label' => 'Autor', - 'author_placeholder' => 'Persona o empresa', + 'author_placeholder' => 'Nombre de la persona o empresa', 'description_label' => 'Descripción', 'description_placeholder' => 'Descripción del tema', - 'homepage_label' => 'Web', + 'homepage_label' => 'Página de inicio', 'homepage_placeholder' => 'URL de la web', 'code_label' => 'Código', 'code_placeholder' => 'Código único para el tema usado para su distribución', + 'preview_image_label' => 'Imagen de previsualización', + 'preview_image_placeholder' => 'La ruta de la imagen de previsualización del tema.', 'dir_name_label' => 'Nombre del directorio', 'dir_name_create_label' => 'El directorio de destino del tema', 'theme_label' => 'Tema', - 'theme_title' => 'Temas', + 'theme_title' => 'Temas', 'activate_button' => 'Activar', 'active_button' => 'Activar', - 'customize_theme' => 'Personalizar Tema', + 'customize_theme' => 'Personalizar Tema', 'customize_button' => 'Personalizar', 'duplicate_button' => 'Duplicar', 'duplicate_title' => 'Duplicar tema', - 'duplicate_theme_success' => 'Tema duplicado satisfactoriamente!', + 'duplicate_theme_success' => 'Tema duplicado!', 'manage_button' => 'Gestionar', 'manage_title' => 'Gestionar tema', 'edit_properties_title' => 'Tema', @@ -63,10 +66,10 @@ 'save_properties' => 'Guardar propiedades', 'import_button' => 'Importar', 'import_title' => 'Importar tema', - 'import_theme_success' => 'Tema importado satisfactoriamente!', - 'import_uploaded_file' => 'Archvio del tema', - 'import_overwrite_label' => 'Sobreescribir archvios existentes', - 'import_overwrite_comment' => 'No marques esta casilla para importar sólo los archivos nuevos', + 'import_theme_success' => 'Tema importado!', + 'import_uploaded_file' => 'Fichero de archivo de tema', + 'import_overwrite_label' => 'Sobreescribir archivos existentes', + 'import_overwrite_comment' => 'Desmarca esta casilla para importar sólo los archivos nuevos', 'import_folders_label' => 'Carpetas', 'import_folders_comment' => 'Por favor, selecciona las carpetas del tema que quieres importar', 'export_button' => 'Exportar', @@ -75,80 +78,85 @@ 'export_folders_comment' => 'Por favor, selecciona las carpetas del tema que quieres exportar', 'delete_button' => 'Eliminar', 'delete_confirm' => '¿Deseas eliminar este tema? Esta acción no se puede deshacer!', - 'delete_active_theme_failed' => 'No puedes eliminar un tema activo. Inténtalo activando otro tema primero.', - 'delete_theme_success' => 'Tema borrado satisfactoriamente!', + 'delete_active_theme_failed' => 'No puedes eliminar el tema activo, intenta activar otro tema primero.', + 'delete_theme_success' => 'Tema eliminado!', 'create_title' => 'Crear tema', 'create_button' => 'Crear', 'create_new_blank_theme' => 'Crear un tema en blanco', - 'create_theme_success' => 'Tema creado satisfactoriamente!', - 'create_theme_required_name' => 'Por favor, introduce un nombre para el tema.', + 'create_theme_success' => 'Tema creado!', + 'create_theme_required_name' => 'Por favor, especifica un nombre para el tema.', 'new_directory_name_label' => 'Directorio del tema', 'new_directory_name_comment' => 'Introduce un nombre para el directorio del tema duplicado.', 'dir_name_invalid' => 'El nombre sólo puede contener dígitos, letras latinas y los siguientes símbolos: _-', 'dir_name_taken' => 'Este directorio ya existe.', 'find_more_themes' => 'Buscar nuevos temas', - 'saving' => 'Salvando tema...', + 'saving' => 'Guardando tema...', 'return' => 'Volver a la lista de temas' ], 'maintenance' => [ - 'settings_menu' => 'Modo mantenimiento', - 'settings_menu_description' => 'Configura la página del modo mantenimiento y cambia su configuración', - 'is_enabled' => 'Activar modo mantenimiento', - 'is_enabled_comment' => 'Cuando se active, los visitantes verán la página elegida a continuación.' + 'settings_menu' => 'Modo de mantenimiento', + 'settings_menu_description' => 'Configura la página del modo de mantenimiento y cambia su configuración', + 'is_enabled' => 'Activar el modo de mantenimiento', + 'is_enabled_comment' => 'Selecciona la página para mostrar cuando el modo de mantenimiento esté activado.', + 'hint' => 'El modo de mantenimiento mostrará la página de mantenimiento a los visitantes que no estén conectados en el área de back-end.' ], 'page' => [ - 'not_found_name' => "La página ':name' no se ha encontrado", + 'not_found_name' => "La página ':name' no se encuentra", 'not_found' => [ 'label' => 'Página no encontrada', - 'help' => 'La página solicitada no se ha encontrado.' + 'help' => 'La página solicitada no se encuentra.' ], 'custom_error' => [ - 'label' => 'Error página', + 'label' => 'Error en la página', 'help' => 'Lo sentimos, pero algo salió mal y la página no se puede mostrar.' ], 'menu_label' => 'Páginas', 'unsaved_label' => 'Página(s) sin guardar', - 'no_list_records' => 'No se encontraron páginas', + 'no_list_records' => 'No se encuentran páginas', 'new' => 'Nueva página', - 'invalid_url' => 'Formato de la URL incorrecto. La URL debe empezar con el símbolo de barra diagonal y puede contener dígitos, letras latinas y los siguientes símbolos: ._-[]:?|/+*^$', + 'invalid_url' => 'Formato de URL incorrecto. La URL debe empezar con el símbolo de barra diagonal y puede contener dígitos, letras latinas y los siguientes símbolos: ._-[]:?|/+*^$', 'delete_confirm_multiple' => '¿Deseas eliminar las páginas seleccionadas?', 'delete_confirm_single' => '¿Deseas eliminar esta página?', - 'no_layout' => '-- sin plantilla --' + 'no_layout' => '-- sin diseño --', + 'cms_page' => 'Página de CMS', + 'title' => 'Título de página', + 'url' => 'URL de página', + 'file_name' => 'Nombre de archivo de página' ], 'layout' => [ 'not_found_name' => "El diseño ':name' no se encuentra", 'menu_label' => 'Diseños', 'unsaved_label' => 'Diseño(s) sin guardar', - 'no_list_records' => 'No se ecnontraron diseños', + 'no_list_records' => 'No se encuentran diseños', 'new' => 'Nuevo diseño', - 'delete_confirm_multiple' => 'Realmente quiere borrar los diseños seleccionados?', - 'delete_confirm_single' => 'Realmente quiere borrar este diseño?' + 'delete_confirm_multiple' => '¿Deseas eliminar los diseños seleccionados?', + 'delete_confirm_single' => '¿Deseas eliminar este diseño?' ], 'partial' => [ - 'not_found_name' => "El nombre parcial ':name' no se encuentra.", - 'invalid_name' => 'Nombre parcial inválido: :name.', + 'not_found_name' => "El nombre de parcial ':name' no se encuentra.", + 'invalid_name' => 'Nombre de parcial inválido: :name.', 'menu_label' => 'Parciales', 'unsaved_label' => 'Parcial(es) sin guardar', 'no_list_records' => 'No se encontraron parciales', - 'delete_confirm_multiple' => 'Realmente quiere borrar los parciales seleccionados?', - 'delete_confirm_single' => 'Realmente quiere borrar este parcial?', + 'delete_confirm_multiple' => '¿Deseas eliminar los parciales seleccionados?', + 'delete_confirm_single' => '¿Deseas eliminar este parcial?', 'new' => 'Nuevo parcial' ], 'content' => [ - 'not_found_name' => "El contenido del archivo ':name' no se encuentra.", + 'not_found_name' => "El archivo de contenido ':name' no se encuentra.", 'menu_label' => 'Contenido', 'unsaved_label' => 'Contenido sin guardar', - 'no_list_records' => 'No se encuentra el conteinod de los archivos', - 'delete_confirm_multiple' => 'Realmente desea borrar los contenidos seleccionados de los archivos o directorios?', - 'delete_confirm_single' => 'Realmente desea borrar el contenido de este archivo?', - 'new' => 'Nuevo contenido de archivo' + 'no_list_records' => 'No se encuentran archivos de contenido', + 'delete_confirm_multiple' => '¿Deseas eliminar los archivos o directorios de contenido seleccionados?', + 'delete_confirm_single' => '¿Deseas eliminar este archivo de contenido?', + 'new' => 'Nuevo archivo de contenido' ], 'ajax_handler' => [ 'invalid_name' => 'Manejador de AJAX inválido: :name.', 'not_found' => "El manejador de AJAX ':name' no se encuentra." ], 'cms' => [ - 'menu_label' => 'Gestión' + 'menu_label' => 'CMS' ], 'sidebar' => [ 'add' => 'Agregar', @@ -157,10 +165,10 @@ 'editor' => [ 'settings' => 'Configuración', 'title' => 'Título', - 'new_title' => 'Nuevo título de la página', + 'new_title' => 'Título de la nueva página', 'url' => 'URL', 'filename' => 'Nombre del archivo', - 'layout' => 'Disposición', + 'layout' => 'Diseño', 'description' => 'Descripción', 'preview' => 'Vista previa', 'meta' => 'Meta', @@ -170,19 +178,19 @@ 'code' => 'Código', 'content' => 'Contenido', 'hidden' => 'Oculto', - 'hidden_comment' => 'A las páginas ocultas sólo pueden acceder los usuarios del back-end que se encuentren logueados.', - 'enter_fullscreen' => 'Ingresar en el modo pantalla completa', + 'hidden_comment' => 'Las páginas ocultas sólo son accesibles por los usuarios que han iniciado sesión en el back-end.', + 'enter_fullscreen' => 'Abrir en pantalla completa', 'exit_fullscreen' => 'Salir de pantalla completa', - 'open_searchbox' => 'Abrir caja de busqueda', - 'close_searchbox' => 'Cerrar caja de busqueda', + 'open_searchbox' => 'Abrir caja de búsqueda', + 'close_searchbox' => 'Cerrar caja de búsqueda', 'open_replacebox' => 'Abrir caja de reemplazo', 'close_replacebox' => 'Cerrar caja de reemplazo' ], 'asset' => [ - 'menu_label' => 'Assets', - 'unsaved_label' => 'Asset(s) sin salvar', + 'menu_label' => 'Recursos', + 'unsaved_label' => 'Recurso(s) sin guardar', 'drop_down_add_title' => 'Añadir...', - 'drop_down_operation_title' => 'Acción...', + 'drop_down_operation_title' => 'Acción...', 'upload_files' => 'Subir archivo(s)', 'create_file' => 'Crear archivo', 'create_directory' => 'Crear directorio', @@ -204,52 +212,58 @@ 'already_exists' => 'Un archivo o directorio con este nombre ya existe', 'error_renaming' => 'Error renombrando el archivo o directorio', 'name_cant_be_empty' => 'El nombre no puede estar vacío', - 'too_large' => 'El archivo subido es demasiado pesado. El tamaño máximo permitido es :max_size', + 'too_large' => 'El archivo subido es demasiado grande. El tamaño máximo permitido es :max_size', 'type_not_allowed' => 'Sólo los siguientes tipos de archivos están permitidos: :allowed_types', 'file_not_valid' => 'El archivo no es válido', 'error_uploading_file' => 'Error subiendo el archivo ":name": :error', 'move_please_select' => 'por favor seleccionar', - 'move_destination' => 'Directorio destino', - 'move_popup_title' => 'Mover los títulos emergentes', + 'move_destination' => 'Directorio de destino', + 'move_popup_title' => 'Mover recursos', 'move_button' => 'Mover', 'selected_files_not_found' => 'Los archivos seleccionados no se encuentran', - 'select_destination_dir' => 'Por favor seleccione un directorio destino', - 'destination_not_found' => 'El directorio destino no se encuentra', - 'error_moving_file' => 'Error moviendo archivo :file', + 'select_destination_dir' => 'Por favor seleccione un directorio de destino', + 'destination_not_found' => 'El directorio de destino no se encuentra', + 'error_moving_file' => 'Error moviendo el archivo :file', 'error_moving_directory' => 'Error moviendo el directorio :dir', 'error_deleting_directory' => 'Error borrando el directorio original :dir', + 'no_list_records' => 'No se encontraron archivos', + 'delete_confirm' => '¿Deseas eliminar los archivos o directorios seleccionados?', 'path' => 'Ruta' ], 'component' => [ 'menu_label' => 'Componentes', 'unnamed' => 'Sin nombre', - 'no_description' => 'No se proporciona descripción', + 'no_description' => 'No se proporcionó descripción', 'alias' => 'Alias', - 'alias_description' => 'Se le ha asignado un nombre único a este componente cuando se lo utilizaba en la página o en el código de disposición.', - 'validation_message' => 'El componente alias es requerido y puede contener solamente letras, números y guión bajo. El alias debe empezar con una letra.', - 'invalid_request' => 'La plantilla no puede ser guardada porque tiene datos inválidos.', + 'alias_description' => 'Un nombre único asignado a este componente cuando se utilice en el código de la página o del diseño.', + 'validation_message' => 'El alias de componente es requerido y puede contener solamente letras, números y guión bajo. El alias debe empezar con una letra.', + 'invalid_request' => 'La plantilla no puede ser guardada porque tiene datos de componente inválidos.', 'no_records' => 'No se encontraron componentes', 'not_found' => "El componente ':name' no se encuentra.", 'method_not_found' => "El componente ':name' no contiene un método ':method'." ], 'template' => [ - 'invalid_type' => 'Tipo de plantilla Desconocido.', - 'not_found' => 'No se encontró la plantilla solicitada.', - 'saved' => 'La plantilla se ha guardado correctamente.' + 'invalid_type' => 'Tipo de plantilla desconocido.', + 'not_found' => 'No se encontró la plantilla.', + 'saved' => 'La plantilla se guardó correctamente.', + 'no_list_records' => 'No se encontraron registros', + 'delete_confirm' => '¿Deseas eliminar las plantillas seleccionadas?', + 'order_by' => 'Ordenar por' ], 'permissions' => [ 'name' => 'CMS', - 'manage_content' => 'Gestionar contenido', - 'manage_assets' => 'Gestionar archivos', - 'manage_pages' => 'Gestionar páginas', - 'manage_layouts' => 'Gestionar diseños', - 'manage_partials' => 'Gestionar parciales', - 'manage_themes' => 'Gestionar plantilla', - 'manage_media' => 'Gestionar media' + 'manage_content' => 'Gestionar archivos de contenido del sitio', + 'manage_assets' => 'Gestionar recursos del sitio - imágenes, archivos JavasCript, archivos CSS', + 'manage_pages' => 'Crear, modificar y eliminar páginas del sitio', + 'manage_layouts' => 'Crear, modificar y eliminar diseños del CMS', + 'manage_partials' => 'Crear, modificar y eliminar parciales del CMS', + 'manage_themes' => 'Activar, desactivar y configurar temas del CMS', + 'manage_media' => 'Subir y gestionar contenidos multimedia - imágenes, vídeos, sonidos y documentos' ], 'mediafinder' => [ - 'default_prompt' => 'Haga clic en el botón de %s para buscar un elemento multimedia' - ], + 'label' => 'Buscador de multimedia', + 'default_prompt' => 'Haga clic en el botón %s para buscar un elemento multimedia', + ], 'media' => [ 'invalid_path' => "Ruta de archivo especificada no válida: ':path'.", 'menu_label' => 'Media', @@ -258,10 +272,10 @@ 'delete' => 'Eliminar', 'add_folder' => 'Nueva carpeta', 'search' => 'Buscar', - 'display' => 'Mostrar', + 'display' => 'Mostrar', 'filter_everything' => 'Todo', 'filter_images' => 'Imágenes', - 'filter_video' => 'Vídeos', + 'filter_video' => 'Vídeo', 'filter_audio' => 'Audio', 'filter_documents' => 'Documentos', 'library' => 'Biblioteca', @@ -271,15 +285,15 @@ 'last_modified' => 'Última modificación', 'public_url' => 'URL pública', 'click_here' => 'Haz click aquí', - 'thumbnail_error' => 'Error generando el thumbnail.', + 'thumbnail_error' => 'Error generando la miniatura.', 'return_to_parent' => 'Volver a la carpeta anterior', 'return_to_parent_label' => 'Atrás ..', 'nothing_selected' => 'No se ha seleccionado nada.', - 'multiple_selected' => 'Se han selecciondo varios elementos.', + 'multiple_selected' => 'Se han seleccionado varios elementos.', 'uploading_file_num' => 'Subiendo :number archivo(s)...', 'uploading_complete' => 'Subida completada', - 'uploading_error' => 'Error al subir', - 'type_blocked' => 'El tipo de archivo usado a sido bloqueado por motivos de seguridad.', + 'uploading_error' => 'Error al subir', + 'type_blocked' => 'El tipo de archivo usado ha sido bloqueado por motivos de seguridad.', 'order_by' => 'Ordenar por', 'folder' => 'Carpeta', 'no_files_found' => 'No se han encontrado archivos.', @@ -295,10 +309,10 @@ 'move_destination' => 'Carpeta de destino', 'please_select_move_dest' => 'Por favor, selecciona una carpeta de destino.', 'move_dest_src_match' => 'Por favor, selecciona otra carpeta de destino.', - 'empty_library' => 'La biblioteca está vacía. Sube archivos o crea carpetas para empezar.', + 'empty_library' => 'La biblioteca de medios está vacía. Sube archivos o crea carpetas para empezar.', 'insert' => 'Insertar', - 'crop_and_insert' => 'Cortar y insertar', - 'select_single_image' => 'Por favor, seleccona sólo una imagen.', + 'crop_and_insert' => 'Cortar e insertar', + 'select_single_image' => 'Por favor, selecciona sólo una imagen.', 'selection_not_image' => 'El elemento seleccionado no es una imagen.', 'restore' => 'Deshacer todos los cambios', 'resize' => 'Redimensionar...', @@ -307,9 +321,38 @@ 'selection_mode_fixed_size' => 'Tamaño fijo', 'height' => 'Alto', 'width' => 'Ancho', - 'selection_mode' => 'Modo selección', + 'selection_mode' => 'Modo de selección', 'resize_image' => 'Redimensionar imagen', 'image_size' => 'Tamaño de la imagen:', 'selected_size' => 'Selección:' - ] + ], + 'theme_log' => [ + 'hint' => 'Este registro muestra todos los cambios hechos al tema por los administradores en el área de back-end.', + 'menu_label' => 'Registro del tema', + 'menu_description' => 'Ver cambios hechos al tema activo.', + 'empty_link' => 'Registro del tema vacío', + 'empty_loading' => 'Vaciando registro del tema...', + 'empty_success' => 'Registro del tema vaciado', + 'return_link' => 'Volver al registro del tema', + 'id' => 'ID', + 'id_label' => 'ID de registro', + 'created_at' => 'Fecha y hora', + 'user' => 'Usuario', + 'type' => 'Tipo', + 'type_create' => 'Crear', + 'type_update' => 'Modificar', + 'type_delete' => 'Eliminar', + 'theme_name' => 'Tema', + 'theme_code' => 'Código de tema', + 'old_template' => 'Plantilla (Antigua)', + 'new_template' => 'Plantilla (Nueva)', + 'template' => 'Plantilla', + 'diff' => 'Cambios', + 'old_value' => 'Valor antiguo', + 'new_value' => 'Valor nuevo', + 'preview_title' => 'Cambios de la plantilla', + 'template_updated' => 'La plantilla se modificó', + 'template_created' => 'La plantilla se creó', + 'template_deleted' => 'La plantilla se eliminó', + ], ]; diff --git a/modules/cms/lang/et/lang.php b/modules/cms/lang/et/lang.php new file mode 100644 index 0000000..0c2f88f --- /dev/null +++ b/modules/cms/lang/et/lang.php @@ -0,0 +1,360 @@ + [ + 'invalid_file' => 'Invalid file name: :name. File names can contain only alphanumeric symbols, underscores, dashes and dots. Some examples of correct file names: page.htm, page, subdirectory/page', + 'invalid_property' => "The property ':name' cannot be set", + 'file_already_exists' => "File ':name' already exists.", + 'error_saving' => "Error saving file ':name'. Please check write permissions.", + 'error_creating_directory' => 'Error creating directory :name. Please check write permissions.', + 'invalid_file_extension' => 'Invalid file extension: :invalid. Allowed extensions are: :allowed.', + 'error_deleting' => "Error deleting the template file ':name'. Please check write permissions.", + 'delete_success' => 'Templates deleted: :count.', + 'file_name_required' => 'The File Name field is required.', + 'safe_mode_enabled' => 'Safe mode is currently enabled.' + ], + 'dashboard' => [ + 'active_theme' => [ + 'widget_title_default' => 'Koduleht', + 'online' => 'Online', + 'maintenance' => 'Hooldusrežiimis', + 'manage_themes' => 'Halda teemasid', + 'customize_theme' => 'Kohanda teemat' + ] + ], + 'theme' => [ + 'not_found_name' => "Teemat ':name' ei leitud.", + 'by_author' => 'Autor: :name', + 'active' => [ + 'not_set' => 'Aktiivset teemat pole määratud.', + 'not_found' => 'Aktiivset teemat ei leitud.' + ], + 'edit' => [ + 'not_set' => 'Muutmise teemat pole määratud.', + 'not_found' => 'Muutmise teemat ei leitud.', + 'not_match' => "Objekt, mida üritad muuta ei kuulu hetkel muudetava teema alla. Palun laadi leht uuesti." + ], + 'settings_menu' => 'Kodulehe teema', + 'settings_menu_description' => 'Vaata paigaldatud teemasid ja vali endale sobiv.', + 'default_tab' => 'Seaded', + 'name_label' => 'Nimi', + 'name_create_placeholder' => 'Uus teema nimi', + 'author_label' => 'Autor', + 'author_placeholder' => 'Inimese või ettevõtte nimi', + 'description_label' => 'Kirjeldus', + 'description_placeholder' => 'Teema kirjeldus', + 'homepage_label' => 'Koduleht', + 'homepage_placeholder' => 'Kodulehe URL', + 'code_label' => 'Kood', + 'code_placeholder' => 'Unikaalne teema kood, mida kasutatakse teema levitamisel', + 'preview_image_label' => 'Eelvaate pilt', + 'preview_image_placeholder' => 'Teema eelvaate pildi asukohta.', + 'dir_name_label' => 'Kataloogi nimi', + 'dir_name_create_label' => 'Teema kataloog', + 'theme_label' => 'Teema', + 'theme_title' => 'Teemad', + 'activate_button' => 'Aktiveeri', + 'active_button' => 'Aktiveeri', + 'customize_theme' => 'Kohanda teemat', + 'customize_button' => 'Kohanda', + 'duplicate_button' => 'Kopeeri', + 'duplicate_title' => 'Kopeeri teema', + 'duplicate_theme_success' => 'Teema kopeeritud!', + 'manage_button' => 'Halda', + 'manage_title' => 'Halda teemat', + 'edit_properties_title' => 'Teema', + 'edit_properties_button' => 'Muuda seadeid', + 'save_properties' => 'Salvesta seaded', + 'import_button' => 'Impordi', + 'import_title' => 'Impordi teema', + 'import_theme_success' => 'Teema imporditud!', + 'import_uploaded_file' => 'Teema arhiivi fail', + 'import_overwrite_label' => 'Kirjuta olemasolevad failid üle', + 'import_overwrite_comment' => 'Jäta see kast märgistamata, et importida ainult uued failid', + 'import_folders_label' => 'Kataloogid', + 'import_folders_comment' => 'Palun vali teema kataloogid, mida soovid importida', + 'export_button' => 'Eksport', + 'export_title' => 'Ekspordi teema', + 'export_folders_label' => 'Kataloogid', + 'export_folders_comment' => 'Palun vali teema kataloogid, mida soovid eksportida', + 'delete_button' => 'Kustuta', + 'delete_confirm' => 'Kustuta teema? Seda tegevust ei saa tagasi võtta!', + 'delete_active_theme_failed' => 'Aktiivset teemat ei saa kustutada. Aktiveeri kõigepealt mõni teine teema.', + 'delete_theme_success' => 'Teema kustutatud!', + 'create_title' => 'Loo teema', + 'create_button' => 'Loo', + 'create_new_blank_theme' => 'Loo uus tühi teema', + 'create_theme_success' => 'Teema loodud!', + 'create_theme_required_name' => 'Palun määra teemale nimi.', + 'new_directory_name_label' => 'Teema kataloog', + 'new_directory_name_comment' => 'Sisesta kopeeritud teemale uus kataloogi nimi.', + 'dir_name_invalid' => 'Nimi võib sisaldada ainult numbreid, tähti ja järgnevaid sümboleid: _-', + 'dir_name_taken' => 'Soovitud kataloog on juba olemas.', + 'find_more_themes' => 'Otsi uusi teemasid', + 'saving' => 'Salvestan teemat...', + 'return' => 'Tagasi teemade nimekirja' + ], + 'maintenance' => [ + 'settings_menu' => 'Maintenance mode', + 'settings_menu_description' => 'Configure the maintenance mode page and toggle the setting.', + 'is_enabled' => 'Enable maintenance mode', + 'is_enabled_comment' => 'Select the page to show when maintenance mode is activated.', + 'hint' => 'Maintenance mode will display the maintenance page to visitors who are not signed in to the back-end area.' + ], + 'page' => [ + 'not_found_name' => "The page ':name' is not found", + 'not_found' => [ + 'label' => 'Page not found', + 'help' => 'The requested page cannot be found.' + ], + 'custom_error' => [ + 'label' => 'Page error', + 'help' => "We're sorry, but something went wrong and the page cannot be displayed." + ], + 'menu_label' => 'Pages', + 'unsaved_label' => 'Unsaved page(s)', + 'no_list_records' => 'No pages found', + 'new' => 'New page', + 'invalid_url' => 'Invalid URL format. The URL should start with the forward slash symbol and can contain digits, Latin letters and the following symbols: ._-[]:?|/+*^$', + 'delete_confirm_multiple' => 'Delete selected pages?', + 'delete_confirm_single' => 'Delete this page?', + 'no_layout' => '-- no layout --', + 'cms_page' => 'CMS page', + 'title' => 'Page title', + 'url' => 'Page URL', + 'file_name' => 'Page file name' + ], + 'layout' => [ + 'not_found_name' => "The layout ':name' is not found", + 'menu_label' => 'Layouts', + 'unsaved_label' => 'Unsaved layout(s)', + 'no_list_records' => 'No layouts found', + 'new' => 'New layout', + 'delete_confirm_multiple' => 'Delete selected layouts?', + 'delete_confirm_single' => 'Delete this layout?' + ], + 'partial' => [ + 'not_found_name' => "The partial ':name' is not found.", + 'invalid_name' => 'Invalid partial name: :name.', + 'menu_label' => 'Partials', + 'unsaved_label' => 'Unsaved partial(s)', + 'no_list_records' => 'No partials found', + 'delete_confirm_multiple' => 'Delete selected partials?', + 'delete_confirm_single' => 'Delete this partial?', + 'new' => 'New partial' + ], + 'content' => [ + 'not_found_name' => "The content file ':name' is not found.", + 'menu_label' => 'Content', + 'unsaved_label' => 'Unsaved content', + 'no_list_records' => 'No content files found', + 'delete_confirm_multiple' => 'Delete selected content files or directories?', + 'delete_confirm_single' => 'Delete this content file?', + 'new' => 'New content file' + ], + 'ajax_handler' => [ + 'invalid_name' => 'Invalid AJAX handler name: :name.', + 'not_found' => "AJAX handler ':name' was not found." + ], + 'cms' => [ + 'menu_label' => 'CMS' + ], + 'sidebar' => [ + 'add' => 'Add', + 'search' => 'Search...' + ], + 'editor' => [ + 'settings' => 'Settings', + 'title' => 'Title', + 'new_title' => 'New page title', + 'url' => 'URL', + 'filename' => 'File Name', + 'layout' => 'Layout', + 'description' => 'Description', + 'preview' => 'Preview', + 'meta' => 'Meta', + 'meta_title' => 'Meta Title', + 'meta_description' => 'Meta Description', + 'markup' => 'Markup', + 'code' => 'Code', + 'content' => 'Content', + 'hidden' => 'Hidden', + 'hidden_comment' => 'Hidden pages are accessible only by logged-in back-end users.', + 'enter_fullscreen' => 'Enter fullscreen mode', + 'exit_fullscreen' => 'Exit fullscreen mode', + 'open_searchbox' => 'Open Search box', + 'close_searchbox' => 'Close Search box', + 'open_replacebox' => 'Open Replace box', + 'close_replacebox' => 'Close Replace box' + ], + 'asset' => [ + 'menu_label' => 'Assets', + 'unsaved_label' => 'Unsaved asset(s)', + 'drop_down_add_title' => 'Add...', + 'drop_down_operation_title' => 'Action...', + 'upload_files' => 'Upload file(s)', + 'create_file' => 'Create file', + 'create_directory' => 'Create directory', + 'directory_popup_title' => 'New directory', + 'directory_name' => 'Directory name', + 'rename' => 'Rename', + 'delete' => 'Delete', + 'move' => 'Move', + 'select' => 'Select', + 'new' => 'New file', + 'rename_popup_title' => 'Rename', + 'rename_new_name' => 'New name', + 'invalid_path' => 'Path can contain only digits, Latin letters, spaces and the following symbols: ._-/', + 'error_deleting_file' => 'Error deleting file :name.', + 'error_deleting_dir_not_empty' => 'Error deleting directory :name. The directory is not empty.', + 'error_deleting_dir' => 'Error deleting directory :name.', + 'invalid_name' => 'Name can contain only digits, Latin letters, spaces and the following symbols: ._-', + 'original_not_found' => 'Original file or directory not found', + 'already_exists' => 'File or directory with this name already exists', + 'error_renaming' => 'Error renaming the file or directory', + 'name_cant_be_empty' => 'The name cannot be empty', + 'too_large' => 'The uploaded file is too large. The maximum allowed file size is :max_size', + 'type_not_allowed' => 'Only the following file types are allowed: :allowed_types', + 'file_not_valid' => 'File is not valid', + 'error_uploading_file' => "Error uploading file ':name': :error", + 'move_please_select' => 'please select', + 'move_destination' => 'Destination directory', + 'move_popup_title' => 'Move assets', + 'move_button' => 'Move', + 'selected_files_not_found' => 'Selected files not found', + 'select_destination_dir' => 'Please select a destination directory', + 'destination_not_found' => 'Destination directory is not found', + 'error_moving_file' => 'Error moving file :file', + 'error_moving_directory' => 'Error moving directory :dir', + 'error_deleting_directory' => 'Error deleting the original directory :dir', + 'no_list_records' => 'No files found', + 'delete_confirm' => 'Delete selected files or directories?', + 'path' => 'Path' + ], + 'component' => [ + 'menu_label' => 'Components', + 'unnamed' => 'Unnamed', + 'no_description' => 'No description provided', + 'alias' => 'Alias', + 'alias_description' => 'A unique name given to this component when using it in the page or layout code.', + 'validation_message' => 'Component aliases are required and can contain only Latin symbols, digits, and underscores. The aliases should start with a Latin symbol.', + 'invalid_request' => 'The template cannot be saved because of invalid component data.', + 'no_records' => 'No components found', + 'not_found' => "The component ':name' is not found.", + 'method_not_found' => "The component ':name' does not contain a method ':method'." + ], + 'template' => [ + 'invalid_type' => 'Unknown template type.', + 'not_found' => 'Template not found.', + 'saved' => 'Template saved.', + 'no_list_records' => 'No records found', + 'delete_confirm' => 'Delete selected templates?', + 'order_by' => 'Order by' + ], + 'permissions' => [ + 'name' => 'CMS', + 'manage_content' => 'Halda kodulehe sisufaile', + 'manage_assets' => 'Manage website assets - images, JavaScript files, CSS files', + 'manage_pages' => 'Create, modify and delete website pages', + 'manage_pages' => 'Loo, muuda ja kustuta kodulehe lehti', + 'manage_layouts' => 'Create, modify and delete CMS layouts', + 'manage_partials' => 'Create, modify and delete CMS partials', + 'manage_themes' => 'Activate, deactivate and configure CMS themes', + 'manage_media' => 'Upload and manage media contents - images, videos, sounds, documents' + ], + 'mediafinder' => [ + 'label' => 'Media Finder', + 'default_prompt' => 'Click the %s button to find a media item' + ], + 'media' => [ + 'invalid_path' => "Invalid file path specified: ':path'.", + 'menu_label' => 'Media', + 'upload' => 'Upload', + 'move' => 'Move', + 'delete' => 'Delete', + 'add_folder' => 'Add folder', + 'search' => 'Search', + 'display' => 'Display', + 'filter_everything' => 'Everything', + 'filter_images' => 'Images', + 'filter_video' => 'Video', + 'filter_audio' => 'Audio', + 'filter_documents' => 'Documents', + 'library' => 'Library', + 'folder_size_items' => 'item(s)', + 'size' => 'Size', + 'title' => 'Title', + 'last_modified' => 'Last modified', + 'public_url' => 'Download URL', + 'click_here' => 'Click here', + 'thumbnail_error' => 'Error generating thumbnail.', + 'return_to_parent' => 'Return to the parent folder', + 'return_to_parent_label' => 'Go up ..', + 'nothing_selected' => 'Nothing is selected.', + 'multiple_selected' => 'Multiple items selected.', + 'uploading_file_num' => 'Uploading :number file(s)...', + 'uploading_complete' => 'Upload complete', + 'uploading_error' => 'Upload failed', + 'type_blocked' => 'The file type used is blocked for security reasons.', + 'order_by' => 'Order by', + 'folder' => 'Folder', + 'no_files_found' => 'No files found by your request.', + 'delete_empty' => 'Please select items to delete.', + 'delete_confirm' => 'Delete the selected item(s)?', + 'error_renaming_file' => 'Error renaming the item.', + 'new_folder_title' => 'New folder', + 'folder_name' => 'Folder name', + 'error_creating_folder' => 'Error creating folder', + 'folder_or_file_exist' => 'A folder or file with the specified name already exists.', + 'move_empty' => 'Please select items to move.', + 'move_popup_title' => 'Move files or folders', + 'move_destination' => 'Destination folder', + 'please_select_move_dest' => 'Please select a destination folder.', + 'move_dest_src_match' => 'Please select another destination folder.', + 'empty_library' => 'It looks a bit empty here. Upload files or create folders to get started.', + 'insert' => 'Insert', + 'crop_and_insert' => 'Crop & Insert', + 'select_single_image' => 'Please select a single image.', + 'selection_not_image' => 'The selected item is not an image.', + 'restore' => 'Undo all changes', + 'resize' => 'Resize...', + 'selection_mode_normal' => 'Normal', + 'selection_mode_fixed_ratio' => 'Fixed ratio', + 'selection_mode_fixed_size' => 'Fixed size', + 'height' => 'Height', + 'width' => 'Width', + 'selection_mode' => 'Selection mode', + 'resize_image' => 'Resize image', + 'image_size' => 'Image size:', + 'selected_size' => 'Selected:' + ], + 'theme_log' => [ + 'hint' => 'This log displays any changes made to the theme by administrators in the back-end area.', + 'menu_label' => 'Theme log', + 'menu_description' => 'View changes made to the active theme.', + 'empty_link' => 'Empty theme log', + 'empty_loading' => 'Emptying theme log...', + 'empty_success' => 'Theme log emptied', + 'return_link' => 'Return to theme log', + 'id' => 'ID', + 'id_label' => 'Log ID', + 'created_at' => 'Date & Time', + 'user' => 'User', + 'type' => 'Type', + 'type_create' => 'Create', + 'type_update' => 'Update', + 'type_delete' => 'Delete', + 'theme_name' => 'Theme', + 'theme_code' => 'Theme code', + 'old_template' => 'Template (Old)', + 'new_template' => 'Template (New)', + 'template' => 'Template', + 'diff' => 'Changes', + 'old_value' => 'Old value', + 'new_value' => 'New value', + 'preview_title' => 'Template changes', + 'template_updated' => 'Template was updated', + 'template_created' => 'Template was created', + 'template_deleted' => 'Template was deleted', + ], +]; diff --git a/modules/cms/lang/fa/lang.php b/modules/cms/lang/fa/lang.php index ca7a35c..030d3a9 100644 --- a/modules/cms/lang/fa/lang.php +++ b/modules/cms/lang/fa/lang.php @@ -114,7 +114,8 @@ 'invalid_url' => 'قالب آدرس صحیح نمی باشد. آدرس باید با اسلش شروع شده و می تواند شامل اعداد، حروف لاتین و این کاراکتر ها باشد: ._-[]:?|/+*^$', 'delete_confirm_multiple' => 'آیا از حذف صفحات انتخاب شده اطمینان دارید؟', 'delete_confirm_single' => 'آیا از حذف این صفحه اطمینان دارید؟', - 'no_layout' => '-- بدون طرح بندی --' + 'no_layout' => '-- بدون طرح بندی --', + 'cms_page' => 'صفحات مدیریت محتوی' ], 'layout' => [ 'not_found_name' => "طرح بندی ی ':name' یافت نشد", @@ -219,6 +220,8 @@ 'error_moving_file' => 'خطایی در جابجایی :file رخ داده است', 'error_moving_directory' => 'خطایی در جابجایی :dir رخ داده است', 'error_deleting_directory' => 'خطایی در حذف :dir رخ داده است', + 'no_list_records' => 'فایلی وجود ندارد', + 'delete_confirm' => 'آیا از حذف فایل ها یا پوشه های انتخاب شده اطمینان دارید؟', 'path' => 'محل قرار گیری' ], 'component' => [ @@ -236,7 +239,9 @@ 'template' => [ 'invalid_type' => "نوع قالب معتبر نمی باشد.", 'not_found' => "قالب درخواست شده یافت نشد.", - 'saved'=> "قالب با موفقیت ذخیره شد." + 'saved'=> "قالب با موفقیت ذخیره شد.", + 'no_list_records' => 'موردی یافت نشد', + 'delete_confirm' => 'آیا از حذف قالب های انتخاب شده اطمینان دارید؟' ], 'permissions' => [ 'name' => 'مدیریت محتوی', @@ -249,6 +254,7 @@ 'manage_media' => 'مدیریت چند رسانه ها' ], 'mediafinder' => [ + 'label' => 'جستجوگر رسانه', 'default_prompt' => '%s را جهت انتخاب فایل چند رسانه ای انتخاب کنید' ], 'media' => [ diff --git a/modules/cms/lang/fr/lang.php b/modules/cms/lang/fr/lang.php index 4852799..259708c 100644 --- a/modules/cms/lang/fr/lang.php +++ b/modules/cms/lang/fr/lang.php @@ -45,6 +45,8 @@ 'homepage_placeholder' => 'Adresse URL du site Web', 'code_label' => 'Code', 'code_placeholder' => 'Un nom de code unique pour la distribution de ce thème', + 'preview_image_label' => 'Aperçu', + 'preview_image_placeholder' => 'Chemin de l’aperçu.', 'dir_name_label' => 'Nom du répertoire', 'dir_name_create_label' => 'Le répertoire de destination du thème', 'theme_label' => 'Thème', @@ -94,7 +96,8 @@ 'settings_menu' => 'Maintenance', 'settings_menu_description' => 'Configurer la page de maintenance et ajuster ses options.', 'is_enabled' => 'Activer la maintenance', - 'is_enabled_comment' => 'Si activé, la page choisie ci-dessous sera affichée pour les visiteurs du site Web.' + 'is_enabled_comment' => 'Si activé, la page choisie ci-dessous sera affichée pour les visiteurs du site Web.', + 'hint' => 'Le mode maintenance affichera la page de maintenance pour les visiteurs qui ne sont pas authentifiés dans l’interface d’administration.' ], 'page' => [ 'not_found_name' => 'La page ":name" est introuvable', @@ -113,7 +116,11 @@ 'invalid_url' => 'Format d’adresse URL invalide. L’adresse URL doit commencer par un / et peut contenir des chiffres, des lettres et les symboles suivants : ._-[]:?|/+*^$', 'delete_confirm_multiple' => 'Confirmer la suppression des pages sélectionnées ?', 'delete_confirm_single' => 'Confirmer la suppression de cette page ?', - 'no_layout' => '-- aucune maquette --' + 'no_layout' => '-- aucune maquette --', + 'cms_page' => 'Page CMS', + 'title' => 'Titre de la page', + 'url' => 'URL de la page', + 'file_name' => 'Nom du fichier de la page' ], 'layout' => [ 'not_found_name' => 'La maquette ":name" est introuvable', @@ -218,6 +225,8 @@ 'error_moving_file' => 'Erreur lors du déplacement du fichier :file', 'error_moving_directory' => 'Erreur lors du déplacement du répertoire :dir', 'error_deleting_directory' => 'Erreur lors de la suppression du répertoire d’origine :dir', + 'no_list_records' => 'Aucun fichier trouvé', + 'delete_confirm' => 'Supprimer les fichiers ou répertoires sélectionnés ?', 'path' => 'Chemin' ], 'component' => [ @@ -235,7 +244,10 @@ 'template' => [ 'invalid_type' => 'Type de modèle inconnu.', 'not_found' => 'Le modèle est introuvable.', - 'saved'=> 'Le modèle a été sauvegardé avec succès.' + 'saved'=> 'Le modèle a été sauvegardé avec succès.', + 'no_list_records' => 'Aucun enregistrement trouvé', + 'delete_confirm' => 'Supprimer les modèles sélectionnés ?', + 'order_by' =>'Trier par' ], 'permissions' => [ 'name' => 'CMS', @@ -248,6 +260,7 @@ 'manage_media' => 'Déposer et gérer les contenus media - images, vidéos, sons, documents' ], 'mediafinder' => [ + 'label' => 'Galerie média', 'default_prompt' => 'Cliquez sur le bouton %s pour trouver un élément média' ], 'media' => [ diff --git a/modules/cms/lang/hu/lang.php b/modules/cms/lang/hu/lang.php index 4a6f7d6..654bc4b 100644 --- a/modules/cms/lang/hu/lang.php +++ b/modules/cms/lang/hu/lang.php @@ -7,22 +7,24 @@ 'file_already_exists' => "Már létezik ':name' nevű fájl.", 'error_saving' => "Hiba a(z) ':name' fájl mentésekor. Ellenőrizze az írási engedélyeket.", 'error_creating_directory' => 'Hiba a(z) :name könyvtár létrehozásakor. Ellenőrizze az írási engedélyeket.', - 'invalid_file_extension'=>'Érvénytelen fájl kiterjesztés: :invalid. Az engedélyezett kiterjesztések: :allowed.', + 'invalid_file_extension' => 'Érvénytelen kiterjesztés: :invalid. Engedélyezett kiterjesztések: :allowed.', 'error_deleting' => "Hiba a(z) ':name' sablonfájl törlésekor. Ellenőrizze az írási engedélyeket.", 'delete_success' => 'A sablonok törlése sikerült: :count.', 'file_name_required' => 'A Fájlnév mező kitöltése kötelező.', - 'safe_mode_enabled' => 'A biztonságos mód jelenleg engedélyezett.' + 'safe_mode_enabled' => 'A biztonságos mód jelenleg aktív.' ], 'dashboard' => [ 'active_theme' => [ 'widget_title_default' => 'Honlap', 'online' => 'Online', 'maintenance' => 'Karbantartás alatt', - 'manage_themes' => 'Témák kezelése' + 'manage_themes' => 'Témák kezelése', + 'customize_theme' => 'Téma testreszabása' ] ], 'theme' => [ - 'not_found_name' => "A következő sablon nem található: ':name'", + 'not_found_name' => "A következő téma nem található: ':name'", + 'by_author' => 'Fejlesztő: :name', 'active' => [ 'not_set' => 'Nincs beállítva az aktív téma.', 'not_found' => 'Az aktív téma nem található.' @@ -32,8 +34,8 @@ 'not_found' => 'A szerkesztés alatt lévő téma nem található.', 'not_match' => 'Az objektum melyhez hozzáférni próbál, nem a szerkesztés alatt lévő témához tartozik. Töltse be újra a lapot.' ], - 'settings_menu' => 'Dizájn', - 'settings_menu_description' => 'A telepített témák és a választható sablonok listája.', + 'settings_menu' => 'Megjelenés', + 'settings_menu_description' => 'A telepített témák listája és azok testreszabása.', 'default_tab' => 'Tulajdonságok', 'name_label' => 'Név', 'name_create_placeholder' => 'Az új téma neve', @@ -45,6 +47,8 @@ 'homepage_placeholder' => 'A honlap webcíme', 'code_label' => 'Kód', 'code_placeholder' => 'Egyedi azonosító ehhez a témához', + 'preview_image_label' => 'Előnézet', + 'preview_image_placeholder' => 'A téma előnézet képének elérési útvonala.', 'dir_name_label' => 'Könyvtár', 'dir_name_create_label' => 'A célkönyvtár', 'theme_label' => 'Téma', @@ -115,7 +119,10 @@ 'delete_confirm_multiple' => 'Valóban törölni akarja a kijelölt lapokat?', 'delete_confirm_single' => 'Valóban törölni akarja ezt a lapot?', 'no_layout' => '-- nincs --', - 'cms_page' => 'Lapok' + 'cms_page' => 'Lapok', + 'title' => 'Elnevezés szerint', + 'url' => 'Webcím szerint', + 'file_name' => 'Fájlnév szerint' ], 'layout' => [ 'not_found_name' => "A(z) ':name' elrendezés nem található", @@ -241,7 +248,8 @@ 'not_found' => 'A kért sablon nem található.', 'saved' => 'A módosítások sikeresen mentésre kerültek.', 'no_list_records' => 'Nincs találat', - 'delete_confirm' => 'Valóban törölni akarja a témát?' + 'delete_confirm' => 'Valóban törölni akarja a témát?', + 'order_by' => 'Rendezés' ], 'permissions' => [ 'name' => 'Testreszabás', @@ -318,5 +326,34 @@ 'resize_image' => 'Kép átméretezése', 'image_size' => 'Kép mérete:', 'selected_size' => 'Kiválasztva:' + ], + 'theme_log' => [ + 'hint' => 'Az adminisztrátorok által elvégzett módosítások az aktív téma fájlaiban, amiket az admin felületen keresztül hajtottak végre.', + 'menu_label' => 'Téma napló', + 'menu_description' => 'Változtatások listája az aktív témánál.', + 'empty_link' => 'Kiürítés', + 'empty_loading' => 'A kiürítés folyamatban...', + 'empty_success' => 'A téma napló kiürítése megtörtént.', + 'return_link' => 'Vissza a téma naplóhoz', + 'id' => 'ID', + 'id_label' => 'Napló ID', + 'created_at' => 'Dátum', + 'user' => 'Felhasználó', + 'type' => 'Művelet', + 'type_create' => 'Létrehozás', + 'type_update' => 'Módosítás', + 'type_delete' => 'Törlés', + 'theme_name' => 'Téma', + 'theme_code' => 'Kódnév', + 'old_template' => 'Fájl (régi)', + 'new_template' => 'Fájl (új)', + 'template' => 'Fájl', + 'diff' => 'Változtatások', + 'old_value' => 'Régi tartalom', + 'new_value' => 'Új tartalom', + 'preview_title' => 'Változtatások', + 'template_updated' => 'A fájl frissítve lett.', + 'template_created' => 'A fájl létre lett hozva.', + 'template_deleted' => 'A fájl törölve lett.', ] ]; diff --git a/modules/cms/lang/lt/lang.php b/modules/cms/lang/lt/lang.php new file mode 100644 index 0000000..9cdaed9 --- /dev/null +++ b/modules/cms/lang/lt/lang.php @@ -0,0 +1,328 @@ + [ + 'invalid_file' => 'Netinkamas failo pavadinimas: :name. Failo pavadinimą gali sudaryti tik skaičiai, raidės, brūkšneliai bei taškai. Keletas pavyzdžių: puslapis.htm, puslapis, direktorija/puslapis, puslapis_2, naujas-puslapis', + 'invalid_property' => "Savybės ':name' negalima nustatyti", + 'file_already_exists' => "Failas pavadinimu ':name' jau yra.", + 'error_saving' => "Klaida išsaugant failą ':name'. Patikrinkite katalogo įrašymo nustatymus serveryje.", + 'error_creating_directory' => 'Nepavyko sukurti direktorijos :name. Patikrinkite katalogo įrašymo nustatymus serveryje.', + 'invalid_file_extension' => 'Netinkama failo galūnė: :invalid. Leistinos galūnės yra: :allowed.', + 'error_deleting' => "Nepavyko ištrinti šablono ':name'. Patikrinkite katalogo įrašymo nustatymus serveryje.", + 'delete_success' => 'Ištrinta šablonų: :count.', + 'file_name_required' => 'Failko pavadinimo laukelis yra būtinas.', + 'safe_mode_enabled' => 'Saugusis režimas šiuo metu įjungtas.' + ], + 'dashboard' => [ + 'active_theme' => [ + 'widget_title_default' => 'Tinklalapis', + 'online' => 'Įjungtas', + 'maintenance' => 'Aptarnavimo režime', + 'manage_themes' => 'Tvarkyti dizainus' + ] + ], + 'theme' => [ + 'not_found_name' => "Dizainas ':name' nerastas.", + 'active' => [ + 'not_set' => 'Aktyvusis dizainas yra nenustatytas.', + 'not_found' => 'Aktyvusis dizainas nerastas.' + ], + 'edit' => [ + 'not_set' => 'Redaguojamas dizainas nenustatytas.', + 'not_found' => 'Redaguojamas dizainas nerastas.', + 'not_match' => "Objektas, kurį bandote prieiti nepriklauso redaguojamam dizainui. Perkraukite puslapį." + ], + 'settings_menu' => 'Svetainės dizainas', + 'settings_menu_description' => 'Peržiūrėkite įdiegtų dizainų sąrašą ir pasirinkite aktyvųjį dizainą.', + 'default_tab' => 'Savybės', + 'name_label' => 'Pavadinimas', + 'name_create_placeholder' => 'Naujo dizaino pavadinimas', + 'author_label' => 'Autorius', + 'author_placeholder' => 'Asmuo arba įmonė', + 'description_label' => 'Aprašymas', + 'description_placeholder' => 'Dizaino aprašymas', + 'homepage_label' => 'Tinklalapis', + 'homepage_placeholder' => 'Svetainės URL', + 'code_label' => 'Kodas', + 'code_placeholder' => 'Unikalus dizaino kodas naudojamas platinant', + 'preview_image_label' => 'Demo paveiksliukas', + 'preview_image_placeholder' => 'Kelias į demo paveiksliuką.', + 'dir_name_label' => 'Direktorijos pavadinimas', + 'dir_name_create_label' => 'Kelias į dizaino direktoriją', + 'theme_label' => 'Dizainas', + 'theme_title' => 'Dizainai', + 'activate_button' => 'Aktyvuoti', + 'active_button' => 'Aktyvuoti', + 'customize_theme' => 'Modifikuoti Dizainą', + 'customize_button' => 'Modifikuoti', + 'duplicate_button' => 'Duplikuoti', + 'duplicate_title' => 'Duplikuoti dizainą', + 'duplicate_theme_success' => 'Dizainą duplikavome!', + 'manage_button' => 'Tvarkyti', + 'manage_title' => 'Tvarkyti dizainą', + 'edit_properties_title' => 'Dizainas', + 'edit_properties_button' => 'Redaguoti nustatymus', + 'save_properties' => 'Išsaugoti nustatymus', + 'import_button' => 'Importuoti', + 'import_title' => 'Importuoti dizainą', + 'import_theme_success' => 'Dizainą importavome!', + 'import_uploaded_file' => 'Dizaino archyvas', + 'import_overwrite_label' => 'Perrašyti esančius failus', + 'import_overwrite_comment' => 'Nuimkite varnelę jei norite įkelti tik naujus failus', + 'import_folders_label' => 'Katalogai', + 'import_folders_comment' => 'Pasirinkite katalogus, kuriuos norite importuoti', + 'export_button' => 'Eksportuoti', + 'export_title' => 'Eksportuoti dizainą', + 'export_folders_label' => 'Katalogai', + 'export_folders_comment' => 'Pasirinkite katalogus, kuriuos norite eksportuoti', + 'delete_button' => 'Trinti', + 'delete_confirm' => 'Ar tikrai norite ištrinti šį dizainą? Atstatyti nebus įmanoma!', + 'delete_active_theme_failed' => 'Negalime ištrinti aktyviojo dizaino. Priskirkite kitą dizainą kaip aktyvųjį ir bandykite dar kartą.', + 'delete_theme_success' => 'Dizainą ištrynėme!', + 'create_title' => 'Kurti dizainą', + 'create_button' => 'Kurti', + 'create_new_blank_theme' => 'Kurti naują tuščią dizainą', + 'create_theme_success' => 'Dizainas sukurtas!', + 'create_theme_required_name' => 'Nurodykite dizaino pavadinimą.', + 'new_directory_name_label' => 'Dizaino direktorija', + 'new_directory_name_comment' => 'Nurodykite naujos direktorijos pavadinimą duplikuojamam dizainui.', + 'dir_name_invalid' => 'Pavadinimą gali sudaryti tik skaičiai, Lotyniškos raidės bei simboliai: _-', + 'dir_name_taken' => 'Norimo dizaino direktorija jau egzistuoja.', + 'find_more_themes' => 'Raskite daugiau dizainų', + 'saving' => 'Išsaugome dizainą...', + 'return' => 'Grįžti į dizainų sąrašą' + ], + 'maintenance' => [ + 'settings_menu' => 'Aptarnavimo režimas', + 'settings_menu_description' => 'Konfigūruokite aptarnavimo režimo puslapį bei perjunkite režimo statusą.', + 'is_enabled' => 'Įjungti aptarnavimo režimą', + 'is_enabled_comment' => 'Parinkite kurį puslapį rodysite lankytojams aptarnavimo režimo metu.', + 'hint' => 'Aptarnavimo režimo metu lankytojams, kurie nėra prisijungę į administracinę zoną, bus rodomas Jūsų nustatytas puslapis.' + ], + 'page' => [ + 'not_found_name' => "Puslapis ':name' nerastas", + 'not_found' => [ + 'label' => 'Puslapis nerstas', + 'help' => 'Negalime rasti užklaustojo puslapio.' + ], + 'custom_error' => [ + 'label' => 'Puslapio klaida', + 'help' => "Atsiprašome, tačiau dėl galimų klaidų užklaustojo puslapio rodyti nepavyko." + ], + 'menu_label' => 'Puslapiai', + 'unsaved_label' => 'Neišsaugoti puslapiai', + 'no_list_records' => 'Puslapių nėra', + 'new' => 'Naujas puslapis', + 'invalid_url' => 'Netinkamas URL formatas. URL turėtų prasidėti simboliu / ir susidaryti iš skaitmenų, Lotyniškų raidžių bei šių simbolių: ._-[]:?|/+*^$', + 'delete_confirm_multiple' => 'Trinti pasirinktus puslapius?', + 'delete_confirm_single' => 'Trinti šį puslapį?', + 'no_layout' => '-- be šablono --', + 'cms_page' => 'CMS puslapis', + 'title' => 'Puslapio pavadinimas', + 'url' => 'Puslapio URL', + 'file_name' => 'Puslapio failo pavadinimas' + ], + 'layout' => [ + 'not_found_name' => "Šablonas ':name' nerastas", + 'menu_label' => 'Šablonai', + 'unsaved_label' => 'Neišsaugoti šablonai', + 'no_list_records' => 'Šablonų nėra', + 'new' => 'Naujas šablonas', + 'delete_confirm_multiple' => 'Trinti pasirinktus šablonus?', + 'delete_confirm_single' => 'Trinti šį šabloną?' + ], + 'partial' => [ + 'not_found_name' => "Priedėlis ':name' nerastas.", + 'invalid_name' => 'Netinkamas priedėlio pavadinimas: :name.', + 'menu_label' => 'Priedėliai', + 'unsaved_label' => 'Neišsaugoti priedėliai', + 'no_list_records' => 'Priedėlių nėra', + 'delete_confirm_multiple' => 'Trinti pasirinktus priedėlius?', + 'delete_confirm_single' => 'Trinti šį priedėlį?', + 'new' => 'Naujas priedėlis' + ], + 'content' => [ + 'not_found_name' => "Turinio failas ':name' nerastas.", + 'menu_label' => 'Turinys', + 'unsaved_label' => 'Neišsaugotas turinys', + 'no_list_records' => 'Turinio failų nėra', + 'delete_confirm_multiple' => 'Trinti pasirinktus turinio failus ar direktorijas?', + 'delete_confirm_single' => 'Trinti šį turinio failą?', + 'new' => 'Nauajs turinio failas' + ], + 'ajax_handler' => [ + 'invalid_name' => 'Netinkamas AJAX tvarkiklis pavadinimas: :name.', + 'not_found' => "AJAX tvarkiklis ':name' nerastas." + ], + 'cms' => [ + 'menu_label' => 'CMS' + ], + 'sidebar' => [ + 'add' => 'Pridėti', + 'search' => 'Ieškoti...' + ], + 'editor' => [ + 'settings' => 'Nustatymai', + 'title' => 'Pavadinimas', + 'new_title' => 'Naujas puslapio pavadinimas', + 'url' => 'URL', + 'filename' => 'Failo pavadinimas', + 'layout' => 'Šablonas', + 'description' => 'Aprašymas', + 'preview' => 'Peržiūra', + 'meta' => 'Meta', + 'meta_title' => 'Meta Pavadinimas', + 'meta_description' => 'Meta Aprašymas', + 'markup' => 'Aprašas (markup)', + 'code' => 'Kodas', + 'content' => 'Turinys', + 'hidden' => 'Paslėptas', + 'hidden_comment' => 'paslėptus puslapius gali matyti tik į administracinę zoną prisijungę nariai.', + 'enter_fullscreen' => 'Eiti į pilno ekrano vaizdą', + 'exit_fullscreen' => 'Išeiti iš pilno ekrano vaizdo', + 'open_searchbox' => 'Atidaryti paieškos laukelį', + 'close_searchbox' => 'Uždaryti paieškos laukelį', + 'open_replacebox' => 'Atidaryti pakeitimo laukelį', + 'close_replacebox' => 'Uždaryti pakeitimo laukelį' + ], + 'asset' => [ + 'menu_label' => 'Aktyvai', + 'unsaved_label' => 'Neišsaugoti aktyvai', + 'drop_down_add_title' => 'Pridėti...', + 'drop_down_operation_title' => 'Veiksmas...', + 'upload_files' => 'Įkelti failus', + 'create_file' => 'Sukurti failą', + 'create_directory' => 'Sukurti direktoriją', + 'directory_popup_title' => 'Nauja direktorija', + 'directory_name' => 'Direktorijos pavadinimas', + 'rename' => 'Pervadinti', + 'delete' => 'Ištrinti', + 'move' => 'Perkelti', + 'select' => 'Pasirinkti', + 'new' => 'Naujas failas', + 'rename_popup_title' => 'Pervadinti', + 'rename_new_name' => 'Naujas pavadinimas', + 'invalid_path' => 'Kelią gali sudaryti tik skaitmenys, Lotyniškos raidės, tarpeliai bei šie simboliai: ._-/', + 'error_deleting_file' => 'Klaida trinant failą :name.', + 'error_deleting_dir_not_empty' => 'Klaida trinant direktoriją :name. Direktorija nėra tuščia.', + 'error_deleting_dir' => 'Klaida trinant direktoriją :name.', + 'invalid_name' => 'Pavadinimą gali sudaryti tik skaitmenys, Lotyniškos raidės, tarpeliai bei šie simboliai: ._-', + 'original_not_found' => 'Nerandame pirminio failo ar direktorijos', + 'already_exists' => 'Failas ar direktorija šiuo pavadinimu jau yra', + 'error_renaming' => 'Klaida pervadinant failą ar direktoriją', + 'name_cant_be_empty' => 'Pavadinimas negali būti tuščias', + 'too_large' => 'Įkeliamas failas yra per didelis. Leistinas failo dydis yra :max_size', + 'type_not_allowed' => 'Tik šie failų tipai yra leistini: :allowed_types', + 'file_not_valid' => 'Netinkamas failas', + 'error_uploading_file' => "Klaida įkeliant failą ':name': :error", + 'move_please_select' => 'prašome pasirinkti', + 'move_destination' => 'Direktorija', + 'move_popup_title' => 'Perkelti aktyvus', + 'move_button' => 'Perkelti', + 'selected_files_not_found' => 'Neradome pasirinktų failų', + 'select_destination_dir' => 'Pasirinkite direktoriją', + 'destination_not_found' => 'Direktorijos neradome', + 'error_moving_file' => 'Klaida perkeliant failą :file', + 'error_moving_directory' => 'Klaida perkeliant direktoriją :dir', + 'error_deleting_directory' => 'Klaida trinant pirminę direktoriją :dir', + 'no_list_records' => 'Failų nėra', + 'delete_confirm' => 'Trinti pasirinktus failus ar direktorijas?', + 'path' => 'Kelias' + ], + 'component' => [ + 'menu_label' => 'Komponentai', + 'unnamed' => 'Neužvadintas', + 'no_description' => 'Nėra aprašymo', + 'alias' => 'Užvadintas', + 'alias_description' => 'Unikalus vardas skiriamas šiam komponentui kai naudojate jį puslapyje ar šablone.', + 'validation_message' => 'Komponentų užvadiniai yra būtini ir gali susidaryti tik iš Lotyniškų raidžių, skaitmenų bei _. Užvadiniai turi prasidėti Lotyniška reide.', + 'invalid_request' => 'Šablono išsaugoti nepavyko dėl netinkamų komponento savybių.', + 'no_records' => 'Komponentų nėra', + 'not_found' => "Komponento ':name' neradome.", + 'method_not_found' => "Komponente ':name' nėra metodo ':method'." + ], + 'template' => [ + 'invalid_type' => 'Nežinomas šablono tipas.', + 'not_found' => 'Šablonas nerastas.', + 'saved' => 'Šablonas išsaugotas.', + 'no_list_records' => 'Įrašų nėra', + 'delete_confirm' => 'Ištrinti pasirinktus šablonus?', + 'order_by' => 'Rūšiuoti pagal' + ], + 'permissions' => [ + 'name' => 'CMS', + 'manage_content' => 'Tvarkyti svetainės turinio failus', + 'manage_assets' => 'Tvarkyti svetainės aktyvus - paveiksliukus, JavaScript failus, CSS failus', + 'manage_pages' => 'Kurti, redaguoti ir trinti svetainės puslapius', + 'manage_layouts' => 'Kurti, redaguoti ir trinti CMS išvaizdos šablonus', + 'manage_partials' => 'Kurti, redaguoti ir trinti CMS priedėlius', + 'manage_themes' => 'Aktyvuoti, deaktyvuoti bei konfigūruoti CMS dizainus', + 'manage_media' => 'Įkelti ir tvarkyti media elementus - paveiksliukus, video, garsus, dokumentus' + ], + 'mediafinder' => [ + 'label' => 'Failų Tvarkyklė', + 'default_prompt' => 'Spauskite %s mygtuką media failų paieškai' + ], + 'media' => [ + 'invalid_path' => "Nurodytas netinkamas kelias: ':path'.", + 'menu_label' => 'Media', + 'upload' => 'Įkelti', + 'move' => 'Perkelti', + 'delete' => 'Trinti', + 'add_folder' => 'Pridėti katalogą', + 'search' => 'Ieškoti', + 'display' => 'Rodyti', + 'filter_everything' => 'Viskas', + 'filter_images' => 'Paveiksliukai', + 'filter_video' => 'Video', + 'filter_audio' => 'Audio', + 'filter_documents' => 'Dokumentai', + 'library' => 'Biblioteka', + 'folder_size_items' => 'elementai(as)', + 'size' => 'Dydis', + 'title' => 'Pavadinimas', + 'last_modified' => 'Redaguotas', + 'public_url' => 'Viešas URL', + 'click_here' => 'Spauskite čia', + 'thumbnail_error' => 'Nepavyko atvaizduoti miniatiūros.', + 'return_to_parent' => 'Grįžti į pirminį katalogą', + 'return_to_parent_label' => 'Eiti aukštyn ..', + 'nothing_selected' => 'Nieko nepasirinkote.', + 'multiple_selected' => 'Pasirinkote keletą elementų.', + 'uploading_file_num' => 'Įkeliama :number failai(as)...', + 'uploading_complete' => 'Įkėlimas įvykdytas', + 'uploading_error' => 'Įkėlimas nepavyko', + 'type_blocked' => 'Failo tipas yra blokuojamas saugumo sumetimais.', + 'order_by' => 'Rūšiuoti pagal', + 'folder' => 'Katalogas', + 'no_files_found' => 'Pagal Jūsų paiešką failų neradome.', + 'delete_empty' => 'Pasirinkite emelentus trynimui.', + 'delete_confirm' => 'Trinti pasirinktus elementus?', + 'error_renaming_file' => 'Klaida pervadinant elementą.', + 'new_folder_title' => 'Naujas katalogas', + 'folder_name' => 'Katalogo pavadinimas', + 'error_creating_folder' => 'Klaida sukuriant katalogą', + 'folder_or_file_exist' => 'Katalogas ar failas šiuo pavadinimu jau yra.', + 'move_empty' => 'Pasirinkite elementus perkėlimui.', + 'move_popup_title' => 'Perkelti failus ar katalogus', + 'move_destination' => 'Paskirties katalogas', + 'please_select_move_dest' => 'Pasirinkite paskirties katalogą.', + 'move_dest_src_match' => 'Prašome pasirinkti kitą paskirties katalogą.', + 'empty_library' => 'Media biblioteka tuščiay. Pradžiai įkelkite failus ar sukurkite katalogus.', + 'insert' => 'Įterpti', + 'crop_and_insert' => 'Apkirpti ir Įterpti', + 'select_single_image' => 'Pasirinkite vieną paveiksliuką.', + 'selection_not_image' => 'pasirinktas elementas nėra paveiksliukas.', + 'restore' => 'Atstatyti visus pakeitimus', + 'resize' => 'Keisti išmatavimus...', + 'selection_mode_normal' => 'Normalus', + 'selection_mode_fixed_ratio' => 'Fiksuotas sdantykis', + 'selection_mode_fixed_size' => 'Fiksuotas dydis', + 'height' => 'Aukštis', + 'width' => 'Plotis', + 'selection_mode' => 'Pasirinkimo būdas', + 'resize_image' => 'Keisti paveiksliuko išmatavimus', + 'image_size' => 'Paveiksliuko dydis:', + 'selected_size' => 'Pasirinkta:' + ] +]; diff --git a/modules/cms/lang/nl/lang.php b/modules/cms/lang/nl/lang.php index 91e15e4..03674f3 100644 --- a/modules/cms/lang/nl/lang.php +++ b/modules/cms/lang/nl/lang.php @@ -11,7 +11,7 @@ 'error_deleting' => 'Fout bij het verwijderen van template: ":name". Controleer de schrijfrechten.', 'delete_success' => 'Templates zijn succesvol verwijderd: :count.', 'file_name_required' => 'Het invullen van een bestandsnaam is verplicht.', - 'safe_mode_enabled' => 'Safe-modus is op dit moment ingeschakeld.', + 'safe_mode_enabled' => 'Beveiligde modus is op dit moment ingeschakeld.', ], 'dashboard' => [ 'active_theme' => [ @@ -19,10 +19,12 @@ 'online' => 'online', 'maintenance' => 'in onderhoud', 'manage_themes' => 'Beheer thema\'s', + 'customize_theme' => 'Thema aanpassen', ], ], 'theme' => [ 'not_found_name' => 'Het thema \':name\' is niet gevonden.', + 'by_author' => 'Door :name', 'active' => [ 'not_set' => 'Er is geen actief thema geselecteerd.', 'not_found' => 'Het actieve thema is niet gevonden.', @@ -45,6 +47,8 @@ 'homepage_placeholder' => 'Website URL', 'code_label' => 'Code', 'code_placeholder' => 'Een unieke code voor dit thema (wordt gebruikt voor distributie)', + 'preview_image_label' => 'Voorbeeld afbeelding', + 'preview_image_placeholder' => 'Het pad van de voorbeeld afbeelding.', 'dir_name_label' => 'Mapnaam', 'dir_name_create_label' => 'Mapnaam van het thema', 'theme_label' => 'Thema', @@ -66,7 +70,7 @@ 'import_theme_success' => 'Thema succesvol geïmporteerd!', 'import_uploaded_file' => 'Thema archiefbestand', 'import_overwrite_label' => 'Overschijf bestaande bestanden', - 'import_overwrite_comment' => 'Untick this box to only import new files', + 'import_overwrite_comment' => 'Vink uit om alleen nieuwe bestanden te importeren', 'import_folders_label' => 'Mappen', 'import_folders_comment' => 'Selecteer de mappen die je wilt importeren:', 'export_button' => 'Exporteren', @@ -115,6 +119,10 @@ 'delete_confirm_multiple' => 'Weet je zeker dat je de geselecteerde pagina\'s wilt verwijderen?', 'delete_confirm_single' => 'Weet je zeker dat je deze pagina wilt verwijderen?', 'no_layout' => '-- geen layout --', + 'cms_page' => 'CMS pagina', + 'title' => 'Paginatitel', + 'url' => 'Pagina URL', + 'file_name' => 'Pagina bestandsnaam', ], 'layout' => [ 'not_found_name' => "De layout ':name' is niet gevonden", @@ -219,6 +227,8 @@ 'error_moving_file' => 'Fout bij verplaatsen bestand :file', 'error_moving_directory' => 'Fout bij verplaatsen map :dir', 'error_deleting_directory' => 'Fout bij het verwijderen van de oorspronkelijke map :dir', + 'no_list_records' => 'Geen bestanden gevonden', + 'delete_confirm' => 'Verwijder geselecteerde bestanden of mappen?', 'path' => 'Pad', ], 'component' => [ @@ -237,6 +247,9 @@ 'invalid_type' => 'Onbekend type template.', 'not_found' => 'De opgevraagde template is niet gevonden.', 'saved' => 'De template is succesvol opgeslagen.', + 'no_list_records' => 'Geen records gevonden', + 'delete_confirm' => 'Verwijder geselecteerde templates?', + 'order_by' => 'Sorteer op', ], 'permissions' => [ 'name' => 'Cms', @@ -249,6 +262,7 @@ 'manage_media' => 'Beheer media', ], 'mediafinder' => [ + 'label' => 'Media zoeker', 'default_prompt' => 'Klik op de %s knop om een media item te vinden', ], 'media' => [ @@ -313,4 +327,33 @@ 'image_size' => 'Grootte afbeelding:', 'selected_size' => 'Geselecteerd:', ], + 'theme_log' => [ + 'hint' => 'Dit logboek laat alle wijzigingen in het thema zien die aangebracht zijn door de beheerders in de back-end omgeving.', + 'menu_label' => 'Thema logboek', + 'menu_description' => 'Toon wijzigingen op het actieve thema.', + 'empty_link' => 'Thema logboek legen', + 'empty_loading' => 'Bezig met legen van thema logboek...', + 'empty_success' => 'Thema logboek is geleegd', + 'return_link' => 'Terug naar thema logboek', + 'id' => 'ID', + 'id_label' => 'Logboek ID', + 'created_at' => 'Datum & Tijd', + 'user' => 'Gebruiker', + 'type' => 'Type', + 'type_create' => 'Aanmaken', + 'type_update' => 'Wijzigen', + 'type_delete' => 'Verwijderen', + 'theme_name' => 'Thema', + 'theme_code' => 'Thema code', + 'old_template' => 'Template (Oud)', + 'new_template' => 'Template (Nieuw)', + 'template' => 'Template', + 'diff' => 'Wijzigingen', + 'old_value' => 'Oude waarde', + 'new_value' => 'Nieuwe waarde', + 'preview_title' => 'Template wijzigingen', + 'template_updated' => 'Template was gewijzigd', + 'template_created' => 'Template was aangemaakt', + 'template_deleted' => 'Template was verwijderd', + ], ]; diff --git a/modules/cms/lang/pt-pt/lang.php b/modules/cms/lang/pt-pt/lang.php new file mode 100644 index 0000000..9bc4cbb --- /dev/null +++ b/modules/cms/lang/pt-pt/lang.php @@ -0,0 +1,358 @@ + [ + 'invalid_file' => 'Nome de ficheiro inválido: ":name". Os nomes de ficheiros podem conter apenas letras, números, sublinhados, traços e pontos. Veja alguns exemplos de nomes de ficheiros correctos: pagina.htm, pagina, subdiretoria/pagina', + 'invalid_property' => 'A propriedade ":nome" não pode ser definida', + 'file_already_exists' => 'O ficheiro ":name" já existe.', + 'error_saving' => 'Erro ao guardar ficheiro ":name". Verifique as permissões de escrita.', + 'error_creating_directory' => 'Erro ao criar a diretória :name. Verifique as permissões de escrita.', + 'invalid_file_extension'=>'Extensão de ficheiro inválida: :invalid. Extensões válidas: :allowed.', + 'error_deleting' => 'Erro ao apagar o ficheiro de modelo ":name". Verifique as permissões de escrita.', + 'delete_success' => 'Modelos excluídos com sucesso: :count.', + 'file_name_required' => 'O campo de nome do ficheiro é necessário.', + 'safe_mode_enabled' => 'Modo de segurança está activado.', + ], + 'dashboard' => [ + 'active_theme' => [ + 'widget_title_default' => 'Sitio', + 'online' => 'Online', + 'maintenance' => 'em manutenção', + 'manage_themes' => 'Gerir temas', + 'customize_theme' => 'Personalizar tema' + ] + ], + 'theme' => [ + 'not_found_name' => 'O tema ":name" não foi encontrado.', + 'active' => [ + 'not_set' => 'O tema activo não foi definido.', + 'not_found' => 'O tema activo não foi encontrado.', + ], + 'edit' => [ + 'not_set' => 'O tema de edição não foi definido.', + 'not_found' => 'O tema de edição não foi encontrado.', + 'not_match' => 'O objeto que está tentando aceder não pertence ao tema que está sendo editado. Por favor, recarregue a página.', + ], + 'settings_menu' => 'Tema de front-end', + 'settings_menu_description' => 'Veja a lista de temas instalados e selecione o tema acivo.', + 'default_tab' => 'Propriedades', + 'name_label' => 'Nome', + 'name_create_placeholder' => 'Nome do novo tema', + 'author_label' => 'Autor', + 'author_placeholder' => 'Nome do autor', + 'description_label' => 'Descrição', + 'description_placeholder' => 'Descrição do tema', + 'homepage_label' => 'Sitio', + 'homepage_placeholder' => 'URL do sitio', + 'code_label' => 'Código', + 'code_placeholder' => 'Um código exclusivo para distribuição deste tema', + 'preview_image_label' => 'Imagem de prévisualização do tema', + 'preview_image_placeholder' => 'Caminho da imagem de prévisualização do tema.', + 'dir_name_label' => 'Nome da diretória', + 'dir_name_create_label' => 'A diretória-alvo do tema', + 'theme_label' => 'Tema', + 'theme_title' => 'Temas', + 'activate_button' => 'Activar', + 'active_button' => 'Activado', + 'customize_theme' => 'Personalizar Tema', + 'customize_button' => 'Personalizar', + 'duplicate_button' => 'Duplicar', + 'duplicate_title' => 'Duplicar tema', + 'duplicate_theme_success' => 'Tema duplicado com sucesso!', + 'manage_button' => 'Gerir', + 'manage_title' => 'Gerir tema', + 'edit_properties_title' => 'Tema', + 'edit_properties_button' => 'Editar propriedades', + 'save_properties' => 'Guardar propriedades', + 'import_button' => 'Importar', + 'import_title' => 'Importar tema', + 'import_theme_success' => 'Tema importado com sucesso!', + 'import_uploaded_file' => 'Ficheiro de tema', + 'import_overwrite_label' => 'Sobrescrever ficheiros existentes', + 'import_overwrite_comment' => 'Desmarque para importar apenas ficheiros novos', + 'import_folders_label' => 'Pastas', + 'import_folders_comment' => 'Por favor selecione as pastas de temas que deseja importar', + 'export_button' => 'Exportar', + 'export_title' => 'Exportar tema', + 'export_folders_label' => 'Pastas', + 'export_folders_comment' => 'Por favor selecione as pastas de temas que deseja exportar', + 'delete_button' => 'Apagar', + 'delete_confirm' => 'Tem certeza que deseja apagar este tema? Isto não pode ser revertido!', + 'delete_active_theme_failed' => 'Não é possível apagar o tema activo, torne outro tema activo antes.', + 'delete_theme_success' => 'Tema apagado com sucesso!', + 'create_title' => 'Criar tema', + 'create_button' => 'Criar', + 'create_new_blank_theme' => 'Criar novo tema em branco', + 'create_theme_success' => 'Tema criado com sucesso!', + 'create_theme_required_name' => 'Por favor forneça um nome para o tema.', + 'new_directory_name_label' => 'Diretoria do tema', + 'new_directory_name_comment' => 'Forneça um novo nome de diretoria para o tema duplicado.', + 'dir_name_invalid' => 'O nome só pode conter letras, números, e os símbolos: _-', + 'dir_name_taken' => 'Diretoria de tema escolhido já existe.', + 'find_more_themes' => 'Encontrar mais temas.', + 'saving' => 'Guardando tema...', + 'return' => 'Regressar à lista de temas', + ], + 'maintenance' => [ + 'settings_menu' => 'Modo de manutenção', + 'settings_menu_description' => 'Configurar modo de manutenção e a página exibida.', + 'is_enabled' => 'Activar modo de manutenção', + 'is_enabled_comment' => 'Quando activado visitantes do site vão ver a página selecionada.', + 'hint' => 'Modo de manutenção mostra a página de manutenção aos visitantes que não tenham feito acesso na área de backend.' + ], + 'page' => [ + 'not_found_name' => 'A página ":name" não foi encontrada', + 'not_found' => [ + 'label' => 'Página não encontrada', + 'help' => 'A página solicitada não pode ser encontrada.', + ], + 'custom_error' => [ + 'label' => 'Erro na página', + 'help' => 'Lamentamos, mas algo deu errado, a página não pode ser exibida.', + ], + 'menu_label' => 'Páginas', + 'unsaved_label' => 'Página(s) por guardar', + 'no_list_records' => 'Nenhuma página encontrada', + 'new' => 'Nova página', + 'invalid_url' => 'Formato de URL inválido. A URL deve começar com uma barra e pode conter letras, números e os símbolos: _-[]:?|/+*^$', + 'delete_confirm_multiple' => 'Deseja excluir as páginas selecionadas?', + 'delete_confirm_single' => 'Deseja excluir esta página?', + 'no_layout' => '-- sem esboço --', + 'cms_page' => 'Página do CMS', + 'title' => 'Título da página', + 'url' => 'URL da página', + 'file_name' => 'Nome ficheiro da página' + ], + 'layout' => [ + 'not_found_name' => 'O esboço ":name" não foi encontrado', + 'menu_label' => 'Esboços', + 'unsaved_label' => 'Esboço(s) por guardar', + 'no_list_records' => 'Nenhum esboço encontrado', + 'new' => 'Novo esboço', + 'delete_confirm_multiple' => 'Deseja excluir os esboços selecionados?', + 'delete_confirm_single' => 'Deseja excluir este esboço?', + ], + 'partial' => [ + 'not_found_name' => 'O bloco ":name" não foi encontrado.', + 'invalid_name' => 'Nome de bloco inválido: :name.', + 'menu_label' => 'Blocos', + 'unsaved_label' => 'Bloco(s) por guardar', + 'no_list_records' => 'Nenhum bloco encontrado', + 'delete_confirm_multiple' => 'Deseja apagar os blocos selecionados?', + 'delete_confirm_single' => 'Deseja apagar este bloco?', + 'new' => 'Novo bloco', + ], + 'content' => [ + 'not_found_name' => 'O ficheiro de conteúdo ":name" não foi encontrado.', + 'menu_label' => 'Conteúdo', + 'unsaved_label' => 'Conteúdo por guardar', + 'no_list_records' => 'Nenhum ficheiro de conteúdo encontrado', + 'delete_confirm_multiple' => 'Deseja apagar ficheiros ou diretórios de conteúdo selecionados?', + 'delete_confirm_single' => 'Deseja apagar este ficheiro de conteúdo?', + 'new' => 'Novo ficheiro de conteúdo', + ], + 'ajax_handler' => [ + 'invalid_name' => 'O nome do manipulador AJAX é inválido: :name.', + 'not_found' => 'Manipulador AJAX ":name" não encontrado.', + ], + 'cms' => [ + 'menu_label' => 'CMS', + ], + 'sidebar' => [ + 'add' => 'Adicionar', + 'search' => 'Pesquisar...', + ], + 'editor' => [ + 'settings' => 'Configurações', + 'title' => 'Título', + 'new_title' => 'Título da nova página', + 'url' => 'URL', + 'filename' => 'Nome do ficheiro', + 'layout' => 'Esboço', + 'description' => 'Descrição', + 'preview' => 'Visualizar', + 'meta' => 'Meta', + 'meta_title' => 'Título Meta', + 'meta_description' => 'Descrição Meta', + 'markup' => 'Edição', + 'code' => 'Código', + 'content' => 'Conteúdo', + 'hidden' => 'Oculta', + 'hidden_comment' => 'Páginas ocultas são acessíveis apenas para administradores.', + 'enter_fullscreen' => 'Entrar no modo de tela cheia', + 'exit_fullscreen' => 'Sair do modo de tela cheia', + 'open_searchbox' => 'Abrir caixa de pesquisa', + 'close_searchbox' => 'Fechar caixa de pesquisa', + 'open_replacebox' => 'Abrir caixa de substituição', + 'close_replacebox' => 'Fechar caixa de substituição' + ], + 'asset' => [ + 'menu_label' => 'Ficheiros', + 'unsaved_label' => 'Ficheiro(s) por guardar', + 'drop_down_add_title' => 'Adicionar...', + 'drop_down_operation_title' => 'Acção...', + 'upload_files' => 'Enviar ficheiro(s)', + 'create_file' => 'Criar ficheiro', + 'create_directory' => 'Criar diretoria', + 'directory_popup_title' => 'Novo diretoria', + 'directory_name' => 'Nome do diretoria', + 'rename' => 'Renomear', + 'delete' => 'Apagar', + 'move' => 'Mover', + 'select' => 'Selecionar', + 'new' => 'Novo ficheiro', + 'rename_popup_title' => 'Renomear', + 'rename_new_name' => 'Novo nome', + 'invalid_path' => 'O caminho pode conter apenas letras, números, espaços e os símbolos: ._-/', + 'error_deleting_file' => 'Erro ao apagar ficheiro :name.', + 'error_deleting_dir_not_empty' => 'Erro ao apagar diretoria :name. A diretoria não está vazia.', + 'error_deleting_dir' => 'Erro ao apagar diretoria :name.', + 'invalid_name' => 'O nome pode conter apenas letras, números, espaços e os símbolos: ._-', + 'original_not_found' => 'ficheiro ou diretoria original não encontrado', + 'already_exists' => 'Um ficheiro ou diretoria com este nome já existe', + 'error_renaming' => 'Erro ao renomear o ficheiro ou diretoria', + 'name_cant_be_empty' => 'O nome não pode estar vazio', + 'too_large' => 'O ficheiro enviado é muito grande. O tamanho máximo permitido é :max_size', + 'type_not_allowed' => 'Apenas os seguintes tipos de ficheiros são permitidos: :allowed_types', + 'file_not_valid' => 'O ficheiro não é válido', + 'error_uploading_file' => 'Erro carregando ficheiro ":name": :error', + 'move_please_select' => 'por favor selecione', + 'move_destination' => 'Diretoria de destino', + 'move_popup_title' => 'Mover ficheiros', + 'move_button' => 'Mover', + 'selected_files_not_found' => 'ficheiros selecionados não encontrados', + 'select_destination_dir' => 'Por favor, selecione uma diretoria de destino', + 'destination_not_found' => 'Diretoria de destino não encontrada', + 'error_moving_file' => 'Erro ao mover ficheiro :file', + 'error_moving_directory' => 'Erro ao mover diretoria :dir', + 'error_deleting_directory' => 'Erro ao apagar o diretoria original :dir', + 'no_list_records' => 'Não foram encontrados ficheiros', + 'delete_confirm' => 'Apagar ficheiros ou directorias selecionadas?', + 'path' => 'Caminho', + ], + 'component' => [ + 'menu_label' => 'Componentes', + 'unnamed' => 'Sem nome', + 'no_description' => 'Nenhuma descrição fornecida', + 'alias' => 'Apelido', + 'alias_description' => 'Um nome exclusivo dado a este componente quando utilizado no código de uma página ou esboço.', + 'validation_message' => 'Apelidos de componentes são necessários e podem conter letras, números e sublinhados. Os apelidos devem começar com uma letra.', + 'invalid_request' => 'O modelo não pode ser guardado devido a dados inválidos nos componentes.', + 'no_records' => 'Nenhum componente encontrado', + 'not_found' => 'O componente ":name" não foi encontrado.', + 'method_not_found' => 'O componente ":name" não tem um método ":method".', + ], + 'template' => [ + 'invalid_type' => 'Tipo de modelo desconhecido.', + 'not_found' => 'O modelo solicitado não foi encontrado.', + 'saved'=> 'O modelo foi salvo com sucesso.', + 'no_list_records' => 'Não foram encontrados registos', + 'delete_confirm' => 'Apagar modelos selecionados?', + 'order_by' => 'Ordenar por' + ], + 'permissions' => [ + 'name' => 'Cms', + 'manage_content' => 'Gerir conteúdo', + 'manage_assets' => 'Gerir ficheiros', + 'manage_pages' => 'Gerir páginas', + 'manage_layouts' => 'Gerir esboços', + 'manage_partials' => 'Gerir blocos', + 'manage_themes' => 'Gerir temas', + 'manage_media' => 'Gerir conteúdo multimédia' + ], + 'mediafinder' => [ + 'label' => 'Localizador de multimédia', + 'default_prompt' => 'Clique no botão %s para localizar um ficheiro multimédia' + ], + 'media' => [ + 'invalid_path' => "Caminho especificado inválido: ':path'.", + 'menu_label' => 'Conteúdos', + 'upload' => 'Enviar', + 'move' => 'Mover', + 'delete' => 'Excluir', + 'add_folder' => 'Adicionar pasta', + 'search' => 'Procurar', + 'display' => 'Mostrar', + 'filter_everything' => 'Tudo', + 'filter_images' => 'Imagens', + 'filter_video' => 'Vídeos', + 'filter_audio' => 'Áudios', + 'filter_documents' => 'Documentos', + 'library' => 'Biblioteca', + 'folder_size_items' => 'item(s)', + 'size' => 'Tamanho', + 'title' => 'Título', + 'last_modified' => 'Última modificação', + 'public_url' => 'URL pública', + 'click_here' => 'Clique aqui', + 'thumbnail_error' => 'Erro ao gerar a miniatura.', + 'return_to_parent' => 'Retornar à diretoria anterior', + 'return_to_parent_label' => 'Acima ..', + 'nothing_selected' => 'Nenhum item selecionado.', + 'multiple_selected' => 'Múltiplos itens selecionados.', + 'uploading_file_num' => 'Enviando :number ficheiro(s)...', + 'uploading_complete' => 'Envio finalizado', + 'uploading_error' => 'Falha no envio', + 'type_blocked' => 'O tipo de ficheiro utilizado é bloqueado por motivos de segurança.', + 'order_by' => 'Ordenar por', + 'folder' => 'Pasta', + 'no_files_found' => 'Nenhum ficheiro encontrado.', + 'delete_empty' => 'Por favor, selecione itens para apagar.', + 'delete_confirm' => 'Deseja apagar o(s) ficheiro(s) selecionado(s)?', + 'error_renaming_file' => 'Erro ao renomear o ficheiro.', + 'new_folder_title' => 'Nova pasta', + 'folder_name' => 'Nome da pasta', + 'error_creating_folder' => 'Erro ao criar a pasta', + 'folder_or_file_exist' => 'Uma pasta ou ficheiro já existe com o nome especificado.', + 'move_empty' => 'Por favor, selecione os itens para mover.', + 'move_popup_title' => 'Mover ficheiros ou pastas', + 'move_destination' => 'Pasta destino', + 'please_select_move_dest' => 'Por favor, selecione a pasta de destino.', + 'move_dest_src_match' => 'Por favor, selecione outra pasta de destino.', + 'empty_library' => 'A biblioteca de multimédia, está vazia. Envie ficheiros ou crie pastas para iniciar.', + 'insert' => 'Inserir', + 'crop_and_insert' => 'Cortar & Inserir', + 'select_single_image' => 'Por favor, selecione uma única imagem.', + 'selection_not_image' => 'O ficheiro selecionado não é uma imagem.', + 'restore' => 'Desfazer todas as alterações', + 'resize' => 'Redimensionar...', + 'selection_mode_normal' => 'Normal', + 'selection_mode_fixed_ratio' => 'Proporção fixa', + 'selection_mode_fixed_size' => 'Tamanho fixo', + 'height' => 'Altura', + 'width' => 'Largura', + 'selection_mode' => 'Modo de seleção', + 'resize_image' => 'Redimensionar imagem', + 'image_size' => 'Tamanho da imagem:', + 'selected_size' => 'Selecionado:' + ], + 'theme_log' => [ + 'hint' => 'Este registo mostra as alterações efectuadas ao tema por administradores na área de backend.', + 'menu_label' => 'Registo de tema', + 'menu_description' => 'Ver alterações ao tema activo.', + 'empty_link' => 'Registo de tema vazio', + 'empty_loading' => 'Esvaziar registos de tema...', + 'empty_success' => 'Registo de temas vazio', + 'return_link' => 'Regressar ao registo de temas', + 'id' => 'ID', + 'id_label' => 'Registo ID', + 'created_at' => 'Data & Hora', + 'user' => 'Utilizador', + 'type' => 'Tipo', + 'type_create' => 'Criar', + 'type_update' => 'Alterar', + 'type_delete' => 'Apagar', + 'theme_name' => 'Tema', + 'theme_code' => 'Código de tema', + 'old_template' => 'Modelo (antigo)', + 'new_template' => 'Modelo (novo)', + 'template' => 'Modelo', + 'diff' => 'Alterações', + 'old_value' => 'Valor antigo', + 'new_value' => 'Novo valor', + 'preview_title' => 'Modelo alterado', + 'template_updated' => 'O modelo foi actualizado', + 'template_created' => 'O modelo foi criado', + 'template_deleted' => 'O modelo foi apagado', + ], +]; diff --git a/modules/cms/lang/ru/lang.php b/modules/cms/lang/ru/lang.php index 4d782f4..3c6ec3f 100644 --- a/modules/cms/lang/ru/lang.php +++ b/modules/cms/lang/ru/lang.php @@ -7,19 +7,24 @@ 'file_already_exists' => "Файл ':name' уже существует.", 'error_saving' => "Ошибка сохранения файла ':name'. Пожалуйста, проверьте права на запись.", 'error_creating_directory' => 'Ошибка создания директории :name. Пожалуйста, проверьте права на запись.', - 'invalid_file_extension'=>'Указано неправильное расширение файла: :invalid. Разрешенные расширения: :allowed.', + 'invalid_file_extension' => 'Указано неправильное расширение файла: :invalid. Разрешенные расширения: :allowed.', 'error_deleting' => "Невозможно удалить файл шаблона ':name'. Пожалуйста, проверьте права на запись.", 'delete_success' => 'Шаблоны были успешно удалены: :count.', - 'file_name_required' => 'Пожалуйста, укажите имя файла шаблона.' + 'file_name_required' => 'Пожалуйста, укажите имя файла шаблона.', + 'safe_mode_enabled' => 'В настоящий момент включен безопасный режим.' ], 'dashboard' => [ 'active_theme' => [ + 'widget_title_default' => 'Веб-сайт', 'online' => 'Онлайн', 'maintenance' => 'в разработке', - ] + 'manage_themes' => 'Управление темами', + 'customize_theme' => 'Настройка Темы' + ], ], 'theme' => [ - 'not_found_name' => "Тема ':name' не найдена.", + 'not_found_name' => "Тема ':name' не найдена.", + 'by_author' => 'By :name', 'active' => [ 'not_set' => 'Активная тема не установлена.', 'not_found' => 'Активная тема не найдена.' @@ -30,20 +35,22 @@ 'not_match' => 'Объект, который вы пытаетесь открыть, не принадлежит редактируемой теме. Пожалуйста, обновите страницу.' ], 'settings_menu' => 'Фронтенд темы', - 'settings_menu_description' => 'Просмотр списка установленных тем и выбор активной темы.', + 'settings_menu_description' => 'Управление темой интерфейса', 'default_tab' => 'Свойства', 'name_label' => 'Название', - 'name_create_placeholder' => 'Новое название темы', + 'name_create_placeholder' => 'Название новой темы', 'author_label' => 'Автор', - 'author_placeholder' => 'Человек или название компании', + 'author_placeholder' => 'Имя автора или название компании', 'description_label' => 'Описание', 'description_placeholder' => 'Описание темы', 'homepage_label' => 'Домашняя страница', 'homepage_placeholder' => 'Адрес сайта', 'code_label' => 'Уникальный код', 'code_placeholder' => 'Уникальный код темы, который используются для её распространения', - 'dir_name_create_label' => 'Директория темы', + 'preview_image_label' => 'Предварительный просмотр', + 'preview_image_placeholder' => 'Путь изображения предварительного просмотра темы.', 'dir_name_label' => 'Имя директории', + 'dir_name_create_label' => 'Директория темы', 'theme_label' => 'Тема', 'theme_title' => 'Темы', 'activate_button' => 'Активировать', @@ -89,9 +96,10 @@ ], 'maintenance' => [ 'settings_menu' => 'Режим обслуживания', - 'settings_menu_description' => 'Управление режимом обслуживания сайта.', + 'settings_menu_description' => 'Управление режимом работы сайта.', 'is_enabled' => 'Включить режим обслуживания', - 'is_enabled_comment' => 'При активации этого режима посетители сайта увидят страницу выбранную ниже.' + 'is_enabled_comment' => 'При активации этого режима посетители сайта увидят страницу выбранную ниже.', + 'hint' => 'Режим обслуживания покажет страницу обслуживания для посетителей, которые не авторизовались в CMS.' ], 'page' => [ 'not_found_name' => "Страница ':name' не найдена", @@ -110,12 +118,16 @@ 'invalid_url' => 'Неверный формат адреса. Адрес страницы должен начинаться со знака / и может содержать цифры, латинские буквы, и следующие знаки: ._-[]:?|/+*^$', 'delete_confirm_multiple' => 'Вы действительно хотите удалить выделенные страницы?', 'delete_confirm_single' => 'Вы действительно хотите удалить эту страницу?', - 'no_layout' => '-- без шаблона --' + 'no_layout' => '-- без шаблона --', + 'cms_page' => 'CMS страница', + 'title' => 'Заголовок страницы', + 'url' => 'Страница URL', + 'file_name' => 'Имя файла страницы' ], 'layout' => [ 'not_found_name' => "Не удалось найти шаблон (layout) с именем :name.", 'menu_label' => 'Шаблоны', - 'unsaved_label' => 'Несохранённый(е) макет(ы)', + 'unsaved_label' => 'Несоsхранённый(е) макет(ы)', 'no_list_records' => 'Шаблоны не найдены', 'new' => 'Новый шаблон', 'delete_confirm_multiple' => 'Вы действительно хотите удалить выделенные шаблоны?', @@ -161,15 +173,19 @@ 'description' => 'Описание', 'preview' => 'Предпросмотр', 'meta' => 'Метатеги', - 'meta_title' => 'Заголовок (meta)', - 'meta_description' => 'Описание (meta)', + 'meta_title' => 'Заголовок (meta title)', + 'meta_description' => 'Описание (meta description)', 'markup' => 'Разметка', 'code' => 'Код', 'content' => 'Содержание', 'hidden' => 'Скрытая страница', 'hidden_comment' => 'Скрытые страницы доступны только для вошедших в систему пользователей.', 'enter_fullscreen' => 'Войти в полноэкранный режим', - 'exit_fullscreen' => 'Выйти из полноэкранного режима' + 'exit_fullscreen' => 'Выйти из полноэкранного режима', + 'open_searchbox' => 'Открыть поле поиска', + 'close_searchbox' => 'Закрыть окно поиска', + 'open_replacebox' => 'Открыть поле "Заменить"', + 'close_replacebox' => 'Закрыть Заменить коробку' ], 'asset' => [ 'menu_label' => 'Ресурсы', @@ -202,7 +218,7 @@ 'file_not_valid' => 'Файл не может быть сохранен', 'error_uploading_file' => "Ошибка загрузки файла ':name': :error", 'move_please_select' => 'пожалуйста, выберите директорию', - 'move_destination' => 'Новая директория', + 'move_destination' => 'Папка назначения', 'move_popup_title' => 'Переместить файлы', 'move_button' => 'Переместить', 'selected_files_not_found' => 'Выбранные файлы не найдены', @@ -211,6 +227,8 @@ 'error_moving_file' => 'Не удалось переместить файл :file', 'error_moving_directory' => 'Не удалось переместить директорию :dir', 'error_deleting_directory' => 'Не удалось удалить директорию :dir', + 'no_list_records' => 'Файлы не найдены', + 'delete_confirm' => 'Удалить выбранные файлы или каталоги?', 'path' => 'Путь' ], 'component' => [ @@ -228,7 +246,10 @@ 'template' => [ 'invalid_type' => 'Неизвестный тип шаблона.', 'not_found' => 'Запрошенный шаблон не найден.', - 'saved'=> 'Шаблон был успешно сохранен.' + 'saved' => 'Шаблон был успешно сохранен.', + 'no_list_records' => 'Записи не найдены', + 'delete_confirm' => 'Удалить выбранные шаблоны?', + 'order_by' => 'Сортировать по' ], 'permissions' => [ 'name' => 'Управление CMS', @@ -238,10 +259,12 @@ 'manage_layouts' => 'Управление шаблонами', 'manage_partials' => 'Управление фрагментами', 'manage_themes' => 'Управление темами', + 'manage_theme_options' => 'Настроить текущую тему CMS', 'manage_media' => 'Управление медиафайлами' ], 'mediafinder' => [ - 'default_prompt' => 'Кликните на %s кнопку, чтобы найти медиафайл' + 'label' => 'Поиск медиа', + 'default_prompt' => 'Кликните на кнопку %s, чтобы найти медиафайл' ], 'media' => [ 'invalid_path' => "Указан недопустимый путь к файлу: ':path'.", @@ -272,6 +295,7 @@ 'uploading_file_num' => 'Загрузка файлов: :number', 'uploading_complete' => 'Загрузка файлов завершена!', 'uploading_error' => 'Ошибка загрузки', + 'type_blocked' => 'Используемый тип файла блокируется по соображениям безопасности.', 'order_by' => 'Сортировать по', 'folder' => 'Папка', 'no_files_found' => 'Ни один из файлов не удовлетворяет вашему запросу.', @@ -303,5 +327,34 @@ 'resize_image' => 'Изменение размера изображения', 'image_size' => 'Размер изображения:', 'selected_size' => 'Выбрано:' + ], + 'theme_log' => [ + 'hint' => 'В этом журнале отображаются изменения, внесенные в тему администраторами во внутренней области CMS.', + 'menu_label' => 'Журнал изменений тем', + 'menu_description' => 'Просмотр изменений, внесенных в активную тему.', + 'empty_link' => 'Очистить журнал', + 'empty_loading' => 'Очистка журнала...', + 'empty_success' => 'Журнал очищен', + 'return_link' => 'Вернуться к журналу', + 'id' => 'ID', + 'id_label' => 'ID записи журнала', + 'created_at' => 'Дата & Время', + 'user' => 'Пользователь', + 'type' => 'Тип', + 'type_create' => 'Создайте', + 'type_update' => 'Обновить', + 'type_delete' => 'Удалить', + 'theme_name' => 'Тема', + 'theme_code' => 'Код темы', + 'old_template' => 'Шаблон (старый)', + 'new_template' => 'Шаблон (новый)', + 'template' => 'Шаблон', + 'diff' => 'Изменения', + 'old_value' => 'Старое значение', + 'new_value' => 'Новое значение', + 'preview_title' => 'Изменение шаблона', + 'template_updated' => 'Шаблон обновлен', + 'template_created' => 'Шаблон был создан', + 'template_deleted' => 'Шаблон был удален' ] ]; diff --git a/modules/cms/lang/uk/lang.php b/modules/cms/lang/uk/lang.php new file mode 100644 index 0000000..2bea90e --- /dev/null +++ b/modules/cms/lang/uk/lang.php @@ -0,0 +1,360 @@ + [ + 'invalid_file' => 'Помилка в імені файлу: :name. Імена файлів можуть містити тільки латинські букви, цифри, знаки підкреслення і точки. Приклад правильних імен файлів: page.htm, page, subdirectory/page', + 'invalid_property' => "Параметр ':name' не можна змінити.", + 'file_already_exists' => "Файл ':name' вже існує.", + 'error_saving' => "Помилка збереження файлу ':name'. Будь ласка, перевірте права на запис.", + 'error_creating_directory' => 'Помилка створення директорії :name. Будь ласка, перевірте права на запис.', + 'invalid_file_extension' => 'Зазначено неправильне розширення файлу: :invalid. Дозволені розширення: :allowed.', + 'error_deleting' => "Неможливо видалити файл шаблону ':name'. Будь ласка, перевірте права на запис.", + 'delete_success' => 'Шаблони були успішно видалені: :count.', + 'file_name_required' => 'Будь ласка, вкажіть ім\'я файлу шаблону.', + 'safe_mode_enabled' => 'Безпечний режим в даний момент включений.' + ], + 'dashboard' => [ + 'active_theme' => [ + 'widget_title_default' => 'Веб-сайт', + 'online' => 'Онлайн', + 'maintenance' => 'В розробці', + 'manage_themes' => 'Керування темами', + 'customize_theme' => 'Налаштування теми' + ], + ], + 'theme' => [ + 'not_found_name' => "Тема ':name' не знайдена.", + 'by_author' => 'Автор :name', + 'active' => [ + 'not_set' => 'Активна тема не встановлена.', + 'not_found' => 'Активна тема не знайдена.' + ], + 'edit' => [ + 'not_set' => 'Тема для редагування не встановлена.', + 'not_found' => 'Тема для редагування не знайдена.', + 'not_match' => 'Об\'єкт, який ви намагаєтеся відкрити, не належить редагованої темі. Будь ласка, оновіть сторінку.' + ], + 'settings_menu' => 'Фронтенд теми', + 'settings_menu_description' => 'Керування інтерфейсною темою', + 'default_tab' => 'Властивості', + 'name_label' => 'Назва', + 'name_create_placeholder' => 'Назва нової теми', + 'author_label' => 'Автор', + 'author_placeholder' => 'Ім\'я автора або назва компанії', + 'description_label' => 'Опис', + 'description_placeholder' => 'Опис теми', + 'homepage_label' => 'Домашня сторінка', + 'homepage_placeholder' => 'Адреса сайту', + 'code_label' => 'Унікальний код', + 'code_placeholder' => 'Унікальний код теми, який використовуються для її поширення', + 'preview_image_label' => 'Попередній перегляд', + 'preview_image_placeholder' => 'Шлях до зображення для попереднього перегляду.', + 'dir_name_label' => 'Назва директорії', + 'dir_name_create_label' => 'Директорія теми', + 'theme_label' => 'Тема', + 'theme_title' => 'Теми', + 'activate_button' => 'Активувати', + 'active_button' => 'Активовано', + 'customize_theme' => 'Налаштування теми', + 'customize_button' => 'Налаштувати тему', + 'duplicate_button' => 'Дублювати', + 'duplicate_title' => 'Дублювати тему', + 'duplicate_theme_success' => 'Дублювання успішно завершено!', + 'manage_button' => 'Керування', + 'manage_title' => 'Керування темою', + 'edit_properties_title' => 'Тема', + 'edit_properties_button' => 'Редагування властивостей', + 'save_properties' => 'Зберегти властивості', + 'import_button' => 'Імпортувати', + 'import_title' => 'Імпортувати тему', + 'import_theme_success' => 'Імпорт теми успішно завершено!', + 'import_uploaded_file' => 'Файл архіву теми', + 'import_overwrite_label' => 'Перезаписувати існуючі файли', + 'import_overwrite_comment' => 'Вимкніть цю опцію, щоб імпортувати тільки нові файли', + 'import_folders_label' => 'Директорії', + 'import_folders_comment' => 'Будь ласка, оберіть директорії теми, які ви хотіли б імпортувати', + 'export_button' => 'Експорт', + 'export_title' => 'Експортувати тему', + 'export_folders_label' => 'Директорії', + 'export_folders_comment' => 'Будь ласка, оберіть директорії теми, які ви хотіли б експортувати', + 'delete_button' => 'Видалити', + 'delete_confirm' => 'Ви впевнені, що хочете видалити цю тему? Ця дія є незворотнім!', + 'delete_active_theme_failed' => 'Неможливо видалити активний тему, спробуйте зробити іншу тему активною.', + 'delete_theme_success' => 'Видалення теми успішно завершено!', + 'create_title' => 'Створити тему', + 'create_button' => 'Створити', + 'create_new_blank_theme' => 'Створити нову тему', + 'create_theme_success' => 'Тема була успішно створена', + 'create_theme_required_name' => 'Будь ласка, вкажіть назву для теми.', + 'new_directory_name_label' => 'Директорія теми', + 'new_directory_name_comment' => 'Вкажіть нову назву каталогу дубліката теми.', + 'dir_name_invalid' => 'Назва може містити тільки цифри, латинські літери і такі символи: _ -', + 'dir_name_taken' => 'Зазначений каталог вже існує.', + 'find_more_themes' => 'Знайти нові теми', + 'saving' => 'Збереження теми...', + 'return' => 'Повернутися до списку тем' + ], + 'maintenance' => [ + 'settings_menu' => 'Режим обслуговування', + 'settings_menu_description' => 'Керування режимом роботи сайту.', + 'is_enabled' => 'Увімкнути режим обслуговування', + 'is_enabled_comment' => 'При активації цього режиму відвідувачі сайту побачать сторінку обрану нижче.', + 'hint' => 'Режим обслуговування покаже сторінку обслуговування для відвідувачів, що не авторизувалися в CMS.' + ], + 'page' => [ + 'not_found_name' => "Сторінка ':name' не знайдена", + 'not_found' => [ + 'label' => 'Сторінка не знайдена', + 'help' => 'Запрошення сторінка не знайдена.' + ], + 'custom_error' => [ + 'label' => 'Помилка на сторінці', + 'help' => 'На жаль, сторінка не може бути відображена через помилку.' + ], + 'menu_label' => 'Сторінки', + 'unsaved_label' => 'Незбережена(і) сторінка(и)', + 'no_list_records' => 'Сторінки не знайденi', + 'new' => 'Нова сторінка', + 'invalid_url' => 'Невірний формат адреси. Адреса сторінки повинен починатися зі знака / і може містити цифри, латинські літери, і такі знаки: ._- [] :? | / + * ^ $', + 'delete_confirm_multiple' => 'Ви дійсно хочете видалити виділені сторінки?', + 'delete_confirm_single' => 'Ви дійсно хочете видалити цю сторінку?', + 'no_layout' => '-- без шаблону --', + 'cms_page' => 'CMS сторінка', + 'title' => 'Заголовок сторінки', + 'url' => 'URL сторінки', + 'file_name' => 'Файл сторінки' + ], + 'layout' => [ + 'not_found_name' => "Не вдалося знайти шаблон (layout) з ім'ям :name.", + 'menu_label' => 'Шаблони', + 'unsaved_label' => 'Незбережений(і) макет(и)', + 'no_list_records' => 'Шаблони не знайдені', + 'new' => 'Новий шаблон', + 'delete_confirm_multiple' => 'Ви дійсно хочете видалити виділені шаблони?', + 'delete_confirm_single' => 'Ви дійсно хочете видалити цей шаблон?' + ], + 'partial' => [ + 'not_found_name' => "Не вдалося знайти шаблон (partial) з ім'ям :name.", + 'invalid_name' => 'Помилка в імені шаблону (partial) :name.', + 'menu_label' => 'Фрагменти', + 'unsaved_label' => 'Незбережений(і) фрагмент(и)', + 'no_list_records' => 'Фрагменти не знайдені', + 'delete_confirm_multiple' => 'Ви дійсно хочете видалити виділені фрагменти?', + 'delete_confirm_single' => 'Ви дійсно хочете видалити цей фрагмент?', + 'new' => 'Новий фрагмент' + ], + 'content' => [ + 'not_found_name' => "Не вдалося знайти файл вмісту (content file): ':name'.", + 'menu_label' => 'Вміст', + 'unsaved_label' => 'Незбережені файли', + 'no_list_records' => 'Файли з вмістом не знайдені', + 'delete_confirm_multiple' => 'Ви дійсно хочете видалити виділені файли?', + 'delete_confirm_single' => 'Ви дійсно хочете видалити цей файл?', + 'new' => 'Новий файл вмісту' + ], + 'ajax_handler' => [ + 'invalid_name' => 'Помилка в імені обробника AJAX: :name.', + 'not_found' => "Обробник AJAX не найден: ':name'.", + ], + 'cms' => [ + 'menu_label' => 'CMS' + ], + 'sidebar' => [ + 'add' => 'Створити', + 'search' => 'Пошук...' + ], + 'editor' => [ + 'settings' => 'Налаштування', + 'title' => 'Заголовок', + 'new_title' => 'Заголовок сторінки', + 'url' => 'Адреса', + 'filename' => 'Ім\'я файлу', + 'layout' => 'Шаблон', + 'description' => 'Опис', + 'preview' => 'Переглянути', + 'meta' => 'Метатеги', + 'meta_title' => 'Заголовок (meta title)', + 'meta_description' => 'Опис (meta description)', + 'markup' => 'Шаблон', + 'code' => 'Код', + 'content' => 'Зміст', + 'hidden' => 'Прихована сторінка', + 'hidden_comment' => 'Приховані сторінки доступні тільки для авторизованих в системі користувачів.', + 'enter_fullscreen' => 'Увійти в повноекранний режим', + 'exit_fullscreen' => 'Вийти з повноекранного режиму', + 'open_searchbox' => 'Відкрити вікно пошуку', + 'close_searchbox' => 'Закрити вікно пошуку', + 'open_replacebox' => 'Відкрито вікно замінити', + 'close_replacebox' => 'Закрити вікно замінити' + ], + 'asset' => [ + 'menu_label' => 'Ресурси', + 'unsaved_label' => 'Незбережений(і) файл(и)', + 'drop_down_add_title' => 'Додати...', + 'drop_down_operation_title' => 'Дія...', + 'upload_files' => 'Завантажити файли', + 'create_file' => 'Створити файл', + 'create_directory' => 'Створити директорію', + 'directory_popup_title' => 'Нова директорія', + 'directory_name' => 'Назва директорії', + 'rename' => 'Перейменувати', + 'delete' => 'Видалити', + 'move' => 'Перемістити', + 'select' => 'Обрати', + 'new' => 'Новий файл', + 'rename_popup_title' => 'Перейменувати', + 'rename_new_name' => 'Нове ім\'я', + 'invalid_path' => 'Шлях може містити тільки цифри, латинські літери, пробіли і наступні символи: ._- /', + 'error_deleting_file' => 'Помилка видалення файлу :name.', + 'error_deleting_dir_not_empty' => 'Неможливо видалити директорію :name. Директорія містить файли або піддиректорії.', + 'error_deleting_dir' => 'Помилка видалення директорії:name.', + 'invalid_name' => 'Назва може містити тільки цифри, латинські літери, пробіли і наступні символи: ._-', + 'original_not_found' => 'Оригінальний файл або директорія не знайдено', + 'already_exists' => 'Файл або директорія з таким ім\'ям вже існує', + 'error_renaming' => 'Неможливо перейменувати файл або директорію', + 'name_cant_be_empty' => 'Назва не може бути порожньою', + 'too_large' => 'Завантажений файл занадто великий. Максимальний допустимий розмір файлу складає :max_size', + 'type_not_allowed' => 'Дозволені файли лише наступних типів: :allowed_types', + 'file_not_valid' => 'Файл не може бути збережений', + 'error_uploading_file' => "Помилка завантаження файлу ':name': :error", + 'move_please_select' => 'будь ласка, оберіть директорію', + 'move_destination' => 'Папка призначення', + 'move_popup_title' => 'Перемістити файли', + 'move_button' => 'Перемістити', + 'selected_files_not_found' => 'Вибрані файли не знайдені', + 'select_destination_dir' => 'Будь ласка, оберіть директорію', + 'destination_not_found' => 'Кінцева директорія не знайдена', + 'error_moving_file' => 'Не вдалося перемістити файл :file', + 'error_moving_directory' => 'Не вдалося перемістити директорію :dir', + 'error_deleting_directory' => 'Не вдалося видалити директорію :dir', + 'no_list_records' => 'Файли не знайдені', + 'delete_confirm' => 'Видалити обрані файли або каталоги?', + 'path' => 'Шлях' + ], + 'component' => [ + 'menu_label' => 'Компоненти', + 'unnamed' => 'Без назви', + 'no_description' => 'Без опису', + 'alias' => 'Назва компонента', + 'alias_description' => 'Назва компонента визначає його ім\'я, під яким він доступний в коді сторінки або шаблону.', + 'validation_message' => 'Псевдонім обов\'язковий і може містити тільки латинські букви, цифри і знаки підкреслення. Псевдоніми повинні починатися з літери.', + 'invalid_request' => 'Шаблон не може бути збережений, так як містить пошкоджену інформацію про компоненти.', + 'no_records' => 'Компоненти не знайдені', + 'not_found' => "Компонент ':name' не знайдено.", + 'method_not_found' => "Компонент ':name' не містить метод ':method'.", + ], + 'template' => [ + 'invalid_type' => 'Невідомий тип шаблону.', + 'not_found' => 'Запитаний шаблон не найден.', + 'saved' => 'Шаблон був успішно збережений.', + 'no_list_records' => 'Записів не знайдено', + 'delete_confirm' => 'Видалити вибрані шаблони?', + 'order_by' => 'Сортувати за' + ], + 'permissions' => [ + 'name' => 'Керування CMS', + 'manage_content' => 'Керування контентом', + 'manage_assets' => 'Керування файлами', + 'manage_pages' => 'Керування сторінками', + 'manage_layouts' => 'Керування шаблонами', + 'manage_partials' => 'Керування фрагментами', + 'manage_themes' => 'Керування темами', + 'manage_theme_options' => 'Налаштувати поточну тему CMS', + 'manage_media' => 'Керування медіафайлами' + ], + 'mediafinder' => [ + 'label' => 'Пошук медіа', + 'default_prompt' => 'Натисніть на кнопку %s, щоб знайти медіафайл' + ], + 'media' => [ + 'invalid_path' => 'Вказано неприпустимий шлях до файлу: ":path".', + 'menu_label' => 'Медіафайли', + 'upload' => 'Завантажити', + 'move' => 'Перемістити', + 'delete' => 'Видалити', + 'add_folder' => 'Створити папку', + 'search' => 'Пошук', + 'display' => 'Показати', + 'filter_everything' => 'Всі файли', + 'filter_images' => 'Зображення', + 'filter_video' => 'Відео', + 'filter_audio' => 'Музика', + 'filter_documents' => 'Документи', + 'library' => 'Бібліотека', + 'folder_size_items' => 'Об\'єктів', + 'size' => 'Розмір', + 'title' => 'Ім\'я', + 'last_modified' => 'Остання зміна', + 'public_url' => 'Публічна адреса', + 'click_here' => 'Натисніть тут', + 'thumbnail_error' => 'Помилка створення мініатюри.', + 'return_to_parent' => 'Повернутися до батьківської папки', + 'return_to_parent_label' => 'Піднятися на рівень вище...', + 'nothing_selected' => 'Нічого не обрано.', + 'multiple_selected' => 'Обрано кілька об\'єктів.', + 'uploading_file_num' => 'Завантаження файлів: :number', + 'uploading_complete' => 'Завантаження файлів завершено!', + 'uploading_error' => 'Помилка завантаження', + 'type_blocked' => 'Тип файлу, який використовується заблокований з міркувань безпеки.', + 'order_by' => 'Сортувати за', + 'folder' => 'Папка', + 'no_files_found' => 'Жоден з файлів не задовольняє вашому запиту.', + 'delete_empty' => 'Будь ласка, оберіть об\'єкти для видалення.', + 'delete_confirm' => 'Ви дійсно хочете видалити вибрані об\'єкти?', + 'error_renaming_file' => 'Помилка зміни імені файлу.', + 'new_folder_title' => 'Нова папка', + 'folder_name' => 'Назва папки', + 'error_creating_folder' => 'Помилка створення папки', + 'folder_or_file_exist' => 'Папка або файл з таким ім\'ям вже існує.', + 'move_empty' => 'Будь ласка, оберіть об\'єкти для переміщення.', + 'move_popup_title' => 'Переміщення файлів або папок', + 'move_destination' => 'Папка призначення', + 'please_select_move_dest' => 'Будь ласка, оберіть папку призначення для переміщення.', + 'move_dest_src_match' => 'Будь ласка, оберіть іншу папку.', + 'empty_library' => 'Бібліотека медіафайлів порожня. Для початку завантажте файли або створіть папки.', + 'insert' => 'Вставити', + 'crop_and_insert' => 'Обрізати і вставити', + 'select_single_image' => 'Будь ласка, оберіть одне зображення.', + 'selection_not_image' => 'Обраний елемент не є зображенням.', + 'restore' => 'Скасувати всі зміни', + 'resize' => 'Зміна розміру...', + 'selection_mode_normal' => 'Нормальний', + 'selection_mode_fixed_ratio' => 'Фіксоване співвідношення', + 'selection_mode_fixed_size' => 'Фіксований розмір', + 'height' => 'Висота', + 'width' => 'Ширина', + 'selection_mode' => 'Режим виділення', + 'resize_image' => 'Зміна розміру зображення', + 'image_size' => 'Розмір зображення:', + 'selected_size' => 'Обрано:' + ], + 'theme_log' => [ + 'hint' => 'Цей журнал відображає будь-які зміни, внесені до теми адміністраторами в задній частині області CMS.', + 'menu_label' => 'Журнал змін тем', + 'menu_description' => 'Переглянути зміни, внесені до активної теми.', + 'empty_link' => 'Очистити журнал', + 'empty_loading' => 'Очищення журналу...', + 'empty_success' => 'Журнал очищено', + 'return_link' => 'Повернутися до журналу', + 'id' => 'ID', + 'id_label' => 'ID запису журналу', + 'created_at' => 'Дата, час', + 'user' => 'Користувач', + 'type' => 'Тип', + 'type_create' => 'Створити', + 'type_update' => 'Оновити', + 'type_delete' => 'Видалити', + 'theme_name' => 'Тема', + 'theme_code' => 'Код теми', + 'old_template' => 'Шаблон (старий)', + 'new_template' => 'Шаблон (новий)', + 'template' => 'Шаблон', + 'diff' => 'Зміни', + 'old_value' => 'Старе значення', + 'new_value' => 'Нове значення', + 'preview_title' => 'Зміни в шаблоні', + 'template_updated' => 'Шаблон було оновлено', + 'template_created' => 'Шаблон був створений', + 'template_deleted' => 'Шаблон був видалений' + ] +]; diff --git a/modules/cms/lang/zh-tw/lang.php b/modules/cms/lang/zh-tw/lang.php index 47cfeda..e59cb2e 100644 --- a/modules/cms/lang/zh-tw/lang.php +++ b/modules/cms/lang/zh-tw/lang.php @@ -299,4 +299,4 @@ 'image_size' => '圖片大小:', 'selected_size' => '選中:' ] -]; \ No newline at end of file +]; diff --git a/modules/cms/models/MaintenanceSetting.php b/modules/cms/models/MaintenanceSetting.php index 396ca02..4530b5f 100644 --- a/modules/cms/models/MaintenanceSetting.php +++ b/modules/cms/models/MaintenanceSetting.php @@ -15,10 +15,21 @@ class MaintenanceSetting extends Model { use \October\Rain\Database\Traits\Validation; - public $implement = ['System.Behaviors.SettingsModel']; + /** + * @var array Behaviors implemented by this model. + */ + public $implement = [ + \System\Behaviors\SettingsModel::class + ]; + /** + * @var string Unique code + */ public $settingsCode = 'cms_maintenance_settings'; + /** + * @var mixed Settings form field defitions + */ public $settingsFields = 'fields.yaml'; /** @@ -26,6 +37,11 @@ class MaintenanceSetting extends Model */ public $rules = []; + /** + * Initialize the seed data for this model. This only executes when the + * model is first created or reset to default. + * @return void + */ public function initSettingsData() { $this->is_enabled = false; @@ -33,8 +49,9 @@ public function initSettingsData() public function getCmsPageOptions() { - if (!$theme = Theme::getEditTheme()) + if (!$theme = Theme::getEditTheme()) { throw new ApplicationException('Unable to find the active theme.'); + } return Page::listInTheme($theme)->lists('fileName', 'fileName'); } @@ -45,8 +62,9 @@ public function getCmsPageOptions() */ public function beforeValidate() { - if (!$theme = Theme::getEditTheme()) + if (!$theme = Theme::getEditTheme()) { throw new ApplicationException('Unable to find the active theme.'); + } $themeMap = $this->getSettingsValue('theme_map', []); $themeMap[$theme->getDirName()] = $this->getSettingsValue('cms_page'); diff --git a/modules/cms/models/ThemeData.php b/modules/cms/models/ThemeData.php index dde92f7..1dd99f8 100644 --- a/modules/cms/models/ThemeData.php +++ b/modules/cms/models/ThemeData.php @@ -154,7 +154,7 @@ public function getDefaultValues() $result = []; foreach ($this->getFormFields() as $attribute => $field) { - if (!$value = array_get($field, 'default')) { + if (($value = array_get($field, 'default')) === null) { continue; } diff --git a/modules/cms/models/ThemeExport.php b/modules/cms/models/ThemeExport.php index bd6fa5c..f128ffb 100644 --- a/modules/cms/models/ThemeExport.php +++ b/modules/cms/models/ThemeExport.php @@ -138,4 +138,4 @@ public static function download($name, $outputName = null) return $result; } -} \ No newline at end of file +} diff --git a/modules/cms/models/ThemeImport.php b/modules/cms/models/ThemeImport.php index 59e78fe..0d7a9bd 100644 --- a/modules/cms/models/ThemeImport.php +++ b/modules/cms/models/ThemeImport.php @@ -40,7 +40,7 @@ class ThemeImport extends Model protected $fillable = []; public $attachOne = [ - 'uploaded_file' => ['System\Models\File'] + 'uploaded_file' => \System\Models\File::class ]; /** @@ -181,4 +181,4 @@ protected function copyDirectory($directory, $destination) return true; } -} \ No newline at end of file +} diff --git a/modules/cms/models/ThemeLog.php b/modules/cms/models/ThemeLog.php new file mode 100644 index 0000000..0e7a7c7 --- /dev/null +++ b/modules/cms/models/ThemeLog.php @@ -0,0 +1,133 @@ + \Backend\Models\User::class + ]; + + protected $themeCache; + + /** + * Adds observers to the model for logging purposes. + */ + public static function bindEventsToModel(HalcyonModel $template) + { + $template->bindEvent('model.beforeDelete', function () use ($template) { + self::add($template, self::TYPE_DELETE); + }); + + $template->bindEvent('model.beforeSave', function () use ($template) { + self::add($template, $template->exists ? self::TYPE_UPDATE : self::TYPE_CREATE); + }); + } + + /** + * Creates a log record + * @return self + */ + public static function add(HalcyonModel $template, $type = null) + { + if (!App::hasDatabase()) { + return; + } + + if (!LogSetting::get('log_theme')) { + return; + } + + if (!$type) { + $type = self::TYPE_UPDATE; + } + + $isDelete = $type === self::TYPE_DELETE; + $dirName = $template->getObjectTypeDirName(); + $templateName = $template->fileName; + $oldTemplateName = $template->getOriginal('fileName'); + $newContent = $template->toCompiled(); + $oldContent = $template->getOriginal('content'); + + if ($newContent === $oldContent && !$isDelete) { + traceLog($newContent, $oldContent); + traceLog('Content not dirty for: '. $template->getObjectTypeDirName().'/'.$template->fileName); + return; + } + + $record = new self; + $record->type = $type; + $record->theme = Theme::getEditThemeCode(); + $record->template = $isDelete ? '' : $dirName.'/'.$templateName; + $record->old_template = $oldTemplateName ? $dirName.'/'.$oldTemplateName : ''; + $record->content = $isDelete ? '' : $newContent; + $record->old_content = $oldContent; + + if ($user = BackendAuth::getUser()) { + $record->user_id = $user->id; + } + + try { + $record->save(); + } + catch (Exception $ex) {} + + return $record; + } + + public function getThemeNameAttribute() + { + $code = $this->theme; + + if (!isset($this->themeCache[$code])) { + $this->themeCache[$code] = Theme::load($code); + } + + $theme = $this->themeCache[$code]; + + return $theme->getConfigValue('name', $theme->getDirName()); + } + + public function getTypeOptions() + { + return [ + self::TYPE_CREATE => 'cms::lang.theme_log.type_create', + self::TYPE_UPDATE => 'cms::lang.theme_log.type_update', + self::TYPE_DELETE => 'cms::lang.theme_log.type_delete' + ]; + } + + public function getAnyTemplateAttribute() + { + return $this->template ?: $this->old_template; + } + + public function getTypeNameAttribute() + { + return array_get($this->getTypeOptions(), $this->type); + } +} diff --git a/modules/cms/models/themelog/columns.yaml b/modules/cms/models/themelog/columns.yaml new file mode 100644 index 0000000..966b5a0 --- /dev/null +++ b/modules/cms/models/themelog/columns.yaml @@ -0,0 +1,47 @@ +# =================================== +# Column Definitions +# =================================== + +columns: + id: + label: cms::lang.theme_log.id + searchable: yes + invisible: true + width: 75px + + created_at: + label: cms::lang.theme_log.created_at + searchable: yes + width: 160px + type: timetense + + type: + label: cms::lang.theme_log.type + invisible: true + + any_template: + label: cms::lang.theme_log.template + + template: + label: cms::lang.theme_log.new_template + searchable: true + invisible: true + + old_template: + label: cms::lang.theme_log.old_template + searchable: true + invisible: true + + user: + label: cms::lang.theme_log.user + relation: user + select: concat(first_name, ' ', last_name) + + theme_name: + label: cms::lang.theme_log.theme_name + sortable: false + + theme: + label: cms::lang.theme_log.theme_code + searchable: true + invisible: true diff --git a/modules/cms/models/themelog/fields.yaml b/modules/cms/models/themelog/fields.yaml new file mode 100644 index 0000000..54c840b --- /dev/null +++ b/modules/cms/models/themelog/fields.yaml @@ -0,0 +1,36 @@ +# =================================== +# Field Definitions +# =================================== + +tabs: + fields: + + diff_template: + tab: cms::lang.theme_log.diff + type: partial + path: field_diff_template + + diff_content: + tab: cms::lang.theme_log.diff + type: partial + path: field_diff_content + + template: + tab: cms::lang.theme_log.new_value + type: partial + path: field_template + + content: + tab: cms::lang.theme_log.new_value + type: partial + path: field_content + + old_template: + tab: cms::lang.theme_log.old_value + type: partial + path: field_template + + old_content: + tab: cms::lang.theme_log.old_value + type: partial + path: field_content diff --git a/modules/cms/reportwidgets/ActiveTheme.php b/modules/cms/reportwidgets/ActiveTheme.php index 9b908d4..eba4d64 100644 --- a/modules/cms/reportwidgets/ActiveTheme.php +++ b/modules/cms/reportwidgets/ActiveTheme.php @@ -49,7 +49,7 @@ public function defineProperties() } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { diff --git a/modules/cms/reportwidgets/activetheme/partials/_widget.htm b/modules/cms/reportwidgets/activetheme/partials/_widget.htm index 39c7503..ca48aa5 100644 --- a/modules/cms/reportwidgets/activetheme/partials/_widget.htm +++ b/modules/cms/reportwidgets/activetheme/partials/_widget.htm @@ -22,13 +22,14 @@

    property('title'))) ?>

  • - + + +
  • hasCustomData()): ?>
  • - - Customize theme + +
  • diff --git a/modules/cms/routes.php b/modules/cms/routes.php index b17cd16..9826a6d 100644 --- a/modules/cms/routes.php +++ b/modules/cms/routes.php @@ -13,7 +13,7 @@ * The CMS module intercepts all URLs that were not * handled by the back-end modules. */ - Route::any('{slug}', 'Cms\Classes\CmsController@run')->where('slug', '(.*)?'); + Route::any('{slug}', 'Cms\Classes\CmsController@run')->where('slug', '(.*)?')->middleware('web'); /* * Extensibility diff --git a/modules/cms/traits/UrlMaker.php b/modules/cms/traits/UrlMaker.php new file mode 100644 index 0000000..50fc3a2 --- /dev/null +++ b/modules/cms/traits/UrlMaker.php @@ -0,0 +1,209 @@ +url` magically + * linking to the component that declares `isPrimary = 1` in configuration. + * + * [blogPost] + * isPrimary = "1" + * + * The parameters passed to the component are supplied when overriding the + * method `getUrlParams` also within the model. + * + * public function getUrlParams() + * { + * return [ + * 'id' => $this->id, + * 'hash' => $this->hash, + * ]; + * } + * + * @package october\cms + * @author Alexey Bobkov, Samuel Georges + */ +trait UrlMaker +{ + // + // Properties to declare + // + + /** + * @var string The component to use for generating URLs. + */ + // protected $urlComponentName = 'testArchive'; + + /** + * @var string The property name to determine a primary component. + */ + // protected $urlComponentProperty = 'isPrimary'; + + /** + * Returns an array of values to use in URL generation. + * @return @array + */ + // public function getUrlParams() + // { + // return [ + // 'id' => $this->id, + // 'slug' => $this->slug + // ]; + // } + + // + // Internal properties + // + + /** + * @var string URL cache + */ + protected $url = null; + + /** + * @var string Page where detected component is found. + */ + protected static $urlPageName = null; + + /** + * Changes the component used for generating the URLs dynamically. + * + * @param string $name + * @param string $property + * @return void + */ + public function resetUrlComponent($name, $property = null) + { + $this->urlComponentName = $name; + + if ($property) { + $this->urlComponentProperty = $property; + } + + static::$urlPageName = $this->url = null; + } + + /** + * Mutator for the "url" attribute. Returns the URL detected by the component. + * @return string + */ + public function getUrlAttribute() + { + if ($this->url === null) { + $this->url = $this->makeUrl(); + } + + return $this->url; + } + + /** + * Explicitly set the URL for this model. + * @param string $value + * @return void + */ + public function setUrlAttribute($value) + { + $this->url = $value; + } + + /** + * Explicitly set the CMS Page to link to. + * @param string $pageName + * @return void + */ + public function setUrlPageName($pageName) + { + static::$urlPageName = $pageName; + } + + /** + * Locates the page name where the detected component is found. This method + * uses the Cache service to improve performance. + * @return string + */ + public function getUrlPageName() + { + if (static::$urlPageName !== null) { + return static::$urlPageName; + } + + /* + * Cache + */ + $key = 'urlMaker'.$this->urlComponentName.crc32(get_class($this)); + + $cached = Cache::get($key, false); + if ($cached !== false && ($cached = @unserialize($cached)) !== false) { + $filePath = array_get($cached, 'path'); + $mtime = array_get($cached, 'mtime'); + if (!File::isFile($filePath) || ($mtime != File::lastModified($filePath))) { + $cached = false; + } + } + + if ($cached !== false) { + return static::$urlPageName = array_get($cached, 'fileName'); + } + + /* + * Fallback + */ + $page = null; + $useProperty = property_exists($this, 'urlComponentProperty'); + + if ($useProperty) { + $page = Page::whereComponent($this->urlComponentName, $this->urlComponentProperty, '1')->first(); + } + + if (!$useProperty || !$page) { + $page = Page::withComponent($this->urlComponentName)->first(); + } + + if (!$page) { + throw new ApplicationException(sprintf( + 'Unable to a find a primary component "%s" for generating a URL in %s.', + $this->urlComponentName, + get_class($this) + )); + } + + $baseFileName = $page->getBaseFileName(); + $filePath = $page->getFilePath(); + + $cached = [ + 'path' => $filePath, + 'fileName' => $baseFileName, + 'mtime' => @File::lastModified($filePath) + ]; + + Cache::put($key, serialize($cached), Config::get('cms.parsedPageCacheTTL', 1440)); + + return static::$urlPageName = $baseFileName; + } + + /** + * Generates a real URL based on the page, detected by the primary component. + * The CMS Controller is used for this process passing the declared params. + * @return string + */ + protected function makeUrl() + { + $controller = Controller::getController() ?: new Controller; + + return $controller->pageUrl($this->getUrlPageName(), $this->getUrlParams()); + } +} diff --git a/modules/cms/twig/ComponentNode.php b/modules/cms/twig/ComponentNode.php index a7c0c11..db3ae85 100644 --- a/modules/cms/twig/ComponentNode.php +++ b/modules/cms/twig/ComponentNode.php @@ -2,7 +2,6 @@ use Twig_Node; use Twig_Compiler; -use Twig_NodeInterface; /** * Represents a component node @@ -12,7 +11,7 @@ */ class ComponentNode extends Twig_Node { - public function __construct(Twig_NodeInterface $nodes, $paramNames, $lineno, $tag = 'component') + public function __construct(Twig_Node $nodes, $paramNames, $lineno, $tag = 'component') { parent::__construct(['nodes' => $nodes], ['names' => $paramNames], $lineno, $tag); } @@ -35,7 +34,7 @@ public function compile(Twig_Compiler $compiler) } $compiler - ->write("echo \$this->env->getExtension('CMS')->componentFunction(") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->componentFunction(") ->subcompile($this->getNode('nodes')->getNode(0)) ->write(", \$context['__cms_component_params']") ->write(");\n") diff --git a/modules/cms/twig/ComponentTokenParser.php b/modules/cms/twig/ComponentTokenParser.php index 8c2726c..450f988 100644 --- a/modules/cms/twig/ComponentTokenParser.php +++ b/modules/cms/twig/ComponentTokenParser.php @@ -6,11 +6,9 @@ use Twig_Error_Syntax; /** - * Parser for the {% component %} Twig tag. + * Parser for the `{% component %}` Twig tag. * - *
    - *  {% component "pluginComponent" %}
    - * 
    + * {% component "pluginComponent" %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -21,8 +19,7 @@ class ComponentTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { @@ -50,9 +47,9 @@ public function parse(Twig_Token $token) default: throw new Twig_Error_Syntax( - sprintf('Invalid syntax in the partial tag. Line %s', $lineno), + sprintf('Invalid syntax in the component tag. Line %s', $lineno), $stream->getCurrent()->getLine(), - $stream->getFilename() + $stream->getSourceContext() ); break; } diff --git a/modules/cms/twig/ContentNode.php b/modules/cms/twig/ContentNode.php index 61d02b6..280ea2c 100644 --- a/modules/cms/twig/ContentNode.php +++ b/modules/cms/twig/ContentNode.php @@ -2,7 +2,6 @@ use Twig_Node; use Twig_Compiler; -use Twig_NodeInterface; /** * Represents a content node @@ -12,7 +11,7 @@ */ class ContentNode extends Twig_Node { - public function __construct(Twig_NodeInterface $nodes, $paramNames, $lineno, $tag = 'content') + public function __construct(Twig_Node $nodes, $paramNames, $lineno, $tag = 'content') { parent::__construct(['nodes' => $nodes], ['names' => $paramNames], $lineno, $tag); } @@ -37,7 +36,7 @@ public function compile(Twig_Compiler $compiler) } $compiler - ->write("echo \$this->env->getExtension('CMS')->contentFunction(") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->contentFunction(") ->subcompile($this->getNode('nodes')->getNode(0)) ->write(", \$context['__cms_content_params']") ->write(");\n") diff --git a/modules/cms/twig/ContentTokenParser.php b/modules/cms/twig/ContentTokenParser.php index a71128d..2ce3cad 100644 --- a/modules/cms/twig/ContentTokenParser.php +++ b/modules/cms/twig/ContentTokenParser.php @@ -6,15 +6,13 @@ use Twig_Error_Syntax; /** - * Parser for the {% content %} Twig tag. + * Parser for the `{% content %}` Twig tag. * - *
    - *  {% content "intro.htm" %}
    + *     {% content "intro.htm" %}
      *
    - *  {% content "intro.md" name='John' %}
    + *     {% content "intro.md" name='John' %}
      *
    - *  {% content "intro/txt" name='John', year=2013 %}
    - * 
    + * {% content "intro/txt" name='John', year=2013 %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -25,8 +23,7 @@ class ContentTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { @@ -56,7 +53,7 @@ public function parse(Twig_Token $token) throw new Twig_Error_Syntax( sprintf('Invalid syntax in the content tag. Line %s', $lineno), $stream->getCurrent()->getLine(), - $stream->getFilename() + $stream->getSourceContext() ); break; } diff --git a/modules/cms/twig/DebugExtension.php b/modules/cms/twig/DebugExtension.php index 80a4759..cf58389 100644 --- a/modules/cms/twig/DebugExtension.php +++ b/modules/cms/twig/DebugExtension.php @@ -7,6 +7,8 @@ use Cms\Classes\ComponentBase; use Illuminate\Pagination\Paginator; use Illuminate\Support\Collection; +use Illuminate\Support\Debug\HtmlDumper; +use Symfony\Component\VarDumper\Cloner\VarCloner; use October\Rain\Database\Model; class DebugExtension extends Twig_Extension @@ -36,6 +38,9 @@ class DebugExtension extends Twig_Extension */ protected $commentMap = []; + /** + * @var array Blocked object methods that should not be included in the dump. + */ protected $blockMethods = [ 'componentDetails', 'defineProperties', @@ -57,7 +62,6 @@ public function __construct(Controller $controller) /** * Returns a list of global functions to add to the existing list. - * * @return array An array of global functions */ public function getFunctions() @@ -128,19 +132,8 @@ public function runDump(Twig_Environment $env, $context) return $result; } - /** - * Returns the name of the extension. - * - * @return string The extension name - */ - public function getName() - { - return 'debug'; - } - /** * Dump information about a variable - * * @param mixed $variables Variable to dump * @param mixed $caption Caption [and subcaption] of the dump * @return void @@ -217,13 +210,49 @@ protected function makeTableRow($key, $variable) $css = $this->getDataCss($variable); $output = []; $output[] = ''; - $output[] = ''.$this->evalKeyLabel($key).''; + $output[] = ''.$this->evalKeyLabel($key).''; $output[] = ''.$this->evalVarLabel($variable).''; $output[] = ''.$this->evalVarDesc($variable, $key).''; $output[] = ''; + $output[] = ''; + $output[] = ''.$this->evalVarDump($variable).''; + $output[] = ''; return implode(PHP_EOL, $output); } + /** + * Builds JavaScript for toggling the dump container + * @return string + */ + protected function evalToggleDumpOnClick() + { + $output = "var d=this.parentElement.nextElementSibling.getElementsByTagName('div')[0];"; + $output .= "d.style.display=='none'?d.style.display='block':d.style.display='none'"; + return $output; + } + + /** + * Dumps a variable using HTML Dumper, wrapped in a hidden DIV element. + * @param mixed $variable + * @return string + */ + protected function evalVarDump($variable) + { + $dumper = new HtmlDumper; + $cloner = new VarCloner; + + $output = '
    '; + $output .= $dumper->dump($cloner->cloneVar($variable), true); + $output .= '
    '; + + return $output; + } + + /** + * Returns a variable name as HTML friendly. + * @param string $key + * @return string + */ protected function evalKeyLabel($key) { if ($this->variablePrefix === true) { @@ -385,6 +414,11 @@ protected function evalObjDesc($variable) // Object helpers // + /** + * Returns default comment information for a paginator object. + * @param Illuminate\Pagination\Paginator $paginator + * @return array + */ protected function paginatorToArray(Paginator $paginator) { $this->commentMap = [ @@ -410,7 +444,11 @@ protected function paginatorToArray(Paginator $paginator) ]; } - + /** + * Returns a map of an object as an array, containing methods and properties. + * @param mixed $object + * @return array + */ protected function objectToArray($object) { $class = get_class($object); @@ -463,6 +501,11 @@ protected function objectToArray($object) return $methods + $vars; } + /** + * Extracts the comment from a DocBlock + * @param ReflectionClass $reflectionObj + * @return string + */ protected function evalDocBlock($reflectionObj) { $comment = $reflectionObj->getDocComment(); @@ -476,14 +519,13 @@ protected function evalDocBlock($reflectionObj) return $comment; } - // // Style helpers // /** * Get the CSS string for the output data - * + * @param mixed $variable * @return string */ protected function getDataCss($variable) @@ -504,7 +546,6 @@ protected function getDataCss($variable) /** * Get the CSS string for the output container - * * @return string */ protected function getContainerCss() @@ -523,7 +564,6 @@ protected function getContainerCss() /** * Get the CSS string for the output header - * * @return string */ protected function getHeaderCss() @@ -540,7 +580,6 @@ protected function getHeaderCss() /** * Get the CSS string for the output subheader - * * @return string */ protected function getSubheaderCss() @@ -558,7 +597,6 @@ protected function getSubheaderCss() /** * Convert a key/value pair array into a CSS string - * * @param array $rules List of rules to process * @return string */ diff --git a/modules/cms/twig/DefaultTokenParser.php b/modules/cms/twig/DefaultTokenParser.php index 9303f5f..8a1f828 100644 --- a/modules/cms/twig/DefaultTokenParser.php +++ b/modules/cms/twig/DefaultTokenParser.php @@ -4,14 +4,12 @@ use Twig_TokenParser; /** - * Parser for the {% default %} Twig tag. + * Parser for the `{% default %}` Twig tag. * - *
    - *  {% put head %}
    - *    
    - *    {% default %}
    - *  {% endput %}
    - * 
    + * {% put head %} + * + * {% default %} + * {% endput %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -22,8 +20,7 @@ class DefaultTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { diff --git a/modules/cms/twig/Extension.php b/modules/cms/twig/Extension.php index 7ff4158..79725d0 100644 --- a/modules/cms/twig/Extension.php +++ b/modules/cms/twig/Extension.php @@ -1,6 +1,5 @@ controller = $controller; } - /** - * Returns the name of the extension. - * - * @return string The extension name - */ - public function getName() - { - return 'CMS'; - } - /** * Returns a list of functions to add to the existing list. * diff --git a/modules/cms/twig/FlashNode.php b/modules/cms/twig/FlashNode.php index 42b036c..1658b8b 100644 --- a/modules/cms/twig/FlashNode.php +++ b/modules/cms/twig/FlashNode.php @@ -2,7 +2,6 @@ use Twig_Node; use Twig_Compiler; -use Twig_NodeInterface; use Twig_Node_Expression; /** @@ -13,7 +12,7 @@ */ class FlashNode extends Twig_Node { - public function __construct($name, Twig_NodeInterface $body, $lineno, $tag = 'flash') + public function __construct($name, Twig_Node $body, $lineno, $tag = 'flash') { parent::__construct(['body' => $body], ['name' => $name], $lineno, $tag); } diff --git a/modules/cms/twig/FlashTokenParser.php b/modules/cms/twig/FlashTokenParser.php index ced972b..aca671b 100644 --- a/modules/cms/twig/FlashTokenParser.php +++ b/modules/cms/twig/FlashTokenParser.php @@ -18,7 +18,7 @@ class FlashTokenParser extends Twig_TokenParser * * @param Twig_Token $token A Twig_Token instance * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { diff --git a/modules/cms/twig/FrameworkTokenParser.php b/modules/cms/twig/FrameworkTokenParser.php index 300f532..192b3c0 100644 --- a/modules/cms/twig/FrameworkTokenParser.php +++ b/modules/cms/twig/FrameworkTokenParser.php @@ -4,11 +4,9 @@ use Twig_TokenParser; /** - * Parser for the {% framework %} Twig tag. + * Parser for the `{% framework %}` Twig tag. * - *
    - *  {% framework %}
    - * 
    + * {% framework %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -19,8 +17,7 @@ class FrameworkTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { diff --git a/modules/cms/twig/Loader.php b/modules/cms/twig/Loader.php index eee3bb4..c74450c 100644 --- a/modules/cms/twig/Loader.php +++ b/modules/cms/twig/Loader.php @@ -1,8 +1,11 @@ validateCmsObject($name)) { + return parent::getSourceContext($name); + } + $content = $this->obj->getTwigContent(); /* @@ -41,7 +53,7 @@ public function getSource($name) Event::fire('cms.template.processTwigContent', [$this->obj, $dataHolder]); - return $dataHolder->content; + return new Twig_Source($dataHolder->content, $name); } /** @@ -49,6 +61,10 @@ public function getSource($name) */ public function getCacheKey($name) { + if (!$this->validateCmsObject($name)) { + return parent::getCacheKey($name); + } + return $this->obj->getTwigCacheKey(); } @@ -57,6 +73,71 @@ public function getCacheKey($name) */ public function isFresh($name, $time) { + if (!$this->validateCmsObject($name)) { + return parent::isFresh($name, $time); + } + return $this->obj->mtime <= $time; } + + /** + * Returns the file name of the loaded template. + */ + public function getFilename($name) + { + if (!$this->validateCmsObject($name)) { + return parent::getFilename($name); + } + + return $this->obj->getFilePath(); + } + + /** + * Checks that the template exists. + */ + public function exists($name) + { + if (!$this->validateCmsObject($name)) { + return parent::exists($name); + } + + return $this->obj->exists; + } + + /** + * Internal method that checks if the template name matches + * the loaded object, with fallback support to partials. + * + * @return bool + */ + protected function validateCmsObject($name) + { + if ($name == $this->obj->getFilePath()) { + return true; + } + + if ($fallbackObj = $this->findFallbackObject($name)) { + $this->obj = $fallbackObj; + return true; + } + + return false; + } + + /** + * Looks up a fallback CMS partial object. + * @return Cms\Classes\Partial + */ + protected function findFallbackObject($name) + { + if (strpos($name, '::') !== false) { + return false; + } + + if (array_key_exists($name, $this->fallbackCache)) { + return $this->fallbackCache[$name]; + } + + return $this->fallbackCache[$name] = CmsPartial::find($name); + } } diff --git a/modules/cms/twig/PageNode.php b/modules/cms/twig/PageNode.php index 64338f1..39ef0a8 100644 --- a/modules/cms/twig/PageNode.php +++ b/modules/cms/twig/PageNode.php @@ -25,7 +25,7 @@ public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) - ->write("echo \$this->env->getExtension('CMS')->pageFunction();\n") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->pageFunction();\n") ; } } diff --git a/modules/cms/twig/PageTokenParser.php b/modules/cms/twig/PageTokenParser.php index 72908dd..056aac5 100644 --- a/modules/cms/twig/PageTokenParser.php +++ b/modules/cms/twig/PageTokenParser.php @@ -4,7 +4,9 @@ use Twig_TokenParser; /** - * Parser for the {% page %} Twig tag. + * Parser for the `{% page %}` Twig tag. + * + * {% page %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -15,8 +17,7 @@ class PageTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { diff --git a/modules/cms/twig/PartialNode.php b/modules/cms/twig/PartialNode.php index e2b779b..baf9778 100644 --- a/modules/cms/twig/PartialNode.php +++ b/modules/cms/twig/PartialNode.php @@ -2,7 +2,6 @@ use Twig_Node; use Twig_Compiler; -use Twig_NodeInterface; /** * Represents a partial node @@ -12,7 +11,7 @@ */ class PartialNode extends Twig_Node { - public function __construct(Twig_NodeInterface $nodes, $paramNames, $lineno, $tag = 'partial') + public function __construct(Twig_Node $nodes, $paramNames, $lineno, $tag = 'partial') { parent::__construct(['nodes' => $nodes], ['names' => $paramNames], $lineno, $tag); } @@ -35,7 +34,7 @@ public function compile(Twig_Compiler $compiler) } $compiler - ->write("echo \$this->env->getExtension('CMS')->partialFunction(") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->partialFunction(") ->subcompile($this->getNode('nodes')->getNode(0)) ->write(", \$context['__cms_partial_params']") ->write(");\n") diff --git a/modules/cms/twig/PartialTokenParser.php b/modules/cms/twig/PartialTokenParser.php index e1cebad..57e452e 100644 --- a/modules/cms/twig/PartialTokenParser.php +++ b/modules/cms/twig/PartialTokenParser.php @@ -6,15 +6,13 @@ use Twig_Error_Syntax; /** - * Parser for the {% partial %} Twig tag. + * Parser for the `{% partial %}` Twig tag. * - *
    - *  {% partial "sidebar" %}
    + *     {% partial "sidebar" %}
      *
    - *  {% partial "sidebar" name='John' %}
    + *     {% partial "sidebar" name='John' %}
      *
    - *  {% partial "sidebar" name='John', year=2013 %}
    - * 
    + * {% partial "sidebar" name='John', year=2013 %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -25,8 +23,7 @@ class PartialTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { @@ -56,7 +53,7 @@ public function parse(Twig_Token $token) throw new Twig_Error_Syntax( sprintf('Invalid syntax in the partial tag. Line %s', $lineno), $stream->getCurrent()->getLine(), - $stream->getFilename() + $stream->getSourceContext() ); break; } diff --git a/modules/cms/twig/PlaceholderNode.php b/modules/cms/twig/PlaceholderNode.php index 650f147..62049d4 100644 --- a/modules/cms/twig/PlaceholderNode.php +++ b/modules/cms/twig/PlaceholderNode.php @@ -2,7 +2,6 @@ use Twig_Node; use Twig_Compiler; -use Twig_NodeInterface; /** * Represents a placeholder node @@ -15,9 +14,11 @@ class PlaceholderNode extends Twig_Node public function __construct($name, $paramValues, $body, $lineno, $tag = 'placeholder') { $nodes = []; + if ($body) { $nodes['default'] = $body; } + $attributes = $paramValues; $attributes['name'] = $name; @@ -53,10 +54,10 @@ public function compile(Twig_Compiler $compiler) $compiler->addDebugInfo($this); if (!$isText) { - $compiler->write("echo \$this->env->getExtension('CMS')->displayBlock("); + $compiler->write("echo \$this->env->getExtension('Cms\Twig\Extension')->displayBlock("); } else { - $compiler->write("echo twig_escape_filter(\$this->env, \$this->env->getExtension('CMS')->displayBlock("); + $compiler->write("echo twig_escape_filter(\$this->env, \$this->env->getExtension('Cms\Twig\Extension')->displayBlock("); } $compiler diff --git a/modules/cms/twig/PlaceholderTokenParser.php b/modules/cms/twig/PlaceholderTokenParser.php index 018297b..93e96c1 100644 --- a/modules/cms/twig/PlaceholderTokenParser.php +++ b/modules/cms/twig/PlaceholderTokenParser.php @@ -6,17 +6,15 @@ use Twig_Error_Syntax; /** - * Parser for the {% placeholder %} Twig tag. + * Parser for the `{% placeholder %}` Twig tag. * - *
    - *  {% placeholder head %}
    + *     {% placeholder head %}
      *
    - *  or - use default placeholder content
    + * or - use default placeholder content
      *
    - *  {% placeholder head %}
    - *    
    - *  {% endshowblock %}
    - * 
    + * {% placeholder head %} + * + * {% endshowblock %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -27,8 +25,7 @@ class PlaceholderTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { @@ -78,9 +75,9 @@ protected function loadParams($stream) default: throw new Twig_Error_Syntax( - sprintf('Invalid syntax in the placeholder tag. Line %s', $lineno), + sprintf('Invalid syntax in the placeholder tag. Line %s', $stream->getCurrent()->getLine()), $stream->getCurrent()->getLine(), - $stream->getFilename() + $stream->getSourceContext() ); break; } diff --git a/modules/cms/twig/PutNode.php b/modules/cms/twig/PutNode.php index a48eb53..c98e387 100644 --- a/modules/cms/twig/PutNode.php +++ b/modules/cms/twig/PutNode.php @@ -2,7 +2,6 @@ use Twig_Node; use Twig_Compiler; -use Twig_NodeInterface; /** * Represents a put node @@ -12,7 +11,7 @@ */ class PutNode extends Twig_Node { - public function __construct(Twig_NodeInterface $body, $name, $endType, $lineno, $tag = 'put') + public function __construct(Twig_Node $body, $name, $endType, $lineno, $tag = 'put') { parent::__construct(['body' => $body], ['name' => $name, 'endType' => $endType], $lineno, $tag); } @@ -26,7 +25,7 @@ public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) - ->write("echo \$this->env->getExtension('CMS')->startBlock(") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->startBlock(") ->raw("'".$this->getAttribute('name')."'") ->write(");\n") ; @@ -37,7 +36,7 @@ public function compile(Twig_Compiler $compiler) $compiler ->addDebugInfo($this) - ->write("echo \$this->env->getExtension('CMS')->endBlock(") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->endBlock(") ->raw($isOverwrite ? 'false' : 'true') ->write(");\n") ; diff --git a/modules/cms/twig/PutTokenParser.php b/modules/cms/twig/PutTokenParser.php index 63494fc..f132485 100644 --- a/modules/cms/twig/PutTokenParser.php +++ b/modules/cms/twig/PutTokenParser.php @@ -4,20 +4,18 @@ use Twig_TokenParser; /** - * Parser for the {% put %} Twig tag. + * Parser for the `{% put %}` Twig tag. * - *
    - *  {% put head %}
    - *    
    - *  {% endput %}
    + *     {% put head %}
    + *         
    + *     {% endput %}
      *
      * or
      *
    - * {% put head %}
    - *   
    - *   {% default %}
    - * {% endput %}
    - * 
    + * {% put head %} + * + * {% default %} + * {% endput %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -28,8 +26,7 @@ class PutTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { diff --git a/modules/cms/twig/ScriptsNode.php b/modules/cms/twig/ScriptsNode.php index b40104c..72324b6 100644 --- a/modules/cms/twig/ScriptsNode.php +++ b/modules/cms/twig/ScriptsNode.php @@ -25,8 +25,8 @@ public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) - ->write("echo \$this->env->getExtension('CMS')->assetsFunction('js');\n") - ->write("echo \$this->env->getExtension('CMS')->displayBlock('scripts');\n") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->assetsFunction('js');\n") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->displayBlock('scripts');\n") ; } } diff --git a/modules/cms/twig/ScriptsTokenParser.php b/modules/cms/twig/ScriptsTokenParser.php index d8c0a49..ac3ab21 100644 --- a/modules/cms/twig/ScriptsTokenParser.php +++ b/modules/cms/twig/ScriptsTokenParser.php @@ -4,11 +4,9 @@ use Twig_TokenParser; /** - * Parser for the {% scripts %} Twig tag. + * Parser for the `{% scripts %}` Twig tag. * - *
    - *  {% scripts %}
    - * 
    + * {% scripts %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -19,8 +17,7 @@ class ScriptsTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { diff --git a/modules/cms/twig/StylesNode.php b/modules/cms/twig/StylesNode.php index 3c38a25..5905d00 100644 --- a/modules/cms/twig/StylesNode.php +++ b/modules/cms/twig/StylesNode.php @@ -25,8 +25,8 @@ public function compile(Twig_Compiler $compiler) { $compiler ->addDebugInfo($this) - ->write("echo \$this->env->getExtension('CMS')->assetsFunction('css');\n") - ->write("echo \$this->env->getExtension('CMS')->displayBlock('styles');\n") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->assetsFunction('css');\n") + ->write("echo \$this->env->getExtension('Cms\Twig\Extension')->displayBlock('styles');\n") ; } } diff --git a/modules/cms/twig/StylesTokenParser.php b/modules/cms/twig/StylesTokenParser.php index 5946cdd..05621d0 100644 --- a/modules/cms/twig/StylesTokenParser.php +++ b/modules/cms/twig/StylesTokenParser.php @@ -4,11 +4,9 @@ use Twig_TokenParser; /** - * Parser for the {% styles %} Twig tag. + * Parser for the `{% styles %}` Twig tag. * - *
    - *  {% styles %}
    - * 
    + * {% styles %} * * @package october\cms * @author Alexey Bobkov, Samuel Georges @@ -19,8 +17,7 @@ class StylesTokenParser extends Twig_TokenParser * Parses a token and returns a node. * * @param Twig_Token $token A Twig_Token instance - * - * @return Twig_NodeInterface A Twig_NodeInterface instance + * @return Twig_Node A Twig_Node instance */ public function parse(Twig_Token $token) { diff --git a/modules/cms/widgets/AssetList.php b/modules/cms/widgets/AssetList.php index 744f997..2019683 100644 --- a/modules/cms/widgets/AssetList.php +++ b/modules/cms/widgets/AssetList.php @@ -1,7 +1,7 @@ alias = $alias; $this->theme = Theme::getEditTheme(); $this->selectionInputName = 'file'; + $this->assetExtensions = FileDefinitions::get('assetExtensions'); parent::__construct($controller, []); $this->bindToController(); @@ -62,7 +66,7 @@ public function __construct($controller, $alias) } /** - * {@inheritDoc} + * @inheritDoc */ protected function loadAssets() { @@ -81,14 +85,9 @@ public function render() ]); } - /* - * Event handlers - */ - - public function onGroupStatusUpdate() - { - $this->setGroupStatus(Input::get('group'), Input::get('status')); - } + // + // Event handlers + // public function onOpenDirectory() { @@ -145,7 +144,7 @@ public function onDeleteFiles() if (!@File::delete($fullPath)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_deleting_file', - ['name'=>$path] + ['name' => $path] )); } } @@ -154,14 +153,14 @@ public function onDeleteFiles() if ($empty === false) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_deleting_dir_not_empty', - ['name'=>$path] + ['name' => $path] )); } if (!@rmdir($fullPath)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_deleting_dir', - ['name'=>$path] + ['name' => $path] )); } } @@ -225,6 +224,13 @@ public function onApplyName() throw new ApplicationException(Lang::get('cms::lang.asset.original_not_found')); } + if (!is_dir($originalFullPath) && !$this->validateFileType($newName)) { + throw new ApplicationException(Lang::get( + 'cms::lang.asset.type_not_allowed', + ['allowed_types' => implode(', ', $this->assetExtensions)] + )); + } + $newFullPath = $this->getFullPath(dirname($originalPath).'/'.$newName); if (file_exists($newFullPath) && $newFullPath !== $originalFullPath) { throw new ApplicationException(Lang::get('cms::lang.asset.already_exists')); @@ -235,7 +241,7 @@ public function onApplyName() } return [ - '#'.$this->getId('asset-list') => $this->makePartial('items', ['items'=>$this->getData()]) + '#'.$this->getId('asset-list') => $this->makePartial('items', ['items' => $this->getData()]) ]; } @@ -276,7 +282,7 @@ public function onNewDirectory() } return [ - '#'.$this->getId('asset-list') => $this->makePartial('items', ['items'=>$this->getData()]) + '#'.$this->getId('asset-list') => $this->makePartial('items', ['items' => $this->getData()]) ]; } @@ -294,7 +300,7 @@ public function onLoadMovePopup() $this->listDestinationDirectories($directories, $selectedList); $this->vars['directories'] = $directories; - $this->vars['selectedList'] = base64_encode(serialize(array_keys($selectedList))); + $this->vars['selectedList'] = base64_encode(json_encode(array_keys($selectedList))); return $this->makePartial('move_form'); } @@ -318,7 +324,7 @@ public function onMove() throw new ApplicationException(Lang::get('cms::lang.asset.destination_not_found')); } - $list = @unserialize(@base64_decode($selectedList)); + $list = @json_decode(@base64_decode($selectedList)); if ($list === false) { throw new ApplicationException(Lang::get('cms::lang.asset.selected_files_not_found')); } @@ -341,7 +347,7 @@ public function onMove() if (!@File::move($originalFullPath, $newFullPath)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_moving_file', - ['file'=>$basename] + ['file' => $basename] )); } } @@ -349,35 +355,35 @@ public function onMove() if (!@File::copyDirectory($originalFullPath, $newFullPath)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_moving_directory', - ['dir'=>$basename] + ['dir' => $basename] )); } if (strpos($originalFullPath, '../') !== false) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_deleting_directory', - ['dir'=>$basename] + ['dir' => $basename] )); } if (strpos($originalFullPath, $safeDir) !== 0) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_deleting_directory', - ['dir'=>$basename] + ['dir' => $basename] )); } if (!@File::deleteDirectory($originalFullPath)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.error_deleting_directory', - ['dir'=>$basename] + ['dir' => $basename] )); } } } return [ - '#'.$this->getId('asset-list') => $this->makePartial('items', ['items'=>$this->getData()]) + '#'.$this->getId('asset-list') => $this->makePartial('items', ['items' => $this->getData()]) ]; } @@ -401,7 +407,7 @@ protected function getData() if (!File::makeDirectory($assetsPath)) { throw new ApplicationException(Lang::get( 'cms::lang.cms_object.error_creating_directory', - ['name'=>$assetsPath] + ['name' => $assetsPath] )); } } @@ -425,7 +431,7 @@ protected function getAssetsPath() protected function getThemeFileUrl($path) { - return URL::to('themes/'.$this->theme->getDirName().'/assets'.$path); + return Url::to('themes/'.$this->theme->getDirName().'/assets'.$path); } public function getCurrentRelativePath() @@ -595,6 +601,22 @@ protected function validateRequestTheme() } } + /** + * Check for valid asset file extension + * @param string + * @return bool + */ + protected function validateFileType($name) + { + $extension = strtolower(File::extension($name)); + + if (!in_array($extension, $this->assetExtensions)) { + return false; + } + + return true; + } + /** * Checks the current request to see if it is a postback containing a file upload * for this particular widget. @@ -612,30 +634,37 @@ protected function checkUploadPostback() $fileName = $uploadedFile->getClientOriginalName(); - // Don't rely on Symfony's mime guessing implementation, it's not accurate enough. - // Use the simple extension validation. - $allowedAssetTypes = FileDefinitions::get('assetExtensions'); + /* + * Check valid upload + */ + if (!$uploadedFile->isValid()) { + throw new ApplicationException(Lang::get('cms::lang.asset.file_not_valid')); + } + /* + * Check file size + */ $maxSize = UploadedFile::getMaxFilesize(); if ($uploadedFile->getSize() > $maxSize) { throw new ApplicationException(Lang::get( 'cms::lang.asset.too_large', - ['max_size '=> File::sizeToString($maxSize)] + ['max_size' => File::sizeToString($maxSize)] )); } - $ext = strtolower(pathinfo($uploadedFile->getClientOriginalName(), PATHINFO_EXTENSION)); - if (!in_array($ext, $allowedAssetTypes)) { + /* + * Check for valid file extensions + */ + if (!$this->validateFileType($fileName)) { throw new ApplicationException(Lang::get( 'cms::lang.asset.type_not_allowed', - ['allowed_types' => implode(', ', $allowedAssetTypes)] + ['allowed_types' => implode(', ', $this->assetExtensions)] )); } - if (!$uploadedFile->isValid()) { - throw new ApplicationException(Lang::get('cms::lang.asset.file_not_valid')); - } - + /* + * Accept the uploaded file + */ $uploadedFile->move($this->getCurrentPath(), $uploadedFile->getClientOriginalName()); die('success'); diff --git a/modules/cms/widgets/MediaManager.php b/modules/cms/widgets/MediaManager.php index 1670db4..f547ed5 100644 --- a/modules/cms/widgets/MediaManager.php +++ b/modules/cms/widgets/MediaManager.php @@ -1,11 +1,12 @@ alias = $alias; @@ -150,8 +154,10 @@ public function onGetSidebarThumbnail() throw new ApplicationException('Invalid input data'); } - // If the thumbnail file exists - just return the thumbnail marup, - // otherwise generate a new thumbnail. + /* + * If the thumbnail file exists, just return the thumbnail markup, + * otherwise generate a new thumbnail. + */ $thumbnailPath = $this->thumbnailExists($thumbnailParams, $path, $lastModified); if ($thumbnailPath) { return [ @@ -232,20 +238,44 @@ public function onDeleteItem() $filesToDelete = []; foreach ($paths as $pathInfo) { - if (!isset($pathInfo['path']) || !isset($pathInfo['type'])) { + $path = array_get($pathInfo, 'path'); + $type = array_get($pathInfo, 'type'); + + if (!$path || !$type) { throw new ApplicationException('Invalid input data'); } - if ($pathInfo['type'] == 'file') { - $filesToDelete[] = $pathInfo['path']; + if ($type === MediaLibraryItem::TYPE_FILE) { + /* + * Add to bulk collection + */ + $filesToDelete[] = $path; } - else if ($pathInfo['type'] == 'folder') { - $library->deleteFolder($pathInfo['path']); + elseif ($type === MediaLibraryItem::TYPE_FOLDER) { + /* + * Delete single folder + */ + $library->deleteFolder($path); + + /* + * Extensibility + */ + $this->fireSystemEvent('media.folder.delete', [$path]); } } if (count($filesToDelete) > 0) { + /* + * Delete collection of files + */ $library->deleteFiles($filesToDelete); + + /* + * Extensibility + */ + foreach ($filesToDelete as $path) { + $this->fireSystemEvent('media.file.delete', [$path]); + } } $library->resetCache(); @@ -265,6 +295,7 @@ public function onLoadRenamePopup() $this->vars['name'] = basename($path); $this->vars['listId'] = Input::get('listId'); $this->vars['type'] = Input::get('type'); + return $this->makePartial('rename-form'); } @@ -279,22 +310,39 @@ public function onApplyName() throw new ApplicationException(Lang::get('cms::lang.asset.invalid_name')); } - if (!$this->validateFileType($newName)) { - throw new ApplicationException(Lang::get('cms::lang.media.type_blocked')); - } - $originalPath = Input::get('originalPath'); $originalPath = MediaLibrary::validatePath($originalPath); - $newPath = dirname($originalPath).'/'.$newName; - $type = Input::get('type'); if ($type == MediaLibraryItem::TYPE_FILE) { + /* + * Validate extension + */ + if (!$this->validateFileType($newName)) { + throw new ApplicationException(Lang::get('cms::lang.media.type_blocked')); + } + + /* + * Move single file + */ MediaLibrary::instance()->moveFile($originalPath, $newPath); + + /* + * Extensibility + */ + $this->fireSystemEvent('media.file.rename', [$originalPath, $newPath]); } else { + /* + * Move single folder + */ MediaLibrary::instance()->moveFolder($originalPath, $newPath); + + /* + * Extensibility + */ + $this->fireSystemEvent('media.folder.rename', [$originalPath, $newPath]); } MediaLibrary::instance()->resetCache(); @@ -311,10 +359,6 @@ public function onCreateFolder() throw new ApplicationException(Lang::get('cms::lang.asset.invalid_name')); } - if (!$this->validateFileType($name)) { - throw new ApplicationException(Lang::get('cms::lang.media.type_blocked')); - } - $path = Input::get('path'); $path = MediaLibrary::validatePath($path); @@ -326,10 +370,18 @@ public function onCreateFolder() throw new ApplicationException(Lang::get('cms::lang.media.folder_or_file_exist')); } + /* + * Create the new folder + */ if (!$library->makeFolder($newFolderPath)) { throw new ApplicationException(Lang::get('cms::lang.media.error_creating_folder')); } + /* + * Extensibility + */ + $this->fireSystemEvent('media.folder.create', [$newFolderPath]); + $library->resetCache(); $this->prepareVars(); @@ -394,11 +446,27 @@ public function onMoveItems() $library = MediaLibrary::instance(); foreach ($files as $path) { + /* + * Move a single file + */ $library->moveFile($path, $dest.'/'.basename($path)); + + /* + * Extensibility + */ + $this->fireSystemEvent('media.file.move', [$path, $dest]); } foreach ($folders as $path) { + /* + * Move a single folder + */ $library->moveFolder($path, $dest.'/'.basename($path)); + + /* + * Extensibility + */ + $this->fireSystemEvent('media.folder.move', [$path, $dest]); } $library->resetCache(); @@ -420,6 +488,7 @@ public function onSetSidebarVisible() public function onLoadPopup() { $this->bottomToolbar = Input::get('bottomToolbar', $this->bottomToolbar); + $this->cropAndInsertButton = Input::get('cropAndInsertButton', $this->cropAndInsertButton); return $this->makePartial('popup-body'); @@ -429,22 +498,20 @@ public function onLoadImageCropPopup() { $path = Input::get('path'); $path = MediaLibrary::validatePath($path); - + $cropSessionKey = md5(Form::getSessionKey()); $selectionParams = $this->getSelectionParams(); - $this->vars['currentSelectionMode'] = $selectionParams['mode']; - $this->vars['currentSelectionWidth'] = $selectionParams['width']; - $this->vars['currentSelectionHeight'] = $selectionParams['height']; - - $this->vars['cropSessionKey'] = $cropSessionKey = md5(Form::getSessionKey()); $urlAndSize = $this->getCropEditImageUrlAndSize($path, $cropSessionKey); - $this->vars['imageUrl'] = $urlAndSize['url']; - $this->vars['dimensions'] = $urlAndSize['dimensions']; - $width = $urlAndSize['dimensions'][0]; $height = $urlAndSize['dimensions'][1] ? $urlAndSize['dimensions'][1] : 1; - $this->vars['originalRatio'] = round($width/$height, 5); + $this->vars['currentSelectionMode'] = $selectionParams['mode']; + $this->vars['currentSelectionWidth'] = $selectionParams['width']; + $this->vars['currentSelectionHeight'] = $selectionParams['height']; + $this->vars['cropSessionKey'] = $cropSessionKey; + $this->vars['imageUrl'] = $urlAndSize['url']; + $this->vars['dimensions'] = $urlAndSize['dimensions']; + $this->vars['originalRatio'] = round($width / $height, 5); $this->vars['path'] = $path; return $this->makePartial('image-crop-popup-body'); @@ -534,10 +601,12 @@ protected function prepareVars() $searchTerm = $this->getSearchTerm(); $searchMode = strlen($searchTerm) > 0; - if (!$searchMode) + if (!$searchMode) { $this->vars['items'] = $this->listFolderItems($folder, $filter, $sortBy); - else + } + else { $this->vars['items'] = $this->findFiles($searchTerm, $filter, $sortBy); + } $this->vars['currentFolder'] = $folder; $this->vars['isRootFolder'] = $folder == self::FOLDER_ROOT; @@ -673,32 +742,33 @@ protected function setSelectionParams($selectionMode, $selectionWidth, $selectio } return $this->putSession('media_crop_selection_params', [ - 'mode'=>$selectionMode, - 'width'=>$selectionWidth, - 'height'=>$selectionHeight + 'mode' => $selectionMode, + 'width' => $selectionWidth, + 'height' => $selectionHeight ]); } protected function setSidebarVisible($visible) { - return $this->putSession('sideba_visible', !!$visible); + return $this->putSession('sidebar_visible', !!$visible); } protected function getSidebarVisible() { - return $this->getSession('sideba_visible', true); + return $this->getSession('sidebar_visible', true); } protected function itemTypeToIconClass($item, $itemType) { - if ($item->type == MediaLibraryItem::TYPE_FOLDER) + if ($item->type == MediaLibraryItem::TYPE_FOLDER) { return 'icon-folder'; + } switch ($itemType) { - case MediaLibraryItem::FILE_TYPE_IMAGE : return "icon-picture-o"; - case MediaLibraryItem::FILE_TYPE_VIDEO : return "icon-video-camera"; - case MediaLibraryItem::FILE_TYPE_AUDIO : return "icon-volume-up"; - default : return "icon-file"; + case MediaLibraryItem::FILE_TYPE_IMAGE: return "icon-picture-o"; + case MediaLibraryItem::FILE_TYPE_VIDEO: return "icon-video-camera"; + case MediaLibraryItem::FILE_TYPE_AUDIO: return "icon-volume-up"; + default: return "icon-file"; } } @@ -712,17 +782,23 @@ protected function splitPathToSegments($path) $folder = array_pop($path); $result[$folder] = implode('/', $path).'/'.$folder; - if (substr($result[$folder], 0, 1) != '/') + if (substr($result[$folder], 0, 1) != '/') { $result[$folder] = '/'.$result[$folder]; + } } - return array_reverse($result); + return array_reverse($result, true); } protected function setViewMode($viewMode) { - if (!in_array($viewMode, [self::VIEW_MODE_GRID, self::VIEW_MODE_LIST, self::VIEW_MODE_TILES])) + if (!in_array($viewMode, [ + self::VIEW_MODE_GRID, + self::VIEW_MODE_LIST, + self::VIEW_MODE_TILES + ])) { throw new ApplicationException('Invalid input data'); + } return $this->putSession('view_mode', $viewMode); } @@ -743,7 +819,7 @@ protected function getThumbnailParams($viewMode = null) if ($viewMode == self::VIEW_MODE_LIST) { $result['width'] = 75; $result['height'] = 75; - } + } else { $result['width'] = 165; $result['height'] = 165; @@ -757,11 +833,11 @@ protected function getThumbnailImagePath($thumbnailParams, $itemPath, $lastModif { $itemSignature = md5($itemPath).$lastModified; - $thumbFile = 'thumb_' . - $itemSignature . '_' . - $thumbnailParams['width'] . 'x' . - $thumbnailParams['height'] . '_' . - $thumbnailParams['mode'] . '.' . + $thumbFile = 'thumb_' . + $itemSignature . '_' . + $thumbnailParams['width'] . 'x' . + $thumbnailParams['height'] . '_' . + $thumbnailParams['mode'] . '.' . $thumbnailParams['ext']; $partition = implode('/', array_slice(str_split($itemSignature, 3), 0, 3)) . '/'; @@ -773,7 +849,7 @@ protected function getThumbnailImagePath($thumbnailParams, $itemPath, $lastModif protected function getThumbnailImageUrl($imagePath) { - return URL::to('/storage/temp'.$imagePath); + return Url::to('/storage/temp'.$imagePath); } protected function thumbnailExists($thumbnailParams, $itemPath, $lastModified) @@ -781,8 +857,10 @@ protected function thumbnailExists($thumbnailParams, $itemPath, $lastModified) $thumbnailPath = $this->getThumbnailImagePath($thumbnailParams, $itemPath, $lastModified); $fullPath = temp_path(ltrim($thumbnailPath, '/')); - if (File::exists($fullPath)) + + if (File::exists($fullPath)) { return $thumbnailPath; + } return false; } @@ -790,6 +868,7 @@ protected function thumbnailExists($thumbnailParams, $itemPath, $lastModified) protected function thumbnailIsError($thumbnailPath) { $fullPath = temp_path(ltrim($thumbnailPath, '/')); + return hash_file('crc32', $fullPath) == $this->getBrokenImageHash(); } @@ -797,17 +876,24 @@ protected function getLocalTempFilePath($fileName) { $fileName = md5($fileName.uniqid().microtime()); - $path = temp_path() . '/media'; + $mediaFolder = Config::get('cms.storage.media.folder', 'media'); - if (!File::isDirectory($path)) + $path = temp_path() . MediaLibrary::validatePath($mediaFolder, true); + + if (!File::isDirectory($path)) { File::makeDirectory($path, 0777, true, true); + } return $path.'/'.$fileName; } protected function getThumbnailDirectory() { - return '/public/'; + /* + * NOTE: Custom routing for /storage/temp/$thumbnailDirectory must be setup + * to return the thumbnail if not using default 'public' directory + */ + return MediaLibrary::validatePath(Config::get('cms.storage.media.thumbFolder', 'public'), true) . '/'; } protected function getPlaceholderId($item) @@ -823,7 +909,9 @@ protected function generateThumbnail($thumbnailInfo, $thumbnailParams = null) $markup = null; try { - // Get and validate input data + /* + * Get and validate input data + */ $path = $thumbnailInfo['path']; $width = $thumbnailInfo['width']; $height = $thumbnailInfo['height']; @@ -842,7 +930,9 @@ protected function generateThumbnail($thumbnailInfo, $thumbnailParams = null) $thumbnailPath = $this->getThumbnailImagePath($thumbnailParams, $path, $lastModified); $fullThumbnailPath = temp_path(ltrim($thumbnailPath, '/')); - // Save the file locally + /* + * Save the file locally + */ $library = MediaLibrary::instance(); $tempFilePath = $this->getLocalTempFilePath($path); @@ -850,16 +940,20 @@ protected function generateThumbnail($thumbnailInfo, $thumbnailParams = null) throw new SystemException('Error saving remote file to a temporary location'); } - // Resize the thumbnail and save to the thumbnails directory + /* + * Resize the thumbnail and save to the thumbnails directory + */ $this->resizeImage($fullThumbnailPath, $thumbnailParams, $tempFilePath); - // Delete the temporary file + /* + * Delete the temporary file + */ File::delete($tempFilePath); $markup = $this->makePartial('thumbnail-image', [ 'isError' => false, 'imageUrl' => $this->getThumbnailImageUrl($thumbnailPath) ]); - } + } catch (Exception $ex) { if ($tempFilePath) { File::delete($tempFilePath); @@ -871,7 +965,9 @@ protected function generateThumbnail($thumbnailInfo, $thumbnailParams = null) $markup = $this->makePartial('thumbnail-image', ['isError' => true]); - // TODO: We need to log all types of exceptions here + /* + * @todo We need to log all types of exceptions here + */ traceLog($ex->getMessage()); } @@ -1001,7 +1097,9 @@ protected function checkUploadPostback() throw new ApplicationException(Lang::get('cms::lang.media.type_blocked')); } - // See mime type handling in the asset manager + /* + * See mime type handling in the asset manager + */ if (!$uploadedFile->isValid()) { throw new ApplicationException($uploadedFile->getErrorMessage()); } @@ -1010,11 +1108,23 @@ protected function checkUploadPostback() $path = MediaLibrary::validatePath($path); $filePath = $path.'/'.$fileName; + /* + * getRealPath() can be empty for some environments (IIS) + */ + $realPath = empty(trim($uploadedFile->getRealPath())) + ? $uploadedFile->getPath() . DIRECTORY_SEPARATOR . $uploadedFile->getFileName() + : $uploadedFile->getRealPath(); + MediaLibrary::instance()->put( $filePath, - File::get($uploadedFile->getRealPath()) + File::get($realPath) ); + /* + * Extensibility + */ + $this->fireSystemEvent('media.file.upload', [$filePath, $uploadedFile]); + Response::json([ 'link' => MediaLibrary::url($filePath), 'result' => 'success' @@ -1054,9 +1164,9 @@ protected function validateFileType($name) { $extension = strtolower(File::extension($name)); - $blockedFileTypes = FileDefinitions::get('blockedExtensions'); + $allowedFileTypes = FileDefinitions::get('defaultExtensions'); - if (in_array($extension, $blockedFileTypes)) { + if (!in_array($extension, $allowedFileTypes)) { return false; } @@ -1113,10 +1223,11 @@ protected function getCropEditImageUrlAndSize($path, $cropSessionKey, $params = $library = MediaLibrary::instance(); $originalThumbFileName = 'original.'.$extension; + /* + * If the target dimensions are not provided, save the original image to the + * crop session directory and return its URL. + */ if (!$params) { - // If the target dimensions are not provided, save the original image to the - // crop session directory and return its URL. - $tempFilePath = $fullSessionDirectoryPath.'/'.$originalThumbFileName; if (!@File::put($tempFilePath, $library->get($path))) { @@ -1131,9 +1242,11 @@ protected function getCropEditImageUrlAndSize($path, $cropSessionKey, $params = 'dimensions' => $dimensions ]; } + /* + * If the target dimensions are provided, resize the original image and + * return its URL and dimensions. + */ else { - // If the target dimensions are provided, resize the original image and return its URL - // and dimensions. $originalFilePath = $fullSessionDirectoryPath.'/'.$originalThumbFileName; if (!File::isFile($originalFilePath)) { diff --git a/modules/cms/widgets/TemplateList.php b/modules/cms/widgets/TemplateList.php index 3c230a1..a18df61 100644 --- a/modules/cms/widgets/TemplateList.php +++ b/modules/cms/widgets/TemplateList.php @@ -17,7 +17,10 @@ */ class TemplateList extends WidgetBase { + const SORTING_FILENAME = 'fileName'; + use \Backend\Traits\SelectableWidget; + use \Backend\Traits\CollapsableWidget; protected $searchTerm = false; @@ -25,8 +28,6 @@ class TemplateList extends WidgetBase protected $theme; - protected $groupStatusCache = false; - /** * @var string object property to use as a title. */ @@ -69,6 +70,12 @@ class TemplateList extends WidgetBase */ public $ignoreDirectories = []; + /** + * @var boolean Defines sorting properties. + * The sorting feature is disabled if there are no sorting properties defined. + */ + public $sortingProperties = []; + /* * Public methods */ @@ -79,6 +86,7 @@ public function __construct($controller, $alias, callable $dataSource) $this->dataSource = $dataSource; $this->theme = Theme::getEditTheme(); $this->selectionInputName = 'template'; + $this->collapseSessionKey = $this->getThemeSessionKey('groups'); parent::__construct($controller, []); @@ -125,11 +133,6 @@ public function onSearch() return $this->updateList(); } - public function onGroupStatusUpdate() - { - $this->setGroupStatus(Input::get('group'), Input::get('status')); - } - public function onUpdate() { $this->extendSelection(); @@ -137,6 +140,16 @@ public function onUpdate() return $this->updateList(); } + public function onApplySorting() + { + $this->setSortingProperty(Input::get('sortProperty')); + + $result = $this->updateList(); + $result['#'.$this->getId('sorting-options')] = $this->makePartial('sorting-options'); + + return $result; + } + // // Methods for the internal use // @@ -156,9 +169,7 @@ protected function getData() $items = array_map([$this, 'normalizeItem'], $items); - usort($items, function ($a, $b) { - return strcmp($a->fileName, $b->fileName); - }); + $this->sortItems($items); /* * Apply the search @@ -217,6 +228,10 @@ protected function getData() } } + // Sort folders by name regardless of the + // selected sorting options. + ksort($foundGroups); + foreach ($foundGroups as $group) { $result[] = $group; } @@ -224,6 +239,15 @@ protected function getData() return $result; } + protected function sortItems(&$items) + { + $sortingProperty = $this->getSortingProperty(); + + usort($items, function ($a, $b) use ($sortingProperty) { + return strcmp($a->$sortingProperty, $b->$sortingProperty); + }); + } + protected function removeIgnoredDirectories($items) { if (!$this->ignoreDirectories) { @@ -232,7 +256,7 @@ protected function removeIgnoredDirectories($items) $ignoreCache = []; - $items = array_filter($items, function($item) use (&$ignoreCache) { + $items = array_filter($items, function ($item) use (&$ignoreCache) { $fileName = $item->getBaseFileName(); $dirName = dirname($fileName); @@ -271,12 +295,34 @@ protected function normalizeItem($item) 'title' => $this->getItemTitle($item), 'fileName' => $item->getFileName(), 'description' => $description, - 'descriptions' => $descriptions + 'descriptions' => $descriptions, + 'dragValue' => $this->getItemDragValue($item) ]; + foreach ($this->sortingProperties as $property => $name) { + $result[$property] = $item->$property; + } + return (object) $result; } + protected function getItemDragValue($item) + { + if ($item instanceof \Cms\Classes\Partial) { + return "{% partial '".$item->getBaseFileName()."' %}"; + } + + if ($item instanceof \Cms\Classes\Content) { + return "{% content '".$item->getBaseFileName()."' %}"; + } + + if ($item instanceof \Cms\Classes\Page) { + return "{{ '".$item->getBaseFileName()."'|page }}"; + } + + return ''; + } + protected function getItemTitle($item) { $titleProperty = $this->titleProperty; @@ -349,40 +395,24 @@ protected function itemContainsWord($word, $item, $exact = false) return false; } - protected function getGroupStatus($group) - { - $statuses = $this->getGroupStatuses(); - if (array_key_exists($group, $statuses)) { - return $statuses[$group]; - } - - return false; - } - protected function getThemeSessionKey($prefix) { return $prefix.$this->theme->getDirName(); } - protected function getGroupStatuses() + protected function getSortingProperty() { - if ($this->groupStatusCache !== false) { - return $this->groupStatusCache; - } + $property = $this->getSession($this->getThemeSessionKey('sorting_property'), self::SORTING_FILENAME); - $groups = $this->getSession($this->getThemeSessionKey('groups'), []); - if (!is_array($groups)) { - return $this->groupStatusCache = []; + if (!array_key_exists($property, $this->sortingProperties)) { + return self::SORTING_FILENAME; } - return $this->groupStatusCache = $groups; + return $property; } - protected function setGroupStatus($group, $status) + protected function setSortingProperty($property) { - $statuses = $this->getGroupStatuses(); - $statuses[$group] = $status; - $this->groupStatusCache = $statuses; - $this->putSession($this->getThemeSessionKey('groups'), $statuses); + $this->putSession($this->getThemeSessionKey('sorting_property'), $property); } } diff --git a/modules/cms/widgets/assetlist/assets/css/assetlist.css b/modules/cms/widgets/assetlist/assets/css/assetlist.css index 9101264..8790910 100644 --- a/modules/cms/widgets/assetlist/assets/css/assetlist.css +++ b/modules/cms/widgets/assetlist/assets/css/assetlist.css @@ -38,7 +38,7 @@ word-wrap: break-word; padding: 10px 50px 10px 20px; outline: none; - font-weight: 500; + font-weight: 400; color: #405261; font-size: 14px; } @@ -58,13 +58,13 @@ .control-assetlist ul li a.link span.description { color: #8f8f8f; font-size: 12px; - font-weight: 500; + font-weight: 400; word-wrap: break-word; } .control-assetlist p.parent a.link span.description strong, .control-assetlist ul li a.link span.description strong { color: #405261; - font-weight: 500; + font-weight: 400; } .control-assetlist p.parent.directory a.link, .control-assetlist ul li.directory a.link, diff --git a/modules/cms/widgets/assetlist/assets/js/assetlist.js b/modules/cms/widgets/assetlist/assets/js/assetlist.js index a8aad3e..cbe03c3 100644 --- a/modules/cms/widgets/assetlist/assets/js/assetlist.js +++ b/modules/cms/widgets/assetlist/assets/js/assetlist.js @@ -82,14 +82,20 @@ this.updateUi() } - AssetList.prototype.onUploadFail = function(file, error) { - alert('Error uploading file: ' + error) + AssetList.prototype.onUploadFail = function(file, message) { + if (!message) { + message = 'Error uploading file' + } + + $.oc.alert(message) + this.refresh() } AssetList.prototype.onUploadSuccess = function(file, data) { - if (data !== 'success') - alert(data) + if (data !== 'success') { + $.oc.alert(data) + } } AssetList.prototype.onUploadComplete = function(file, data) { diff --git a/modules/cms/widgets/assetlist/assets/less/assetlist.less b/modules/cms/widgets/assetlist/assets/less/assetlist.less index a21c866..a8070d3 100644 --- a/modules/cms/widgets/assetlist/assets/less/assetlist.less +++ b/modules/cms/widgets/assetlist/assets/less/assetlist.less @@ -37,24 +37,24 @@ word-wrap: break-word; padding: 10px 50px 10px 20px; outline: none; - font-weight: 500; + font-weight: 400; color: @color-text-title; font-size: 14px; &:hover, &:focus, &:active {text-decoration: none;} - span { + span { display: block; &.description { color: @color-text-description; font-size: 12px; - font-weight: 500; + font-weight: 400; word-wrap: break-word; strong { color: @color-text-title; - font-weight: 500; + font-weight: 400; } } } diff --git a/modules/cms/widgets/assetlist/partials/_new_dir_form.htm b/modules/cms/widgets/assetlist/partials/_new_dir_form.htm index 2cb794f..027c574 100644 --- a/modules/cms/widgets/assetlist/partials/_new_dir_form.htm +++ b/modules/cms/widgets/assetlist/partials/_new_dir_form.htm @@ -11,7 +11,12 @@ - +
    @@ -64,6 +73,6 @@

    fatalError)) ?>

    -

    +

    diff --git a/modules/system/controllers/mailpartials/config_form.yaml b/modules/system/controllers/mailpartials/config_form.yaml new file mode 100644 index 0000000..92b624b --- /dev/null +++ b/modules/system/controllers/mailpartials/config_form.yaml @@ -0,0 +1,16 @@ +# =================================== +# Form Behavior Config +# =================================== + +name: system::lang.mail_templates.partial +form: ~/modules/system/models/mailpartial/fields.yaml +modelClass: System\Models\MailPartial +defaultRedirect: system/mailtemplates/index/partials + +create: + redirect: system/mailpartials/update/:id + redirectClose: system/mailtemplates/index/partials + +update: + redirect: system/mailtemplates/index/partials + redirectClose: system/mailtemplates/index/partials diff --git a/modules/system/controllers/mailpartials/create.htm b/modules/system/controllers/mailpartials/create.htm new file mode 100644 index 0000000..dc1e3b3 --- /dev/null +++ b/modules/system/controllers/mailpartials/create.htm @@ -0,0 +1,48 @@ + +
      +
    • +
    • pageTitle)) ?>
    • +
    + + +fatalError): ?> + + 'layout']) ?> + +
    + formRender() ?> +
    + +
    +
    + + + + + +
    +
    + + + + + +

    fatalError)) ?>

    +

    + + diff --git a/modules/system/controllers/mailpartials/update.htm b/modules/system/controllers/mailpartials/update.htm new file mode 100644 index 0000000..f328f37 --- /dev/null +++ b/modules/system/controllers/mailpartials/update.htm @@ -0,0 +1,67 @@ + +
      +
    • +
    • pageTitle)) ?>
    • +
    + + +fatalError): ?> + + 'layout']) ?> + +
    +
    +
    +
    +

    +

    code ?>

    +
    +
    +
    +
    + +
    + formRender() ?> +
    + +
    +
    + + + + + + +
    +
    + + + + + +

    fatalError)) ?>

    +

    + + diff --git a/modules/system/controllers/mailtemplates/_list_partials_toolbar.htm b/modules/system/controllers/mailtemplates/_list_partials_toolbar.htm new file mode 100644 index 0000000..328b48a --- /dev/null +++ b/modules/system/controllers/mailtemplates/_list_partials_toolbar.htm @@ -0,0 +1,7 @@ + diff --git a/modules/system/controllers/mailtemplates/config_partials_list.yaml b/modules/system/controllers/mailtemplates/config_partials_list.yaml new file mode 100644 index 0000000..cd22dbe --- /dev/null +++ b/modules/system/controllers/mailtemplates/config_partials_list.yaml @@ -0,0 +1,16 @@ +# =================================== +# List Behavior Config +# =================================== + +title: system::lang.mail_partials.menu_label +list: ~/modules/system/models/mailpartial/columns.yaml +modelClass: System\Models\MailPartial +recordUrl: system/mailpartials/update/:id +noRecordsMessage: backend::lang.list.no_records +recordsPerPage: 20 +showSetup: true + +toolbar: + buttons: list_partials_toolbar + search: + prompt: backend::lang.list.search_prompt diff --git a/modules/system/controllers/mailtemplates/create.htm b/modules/system/controllers/mailtemplates/create.htm index 86b076d..eb37510 100644 --- a/modules/system/controllers/mailtemplates/create.htm +++ b/modules/system/controllers/mailtemplates/create.htm @@ -13,7 +13,7 @@ formRender() ?> -
    +
    \ No newline at end of file +
    diff --git a/modules/system/controllers/updates/_install_plugins.htm b/modules/system/controllers/updates/_install_plugins.htm index 8170aa8..38c0121 100644 --- a/modules/system/controllers/updates/_install_plugins.htm +++ b/modules/system/controllers/updates/_install_plugins.htm @@ -1,4 +1,3 @@ -
    @@ -46,7 +45,7 @@

    -

    by

    +

    $plugin['author']])) ?>

    -

    by

    +

    $theme['author']])) ?>