From 3042b2589e2d5acd88b7a4138db4de50baa6432f Mon Sep 17 00:00:00 2001 From: Jasmin Savard Date: Wed, 8 Jan 2025 21:06:46 -0500 Subject: [PATCH] WIP Migrate to Assets2.json --- .../Assets.json | 8 - .../Assets2.json | 8 + .../wwwroot/Styles/contentLocalization.css | 2 +- .../Styles/contentLocalization.css.map | 1 + .../Styles/contentLocalization.min.css | 2 +- .../OrchardCore.ContentTypes/Assets.json | 8 - .../OrchardCore.ContentTypes/Assets2.json | 9 + .../wwwroot/Scripts/list-items-filter.js | 132 +- .../wwwroot/Scripts/list-items-filter.map | 1 + .../wwwroot/Scripts/list-items-filter.min.js | 2 +- .../OrchardCore.Contents/Assets.json | 26 - .../OrchardCore.Contents/Assets2.json | 28 + .../Scripts/audittrail-disabledcontent.js | 20 +- .../Scripts/audittrail-disabledcontent.map | 1 + .../Scripts/audittrail-disabledcontent.min.js | 2 +- .../wwwroot/Scripts/content-type-check-all.js | 51 +- .../Scripts/content-type-check-all.map | 1 + .../Scripts/content-type-check-all.min.js | 2 +- .../wwwroot/Styles/Contents.css | 2 +- .../wwwroot/Styles/Contents.css.map | 1 + .../wwwroot/Styles/Contents.min.css | 2 +- .../Styles/audittrail-disabledcontent.css | 2 +- .../Styles/audittrail-disabledcontent.css.map | 1 + .../Styles/audittrail-disabledcontent.min.css | 2 +- .../OrchardCore.Cors/Assets.json | 8 - .../OrchardCore.Cors/Assets2.json | 9 + .../wwwroot/Scripts/cors-admin.js | 272 ++- .../wwwroot/Scripts/cors-admin.map | 1 + .../wwwroot/Scripts/cors-admin.min.js | 2 +- .../OrchardCore.Deployment/Assets.json | 8 - .../OrchardCore.Deployment/Assets2.json | 9 + .../wwwroot/Scripts/steporder.js | 61 +- .../wwwroot/Scripts/steporder.map | 1 + .../wwwroot/Scripts/steporder.min.js | 2 +- .../OrchardCore.Flows/Assets.json | 14 - .../OrchardCore.Flows/Assets2.json | 15 + .../wwwroot/Scripts/flows.edit.js | 247 +-- .../wwwroot/Scripts/flows.edit.map | 1 + .../wwwroot/Scripts/flows.edit.min.js | 2 +- .../wwwroot/Styles/flows.edit.css | 2 +- .../wwwroot/Styles/flows.edit.css.map | 1 + .../wwwroot/Styles/flows.edit.min.css | 2 +- .../OrchardCore.Forms/Assets.json | 20 - .../OrchardCore.Forms/Assets2.json | 22 + .../Scripts/formElementLabelManager.js | 47 +- .../Scripts/formElementLabelManager.map | 1 + .../Scripts/formElementLabelManager.min.js | 2 +- .../wwwroot/Scripts/selectOptionsEditor.js | 593 +++--- .../wwwroot/Scripts/selectOptionsEditor.map | 1 + .../Scripts/selectOptionsEditor.min.js | 2 +- .../wwwroot/Styles/selectOptionsEditor.css | 2 +- .../Styles/selectOptionsEditor.css.map | 1 + .../Styles/selectOptionsEditor.min.css | 2 +- .../OrchardCore.Html/Assets.json | 14 - .../OrchardCore.Html/Assets2.json | 16 + .../wwwroot/Scripts/trumbowyg.media.tag.js | 89 +- .../wwwroot/Scripts/trumbowyg.media.tag.map | 1 + .../Scripts/trumbowyg.media.tag.min.js | 2 +- .../wwwroot/Scripts/trumbowyg.media.url.js | 96 +- .../wwwroot/Scripts/trumbowyg.media.url.map | 1 + .../Scripts/trumbowyg.media.url.min.js | 2 +- .../OrchardCore.Lists/Assets.json | 8 - .../OrchardCore.Lists/Assets2.json | 9 + .../wwwroot/Scripts/ci-list-ordering.js | 73 +- .../wwwroot/Scripts/ci-list-ordering.map | 1 + .../wwwroot/Scripts/ci-list-ordering.min.js | 2 +- .../OrchardCore.Localization/Assets.json | 8 - .../OrchardCore.Localization/Assets2.json | 9 + .../wwwroot/Scripts/optionsEditor.js | 163 +- .../wwwroot/Scripts/optionsEditor.map | 1 + .../wwwroot/Scripts/optionsEditor.min.js | 2 +- .../OrchardCore.Menu/Assets.json | 32 - .../{jquery.mjs.nestedSortable.js => menu.js} | 0 .../OrchardCore.Menu/Assets2.json | 35 + .../OrchardCore.Menu/wwwroot/Scripts/menu.js | 1527 ++++++++------- .../OrchardCore.Menu/wwwroot/Scripts/menu.map | 1 + .../wwwroot/Scripts/menu.min.js | 2 +- .../wwwroot/Styles/menu-permission-picker.css | 2 +- .../Styles/menu-permission-picker.css.map | 1 + .../Styles/menu-permission-picker.min.css | 2 +- .../OrchardCore.Menu/wwwroot/Styles/menu.css | 2 +- .../wwwroot/Styles/menu.css.map | 1 + .../wwwroot/Styles/menu.min.css | 2 +- .../OrchardCore.Notifications/Assets.json | 8 - .../OrchardCore.Notifications/Assets2.json | 9 + .../wwwroot/Scripts/notification-manager.js | 159 +- .../wwwroot/Scripts/notification-manager.map | 1 + .../Scripts/notification-manager.min.js | 2 +- .../OrchardCore.OpenId/Assets.json | 14 - .../OrchardCore.OpenId/Assets2.json | 15 + .../wwwroot/Scripts/parametersEditor.js | 144 +- .../wwwroot/Scripts/parametersEditor.map | 1 + .../wwwroot/Scripts/parametersEditor.min.js | 2 +- .../wwwroot/Styles/parametersEditor.css | 2 +- .../wwwroot/Styles/parametersEditor.css.map | 1 + .../wwwroot/Styles/parametersEditor.min.css | 2 +- .../OrchardCore.Rules/Assets.json | 14 - .../OrchardCore.Rules/Assets2.json | 15 + .../wwwroot/Scripts/rules.js | 76 +- .../wwwroot/Scripts/rules.map | 1 + .../wwwroot/Scripts/rules.min.js | 2 +- .../wwwroot/Styles/rules.css | 2 +- .../wwwroot/Styles/rules.css.map | 1 + .../wwwroot/Styles/rules.min.css | 2 +- .../OrchardCore.Seo/Assets.json | 14 - .../OrchardCore.Seo/Assets2.json | 15 + .../wwwroot/Scripts/customMetaTagsEditor.js | 143 +- .../wwwroot/Scripts/customMetaTagsEditor.map | 1 + .../Scripts/customMetaTagsEditor.min.js | 2 +- .../wwwroot/Styles/customMetaTagsEditor.css | 2 +- .../Styles/customMetaTagsEditor.css.map | 1 + .../Styles/customMetaTagsEditor.min.css | 2 +- .../OrchardCore.Shortcodes/Assets.json | 21 - .../OrchardCore.Shortcodes/Assets2.json | 22 + .../wwwroot/Scripts/shortcode-templates.js | 145 +- .../wwwroot/Scripts/shortcode-templates.map | 1 + .../Scripts/shortcode-templates.min.js | 2 +- .../wwwroot/Scripts/shortcodes.js | 250 +-- .../wwwroot/Scripts/shortcodes.map | 1 + .../wwwroot/Scripts/shortcodes.min.js | 8 +- .../wwwroot/Styles/shortcodes.css | 7 +- .../wwwroot/Styles/shortcodes.css.map | 1 + .../wwwroot/Styles/shortcodes.min.css | 2 +- .../OrchardCore.Taxonomies/Assets.json | 32 - .../{jquery.mjs.nestedSortable.js => menu.js} | 0 .../OrchardCore.Taxonomies/Assets2.json | 35 + .../wwwroot/Scripts/activate-links.js | 44 +- .../wwwroot/Scripts/activate-links.map | 1 + .../wwwroot/Scripts/activate-links.min.js | 2 +- .../wwwroot/Scripts/menu.js | 1527 ++++++++------- .../wwwroot/Scripts/menu.map | 1 + .../wwwroot/Scripts/menu.min.js | 2 +- .../wwwroot/Scripts/tags-editor.js | 204 +- .../wwwroot/Scripts/tags-editor.map | 1 + .../wwwroot/Scripts/tags-editor.min.js | 2 +- .../wwwroot/Styles/menu.css | 2 +- .../wwwroot/Styles/menu.css.map | 1 + .../wwwroot/Styles/menu.min.css | 2 +- .../wwwroot/Styles/tags-editor.css | 2 +- .../wwwroot/Styles/tags-editor.css.map | 1 + .../wwwroot/Styles/tags-editor.min.css | 2 +- .../OrchardCore.Templates/Assets.json | 8 - .../OrchardCore.Templates/Assets2.json | 9 + .../wwwroot/Scripts/templatepreview.edit.js | 120 +- .../wwwroot/Scripts/templatepreview.edit.map | 1 + .../Scripts/templatepreview.edit.min.js | 2 +- .../OrchardCore.UrlRewriting/Assets.json | 14 - .../OrchardCore.UrlRewriting/Assets2.json | 17 + .../wwwroot/Scripts/admin-ui.js | 316 ++-- .../wwwroot/Scripts/admin-ui.map | 1 + .../wwwroot/Scripts/admin-ui.min.js | 2 +- .../wwwroot/Scripts/sortable-rules.js | 102 +- .../wwwroot/Scripts/sortable-rules.map | 1 + .../wwwroot/Scripts/sortable-rules.min.js | 2 +- .../OrchardCore.Users/Assets.json | 14 - .../OrchardCore.Users/Assets2.json | 16 + .../wwwroot/Scripts/password-generator.js | 127 +- .../wwwroot/Scripts/password-generator.map | 1 + .../wwwroot/Scripts/password-generator.min.js | 2 +- .../wwwroot/Scripts/qrcode.js | 1662 ++++++----------- .../wwwroot/Scripts/qrcode.map | 1 + .../wwwroot/Scripts/qrcode.min.js | 2 +- .../OrchardCore.Widgets/Assets.json | 14 - .../OrchardCore.Widgets/Assets2.json | 15 + .../wwwroot/Scripts/widgetslist.edit.js | 184 +- .../wwwroot/Scripts/widgetslist.edit.map | 1 + .../wwwroot/Scripts/widgetslist.edit.min.js | 2 +- .../wwwroot/Styles/widgetslist.edit.css | 2 +- .../wwwroot/Styles/widgetslist.edit.css.map | 1 + .../wwwroot/Styles/widgetslist.edit.min.css | 2 +- 170 files changed, 4755 insertions(+), 4628 deletions(-) delete mode 100644 src/OrchardCore.Modules/OrchardCore.ContentLocalization/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.ContentLocalization/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.ContentTypes/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.ContentTypes/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Contents/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Contents/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.css.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Cors/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Cors/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Deployment/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Deployment/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Flows/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Flows/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Forms/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Forms/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Styles/selectOptionsEditor.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Html/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Html/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.tag.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.url.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Lists/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Lists/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Lists/wwwroot/Scripts/ci-list-ordering.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Localization/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Localization/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Menu/Assets.json rename src/OrchardCore.Modules/OrchardCore.Menu/Assets/js/{jquery.mjs.nestedSortable.js => menu.js} (100%) create mode 100644 src/OrchardCore.Modules/OrchardCore.Menu/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Styles/menu-permission-picker.css.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Styles/menu.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Notifications/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Notifications/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Notifications/wwwroot/Scripts/notification-manager.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.OpenId/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.OpenId/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.map create mode 100644 src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Rules/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Rules/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Styles/rules.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Seo/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Seo/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Scripts/customMetaTagsEditor.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Shortcodes/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Shortcodes/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets.json rename src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets/js/{jquery.mjs.nestedSortable.js => menu.js} (100%) create mode 100644 src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/tags-editor.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.css.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.css.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Templates/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Templates/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.UrlRewriting/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.UrlRewriting/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.map create mode 100644 src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/sortable-rules.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Users/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Users/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.map delete mode 100644 src/OrchardCore.Modules/OrchardCore.Widgets/Assets.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Widgets/Assets2.json create mode 100644 src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.map create mode 100644 src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Styles/widgetslist.edit.css.map diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Assets.json b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Assets.json deleted file mode 100644 index 1629a73aaec..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Assets.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "inputs": [ - "Assets/contentLocalization.scss" - ], - "output": "wwwroot/Styles/contentLocalization.css" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Assets2.json b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Assets2.json new file mode 100644 index 00000000000..bd0210163d2 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/Assets2.json @@ -0,0 +1,8 @@ +[ + { + "action": "sass", + "name": "content-localization", + "source": "Assets/contentLocalization.scss", + "tags": ["admin", "dashboard", "scss"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.css b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.css index 5ab9e7e3a6d..7a722b79619 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.css +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.css @@ -14,4 +14,4 @@ .content-localization .btn-link:hover, .content-localization .btn-link:focus { text-decoration: none; -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.css.map b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.css.map new file mode 100644 index 00000000000..ccd67aad7bd --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA,mDAGA,4FAIA,8EAMA","sources":["style.css"],"sourcesContent":[".content-localization {\n box-shadow: 0 0 1px rgba(0, 0, 0, 0.1);\n}\n.content-localization .card,\n.content-localization .card:last-child .card-header {\n border: none;\n}\n.content-localization .btn {\n width: 100%;\n font-weight: bold;\n color: #38503c;\n padding: 0;\n}\n.content-localization .btn-link:hover,\n.content-localization .btn-link:focus {\n text-decoration: none;\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.min.css b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.min.css index 3a8746e4526..17f8e36bdcd 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.min.css +++ b/src/OrchardCore.Modules/OrchardCore.ContentLocalization/wwwroot/Styles/contentLocalization.min.css @@ -1 +1 @@ -.content-localization{box-shadow:0 0 1px rgba(0,0,0,.1)}.content-localization .card,.content-localization .card:last-child .card-header{border:none}.content-localization .btn{width:100%;font-weight:700;color:#38503c;padding:0}.content-localization .btn-link:focus,.content-localization .btn-link:hover{text-decoration:none} +.content-localization{box-shadow:0 0 1px #0000001a}.content-localization .card,.content-localization .card:last-child .card-header{border:none}.content-localization .btn{color:#38503c;width:100%;padding:0;font-weight:700}.content-localization .btn-link:hover,.content-localization .btn-link:focus{text-decoration:none} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Assets.json b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Assets.json deleted file mode 100644 index 5c188a56479..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Assets.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "inputs": [ - "Assets/js/list-items-filter.js" - ], - "output": "wwwroot/Scripts/list-items-filter.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/Assets2.json b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Assets2.json new file mode 100644 index 00000000000..eb20096226f --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/Assets2.json @@ -0,0 +1,9 @@ +[ + { + "action": "min", + "name": "content-types", + "source": "Assets/js/list-items-filter.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.js b/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.js index 44a8ab463df..105e938935d 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.js +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.js @@ -1,69 +1,77 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - document.addEventListener('DOMContentLoaded', function () { - var searchBox = document.getElementById('search-box'); - var allRows = Array.from(document.querySelectorAll("#list-items > li[data-filter-value]")); - var listAlert = document.getElementById('list-alert'); - var createButton = document.getElementById("btnCreate"); - var visibleRows = allRows; + const searchBox = document.getElementById('search-box'); + const allRows = Array.from(document.querySelectorAll("#list-items > li[data-filter-value]")); + const listAlert = document.getElementById('list-alert'); + const createButton = document.getElementById("btnCreate"); + + let visibleRows = allRows; + + // On each keypress filter the list of types + searchBox.addEventListener('keyup', function (e) { + visibleRows = []; + var search = e.target.value.toLowerCase().trim(); + + // On ESC, clear the search box and display all types + if (e.key === "Escape" || search == '') { + searchBox.value = ''; - // On each keypress filter the list of types - searchBox.addEventListener('keyup', function (e) { - visibleRows = []; - var search = e.target.value.toLowerCase().trim(); + allRows.forEach(row => { + row.classList.remove("d-none"); + row.classList.remove("first-child-visible"); + row.classList.remove("last-child-visible"); - // On ESC, clear the search box and display all types - if (e.key === "Escape" || search == '') { - searchBox.value = ''; - allRows.forEach(function (row) { - row.classList.remove("d-none"); - row.classList.remove("first-child-visible"); - row.classList.remove("last-child-visible"); - visibleRows.push(row); - }); - } else { - allRows.forEach(function (row) { - var text = row.getAttribute('data-filter-value').toLowerCase(); - var found = text.indexOf(search) > -1; - if (found) { - row.classList.remove("d-none"); - row.classList.remove("first-child-visible"); - row.classList.remove("last-child-visible"); - row.classList.remove("border-top"); - row.classList.remove("rounded-top"); - visibleRows.push(row); + visibleRows.push(row); + }); } else { - row.classList.add("d-none"); + allRows.forEach(row => { + let text = row.getAttribute('data-filter-value').toLowerCase(); + let found = text.indexOf(search) > -1; + + if (found) { + row.classList.remove("d-none"); + row.classList.remove("first-child-visible"); + row.classList.remove("last-child-visible"); + row.classList.remove("border-top"); + row.classList.remove("rounded-top"); + + visibleRows.push(row); + } + else { + row.classList.add("d-none"); + } + }); + + if (visibleRows.length > 0) { + visibleRows[0].classList.add('first-child-visible'); + visibleRows[0].classList.add('border-top'); + visibleRows[0].classList.add("rounded-top"); + + visibleRows[visibleRows.length - 1].classList.add('last-child-visible'); + } + } + + if (visibleRows.length == 0) { + listAlert.classList.remove("d-none"); + } + else { + listAlert.classList.add("d-none"); } - }); - if (visibleRows.length > 0) { - visibleRows[0].classList.add('first-child-visible'); - visibleRows[0].classList.add('border-top'); - visibleRows[0].classList.add("rounded-top"); - visibleRows[visibleRows.length - 1].classList.add('last-child-visible'); - } - } - if (visibleRows.length == 0) { - listAlert.classList.remove("d-none"); - } else { - listAlert.classList.add("d-none"); - } - // On Enter, redirect to the edit page if the type exists or the create page with a suggestion - if (e.key === "Enter" && search != '') { - if (visibleRows.length > 0) { - var link = visibleRows[0].querySelector('a.edit-button'); - var hrefValue = link.getAttribute("href"); - if (hrefValue) { - location.href = hrefValue; + // On Enter, redirect to the edit page if the type exists or the create page with a suggestion + if (e.key === "Enter" && search != '') { + + if (visibleRows.length > 0) { + let link = visibleRows[0].querySelector('a.edit-button'); + + let hrefValue = link.getAttribute("href"); + + if (hrefValue) { + location.href = hrefValue; + } + } else { + location.href = createButton.getAttribute("href") + "?suggestion=" + search; + } + return; } - } else { - location.href = createButton.getAttribute("href") + "?suggestion=" + search; - } - return; - } - }); -}); \ No newline at end of file + }); +}); diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.map b/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.map new file mode 100644 index 00000000000..f652848b324 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["document.addEventListener('DOMContentLoaded', function () {\r\n const searchBox = document.getElementById('search-box');\r\n const allRows = Array.from(document.querySelectorAll(\"#list-items > li[data-filter-value]\"));\r\n const listAlert = document.getElementById('list-alert');\r\n const createButton = document.getElementById(\"btnCreate\");\r\n\r\n let visibleRows = allRows;\r\n\r\n // On each keypress filter the list of types\r\n searchBox.addEventListener('keyup', function (e) {\r\n visibleRows = [];\r\n var search = e.target.value.toLowerCase().trim();\r\n\r\n // On ESC, clear the search box and display all types\r\n if (e.key === \"Escape\" || search == '') {\r\n searchBox.value = '';\r\n\r\n allRows.forEach(row => {\r\n row.classList.remove(\"d-none\");\r\n row.classList.remove(\"first-child-visible\");\r\n row.classList.remove(\"last-child-visible\");\r\n\r\n visibleRows.push(row);\r\n });\r\n } else {\r\n allRows.forEach(row => {\r\n let text = row.getAttribute('data-filter-value').toLowerCase();\r\n let found = text.indexOf(search) > -1;\r\n\r\n if (found) {\r\n row.classList.remove(\"d-none\");\r\n row.classList.remove(\"first-child-visible\");\r\n row.classList.remove(\"last-child-visible\");\r\n row.classList.remove(\"border-top\");\r\n row.classList.remove(\"rounded-top\");\r\n\r\n visibleRows.push(row);\r\n }\r\n else {\r\n row.classList.add(\"d-none\");\r\n }\r\n });\r\n\r\n if (visibleRows.length > 0) {\r\n visibleRows[0].classList.add('first-child-visible');\r\n visibleRows[0].classList.add('border-top');\r\n visibleRows[0].classList.add(\"rounded-top\");\r\n\r\n visibleRows[visibleRows.length - 1].classList.add('last-child-visible');\r\n }\r\n }\r\n\r\n if (visibleRows.length == 0) {\r\n listAlert.classList.remove(\"d-none\");\r\n }\r\n else {\r\n listAlert.classList.add(\"d-none\");\r\n }\r\n\r\n // On Enter, redirect to the edit page if the type exists or the create page with a suggestion\r\n if (e.key === \"Enter\" && search != '') {\r\n\r\n if (visibleRows.length > 0) {\r\n let link = visibleRows[0].querySelector('a.edit-button');\r\n\r\n let hrefValue = link.getAttribute(\"href\");\r\n\r\n if (hrefValue) {\r\n location.href = hrefValue;\r\n }\r\n } else {\r\n location.href = createButton.getAttribute(\"href\") + \"?suggestion=\" + search;\r\n }\r\n return;\r\n }\r\n });\r\n});\r\n"],"names":["document","addEventListener","searchBox","getElementById","allRows","Array","from","querySelectorAll","listAlert","createButton","visibleRows","e","search","target","value","toLowerCase","trim","key","forEach","row","classList","remove","push","text","getAttribute","indexOf","add","length","hrefValue","link","querySelector","location","href"],"mappings":"AAAAA,SAASC,gBAAgB,CAAC,mBAAoB,WAC1C,IAAMC,EAAYF,SAASG,cAAc,CAAC,cACpCC,EAAUC,MAAMC,IAAI,CAACN,SAASO,gBAAgB,CAAC,wCAC/CC,EAAYR,SAASG,cAAc,CAAC,cACpCM,EAAeT,SAASG,cAAc,CAAC,aAEzCO,EAAcN,EAGlBF,EAAUD,gBAAgB,CAAC,QAAS,SAAUU,CAAC,EAC3CD,EAAc,EAAE,CAChB,IAAIE,EAASD,EAAEE,MAAM,CAACC,KAAK,CAACC,WAAW,GAAGC,IAAI,GAiD9C,GA9CIL,AAAU,WAAVA,EAAEM,GAAG,EAAiBL,AAAU,IAAVA,GACtBV,EAAUY,KAAK,CAAG,GAEl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CAAC,QAAU,eAAiBZ,EAEzE,MACJ,CACJ,EACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.min.js b/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.min.js index f2f004523ed..82c7d1b4b1f 100644 --- a/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.min.js +++ b/src/OrchardCore.Modules/OrchardCore.ContentTypes/wwwroot/Scripts/list-items-filter.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("search-box"),t=Array.from(document.querySelectorAll("#list-items > li[data-filter-value]")),s=document.getElementById("list-alert"),i=document.getElementById("btnCreate"),l=t;e.addEventListener("keyup",(function(a){l=[];var o=a.target.value.toLowerCase().trim();if("Escape"===a.key||""==o?(e.value="",t.forEach((function(e){e.classList.remove("d-none"),e.classList.remove("first-child-visible"),e.classList.remove("last-child-visible"),l.push(e)}))):(t.forEach((function(e){e.getAttribute("data-filter-value").toLowerCase().indexOf(o)>-1?(e.classList.remove("d-none"),e.classList.remove("first-child-visible"),e.classList.remove("last-child-visible"),e.classList.remove("border-top"),e.classList.remove("rounded-top"),l.push(e)):e.classList.add("d-none")})),l.length>0&&(l[0].classList.add("first-child-visible"),l[0].classList.add("border-top"),l[0].classList.add("rounded-top"),l[l.length-1].classList.add("last-child-visible"))),0==l.length?s.classList.remove("d-none"):s.classList.add("d-none"),"Enter"!==a.key||""==o);else if(l.length>0){var r=l[0].querySelector("a.edit-button").getAttribute("href");r&&(location.href=r)}else location.href=i.getAttribute("href")+"?suggestion="+o}))})); +document.addEventListener("DOMContentLoaded",function(){let e=document.getElementById("search-box"),t=Array.from(document.querySelectorAll("#list-items > li[data-filter-value]")),s=document.getElementById("list-alert"),i=document.getElementById("btnCreate"),l=t;e.addEventListener("keyup",function(a){l=[];var r=a.target.value.toLowerCase().trim();if("Escape"===a.key||""==r?(e.value="",t.forEach(e=>{e.classList.remove("d-none"),e.classList.remove("first-child-visible"),e.classList.remove("last-child-visible"),l.push(e)})):(t.forEach(e=>{e.getAttribute("data-filter-value").toLowerCase().indexOf(r)>-1?(e.classList.remove("d-none"),e.classList.remove("first-child-visible"),e.classList.remove("last-child-visible"),e.classList.remove("border-top"),e.classList.remove("rounded-top"),l.push(e)):e.classList.add("d-none")}),l.length>0&&(l[0].classList.add("first-child-visible"),l[0].classList.add("border-top"),l[0].classList.add("rounded-top"),l[l.length-1].classList.add("last-child-visible"))),0==l.length?s.classList.remove("d-none"):s.classList.add("d-none"),"Enter"===a.key&&""!=r){if(l.length>0){let e=l[0].querySelector("a.edit-button").getAttribute("href");e&&(location.href=e)}else location.href=i.getAttribute("href")+"?suggestion="+r;return}})}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Assets.json b/src/OrchardCore.Modules/OrchardCore.Contents/Assets.json deleted file mode 100644 index c3ff216b50c..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Contents/Assets.json +++ /dev/null @@ -1,26 +0,0 @@ -[ - { - "inputs": [ - "Assets/scss/Contents.scss" - ], - "output": "wwwroot/Styles/Contents.css" - }, - { - "inputs": [ - "Assets/scss/audittrail-disabledcontent.scss" - ], - "output": "wwwroot/Styles/audittrail-disabledcontent.css" - }, - { - "inputs": [ - "Assets/js/audittrail-disabledcontent.js" - ], - "output": "wwwroot/Scripts/audittrail-disabledcontent.js" - }, - { - "inputs": [ - "Assets/js/content-type-check-all.js" - ], - "output": "wwwroot/Scripts/content-type-check-all.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Contents/Assets2.json new file mode 100644 index 00000000000..39578cf71de --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Contents/Assets2.json @@ -0,0 +1,28 @@ +[ + { + "action": "sass", + "name": "content-localization", + "source": "Assets/scss/Contents.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "sass", + "name": "content-localization", + "source": "Assets/scss/audittrail-disabledcontent.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "min", + "name": "content-localization", + "source": "Assets/js/audittrail-disabledcontent.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "min", + "name": "content-localization", + "source": "Assets/js/content-type-check-all.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.js b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.js index 9c3e10ea404..b4633000e97 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.js +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.js @@ -1,14 +1,10 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - $(function () { - $('.disabledContent__wrapper input').prop('disabled', true); - $('.disabledContent__wrapper textarea').prop('disabled', true); - $('.disabledContent__wrapper button').prop('disabled', true); - $('.disabledContent__wrapper .widget-editor .widget-editor-header .widget-editor-btn-toggle').prop('disabled', false); - setTimeout(function () { + $('.disabledContent__wrapper input').prop('disabled', true); $('.disabledContent__wrapper textarea').prop('disabled', true); - }); -}); \ No newline at end of file + $('.disabledContent__wrapper button').prop('disabled', true); + $('.disabledContent__wrapper .widget-editor .widget-editor-header .widget-editor-btn-toggle').prop('disabled', false); + + setTimeout(function () { + $('.disabledContent__wrapper textarea').prop('disabled', true); + }); +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.map b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.map new file mode 100644 index 00000000000..7106d73beab --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["$(function () {\r\n $('.disabledContent__wrapper input').prop('disabled', true);\r\n $('.disabledContent__wrapper textarea').prop('disabled', true);\r\n $('.disabledContent__wrapper button').prop('disabled', true);\r\n $('.disabledContent__wrapper .widget-editor .widget-editor-header .widget-editor-btn-toggle').prop('disabled', false);\r\n\r\n setTimeout(function () {\r\n $('.disabledContent__wrapper textarea').prop('disabled', true);\r\n });\r\n});\r\n"],"names":["$","prop","setTimeout"],"mappings":"AAAAA,EAAE,WACEA,EAAE,mCAAmCC,IAAI,CAAC,WAAY,CAAA,GACtDD,EAAE,sCAAsCC,IAAI,CAAC,WAAY,CAAA,GACzDD,EAAE,oCAAoCC,IAAI,CAAC,WAAY,CAAA,GACvDD,EAAE,4FAA4FC,IAAI,CAAC,WAAY,CAAA,GAE/GC,WAAW,WACPF,EAAE,sCAAsCC,IAAI,CAAC,WAAY,CAAA,EAC7D,EACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.min.js b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.min.js index 44b1cfc5a1b..5cf312eb531 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/audittrail-disabledcontent.min.js @@ -1 +1 @@ -$((function(){$(".disabledContent__wrapper input").prop("disabled",!0),$(".disabledContent__wrapper textarea").prop("disabled",!0),$(".disabledContent__wrapper button").prop("disabled",!0),$(".disabledContent__wrapper .widget-editor .widget-editor-header .widget-editor-btn-toggle").prop("disabled",!1),setTimeout((function(){$(".disabledContent__wrapper textarea").prop("disabled",!0)}))})); +$(function(){$(".disabledContent__wrapper input").prop("disabled",!0),$(".disabledContent__wrapper textarea").prop("disabled",!0),$(".disabledContent__wrapper button").prop("disabled",!0),$(".disabledContent__wrapper .widget-editor .widget-editor-header .widget-editor-btn-toggle").prop("disabled",!1),setTimeout(function(){$(".disabledContent__wrapper textarea").prop("disabled",!0)})}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.js b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.js index 4c264a83d2d..564ad0e10ec 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.js +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.js @@ -1,29 +1,30 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - /** Content Type Check All **/ document.addEventListener('DOMContentLoaded', function (event) { - var checkAllContainer = document.querySelectorAll('.check-all.content-types'); - checkAllContainer.forEach(function (container) { - var master = container.querySelector('input[type="checkbox"].master'); - var slaves = container.querySelectorAll('.slaves input[type="checkbox"]:not(:disabled)'); - var updateMaster = function updateMaster() { - var allChecked = container.querySelectorAll('.slaves input[type="checkbox"]:not(:checked)').length == 0; - master.checked = allChecked; - }; - master.addEventListener('change', function (elem) { - var isChecked = elem.target.checked; - slaves.forEach(function (slave) { - slave.checked = isChecked; - }); - }); - slaves.forEach(function (slave) { - slave.addEventListener('change', function () { + let checkAllContainer = document.querySelectorAll('.check-all.content-types'); + + checkAllContainer.forEach((container) => { + let master = container.querySelector('input[type="checkbox"].master'); + let slaves = container.querySelectorAll('.slaves input[type="checkbox"]:not(:disabled)'); + + let updateMaster = function () { + let allChecked = container.querySelectorAll('.slaves input[type="checkbox"]:not(:checked)').length == 0; + master.checked = allChecked; + }; + + master.addEventListener('change', function (elem) { + let isChecked = elem.target.checked; + + slaves.forEach((slave) => { + slave.checked = isChecked; + }); + }); + + slaves.forEach((slave) => { + slave.addEventListener('change', function () { + updateMaster(); + }); + }); + updateMaster(); - }); }); - updateMaster(); - }); -}); \ No newline at end of file +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.map b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.map new file mode 100644 index 00000000000..cbf1178f18c --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["/** Content Type Check All **/\r\ndocument.addEventListener('DOMContentLoaded', function (event) {\r\n let checkAllContainer = document.querySelectorAll('.check-all.content-types');\r\n\r\n checkAllContainer.forEach((container) => {\r\n let master = container.querySelector('input[type=\"checkbox\"].master');\r\n let slaves = container.querySelectorAll('.slaves input[type=\"checkbox\"]:not(:disabled)');\r\n\r\n let updateMaster = function () {\r\n let allChecked = container.querySelectorAll('.slaves input[type=\"checkbox\"]:not(:checked)').length == 0;\r\n master.checked = allChecked;\r\n };\r\n\r\n master.addEventListener('change', function (elem) {\r\n let isChecked = elem.target.checked;\r\n\r\n slaves.forEach((slave) => {\r\n slave.checked = isChecked;\r\n });\r\n });\r\n\r\n slaves.forEach((slave) => {\r\n slave.addEventListener('change', function () {\r\n updateMaster();\r\n });\r\n });\r\n\r\n updateMaster();\r\n });\r\n});\r\n"],"names":["document","addEventListener","event","checkAllContainer","querySelectorAll","forEach","container","master","querySelector","slaves","updateMaster","allChecked","length","checked","elem","isChecked","target","slave"],"mappings":"AACAA,SAASC,gBAAgB,CAAC,mBAAoB,SAAUC,CAAK,EAGzDC,AAFwBH,SAASI,gBAAgB,CAAC,4BAEhCC,OAAO,CAAC,AAACC,IACvB,IAAIC,EAASD,EAAUE,aAAa,CAAC,iCACjCC,EAASH,EAAUF,gBAAgB,CAAC,iDAEpCM,EAAe,WACf,IAAIC,EAAaL,AAAqF,GAArFA,EAAUF,gBAAgB,CAAC,gDAAgDQ,MAAM,AAClGL,CAAAA,EAAOM,OAAO,CAAGF,CACrB,EAEAJ,EAAON,gBAAgB,CAAC,SAAU,SAAUa,CAAI,EAC5C,IAAIC,EAAYD,EAAKE,MAAM,CAACH,OAAO,CAEnCJ,EAAOJ,OAAO,CAAC,AAACY,IACZA,EAAMJ,OAAO,CAAGE,CACpB,EACJ,GAEAN,EAAOJ,OAAO,CAAC,AAACY,IACZA,EAAMhB,gBAAgB,CAAC,SAAU,WAC7BS,GACJ,EACJ,GAEAA,GACJ,EACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.min.js b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.min.js index 5320926918b..a4a54b5e7c7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Scripts/content-type-check-all.min.js @@ -1 +1 @@ -document.addEventListener("DOMContentLoaded",(function(e){document.querySelectorAll(".check-all.content-types").forEach((function(e){var t=e.querySelector('input[type="checkbox"].master'),c=e.querySelectorAll('.slaves input[type="checkbox"]:not(:disabled)'),n=function(){var c=0==e.querySelectorAll('.slaves input[type="checkbox"]:not(:checked)').length;t.checked=c};t.addEventListener("change",(function(e){var t=e.target.checked;c.forEach((function(e){e.checked=t}))})),c.forEach((function(e){e.addEventListener("change",(function(){n()}))})),n()}))})); +document.addEventListener("DOMContentLoaded",function(e){document.querySelectorAll(".check-all.content-types").forEach(e=>{let t=e.querySelector('input[type="checkbox"].master'),c=e.querySelectorAll('.slaves input[type="checkbox"]:not(:disabled)'),n=function(){let c=0==e.querySelectorAll('.slaves input[type="checkbox"]:not(:checked)').length;t.checked=c};t.addEventListener("change",function(e){let t=e.target.checked;c.forEach(e=>{e.checked=t})}),c.forEach(e=>{e.addEventListener("change",function(){n()})}),n()})}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.css b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.css index f5fd7ce4441..2c3ed90c7fd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.css +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.css @@ -72,4 +72,4 @@ .edit-body { order: 0; } -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.css.map b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.css.map new file mode 100644 index 00000000000..33fd084da21 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA,8FAQA,sCAGA,yDAGA,8DAIA,kEAMA,wKAWA,2HASA,qDAIA,kEAIA,sBACE,0DAIA,uDAGA,8DAGA,kFAKA,4DAGA","sources":["style.css"],"sourcesContent":[".edit-container {\n display: -ms-flexbox;\n display: flex;\n flex-direction: row;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n width: 100%;\n}\n.edit-container > .edit-body {\n width: 100%;\n}\n.edit-container.sidebar > .edit-sidebar {\n visibility: visible;\n}\n.edit-container:not(.sidebar) > .edit-sidebar {\n visibility: hidden;\n}\n\n.edit-body {\n display: -ms-flexbox;\n display: flex;\n flex-direction: column;\n}\n\n.edit-sidebar-handler {\n display: none;\n border: 0;\n border-left: 1px solid lightgray;\n border-right: 1px solid lightgray;\n cursor: col-resize;\n padding-left: 1px;\n padding-right: 1px;\n width: 3px;\n}\n\n.edit-sidebar {\n visibility: hidden;\n vertical-align: top;\n display: -ms-flexbox;\n display: flex;\n padding-left: 8px;\n flex-direction: column;\n}\n\n#show-selected-card .list-group-item {\n min-height: 64px;\n}\n\n.list-group-item.disabled-content-type .icon-toolbar {\n display: none;\n}\n\n@media (min-width: 768px) {\n .edit-container.sidebar > .edit-body {\n flex: 0 0 75%;\n width: 75%;\n }\n .edit-container:not(.sidebar) > .edit-body {\n flex: 0 0 100%;\n }\n .edit-container:not(.sidebar) > .edit-sidebar {\n visibility: hidden;\n }\n .edit-container.sidebar > .edit-sidebar {\n flex: 0 0 24.42141%;\n order: 2;\n padding-left: 15px;\n }\n .edit-container.sidebar > .edit-sidebar-handler {\n display: block;\n }\n .edit-body {\n order: 0;\n }\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.min.css b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.min.css index f79a88cc4db..d1fd1552dc4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.min.css +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/Contents.min.css @@ -1 +1 @@ -.edit-container{display:-ms-flexbox;display:flex;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;width:100%}.edit-container>.edit-body{width:100%}.edit-container.sidebar>.edit-sidebar{visibility:visible}.edit-container:not(.sidebar)>.edit-sidebar{visibility:hidden}.edit-body{display:-ms-flexbox;display:flex;flex-direction:column}.edit-sidebar-handler{display:none;border:0;border-left:1px solid #d3d3d3;border-right:1px solid #d3d3d3;cursor:col-resize;padding-left:1px;padding-right:1px;width:3px}.edit-sidebar{visibility:hidden;vertical-align:top;display:-ms-flexbox;display:flex;padding-left:8px;flex-direction:column}#show-selected-card .list-group-item{min-height:64px}.list-group-item.disabled-content-type .icon-toolbar{display:none}@media (min-width:768px){.edit-container.sidebar>.edit-body{flex:0 0 75%;width:75%}.edit-container:not(.sidebar)>.edit-body{flex:0 0 100%}.edit-container:not(.sidebar)>.edit-sidebar{visibility:hidden}.edit-container.sidebar>.edit-sidebar{flex:0 0 24.42141%;order:2;padding-left:15px}.edit-container.sidebar>.edit-sidebar-handler{display:block}.edit-body{order:0}} +.edit-container{flex-flow:wrap;-ms-flex-wrap:wrap;width:100%;display:-ms-flexbox;display:flex}.edit-container>.edit-body{width:100%}.edit-container.sidebar>.edit-sidebar{visibility:visible}.edit-container:not(.sidebar)>.edit-sidebar{visibility:hidden}.edit-body{flex-direction:column;display:-ms-flexbox;display:flex}.edit-sidebar-handler{cursor:col-resize;border:0;border-left:1px solid #d3d3d3;border-right:1px solid #d3d3d3;width:3px;padding-left:1px;padding-right:1px;display:none}.edit-sidebar{visibility:hidden;vertical-align:top;flex-direction:column;padding-left:8px;display:-ms-flexbox;display:flex}#show-selected-card .list-group-item{min-height:64px}.list-group-item.disabled-content-type .icon-toolbar{display:none}@media (width>=768px){.edit-container.sidebar>.edit-body{flex:0 0 75%;width:75%}.edit-container:not(.sidebar)>.edit-body{flex:0 0 100%}.edit-container:not(.sidebar)>.edit-sidebar{visibility:hidden}.edit-container.sidebar>.edit-sidebar{flex:0 0 24.4214%;order:2;padding-left:15px}.edit-container.sidebar>.edit-sidebar-handler{display:block}.edit-body{order:0}} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.css b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.css index 2127f7f2f0b..89b06c42e49 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.css +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.css @@ -3,4 +3,4 @@ } .disabledContent__wrapper .edit-item-secondary { display: none; -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.css.map b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.css.map new file mode 100644 index 00000000000..ac99728064a --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA,4CAGA","sources":["style.css"],"sourcesContent":[".disabledContent__wrapper {\n position: relative;\n}\n.disabledContent__wrapper .edit-item-secondary {\n display: none;\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.min.css b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.min.css index af6a86472fd..df66fb643a8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.min.css +++ b/src/OrchardCore.Modules/OrchardCore.Contents/wwwroot/Styles/audittrail-disabledcontent.min.css @@ -1 +1 @@ -.disabledContent__wrapper{position:relative}.disabledContent__wrapper .edit-item-secondary{display:none} +.disabledContent__wrapper{position:relative}.disabledContent__wrapper .edit-item-secondary{display:none} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/Assets.json b/src/OrchardCore.Modules/OrchardCore.Cors/Assets.json deleted file mode 100644 index d69784e65af..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Cors/Assets.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "inputs": [ - "Assets/Admin/cors-admin.js" - ], - "output": "wwwroot/Scripts/cors-admin.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Cors/Assets2.json new file mode 100644 index 00000000000..7927ee82ec9 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Cors/Assets2.json @@ -0,0 +1,9 @@ +[ + { + "action": "min", + "name": "cors", + "source": "Assets/Admin/cors-admin.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.js b/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.js index a7093e42d87..5801be7031e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.js +++ b/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.js @@ -1,149 +1,143 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - -var optionsList = Vue.component('options-list', { - props: ['options', 'optionType', 'title', 'subTitle'], - template: '#options-list', - data: function data() { - return { - 'newOption': '' - }; - }, - methods: { - addOption: function addOption(value) { - if (value !== null && value !== '') { - var noDuplicates = $.inArray(value.toLowerCase(), this.options.map(function (o) { - return o.toLowerCase(); - })) < 0; - if (noDuplicates) { - this.options.push(value); +var optionsList = Vue.component('options-list', + { + props: ['options', 'optionType', 'title', 'subTitle'], + template: '#options-list', + data: function () { + return { + 'newOption': '' + }; + }, + methods: { + addOption: function (value) { + if (value !== null && value !== '') { + var noDuplicates = ($.inArray(value.toLowerCase(), this.options.map(o => o.toLowerCase())) < 0); + if (noDuplicates) { + this.options.push(value); + } + } + }, + deleteOption: function (value) { + this.options.splice($.inArray(value, this.options), 1); + } } - } - }, - deleteOption: function deleteOption(value) { - this.options.splice($.inArray(value, this.options), 1); - } - } -}); -var policyDetails = Vue.component('policy-details', { - components: { - optionsList: optionsList - }, - props: ['policy'], - template: '#policy-details' -}); + }); + +var policyDetails = Vue.component('policy-details', + { + components: { optionsList: optionsList }, + props: ['policy'], + template: '#policy-details' + }); + var corsApp = new Vue({ - el: '#corsAdmin', - components: { - policyDetails: policyDetails, - optionsList: optionsList - }, - data: { - selectedPolicy: null, - policies: null, - defaultPolicyName: null - }, - updated: function updated() { - this.searchBox(); - }, - methods: { - newPolicy: function newPolicy() { - this.selectedPolicy = { - name: 'New policy', - allowedOrigins: [], - allowAnyOrigin: true, - allowedMethods: [], - allowAnyMethod: true, - allowedHeaders: [], - allowAnyHeader: true, - allowCredentials: true, - isDefaultPolicy: false, - exposedHeaders: [] - }; - }, - editPolicy: function editPolicy(policy) { - this.selectedPolicy = Object.assign({}, policy); - this.selectedPolicy.originalName = this.selectedPolicy.name; - }, - deletePolicy: function deletePolicy(policy, event) { - this.selectedPolicy = null; - var policyToRemove = this.policies.filter(function (item) { - return item.name === policy.name; - }); - if (policyToRemove.length > 0) this.policies.splice($.inArray(policyToRemove[0], this.policies), 1); - event.stopPropagation(); - this.save(); - }, - updatePolicy: function updatePolicy(policy, event) { - if (policy.isDefaultPolicy) { - this.policies.forEach(function (p) { - return p.isDefaultPolicy = false; - }); - } - if (policy.originalName) { - var policyIndex = this.policies.findIndex(function (oldPolicy) { - return oldPolicy.name === policy.originalName; - }); - this.policies[policyIndex] = policy; - } else { - this.policies.push(policy); - } - this.save(); - this.back(); + el: '#corsAdmin', + components: { policyDetails: policyDetails, optionsList: optionsList }, + data: { + selectedPolicy: null, + policies: null, + defaultPolicyName: null }, - save: function save() { - document.getElementById('corsSettings').value = JSON.stringify(this.policies); - document.getElementById('corsForm').submit(); + updated: function () { + this.searchBox(); }, - back: function back() { - this.selectedPolicy = null; - }, - searchBox: function searchBox() { - var searchBox = $('#search-box'); + methods: { + newPolicy: function () { + this.selectedPolicy = { + name: 'New policy', + allowedOrigins: [], + allowAnyOrigin: true, + allowedMethods: [], + allowAnyMethod: true, + allowedHeaders: [], + allowAnyHeader: true, + allowCredentials: true, + isDefaultPolicy: false, + exposedHeaders: [] + }; + }, + editPolicy: function (policy) { + this.selectedPolicy = Object.assign({}, policy); + this.selectedPolicy.originalName = this.selectedPolicy.name; + }, + deletePolicy: function (policy, event) { + this.selectedPolicy = null; + var policyToRemove = this.policies.filter(function (item) { return item.name === policy.name; }); + if (policyToRemove.length > 0) + this.policies.splice($.inArray(policyToRemove[0], this.policies), 1); + event.stopPropagation(); + this.save(); + }, + updatePolicy: function (policy, event) { + if (policy.isDefaultPolicy) { + this.policies.forEach(p => p.isDefaultPolicy = false); + } - // On Enter, edit the item if there is a single one - searchBox.keypress(function (event) { - if (event.which == 13) { - // Edit the item if there is a single filtered element - var visible = $('#corsAdmin > ul > li:visible'); - if (visible.length == 1) { - window.location = visible.find('.edit').attr('href'); - } - return false; - } - }); + if (policy.originalName) { + var policyIndex = this.policies.findIndex((oldPolicy) => oldPolicy.name === policy.originalName); + this.policies[policyIndex] = policy; + } + else { + this.policies.push(policy); + } - // On each keypress filter the list - searchBox.keyup(function (e) { - var search = $(this).val().toLowerCase(); - var elementsToFilter = $("[data-filter-value]"); + this.save(); + this.back(); + }, + save: function () { + document.getElementById('corsSettings').value = JSON.stringify(this.policies); + document.getElementById('corsForm').submit(); + }, + back: function () { + this.selectedPolicy = null; + }, + searchBox: function () { + var searchBox = $('#search-box'); - // On ESC, clear the search box and display all - if (e.keyCode == 27 || search == '') { - searchBox.val(''); - elementsToFilter.toggle(true); - $('#list-alert').addClass("d-none"); - } else { - var intVisible = 0; - elementsToFilter.each(function () { - var text = $(this).data('filter-value').toLowerCase(); - var found = text.indexOf(search) > -1; - $(this).toggle(found); - if (found) { - intVisible++; - } - }); + // On Enter, edit the item if there is a single one + searchBox.keypress(function (event) { + if (event.which == 13) { - // We display an alert if a search is not found - if (intVisible == 0) { - $('#list-alert').removeClass("d-none"); - } else { - $('#list-alert').addClass("d-none"); - } + // Edit the item if there is a single filtered element + var visible = $('#corsAdmin > ul > li:visible'); + if (visible.length == 1) { + window.location = visible.find('.edit').attr('href'); + } + return false; + } + }); + + // On each keypress filter the list + searchBox.keyup(function (e) { + var search = $(this).val().toLowerCase(); + var elementsToFilter = $("[data-filter-value]"); + + // On ESC, clear the search box and display all + if (e.keyCode == 27 || search == '') { + searchBox.val(''); + elementsToFilter.toggle(true); + $('#list-alert').addClass("d-none"); + } + else { + var intVisible = 0; + elementsToFilter.each(function () { + var text = $(this).data('filter-value').toLowerCase(); + var found = text.indexOf(search) > -1; + $(this).toggle(found); + + if (found) { + intVisible++; + } + }); + + // We display an alert if a search is not found + if (intVisible == 0) { + $('#list-alert').removeClass("d-none"); + } + else { + $('#list-alert').addClass("d-none"); + } + } + }); } - }); } - } -}); \ No newline at end of file +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.map b/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.map new file mode 100644 index 00000000000..cdea6ed0965 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["var optionsList = Vue.component('options-list',\r\n {\r\n props: ['options', 'optionType', 'title', 'subTitle'],\r\n template: '#options-list',\r\n data: function () {\r\n return {\r\n 'newOption': ''\r\n };\r\n },\r\n methods: {\r\n addOption: function (value) {\r\n if (value !== null && value !== '') {\r\n var noDuplicates = ($.inArray(value.toLowerCase(), this.options.map(o => o.toLowerCase())) < 0);\r\n if (noDuplicates) {\r\n this.options.push(value);\r\n }\r\n }\r\n },\r\n deleteOption: function (value) {\r\n this.options.splice($.inArray(value, this.options), 1);\r\n }\r\n }\r\n });\r\n\r\nvar policyDetails = Vue.component('policy-details',\r\n {\r\n components: { optionsList: optionsList },\r\n props: ['policy'],\r\n template: '#policy-details'\r\n });\r\n\r\nvar corsApp = new Vue({\r\n el: '#corsAdmin',\r\n components: { policyDetails: policyDetails, optionsList: optionsList },\r\n data: {\r\n selectedPolicy: null,\r\n policies: null,\r\n defaultPolicyName: null\r\n },\r\n updated: function () {\r\n this.searchBox();\r\n },\r\n methods: {\r\n newPolicy: function () {\r\n this.selectedPolicy = {\r\n name: 'New policy',\r\n allowedOrigins: [],\r\n allowAnyOrigin: true,\r\n allowedMethods: [],\r\n allowAnyMethod: true,\r\n allowedHeaders: [],\r\n allowAnyHeader: true,\r\n allowCredentials: true,\r\n isDefaultPolicy: false,\r\n exposedHeaders: []\r\n };\r\n },\r\n editPolicy: function (policy) {\r\n this.selectedPolicy = Object.assign({}, policy);\r\n this.selectedPolicy.originalName = this.selectedPolicy.name;\r\n },\r\n deletePolicy: function (policy, event) {\r\n this.selectedPolicy = null;\r\n var policyToRemove = this.policies.filter(function (item) { return item.name === policy.name; });\r\n if (policyToRemove.length > 0)\r\n this.policies.splice($.inArray(policyToRemove[0], this.policies), 1);\r\n event.stopPropagation();\r\n this.save();\r\n },\r\n updatePolicy: function (policy, event) {\r\n if (policy.isDefaultPolicy) {\r\n this.policies.forEach(p => p.isDefaultPolicy = false);\r\n }\r\n\r\n if (policy.originalName) {\r\n var policyIndex = this.policies.findIndex((oldPolicy) => oldPolicy.name === policy.originalName);\r\n this.policies[policyIndex] = policy;\r\n }\r\n else {\r\n this.policies.push(policy);\r\n }\r\n\r\n this.save();\r\n this.back();\r\n },\r\n save: function () {\r\n document.getElementById('corsSettings').value = JSON.stringify(this.policies);\r\n document.getElementById('corsForm').submit();\r\n },\r\n back: function () {\r\n this.selectedPolicy = null;\r\n },\r\n searchBox: function () {\r\n var searchBox = $('#search-box');\r\n\r\n // On Enter, edit the item if there is a single one\r\n searchBox.keypress(function (event) {\r\n if (event.which == 13) {\r\n\r\n // Edit the item if there is a single filtered element\r\n var visible = $('#corsAdmin > ul > li:visible');\r\n if (visible.length == 1) {\r\n window.location = visible.find('.edit').attr('href');\r\n }\r\n return false;\r\n }\r\n });\r\n\r\n // On each keypress filter the list\r\n searchBox.keyup(function (e) {\r\n var search = $(this).val().toLowerCase();\r\n var elementsToFilter = $(\"[data-filter-value]\");\r\n\r\n // On ESC, clear the search box and display all\r\n if (e.keyCode == 27 || search == '') {\r\n searchBox.val('');\r\n elementsToFilter.toggle(true);\r\n $('#list-alert').addClass(\"d-none\");\r\n }\r\n else {\r\n var intVisible = 0;\r\n elementsToFilter.each(function () {\r\n var text = $(this).data('filter-value').toLowerCase();\r\n var found = text.indexOf(search) > -1;\r\n $(this).toggle(found);\r\n\r\n if (found) {\r\n intVisible++;\r\n }\r\n });\r\n\r\n // We display an alert if a search is not found\r\n if (intVisible == 0) {\r\n $('#list-alert').removeClass(\"d-none\");\r\n }\r\n else {\r\n $('#list-alert').addClass(\"d-none\");\r\n }\r\n }\r\n });\r\n }\r\n }\r\n});\r\n"],"names":["optionsList","Vue","component","props","template","data","methods","addOption","value","$","inArray","toLowerCase","options","map","o","push","deleteOption","splice","policyDetails","components","corsApp","el","selectedPolicy","policies","defaultPolicyName","updated","searchBox","newPolicy","name","allowedOrigins","allowAnyOrigin","allowedMethods","allowAnyMethod","allowedHeaders","allowAnyHeader","allowCredentials","isDefaultPolicy","exposedHeaders","editPolicy","policy","Object","assign","originalName","deletePolicy","event","policyToRemove","filter","item","length","stopPropagation","save","updatePolicy","forEach","p","policyIndex","findIndex","oldPolicy","back","document","getElementById","JSON","stringify","submit","keypress","which","visible","window","location","find","attr","keyup","e","search","val","elementsToFilter","keyCode","toggle","addClass","intVisible","each","found","text","indexOf","removeClass"],"mappings":"AAAA,IAAIA,YAAcC,IAAIC,SAAS,CAAC,eAC5B,CACIC,MAAO,CAAC,UAAW,aAAc,QAAS,WAAW,CACrDC,SAAU,gBACVC,KAAM,WACF,MAAO,CACH,UAAa,EACjB,CACJ,EACAC,QAAS,CACLC,UAAW,SAAUC,CAAK,EACR,OAAVA,GAAkBA,AAAU,KAAVA,GACEC,AAAyE,EAAzEA,EAAEC,OAAO,CAACF,EAAMG,WAAW,GAAI,IAAI,CAACC,OAAO,CAACC,GAAG,CAACC,GAAKA,EAAEH,WAAW,MAElF,IAAI,CAACC,OAAO,CAACG,IAAI,CAACP,EAG9B,EACAQ,aAAc,SAAUR,CAAK,EACzB,IAAI,CAACI,OAAO,CAACK,MAAM,CAACR,EAAEC,OAAO,CAACF,EAAO,IAAI,CAACI,OAAO,EAAG,EACxD,CACJ,CACJ,GAEAM,cAAgBjB,IAAIC,SAAS,CAAC,iBAC9B,CACIiB,WAAY,CAAEnB,YAAaA,WAAY,EACvCG,MAAO,CAAC,SAAS,CACjBC,SAAU,iBACd,GAEAgB,QAAU,IAAInB,IAAI,CAClBoB,GAAI,aACJF,WAAY,CAAED,cAAeA,cAAelB,YAAaA,WAAY,EACrEK,KAAM,CACFiB,eAAgB,KAChBC,SAAU,KACVC,kBAAmB,IACvB,EACAC,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--git a/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.min.js b/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.min.js index 941ec23e41d..988d4381c73 100644 --- a/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Cors/wwwroot/Scripts/cors-admin.min.js @@ -1 +1 @@ -var optionsList=Vue.component("options-list",{props:["options","optionType","title","subTitle"],template:"#options-list",data:function(){return{newOption:""}},methods:{addOption:function(i){null!==i&&""!==i&&($.inArray(i.toLowerCase(),this.options.map((function(i){return i.toLowerCase()})))<0&&this.options.push(i))},deleteOption:function(i){this.options.splice($.inArray(i,this.options),1)}}}),policyDetails=Vue.component("policy-details",{components:{optionsList:optionsList},props:["policy"],template:"#policy-details"}),corsApp=new Vue({el:"#corsAdmin",components:{policyDetails:policyDetails,optionsList:optionsList},data:{selectedPolicy:null,policies:null,defaultPolicyName:null},updated:function(){this.searchBox()},methods:{newPolicy:function(){this.selectedPolicy={name:"New policy",allowedOrigins:[],allowAnyOrigin:!0,allowedMethods:[],allowAnyMethod:!0,allowedHeaders:[],allowAnyHeader:!0,allowCredentials:!0,isDefaultPolicy:!1,exposedHeaders:[]}},editPolicy:function(i){this.selectedPolicy=Object.assign({},i),this.selectedPolicy.originalName=this.selectedPolicy.name},deletePolicy:function(i,e){this.selectedPolicy=null;var t=this.policies.filter((function(e){return e.name===i.name}));t.length>0&&this.policies.splice($.inArray(t[0],this.policies),1),e.stopPropagation(),this.save()},updatePolicy:function(i,e){if(i.isDefaultPolicy&&this.policies.forEach((function(i){return i.isDefaultPolicy=!1})),i.originalName){var t=this.policies.findIndex((function(e){return e.name===i.originalName}));this.policies[t]=i}else this.policies.push(i);this.save(),this.back()},save:function(){document.getElementById("corsSettings").value=JSON.stringify(this.policies),document.getElementById("corsForm").submit()},back:function(){this.selectedPolicy=null},searchBox:function(){var i=$("#search-box");i.keypress((function(i){if(13==i.which){var e=$("#corsAdmin > ul > li:visible");return 1==e.length&&(window.location=e.find(".edit").attr("href")),!1}})),i.keyup((function(e){var t=$(this).val().toLowerCase(),o=$("[data-filter-value]");if(27==e.keyCode||""==t)i.val(""),o.toggle(!0),$("#list-alert").addClass("d-none");else{var s=0;o.each((function(){var i=$(this).data("filter-value").toLowerCase().indexOf(t)>-1;$(this).toggle(i),i&&s++})),0==s?$("#list-alert").removeClass("d-none"):$("#list-alert").addClass("d-none")}}))}}}); +var optionsList=Vue.component("options-list",{props:["options","optionType","title","subTitle"],template:"#options-list",data:function(){return{newOption:""}},methods:{addOption:function(i){null!==i&&""!==i&&0>$.inArray(i.toLowerCase(),this.options.map(i=>i.toLowerCase()))&&this.options.push(i)},deleteOption:function(i){this.options.splice($.inArray(i,this.options),1)}}}),policyDetails=Vue.component("policy-details",{components:{optionsList:optionsList},props:["policy"],template:"#policy-details"}),corsApp=new Vue({el:"#corsAdmin",components:{policyDetails:policyDetails,optionsList:optionsList},data:{selectedPolicy:null,policies:null,defaultPolicyName:null},updated:function(){this.searchBox()},methods:{newPolicy:function(){this.selectedPolicy={name:"New policy",allowedOrigins:[],allowAnyOrigin:!0,allowedMethods:[],allowAnyMethod:!0,allowedHeaders:[],allowAnyHeader:!0,allowCredentials:!0,isDefaultPolicy:!1,exposedHeaders:[]}},editPolicy:function(i){this.selectedPolicy=Object.assign({},i),this.selectedPolicy.originalName=this.selectedPolicy.name},deletePolicy:function(i,e){this.selectedPolicy=null;var t=this.policies.filter(function(e){return e.name===i.name});t.length>0&&this.policies.splice($.inArray(t[0],this.policies),1),e.stopPropagation(),this.save()},updatePolicy:function(i,e){if(i.isDefaultPolicy&&this.policies.forEach(i=>i.isDefaultPolicy=!1),i.originalName){var t=this.policies.findIndex(e=>e.name===i.originalName);this.policies[t]=i}else this.policies.push(i);this.save(),this.back()},save:function(){document.getElementById("corsSettings").value=JSON.stringify(this.policies),document.getElementById("corsForm").submit()},back:function(){this.selectedPolicy=null},searchBox:function(){var i=$("#search-box");i.keypress(function(i){if(13==i.which){var e=$("#corsAdmin > ul > li:visible");return 1==e.length&&(window.location=e.find(".edit").attr("href")),!1}}),i.keyup(function(e){var t=$(this).val().toLowerCase(),o=$("[data-filter-value]");if(27==e.keyCode||""==t)i.val(""),o.toggle(!0),$("#list-alert").addClass("d-none");else{var s=0;o.each(function(){var i=$(this).data("filter-value").toLowerCase().indexOf(t)>-1;$(this).toggle(i),i&&s++}),0==s?$("#list-alert").removeClass("d-none"):$("#list-alert").addClass("d-none")}})}}}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Assets.json b/src/OrchardCore.Modules/OrchardCore.Deployment/Assets.json deleted file mode 100644 index bb70972d44f..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/Assets.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "inputs": [ - "Assets/js/steporder.js" - ], - "output": "wwwroot/Scripts/steporder.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Deployment/Assets2.json new file mode 100644 index 00000000000..cebd6bee51b --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/Assets2.json @@ -0,0 +1,9 @@ +[ + { + "action": "min", + "name": "deployment", + "source": "Assets/js/steporder.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.js b/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.js index e9776c52404..d88725007d2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.js +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.js @@ -1,36 +1,33 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - function updateStepOrders(oldIndex, newIndex) { - var url = $('#stepOrderUrl').data("url"); - var id = $('#deploymentPlanId').data("id"); - $.ajax({ - url: url, - method: 'POST', - data: { - __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val(), - id: id, - newIndex: newIndex, - oldIndex: oldIndex - }, - error: function error(_error) { - alert($('#stepOrderErrorMessage').data("message")); - } - }); + var url = $('#stepOrderUrl').data("url"); + var id = $('#deploymentPlanId').data("id"); + + $.ajax({ + url: url, + method: 'POST', + data: { + __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val(), + id: id, + newIndex: newIndex, + oldIndex: oldIndex, + }, + error: function (error) { + alert($('#stepOrderErrorMessage').data("message")); + } + }); } + $(function () { - var sortable = document.getElementById("stepOrder"); - if (!sortable) { - return; - } - var sortable = Sortable.create(sortable, { - handle: ".ui-sortable-handle", - onSort: function onSort(evt) { - var oldIndex = evt.oldIndex; - var newIndex = evt.newIndex; - updateStepOrders(oldIndex, newIndex); + var sortable = document.getElementById("stepOrder"); + if (!sortable) { + return; } - }); -}); \ No newline at end of file + var sortable = Sortable.create(sortable, { + handle: ".ui-sortable-handle", + onSort: function (evt) { + var oldIndex = evt.oldIndex; + var newIndex = evt.newIndex; + updateStepOrders(oldIndex, newIndex); + } + }); +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.map b/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.map new file mode 100644 index 00000000000..f97c0ea3ad9 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["function updateStepOrders(oldIndex, newIndex) {\r\n var url = $('#stepOrderUrl').data(\"url\");\r\n var id = $('#deploymentPlanId').data(\"id\");\r\n\r\n $.ajax({\r\n url: url,\r\n method: 'POST',\r\n data: {\r\n __RequestVerificationToken: $(\"input[name='__RequestVerificationToken']\").val(),\r\n id: id,\r\n newIndex: newIndex,\r\n oldIndex: oldIndex,\r\n },\r\n error: function (error) {\r\n alert($('#stepOrderErrorMessage').data(\"message\"));\r\n }\r\n });\r\n}\r\n\r\n$(function () {\r\n var sortable = document.getElementById(\"stepOrder\");\r\n if (!sortable) {\r\n return;\r\n }\r\n var sortable = Sortable.create(sortable, {\r\n handle: \".ui-sortable-handle\",\r\n onSort: function (evt) {\r\n var oldIndex = evt.oldIndex;\r\n var newIndex = evt.newIndex;\r\n updateStepOrders(oldIndex, newIndex);\r\n }\r\n });\r\n});\r\n"],"names":["updateStepOrders","oldIndex","newIndex","url","$","data","id","ajax","method","__RequestVerificationToken","val","error","alert","sortable","document","getElementById","Sortable","create","handle","onSort","evt"],"mappings":"AAAA,SAASA,iBAAiBC,CAAQ,CAAEC,CAAQ,EACxC,IAAIC,EAAMC,EAAE,iBAAiBC,IAAI,CAAC,OAC9BC,EAAKF,EAAE,qBAAqBC,IAAI,CAAC,MAErCD,EAAEG,IAAI,CAAC,CACHJ,IAAKA,EACLK,OAAQ,OACRH,KAAM,CACFI,2BAA4BL,EAAE,4CAA4CM,GAAG,GAC7EJ,GAAIA,EACJJ,SAAUA,EACVD,SAAUA,CACd,EACAU,MAAO,SAAUA,CAAK,EAClBC,MAAMR,EAAE,0BAA0BC,IAAI,CAAC,WAC3C,CACJ,EACJ,CAEAD,EAAE,WACE,IAAIS,EAAWC,SAASC,cAAc,CAAC,aACvC,GAAKF,EAGL,IAAIA,EAAWG,SAASC,MAAM,CAACJ,EAAU,CACrCK,OAAQ,sBACRC,OAAQ,SAAUC,CAAG,EAGjBpB,iBAFeoB,EAAInB,QAAQ,CACZmB,EAAIlB,QAAQ,CAE/B,CACJ,EACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.min.js b/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.min.js index f91e1fdc3cf..ad252d6f12f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Deployment/wwwroot/Scripts/steporder.min.js @@ -1 +1 @@ -function updateStepOrders(e,t){var r=$("#stepOrderUrl").data("url"),a=$("#deploymentPlanId").data("id");$.ajax({url:r,method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),id:a,newIndex:t,oldIndex:e},error:function(e){alert($("#stepOrderErrorMessage").data("message"))}})}$((function(){if(e=document.getElementById("stepOrder"))var e=Sortable.create(e,{handle:".ui-sortable-handle",onSort:function(e){updateStepOrders(e.oldIndex,e.newIndex)}})})); +function updateStepOrders(e,t){var r=$("#stepOrderUrl").data("url"),a=$("#deploymentPlanId").data("id");$.ajax({url:r,method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),id:a,newIndex:t,oldIndex:e},error:function(e){alert($("#stepOrderErrorMessage").data("message"))}})}$(function(){var e=document.getElementById("stepOrder");if(e)var e=Sortable.create(e,{handle:".ui-sortable-handle",onSort:function(e){updateStepOrders(e.oldIndex,e.newIndex)}})}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/Assets.json b/src/OrchardCore.Modules/OrchardCore.Flows/Assets.json deleted file mode 100644 index 4021b8f22f0..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Flows/Assets.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "inputs": [ - "Assets/js/flows.edit.js" - ], - "output": "wwwroot/Scripts/flows.edit.js" - }, - { - "inputs": [ - "Assets/scss/flows.edit.scss" - ], - "output": "wwwroot/Styles/flows.edit.css" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Flows/Assets2.json new file mode 100644 index 00000000000..9231388a4bb --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Flows/Assets2.json @@ -0,0 +1,15 @@ +[ + { + "action": "min", + "name": "flows", + "source": "Assets/js/flows.edit.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "sass", + "name": "flows", + "source": "Assets/scss/flows.edit.scss", + "tags": ["admin", "dashboard", "scss"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js index 451ed269dc5..c9cce32c35a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js @@ -1,132 +1,133 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } -function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } -function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } -function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } -function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } -function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } -function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } //variables used in FlowPart.Edit sortable var widgetDragItem, lastContainer, widgetItemSourceId, widgetItemDestId; + $(function () { - $(document).on('click', '.add-widget', function (event) { - var type = $(this).data("widget-type"); - var targetId = $(this).data("target-id"); - var htmlFieldPrefix = $(this).data("html-field-prefix"); - var createEditorUrl = $('#' + targetId).data("buildeditorurl"); - var prefixesName = $(this).data("prefixes-name"); - var flowmetadata = $(this).data("flowmetadata"); - var parentContentType = $(this).data("parent-content-type"); - var partName = $(this).data("part-name"); - - // Retrieve all index values knowing that some elements may have been moved / removed. - var indexes = $('#' + targetId).closest("form").find("input[name*='Prefixes']").filter(function (i, e) { - return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix; - }).map(function (i, e) { - return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0; - }); + $(document).on('click', '.add-widget', function (event) { + var type = $(this).data("widget-type"); + var targetId = $(this).data("target-id"); + var htmlFieldPrefix = $(this).data("html-field-prefix"); + var createEditorUrl = $('#' + targetId).data("buildeditorurl"); + var prefixesName = $(this).data("prefixes-name"); + var flowmetadata = $(this).data("flowmetadata"); + var parentContentType = $(this).data("parent-content-type"); + var partName = $(this).data("part-name"); + + // Retrieve all index values knowing that some elements may have been moved / removed. + var indexes = $('#' + targetId).closest("form").find("input[name*='Prefixes']") + .filter(function (i, e) { + return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix; + }) + .map(function (i, e) { + return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0; + }); + + // Use a prefix based on the items count (not a guid) so that the browser autofill still works. + var index = indexes.length ? Math.max(...indexes) + 1 : 0; + var prefix = htmlFieldPrefix + '-' + index.toString(); + + var contentTypesName = $(this).data("contenttypes-name"); + var contentItemsName = $(this).data("contentitems-name"); + $.ajax({ + url: createEditorUrl + "?id=" + type + "&prefix=" + prefix + "&prefixesName=" + prefixesName + "&contentTypesName=" + contentTypesName + "&contentItemsName=" + contentItemsName + "&targetId=" + targetId + "&flowmetadata=" + flowmetadata + "&parentContentType=" + parentContentType + "&partName=" + partName + }).done(function (data) { + var result = JSON.parse(data); + $(document.getElementById(targetId)).append(result.Content); - // Use a prefix based on the items count (not a guid) so that the browser autofill still works. - var index = indexes.length ? Math.max.apply(Math, _toConsumableArray(indexes)) + 1 : 0; - var prefix = htmlFieldPrefix + '-' + index.toString(); - var contentTypesName = $(this).data("contenttypes-name"); - var contentItemsName = $(this).data("contentitems-name"); - $.ajax({ - url: createEditorUrl + "?id=" + type + "&prefix=" + prefix + "&prefixesName=" + prefixesName + "&contentTypesName=" + contentTypesName + "&contentItemsName=" + contentItemsName + "&targetId=" + targetId + "&flowmetadata=" + flowmetadata + "&parentContentType=" + parentContentType + "&partName=" + partName - }).done(function (data) { - var result = JSON.parse(data); - $(document.getElementById(targetId)).append(result.Content); - var dom = $(result.Scripts); - dom.filter('script').each(function () { - $.globalEval(this.text || this.textContent || this.innerHTML || ''); - }); + var dom = $(result.Scripts); + dom.filter('script').each(function () { + $.globalEval(this.text || this.textContent || this.innerHTML || ''); + }); + }); }); - }); - $(document).on('click', '.insert-widget', function (event) { - var type = $(this).data("widget-type"); - var target = $(this).closest('.widget-template'); - var targetId = $(this).data("target-id"); - var htmlFieldPrefix = $(this).data("html-field-prefix"); - var createEditorUrl = $('#' + targetId).data("buildeditorurl"); - var flowmetadata = $(this).data("flowmetadata"); - var prefixesName = $(this).data("prefixes-name"); - var parentContentType = $(this).data("parent-content-type"); - var partName = $(this).data("part-name"); - - // Retrieve all index values knowing that some elements may have been moved / removed. - var indexes = $('#' + targetId).closest("form").find("input[name*='Prefixes']").filter(function (i, e) { - return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix; - }).map(function (i, e) { - return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0; + + $(document).on('click', '.insert-widget', function (event) { + var type = $(this).data("widget-type"); + var target = $(this).closest('.widget-template'); + var targetId = $(this).data("target-id"); + var htmlFieldPrefix = $(this).data("html-field-prefix"); + var createEditorUrl = $('#' + targetId).data("buildeditorurl"); + var flowmetadata = $(this).data("flowmetadata"); + var prefixesName = $(this).data("prefixes-name"); + var parentContentType = $(this).data("parent-content-type"); + var partName = $(this).data("part-name"); + + // Retrieve all index values knowing that some elements may have been moved / removed. + var indexes = $('#' + targetId).closest("form").find("input[name*='Prefixes']") + .filter(function (i, e) { + return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix; + }) + .map(function (i, e) { + return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0; + }); + + // Use a prefix based on the items count (not a guid) so that the browser autofill still works. + var index = indexes.length ? Math.max(...indexes) + 1 : 0; + var prefix = htmlFieldPrefix + '-' + index.toString(); + + var contentTypesName = $(this).data("contenttypes-name"); + var contentItemsName = $(this).data("contentitems-name"); + $.ajax({ + url: createEditorUrl + "?id=" + type + "&prefix=" + prefix + "&prefixesName=" + prefixesName + "&contentTypesName=" + contentTypesName + "&contentItemsName=" + contentItemsName + "&targetId=" + targetId + "&flowmetadata=" + flowmetadata + "&parentContentType=" + parentContentType + "&partName=" + partName + }).done(function (data) { + var result = JSON.parse(data); + $(result.Content).insertBefore(target); + + var dom = $(result.Scripts); + dom.filter('script').each(function () { + $.globalEval(this.text || this.textContent || this.innerHTML || ''); + }); + }); }); - // Use a prefix based on the items count (not a guid) so that the browser autofill still works. - var index = indexes.length ? Math.max.apply(Math, _toConsumableArray(indexes)) + 1 : 0; - var prefix = htmlFieldPrefix + '-' + index.toString(); - var contentTypesName = $(this).data("contenttypes-name"); - var contentItemsName = $(this).data("contentitems-name"); - $.ajax({ - url: createEditorUrl + "?id=" + type + "&prefix=" + prefix + "&prefixesName=" + prefixesName + "&contentTypesName=" + contentTypesName + "&contentItemsName=" + contentItemsName + "&targetId=" + targetId + "&flowmetadata=" + flowmetadata + "&parentContentType=" + parentContentType + "&partName=" + partName - }).done(function (data) { - var result = JSON.parse(data); - $(result.Content).insertBefore(target); - var dom = $(result.Scripts); - dom.filter('script').each(function () { - $.globalEval(this.text || this.textContent || this.innerHTML || ''); - }); + $(document).on('click', '.widget-delete', function () { + var $this = $(this); + confirmDialog({ + ...$this.data(), callback: function (r) { + if (r) { + $this.closest('.widget-template').remove(); + $(document).trigger('contentpreview:render'); + } + } + }); }); - }); - $(document).on('click', '.widget-delete', function () { - var $this = $(this); - confirmDialog(_objectSpread(_objectSpread({}, $this.data()), {}, { - callback: function callback(r) { - if (r) { - $this.closest('.widget-template').remove(); - $(document).trigger('contentpreview:render'); + + $(document).on('change', '.widget-editor-footer label, .widget-editor-header label', function () { + + var $tmpl = $(this).closest('.widget-template'); + var $radio = $(this).find("input:first-child"); + if ($radio[0].id !== 'undefined' && $radio[0].id.indexOf('Size') > 0) { + var $radioSize = $(this).find("input:first-child").val(); + var classList = $tmpl.attr('class').split(' '); + $.each(classList, function (id, item) { + if (item.indexOf('col-md-') === 0) $tmpl.removeClass(item); + }); + var colSize = Math.round($radioSize / 100 * 12); + $tmpl.addClass('col-md-' + colSize); + + var dropdown = $(this).closest('.dropdown-menu'); + dropdown.prev('button').text($radioSize + '%'); + } else if ($radio[0].id !== 'undefined' && $radio[0].id.indexOf('Alignment') > 0) { + var svg = $(this).find('svg')[0].outerHTML; + var alignDropdown = $(this).closest('.dropdown-menu'); + var $btn = alignDropdown.prev('button'); + $btn.html(svg); } - } - })); - }); - $(document).on('change', '.widget-editor-footer label, .widget-editor-header label', function () { - var $tmpl = $(this).closest('.widget-template'); - var $radio = $(this).find("input:first-child"); - if ($radio[0].id !== 'undefined' && $radio[0].id.indexOf('Size') > 0) { - var $radioSize = $(this).find("input:first-child").val(); - var classList = $tmpl.attr('class').split(' '); - $.each(classList, function (id, item) { - if (item.indexOf('col-md-') === 0) $tmpl.removeClass(item); - }); - var colSize = Math.round($radioSize / 100 * 12); - $tmpl.addClass('col-md-' + colSize); - var dropdown = $(this).closest('.dropdown-menu'); - dropdown.prev('button').text($radioSize + '%'); - } else if ($radio[0].id !== 'undefined' && $radio[0].id.indexOf('Alignment') > 0) { - var svg = $(this).find('svg')[0].outerHTML; - var alignDropdown = $(this).closest('.dropdown-menu'); - var $btn = alignDropdown.prev('button'); - $btn.html(svg); - } - $(this).parent().find('.dropdown-item').removeClass('active'); - $(this).toggleClass('active'); - $(document).trigger('contentpreview:render'); - }); - $(document).on('click', '.widget-editor-btn-toggle', function () { - $(this).closest('.widget-editor').toggleClass('collapsed'); - }); - $(document).on('keyup', '.widget-editor-body .form-group input.content-caption-text', function () { - var headerTextLabel = $(this).closest('.widget-editor').find('.widget-editor-header:first .widget-editor-header-text'); - var contentTypeDisplayText = headerTextLabel.data('content-type-display-text'); - var title = $(this).val(); - var newDisplayText = title + ' ' + contentTypeDisplayText; - headerTextLabel.text(newDisplayText); - }); -}); \ No newline at end of file + + $(this).parent().find('.dropdown-item').removeClass('active'); + $(this).toggleClass('active'); + $(document).trigger('contentpreview:render'); + }); + + $(document).on('click', '.widget-editor-btn-toggle', function () { + $(this).closest('.widget-editor').toggleClass('collapsed'); + }); + + $(document).on('keyup', '.widget-editor-body .form-group input.content-caption-text', function () { + var headerTextLabel = $(this).closest('.widget-editor').find('.widget-editor-header:first .widget-editor-header-text'); + var contentTypeDisplayText = headerTextLabel.data('content-type-display-text'); + var title = $(this).val(); + var newDisplayText = title + ' ' + contentTypeDisplayText; + + headerTextLabel.text(newDisplayText); + }); +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.map b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.map new file mode 100644 index 00000000000..56579d5c3ca --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["//variables used in FlowPart.Edit sortable\r\nvar widgetDragItem, lastContainer, widgetItemSourceId, widgetItemDestId;\r\n\r\n$(function () {\r\n $(document).on('click', '.add-widget', function (event) {\r\n var type = $(this).data(\"widget-type\");\r\n var targetId = $(this).data(\"target-id\");\r\n var htmlFieldPrefix = $(this).data(\"html-field-prefix\");\r\n var createEditorUrl = $('#' + targetId).data(\"buildeditorurl\");\r\n var prefixesName = $(this).data(\"prefixes-name\");\r\n var flowmetadata = $(this).data(\"flowmetadata\");\r\n var parentContentType = $(this).data(\"parent-content-type\");\r\n var partName = $(this).data(\"part-name\");\r\n\r\n // Retrieve all index values knowing that some elements may have been moved / removed.\r\n var indexes = $('#' + targetId).closest(\"form\").find(\"input[name*='Prefixes']\")\r\n .filter(function (i, e) {\r\n return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix;\r\n })\r\n .map(function (i, e) {\r\n return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0;\r\n });\r\n\r\n // Use a prefix based on the items count (not a guid) so that the browser autofill still works.\r\n var index = indexes.length ? Math.max(...indexes) + 1 : 0;\r\n var prefix = htmlFieldPrefix + '-' + index.toString();\r\n\r\n var contentTypesName = $(this).data(\"contenttypes-name\");\r\n var contentItemsName = $(this).data(\"contentitems-name\");\r\n $.ajax({\r\n url: createEditorUrl + \"?id=\" + type + \"&prefix=\" + prefix + \"&prefixesName=\" + prefixesName + \"&contentTypesName=\" + contentTypesName + \"&contentItemsName=\" + contentItemsName + \"&targetId=\" + targetId + \"&flowmetadata=\" + flowmetadata + \"&parentContentType=\" + parentContentType + \"&partName=\" + partName\r\n }).done(function (data) {\r\n var result = JSON.parse(data);\r\n $(document.getElementById(targetId)).append(result.Content);\r\n\r\n var dom = $(result.Scripts);\r\n dom.filter('script').each(function () {\r\n $.globalEval(this.text || this.textContent || this.innerHTML || '');\r\n });\r\n });\r\n });\r\n\r\n $(document).on('click', '.insert-widget', function (event) {\r\n var type = $(this).data(\"widget-type\");\r\n var target = $(this).closest('.widget-template');\r\n var targetId = $(this).data(\"target-id\");\r\n var htmlFieldPrefix = $(this).data(\"html-field-prefix\");\r\n var createEditorUrl = $('#' + targetId).data(\"buildeditorurl\");\r\n var flowmetadata = $(this).data(\"flowmetadata\");\r\n var prefixesName = $(this).data(\"prefixes-name\");\r\n var parentContentType = $(this).data(\"parent-content-type\");\r\n var partName = $(this).data(\"part-name\");\r\n\r\n // Retrieve all index values knowing that some elements may have been moved / removed.\r\n var indexes = $('#' + targetId).closest(\"form\").find(\"input[name*='Prefixes']\")\r\n .filter(function (i, e) {\r\n return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix;\r\n })\r\n .map(function (i, e) {\r\n return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0;\r\n });\r\n\r\n // Use a prefix based on the items count (not a guid) so that the browser autofill still works.\r\n var index = indexes.length ? Math.max(...indexes) + 1 : 0;\r\n var prefix = htmlFieldPrefix + '-' + index.toString();\r\n\r\n var contentTypesName = $(this).data(\"contenttypes-name\");\r\n var contentItemsName = $(this).data(\"contentitems-name\");\r\n $.ajax({\r\n url: createEditorUrl + \"?id=\" + type + \"&prefix=\" + prefix + \"&prefixesName=\" + prefixesName + \"&contentTypesName=\" + contentTypesName + \"&contentItemsName=\" + contentItemsName + \"&targetId=\" + targetId + \"&flowmetadata=\" + flowmetadata + \"&parentContentType=\" + parentContentType + \"&partName=\" + partName\r\n }).done(function (data) {\r\n var result = JSON.parse(data);\r\n $(result.Content).insertBefore(target);\r\n\r\n var dom = $(result.Scripts);\r\n dom.filter('script').each(function () {\r\n $.globalEval(this.text || this.textContent || this.innerHTML || '');\r\n });\r\n });\r\n });\r\n\r\n $(document).on('click', '.widget-delete', function () {\r\n var $this = $(this);\r\n confirmDialog({\r\n ...$this.data(), callback: function (r) {\r\n if (r) {\r\n $this.closest('.widget-template').remove();\r\n $(document).trigger('contentpreview:render');\r\n }\r\n }\r\n });\r\n });\r\n\r\n $(document).on('change', '.widget-editor-footer label, .widget-editor-header label', function () {\r\n\r\n var $tmpl = $(this).closest('.widget-template');\r\n var $radio = $(this).find(\"input:first-child\");\r\n if ($radio[0].id !== 'undefined' && $radio[0].id.indexOf('Size') > 0) {\r\n var $radioSize = $(this).find(\"input:first-child\").val();\r\n var classList = $tmpl.attr('class').split(' ');\r\n $.each(classList, function (id, item) {\r\n if (item.indexOf('col-md-') === 0) $tmpl.removeClass(item);\r\n });\r\n var colSize = Math.round($radioSize / 100 * 12);\r\n $tmpl.addClass('col-md-' + colSize);\r\n\r\n var dropdown = $(this).closest('.dropdown-menu');\r\n dropdown.prev('button').text($radioSize + '%');\r\n } else if ($radio[0].id !== 'undefined' && $radio[0].id.indexOf('Alignment') > 0) {\r\n var svg = $(this).find('svg')[0].outerHTML;\r\n var alignDropdown = $(this).closest('.dropdown-menu');\r\n var $btn = alignDropdown.prev('button');\r\n $btn.html(svg);\r\n }\r\n\r\n $(this).parent().find('.dropdown-item').removeClass('active');\r\n $(this).toggleClass('active');\r\n $(document).trigger('contentpreview:render');\r\n });\r\n\r\n $(document).on('click', '.widget-editor-btn-toggle', function () {\r\n $(this).closest('.widget-editor').toggleClass('collapsed');\r\n });\r\n\r\n $(document).on('keyup', '.widget-editor-body .form-group input.content-caption-text', function () {\r\n var headerTextLabel = $(this).closest('.widget-editor').find('.widget-editor-header:first .widget-editor-header-text');\r\n var contentTypeDisplayText = headerTextLabel.data('content-type-display-text');\r\n var title = $(this).val();\r\n var newDisplayText = title + ' ' + contentTypeDisplayText;\r\n\r\n headerTextLabel.text(newDisplayText);\r\n });\r\n});\r\n"],"names":["widgetDragItem","lastContainer","widgetItemSourceId","widgetItemDestId","$","document","on","event","type","data","targetId","htmlFieldPrefix","createEditorUrl","prefixesName","flowmetadata","parentContentType","partName","indexes","closest","find","filter","i","e","val","substring","lastIndexOf","map","parseInt","prefix","index","length","Math","max","toString","contentTypesName","contentItemsName","ajax","url","done","result","JSON","parse","getElementById","append","Content","dom","Scripts","each","globalEval","text","textContent","innerHTML","target","insertBefore","$this","confirmDialog","callback","r","remove","trigger","$tmpl","$radio","id","indexOf","$radioSize","classList","attr","split","item","removeClass","addClass","round","dropdown","prev","svg","outerHTML","$btn","alignDropdown","html","parent","toggleClass","headerTextLabel","contentTypeDisplayText","title"],"mappings":"AACA,IAAIA,eAAgBC,cAAeC,mBAAoBC,iBAEvDC,EAAE,WACEA,EAAEC,UAAUC,EAAE,CAAC,QAAS,cAAe,SAAUC,CAAK,EAClD,IAAIC,EAAOJ,EAAE,IAAI,EAAEK,IAAI,CAAC,eACpBC,EAAWN,EAAE,IAAI,EAAEK,IAAI,CAAC,aACxBE,EAAkBP,EAAE,IAAI,EAAEK,IAAI,CAAC,qBAC/BG,EAAkBR,EAAE,IAAMM,GAAUD,IAAI,CAAC,kBACzCI,EAAeT,EAAE,IAAI,EAAEK,IAAI,CAAC,iBAC5BK,EAAeV,EAAE,IAAI,EAAEK,IAAI,CAAC,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AQ,CAAC,UADDvC,KAAKwC,KAAK,CAACP,EAAa,IAAM,KAI5CQ,AADepE,EAAE,IAAI,EAAEc,OAAO,CAAC,kBACtBuD,IAAI,CAAC,UAAUxB,IAAI,CAACe,EAAa,IAC9C,MAAO,GAAIH,AAAiB,cAAjBA,CAAM,CAAC,EAAE,CAACC,EAAE,EAAoBD,CAAM,CAAC,EAAE,CAACC,EAAE,CAACC,OAAO,CAAC,aAAe,EAAG,CAC9E,IAAIW,EAAMtE,EAAE,IAAI,EAAEe,IAAI,CAAC,MAAM,CAAC,EAAE,CAACwD,SAAS,CAG1CC,AADWC,AADSzE,EAAE,IAAI,EAAEc,OAAO,CAAC,kBACXuD,IAAI,CAAC,UACzBK,IAAI,CAACJ,EACd,CAEAtE,EAAE,IAAI,EAAE2E,MAAM,GAAG5D,IAAI,CAAC,kBAAkBkD,WAAW,CAAC,UACpDjE,EAAE,IAAI,EAAE4E,WAAW,CAAC,UACpB5E,EAAEC,UAAUsD,OAAO,CAAC,wBACxB,GAEAvD,EAAEC,UAAUC,EAAE,CAAC,QAAS,4BAA6B,WACjDF,EAAE,IAAI,EAAEc,OAAO,CAAC,kBAAkB8D,WAAW,CAAC,YAClD,GAEA5E,EAAEC,UAAUC,EAAE,CAAC,QAAS,6DAA8D,WAClF,IAAI2E,EAAkB7E,EAAE,IAAI,EAAEc,OAAO,CAAC,kBAAkBC,IAAI,CAAC,0DACzD+D,EAAyBD,EAAgBxE,IAAI,CAAC,6BAC9C0E,EAAQ/E,EAAE,IAAI,EAAEmB,GAAG,GAGvB0D,EAAgBhC,IAAI,CAFCkC,EAAQ,IAAMD,EAGvC,EACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js index a7f71603e63..1d09c37f2bf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js @@ -1 +1 @@ -function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r0){var r=$(this).find("input:first-child").val(),n=t.attr("class").split(" ");$.each(n,(function(e,r){0===r.indexOf("col-md-")&&t.removeClass(r)}));var i=Math.round(r/100*12);t.addClass("col-md-"+i),$(this).closest(".dropdown-menu").prev("button").text(r+"%")}else if("undefined"!==e[0].id&&e[0].id.indexOf("Alignment")>0){var a=$(this).find("svg")[0].outerHTML;$(this).closest(".dropdown-menu").prev("button").html(a)}$(this).parent().find(".dropdown-item").removeClass("active"),$(this).toggleClass("active"),$(document).trigger("contentpreview:render")})),$(document).on("click",".widget-editor-btn-toggle",(function(){$(this).closest(".widget-editor").toggleClass("collapsed")})),$(document).on("keyup",".widget-editor-body .form-group input.content-caption-text",(function(){var t=$(this).closest(".widget-editor").find(".widget-editor-header:first .widget-editor-header-text"),e=t.data("content-type-display-text"),r=$(this).val()+" "+e;t.text(r)}))})); +var widgetDragItem,lastContainer,widgetItemSourceId,widgetItemDestId;$(function(){$(document).on("click",".add-widget",function(t){var e=$(this).data("widget-type"),n=$(this).data("target-id"),i=$(this).data("html-field-prefix"),a=$("#"+n).data("buildeditorurl"),d=$(this).data("prefixes-name"),r=$(this).data("flowmetadata"),o=$(this).data("parent-content-type"),s=$(this).data("part-name"),l=$("#"+n).closest("form").find("input[name*='Prefixes']").filter(function(t,e){return $(e).val().substring(0,$(e).val().lastIndexOf("-"))===i}).map(function(t,e){return parseInt($(e).val().substring($(e).val().lastIndexOf("-")+1))||0}),c=i+"-"+(l.length?Math.max(...l)+1:0).toString(),f=$(this).data("contenttypes-name"),m=$(this).data("contentitems-name");$.ajax({url:a+"?id="+e+"&prefix="+c+"&prefixesName="+d+"&contentTypesName="+f+"&contentItemsName="+m+"&targetId="+n+"&flowmetadata="+r+"&parentContentType="+o+"&partName="+s}).done(function(t){var e=JSON.parse(t);$(document.getElementById(n)).append(e.Content),$(e.Scripts).filter("script").each(function(){$.globalEval(this.text||this.textContent||this.innerHTML||"")})})}),$(document).on("click",".insert-widget",function(t){var e=$(this).data("widget-type"),n=$(this).closest(".widget-template"),i=$(this).data("target-id"),a=$(this).data("html-field-prefix"),d=$("#"+i).data("buildeditorurl"),r=$(this).data("flowmetadata"),o=$(this).data("prefixes-name"),s=$(this).data("parent-content-type"),l=$(this).data("part-name"),c=$("#"+i).closest("form").find("input[name*='Prefixes']").filter(function(t,e){return $(e).val().substring(0,$(e).val().lastIndexOf("-"))===a}).map(function(t,e){return parseInt($(e).val().substring($(e).val().lastIndexOf("-")+1))||0}),f=a+"-"+(c.length?Math.max(...c)+1:0).toString(),m=$(this).data("contenttypes-name"),p=$(this).data("contentitems-name");$.ajax({url:d+"?id="+e+"&prefix="+f+"&prefixesName="+o+"&contentTypesName="+m+"&contentItemsName="+p+"&targetId="+i+"&flowmetadata="+r+"&parentContentType="+s+"&partName="+l}).done(function(t){var e=JSON.parse(t);$(e.Content).insertBefore(n),$(e.Scripts).filter("script").each(function(){$.globalEval(this.text||this.textContent||this.innerHTML||"")})})}),$(document).on("click",".widget-delete",function(){var t=$(this);confirmDialog({...t.data(),callback:function(e){e&&(t.closest(".widget-template").remove(),$(document).trigger("contentpreview:render"))}})}),$(document).on("change",".widget-editor-footer label, .widget-editor-header label",function(){var t=$(this).closest(".widget-template"),e=$(this).find("input:first-child");if("undefined"!==e[0].id&&e[0].id.indexOf("Size")>0){var n=$(this).find("input:first-child").val(),i=t.attr("class").split(" ");$.each(i,function(e,n){0===n.indexOf("col-md-")&&t.removeClass(n)}),t.addClass("col-md-"+Math.round(n/100*12)),$(this).closest(".dropdown-menu").prev("button").text(n+"%")}else if("undefined"!==e[0].id&&e[0].id.indexOf("Alignment")>0){var a=$(this).find("svg")[0].outerHTML;$(this).closest(".dropdown-menu").prev("button").html(a)}$(this).parent().find(".dropdown-item").removeClass("active"),$(this).toggleClass("active"),$(document).trigger("contentpreview:render")}),$(document).on("click",".widget-editor-btn-toggle",function(){$(this).closest(".widget-editor").toggleClass("collapsed")}),$(document).on("keyup",".widget-editor-body .form-group input.content-caption-text",function(){var t=$(this).closest(".widget-editor").find(".widget-editor-header:first .widget-editor-header-text"),e=t.data("content-type-display-text"),n=$(this).val();t.text(n+" "+e)})}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.css b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.css index 85702a1ac4e..0bff02cfcca 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.css +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.css @@ -80,4 +80,4 @@ [dir=rtl] .btn-widget-add-below > .btn-group { right: calc(-14px + 50%); -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.css.map b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.css.map new file mode 100644 index 00000000000..679e7a8d77f --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AACA,uFAGA,+SAeA,uJAIA,+JAGA,gMAOA,0EAKA,mKAWA,0CAIA,gFAIA,6CAGA,qFAKA,qFAMA,2DAKA,iEAIA","sources":["style.css"],"sourcesContent":["/* Flow uses common Widget CSS from Widget Module - Define any additional Flow or Bag specific CSS here*/\n.widget-editor-body > div > .edit-container div.form-group:only-of-type > label {\n display: none;\n}\n.widget-editor-body > div > .edit-container div.form-group:only-of-type > .trumbowyg-box:not(.trumbowyg-fullscreen) {\n margin-top: -12px !important;\n width: calc(100% + 33px);\n margin-left: -17px !important;\n border-top: none;\n border-right: none;\n}\n.widget-editor-body > div > .edit-container div.form-group:only-of-type > .CodeMirror {\n margin-top: -12px !important;\n width: calc(100% + 33px);\n margin-left: -17px !important;\n border-top: none;\n border-right: none;\n}\n\n.btn-widget-add-below ::-webkit-scrollbar, .btn-widget-metadata ::-webkit-scrollbar, .btn-bag-add ::-webkit-scrollbar {\n width: 4px;\n background-color: #EAEAEA;\n}\n.btn-widget-add-below ::-webkit-scrollbar-thumb, .btn-widget-metadata ::-webkit-scrollbar-thumb, .btn-bag-add ::-webkit-scrollbar-thumb {\n background-color: #495057;\n}\n.btn-widget-add-below .dropdown-menu, .btn-widget-metadata .dropdown-menu, .btn-bag-add .dropdown-menu {\n max-height: 200px;\n overflow: hidden auto;\n scrollbar-width: thin;\n scrollbar-color: #495057 #EAEAEA;\n}\n\n.widget-editor.card:focus-within {\n border-color: #007bff;\n border-style: dotted;\n}\n\n.btn-widget-metadata {\n margin: 0 auto;\n left: 0;\n top: -6px;\n position: absolute;\n visibility: collapse;\n height: 1px;\n white-space: nowrap;\n text-align: center;\n transition: 0.3s visibility;\n}\n.btn-widget-metadata > .btn-group {\n top: -20px;\n}\n\n.widget-editor-header.card-header:hover > .btn-widget-metadata {\n visibility: visible;\n}\n\n.btn-widget-add-below-wrapper {\n min-height: 5px;\n}\n.btn-widget-add-below-wrapper:hover > .btn-widget-add-below {\n border-width: 5px;\n opacity: 1;\n}\n\n.btn-widget-add-below {\n height: 1px;\n position: relative;\n opacity: 0.5;\n transition: 0.3s opacity;\n}\n.btn-widget-add-below > .btn-group {\n margin: 0 auto;\n bottom: 17px;\n}\n\n[dir=ltr] .btn-widget-add-below > .btn-group {\n left: calc(-14px + 50%);\n}\n\n[dir=rtl] .btn-widget-add-below > .btn-group {\n right: calc(-14px + 50%);\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.min.css b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.min.css index 3447b2a4666..b4918810ab6 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.min.css +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Styles/flows.edit.min.css @@ -1 +1 @@ -.widget-editor-body>div>.edit-container div.form-group:only-of-type>label{display:none}.widget-editor-body>div>.edit-container div.form-group:only-of-type>.trumbowyg-box:not(.trumbowyg-fullscreen){margin-top:-12px!important;width:calc(100% + 33px);margin-left:-17px!important;border-top:none;border-right:none}.widget-editor-body>div>.edit-container div.form-group:only-of-type>.CodeMirror{margin-top:-12px!important;width:calc(100% + 33px);margin-left:-17px!important;border-top:none;border-right:none}.btn-bag-add ::-webkit-scrollbar,.btn-widget-add-below ::-webkit-scrollbar,.btn-widget-metadata ::-webkit-scrollbar{width:4px;background-color:#eaeaea}.btn-bag-add ::-webkit-scrollbar-thumb,.btn-widget-add-below ::-webkit-scrollbar-thumb,.btn-widget-metadata ::-webkit-scrollbar-thumb{background-color:#495057}.btn-bag-add .dropdown-menu,.btn-widget-add-below .dropdown-menu,.btn-widget-metadata .dropdown-menu{max-height:200px;overflow:hidden auto;scrollbar-width:thin;scrollbar-color:#495057 #eaeaea}.widget-editor.card:focus-within{border-color:#007bff;border-style:dotted}.btn-widget-metadata{margin:0 auto;left:0;top:-6px;position:absolute;visibility:collapse;height:1px;white-space:nowrap;text-align:center;transition:.3s visibility}.btn-widget-metadata>.btn-group{top:-20px}.widget-editor-header.card-header:hover>.btn-widget-metadata{visibility:visible}.btn-widget-add-below-wrapper{min-height:5px}.btn-widget-add-below-wrapper:hover>.btn-widget-add-below{border-width:5px;opacity:1}.btn-widget-add-below{height:1px;position:relative;opacity:.5;transition:.3s opacity}.btn-widget-add-below>.btn-group{margin:0 auto;bottom:17px}[dir=ltr] .btn-widget-add-below>.btn-group{left:calc(-14px + 50%)}[dir=rtl] .btn-widget-add-below>.btn-group{right:calc(-14px + 50%)} +.widget-editor-body>div>.edit-container div.form-group:only-of-type>label{display:none}.widget-editor-body>div>.edit-container div.form-group:only-of-type>.trumbowyg-box:not(.trumbowyg-fullscreen),.widget-editor-body>div>.edit-container div.form-group:only-of-type>.CodeMirror{border-top:none;border-right:none;width:calc(100% + 33px);margin-top:-12px!important;margin-left:-17px!important}.btn-widget-add-below ::-webkit-scrollbar,.btn-widget-metadata ::-webkit-scrollbar,.btn-bag-add ::-webkit-scrollbar{background-color:#eaeaea;width:4px}.btn-widget-add-below ::-webkit-scrollbar-thumb,.btn-widget-metadata ::-webkit-scrollbar-thumb,.btn-bag-add ::-webkit-scrollbar-thumb{background-color:#495057}.btn-widget-add-below .dropdown-menu,.btn-widget-metadata .dropdown-menu,.btn-bag-add .dropdown-menu{scrollbar-width:thin;scrollbar-color:#495057 #eaeaea;max-height:200px;overflow:hidden auto}.widget-editor.card:focus-within{border-style:dotted;border-color:#007bff}.btn-widget-metadata{visibility:collapse;white-space:nowrap;text-align:center;height:1px;margin:0 auto;transition:visibility .3s;position:absolute;top:-6px;left:0}.btn-widget-metadata>.btn-group{top:-20px}.widget-editor-header.card-header:hover>.btn-widget-metadata{visibility:visible}.btn-widget-add-below-wrapper{min-height:5px}.btn-widget-add-below-wrapper:hover>.btn-widget-add-below{opacity:1;border-width:5px}.btn-widget-add-below{opacity:.5;height:1px;transition:opacity .3s;position:relative}.btn-widget-add-below>.btn-group{margin:0 auto;bottom:17px}[dir=ltr] .btn-widget-add-below>.btn-group{left:calc(50% - 14px)}[dir=rtl] .btn-widget-add-below>.btn-group{right:calc(50% - 14px)} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Assets.json b/src/OrchardCore.Modules/OrchardCore.Forms/Assets.json deleted file mode 100644 index e6508cfeb35..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Forms/Assets.json +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "inputs": [ - "Assets/scss/SelectOptionsEditor/selectOptionsEditor.scss" - ], - "output": "wwwroot/Styles/selectOptionsEditor.css" - }, - { - "inputs": [ - "Assets/js/SelectOptionsEditor/selectOptionsEditor.js" - ], - "output": "wwwroot/Scripts/selectOptionsEditor.js" - }, - { - "inputs": [ - "Assets/js/formElementLabelManager.js" - ], - "output": "wwwroot/Scripts/formElementLabelManager.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Forms/Assets2.json new file mode 100644 index 00000000000..0a98998942f --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Forms/Assets2.json @@ -0,0 +1,22 @@ +[ + { + "action": "min", + "name": "selectOptionsEditor", + "source": "Assets/js/SelectOptionsEditor/selectOptionsEditor.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "min", + "name": "formElementLabelManager", + "source": "Assets/js/formElementLabelManager.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "sass", + "name": "SelectOptionsEditor", + "source": "Assets/scss/SelectOptionsEditor/selectOptionsEditor.scss", + "tags": ["admin", "dashboard", "scss"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.js b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.js index f64d8aa8e06..41a36fbadb7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.js +++ b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.js @@ -1,28 +1,27 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - formElementLabelManager = function () { - var initilize = function initilize(wrapper) { - var selectMenus = wrapper.getElementsByClassName('field-label-option-select-menu'); - for (var i = 0; i < selectMenus.length; i++) { - var selectMenu = selectMenus[i]; - selectMenu.addEventListener('change', function (e) { - var labelTextContainer = wrapper.querySelector('.label-text-container'); - if (e.target.value == 'None') { - labelTextContainer.classList.add('d-none'); - } else { - labelTextContainer.classList.remove('d-none'); + const initilize = (wrapper) => { + var selectMenus = wrapper.getElementsByClassName('field-label-option-select-menu'); + + for (let i = 0; i < selectMenus.length; i++) { + var selectMenu = selectMenus[i]; + selectMenu.addEventListener('change', function (e) { + var labelTextContainer = wrapper.querySelector('.label-text-container'); + + if (e.target.value == 'None') { + labelTextContainer.classList.add('d-none'); + } else { + labelTextContainer.classList.remove('d-none'); + } + }); + selectMenu.dispatchEvent(new Event('change')); } - }); - selectMenu.dispatchEvent(new Event('change')); - } - }; - return { - initilize: initilize - }; + }; + + return { + initilize: initilize + }; }(); + document.addEventListener('DOMContentLoaded', function () { - formElementLabelManager.initilize(document); -}); \ No newline at end of file + formElementLabelManager.initilize(document); +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.map b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.map new file mode 100644 index 00000000000..65253e6b0c6 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["formElementLabelManager = function () {\r\n const initilize = (wrapper) => {\r\n var selectMenus = wrapper.getElementsByClassName('field-label-option-select-menu');\r\n\r\n for (let i = 0; i < selectMenus.length; i++) {\r\n var selectMenu = selectMenus[i];\r\n selectMenu.addEventListener('change', function (e) {\r\n var labelTextContainer = wrapper.querySelector('.label-text-container');\r\n\r\n if (e.target.value == 'None') {\r\n labelTextContainer.classList.add('d-none');\r\n } else {\r\n labelTextContainer.classList.remove('d-none');\r\n }\r\n });\r\n selectMenu.dispatchEvent(new Event('change'));\r\n }\r\n };\r\n\r\n return {\r\n initilize: initilize\r\n };\r\n}();\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n formElementLabelManager.initilize(document);\r\n});\r\n"],"names":["formElementLabelManager","initilize","wrapper","selectMenus","getElementsByClassName","i","length","selectMenu","addEventListener","e","labelTextContainer","querySelector","target","value","classList","add","remove","dispatchEvent","Event","document"],"mappings":"AAAAA,wBAmBW,CACHC,UAnBc,AAACC,IACf,IAAIC,EAAcD,EAAQE,sBAAsB,CAAC,kCAEjD,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAYG,MAAM,CAAED,IAAK,CACzC,IAAIE,EAAaJ,CAAW,CAACE,EAAE,CAC/BE,EAAWC,gBAAgB,CAAC,SAAU,SAAUC,CAAC,EAC7C,IAAIC,EAAqBR,EAAQS,aAAa,CAAC,wBAE3CF,AAAkB,CAAA,QAAlBA,EAAEG,MAAM,CAACC,KAAK,CACdH,EAAmBI,SAAS,CAACC,GAAG,CAAC,UAEjCL,EAAmBI,SAAS,CAACE,MAAM,CAAC,SAE5C,GACAT,EAAWU,aAAa,CAAC,IAAIC,MAAM,UACvC,CACJ,CAIA,EAGJC,SAASX,gBAAgB,CAAC,mBAAoB,WAC1CR,wBAAwBC,SAAS,CAACkB,SACtC"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.min.js b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.min.js index 0ed3bbe9ae9..4844941b2c8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/formElementLabelManager.min.js @@ -1 +1 @@ -formElementLabelManager={initilize:function(e){for(var n=e.getElementsByClassName("field-label-option-select-menu"),t=0;t{var n=e.getElementsByClassName("field-label-option-select-menu");for(let a=0;a { + var keyId = 1; + //Add Key ID + optionsData = optionsData.map((x) => { + x.key = keyId; + keyId++; + return x; + }); + + var selectOptionsRow = { + name: "select-options-row", + template: "#select-options-row", + props: ["option", "defaultValue"], + data: function () { + return { + partId: elemId, + }; + }, + methods: { + remove: function () { + this.$emit("remove-option", this.option); + }, + }, + computed: { + IsSelected: { + get: function () { + if (!IsNullOrWhiteSpace(this.option.value)) { + return this.option.value == this.defaultValue; + } else { + return this.option.text == this.defaultValue; + } + }, + set: function (val) { + if (val) { + this.$emit("set-default", this.option); + } else { + this.$emit("set-default", null); + } + }, + }, + optionValue: { + get: function () { + return this.option.value; + }, + set: function (val) { + var isSelected = this.IsSelected; + this.option.value = val; + if (isSelected) { + this.$emit("set-default", this.option); + } else { + this.$emit("reorder-option"); + } + }, + }, + + optionText: { + get: function () { + return this.option.text; + }, + set: function (val) { + var isSelected = this.IsSelected; + this.option.text = val; + if (isSelected) { + this.$emit("set-default", this.option); + } else { + this.$emit("reorder-option"); + } + }, + }, + + optionCheck: { + get: function () { + if (IsNullOrWhiteSpace(this.option.value)) { + return this.option.text; + } else { + return this.option.value; + } + }, + }, + }, }; - }, - methods: { - remove: function remove() { - this.$emit("remove-option", this.option); - } - }, - computed: { - IsSelected: { - get: function get() { - if (!IsNullOrWhiteSpace(this.option.value)) { - return this.option.value == this.defaultValue; - } else { - return this.option.text == this.defaultValue; - } - }, - set: function set(val) { - if (val) { - this.$emit("set-default", this.option); - } else { - this.$emit("set-default", null); - } - } - }, - optionValue: { - get: function get() { - return this.option.value; - }, - set: function set(val) { - var isSelected = this.IsSelected; - this.option.value = val; - if (isSelected) { - this.$emit("set-default", this.option); - } else { - this.$emit("reorder-option"); - } - } - }, - optionText: { - get: function get() { - return this.option.text; - }, - set: function set(val) { - var isSelected = this.IsSelected; - this.option.text = val; - if (isSelected) { - this.$emit("set-default", this.option); - } else { - this.$emit("reorder-option"); - } - } - }, - optionCheck: { - get: function get() { - if (IsNullOrWhiteSpace(this.option.value)) { - return this.option.text; - } else { - return this.option.value; - } - } - } - } - }; - var selectOptionsTable = { - name: "select-options-table", - components: { - selectOptionsRow: selectOptionsRow - }, - template: "#select-options-table", - props: ["data"], - data: function data() { - return { - partId: elemId + + var selectOptionsTable = { + name: "select-options-table", + components: { + selectOptionsRow: selectOptionsRow, + }, + template: "#select-options-table", + props: ["data"], + data: function () { + return { + partId: elemId, + }; + }, + methods: { + add: function () { + this.$emit("add-option"); + }, + onDragEnd: function () { + this.$emit("reorder-option"); + }, + }, }; - }, - methods: { - add: function add() { - this.$emit("add-option"); - }, - onDragEnd: function onDragEnd() { - this.$emit("reorder-option"); - } - } - }; - var selectOptionsModal = { - name: "select-options-modal", - template: "#select-options-modal", - props: ["data", "showModal", "validOptions"], - data: function data() { - return { - optionsFormattedList: "[]", - partId: elemId, - defaultValue: "", - isValid: false, - jsonOptions: [] + + var selectOptionsModal = { + name: "select-options-modal", + template: "#select-options-modal", + props: ["data", "showModal", "validOptions"], + data: function () { + return { + optionsFormattedList: "[]", + partId: elemId, + defaultValue: "", + isValid: false, + jsonOptions: [], + }; + }, + methods: { + closeModal: function (save) { + if (save) { + this.$emit("modal-save", { + options: this.jsonOptions, + defaultValue: this.defaultValue, + }); + } else { + this.$emit("modal-cancel"); + } + }, + showStart: function (params) { + this.$refs.modal.classList.toggle('d-block'); + this.$refs.backdrop.classList.toggle('d-block'); + }, + showEnd: function (params) { + this.$refs.modal.classList.toggle('show'); + this.$refs.backdrop.classList.toggle('show'); + } + }, + watch: { + showModal: function (newval) { + if (newval) { + + this.optionsFormattedList = JSON.stringify( + this.validOptions, + null, + 2 + ); + this.defaultValue = this.data.defaultValue; + } else { + this.optionsFormattedList = "[]"; + this.defaultValue = ""; + } + }, + optionsFormattedList: function (newval) { + try { + var parsed = JSON.parse(newval); + if (!!newval && parsed instanceof Array) { + this.jsonOptions = parsed; + this.isValid = true; + } else { + this.isValid = false; + } + } catch (e) { + this.isValid = false; + } + }, + }, }; - }, - methods: { - closeModal: function closeModal(save) { - if (save) { - this.$emit("modal-save", { - options: this.jsonOptions, - defaultValue: this.defaultValue - }); - } else { - this.$emit("modal-cancel"); - } - }, - showStart: function showStart(params) { - this.$refs.modal.classList.toggle('d-block'); - this.$refs.backdrop.classList.toggle('d-block'); - }, - showEnd: function showEnd(params) { - this.$refs.modal.classList.toggle('show'); - this.$refs.backdrop.classList.toggle('show'); - } - }, - watch: { - showModal: function showModal(newval) { - if (newval) { - this.optionsFormattedList = JSON.stringify(this.validOptions, null, 2); - this.defaultValue = this.data.defaultValue; - } else { - this.optionsFormattedList = "[]"; - this.defaultValue = ""; - } - }, - optionsFormattedList: function optionsFormattedList(newval) { - try { - var parsed = JSON.parse(newval); - if (!!newval && parsed instanceof Array) { - this.jsonOptions = parsed; - this.isValid = true; - } else { - this.isValid = false; - } - } catch (e) { - this.isValid = false; - } + + new Vue({ + components: { + selectOptionsTable: selectOptionsTable, + selectOptionsModal: selectOptionsModal, + }, + data: function () { + return { + state: { + options: optionsData, + defaultValue: defaultValue, + partId: elemId, + }, + debounceTimeout: null, + showModal: false, + }; + }, + el: "#" + elemId, + methods: { + cancelChanges: function () { + this.showModal = false; + }, + updateChanges: function (changes) { + this.state.options = changes.options + .filter(function (y) { + return !IsNullOrWhiteSpace(y.text); + }) + .map(function (x) { + x.key = keyId++; + return x; + }); + this.state.defaultValue = changes.defaultValue; + this.showModal = false; + this.debouncePreview(); + }, + setDefaultValue: function (opt) { + if (opt == null) { + this.state.defaultValue = ""; + } else { + if (!IsNullOrWhiteSpace(opt.value)) { + this.state.defaultValue = opt.value; + } else { + this.state.defaultValue = opt.text; + } + } + this.debouncePreview(); + }, + addOption: function () { + this.state.options.push({ + text: "", + value: "", + key: keyId++, + }); + this.debouncePreview(); + }, + removeOption: function (opt) { + var index = this.state.options.findIndex(function (c) { + return c.key == opt.key; + }); + if (index > -1) { + this.state.options.splice(index, 1); + this.debouncePreview(); + } + }, + reorderOption: function (evt) { + this.debouncePreview(); + }, + debouncePreview: function (params) { + if (this.debounceTimeout) clearTimeout(this.debounceTimeout); + this.debounceTimeout = setTimeout(() => { + const previewEvent = new Event("contentpreview:render"); + document.dispatchEvent(previewEvent); + }, 500); + }, + }, + computed: { + stringify: function () { + return JSON.stringify(this.validOptions); + }, + validOptions: function () { + return this.state.options + .map(function (x) { + return { + text: x.text, + value: x.value, + }; + }) + .filter(function (x) { + return !IsNullOrWhiteSpace(x.text); + }); + }, + }, + }); + + function IsNullOrWhiteSpace(str) { + return str == null || str.match(/^ *$/) !== null; } - } }; - new Vue({ - components: { - selectOptionsTable: selectOptionsTable, - selectOptionsModal: selectOptionsModal - }, - data: function data() { - return { - state: { - options: optionsData, - defaultValue: defaultValue, - partId: elemId - }, - debounceTimeout: null, - showModal: false - }; - }, - el: "#" + elemId, - methods: { - cancelChanges: function cancelChanges() { - this.showModal = false; - }, - updateChanges: function updateChanges(changes) { - this.state.options = changes.options.filter(function (y) { - return !IsNullOrWhiteSpace(y.text); - }).map(function (x) { - x.key = keyId++; - return x; - }); - this.state.defaultValue = changes.defaultValue; - this.showModal = false; - this.debouncePreview(); - }, - setDefaultValue: function setDefaultValue(opt) { - if (opt == null) { - this.state.defaultValue = ""; - } else { - if (!IsNullOrWhiteSpace(opt.value)) { - this.state.defaultValue = opt.value; - } else { - this.state.defaultValue = opt.text; - } - } - this.debouncePreview(); - }, - addOption: function addOption() { - this.state.options.push({ - text: "", - value: "", - key: keyId++ - }); - this.debouncePreview(); - }, - removeOption: function removeOption(opt) { - var index = this.state.options.findIndex(function (c) { - return c.key == opt.key; - }); - if (index > -1) { - this.state.options.splice(index, 1); - this.debouncePreview(); - } - }, - reorderOption: function reorderOption(evt) { - this.debouncePreview(); - }, - debouncePreview: function debouncePreview(params) { - if (this.debounceTimeout) clearTimeout(this.debounceTimeout); - this.debounceTimeout = setTimeout(function () { - var previewEvent = new Event("contentpreview:render"); - document.dispatchEvent(previewEvent); - }, 500); - } - }, - computed: { - stringify: function stringify() { - return JSON.stringify(this.validOptions); - }, - validOptions: function validOptions() { - return this.state.options.map(function (x) { - return { - text: x.text, - value: x.value - }; - }).filter(function (x) { - return !IsNullOrWhiteSpace(x.text); - }); + + const initilizeElement = (id, options, value) => { + var wrapper = document.getElementById(id); + + if (wrapper != null) { + initilize(id, options, value); } - } - }); - function IsNullOrWhiteSpace(str) { - return str == null || str.match(/^ *$/) !== null; - } - }; - var initilizeElement = function initilizeElement(id, options, value) { - var wrapper = document.getElementById(id); - if (wrapper != null) { - initilize(id, options, value); } - }; - var initilizeFieldType = function initilizeFieldType(wrapper) { - var selectMenus = wrapper.getElementsByClassName('field-type-select-menu'); - for (var i = 0; i < selectMenus.length; i++) { - var selectMenu = selectMenus[i]; - selectMenu.addEventListener('change', function (e) { - var visibleForInputContainers = wrapper.getElementsByClassName('show-for-input'); - for (var _i = 0; _i < visibleForInputContainers.length; _i++) { - var container = visibleForInputContainers[_i]; - if (e.target.value == 'reset' || e.target.value == 'submit' || e.target.value == 'hidden') { - container.classList.add('d-none'); - } else { - container.classList.remove('d-none'); - } + + const initilizeFieldType = (wrapper) => { + var selectMenus = wrapper.getElementsByClassName('field-type-select-menu'); + for (let i = 0; i < selectMenus.length; i++) { + var selectMenu = selectMenus[i]; + selectMenu.addEventListener('change', function (e) { + var visibleForInputContainers = wrapper.getElementsByClassName('show-for-input'); + + for (let i = 0; i < visibleForInputContainers.length; i++) { + var container = visibleForInputContainers[i]; + if (e.target.value == 'reset' || e.target.value == 'submit' || e.target.value == 'hidden') { + container.classList.add('d-none'); + } else { + container.classList.remove('d-none'); + } + } + }); + selectMenu.dispatchEvent(new Event('change')); } - }); - selectMenu.dispatchEvent(new Event('change')); - } - }; - return { - initilizeElement: initilizeElement, - initilizeFieldType: initilizeFieldType - }; + }; + + return { + initilizeElement: initilizeElement, + initilizeFieldType: initilizeFieldType + }; }(); + document.addEventListener('DOMContentLoaded', function () { - var wrappers = document.getElementsByName('select-part-properties-wrapper'); - for (var i = 0; i < wrappers.length; i++) { - var wrapper = wrappers[i]; - var fieldWrapper = wrapper.querySelector('.field-options-wrapper'); - if (fieldWrapper != null) { - var initialDefaultValue = fieldWrapper.querySelector('.field-options-wrapper-initial-default-value'); - var initialOptions = fieldWrapper.querySelector('.field-options-wrapper-initial-options'); - selectOptionsEditor.initilizeElement(fieldWrapper.Id, initialOptions.innerHTML, initialDefaultValue.value); + var wrappers = document.getElementsByName('select-part-properties-wrapper'); + + for (let i = 0; i < wrappers.length; i++) { + var wrapper = wrappers[i]; + + var fieldWrapper = wrapper.querySelector('.field-options-wrapper'); + + if (fieldWrapper != null) { + var initialDefaultValue = fieldWrapper.querySelector('.field-options-wrapper-initial-default-value'); + var initialOptions = fieldWrapper.querySelector('.field-options-wrapper-initial-options'); + + selectOptionsEditor.initilizeElement(fieldWrapper.Id, initialOptions.innerHTML, initialDefaultValue.value) + } } - } - selectOptionsEditor.initilizeFieldType(document); -}); \ No newline at end of file + + selectOptionsEditor.initilizeFieldType(document); +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.map b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.map new file mode 100644 index 00000000000..5b1f6003441 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["selectOptionsEditor = function () {\r\n\r\n const initilize = (elemId, optionsData, defaultValue) => {\r\n var keyId = 1;\r\n //Add Key ID\r\n optionsData = optionsData.map((x) => {\r\n x.key = keyId;\r\n keyId++;\r\n return x;\r\n });\r\n\r\n var selectOptionsRow = {\r\n name: \"select-options-row\",\r\n template: \"#select-options-row\",\r\n props: [\"option\", \"defaultValue\"],\r\n data: function () {\r\n return {\r\n partId: elemId,\r\n };\r\n },\r\n methods: {\r\n remove: function () {\r\n this.$emit(\"remove-option\", this.option);\r\n },\r\n },\r\n computed: {\r\n IsSelected: {\r\n get: function () {\r\n if (!IsNullOrWhiteSpace(this.option.value)) {\r\n return this.option.value == this.defaultValue;\r\n } else {\r\n return this.option.text == this.defaultValue;\r\n }\r\n },\r\n set: function (val) {\r\n if (val) {\r\n this.$emit(\"set-default\", this.option);\r\n } else {\r\n this.$emit(\"set-default\", null);\r\n }\r\n },\r\n },\r\n optionValue: {\r\n get: function () {\r\n return this.option.value;\r\n },\r\n set: function (val) {\r\n var isSelected = this.IsSelected;\r\n this.option.value = val;\r\n if (isSelected) {\r\n this.$emit(\"set-default\", this.option);\r\n } else {\r\n this.$emit(\"reorder-option\");\r\n }\r\n },\r\n },\r\n\r\n optionText: {\r\n get: function () {\r\n return this.option.text;\r\n },\r\n set: function (val) {\r\n var isSelected = this.IsSelected;\r\n this.option.text = val;\r\n if (isSelected) {\r\n this.$emit(\"set-default\", this.option);\r\n } else {\r\n this.$emit(\"reorder-option\");\r\n }\r\n },\r\n },\r\n\r\n optionCheck: {\r\n get: function () {\r\n if (IsNullOrWhiteSpace(this.option.value)) {\r\n return this.option.text;\r\n } else {\r\n return this.option.value;\r\n }\r\n },\r\n },\r\n },\r\n };\r\n\r\n var selectOptionsTable = {\r\n name: \"select-options-table\",\r\n components: {\r\n selectOptionsRow: selectOptionsRow,\r\n },\r\n template: \"#select-options-table\",\r\n props: [\"data\"],\r\n data: function () {\r\n return {\r\n partId: elemId,\r\n };\r\n },\r\n methods: {\r\n add: function () {\r\n this.$emit(\"add-option\");\r\n },\r\n onDragEnd: function () {\r\n this.$emit(\"reorder-option\");\r\n },\r\n },\r\n };\r\n\r\n var selectOptionsModal = {\r\n name: \"select-options-modal\",\r\n template: \"#select-options-modal\",\r\n props: [\"data\", \"showModal\", \"validOptions\"],\r\n data: function () {\r\n return {\r\n optionsFormattedList: \"[]\",\r\n partId: elemId,\r\n defaultValue: \"\",\r\n isValid: false,\r\n jsonOptions: [],\r\n };\r\n },\r\n methods: {\r\n closeModal: function (save) {\r\n if (save) {\r\n this.$emit(\"modal-save\", {\r\n options: this.jsonOptions,\r\n defaultValue: this.defaultValue,\r\n });\r\n } else {\r\n this.$emit(\"modal-cancel\");\r\n }\r\n },\r\n showStart: function (params) {\r\n this.$refs.modal.classList.toggle('d-block');\r\n this.$refs.backdrop.classList.toggle('d-block');\r\n },\r\n showEnd: function (params) {\r\n this.$refs.modal.classList.toggle('show');\r\n this.$refs.backdrop.classList.toggle('show');\r\n }\r\n },\r\n watch: {\r\n showModal: function (newval) {\r\n if (newval) {\r\n\r\n this.optionsFormattedList = JSON.stringify(\r\n this.validOptions,\r\n null,\r\n 2\r\n );\r\n this.defaultValue = this.data.defaultValue;\r\n } else {\r\n this.optionsFormattedList = \"[]\";\r\n this.defaultValue = \"\";\r\n }\r\n },\r\n optionsFormattedList: function (newval) {\r\n try {\r\n var parsed = JSON.parse(newval);\r\n if (!!newval && parsed instanceof Array) {\r\n this.jsonOptions = parsed;\r\n this.isValid = true;\r\n } else {\r\n this.isValid = false;\r\n }\r\n } catch (e) {\r\n this.isValid = false;\r\n }\r\n },\r\n },\r\n };\r\n\r\n new Vue({\r\n components: {\r\n selectOptionsTable: selectOptionsTable,\r\n selectOptionsModal: selectOptionsModal,\r\n },\r\n data: function () {\r\n return {\r\n state: {\r\n options: optionsData,\r\n defaultValue: defaultValue,\r\n partId: elemId,\r\n },\r\n debounceTimeout: null,\r\n showModal: false,\r\n };\r\n },\r\n el: \"#\" + elemId,\r\n methods: {\r\n cancelChanges: function () {\r\n this.showModal = false;\r\n },\r\n updateChanges: function (changes) {\r\n this.state.options = changes.options\r\n .filter(function (y) {\r\n return !IsNullOrWhiteSpace(y.text);\r\n })\r\n .map(function (x) {\r\n x.key = keyId++;\r\n return x;\r\n });\r\n this.state.defaultValue = changes.defaultValue;\r\n this.showModal = false;\r\n this.debouncePreview();\r\n },\r\n setDefaultValue: function (opt) {\r\n if (opt == null) {\r\n this.state.defaultValue = \"\";\r\n } else {\r\n if (!IsNullOrWhiteSpace(opt.value)) {\r\n this.state.defaultValue = opt.value;\r\n } else {\r\n this.state.defaultValue = opt.text;\r\n }\r\n }\r\n this.debouncePreview();\r\n },\r\n addOption: function () {\r\n this.state.options.push({\r\n text: \"\",\r\n value: \"\",\r\n key: keyId++,\r\n });\r\n this.debouncePreview();\r\n },\r\n removeOption: function (opt) {\r\n var index = this.state.options.findIndex(function (c) {\r\n return c.key == opt.key;\r\n });\r\n if (index > -1) {\r\n this.state.options.splice(index, 1);\r\n this.debouncePreview();\r\n }\r\n },\r\n reorderOption: function (evt) {\r\n this.debouncePreview();\r\n },\r\n debouncePreview: function (params) {\r\n if (this.debounceTimeout) clearTimeout(this.debounceTimeout);\r\n this.debounceTimeout = setTimeout(() => {\r\n const previewEvent = new Event(\"contentpreview:render\");\r\n document.dispatchEvent(previewEvent);\r\n }, 500);\r\n },\r\n },\r\n computed: {\r\n stringify: function () {\r\n return JSON.stringify(this.validOptions);\r\n },\r\n validOptions: function () {\r\n return this.state.options\r\n .map(function (x) {\r\n return {\r\n text: x.text,\r\n value: x.value,\r\n };\r\n })\r\n .filter(function (x) {\r\n return !IsNullOrWhiteSpace(x.text);\r\n });\r\n },\r\n },\r\n });\r\n\r\n function IsNullOrWhiteSpace(str) {\r\n return str == null || str.match(/^ *$/) !== null;\r\n }\r\n };\r\n\r\n const initilizeElement = (id, options, value) => {\r\n var wrapper = document.getElementById(id);\r\n\r\n if (wrapper != null) {\r\n initilize(id, options, value);\r\n }\r\n }\r\n\r\n const initilizeFieldType = (wrapper) => {\r\n var selectMenus = wrapper.getElementsByClassName('field-type-select-menu');\r\n for (let i = 0; i < selectMenus.length; i++) {\r\n var selectMenu = selectMenus[i];\r\n selectMenu.addEventListener('change', function (e) {\r\n var visibleForInputContainers = wrapper.getElementsByClassName('show-for-input');\r\n\r\n for (let i = 0; i < visibleForInputContainers.length; i++) {\r\n var container = visibleForInputContainers[i];\r\n if (e.target.value == 'reset' || e.target.value == 'submit' || e.target.value == 'hidden') {\r\n container.classList.add('d-none');\r\n } else {\r\n container.classList.remove('d-none');\r\n }\r\n }\r\n });\r\n selectMenu.dispatchEvent(new Event('change'));\r\n }\r\n };\r\n\r\n return {\r\n initilizeElement: initilizeElement,\r\n initilizeFieldType: initilizeFieldType\r\n };\r\n}();\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n var wrappers = document.getElementsByName('select-part-properties-wrapper');\r\n\r\n for (let i = 0; i < wrappers.length; i++) {\r\n var wrapper = wrappers[i];\r\n\r\n var fieldWrapper = wrapper.querySelector('.field-options-wrapper');\r\n\r\n if (fieldWrapper != null) {\r\n var initialDefaultValue = fieldWrapper.querySelector('.field-options-wrapper-initial-default-value');\r\n var initialOptions = fieldWrapper.querySelector('.field-options-wrapper-initial-options');\r\n\r\n selectOptionsEditor.initilizeElement(fieldWrapper.Id, initialOptions.innerHTML, initialDefaultValue.value)\r\n }\r\n }\r\n\r\n selectOptionsEditor.initilizeFieldType(document);\r\n});\r\n"],"names":["selectOptionsEditor","initilize","elemId","optionsData","defaultValue","keyId","IsNullOrWhiteSpace","str","match","map","x","key","Vue","components","selectOptionsTable","name","selectOptionsRow","template","props","data","partId","methods","remove","$emit","option","computed","IsSelected","get","value","text","set","val","optionValue","isSelected","optionText","optionCheck","add","onDragEnd","selectOptionsModal","optionsFormattedList","isValid","jsonOptions","closeModal","save","options","showStart","params","$refs","modal","classList","toggle","backdrop","showEnd","watch","showModal","newval","JSON","stringify","validOptions","parsed","parse","Array","e","state","debounceTimeout","el","cancelChanges","updateChanges","changes","filter","y","debouncePreview","setDefaultValue","opt","addOption","push","removeOption","index","findIndex","c","splice","reorderOption","evt","clearTimeout","setTimeout","previewEvent","Event","document","dispatchEvent","initilizeElement","id","getElementById","initilizeFieldType","wrapper","selectMenus","getElementsByClassName","i","length","selectMenu","addEventListener","visibleForInputContainers","container","target","wrappers","getElementsByName","fieldWrapper","querySelector","initialDefaultValue","initialOptions","Id","innerHTML"],"mappings":"AAAAA,oBAAsB,WAElB,IAAMC,EAAY,CAACC,EAAQC,EAAaC,KACpC,IAAIC,EAAQ,EAoQZ,SAAS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,EAAaC,aAAa,CAAC,0CAEhD1G,oBAAoByF,gBAAgB,CAACgB,EAAaI,EAAE,CAAED,EAAeE,SAAS,CAAEH,EAAoB/E,KAAK,CAC7G,CACJ,CAEA5B,oBAAoB4F,kBAAkB,CAACL,SAC3C"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.min.js b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.min.js index dbac380bc3c..635e533cae7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Forms/wwwroot/Scripts/selectOptionsEditor.min.js @@ -1 +1 @@ -selectOptionsEditor={initilizeElement:function(t,e,i){null!=document.getElementById(t)&&function(t,e,i){var n=1;function o(t){return null==t||null!==t.match(/^ *$/)}e=e.map((function(t){return t.key=n,n++,t})),new Vue({components:{selectOptionsTable:{name:"select-options-table",components:{selectOptionsRow:{name:"select-options-row",template:"#select-options-row",props:["option","defaultValue"],data:function(){return{partId:t}},methods:{remove:function(){this.$emit("remove-option",this.option)}},computed:{IsSelected:{get:function(){return o(this.option.value)?this.option.text==this.defaultValue:this.option.value==this.defaultValue},set:function(t){t?this.$emit("set-default",this.option):this.$emit("set-default",null)}},optionValue:{get:function(){return this.option.value},set:function(t){var e=this.IsSelected;this.option.value=t,e?this.$emit("set-default",this.option):this.$emit("reorder-option")}},optionText:{get:function(){return this.option.text},set:function(t){var e=this.IsSelected;this.option.text=t,e?this.$emit("set-default",this.option):this.$emit("reorder-option")}},optionCheck:{get:function(){return o(this.option.value)?this.option.text:this.option.value}}}}},template:"#select-options-table",props:["data"],data:function(){return{partId:t}},methods:{add:function(){this.$emit("add-option")},onDragEnd:function(){this.$emit("reorder-option")}}},selectOptionsModal:{name:"select-options-modal",template:"#select-options-modal",props:["data","showModal","validOptions"],data:function(){return{optionsFormattedList:"[]",partId:t,defaultValue:"",isValid:!1,jsonOptions:[]}},methods:{closeModal:function(t){t?this.$emit("modal-save",{options:this.jsonOptions,defaultValue:this.defaultValue}):this.$emit("modal-cancel")},showStart:function(t){this.$refs.modal.classList.toggle("d-block"),this.$refs.backdrop.classList.toggle("d-block")},showEnd:function(t){this.$refs.modal.classList.toggle("show"),this.$refs.backdrop.classList.toggle("show")}},watch:{showModal:function(t){t?(this.optionsFormattedList=JSON.stringify(this.validOptions,null,2),this.defaultValue=this.data.defaultValue):(this.optionsFormattedList="[]",this.defaultValue="")},optionsFormattedList:function(t){try{var e=JSON.parse(t);t&&e instanceof Array?(this.jsonOptions=e,this.isValid=!0):this.isValid=!1}catch(t){this.isValid=!1}}}}},data:function(){return{state:{options:e,defaultValue:i,partId:t},debounceTimeout:null,showModal:!1}},el:"#"+t,methods:{cancelChanges:function(){this.showModal=!1},updateChanges:function(t){this.state.options=t.options.filter((function(t){return!o(t.text)})).map((function(t){return t.key=n++,t})),this.state.defaultValue=t.defaultValue,this.showModal=!1,this.debouncePreview()},setDefaultValue:function(t){null==t?this.state.defaultValue="":o(t.value)?this.state.defaultValue=t.text:this.state.defaultValue=t.value,this.debouncePreview()},addOption:function(){this.state.options.push({text:"",value:"",key:n++}),this.debouncePreview()},removeOption:function(t){var e=this.state.options.findIndex((function(e){return e.key==t.key}));e>-1&&(this.state.options.splice(e,1),this.debouncePreview())},reorderOption:function(t){this.debouncePreview()},debouncePreview:function(t){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout((function(){var t=new Event("contentpreview:render");document.dispatchEvent(t)}),500)}},computed:{stringify:function(){return JSON.stringify(this.validOptions)},validOptions:function(){return this.state.options.map((function(t){return{text:t.text,value:t.value}})).filter((function(t){return!o(t.text)}))}}})}(t,e,i)},initilizeFieldType:function(t){for(var e=t.getElementsByClassName("field-type-select-menu"),i=0;i{var o=1;function n(t){return null==t||null!==t.match(/^ *$/)}e=e.map(t=>(t.key=o,o++,t)),new Vue({components:{selectOptionsTable:{name:"select-options-table",components:{selectOptionsRow:{name:"select-options-row",template:"#select-options-row",props:["option","defaultValue"],data:function(){return{partId:t}},methods:{remove:function(){this.$emit("remove-option",this.option)}},computed:{IsSelected:{get:function(){return n(this.option.value)?this.option.text==this.defaultValue:this.option.value==this.defaultValue},set:function(t){t?this.$emit("set-default",this.option):this.$emit("set-default",null)}},optionValue:{get:function(){return this.option.value},set:function(t){var e=this.IsSelected;this.option.value=t,e?this.$emit("set-default",this.option):this.$emit("reorder-option")}},optionText:{get:function(){return this.option.text},set:function(t){var e=this.IsSelected;this.option.text=t,e?this.$emit("set-default",this.option):this.$emit("reorder-option")}},optionCheck:{get:function(){return n(this.option.value)?this.option.text:this.option.value}}}}},template:"#select-options-table",props:["data"],data:function(){return{partId:t}},methods:{add:function(){this.$emit("add-option")},onDragEnd:function(){this.$emit("reorder-option")}}},selectOptionsModal:{name:"select-options-modal",template:"#select-options-modal",props:["data","showModal","validOptions"],data:function(){return{optionsFormattedList:"[]",partId:t,defaultValue:"",isValid:!1,jsonOptions:[]}},methods:{closeModal:function(t){t?this.$emit("modal-save",{options:this.jsonOptions,defaultValue:this.defaultValue}):this.$emit("modal-cancel")},showStart:function(t){this.$refs.modal.classList.toggle("d-block"),this.$refs.backdrop.classList.toggle("d-block")},showEnd:function(t){this.$refs.modal.classList.toggle("show"),this.$refs.backdrop.classList.toggle("show")}},watch:{showModal:function(t){t?(this.optionsFormattedList=JSON.stringify(this.validOptions,null,2),this.defaultValue=this.data.defaultValue):(this.optionsFormattedList="[]",this.defaultValue="")},optionsFormattedList:function(t){try{var e=JSON.parse(t);t&&e instanceof Array?(this.jsonOptions=e,this.isValid=!0):this.isValid=!1}catch(t){this.isValid=!1}}}}},data:function(){return{state:{options:e,defaultValue:i,partId:t},debounceTimeout:null,showModal:!1}},el:"#"+t,methods:{cancelChanges:function(){this.showModal=!1},updateChanges:function(t){this.state.options=t.options.filter(function(t){return!n(t.text)}).map(function(t){return t.key=o++,t}),this.state.defaultValue=t.defaultValue,this.showModal=!1,this.debouncePreview()},setDefaultValue:function(t){null==t?this.state.defaultValue="":n(t.value)?this.state.defaultValue=t.text:this.state.defaultValue=t.value,this.debouncePreview()},addOption:function(){this.state.options.push({text:"",value:"",key:o++}),this.debouncePreview()},removeOption:function(t){var e=this.state.options.findIndex(function(e){return e.key==t.key});e>-1&&(this.state.options.splice(e,1),this.debouncePreview())},reorderOption:function(t){this.debouncePreview()},debouncePreview:function(t){this.debounceTimeout&&clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(()=>{let t=new Event("contentpreview:render");document.dispatchEvent(t)},500)}},computed:{stringify:function(){return JSON.stringify(this.validOptions)},validOptions:function(){return this.state.options.map(function(t){return{text:t.text,value:t.value}}).filter(function(t){return!n(t.text)})}}})};return{initilizeElement:(e,i,o)=>{null!=document.getElementById(e)&&t(e,i,o)},initilizeFieldType:t=>{var e=t.getElementsByClassName("field-type-select-menu");for(let o=0;o"],"sourcesContent":["(function ($) {\r\n 'use strict';\r\n\r\n $.extend(true, $.trumbowyg, {\r\n langs: {\r\n en: {\r\n insertImage: 'Insert Media'\r\n }\r\n },\r\n plugins: {\r\n insertImage: {\r\n init: function (trumbowyg) {\r\n var btnDef = {\r\n fn: function () {\r\n trumbowyg.saveRange();\r\n $(\"#mediaApp\").detach().appendTo('#mediaModalBody .modal-body');\r\n $(\"#mediaApp\").show();\r\n mediaApp.selectedMedias = [];\r\n var modal = new bootstrap.Modal($(\"#mediaModalBody\"));\r\n modal.show();\r\n //disable an reset on click event over the button to avoid issue if press button multiple times or have multiple editor\r\n $('#mediaBodySelectButton').off('click');\r\n $('#mediaBodySelectButton').on('click', function (v) {\r\n trumbowyg.restoreRange();\r\n trumbowyg.range.deleteContents();\r\n \r\n for (i = 0; i < mediaApp.selectedMedias.length; i++) {\r\n var mediaBodyContent = ' [image]' + mediaApp.selectedMedias[i].mediaPath + '[/image]';\r\n var node = document.createTextNode(mediaBodyContent);\r\n trumbowyg.range.insertNode(node);\r\n }\r\n \r\n trumbowyg.syncCode();\r\n trumbowyg.$c.trigger('tbwchange');\r\n //avoid tag to be selected after add it\r\n trumbowyg.$c.focus();\r\n\r\n modal.hide();\r\n return true;\r\n });\r\n }\r\n };\r\n\r\n trumbowyg.addBtnDef('insertImage', btnDef);\r\n }\r\n }\r\n }\r\n });\r\n})(jQuery);\r\n"],"names":["$","extend","trumbowyg","langs","en","insertImage","plugins","init","addBtnDef","fn","saveRange","detach","appendTo","show","mediaApp","selectedMedias","modal","bootstrap","Modal","off","on","v","restoreRange","range","deleteContents","i","length","mediaBodyContent","mediaPath","node","document","createTextNode","insertNode","syncCode","$c","trigger","focus","hide","jQuery"],"mappings":"CAAA,AAAC,SAAUA,CAAC,EACR,aAEAA,EAAEC,MAAM,CAAC,CAAA,EAAMD,EAAEE,SAAS,CAAE,CACxBC,MAAO,CACHC,GAAI,CACAC,YAAa,cACjB,CACJ,EACAC,QAAS,CACLD,YAAa,CACTE,KAAM,SAAUL,CAAS,EAgCrBA,EAAUM,SAAS,CAAC,cA/BP,CACTC,GAAI,WACAP,EAAUQ,SAAS,GACnBV,EAAE,aAAaW,MAAM,GAAGC,QAAQ,CAAC,+BACjCZ,EAAE,aAAaa,IAAI,GACnBC,SAASC,cAAc,CAAG,EAAE,CAC5B,IAAIC,EAAQ,IAAIC,UAAUC,KAAK,CAAClB,EAAE,oBAClCgB,EAAMH,IAAI,GAEVb,EAAE,0BAA0BmB,GAAG,CAAC,SAChCnB,EAAE,0BAA0BoB,EAAE,CAAC,QAAS,SAAUC,CAAC,EAI/C,IAHAnB,EAAUoB,YAAY,GACtBpB,EAAUqB,KAAK,CAACC,cAAc,GAEzBC,EAAI,EAAGA,EAAIX,SAASC,cAAc,CAACW,MAAM,CAAED,IAAK,CACjD,IAAIE,EAAmB,WAAab,SAASC,cAAc,CAACU,EAAE,CAACG,SAAS,CAAG,WACvEC,EAAOC,SAASC,cAAc,CAACJ,GACnCzB,EAAUqB,KAAK,CAACS,UAAU,CAACH,EAC/B,CAQA,OANA3B,EAAU+B,QAAQ,GAClB/B,EAAUgC,EAAE,CAACC,OAAO,CAAC,aAErBjC,EAAUgC,EAAE,CAACE,KAAK,GAElBpB,EAAMqB,IAAI,GACH,CAAA,CACX,EACJ,CACJ,EAGJ,CACJ,CACJ,CACJ,EACJ,EAAGC"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.tag.min.js b/src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.tag.min.js index bf709437980..331869f4cb4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.tag.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.tag.min.js @@ -1 +1 @@ -!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{insertImage:"Insert Media"}},plugins:{insertImage:{init:function(a){var t={fn:function(){a.saveRange(),e("#mediaApp").detach().appendTo("#mediaModalBody .modal-body"),e("#mediaApp").show(),mediaApp.selectedMedias=[];var t=new bootstrap.Modal(e("#mediaModalBody"));t.show(),e("#mediaBodySelectButton").off("click"),e("#mediaBodySelectButton").on("click",(function(e){for(a.restoreRange(),a.range.deleteContents(),i=0;i"],"sourcesContent":["(function ($) {\r\n 'use strict';\r\n\r\n $.extend(true, $.trumbowyg, {\r\n langs: {\r\n en: {\r\n insertImage: 'Insert Media'\r\n }\r\n },\r\n plugins: {\r\n insertImage: {\r\n init: function (trumbowyg) {\r\n var btnDef = {\r\n fn: function () {\r\n trumbowyg.saveRange();\r\n $(\"#mediaApp\").detach().appendTo('#mediaModalBody .modal-body');\r\n $(\"#mediaApp\").show();\r\n mediaApp.selectedMedias = [];\r\n var modal = new bootstrap.Modal($(\"#mediaModalBody\"));\r\n modal.show();\r\n //disable an reset on click event over the button to avoid issue if press button multiple times or have multiple editor\r\n $('#mediaBodySelectButton').off('click');\r\n $('#mediaBodySelectButton').on('click', function (v) {\r\n //avoid multiple image insert\r\n trumbowyg.restoreRange();\r\n trumbowyg.range.deleteContents();\r\n \r\n $(window).trigger('scroll');\r\n\r\n for (i = 0; i < mediaApp.selectedMedias.length; i++) {\r\n var img = document.createElement(\"img\");\r\n img.src = mediaApp.selectedMedias[i].url;\r\n img.alt = mediaApp.selectedMedias[i].name;\r\n trumbowyg.range.insertNode(img);\r\n }\r\n\r\n trumbowyg.syncCode();\r\n trumbowyg.$c.trigger('tbwchange');\r\n //avoid image to be selected after add it\r\n trumbowyg.$c.focus();\r\n\r\n modal.hide();\r\n return true;\r\n });\r\n }\r\n };\r\n\r\n trumbowyg.addBtnDef('insertImage', btnDef);\r\n }\r\n }\r\n }\r\n });\r\n})(jQuery);\r\n"],"names":["$","extend","trumbowyg","langs","en","insertImage","plugins","init","addBtnDef","fn","saveRange","detach","appendTo","show","mediaApp","selectedMedias","modal","bootstrap","Modal","off","on","v","restoreRange","range","deleteContents","window","trigger","i","length","img","document","createElement","src","url","alt","name","insertNode","syncCode","$c","focus","hide","jQuery"],"mappings":"CAAA,AAAC,SAAUA,CAAC,EACR,aAEAA,EAAEC,MAAM,CAAC,CAAA,EAAMD,EAAEE,SAAS,CAAE,CACxBC,MAAO,CACHC,GAAI,CACAC,YAAa,cACjB,CACJ,EACAC,QAAS,CACLD,YAAa,CACTE,KAAM,SAAUL,CAAS,EAoCrBA,EAAUM,SAAS,CAAC,cAnCP,CACTC,GAAI,WACAP,EAAUQ,SAAS,GACnBV,EAAE,aAAaW,MAAM,GAAGC,QAAQ,CAAC,+BACjCZ,EAAE,aAAaa,IAAI,GACnBC,SAASC,cAAc,CAAG,EAAE,CAC5B,IAAIC,EAAQ,IAAIC,UAAUC,KAAK,CAAClB,EAAE,oBAClCgB,EAAMH,IAAI,GAEVb,EAAE,0BAA0BmB,GAAG,CAAC,SAChCnB,EAAE,0BAA0BoB,EAAE,CAAC,QAAS,SAAUC,CAAC,EAO/C,IALAnB,EAAUoB,YAAY,GACtBpB,EAAUqB,KAAK,CAACC,cAAc,GAE9BxB,EAAEyB,QAAQC,OAAO,CAAC,UAEbC,EAAI,EAAGA,EAAIb,SAASC,cAAc,CAACa,MAAM,CAAED,IAAK,CACjD,IAAIE,EAAMC,SAASC,aAAa,CAAC,MACjCF,CAAAA,EAAIG,GAAG,CAAGlB,SAASC,cAAc,CAACY,EAAE,CAACM,GAAG,CACxCJ,EAAIK,GAAG,CAAGpB,SAASC,cAAc,CAACY,EAAE,CAACQ,IAAI,CACzCjC,EAAUqB,KAAK,CAACa,UAAU,CAACP,EAC/B,CAQA,OANA3B,EAAUmC,QAAQ,GAClBnC,EAAUoC,EAAE,CAACZ,OAAO,CAAC,aAErBxB,EAAUoC,EAAE,CAACC,KAAK,GAElBvB,EAAMwB,IAAI,GACH,CAAA,CACX,EACJ,CACJ,EAGJ,CACJ,CACJ,CACJ,EACJ,EAAGC"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.url.min.js b/src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.url.min.js index 6ccbc4b5307..58eea07c3e8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.url.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Html/wwwroot/Scripts/trumbowyg.media.url.min.js @@ -1 +1 @@ -!function(e){"use strict";e.extend(!0,e.trumbowyg,{langs:{en:{insertImage:"Insert Media"}},plugins:{insertImage:{init:function(t){var a={fn:function(){t.saveRange(),e("#mediaApp").detach().appendTo("#mediaModalBody .modal-body"),e("#mediaApp").show(),mediaApp.selectedMedias=[];var a=new bootstrap.Modal(e("#mediaModalBody"));a.show(),e("#mediaBodySelectButton").off("click"),e("#mediaBodySelectButton").on("click",(function(d){for(t.restoreRange(),t.range.deleteContents(),e(window).trigger("scroll"),i=0;i"],"sourcesContent":["function updateContentItemOrders(oldIndex, newIndex) {\r\n var url = $('#ordering-url').data(\"url\");\r\n var containerId = $('#container-id').data(\"id\");\r\n var before = $('#pager-before').data(\"before\");\r\n var after = $('#pager-after').data(\"after\");\r\n var pageSize = $('#pager-pagesize').data(\"pagesize\");\r\n $.ajax({\r\n url: url,\r\n method: 'POST',\r\n data: {\r\n __RequestVerificationToken: $(\"input[name='__RequestVerificationToken']\").val(),\r\n containerId: containerId,\r\n oldIndex: oldIndex,\r\n newIndex: newIndex,\r\n pagerSlimParameters: {\r\n before: before,\r\n after: after\r\n },\r\n pageSize: pageSize\r\n },\r\n error: function (error) {\r\n alert($('#update-order-error-message').data(\"message\"));\r\n }\r\n });\r\n}\r\n\r\n$(function () {\r\n var sortable = document.getElementById(\"ci-sortable\");\r\n\r\n var sortable = Sortable.create(sortable, {\r\n handle: \".ui-sortable-handle\",\r\n onSort: function (evt) {\r\n var oldIndex = evt.oldIndex;\r\n var newIndex = evt.newIndex;\r\n updateContentItemOrders(oldIndex, newIndex);\r\n }\r\n });\r\n});\r\n"],"names":["updateContentItemOrders","oldIndex","newIndex","url","$","data","containerId","before","after","pageSize","ajax","method","__RequestVerificationToken","val","pagerSlimParameters","error","alert","sortable","document","getElementById","Sortable","create","handle","onSort","evt"],"mappings":"AAAA,SAASA,wBAAwBC,CAAQ,CAAEC,CAAQ,EAC/C,IAAIC,EAAMC,EAAE,iBAAiBC,IAAI,CAAC,OAC9BC,EAAcF,EAAE,iBAAiBC,IAAI,CAAC,MACtCE,EAASH,EAAE,iBAAiBC,IAAI,CAAC,UACjCG,EAAQJ,EAAE,gBAAgBC,IAAI,CAAC,SAC/BI,EAAWL,EAAE,mBAAmBC,IAAI,CAAC,YACzCD,EAAEM,IAAI,CAAC,CACHP,IAAKA,EACLQ,OAAQ,OACRN,KAAM,CACFO,2BAA4BR,EAAE,4CAA4CS,GAAG,GAC7EP,YAAaA,EACbL,SAAUA,EACVC,SAAUA,EACVY,oBAAqB,CACjBP,OAAQA,EACRC,MAAOA,CACX,EACAC,SAAUA,CACd,EACAM,MAAO,SAAUA,CAAK,EAClBC,MAAMZ,EAAE,+BAA+BC,IAAI,CAAC,WAChD,CACJ,EACJ,CAEAD,EAAE,WACE,IAAIa,EAAWC,SAASC,cAAc,CAAC,eAEnCF,EAAWG,SAASC,MAAM,CAACJ,EAAU,CACrCK,OAAQ,sBACRC,OAAQ,SAAUC,CAAG,EAGjBxB,wBAFewB,EAAIvB,QAAQ,CACZuB,EAAItB,QAAQ,CAE/B,CACJ,EACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Lists/wwwroot/Scripts/ci-list-ordering.min.js b/src/OrchardCore.Modules/OrchardCore.Lists/wwwroot/Scripts/ci-list-ordering.min.js index 215c55fa798..5b8608bff2f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Lists/wwwroot/Scripts/ci-list-ordering.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Lists/wwwroot/Scripts/ci-list-ordering.min.js @@ -1 +1 @@ -function updateContentItemOrders(e,a){var r=$("#ordering-url").data("url"),t=$("#container-id").data("id"),n=$("#pager-before").data("before"),d=$("#pager-after").data("after"),o=$("#pager-pagesize").data("pagesize");$.ajax({url:r,method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),containerId:t,oldIndex:e,newIndex:a,pagerSlimParameters:{before:n,after:d},pageSize:o},error:function(e){alert($("#update-order-error-message").data("message"))}})}$((function(){var e=document.getElementById("ci-sortable");e=Sortable.create(e,{handle:".ui-sortable-handle",onSort:function(e){updateContentItemOrders(e.oldIndex,e.newIndex)}})})); +function updateContentItemOrders(e,a){var r=$("#ordering-url").data("url"),t=$("#container-id").data("id"),n=$("#pager-before").data("before"),d=$("#pager-after").data("after"),o=$("#pager-pagesize").data("pagesize");$.ajax({url:r,method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),containerId:t,oldIndex:e,newIndex:a,pagerSlimParameters:{before:n,after:d},pageSize:o},error:function(e){alert($("#update-order-error-message").data("message"))}})}$(function(){var e=document.getElementById("ci-sortable"),e=Sortable.create(e,{handle:".ui-sortable-handle",onSort:function(e){updateContentItemOrders(e.oldIndex,e.newIndex)}})}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/Assets.json b/src/OrchardCore.Modules/OrchardCore.Localization/Assets.json deleted file mode 100644 index a91be89de53..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Localization/Assets.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "inputs": [ - "Assets/js/*.js" - ], - "output": "wwwroot/Scripts/optionsEditor.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Localization/Assets2.json new file mode 100644 index 00000000000..308e7412a67 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Localization/Assets2.json @@ -0,0 +1,9 @@ +[ + { + "action": "min", + "name": "loc-optionsEditor", + "source": "Assets/js/*.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.js b/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.js index 08b969ae4cf..a52bd78763a 100644 --- a/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.js +++ b/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.js @@ -1,80 +1,87 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - function initializeOptionsEditor(elem, data, defaultValue, selectedValue, list) { - var optionsTable = { - name: 'options-table', - template: '#options-table', - props: ['data', 'defaultValue', 'selectedValue', 'list'], - data: function data() { - return { - defaultCulture: this.defaultValue, - selectedCulture: typeof this.selectedValue != 'undefined' ? this.selectedValue : selectedValue, - allCultures: this.list - }; - }, - methods: { - add: function add() { - if (!this.data.includes(this.selectedCulture)) { - this.data.push(this.selectedCulture); - var culture = this.selectedCulture; - var selectedCulture = this.allCultures.filter(function (ele) { - return ele.Name == culture; - }); - if (selectedCulture.length > 0) { - selectedCulture[0].Supported = true; - } - var allUnsupportedCultures = this.allCultures.filter(function (ele) { - return ele.Supported == false; - }); - if (allUnsupportedCultures.length > 0) { - this.selectedCulture = allUnsupportedCultures[0].Name; - } - } - }, - remove: function remove(index) { - var selectedCulture = this.data[index]; - cultureRemoved = this.list.filter(function (ele) { - return ele.Name == selectedCulture; - }); - if (cultureRemoved.length > 0) { - cultureRemoved[0].Supported = false; - } - this.data.splice(index, 1); - var allUnsupportedCultures = this.allCultures.filter(function (ele) { - return ele.Supported == false; - }); - if (allUnsupportedCultures.length > 0) { - this.selectedCulture = allUnsupportedCultures[0].Name; - } - }, - getSupportedCultures: function getSupportedCultures() { - return JSON.stringify(this.data); - }, - getDefaultCulture: function getDefaultCulture() { - var result = defaultValue; - if (this.defaultCulture != null) { - result = this.defaultCulture; + + var optionsTable = { + name: 'options-table', + template: '#options-table', + props: ['data', 'defaultValue', 'selectedValue', 'list'], + data: function () { + return { + defaultCulture: this.defaultValue, + selectedCulture: typeof this.selectedValue != 'undefined' ? this.selectedValue : selectedValue, + allCultures: this.list + } + }, + methods: { + add: function () { + if (!this.data.includes(this.selectedCulture)) { + this.data.push(this.selectedCulture); + + var culture = this.selectedCulture; + var selectedCulture = this.allCultures.filter(function (ele) { + return ele.Name == culture; + }); + + if (selectedCulture.length > 0) { + selectedCulture[0].Supported = true; + } + + var allUnsupportedCultures = this.allCultures.filter(function (ele) { + return ele.Supported == false + }); + + if (allUnsupportedCultures.length > 0) { + this.selectedCulture = allUnsupportedCultures[0].Name; + } + } + }, + remove: function (index) { + + var selectedCulture = this.data[index]; + cultureRemoved = this.list.filter(function (ele) { + return ele.Name == selectedCulture; + }); + + if (cultureRemoved.length > 0) { + cultureRemoved[0].Supported = false; + } + + this.data.splice(index, 1); + + var allUnsupportedCultures = this.allCultures.filter(function (ele) { + return ele.Supported == false + }); + + if (allUnsupportedCultures.length > 0) { + this.selectedCulture = allUnsupportedCultures[0].Name; + } + }, + getSupportedCultures: function () { + return JSON.stringify(this.data); + }, + getDefaultCulture: function () { + var result = defaultValue; + if (this.defaultCulture != null) { + result = this.defaultCulture; + } + return result; + }, + getAllCultures: function () { + return this.AllCultures; + } } - return result; - }, - getAllCultures: function getAllCultures() { - return this.AllCultures; - } - } - }; - new Vue({ - components: { - optionsTable: optionsTable - }, - data: { - allCultures: list, - supportedCultures: data, - defaultCulture: defaultValue, - selectedCulture: selectedValue - }, - el: elem - }); -} \ No newline at end of file + }; + + new Vue({ + components: { + optionsTable: optionsTable + }, + data: { + allCultures: list, + supportedCultures: data, + defaultCulture: defaultValue, + selectedCulture: selectedValue + }, + el: elem + }); + +} diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.map b/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.map new file mode 100644 index 00000000000..744d82c483f --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["function initializeOptionsEditor(elem, data, defaultValue, selectedValue, list) {\r\n\r\n var optionsTable = {\r\n name: 'options-table',\r\n template: '#options-table',\r\n props: ['data', 'defaultValue', 'selectedValue', 'list'],\r\n data: function () {\r\n return {\r\n defaultCulture: this.defaultValue,\r\n selectedCulture: typeof this.selectedValue != 'undefined' ? this.selectedValue : selectedValue,\r\n allCultures: this.list\r\n }\r\n },\r\n methods: {\r\n add: function () {\r\n if (!this.data.includes(this.selectedCulture)) {\r\n this.data.push(this.selectedCulture);\r\n\r\n var culture = this.selectedCulture;\r\n var selectedCulture = this.allCultures.filter(function (ele) {\r\n return ele.Name == culture;\r\n });\r\n\r\n if (selectedCulture.length > 0) {\r\n selectedCulture[0].Supported = true;\r\n }\r\n\r\n var allUnsupportedCultures = this.allCultures.filter(function (ele) {\r\n return ele.Supported == false\r\n });\r\n\r\n if (allUnsupportedCultures.length > 0) {\r\n this.selectedCulture = allUnsupportedCultures[0].Name;\r\n }\r\n }\r\n },\r\n remove: function (index) {\r\n\r\n var selectedCulture = this.data[index];\r\n cultureRemoved = this.list.filter(function (ele) {\r\n return ele.Name == selectedCulture;\r\n });\r\n\r\n if (cultureRemoved.length > 0) {\r\n cultureRemoved[0].Supported = false;\r\n }\r\n\r\n this.data.splice(index, 1);\r\n\r\n var allUnsupportedCultures = this.allCultures.filter(function (ele) {\r\n return ele.Supported == false\r\n });\r\n\r\n if (allUnsupportedCultures.length > 0) {\r\n this.selectedCulture = allUnsupportedCultures[0].Name;\r\n }\r\n },\r\n getSupportedCultures: function () {\r\n return JSON.stringify(this.data);\r\n },\r\n getDefaultCulture: function () {\r\n var result = defaultValue;\r\n if (this.defaultCulture != null) {\r\n result = this.defaultCulture;\r\n }\r\n return result;\r\n },\r\n getAllCultures: function () {\r\n return this.AllCultures;\r\n }\r\n }\r\n };\r\n\r\n new Vue({\r\n components: {\r\n optionsTable: optionsTable\r\n },\r\n data: {\r\n allCultures: list,\r\n supportedCultures: data,\r\n defaultCulture: defaultValue,\r\n selectedCulture: selectedValue\r\n },\r\n el: elem\r\n });\r\n\r\n}\r\n"],"names":["initializeOptionsEditor","elem","data","defaultValue","selectedValue","list","Vue","components","optionsTable","name","template","props","defaultCulture","selectedCulture","allCultures","methods","add","includes","push","culture","filter","ele","Name","length","Supported","allUnsupportedCultures","remove","index","cultureRemoved","splice","getSupportedCultures","JSON","stringify","getDefaultCulture","result","getAllCultures","AllCultures","supportedCultures","el"],"mappings":"AAAA,SAASA,wBAAwBC,CAAI,CAAEC,CAAI,CAAEC,CAAY,CAAEC,CAAa,CAAEC,CAAI,EAyE1E,IAAIC,IAAI,CACJC,WAAY,CACRC,aAzEW,CACfC,KAAM,gBACNC,SAAU,iBACVC,MAAO,CAAC,OAAQ,eAAgB,gBAAiB,OAAO,CACxDT,KAAM,WACF,MAAO,CACHU,eAAg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A,AAAiB,CAAA,GAAjBA,EAAIG,SAAS,AACxB,EAEIC,CAAAA,EAAuBF,MAAM,CAAG,GAChC,CAAA,IAAI,CAACV,eAAe,CAAGY,CAAsB,CAAC,EAAE,CAACH,IAAI,AAAD,CAE5D,EACAQ,qBAAsB,WAClB,OAAOC,KAAKC,SAAS,CAAC,IAAI,CAAC9B,IAAI,CACnC,EACA+B,kBAAmB,WACf,IAAIC,EAAS/B,EAIb,OAH2B,MAAvB,IAAI,CAACS,cAAc,EACnBsB,CAAAA,EAAS,IAAI,CAACtB,cAAc,AAAD,EAExBsB,CACX,EACAC,eAAgB,WACZ,OAAO,IAAI,CAACC,WAAW,AAC3B,CACJ,CACJ,CAKI,EACAlC,KAAM,CACFY,YAAaT,EACbgC,kBAAmBnC,EACnBU,eAAgBT,EAChBU,gBAAiBT,CACrB,EACAkC,GAAIrC,CACR,EAEJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.min.js b/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.min.js index e4b4bed0e22..8045968a8af 100644 --- a/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Localization/wwwroot/Scripts/optionsEditor.min.js @@ -1 +1 @@ -function initializeOptionsEditor(t,e,u,l,r){new Vue({components:{optionsTable:{name:"options-table",template:"#options-table",props:["data","defaultValue","selectedValue","list"],data:function(){return{defaultCulture:this.defaultValue,selectedCulture:void 0!==this.selectedValue?this.selectedValue:l,allCultures:this.list}},methods:{add:function(){if(!this.data.includes(this.selectedCulture)){this.data.push(this.selectedCulture);var t=this.selectedCulture,e=this.allCultures.filter((function(e){return e.Name==t}));e.length>0&&(e[0].Supported=!0);var u=this.allCultures.filter((function(t){return 0==t.Supported}));u.length>0&&(this.selectedCulture=u[0].Name)}},remove:function(t){var e=this.data[t];cultureRemoved=this.list.filter((function(t){return t.Name==e})),cultureRemoved.length>0&&(cultureRemoved[0].Supported=!1),this.data.splice(t,1);var u=this.allCultures.filter((function(t){return 0==t.Supported}));u.length>0&&(this.selectedCulture=u[0].Name)},getSupportedCultures:function(){return JSON.stringify(this.data)},getDefaultCulture:function(){var t=u;return null!=this.defaultCulture&&(t=this.defaultCulture),t},getAllCultures:function(){return this.AllCultures}}}},data:{allCultures:r,supportedCultures:e,defaultCulture:u,selectedCulture:l},el:t})} +function initializeOptionsEditor(t,e,u,l,r){new Vue({components:{optionsTable:{name:"options-table",template:"#options-table",props:["data","defaultValue","selectedValue","list"],data:function(){return{defaultCulture:this.defaultValue,selectedCulture:void 0!==this.selectedValue?this.selectedValue:l,allCultures:this.list}},methods:{add:function(){if(!this.data.includes(this.selectedCulture)){this.data.push(this.selectedCulture);var t=this.selectedCulture,e=this.allCultures.filter(function(e){return e.Name==t});e.length>0&&(e[0].Supported=!0);var u=this.allCultures.filter(function(t){return!1==t.Supported});u.length>0&&(this.selectedCulture=u[0].Name)}},remove:function(t){var e=this.data[t];(cultureRemoved=this.list.filter(function(t){return t.Name==e})).length>0&&(cultureRemoved[0].Supported=!1),this.data.splice(t,1);var u=this.allCultures.filter(function(t){return!1==t.Supported});u.length>0&&(this.selectedCulture=u[0].Name)},getSupportedCultures:function(){return JSON.stringify(this.data)},getDefaultCulture:function(){var t=u;return null!=this.defaultCulture&&(t=this.defaultCulture),t},getAllCultures:function(){return this.AllCultures}}}},data:{allCultures:r,supportedCultures:e,defaultCulture:u,selectedCulture:l},el:t})} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Assets.json b/src/OrchardCore.Modules/OrchardCore.Menu/Assets.json deleted file mode 100644 index f032c317c7f..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Menu/Assets.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "inputs": [ - "Assets/scss/menu.scss" - ], - "output": "wwwroot/Styles/menu.css" - }, - { - "inputs": [ - "Assets/js/jquery.mjs.nestedSortable.js" - ], - "output": "wwwroot/Scripts/menu.js" - }, - { - "inputs": [ - "Assets/js/activate-links.js" - ], - "output": "wwwroot/Scripts/activate-links.js" - }, - { - "inputs": [ - "Assets/scss/menu-permission-picker.scss" - ], - "output": "wwwroot/Styles/menu-permission-picker.css" - }, - { - "inputs": [ - "Assets/js/menu-permission-picker.js" - ], - "output": "wwwroot/Scripts/menu-permission-picker.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Assets/js/jquery.mjs.nestedSortable.js b/src/OrchardCore.Modules/OrchardCore.Menu/Assets/js/menu.js similarity index 100% rename from src/OrchardCore.Modules/OrchardCore.Menu/Assets/js/jquery.mjs.nestedSortable.js rename to src/OrchardCore.Modules/OrchardCore.Menu/Assets/js/menu.js diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Menu/Assets2.json new file mode 100644 index 00000000000..956b5fcd114 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Menu/Assets2.json @@ -0,0 +1,35 @@ +[ + { + "action": "sass", + "name": "menu", + "source": "Assets/scss/menu.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "min", + "name": "nestedSortable", + "source": "Assets/js/menu.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "min", + "name": "activate-links", + "source": "Assets/js/activate-links.js", + "dest": "wwwroot/Scripts/menu.js", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "sass", + "name": "menu-permission-picker", + "source": "Assets/scss/menu-permission-picker.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "min", + "name": "menu-permission-picker", + "source": "Assets/js/menu-permission-picker.js", + "dest": "wwwroot/Scripts/menu.js", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.js b/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.js index 41b5053dc54..38bf5f7eb0d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.js +++ b/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.js @@ -1,8 +1,3 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - /* * jQuery UI Nested Sortable * v 2.1a / 2016-02-04 @@ -15,630 +10,898 @@ * Licensed under the MIT License * http://www.opensource.org/licenses/mit-license.php */ -(function (factory) { - "use strict"; - - if (typeof define === "function" && define.amd) { - // AMD. Register as an anonymous module. - define(["jquery", "jquery-ui/sortable"], factory); - } else { - // Browser globals - factory(window.jQuery); - } -})(function ($) { - "use strict"; - - function isOverAxis(x, reference, size) { - return x > reference && x < reference + size; - } - $.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, { - options: { - disableParentChange: false, - doNotClear: false, - expandOnHover: 700, - isAllowed: function isAllowed() { - return true; - }, - isTree: false, - listType: "ol", - maxLevels: 0, - protectRoot: false, - rootID: null, - rtl: false, - startCollapsed: false, - tabSize: 20, - branchClass: "mjs-nestedSortable-branch", - collapsedClass: "mjs-nestedSortable-collapsed", - disableNestingClass: "mjs-nestedSortable-no-nesting", - errorClass: "mjs-nestedSortable-error", - expandedClass: "mjs-nestedSortable-expanded", - hoveringClass: "mjs-nestedSortable-hovering", - leafClass: "mjs-nestedSortable-leaf", - disabledClass: "mjs-nestedSortable-disabled" - }, - _create: function _create() { - var self = this, - err; - this.element.data("ui-sortable", this.element.data("mjs-nestedSortable")); - - // mjs - prevent browser from freezing if the HTML is not correct - if (!this.element.is(this.options.listType)) { - err = "nestedSortable: " + "Please check that the listType option is set to your actual list type"; - throw new Error(err); - } - - // if we have a tree with expanding/collapsing functionality, - // force 'intersect' tolerance method - if (this.options.isTree && this.options.expandOnHover) { - this.options.tolerance = "intersect"; - } - $.ui.sortable.prototype._create.apply(this, arguments); - - // prepare the tree by applying the right classes - // (the CSS is responsible for actual hide/show functionality) - if (this.options.isTree) { - $(this.items).each(function () { - var $li = this.item, - hasCollapsedClass = $li.hasClass(self.options.collapsedClass), - hasExpandedClass = $li.hasClass(self.options.expandedClass); - if ($li.children(self.options.listType).length) { - $li.addClass(self.options.branchClass); - // expand/collapse class only if they have children - - if (!hasCollapsedClass && !hasExpandedClass) { - if (self.options.startCollapsed) { - $li.addClass(self.options.collapsedClass); - } else { - $li.addClass(self.options.expandedClass); - } - } - } else { - $li.addClass(self.options.leafClass); - } - }); - } - }, - _destroy: function _destroy() { - this.element.removeData("mjs-nestedSortable").removeData("ui-sortable"); - return $.ui.sortable.prototype._destroy.apply(this, arguments); - }, - _mouseDrag: function _mouseDrag(event) { - var i, - item, - itemElement, - intersection, - self = this, - o = this.options, - scrolled = false, - $document = $(document), - previousTopOffset, - parentItem, - level, - childLevels, - itemAfter, - itemBefore, - newList, - method, - a, - previousItem, - nextItem, - helperIsNotSibling; - - //Compute the helpers position - this.position = this._generatePosition(event); - this.positionAbs = this._convertPositionTo("absolute"); - if (!this.lastPositionAbs) { - this.lastPositionAbs = this.positionAbs; - } - - //Do scrolling - if (this.options.scroll) { - if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { - if (this.overflowOffset.top + this.scrollParent[0].offsetHeight - event.pageY < o.scrollSensitivity) { - scrolled = this.scrollParent.scrollTop() + o.scrollSpeed; - this.scrollParent.scrollTop(scrolled); - } else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) { - scrolled = this.scrollParent.scrollTop() - o.scrollSpeed; - this.scrollParent.scrollTop(scrolled); - } - if (this.overflowOffset.left + this.scrollParent[0].offsetWidth - event.pageX < o.scrollSensitivity) { - scrolled = this.scrollParent.scrollLeft() + o.scrollSpeed; - this.scrollParent.scrollLeft(scrolled); - } else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) { - scrolled = this.scrollParent.scrollLeft() - o.scrollSpeed; - this.scrollParent.scrollLeft(scrolled); - } - } else { - if (event.pageY - $document.scrollTop() < o.scrollSensitivity) { - scrolled = $document.scrollTop() - o.scrollSpeed; - $document.scrollTop(scrolled); - } else if ($(window).height() - (event.pageY - $document.scrollTop()) < o.scrollSensitivity) { - scrolled = $document.scrollTop() + o.scrollSpeed; - $document.scrollTop(scrolled); - } - if (event.pageX - $document.scrollLeft() < o.scrollSensitivity) { - scrolled = $document.scrollLeft() - o.scrollSpeed; - $document.scrollLeft(scrolled); - } else if ($(window).width() - (event.pageX - $document.scrollLeft()) < o.scrollSensitivity) { - scrolled = $document.scrollLeft() + o.scrollSpeed; - $document.scrollLeft(scrolled); - } - } - if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { - $.ui.ddmanager.prepareOffsets(this, event); - } - } - - //Regenerate the absolute position used for position checks - this.positionAbs = this._convertPositionTo("absolute"); - - // mjs - find the top offset before rearrangement, - previousTopOffset = this.placeholder.offset().top; - - //Set the helper position - if (!this.options.axis || this.options.axis !== "y") { - this.helper[0].style.left = this.position.left + "px"; - } - if (!this.options.axis || this.options.axis !== "x") { - this.helper[0].style.top = this.position.top + "px"; - } - - // mjs - check and reset hovering state at each cycle - this.hovering = this.hovering ? this.hovering : null; - this.mouseentered = this.mouseentered ? this.mouseentered : false; - - // mjs - let's start caching some variables - (function () { - var _parentItem = this.placeholder.parent().parent(); - if (_parentItem && _parentItem.closest(".ui-sortable").length) { - parentItem = _parentItem; - } - }).call(this); - level = this._getLevel(this.placeholder); - childLevels = this._getChildLevels(this.helper); - newList = document.createElement(o.listType); - - //Rearrange - for (i = this.items.length - 1; i >= 0; i--) { - //Cache variables and intersection, continue if no intersection - item = this.items[i]; - itemElement = item.item[0]; - intersection = this._intersectsWithPointer(item); - if (!intersection) { - continue; - } - - // Only put the placeholder inside the current Container, skip all - // items form other containers. This works because when moving - // an item from one container to another the - // currentContainer is switched before the placeholder is moved. - // - // Without this moving items in "sub-sortables" can cause the placeholder to jitter - // beetween the outer and inner container. - if (item.instance !== this.currentContainer) { - continue; - } - - // No action if intersected item is disabled - // and the element above or below in the direction we're going is also disabled - if (itemElement.className.indexOf(o.disabledClass) !== -1) { - // Note: intersection hardcoded direction values from - // jquery.ui.sortable.js:_intersectsWithPointer - if (intersection === 2) { - // Going down - itemAfter = this.items[i + 1]; - if (itemAfter && itemAfter.item.hasClass(o.disabledClass)) { - continue; - } - } else if (intersection === 1) { - // Going up - itemBefore = this.items[i - 1]; - if (itemBefore && itemBefore.item.hasClass(o.disabledClass)) { - continue; - } - } - } - method = intersection === 1 ? "next" : "prev"; - - // cannot intersect with itself - // no useless actions that have been done before - // no action if the item moved is the parent of the item checked - if (itemElement !== this.currentItem[0] && this.placeholder[method]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)) { - // mjs - we are intersecting an element: - // trigger the mouseenter event and store this state - if (!this.mouseentered) { - $(itemElement).mouseenter(); - this.mouseentered = true; - } - - // mjs - if the element has children and they are hidden, - // show them after a delay (CSS responsible) - if (o.isTree && $(itemElement).hasClass(o.collapsedClass) && o.expandOnHover) { - if (!this.hovering) { - $(itemElement).addClass(o.hoveringClass); - this.hovering = window.setTimeout(function () { - $(itemElement).removeClass(o.collapsedClass).addClass(o.expandedClass); - self.refreshPositions(); - self._trigger("expand", event, self._uiHash()); - }, o.expandOnHover); - } - } - this.direction = intersection === 1 ? "down" : "up"; - - // mjs - rearrange the elements and reset timeouts and hovering state - if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { - $(itemElement).mouseleave(); - this.mouseentered = false; - $(itemElement).removeClass(o.hoveringClass); - if (this.hovering) { - window.clearTimeout(this.hovering); - } - this.hovering = null; - - // mjs - do not switch container if - // it's a root item and 'protectRoot' is true - // or if it's not a root item but we are trying to make it root - if (o.protectRoot && !(this.currentItem[0].parentNode === this.element[0] && - // it's a root item - itemElement.parentNode !== this.element[0] - // it's intersecting a non-root item - )) { - if (this.currentItem[0].parentNode !== this.element[0] && itemElement.parentNode === this.element[0]) { - if (!$(itemElement).children(o.listType).length) { - itemElement.appendChild(newList); - if (o.isTree) { - $(itemElement).removeClass(o.leafClass).addClass(o.branchClass + " " + o.expandedClass); - } - } - if (this.direction === "down") { - a = $(itemElement).prev().children(o.listType); - } else { - a = $(itemElement).children(o.listType); - } - if (a[0] !== undefined) { - this._rearrange(event, null, a); - } - } else { - this._rearrange(event, item); - } - } else if (!o.protectRoot) { - this._rearrange(event, item); - } - } else { - break; - } - - // Clear emtpy ul's/ol's - this._clearEmpty(itemElement); - this._trigger("change", event, this._uiHash()); - break; - } - } - - // mjs - to find the previous sibling in the list, - // keep backtracking until we hit a valid list item. - (function () { - var _previousItem = this.placeholder.prev(); - if (_previousItem.length) { - previousItem = _previousItem; - } else { - previousItem = null; - } - }).call(this); - if (previousItem != null) { - while (previousItem[0].nodeName.toLowerCase() !== "li" || previousItem[0].className.indexOf(o.disabledClass) !== -1 || previousItem[0] === this.currentItem[0] || previousItem[0] === this.helper[0]) { - if (previousItem[0].previousSibling) { - previousItem = $(previousItem[0].previousSibling); - } else { - previousItem = null; - break; - } - } - } - - // mjs - to find the next sibling in the list, - // keep stepping forward until we hit a valid list item. - (function () { - var _nextItem = this.placeholder.next(); - if (_nextItem.length) { - nextItem = _nextItem; - } else { - nextItem = null; - } - }).call(this); - if (nextItem != null) { - while (nextItem[0].nodeName.toLowerCase() !== "li" || nextItem[0].className.indexOf(o.disabledClass) !== -1 || nextItem[0] === this.currentItem[0] || nextItem[0] === this.helper[0]) { - if (nextItem[0].nextSibling) { - nextItem = $(nextItem[0].nextSibling); - } else { - nextItem = null; - break; - } - } - } - this.beyondMaxLevels = 0; - - // mjs - if the item is moved to the left, send it one level up - // but only if it's at the bottom of the list - if (parentItem != null && nextItem == null && !(o.protectRoot && parentItem[0].parentNode == this.element[0]) && (o.rtl && this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth() || !o.rtl && this.positionAbs.left < parentItem.offset().left)) { - parentItem.after(this.placeholder[0]); - helperIsNotSibling = !parentItem.children(o.listItem).children("li:visible:not(.ui-sortable-helper)").length; - if (o.isTree && helperIsNotSibling) { - parentItem.removeClass(this.options.branchClass + " " + this.options.expandedClass).addClass(this.options.leafClass); - } - if (typeof parentItem !== 'undefined') this._clearEmpty(parentItem[0]); - this._trigger("change", event, this._uiHash()); - // mjs - if the item is below a sibling and is moved to the right, - // make it a child of that sibling - } else if (previousItem != null && !previousItem.hasClass(o.disableNestingClass) && (previousItem.children(o.listType).length && previousItem.children(o.listType).is(":visible") || !previousItem.children(o.listType).length) && !(o.protectRoot && this.currentItem[0].parentNode === this.element[0]) && (o.rtl && this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize || !o.rtl && this.positionAbs.left > previousItem.offset().left + o.tabSize)) { - this._isAllowed(previousItem, level, level + childLevels + 1); - if (!previousItem.children(o.listType).length) { - previousItem[0].appendChild(newList); - if (o.isTree) { - previousItem.removeClass(o.leafClass).addClass(o.branchClass + " " + o.expandedClass); - } - } - - // mjs - if this item is being moved from the top, add it to the top of the list. - if (previousTopOffset && previousTopOffset <= previousItem.offset().top) { - previousItem.children(o.listType).prepend(this.placeholder); - } else { - // mjs - otherwise, add it to the bottom of the list. - previousItem.children(o.listType)[0].appendChild(this.placeholder[0]); - } - if (typeof parentItem !== 'undefined') this._clearEmpty(parentItem[0]); - this._trigger("change", event, this._uiHash()); - } else { - this._isAllowed(parentItem, level, level + childLevels); - } - - //Post events to containers - this._contactContainers(event); - - //Interconnect with droppables - if ($.ui.ddmanager) { - $.ui.ddmanager.drag(this, event); - } - - //Call callbacks - this._trigger("sort", event, this._uiHash()); - this.lastPositionAbs = this.positionAbs; - return false; - }, - _mouseStop: function _mouseStop(event) { - // mjs - if the item is in a position not allowed, send it back - if (this.beyondMaxLevels) { - this.placeholder.removeClass(this.options.errorClass); - if (this.domPosition.prev) { - $(this.domPosition.prev).after(this.placeholder); - } else { - $(this.domPosition.parent).prepend(this.placeholder); - } - this._trigger("revert", event, this._uiHash()); - } - - // mjs - clear the hovering timeout, just to be sure - $("." + this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass); - this.mouseentered = false; - if (this.hovering) { - window.clearTimeout(this.hovering); - } - this.hovering = null; - this._relocate_event = event; - this._pid_current = $(this.domPosition.parent).parent().attr("id"); - this._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0; - $.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event. - }, - // mjs - this function is slightly modified - // to make it easier to hover over a collapsed element and have it expand - _intersectsWithSides: function _intersectsWithSides(item) { - var half = this.options.isTree ? .8 : .5, - isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + item.height * half, item.height), - isOverTopHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top - item.height * half, item.height), - isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + item.width / 2, item.width), - verticalDirection = this._getDragVerticalDirection(), - horizontalDirection = this._getDragHorizontalDirection(); - if (this.floating && horizontalDirection) { - return horizontalDirection === "right" && isOverRightHalf || horizontalDirection === "left" && !isOverRightHalf; - } else { - return verticalDirection && (verticalDirection === "down" && isOverBottomHalf || verticalDirection === "up" && isOverTopHalf); - } - }, - _contactContainers: function _contactContainers() { - if (this.options.protectRoot && this.currentItem[0].parentNode === this.element[0]) { - return; - } - $.ui.sortable.prototype._contactContainers.apply(this, arguments); - }, - _clear: function _clear() { - var i, item; - $.ui.sortable.prototype._clear.apply(this, arguments); - - //relocate event - if (!(this._pid_current === this._uiHash().item.parent().parent().attr("id") && this._sort_current === this._uiHash().item.index())) { - this._trigger("relocate", this._relocate_event, this._uiHash()); - } - - // mjs - clean last empty ul/ol - for (i = this.items.length - 1; i >= 0; i--) { - item = this.items[i].item[0]; - this._clearEmpty(item); - } - }, - serialize: function serialize(options) { - var o = $.extend({}, this.options, options), - items = this._getItemsAsjQuery(o && o.connected), - str = []; - $(items).each(function () { - var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || /(.+)[-=_](.+)/), - pid = ($(o.item || this).parent(o.listType).parent(o.items).attr(o.attribute || "id") || "").match(o.expression || /(.+)[-=_](.+)/); - if (res) { - str.push((o.key || res[1]) + "[" + (o.key && o.expression ? res[1] : res[2]) + "]" + "=" + (pid ? o.key && o.expression ? pid[1] : pid[2] : o.rootID)); - } - }); - if (!str.length && o.key) { - str.push(o.key + "="); - } - return str.join("&"); - }, - toHierarchy: function toHierarchy(options) { - var o = $.extend({}, this.options, options), - ret = []; - $(this.element).children(o.items).each(function () { - var level = _recursiveItems(this); - ret.push(level); - }); - return ret; - function _recursiveItems(item) { - var id = ($(item).attr(o.attribute || "id") || "").match(o.expression || /(.+)[-=_](.+)/), - currentItem; - var data = $(item).data(); - if (data.nestedSortableItem) { - delete data.nestedSortableItem; // Remove the nestedSortableItem object from the data - } - if (id) { - currentItem = { - "id": id[2] - }; - currentItem = $.extend({}, currentItem, data); // Combine the two objects - - if ($(item).children(o.listType).children(o.items).length > 0) { - currentItem.children = []; - $(item).children(o.listType).children(o.items).each(function () { - var level = _recursiveItems(this); - currentItem.children.push(level); - }); - } - return currentItem; - } - } - }, - toArray: function toArray(options) { - var o = $.extend({}, this.options, options), - sDepth = o.startDepthCount || 0, - ret = [], - left = 1; - if (!o.excludeRoot) { - ret.push({ - "item_id": o.rootID, - "parent_id": null, - "depth": sDepth, - "left": left, - "right": ($(o.items, this.element).length + 1) * 2 - }); - left++; - } - $(this.element).children(o.items).each(function () { - left = _recursiveArray(this, sDepth, left); - }); - ret = ret.sort(function (a, b) { - return a.left - b.left; - }); - return ret; - function _recursiveArray(item, depth, _left) { - var right = _left + 1, - id, - pid, - parentItem; - if ($(item).children(o.listType).children(o.items).length > 0) { - depth++; - $(item).children(o.listType).children(o.items).each(function () { - right = _recursiveArray($(this), depth, right); - }); - depth--; - } - id = ($(item).attr(o.attribute || "id") || "").match(o.expression || /(.+)[-=_](.+)/); - if (depth === sDepth) { - pid = o.rootID; - } else { - parentItem = $(item).parent(o.listType).parent(o.items).attr(o.attribute || "id").match(o.expression || /(.+)[-=_](.+)/); - pid = parentItem[2]; - } - if (id) { - var data = $(item).children('div').data(); - var itemObj = $.extend(data, { - "id": id[2], - "parent_id": pid, - "depth": depth, - "left": _left, - "right": right - }); - ret.push(itemObj); - } - _left = right + 1; - return _left; - } - }, - _clearEmpty: function _clearEmpty(item) { - function replaceClass(elem, search, replace, swap) { - if (swap) { - search = [replace, replace = search][0]; - } - $(elem).removeClass(search).addClass(replace); - } - var o = this.options, - childrenList = $(item).children(o.listType), - hasChildren = childrenList.has('li').length; - var doNotClear = o.doNotClear || hasChildren || o.protectRoot && $(item)[0] === this.element[0]; - if (o.isTree) { - replaceClass(item, o.branchClass, o.leafClass, doNotClear); - } - if (!doNotClear) { - childrenList.parent().removeClass(o.expandedClass); - childrenList.remove(); - } - }, - _getLevel: function _getLevel(item) { - var level = 1, - list; - if (this.options.listType) { - list = item.closest(this.options.listType); - while (list && list.length > 0 && !list.is(".ui-sortable")) { - level++; - list = list.parent().closest(this.options.listType); - } - } - return level; - }, - _getChildLevels: function _getChildLevels(parent, depth) { - var self = this, - o = this.options, - result = 0; - depth = depth || 0; - $(parent).children(o.listType).children(o.items).each(function (index, child) { - result = Math.max(self._getChildLevels(child, depth + 1), result); - }); - return depth ? result + 1 : result; - }, - _isAllowed: function _isAllowed(parentItem, level, levels) { - var o = this.options, - // this takes into account the maxLevels set to the recipient list - maxLevels = this.placeholder.closest(".ui-sortable").nestedSortable("option", "maxLevels"), - // Check if the parent has changed to prevent it, when o.disableParentChange is true - oldParent = this.currentItem.parent().parent(), - disabledByParentchange = o.disableParentChange && ( - //From somewhere to somewhere else, except the root - typeof parentItem !== 'undefined' && !oldParent.is(parentItem) || typeof parentItem === 'undefined' && oldParent.is("li") //From somewhere to the root - ); - // mjs - is the root protected? - // mjs - are we nesting too deep? - if (disabledByParentchange || !o.isAllowed(this.placeholder, parentItem, this.currentItem)) { - this.placeholder.addClass(o.errorClass); - if (maxLevels < levels && maxLevels !== 0) { - this.beyondMaxLevels = levels - maxLevels; - } else { - this.beyondMaxLevels = 1; - } - } else { - if (maxLevels < levels && maxLevels !== 0) { - this.placeholder.addClass(o.errorClass); - this.beyondMaxLevels = levels - maxLevels; - } else { - this.placeholder.removeClass(o.errorClass); - this.beyondMaxLevels = 0; - } - } - } - })); - $.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options); -}); \ No newline at end of file +(function( factory ) { + "use strict"; + + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ + "jquery", + "jquery-ui/sortable" + ], factory ); + } else { + + // Browser globals + factory( window.jQuery ); + } +}(function($) { + "use strict"; + + function isOverAxis( x, reference, size ) { + return ( x > reference ) && ( x < ( reference + size ) ); + } + + $.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, { + + options: { + disableParentChange: false, + doNotClear: false, + expandOnHover: 700, + isAllowed: function() { return true; }, + isTree: false, + listType: "ol", + maxLevels: 0, + protectRoot: false, + rootID: null, + rtl: false, + startCollapsed: false, + tabSize: 20, + + branchClass: "mjs-nestedSortable-branch", + collapsedClass: "mjs-nestedSortable-collapsed", + disableNestingClass: "mjs-nestedSortable-no-nesting", + errorClass: "mjs-nestedSortable-error", + expandedClass: "mjs-nestedSortable-expanded", + hoveringClass: "mjs-nestedSortable-hovering", + leafClass: "mjs-nestedSortable-leaf", + disabledClass: "mjs-nestedSortable-disabled" + }, + + _create: function() { + var self = this, + err; + + this.element.data("ui-sortable", this.element.data("mjs-nestedSortable")); + + // mjs - prevent browser from freezing if the HTML is not correct + if (!this.element.is(this.options.listType)) { + err = "nestedSortable: " + + "Please check that the listType option is set to your actual list type"; + + throw new Error(err); + } + + // if we have a tree with expanding/collapsing functionality, + // force 'intersect' tolerance method + if (this.options.isTree && this.options.expandOnHover) { + this.options.tolerance = "intersect"; + } + + $.ui.sortable.prototype._create.apply(this, arguments); + + // prepare the tree by applying the right classes + // (the CSS is responsible for actual hide/show functionality) + if (this.options.isTree) { + $(this.items).each(function() { + var $li = this.item, + hasCollapsedClass = $li.hasClass(self.options.collapsedClass), + hasExpandedClass = $li.hasClass(self.options.expandedClass); + + if ($li.children(self.options.listType).length) { + $li.addClass(self.options.branchClass); + // expand/collapse class only if they have children + + if ( !hasCollapsedClass && !hasExpandedClass ) { + if (self.options.startCollapsed) { + $li.addClass(self.options.collapsedClass); + } else { + $li.addClass(self.options.expandedClass); + } + } + } else { + $li.addClass(self.options.leafClass); + } + }); + } + }, + + _destroy: function() { + this.element + .removeData("mjs-nestedSortable") + .removeData("ui-sortable"); + return $.ui.sortable.prototype._destroy.apply(this, arguments); + }, + + _mouseDrag: function(event) { + var i, + item, + itemElement, + intersection, + self = this, + o = this.options, + scrolled = false, + $document = $(document), + previousTopOffset, + parentItem, + level, + childLevels, + itemAfter, + itemBefore, + newList, + method, + a, + previousItem, + nextItem, + helperIsNotSibling; + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if (this.options.scroll) { + if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { + + if ( + ( + this.overflowOffset.top + + this.scrollParent[0].offsetHeight + ) - + event.pageY < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollTop() + o.scrollSpeed; + this.scrollParent.scrollTop(scrolled); + } else if ( + event.pageY - + this.overflowOffset.top < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollTop() - o.scrollSpeed; + this.scrollParent.scrollTop(scrolled); + } + + if ( + ( + this.overflowOffset.left + + this.scrollParent[0].offsetWidth + ) - + event.pageX < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollLeft() + o.scrollSpeed; + this.scrollParent.scrollLeft(scrolled); + } else if ( + event.pageX - + this.overflowOffset.left < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollLeft() - o.scrollSpeed; + this.scrollParent.scrollLeft(scrolled); + } + + } else { + + if ( + event.pageY - + $document.scrollTop() < + o.scrollSensitivity + ) { + scrolled = $document.scrollTop() - o.scrollSpeed; + $document.scrollTop(scrolled); + } else if ( + $(window).height() - + ( + event.pageY - + $document.scrollTop() + ) < + o.scrollSensitivity + ) { + scrolled = $document.scrollTop() + o.scrollSpeed; + $document.scrollTop(scrolled); + } + + if ( + event.pageX - + $document.scrollLeft() < + o.scrollSensitivity + ) { + scrolled = $document.scrollLeft() - o.scrollSpeed; + $document.scrollLeft(scrolled); + } else if ( + $(window).width() - + ( + event.pageX - + $document.scrollLeft() + ) < + o.scrollSensitivity + ) { + scrolled = $document.scrollLeft() + o.scrollSpeed; + $document.scrollLeft(scrolled); + } + + } + + if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { + $.ui.ddmanager.prepareOffsets(this, event); + } + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + // mjs - find the top offset before rearrangement, + previousTopOffset = this.placeholder.offset().top; + + //Set the helper position + if (!this.options.axis || this.options.axis !== "y") { + this.helper[0].style.left = this.position.left + "px"; + } + if (!this.options.axis || this.options.axis !== "x") { + this.helper[0].style.top = (this.position.top) + "px"; + } + + // mjs - check and reset hovering state at each cycle + this.hovering = this.hovering ? this.hovering : null; + this.mouseentered = this.mouseentered ? this.mouseentered : false; + + // mjs - let's start caching some variables + (function() { + var _parentItem = this.placeholder.parent().parent(); + if (_parentItem && _parentItem.closest(".ui-sortable").length) { + parentItem = _parentItem; + } + }.call(this)); + + level = this._getLevel(this.placeholder); + childLevels = this._getChildLevels(this.helper); + newList = document.createElement(o.listType); + + //Rearrange + for (i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + item = this.items[i]; + itemElement = item.item[0]; + intersection = this._intersectsWithPointer(item); + if (!intersection) { + continue; + } + + // Only put the placeholder inside the current Container, skip all + // items form other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this moving items in "sub-sortables" can cause the placeholder to jitter + // beetween the outer and inner container. + if (item.instance !== this.currentContainer) { + continue; + } + + // No action if intersected item is disabled + // and the element above or below in the direction we're going is also disabled + if (itemElement.className.indexOf(o.disabledClass) !== -1) { + // Note: intersection hardcoded direction values from + // jquery.ui.sortable.js:_intersectsWithPointer + if (intersection === 2) { + // Going down + itemAfter = this.items[i + 1]; + if (itemAfter && itemAfter.item.hasClass(o.disabledClass)) { + continue; + } + + } else if (intersection === 1) { + // Going up + itemBefore = this.items[i - 1]; + if (itemBefore && itemBefore.item.hasClass(o.disabledClass)) { + continue; + } + } + } + + method = intersection === 1 ? "next" : "prev"; + + // cannot intersect with itself + // no useless actions that have been done before + // no action if the item moved is the parent of the item checked + if (itemElement !== this.currentItem[0] && + this.placeholder[method]()[0] !== itemElement && + !$.contains(this.placeholder[0], itemElement) && + ( + this.options.type === "semi-dynamic" ? + !$.contains(this.element[0], itemElement) : + true + ) + ) { + + // mjs - we are intersecting an element: + // trigger the mouseenter event and store this state + if (!this.mouseentered) { + $(itemElement).mouseenter(); + this.mouseentered = true; + } + + // mjs - if the element has children and they are hidden, + // show them after a delay (CSS responsible) + if (o.isTree && $(itemElement).hasClass(o.collapsedClass) && o.expandOnHover) { + if (!this.hovering) { + $(itemElement).addClass(o.hoveringClass); + this.hovering = window.setTimeout(function() { + $(itemElement) + .removeClass(o.collapsedClass) + .addClass(o.expandedClass); + + self.refreshPositions(); + self._trigger("expand", event, self._uiHash()); + }, o.expandOnHover); + } + } + + this.direction = intersection === 1 ? "down" : "up"; + + // mjs - rearrange the elements and reset timeouts and hovering state + if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { + $(itemElement).mouseleave(); + this.mouseentered = false; + $(itemElement).removeClass(o.hoveringClass); + if (this.hovering) { + window.clearTimeout(this.hovering); + } + this.hovering = null; + + // mjs - do not switch container if + // it's a root item and 'protectRoot' is true + // or if it's not a root item but we are trying to make it root + if (o.protectRoot && + !( + this.currentItem[0].parentNode === this.element[0] && + // it's a root item + itemElement.parentNode !== this.element[0] + // it's intersecting a non-root item + ) + ) { + if (this.currentItem[0].parentNode !== this.element[0] && + itemElement.parentNode === this.element[0] + ) { + + if ( !$(itemElement).children(o.listType).length) { + itemElement.appendChild(newList); + if (o.isTree) { + $(itemElement) + .removeClass(o.leafClass) + .addClass(o.branchClass + " " + o.expandedClass); + } + } + + if (this.direction === "down") { + a = $(itemElement).prev().children(o.listType); + } else { + a = $(itemElement).children(o.listType); + } + + if (a[0] !== undefined) { + this._rearrange(event, null, a); + } + + } else { + this._rearrange(event, item); + } + } else if (!o.protectRoot) { + this._rearrange(event, item); + } + } else { + break; + } + + // Clear emtpy ul's/ol's + this._clearEmpty(itemElement); + + this._trigger("change", event, this._uiHash()); + break; + } + } + + // mjs - to find the previous sibling in the list, + // keep backtracking until we hit a valid list item. + (function() { + var _previousItem = this.placeholder.prev(); + if (_previousItem.length) { + previousItem = _previousItem; + } else { + previousItem = null; + } + }.call(this)); + + if (previousItem != null) { + while ( + previousItem[0].nodeName.toLowerCase() !== "li" || + previousItem[0].className.indexOf(o.disabledClass) !== -1 || + previousItem[0] === this.currentItem[0] || + previousItem[0] === this.helper[0] + ) { + if (previousItem[0].previousSibling) { + previousItem = $(previousItem[0].previousSibling); + } else { + previousItem = null; + break; + } + } + } + + // mjs - to find the next sibling in the list, + // keep stepping forward until we hit a valid list item. + (function() { + var _nextItem = this.placeholder.next(); + if (_nextItem.length) { + nextItem = _nextItem; + } else { + nextItem = null; + } + }.call(this)); + + if (nextItem != null) { + while ( + nextItem[0].nodeName.toLowerCase() !== "li" || + nextItem[0].className.indexOf(o.disabledClass) !== -1 || + nextItem[0] === this.currentItem[0] || + nextItem[0] === this.helper[0] + ) { + if (nextItem[0].nextSibling) { + nextItem = $(nextItem[0].nextSibling); + } else { + nextItem = null; + break; + } + } + } + + this.beyondMaxLevels = 0; + + // mjs - if the item is moved to the left, send it one level up + // but only if it's at the bottom of the list + if (parentItem != null && + nextItem == null && + !(o.protectRoot && parentItem[0].parentNode == this.element[0]) && + ( + o.rtl && + ( + this.positionAbs.left + + this.helper.outerWidth() > parentItem.offset().left + + parentItem.outerWidth() + ) || + !o.rtl && (this.positionAbs.left < parentItem.offset().left) + ) + ) { + + parentItem.after(this.placeholder[0]); + helperIsNotSibling = !parentItem + .children(o.listItem) + .children("li:visible:not(.ui-sortable-helper)") + .length; + if (o.isTree && helperIsNotSibling) { + parentItem + .removeClass(this.options.branchClass + " " + this.options.expandedClass) + .addClass(this.options.leafClass); + } + if(typeof parentItem !== 'undefined') + this._clearEmpty(parentItem[0]); + this._trigger("change", event, this._uiHash()); + // mjs - if the item is below a sibling and is moved to the right, + // make it a child of that sibling + } else if (previousItem != null && + !previousItem.hasClass(o.disableNestingClass) && + ( + previousItem.children(o.listType).length && + previousItem.children(o.listType).is(":visible") || + !previousItem.children(o.listType).length + ) && + !(o.protectRoot && this.currentItem[0].parentNode === this.element[0]) && + ( + o.rtl && + ( + this.positionAbs.left + + this.helper.outerWidth() < + previousItem.offset().left + + previousItem.outerWidth() - + o.tabSize + ) || + !o.rtl && + (this.positionAbs.left > previousItem.offset().left + o.tabSize) + ) + ) { + + this._isAllowed(previousItem, level, level + childLevels + 1); + + if (!previousItem.children(o.listType).length) { + previousItem[0].appendChild(newList); + if (o.isTree) { + previousItem + .removeClass(o.leafClass) + .addClass(o.branchClass + " " + o.expandedClass); + } + } + + // mjs - if this item is being moved from the top, add it to the top of the list. + if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) { + previousItem.children(o.listType).prepend(this.placeholder); + } else { + // mjs - otherwise, add it to the bottom of the list. + previousItem.children(o.listType)[0].appendChild(this.placeholder[0]); + } + if(typeof parentItem !== 'undefined') + this._clearEmpty(parentItem[0]); + this._trigger("change", event, this._uiHash()); + } else { + this._isAllowed(parentItem, level, level + childLevels); + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if ($.ui.ddmanager) { + $.ui.ddmanager.drag(this, event); + } + + //Call callbacks + this._trigger("sort", event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event) { + // mjs - if the item is in a position not allowed, send it back + if (this.beyondMaxLevels) { + + this.placeholder.removeClass(this.options.errorClass); + + if (this.domPosition.prev) { + $(this.domPosition.prev).after(this.placeholder); + } else { + $(this.domPosition.parent).prepend(this.placeholder); + } + + this._trigger("revert", event, this._uiHash()); + + } + + // mjs - clear the hovering timeout, just to be sure + $("." + this.options.hoveringClass) + .mouseleave() + .removeClass(this.options.hoveringClass); + + this.mouseentered = false; + if (this.hovering) { + window.clearTimeout(this.hovering); + } + this.hovering = null; + + this._relocate_event = event; + this._pid_current = $(this.domPosition.parent).parent().attr("id"); + this._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0; + $.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event. + }, + + // mjs - this function is slightly modified + // to make it easier to hover over a collapsed element and have it expand + _intersectsWithSides: function(item) { + + var half = this.options.isTree ? .8 : .5, + isOverBottomHalf = isOverAxis( + this.positionAbs.top + this.offset.click.top, + item.top + (item.height * half), + item.height + ), + isOverTopHalf = isOverAxis( + this.positionAbs.top + this.offset.click.top, + item.top - (item.height * half), + item.height + ), + isOverRightHalf = isOverAxis( + this.positionAbs.left + this.offset.click.left, + item.left + (item.width / 2), + item.width + ), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ( + (horizontalDirection === "right" && isOverRightHalf) || + (horizontalDirection === "left" && !isOverRightHalf) + ); + } else { + return verticalDirection && ( + (verticalDirection === "down" && isOverBottomHalf) || + (verticalDirection === "up" && isOverTopHalf) + ); + } + + }, + + _contactContainers: function() { + + if (this.options.protectRoot && this.currentItem[0].parentNode === this.element[0] ) { + return; + } + + $.ui.sortable.prototype._contactContainers.apply(this, arguments); + + }, + + _clear: function() { + var i, + item; + + $.ui.sortable.prototype._clear.apply(this, arguments); + + //relocate event + if (!(this._pid_current === this._uiHash().item.parent().parent().attr("id") && + this._sort_current === this._uiHash().item.index())) { + this._trigger("relocate", this._relocate_event, this._uiHash()); + } + + // mjs - clean last empty ul/ol + for (i = this.items.length - 1; i >= 0; i--) { + item = this.items[i].item[0]; + this._clearEmpty(item); + } + + }, + + serialize: function(options) { + + var o = $.extend({}, this.options, options), + items = this._getItemsAsjQuery(o && o.connected), + str = []; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || "id") || "") + .match(o.expression || (/(.+)[-=_](.+)/)), + pid = ($(o.item || this).parent(o.listType) + .parent(o.items) + .attr(o.attribute || "id") || "") + .match(o.expression || (/(.+)[-=_](.+)/)); + + if (res) { + str.push( + ( + (o.key || res[1]) + + "[" + + (o.key && o.expression ? res[1] : res[2]) + "]" + ) + + "=" + + (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID)); + } + }); + + if (!str.length && o.key) { + str.push(o.key + "="); + } + + return str.join("&"); + + }, + + toHierarchy: function(options) { + + var o = $.extend({}, this.options, options), + ret = []; + + $(this.element).children(o.items).each(function() { + var level = _recursiveItems(this); + ret.push(level); + }); + + return ret; + + function _recursiveItems(item) { + var id = ($(item).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[-=_](.+)/)), + currentItem; + + var data = $(item).data(); + if (data.nestedSortableItem) { + delete data.nestedSortableItem; // Remove the nestedSortableItem object from the data + } + + if (id) { + currentItem = { + "id": id[2] + }; + + currentItem = $.extend({}, currentItem, data); // Combine the two objects + + if ($(item).children(o.listType).children(o.items).length > 0) { + currentItem.children = []; + $(item).children(o.listType).children(o.items).each(function() { + var level = _recursiveItems(this); + currentItem.children.push(level); + }); + } + return currentItem; + } + } + }, + + toArray: function(options) { + + var o = $.extend({}, this.options, options), + sDepth = o.startDepthCount || 0, + ret = [], + left = 1; + + if (!o.excludeRoot) { + ret.push({ + "item_id": o.rootID, + "parent_id": null, + "depth": sDepth, + "left": left, + "right": ($(o.items, this.element).length + 1) * 2 + }); + left++; + } + + $(this.element).children(o.items).each(function() { + left = _recursiveArray(this, sDepth, left); + }); + + ret = ret.sort(function(a, b) { return (a.left - b.left); }); + + return ret; + + function _recursiveArray(item, depth, _left) { + + var right = _left + 1, + id, + pid, + parentItem; + + if ($(item).children(o.listType).children(o.items).length > 0) { + depth++; + $(item).children(o.listType).children(o.items).each(function() { + right = _recursiveArray($(this), depth, right); + }); + depth--; + } + + id = ($(item).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[-=_](.+)/)); + + if (depth === sDepth) { + pid = o.rootID; + } else { + parentItem = ($(item).parent(o.listType) + .parent(o.items) + .attr(o.attribute || "id")) + .match(o.expression || (/(.+)[-=_](.+)/)); + pid = parentItem[2]; + } + + if (id) { + var data = $(item).children('div').data(); + var itemObj = $.extend( data, { + "id":id[2], + "parent_id":pid, + "depth":depth, + "left":_left, + "right":right + } ); + ret.push( itemObj ); + } + + _left = right + 1; + return _left; + } + + }, + + _clearEmpty: function (item) { + function replaceClass(elem, search, replace, swap) { + if (swap) { + search = [replace, replace = search][0]; + } + + $(elem).removeClass(search).addClass(replace); + } + + var o = this.options, + childrenList = $(item).children(o.listType), + hasChildren = childrenList.has('li').length; + + var doNotClear = + o.doNotClear || + hasChildren || + o.protectRoot && $(item)[0] === this.element[0]; + + if (o.isTree) { + replaceClass(item, o.branchClass, o.leafClass, doNotClear); + } + + if (!doNotClear) { + childrenList.parent().removeClass(o.expandedClass); + childrenList.remove(); + } + }, + + _getLevel: function(item) { + + var level = 1, + list; + + if (this.options.listType) { + list = item.closest(this.options.listType); + while (list && list.length > 0 && !list.is(".ui-sortable")) { + level++; + list = list.parent().closest(this.options.listType); + } + } + + return level; + }, + + _getChildLevels: function(parent, depth) { + var self = this, + o = this.options, + result = 0; + depth = depth || 0; + + $(parent).children(o.listType).children(o.items).each(function(index, child) { + result = Math.max(self._getChildLevels(child, depth + 1), result); + }); + + return depth ? result + 1 : result; + }, + + _isAllowed: function(parentItem, level, levels) { + var o = this.options, + // this takes into account the maxLevels set to the recipient list + maxLevels = this + .placeholder + .closest(".ui-sortable") + .nestedSortable("option", "maxLevels"), + + // Check if the parent has changed to prevent it, when o.disableParentChange is true + oldParent = this.currentItem.parent().parent(), + disabledByParentchange = o.disableParentChange && ( + //From somewhere to somewhere else, except the root + typeof parentItem !== 'undefined' && !oldParent.is(parentItem) || + typeof parentItem === 'undefined' && oldParent.is("li") //From somewhere to the root + ); + // mjs - is the root protected? + // mjs - are we nesting too deep? + if ( + disabledByParentchange || + !o.isAllowed(this.placeholder, parentItem, this.currentItem) + ) { + this.placeholder.addClass(o.errorClass); + if (maxLevels < levels && maxLevels !== 0) { + this.beyondMaxLevels = levels - maxLevels; + } else { + this.beyondMaxLevels = 1; + } + } else { + if (maxLevels < levels && maxLevels !== 0) { + this.placeholder.addClass(o.errorClass); + this.beyondMaxLevels = levels - maxLevels; + } else { + this.placeholder.removeClass(o.errorClass); + this.beyondMaxLevels = 0; + } + } + } + + })); + + $.mjs.nestedSortable.prototype.options = $.extend( + {}, + $.ui.sortable.prototype.options, + $.mjs.nestedSortable.prototype.options + ); +})); diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.map b/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.map new file mode 100644 index 00000000000..0c8f9a03b88 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["/*\r\n * jQuery UI Nested Sortable\r\n * v 2.1a / 2016-02-04\r\n * https://github.com/ilikenwf/nestedSortable\r\n *\r\n * Depends on:\r\n *\t jquery.ui.sortable.js 1.10+\r\n *\r\n * Copyright (c) 2010-2016 Manuele J Sarfatti and contributors\r\n * Licensed under the MIT License\r\n * http://www.opensource.org/licenses/mit-license.php\r\n */\r\n(function( factory ) {\r\n\t\"use strict\";\r\n\r\n\tif ( typeof define === \"function\" && define.amd ) {\r\n\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\tdefine([\r\n\t\t\t\"jquery\",\r\n\t\t\t\"jquery-ui/sortable\"\r\n\t\t], factory );\r\n\t} else {\r\n\r\n\t\t// Browser globals\r\n\t\tfactory( window.jQuery );\r\n\t}\r\n}(function($) {\r\n\t\"use strict\";\r\n\r\n\tfunction isOverAxis( x, reference, size ) {\r\n\t\treturn ( x > reference ) && ( x < ( reference + size ) );\r\n\t}\r\n\r\n\t$.widget(\"mjs.nestedSortable\", $.extend({}, $.ui.sortable.prototype, {\r\n\r\n\t\toptions: {\r\n\t\t\tdisableParentChange: false,\r\n\t\t\tdoNotClear: false,\r\n\t\t\texpandOnHover: 700,\r\n\t\t\tisAllowed: function() { return true; },\r\n\t\t\tisTree: false,\r\n\t\t\tlistType: \"ol\",\r\n\t\t\tmaxLevels: 0,\r\n\t\t\tprotectRoot: false,\r\n\t\t\trootID: null,\r\n\t\t\trtl: false,\r\n\t\t\tstartCollapsed: false,\r\n\t\t\ttabSize: 20,\r\n\r\n\t\t\tbranchClass: \"mjs-nestedSortable-branch\",\r\n\t\t\tcollapsedClass: \"mjs-nestedSortable-collapsed\",\r\n\t\t\tdisableNestingClass: \"mjs-nestedSortable-no-nesting\",\r\n\t\t\terrorClass: \"mjs-nestedSortable-error\",\r\n\t\t\texpandedClass: \"mjs-nestedSortable-expanded\",\r\n\t\t\thoveringClass: \"mjs-nestedSortable-hovering\",\r\n\t\t\tleafClass: \"mjs-nestedSortable-leaf\",\r\n\t\t\tdisabledClass: \"mjs-nestedSortable-disabled\"\r\n\t\t},\r\n\r\n\t\t_create: function() {\r\n\t\t\tvar self = this,\r\n\t\t\t\terr;\r\n\r\n\t\t\tthis.element.data(\"ui-sortable\", this.element.data(\"mjs-nestedSortable\"));\r\n\r\n\t\t\t// mjs - prevent browser from freezing if the HTML is not correct\r\n\t\t\tif (!this.element.is(this.options.listType)) {\r\n\t\t\t\terr = \"nestedSortable: \" +\r\n\t\t\t\t\t\"Please check that the listType option is set to your actual list type\";\r\n\r\n\t\t\t\tthrow new Error(err);\r\n\t\t\t}\r\n\r\n\t\t\t// if we have a tree with expanding/collapsing functionality,\r\n\t\t\t// force 'intersect' tolerance method\r\n\t\t\tif (this.options.isTree && this.options.expandOnHover) {\r\n\t\t\t\tthis.options.tolerance = \"intersect\";\r\n\t\t\t}\r\n\r\n\t\t\t$.ui.sortable.prototype._create.apply(this, arguments);\r\n\r\n\t\t\t// prepare the tree by applying the right classes\r\n\t\t\t// (the CSS is responsible for actual hide/show functionality)\r\n\t\t\tif (this.options.isTree) {\r\n\t\t\t\t$(this.items).each(function() {\r\n\t\t\t\t\tvar $li = this.item,\r\n\t\t\t\t\t\thasCollapsedClass = $li.hasClass(self.options.collapsedClass),\r\n\t\t\t\t\t\thasExpandedClass = $li.hasClass(self.options.expandedClass);\r\n\r\n\t\t\t\t\tif ($li.children(self.options.listType).length) {\r\n\t\t\t\t\t\t$li.addClass(self.options.branchClass);\r\n\t\t\t\t\t\t// expand/collapse class only if they have children\r\n\r\n\t\t\t\t\t\tif ( !hasCollapsedClass && !hasExpandedClass ) {\r\n\t\t\t\t\t\t\tif (self.options.startCollapsed) {\r\n\t\t\t\t\t\t\t\t$li.addClass(self.options.collapsedClass);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$li.addClass(self.options.expandedClass);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$li.addClass(self.options.leafClass);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_destroy: function() {\r\n\t\t\tthis.element\r\n\t\t\t\t.removeData(\"mjs-nestedSortable\")\r\n\t\t\t\t.removeData(\"ui-sortable\");\r\n\t\t\treturn $.ui.sortable.prototype._destroy.apply(this, arguments);\r\n\t\t},\r\n\r\n\t\t_mouseDrag: function(event) {\r\n\t\t\tvar i,\r\n\t\t\t\titem,\r\n\t\t\t\titemElement,\r\n\t\t\t\tintersection,\r\n\t\t\t\tself = this,\r\n\t\t\t\to = this.options,\r\n\t\t\t\tscrolled = false,\r\n\t\t\t\t$document = $(document),\r\n\t\t\t\tpreviousTopOffset,\r\n\t\t\t\tparentItem,\r\n\t\t\t\tlevel,\r\n\t\t\t\tchildLevels,\r\n\t\t\t\titemAfter,\r\n\t\t\t\titemBefore,\r\n\t\t\t\tnewList,\r\n\t\t\t\tmethod,\r\n\t\t\t\ta,\r\n\t\t\t\tpreviousItem,\r\n\t\t\t\tnextItem,\r\n\t\t\t\thelperIsNotSibling;\r\n\r\n\t\t\t//Compute the helpers position\r\n\t\t\tthis.position = this._generatePosition(event);\r\n\t\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\r\n\r\n\t\t\tif (!this.lastPositionAbs) {\r\n\t\t\t\tthis.lastPositionAbs = this.positionAbs;\r\n\t\t\t}\r\n\r\n\t\t\t//Do scrolling\r\n\t\t\tif (this.options.scroll) {\r\n\t\t\t\tif (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== \"HTML\") {\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tthis.overflowOffset.top +\r\n\t\t\t\t\t\t\tthis.scrollParent[0].offsetHeight\r\n\t\t\t\t\t\t) -\r\n\t\t\t\t\t\tevent.pageY <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = this.scrollParent.scrollTop() + o.scrollSpeed;\r\n\t\t\t\t\t\tthis.scrollParent.scrollTop(scrolled);\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\tevent.pageY -\r\n\t\t\t\t\t\tthis.overflowOffset.top <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = this.scrollParent.scrollTop() - o.scrollSpeed;\r\n\t\t\t\t\t\tthis.scrollParent.scrollTop(scrolled);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tthis.overflowOffset.left +\r\n\t\t\t\t\t\t\tthis.scrollParent[0].offsetWidth\r\n\t\t\t\t\t\t) -\r\n\t\t\t\t\t\tevent.pageX <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = this.scrollParent.scrollLeft() + o.scrollSpeed;\r\n\t\t\t\t\t\tthis.scrollParent.scrollLeft(scrolled);\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\tevent.pageX -\r\n\t\t\t\t\t\tthis.overflowOffset.left <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = this.scrollParent.scrollLeft() - o.scrollSpeed;\r\n\t\t\t\t\t\tthis.scrollParent.scrollLeft(scrolled);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tevent.pageY -\r\n\t\t\t\t\t\t$document.scrollTop() <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = $document.scrollTop() - o.scrollSpeed;\r\n\t\t\t\t\t\t$document.scrollTop(scrolled);\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\t$(window).height() -\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tevent.pageY -\r\n\t\t\t\t\t\t\t$document.scrollTop()\r\n\t\t\t\t\t\t) <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = $document.scrollTop() + o.scrollSpeed;\r\n\t\t\t\t\t\t$document.scrollTop(scrolled);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tevent.pageX -\r\n\t\t\t\t\t\t$document.scrollLeft() <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = $document.scrollLeft() - o.scrollSpeed;\r\n\t\t\t\t\t\t$document.scrollLeft(scrolled);\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\t$(window).width() -\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tevent.pageX -\r\n\t\t\t\t\t\t\t$document.scrollLeft()\r\n\t\t\t\t\t\t) <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = $document.scrollLeft() + o.scrollSpeed;\r\n\t\t\t\t\t\t$document.scrollLeft(scrolled);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {\r\n\t\t\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//Regenerate the absolute position used for position checks\r\n\t\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\r\n\r\n\t\t\t// mjs - find the top offset before rearrangement,\r\n\t\t\tpreviousTopOffset = this.placeholder.offset().top;\r\n\r\n\t\t\t//Set the helper position\r\n\t\t\tif (!this.options.axis || this.options.axis !== \"y\") {\r\n\t\t\t\tthis.helper[0].style.left = this.position.left + \"px\";\r\n\t\t\t}\r\n\t\t\tif (!this.options.axis || this.options.axis !== \"x\") {\r\n\t\t\t\tthis.helper[0].style.top = (this.position.top) + \"px\";\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - check and reset hovering state at each cycle\r\n\t\t\tthis.hovering = this.hovering ? this.hovering : null;\r\n\t\t\tthis.mouseentered = this.mouseentered ? this.mouseentered : false;\r\n\r\n\t\t\t// mjs - let's start caching some variables\r\n\t\t\t(function() {\r\n\t\t\t\tvar _parentItem = this.placeholder.parent().parent();\r\n\t\t\t\tif (_parentItem && _parentItem.closest(\".ui-sortable\").length) {\r\n\t\t\t\t\tparentItem = _parentItem;\r\n\t\t\t\t}\r\n\t\t\t}.call(this));\r\n\r\n\t\t\tlevel = this._getLevel(this.placeholder);\r\n\t\t\tchildLevels = this._getChildLevels(this.helper);\r\n\t\t\tnewList = document.createElement(o.listType);\r\n\r\n\t\t\t//Rearrange\r\n\t\t\tfor (i = this.items.length - 1; i >= 0; i--) {\r\n\r\n\t\t\t\t//Cache variables and intersection, continue if no intersection\r\n\t\t\t\titem = this.items[i];\r\n\t\t\t\titemElement = item.item[0];\r\n\t\t\t\tintersection = this._intersectsWithPointer(item);\r\n\t\t\t\tif (!intersection) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Only put the placeholder inside the current Container, skip all\r\n\t\t\t\t// items form other containers. This works because when moving\r\n\t\t\t\t// an item from one container to another the\r\n\t\t\t\t// currentContainer is switched before the placeholder is moved.\r\n\t\t\t\t//\r\n\t\t\t\t// Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\r\n\t\t\t\t// beetween the outer and inner container.\r\n\t\t\t\tif (item.instance !== this.currentContainer) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// No action if intersected item is disabled\r\n\t\t\t\t// and the element above or below in the direction we're going is also disabled\r\n\t\t\t\tif (itemElement.className.indexOf(o.disabledClass) !== -1) {\r\n\t\t\t\t\t// Note: intersection hardcoded direction values from\r\n\t\t\t\t\t// jquery.ui.sortable.js:_intersectsWithPointer\r\n\t\t\t\t\tif (intersection === 2) {\r\n\t\t\t\t\t\t// Going down\r\n\t\t\t\t\t\titemAfter = this.items[i + 1];\r\n\t\t\t\t\t\tif (itemAfter && itemAfter.item.hasClass(o.disabledClass)) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else if (intersection === 1) {\r\n\t\t\t\t\t\t// Going up\r\n\t\t\t\t\t\titemBefore = this.items[i - 1];\r\n\t\t\t\t\t\tif (itemBefore && itemBefore.item.hasClass(o.disabledClass)) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmethod = intersection === 1 ? \"next\" : \"prev\";\r\n\r\n\t\t\t\t// cannot intersect with itself\r\n\t\t\t\t// no useless actions that have been done before\r\n\t\t\t\t// no action if the item moved is the parent of the item checked\r\n\t\t\t\tif (itemElement !== this.currentItem[0] &&\r\n\t\t\t\t\tthis.placeholder[method]()[0] !== itemElement &&\r\n\t\t\t\t\t!$.contains(this.placeholder[0], itemElement) &&\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tthis.options.type === \"semi-dynamic\" ?\r\n\t\t\t\t\t\t\t!$.contains(this.element[0], itemElement) :\r\n\t\t\t\t\t\t\ttrue\r\n\t\t\t\t\t)\r\n\t\t\t\t) {\r\n\r\n\t\t\t\t\t// mjs - we are intersecting an element:\r\n\t\t\t\t\t// trigger the mouseenter event and store this state\r\n\t\t\t\t\tif (!this.mouseentered) {\r\n\t\t\t\t\t\t$(itemElement).mouseenter();\r\n\t\t\t\t\t\tthis.mouseentered = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// mjs - if the element has children and they are hidden,\r\n\t\t\t\t\t// show them after a delay (CSS responsible)\r\n\t\t\t\t\tif (o.isTree && $(itemElement).hasClass(o.collapsedClass) && o.expandOnHover) {\r\n\t\t\t\t\t\tif (!this.hovering) {\r\n\t\t\t\t\t\t\t$(itemElement).addClass(o.hoveringClass);\r\n\t\t\t\t\t\t\tthis.hovering = window.setTimeout(function() {\r\n\t\t\t\t\t\t\t\t$(itemElement)\r\n\t\t\t\t\t\t\t\t\t.removeClass(o.collapsedClass)\r\n\t\t\t\t\t\t\t\t\t.addClass(o.expandedClass);\r\n\r\n\t\t\t\t\t\t\t\tself.refreshPositions();\r\n\t\t\t\t\t\t\t\tself._trigger(\"expand\", event, self._uiHash());\r\n\t\t\t\t\t\t\t}, o.expandOnHover);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.direction = intersection === 1 ? \"down\" : \"up\";\r\n\r\n\t\t\t\t\t// mjs - rearrange the elements and reset timeouts and hovering state\r\n\t\t\t\t\tif (this.options.tolerance === \"pointer\" || this._intersectsWithSides(item)) {\r\n\t\t\t\t\t\t$(itemElement).mouseleave();\r\n\t\t\t\t\t\tthis.mouseentered = false;\r\n\t\t\t\t\t\t$(itemElement).removeClass(o.hoveringClass);\r\n\t\t\t\t\t\tif (this.hovering) {\r\n\t\t\t\t\t\t\twindow.clearTimeout(this.hovering);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.hovering = null;\r\n\r\n\t\t\t\t\t\t// mjs - do not switch container if\r\n\t\t\t\t\t\t// it's a root item and 'protectRoot' is true\r\n\t\t\t\t\t\t// or if it's not a root item but we are trying to make it root\r\n\t\t\t\t\t\tif (o.protectRoot &&\r\n\t\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\t\tthis.currentItem[0].parentNode === this.element[0] &&\r\n\t\t\t\t\t\t\t\t// it's a root item\r\n\t\t\t\t\t\t\t\titemElement.parentNode !== this.element[0]\r\n\t\t\t\t\t\t\t\t// it's intersecting a non-root item\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\tif (this.currentItem[0].parentNode !== this.element[0] &&\r\n\t\t\t\t\t\t\t\titemElement.parentNode === this.element[0]\r\n\t\t\t\t\t\t\t) {\r\n\r\n\t\t\t\t\t\t\t\tif ( !$(itemElement).children(o.listType).length) {\r\n\t\t\t\t\t\t\t\t\titemElement.appendChild(newList);\r\n\t\t\t\t\t\t\t\t\tif (o.isTree) {\r\n\t\t\t\t\t\t\t\t\t\t$(itemElement)\r\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(o.leafClass)\r\n\t\t\t\t\t\t\t\t\t\t\t.addClass(o.branchClass + \" \" + o.expandedClass);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (this.direction === \"down\") {\r\n\t\t\t\t\t\t\t\t\ta = $(itemElement).prev().children(o.listType);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\ta = $(itemElement).children(o.listType);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (a[0] !== undefined) {\r\n\t\t\t\t\t\t\t\t\tthis._rearrange(event, null, a);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tthis._rearrange(event, item);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (!o.protectRoot) {\r\n\t\t\t\t\t\t\tthis._rearrange(event, item);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Clear emtpy ul's/ol's\r\n\t\t\t\t\tthis._clearEmpty(itemElement);\r\n\r\n\t\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - to find the previous sibling in the list,\r\n\t\t\t// keep backtracking until we hit a valid list item.\r\n\t\t\t(function() {\r\n\t\t\t\tvar _previousItem = this.placeholder.prev();\r\n\t\t\t\tif (_previousItem.length) {\r\n\t\t\t\t\tpreviousItem = _previousItem;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpreviousItem = null;\r\n\t\t\t\t}\r\n\t\t\t}.call(this));\r\n\r\n\t\t\tif (previousItem != null) {\r\n\t\t\t\twhile (\r\n\t\t\t\t\tpreviousItem[0].nodeName.toLowerCase() !== \"li\" ||\r\n\t\t\t\t\tpreviousItem[0].className.indexOf(o.disabledClass) !== -1 ||\r\n\t\t\t\t\tpreviousItem[0] === this.currentItem[0] ||\r\n\t\t\t\t\tpreviousItem[0] === this.helper[0]\r\n\t\t\t\t) {\r\n\t\t\t\t\tif (previousItem[0].previousSibling) {\r\n\t\t\t\t\t\tpreviousItem = $(previousItem[0].previousSibling);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpreviousItem = null;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - to find the next sibling in the list,\r\n\t\t\t// keep stepping forward until we hit a valid list item.\r\n\t\t\t(function() {\r\n\t\t\t\tvar _nextItem = this.placeholder.next();\r\n\t\t\t\tif (_nextItem.length) {\r\n\t\t\t\t\tnextItem = _nextItem;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnextItem = null;\r\n\t\t\t\t}\r\n\t\t\t}.call(this));\r\n\r\n\t\t\tif (nextItem != null) {\r\n\t\t\t\twhile (\r\n\t\t\t\t\tnextItem[0].nodeName.toLowerCase() !== \"li\" ||\r\n\t\t\t\t\tnextItem[0].className.indexOf(o.disabledClass) !== -1 ||\r\n\t\t\t\t\tnextItem[0] === this.currentItem[0] ||\r\n\t\t\t\t\tnextItem[0] === this.helper[0]\r\n\t\t\t\t) {\r\n\t\t\t\t\tif (nextItem[0].nextSibling) {\r\n\t\t\t\t\t\tnextItem = $(nextItem[0].nextSibling);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnextItem = null;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.beyondMaxLevels = 0;\r\n\r\n\t\t\t// mjs - if the item is moved to the left, send it one level up\r\n\t\t\t// but only if it's at the bottom of the list\r\n\t\t\tif (parentItem != null &&\r\n\t\t\t\tnextItem == null &&\r\n\t\t\t\t!(o.protectRoot && parentItem[0].parentNode == this.element[0]) &&\r\n\t\t\t\t(\r\n\t\t\t\t\to.rtl &&\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tthis.positionAbs.left +\r\n\t\t\t\t\t\tthis.helper.outerWidth() > parentItem.offset().left +\r\n\t\t\t\t\t\tparentItem.outerWidth()\r\n\t\t\t\t\t) ||\r\n\t\t\t\t\t!o.rtl && (this.positionAbs.left < parentItem.offset().left)\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\r\n\t\t\t\tparentItem.after(this.placeholder[0]);\r\n\t\t\t\thelperIsNotSibling = !parentItem\r\n\t\t\t\t\t\t\t\t\t\t\t.children(o.listItem)\r\n\t\t\t\t\t\t\t\t\t\t\t.children(\"li:visible:not(.ui-sortable-helper)\")\r\n\t\t\t\t\t\t\t\t\t\t\t.length;\r\n\t\t\t\tif (o.isTree && helperIsNotSibling) {\r\n\t\t\t\t\tparentItem\r\n\t\t\t\t\t\t.removeClass(this.options.branchClass + \" \" + this.options.expandedClass)\r\n\t\t\t\t\t\t.addClass(this.options.leafClass);\r\n\t\t\t\t}\r\n if(typeof parentItem !== 'undefined')\r\n\t\t\t\t this._clearEmpty(parentItem[0]);\r\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\r\n\t\t\t\t// mjs - if the item is below a sibling and is moved to the right,\r\n\t\t\t\t// make it a child of that sibling\r\n\t\t\t} else if (previousItem != null &&\r\n\t\t\t\t!previousItem.hasClass(o.disableNestingClass) &&\r\n\t\t\t\t(\r\n\t\t\t\t\tpreviousItem.children(o.listType).length &&\r\n\t\t\t\t\tpreviousItem.children(o.listType).is(\":visible\") ||\r\n\t\t\t\t\t!previousItem.children(o.listType).length\r\n\t\t\t\t) &&\r\n\t\t\t\t!(o.protectRoot && this.currentItem[0].parentNode === this.element[0]) &&\r\n\t\t\t\t(\r\n\t\t\t\t\to.rtl &&\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tthis.positionAbs.left +\r\n\t\t\t\t\t\tthis.helper.outerWidth() <\r\n\t\t\t\t\t\tpreviousItem.offset().left +\r\n\t\t\t\t\t\tpreviousItem.outerWidth() -\r\n\t\t\t\t\t\to.tabSize\r\n\t\t\t\t\t) ||\r\n\t\t\t\t\t!o.rtl &&\r\n\t\t\t\t\t(this.positionAbs.left > previousItem.offset().left + o.tabSize)\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\r\n\t\t\t\tthis._isAllowed(previousItem, level, level + childLevels + 1);\r\n\r\n\t\t\t\tif (!previousItem.children(o.listType).length) {\r\n\t\t\t\t\tpreviousItem[0].appendChild(newList);\r\n\t\t\t\t\tif (o.isTree) {\r\n\t\t\t\t\t\tpreviousItem\r\n\t\t\t\t\t\t\t.removeClass(o.leafClass)\r\n\t\t\t\t\t\t\t.addClass(o.branchClass + \" \" + o.expandedClass);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// mjs - if this item is being moved from the top, add it to the top of the list.\r\n\t\t\t\tif (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) {\r\n\t\t\t\t\tpreviousItem.children(o.listType).prepend(this.placeholder);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// mjs - otherwise, add it to the bottom of the list.\r\n\t\t\t\t\tpreviousItem.children(o.listType)[0].appendChild(this.placeholder[0]);\r\n\t\t\t\t}\r\n if(typeof parentItem !== 'undefined')\r\n\t\t\t\t this._clearEmpty(parentItem[0]);\r\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\r\n\t\t\t} else {\r\n\t\t\t\tthis._isAllowed(parentItem, level, level + childLevels);\r\n\t\t\t}\r\n\r\n\t\t\t//Post events to containers\r\n\t\t\tthis._contactContainers(event);\r\n\r\n\t\t\t//Interconnect with droppables\r\n\t\t\tif ($.ui.ddmanager) {\r\n\t\t\t\t$.ui.ddmanager.drag(this, event);\r\n\t\t\t}\r\n\r\n\t\t\t//Call callbacks\r\n\t\t\tthis._trigger(\"sort\", event, this._uiHash());\r\n\r\n\t\t\tthis.lastPositionAbs = this.positionAbs;\r\n\t\t\treturn false;\r\n\r\n\t\t},\r\n\r\n\t\t_mouseStop: function(event) {\r\n\t\t\t// mjs - if the item is in a position not allowed, send it back\r\n\t\t\tif (this.beyondMaxLevels) {\r\n\r\n\t\t\t\tthis.placeholder.removeClass(this.options.errorClass);\r\n\r\n\t\t\t\tif (this.domPosition.prev) {\r\n\t\t\t\t\t$(this.domPosition.prev).after(this.placeholder);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this.domPosition.parent).prepend(this.placeholder);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._trigger(\"revert\", event, this._uiHash());\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - clear the hovering timeout, just to be sure\r\n\t\t\t$(\".\" + this.options.hoveringClass)\r\n\t\t\t\t.mouseleave()\r\n\t\t\t\t.removeClass(this.options.hoveringClass);\r\n\r\n\t\t\tthis.mouseentered = false;\r\n\t\t\tif (this.hovering) {\r\n\t\t\t\twindow.clearTimeout(this.hovering);\r\n\t\t\t}\r\n\t\t\tthis.hovering = null;\r\n\r\n\t\t\tthis._relocate_event = event;\r\n\t\t\tthis._pid_current = $(this.domPosition.parent).parent().attr(\"id\");\r\n\t\t\tthis._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0;\r\n\t\t\t$.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event.\r\n\t\t},\r\n\r\n\t\t// mjs - this function is slightly modified\r\n\t\t// to make it easier to hover over a collapsed element and have it expand\r\n\t\t_intersectsWithSides: function(item) {\r\n\r\n\t\t\tvar half = this.options.isTree ? .8 : .5,\r\n\t\t\t\tisOverBottomHalf = isOverAxis(\r\n\t\t\t\t\tthis.positionAbs.top + this.offset.click.top,\r\n\t\t\t\t\titem.top + (item.height * half),\r\n\t\t\t\t\titem.height\r\n\t\t\t\t),\r\n\t\t\t\tisOverTopHalf = isOverAxis(\r\n\t\t\t\t\tthis.positionAbs.top + this.offset.click.top,\r\n\t\t\t\t\titem.top - (item.height * half),\r\n\t\t\t\t\titem.height\r\n\t\t\t\t),\r\n\t\t\t\tisOverRightHalf = isOverAxis(\r\n\t\t\t\t\tthis.positionAbs.left + this.offset.click.left,\r\n\t\t\t\t\titem.left + (item.width / 2),\r\n\t\t\t\t\titem.width\r\n\t\t\t\t),\r\n\t\t\t\tverticalDirection = this._getDragVerticalDirection(),\r\n\t\t\t\thorizontalDirection = this._getDragHorizontalDirection();\r\n\r\n\t\t\tif (this.floating && horizontalDirection) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t(horizontalDirection === \"right\" && isOverRightHalf) ||\r\n\t\t\t\t\t(horizontalDirection === \"left\" && !isOverRightHalf)\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\treturn verticalDirection && (\r\n\t\t\t\t\t(verticalDirection === \"down\" && isOverBottomHalf) ||\r\n\t\t\t\t\t(verticalDirection === \"up\" && isOverTopHalf)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t_contactContainers: function() {\r\n\r\n\t\t\tif (this.options.protectRoot && this.currentItem[0].parentNode === this.element[0] ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t$.ui.sortable.prototype._contactContainers.apply(this, arguments);\r\n\r\n\t\t},\r\n\r\n\t\t_clear: function() {\r\n\t\t\tvar i,\r\n\t\t\t\titem;\r\n\r\n\t\t\t$.ui.sortable.prototype._clear.apply(this, arguments);\r\n\r\n\t\t\t//relocate event\r\n\t\t\tif (!(this._pid_current === this._uiHash().item.parent().parent().attr(\"id\") &&\r\n\t\t\t\tthis._sort_current === this._uiHash().item.index())) {\r\n\t\t\t\tthis._trigger(\"relocate\", this._relocate_event, this._uiHash());\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - clean last empty ul/ol\r\n\t\t\tfor (i = this.items.length - 1; i >= 0; i--) {\r\n\t\t\t\titem = this.items[i].item[0];\r\n\t\t\t\tthis._clearEmpty(item);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tserialize: function(options) {\r\n\r\n\t\t\tvar o = $.extend({}, this.options, options),\r\n\t\t\t\titems = this._getItemsAsjQuery(o && o.connected),\r\n\t\t\t\tstr = [];\r\n\r\n\t\t\t$(items).each(function() {\r\n\t\t\t\tvar res = ($(o.item || this).attr(o.attribute || \"id\") || \"\")\r\n\t\t\t\t\t\t.match(o.expression || (/(.+)[-=_](.+)/)),\r\n\t\t\t\t\tpid = ($(o.item || this).parent(o.listType)\r\n\t\t\t\t\t\t.parent(o.items)\r\n\t\t\t\t\t\t.attr(o.attribute || \"id\") || \"\")\r\n\t\t\t\t\t\t.match(o.expression || (/(.+)[-=_](.+)/));\r\n\r\n\t\t\t\tif (res) {\r\n\t\t\t\t\tstr.push(\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t(o.key || res[1]) +\r\n\t\t\t\t\t\t\t\"[\" +\r\n\t\t\t\t\t\t\t(o.key && o.expression ? res[1] : res[2]) + \"]\"\r\n\t\t\t\t\t\t) +\r\n\t\t\t\t\t\t\"=\" +\r\n\t\t\t\t\t\t(pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (!str.length && o.key) {\r\n\t\t\t\tstr.push(o.key + \"=\");\r\n\t\t\t}\r\n\r\n\t\t\treturn str.join(\"&\");\r\n\r\n\t\t},\r\n\r\n\t\ttoHierarchy: function(options) {\r\n\r\n\t\t\tvar o = $.extend({}, this.options, options),\r\n\t\t\t\tret = [];\r\n\r\n\t\t\t$(this.element).children(o.items).each(function() {\r\n\t\t\t\tvar level = _recursiveItems(this);\r\n\t\t\t\tret.push(level);\r\n\t\t\t});\r\n\r\n\t\t\treturn ret;\r\n\r\n\t\t\tfunction _recursiveItems(item) {\r\n\t\t\t\tvar id = ($(item).attr(o.attribute || \"id\") || \"\").match(o.expression || (/(.+)[-=_](.+)/)),\r\n\t\t\t\t\tcurrentItem;\r\n\r\n\t\t\t\tvar data = $(item).data();\r\n\t\t\t\tif (data.nestedSortableItem) {\r\n\t\t\t\t\tdelete data.nestedSortableItem; // Remove the nestedSortableItem object from the data\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (id) {\r\n\t\t\t\t\tcurrentItem = {\r\n\t\t\t\t\t\t\"id\": id[2]\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tcurrentItem = $.extend({}, currentItem, data); // Combine the two objects\r\n\r\n\t\t\t\t\tif ($(item).children(o.listType).children(o.items).length > 0) {\r\n\t\t\t\t\t\tcurrentItem.children = [];\r\n\t\t\t\t\t\t$(item).children(o.listType).children(o.items).each(function() {\r\n\t\t\t\t\t\t\tvar level = _recursiveItems(this);\r\n\t\t\t\t\t\t\tcurrentItem.children.push(level);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn currentItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttoArray: function(options) {\r\n\r\n\t\t\tvar o = $.extend({}, this.options, options),\r\n\t\t\t\tsDepth = o.startDepthCount || 0,\r\n\t\t\t\tret = [],\r\n\t\t\t\tleft = 1;\r\n\r\n\t\t\tif (!o.excludeRoot) {\r\n\t\t\t\tret.push({\r\n\t\t\t\t\t\"item_id\": o.rootID,\r\n\t\t\t\t\t\"parent_id\": null,\r\n\t\t\t\t\t\"depth\": sDepth,\r\n\t\t\t\t\t\"left\": left,\r\n\t\t\t\t\t\"right\": ($(o.items, this.element).length + 1) * 2\r\n\t\t\t\t});\r\n\t\t\t\tleft++;\r\n\t\t\t}\r\n\r\n\t\t\t$(this.element).children(o.items).each(function() {\r\n\t\t\t\tleft = _recursiveArray(this, sDepth, left);\r\n\t\t\t});\r\n\r\n\t\t\tret = ret.sort(function(a, b) { return (a.left - b.left); });\r\n\r\n\t\t\treturn ret;\r\n\r\n\t\t\tfunction _recursiveArray(item, depth, _left) {\r\n\r\n\t\t\t\tvar right = _left + 1,\r\n\t\t\t\t\tid,\r\n\t\t\t\t\tpid,\r\n\t\t\t\t\tparentItem;\r\n\r\n\t\t\t\tif ($(item).children(o.listType).children(o.items).length > 0) {\r\n\t\t\t\t\tdepth++;\r\n\t\t\t\t\t$(item).children(o.listType).children(o.items).each(function() {\r\n\t\t\t\t\t\tright = _recursiveArray($(this), depth, right);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tdepth--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tid = ($(item).attr(o.attribute || \"id\") || \"\").match(o.expression || (/(.+)[-=_](.+)/));\r\n\r\n\t\t\t\tif (depth === sDepth) {\r\n\t\t\t\t\tpid = o.rootID;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tparentItem = ($(item).parent(o.listType)\r\n\t\t\t\t\t\t\t\t\t\t\t.parent(o.items)\r\n\t\t\t\t\t\t\t\t\t\t\t.attr(o.attribute || \"id\"))\r\n\t\t\t\t\t\t\t\t\t\t\t.match(o.expression || (/(.+)[-=_](.+)/));\r\n\t\t\t\t\tpid = parentItem[2];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (id) {\r\n\t\t\t\t\tvar data = $(item).children('div').data();\r\n\t\t\t\t\tvar itemObj = $.extend( data, {\r\n\t\t\t\t\t\t\"id\":id[2],\r\n\t\t\t\t\t\t\"parent_id\":pid,\r\n\t\t\t\t\t\t\"depth\":depth,\r\n\t\t\t\t\t\t\"left\":_left,\r\n\t\t\t\t\t\t\"right\":right\r\n\t\t\t\t\t\t} );\r\n\t\t\t\t\tret.push( itemObj );\r\n\t\t\t\t}\r\n\r\n\t\t\t\t_left = right + 1;\r\n\t\t\t\treturn _left;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t_clearEmpty: function (item) {\r\n\t\t\tfunction replaceClass(elem, search, replace, swap) {\r\n\t\t\t\tif (swap) {\r\n\t\t\t\t\tsearch = [replace, replace = search][0];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$(elem).removeClass(search).addClass(replace);\r\n\t\t\t}\r\n\r\n\t\t\tvar o = this.options,\r\n\t\t\t\tchildrenList = $(item).children(o.listType),\r\n\t\t\t\thasChildren = childrenList.has('li').length;\r\n\r\n\t\t\tvar doNotClear =\r\n\t\t\t\to.doNotClear ||\r\n\t\t\t\thasChildren ||\r\n\t\t\t\to.protectRoot && $(item)[0] === this.element[0];\r\n\r\n\t\t\tif (o.isTree) {\r\n\t\t\t\treplaceClass(item, o.branchClass, o.leafClass, doNotClear);\r\n\t\t\t}\r\n\r\n\t\t\tif (!doNotClear) {\r\n\t\t\t\tchildrenList.parent().removeClass(o.expandedClass);\r\n\t\t\t\tchildrenList.remove();\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_getLevel: function(item) {\r\n\r\n\t\t\tvar level = 1,\r\n\t\t\t\tlist;\r\n\r\n\t\t\tif (this.options.listType) {\r\n\t\t\t\tlist = item.closest(this.options.listType);\r\n\t\t\t\twhile (list && list.length > 0 && !list.is(\".ui-sortable\")) {\r\n\t\t\t\t\tlevel++;\r\n\t\t\t\t\tlist = list.parent().closest(this.options.listType);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn level;\r\n\t\t},\r\n\r\n\t\t_getChildLevels: function(parent, depth) {\r\n\t\t\tvar self = this,\r\n\t\t\t\to = this.options,\r\n\t\t\t\tresult = 0;\r\n\t\t\tdepth = depth || 0;\r\n\r\n\t\t\t$(parent).children(o.listType).children(o.items).each(function(index, child) {\r\n\t\t\t\tresult = Math.max(self._getChildLevels(child, depth + 1), result);\r\n\t\t\t});\r\n\r\n\t\t\treturn depth ? result + 1 : result;\r\n\t\t},\r\n\r\n\t\t_isAllowed: function(parentItem, level, levels) {\r\n\t\t\tvar o = this.options,\r\n\t\t\t\t// this takes into account the maxLevels set to the recipient list\r\n\t\t\t\tmaxLevels = this\r\n\t\t\t\t\t.placeholder\r\n\t\t\t\t\t.closest(\".ui-sortable\")\r\n\t\t\t\t\t.nestedSortable(\"option\", \"maxLevels\"),\r\n\r\n\t\t\t\t// Check if the parent has changed to prevent it, when o.disableParentChange is true\r\n\t\t\t\toldParent = this.currentItem.parent().parent(),\r\n\t\t\t\tdisabledByParentchange = o.disableParentChange && (\r\n\t\t\t\t\t//From somewhere to somewhere else, except the root\r\n\t\t\t\t\ttypeof parentItem !== 'undefined' && !oldParent.is(parentItem) ||\r\n\t\t\t\t\ttypeof parentItem === 'undefined' && oldParent.is(\"li\")\t//From somewhere to the root\r\n\t\t\t\t);\r\n\t\t\t// mjs - is the root protected?\r\n\t\t\t// mjs - are we nesting too deep?\r\n\t\t\tif (\r\n\t\t\t\tdisabledByParentchange ||\r\n\t\t\t\t!o.isAllowed(this.placeholder, parentItem, this.currentItem)\r\n\t\t\t) {\r\n\t\t\t\tthis.placeholder.addClass(o.errorClass);\r\n\t\t\t\tif (maxLevels < levels && maxLevels !== 0) {\r\n\t\t\t\t\tthis.beyondMaxLevels = levels - maxLevels;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.beyondMaxLevels = 1;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (maxLevels < levels && maxLevels !== 0) {\r\n\t\t\t\t\tthis.placeholder.addClass(o.errorClass);\r\n\t\t\t\t\tthis.beyondMaxLevels = levels - maxLevels;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.placeholder.removeClass(o.errorClass);\r\n\t\t\t\t\tthis.beyondMaxLevels = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}));\r\n\r\n\t$.mjs.nestedSortable.prototype.options = $.extend(\r\n\t\t{},\r\n\t\t$.ui.sortable.prototype.options,\r\n\t\t$.mjs.nestedSortable.prototype.options\r\n\t);\r\n}));\r\n"],"names":["factory","define","amd","window","jQuery","$","widget","extend","ui","sortable","prototype","options","disableParentChange","doNotClear","expandOnHover","isAllowed","isTree","listType","maxLevels","protectRoot","rootID","rtl","startCollapsed","tabSize","branchClass","collapsedClass","disableNestingClass","errorClass","expandedClass","hoveringClass","leafClass","disabledClass","_create","self","element","data","is","Error","tolerance","apply","arguments","items","each","$li","item","hasCollapsedClass","hasClass","hasExpandedClass","children","length","addClass","_destroy","removeData","_mouseDrag","event","i","itemElement","intersection","previousTopOffset","parentItem","level","childLevels","itemAfter","itemBefore","newList","method","a","previousItem","nextItem","helperIsNotSibling","o","scrolled","$document","document","position","_generatePosition","positionAbs","_convertPositionTo","lastPositionAbs","scroll","scrollParent","tagName","overflowOffset","top","offsetHeight","pageY","scrollSensitivity","scrollTop","scrollSpeed","left","offsetWidth","pageX","scrollLeft","height","width","ddmanager","dropBehaviour","prepareOffsets","placeholder","offset","axis","helper","style","hovering","mouseentered","_parentItem","parent","closest","call","_getLevel","_getChildLevels","createElement","_intersectsWithPointer","instance","currentContainer","className","indexOf","currentItem","contains","type","mouseenter","setTimeout","removeClass","refreshPositions","_trigger","_uiHash","direction","_intersectsWithSides","mouseleave","clearTimeout","parentNode","appendChild","undefined","prev","_rearrange","_clearEmpty","_previousItem","nodeName","toLowerCase","previousSibling","_nextItem","next","nextSibling","beyondMaxLevels","outerWidth","after","listItem","_isAllowed","prepend","_contactContainers","drag","_mouseStop","domPosition","_relocate_event","_pid_current","attr","_sort_current","index","x","reference","size","half","isOverBottomHalf","click","isOverTopHalf","isOverRightHalf","verticalDirection","_getDragVerticalDirection","horizontalDirection","_getDragHorizontalDirection","floating","_clear","serialize","_getItemsAsjQuery","connected","str","res","attribute","match","expression","pid","push","key","join","toHierarchy","ret","_recursiveItems","id","nestedSortableItem","toArray","sDepth","startDepthCount","excludeRoot","_recursiveArray","depth","_left","right","itemObj","sort","b","search","replace","childrenList","hasChildren","has","remove","list","result","child","Math","max","levels","nestedSortable","oldParent","disabledByParentchange","mjs"],"mappings":"CAYC,SAAUA,CAAO,EACjB,YAEK,AAAkB,CAAA,YAAlB,OAAOC,QAAyBA,OAAOC,GAAG,CAG9CD,OAAO,CACN,SACA,qBACA,CAAED,GAIHA,EAASG,OAAOC,MAAM,CAExB,EAAE,SAASC,CAAC,EACX,aAMAA,EAAEC,MA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sB,KAAA,IAAf+C,GAA8B,CAAC0J,EAAUjL,EAAE,CAACuB,IACnD,AAAsB,KAAA,IAAfA,GAA8B0J,EAAUjL,EAAE,CAAC,KAAI,GAMvD,CAACkC,EAAEvD,SAAS,CAAC,IAAI,CAACmF,WAAW,CAAEvC,EAAY,IAAI,CAAC0D,WAAW,GAE3D,IAAI,CAACnB,WAAW,CAAChD,QAAQ,CAACoB,EAAE3C,UAAU,EAClCT,EAAYiM,GAAUjM,AAAc,IAAdA,EACzB,IAAI,CAAC6H,eAAe,CAAGoE,EAASjM,EAEhC,IAAI,CAAC6H,eAAe,CAAG,GAGpB7H,EAAYiM,GAAUjM,AAAc,IAAdA,GACzB,IAAI,CAACgF,WAAW,CAAChD,QAAQ,CAACoB,EAAE3C,UAAU,EACtC,IAAI,CAACoH,eAAe,CAAGoE,EAASjM,IAEhC,IAAI,CAACgF,WAAW,CAACwB,WAAW,CAACpD,EAAE3C,UAAU,EACzC,IAAI,CAACoH,eAAe,CAAG,EAG1B,CAED,IAEA1I,EAAEkN,GAAG,CAACH,cAAc,CAAC1M,SAAS,CAACC,OAAO,CAAGN,EAAEE,MAAM,CAChD,CAAC,EACDF,EAAEG,EAAE,CAACC,QAAQ,CAACC,SAAS,CAACC,OAAO,CAC/BN,EAAEkN,GAAG,CAACH,cAAc,CAAC1M,SAAS,CAACC,OAAO,CAExC"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.min.js b/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.min.js index 198b2d51a17..1206a13a301 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.min.js @@ -1 +1 @@ -!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/sortable"],e):e(window.jQuery)}((function(e){"use strict";function t(e,t,s){return e>t&&e=0;s--)if(i=this.items[s],o=i.item[0],(l=this._intersectsWithPointer(i))&&i.instance===this.currentContainer){if(-1!==o.className.indexOf(b.disabledClass))if(2===l){if((p=this.items[s+1])&&p.item.hasClass(b.disabledClass))continue}else if(1===l&&(d=this.items[s-1])&&d.item.hasClass(b.disabledClass))continue;if(u=1===l?"next":"prev",!(o===this.currentItem[0]||this.placeholder[u]()[0]===o||e.contains(this.placeholder[0],o)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],o))){if(this.mouseentered||(e(o).mouseenter(),this.mouseentered=!0),b.isTree&&e(o).hasClass(b.collapsedClass)&&b.expandOnHover&&(this.hovering||(e(o).addClass(b.hoveringClass),this.hovering=window.setTimeout((function(){e(o).removeClass(b.collapsedClass).addClass(b.expandedClass),C.refreshPositions(),C._trigger("expand",t,C._uiHash())}),b.expandOnHover))),this.direction=1===l?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;e(o).mouseleave(),this.mouseentered=!1,e(o).removeClass(b.hoveringClass),this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,!b.protectRoot||this.currentItem[0].parentNode===this.element[0]&&o.parentNode!==this.element[0]?b.protectRoot||this._rearrange(t,i):this.currentItem[0].parentNode!==this.element[0]&&o.parentNode===this.element[0]?(e(o).children(b.listType).length||(o.appendChild(c),b.isTree&&e(o).removeClass(b.leafClass).addClass(b.branchClass+" "+b.expandedClass)),void 0!==(f="down"===this.direction?e(o).prev().children(b.listType):e(o).children(b.listType))[0]&&this._rearrange(t,null,f)):this._rearrange(t,i),this._clearEmpty(o),this._trigger("change",t,this._uiHash());break}}if(function(){var e=this.placeholder.prev();m=e.length?e:null}.call(this),null!=m)for(;"li"!==m[0].nodeName.toLowerCase()||-1!==m[0].className.indexOf(b.disabledClass)||m[0]===this.currentItem[0]||m[0]===this.helper[0];){if(!m[0].previousSibling){m=null;break}m=e(m[0].previousSibling)}if(function(){var e=this.placeholder.next();v=e.length?e:null}.call(this),null!=v)for(;"li"!==v[0].nodeName.toLowerCase()||-1!==v[0].className.indexOf(b.disabledClass)||v[0]===this.currentItem[0]||v[0]===this.helper[0];){if(!v[0].nextSibling){v=null;break}v=e(v[0].nextSibling)}return this.beyondMaxLevels=0,null==n||null!=v||b.protectRoot&&n[0].parentNode==this.element[0]||!(b.rtl&&this.positionAbs.left+this.helper.outerWidth()>n.offset().left+n.outerWidth()||!b.rtl&&this.positionAbs.leftm.offset().left+b.tabSize)?this._isAllowed(n,a,a+h):(this._isAllowed(m,a,a+h+1),m.children(b.listType).length||(m[0].appendChild(c),b.isTree&&m.removeClass(b.leafClass).addClass(b.branchClass+" "+b.expandedClass)),r&&r<=m.offset().top?m.children(b.listType).prepend(this.placeholder):m.children(b.listType)[0].appendChild(this.placeholder[0]),void 0!==n&&this._clearEmpty(n[0]),this._trigger("change",t,this._uiHash())):(n.after(this.placeholder[0]),g=!n.children(b.listItem).children("li:visible:not(.ui-sortable-helper)").length,b.isTree&&g&&n.removeClass(this.options.branchClass+" "+this.options.expandedClass).addClass(this.options.leafClass),void 0!==n&&this._clearEmpty(n[0]),this._trigger("change",t,this._uiHash())),this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?e(this.domPosition.prev).after(this.placeholder):e(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",t,this._uiHash())),e("."+this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass),this.mouseentered=!1,this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,this._relocate_event=t,this._pid_current=e(this.domPosition.parent).parent().attr("id"),this._sort_current=this.domPosition.prev?e(this.domPosition.prev).next().index():0,e.ui.sortable.prototype._mouseStop.apply(this,arguments)},_intersectsWithSides:function(e){var s=this.options.isTree?.8:.5,i=t(this.positionAbs.top+this.offset.click.top,e.top+e.height*s,e.height),o=t(this.positionAbs.top+this.offset.click.top,e.top-e.height*s,e.height),l=t(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),r=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&l||"left"===n&&!l:r&&("down"===r&&i||"up"===r&&o)},_contactContainers:function(){this.options.protectRoot&&this.currentItem[0].parentNode===this.element[0]||e.ui.sortable.prototype._contactContainers.apply(this,arguments)},_clear:function(){var t,s;for(e.ui.sortable.prototype._clear.apply(this,arguments),this._pid_current===this._uiHash().item.parent().parent().attr("id")&&this._sort_current===this._uiHash().item.index()||this._trigger("relocate",this._relocate_event,this._uiHash()),t=this.items.length-1;t>=0;t--)s=this.items[t].item[0],this._clearEmpty(s)},serialize:function(t){var s=e.extend({},this.options,t),i=this._getItemsAsjQuery(s&&s.connected),o=[];return e(i).each((function(){var t=(e(s.item||this).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),i=(e(s.item||this).parent(s.listType).parent(s.items).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/);t&&o.push((s.key||t[1])+"["+(s.key&&s.expression?t[1]:t[2])+"]="+(i?s.key&&s.expression?i[1]:i[2]:s.rootID))})),!o.length&&s.key&&o.push(s.key+"="),o.join("&")},toHierarchy:function(t){var s=e.extend({},this.options,t),i=[];return e(this.element).children(s.items).each((function(){var e=o(this);i.push(e)})),i;function o(t){var i,l=(e(t).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),r=e(t).data();if(r.nestedSortableItem&&delete r.nestedSortableItem,l)return i={id:l[2]},i=e.extend({},i,r),e(t).children(s.listType).children(s.items).length>0&&(i.children=[],e(t).children(s.listType).children(s.items).each((function(){var e=o(this);i.children.push(e)}))),i}},toArray:function(t){var s=e.extend({},this.options,t),i=s.startDepthCount||0,o=[],l=1;return s.excludeRoot||(o.push({item_id:s.rootID,parent_id:null,depth:i,left:l,right:2*(e(s.items,this.element).length+1)}),l++),e(this.element).children(s.items).each((function(){l=r(this,i,l)})),o=o.sort((function(e,t){return e.left-t.left}));function r(t,l,n){var a,h,p=n+1;if(e(t).children(s.listType).children(s.items).length>0&&(l++,e(t).children(s.listType).children(s.items).each((function(){p=r(e(this),l,p)})),l--),a=(e(t).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),h=l===i?s.rootID:e(t).parent(s.listType).parent(s.items).attr(s.attribute||"id").match(s.expression||/(.+)[-=_](.+)/)[2],a){var d=e(t).children("div").data(),c=e.extend(d,{id:a[2],parent_id:h,depth:l,left:n,right:p});o.push(c)}return n=p+1}},_clearEmpty:function(t){var s,i,o,l=this.options,r=e(t).children(l.listType),n=r.has("li").length,a=l.doNotClear||n||l.protectRoot&&e(t)[0]===this.element[0];l.isTree&&(s=t,i=l.branchClass,o=l.leafClass,a&&(i=[o,o=i][0]),e(s).removeClass(i).addClass(o)),a||(r.parent().removeClass(l.expandedClass),r.remove())},_getLevel:function(e){var t,s=1;if(this.options.listType)for(t=e.closest(this.options.listType);t&&t.length>0&&!t.is(".ui-sortable");)s++,t=t.parent().closest(this.options.listType);return s},_getChildLevels:function(t,s){var i=this,o=this.options,l=0;return s=s||0,e(t).children(o.listType).children(o.items).each((function(e,t){l=Math.max(i._getChildLevels(t,s+1),l)})),s?l+1:l},_isAllowed:function(e,t,s){var i=this.options,o=this.placeholder.closest(".ui-sortable").nestedSortable("option","maxLevels"),l=this.currentItem.parent().parent();i.disableParentChange&&(void 0!==e&&!l.is(e)||void 0===e&&l.is("li"))||!i.isAllowed(this.placeholder,e,this.currentItem)?(this.placeholder.addClass(i.errorClass),this.beyondMaxLevels=o=0;s--)if(o=(i=this.items[s]).item[0],(l=this._intersectsWithPointer(i))&&i.instance===this.currentContainer){if(-1!==o.className.indexOf(b.disabledClass)){if(2===l){if((p=this.items[s+1])&&p.item.hasClass(b.disabledClass))continue}else if(1===l&&(d=this.items[s-1])&&d.item.hasClass(b.disabledClass))continue}if(u=1===l?"next":"prev",o!==this.currentItem[0]&&this.placeholder[u]()[0]!==o&&!e.contains(this.placeholder[0],o)&&("semi-dynamic"!==this.options.type||!e.contains(this.element[0],o))){if(this.mouseentered||(e(o).mouseenter(),this.mouseentered=!0),b.isTree&&e(o).hasClass(b.collapsedClass)&&b.expandOnHover&&!this.hovering&&(e(o).addClass(b.hoveringClass),this.hovering=window.setTimeout(function(){e(o).removeClass(b.collapsedClass).addClass(b.expandedClass),C.refreshPositions(),C._trigger("expand",t,C._uiHash())},b.expandOnHover)),this.direction=1===l?"down":"up","pointer"===this.options.tolerance||this._intersectsWithSides(i))e(o).mouseleave(),this.mouseentered=!1,e(o).removeClass(b.hoveringClass),this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,b.protectRoot&&!(this.currentItem[0].parentNode===this.element[0]&&o.parentNode!==this.element[0])?this.currentItem[0].parentNode!==this.element[0]&&o.parentNode===this.element[0]?(!e(o).children(b.listType).length&&(o.appendChild(c),b.isTree&&e(o).removeClass(b.leafClass).addClass(b.branchClass+" "+b.expandedClass)),void 0!==(f="down"===this.direction?e(o).prev().children(b.listType):e(o).children(b.listType))[0]&&this._rearrange(t,null,f)):this._rearrange(t,i):b.protectRoot||this._rearrange(t,i);else break;this._clearEmpty(o),this._trigger("change",t,this._uiHash());break}}if((function(){var e=this.placeholder.prev();m=e.length?e:null}).call(this),null!=m)for(;"li"!==m[0].nodeName.toLowerCase()||-1!==m[0].className.indexOf(b.disabledClass)||m[0]===this.currentItem[0]||m[0]===this.helper[0];)if(m[0].previousSibling)m=e(m[0].previousSibling);else{m=null;break}if((function(){var e=this.placeholder.next();v=e.length?e:null}).call(this),null!=v)for(;"li"!==v[0].nodeName.toLowerCase()||-1!==v[0].className.indexOf(b.disabledClass)||v[0]===this.currentItem[0]||v[0]===this.helper[0];)if(v[0].nextSibling)v=e(v[0].nextSibling);else{v=null;break}return this.beyondMaxLevels=0,null!=n&&null==v&&!(b.protectRoot&&n[0].parentNode==this.element[0])&&(b.rtl&&this.positionAbs.left+this.helper.outerWidth()>n.offset().left+n.outerWidth()||!b.rtl&&this.positionAbs.leftm.offset().left+b.tabSize)?(this._isAllowed(m,a,a+h+1),!m.children(b.listType).length&&(m[0].appendChild(c),b.isTree&&m.removeClass(b.leafClass).addClass(b.branchClass+" "+b.expandedClass)),r&&r<=m.offset().top?m.children(b.listType).prepend(this.placeholder):m.children(b.listType)[0].appendChild(this.placeholder[0]),void 0!==n&&this._clearEmpty(n[0]),this._trigger("change",t,this._uiHash())):this._isAllowed(n,a,a+h),this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?e(this.domPosition.prev).after(this.placeholder):e(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",t,this._uiHash())),e("."+this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass),this.mouseentered=!1,this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,this._relocate_event=t,this._pid_current=e(this.domPosition.parent).parent().attr("id"),this._sort_current=this.domPosition.prev?e(this.domPosition.prev).next().index():0,e.ui.sortable.prototype._mouseStop.apply(this,arguments)},_intersectsWithSides:function(e){var t,s,i,o,l,r,n,a,h,p=this.options.isTree?.8:.5,d=(t=this.positionAbs.top+this.offset.click.top,s=e.top+e.height*p,i=e.height,t>s&&tl&&oa&&n=0;t--)s=this.items[t].item[0],this._clearEmpty(s)},serialize:function(t){var s=e.extend({},this.options,t),i=this._getItemsAsjQuery(s&&s.connected),o=[];return e(i).each(function(){var t=(e(s.item||this).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),i=(e(s.item||this).parent(s.listType).parent(s.items).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/);t&&o.push((s.key||t[1])+"["+(s.key&&s.expression?t[1]:t[2])+"]="+(i?s.key&&s.expression?i[1]:i[2]:s.rootID))}),!o.length&&s.key&&o.push(s.key+"="),o.join("&")},toHierarchy:function(t){var s=e.extend({},this.options,t),i=[];return e(this.element).children(s.items).each(function(){var t=function t(i){var o,l=(e(i).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),r=e(i).data();if(r.nestedSortableItem&&delete r.nestedSortableItem,l)return o={id:l[2]},o=e.extend({},o,r),e(i).children(s.listType).children(s.items).length>0&&(o.children=[],e(i).children(s.listType).children(s.items).each(function(){var e=t(this);o.children.push(e)})),o}(this);i.push(t)}),i},toArray:function(t){var s=e.extend({},this.options,t),i=s.startDepthCount||0,o=[],l=1;return!s.excludeRoot&&(o.push({item_id:s.rootID,parent_id:null,depth:i,left:l,right:(e(s.items,this.element).length+1)*2}),l++),e(this.element).children(s.items).each(function(){l=function t(l,r,n){var a,h,p=n+1;if(e(l).children(s.listType).children(s.items).length>0&&(r++,e(l).children(s.listType).children(s.items).each(function(){p=t(e(this),r,p)}),r--),a=(e(l).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),h=r===i?s.rootID:e(l).parent(s.listType).parent(s.items).attr(s.attribute||"id").match(s.expression||/(.+)[-=_](.+)/)[2],a){var d=e(l).children("div").data(),c=e.extend(d,{id:a[2],parent_id:h,depth:r,left:n,right:p});o.push(c)}return n=p+1}(this,i,l)}),o=o.sort(function(e,t){return e.left-t.left})},_clearEmpty:function(t){var s,i,o=this.options,l=e(t).children(o.listType),r=l.has("li").length,n=o.doNotClear||r||o.protectRoot&&e(t)[0]===this.element[0];o.isTree&&(s=o.branchClass,i=o.leafClass,n&&(s=[i,i=s][0]),e(t).removeClass(s).addClass(i)),n||(l.parent().removeClass(o.expandedClass),l.remove())},_getLevel:function(e){var t,s=1;if(this.options.listType)for(t=e.closest(this.options.listType);t&&t.length>0&&!t.is(".ui-sortable");)s++,t=t.parent().closest(this.options.listType);return s},_getChildLevels:function(t,s){var i=this,o=this.options,l=0;return s=s||0,e(t).children(o.listType).children(o.items).each(function(e,t){l=Math.max(i._getChildLevels(t,s+1),l)}),s?l+1:l},_isAllowed:function(e,t,s){var i=this.options,o=this.placeholder.closest(".ui-sortable").nestedSortable("option","maxLevels"),l=this.currentItem.parent().parent();i.disableParentChange&&(void 0!==e&&!l.is(e)||void 0===e&&l.is("li"))||!i.isAllowed(this.placeholder,e,this.currentItem)?(this.placeholder.addClass(i.errorClass),o -1) { - values.splice(index, 1); - return true; - } - return false; - }; - var initialize = function initialize(readUrl, wrapperSelector) { - if (!readUrl) { - console.log('No readUrl was provided.'); - return; + + const removeItem = (values, value) => { + const index = values.indexOf(value); + + if (index > -1) { + values.splice(index, 1); + + return true; + } + + return false; } - var reading = []; - var elements = document.getElementsByClassName('mark-notification-as-read'); - var _loop = function _loop(i) { - ['click', 'mouseover'].forEach(function (evt) { - elements[i].addEventListener(evt, function (e) { - if (e.target.getAttribute('data-is-read') != "false") { - return; - } - var messageId = e.target.getAttribute('data-message-id'); - if (!messageId) { - return; - } - if (reading.includes(messageId)) { - // If a message is pending request, no need to send another request. + + const initialize = (readUrl, wrapperSelector) => { + + if (!readUrl) { + console.log('No readUrl was provided.'); + return; - } - reading.push(messageId); - fetch(readUrl, { - method: 'POST', - headers: { - 'Content-Type': 'application/json' - }, - body: JSON.stringify({ - messageId: messageId - }) - }).then(function (response) { - return response.json(); - }).then(function (result) { - if (result.updated) { - if (wrapperSelector) { - var wrapper = e.target.closest(wrapperSelector); - if (wrapper) { - wrapper.classList.remove('notification-is-unread'); - wrapper.classList.add('notification-is-read'); - wrapper.setAttribute('data-is-read', true); - removeItem(reading, messageId); - } - } else { - e.target.classList.remove('notification-is-unread'); - e.target.classList.add('notification-is-read'); - e.target.setAttribute('data-is-read', true); - removeItem(reading, messageId); - } - } - var targetUrl = e.target.getAttribute('data-target-url'); - if (targetUrl) { - window.location.href = targetUrl; - } - }); - }); - }); - }; - for (var i = 0; i < elements.length; i++) { - _loop(i); + } + + const reading = []; + + var elements = document.getElementsByClassName('mark-notification-as-read'); + + for (let i = 0; i < elements.length; i++) { + + ['click', 'mouseover'].forEach((evt) => { + elements[i].addEventListener(evt, (e) => { + + if (e.target.getAttribute('data-is-read') != "false") { + return; + } + + var messageId = e.target.getAttribute('data-message-id'); + + if (!messageId) { + return; + } + + if (reading.includes(messageId)) { + // If a message is pending request, no need to send another request. + return; + } + + reading.push(messageId); + + fetch(readUrl, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify({ messageId: messageId }) + }).then(response => response.json()) + .then(result => { + if (result.updated) { + if (wrapperSelector) { + var wrapper = e.target.closest(wrapperSelector); + if (wrapper) { + wrapper.classList.remove('notification-is-unread'); + wrapper.classList.add('notification-is-read'); + wrapper.setAttribute('data-is-read', true); + removeItem(reading, messageId); + } + } else { + e.target.classList.remove('notification-is-unread'); + e.target.classList.add('notification-is-read'); + e.target.setAttribute('data-is-read', true); + removeItem(reading, messageId); + } + } + + var targetUrl = e.target.getAttribute('data-target-url'); + + if (targetUrl) { + window.location.href = targetUrl; + } + }); + }); + }); + } } - }; - return { - initializeContainer: initialize - }; -}(); \ No newline at end of file + + return { + initializeContainer: initialize + }; +}(); diff --git a/src/OrchardCore.Modules/OrchardCore.Notifications/wwwroot/Scripts/notification-manager.map b/src/OrchardCore.Modules/OrchardCore.Notifications/wwwroot/Scripts/notification-manager.map new file mode 100644 index 00000000000..a6b8e8bf6bc --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Notifications/wwwroot/Scripts/notification-manager.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["notificationManager = function () {\r\n\r\n const removeItem = (values, value) => {\r\n const index = values.indexOf(value);\r\n\r\n if (index > -1) {\r\n values.splice(index, 1);\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n const initialize = (readUrl, wrapperSelector) => {\r\n\r\n if (!readUrl) {\r\n console.log('No readUrl was provided.');\r\n\r\n return;\r\n }\r\n\r\n const reading = [];\r\n\r\n var elements = document.getElementsByClassName('mark-notification-as-read');\r\n\r\n for (let i = 0; i < elements.length; i++) {\r\n\r\n ['click', 'mouseover'].forEach((evt) => {\r\n elements[i].addEventListener(evt, (e) => {\r\n\r\n if (e.target.getAttribute('data-is-read') != \"false\") {\r\n return;\r\n }\r\n\r\n var messageId = e.target.getAttribute('data-message-id');\r\n\r\n if (!messageId) {\r\n return;\r\n }\r\n\r\n if (reading.includes(messageId)) {\r\n // If a message is pending request, no need to send another request.\r\n return;\r\n }\r\n\r\n reading.push(messageId);\r\n\r\n fetch(readUrl, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify({ messageId: messageId })\r\n }).then(response => response.json())\r\n .then(result => {\r\n if (result.updated) {\r\n if (wrapperSelector) {\r\n var wrapper = e.target.closest(wrapperSelector);\r\n if (wrapper) {\r\n wrapper.classList.remove('notification-is-unread');\r\n wrapper.classList.add('notification-is-read');\r\n wrapper.setAttribute('data-is-read', true);\r\n removeItem(reading, messageId);\r\n }\r\n } else {\r\n e.target.classList.remove('notification-is-unread');\r\n e.target.classList.add('notification-is-read');\r\n e.target.setAttribute('data-is-read', true);\r\n removeItem(reading, messageId);\r\n }\r\n }\r\n\r\n var targetUrl = e.target.getAttribute('data-target-url');\r\n\r\n if (targetUrl) {\r\n window.location.href = targetUrl;\r\n }\r\n });\r\n });\r\n });\r\n }\r\n }\r\n\r\n return {\r\n initializeContainer: initialize\r\n };\r\n}();\r\n"],"names":["notificationManager","removeItem","values","value","index","indexOf","splice","initializeContainer","readUrl","wrapperSelector","console","log","reading","elements","document","getElementsByClassName","i","length","forEach","evt","addEventListener","e","target","getAttribute","messageId","includes","push","fetch","method","headers","body","JSON","stringify","then","response","json","result","updated","wrapper","closest","classList","remove","add","setAttribute","targetUrl","window","location","href"],"mappings":"AAAAA,oBAAsB,WAElB,IAAMC,EAAa,CAACC,EAAQC,KACxB,IAAMC,EAAQF,EAAOG,OAAO,CAACF,UAE7B,AAAIC,EAAQ,KACRF,EAAOI,MAAM,CAACF,EAAO,GAEd,CAAA,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CAAAA,OAAOC,QAAQ,CAACC,IAAI,CAAGH,CAAQ,CAEvC,IACR,EACJ,EAER,CAIA,CACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Notifications/wwwroot/Scripts/notification-manager.min.js b/src/OrchardCore.Modules/OrchardCore.Notifications/wwwroot/Scripts/notification-manager.min.js index c3b33162181..43259b70dbc 100644 --- a/src/OrchardCore.Modules/OrchardCore.Notifications/wwwroot/Scripts/notification-manager.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Notifications/wwwroot/Scripts/notification-manager.min.js @@ -1 +1 @@ -notificationManager=function(){var t=function(t,e){var a=t.indexOf(e);return a>-1&&(t.splice(a,1),!0)};return{initializeContainer:function(e,a){if(e)for(var i=[],n=document.getElementsByClassName("mark-notification-as-read"),r=function(r){["click","mouseover"].forEach((function(s){n[r].addEventListener(s,(function(n){if("false"==n.target.getAttribute("data-is-read")){var r=n.target.getAttribute("data-message-id");r&&(i.includes(r)||(i.push(r),fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageId:r})}).then((function(t){return t.json()})).then((function(e){if(e.updated)if(a){var s=n.target.closest(a);s&&(s.classList.remove("notification-is-unread"),s.classList.add("notification-is-read"),s.setAttribute("data-is-read",!0),t(i,r))}else n.target.classList.remove("notification-is-unread"),n.target.classList.add("notification-is-read"),n.target.setAttribute("data-is-read",!0),t(i,r);var o=n.target.getAttribute("data-target-url");o&&(window.location.href=o)}))))}}))}))},s=0;s{let a=t.indexOf(e);return a>-1&&(t.splice(a,1),!0)};return{initializeContainer:(e,a)=>{if(!e){console.log("No readUrl was provided.");return}let i=[];var r=document.getElementsByClassName("mark-notification-as-read");for(let s=0;s{r[s].addEventListener(n,r=>{if("false"==r.target.getAttribute("data-is-read")){var s=r.target.getAttribute("data-message-id");!s||i.includes(s)||(i.push(s),fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageId:s})}).then(t=>t.json()).then(e=>{if(e.updated){if(a){var n=r.target.closest(a);n&&(n.classList.remove("notification-is-unread"),n.classList.add("notification-is-read"),n.setAttribute("data-is-read",!0),t(i,s))}else r.target.classList.remove("notification-is-unread"),r.target.classList.add("notification-is-read"),r.target.setAttribute("data-is-read",!0),t(i,s)}var o=r.target.getAttribute("data-target-url");o&&(window.location.href=o)}))}})})}}}(); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/Assets.json b/src/OrchardCore.Modules/OrchardCore.OpenId/Assets.json deleted file mode 100644 index 7ca14f4a4c3..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/Assets.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "inputs": [ - "Assets/scss/parametersEditor/parametersEditor.scss" - ], - "output": "wwwroot/Styles/parametersEditor.css" - }, - { - "inputs": [ - "Assets/js/parametersEditor/*.js" - ], - "output": "wwwroot/Scripts/parametersEditor.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/Assets2.json b/src/OrchardCore.Modules/OrchardCore.OpenId/Assets2.json new file mode 100644 index 00000000000..826fa7246bc --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/Assets2.json @@ -0,0 +1,15 @@ +[ + { + "action": "sass", + "name": "parametersEditor", + "source": "Assets/scss/parametersEditor/parametersEditor.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "min", + "name": "parametersEditor", + "source": "Assets/js/parametersEditor/parametersEditor.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.js b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.js index ca8dc83a4bb..956ffec1f9e 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.js +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.js @@ -1,78 +1,74 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - function initializeParametersEditor(elem, data, modalBodyElement) { - var store = { - state: { - parameters: data - }, - addParameter: function addParameter() { - this.state.parameters.push({ - name: '', - value: '' - }); - }, - removeParameter: function removeParameter(index) { - this.state.parameters.splice(index, 1); - }, - getParametersFormattedList: function getParametersFormattedList() { - return JSON.stringify(this.state.parameters.filter(function (x) { - return !IsNullOrWhiteSpace(x.name); - })); - } - }; - var parametersTable = { - template: '#parameters-table', - props: ['data'], - name: 'parameters-table', - methods: { - add: function add() { - store.addParameter(); - }, - remove: function remove(index) { - store.removeParameter(index); - }, - getParametersFormattedList: function getParametersFormattedList() { - return store.getParametersFormattedList(); - } - } - }; - var parametersModal = { - template: '#parameters-modal', - props: ['data'], - name: 'parameters-modal', - methods: { - getParametersFormattedList: function getParametersFormattedList() { - return store.getParametersFormattedList(); - }, - showModal: function showModal() { - parametersModal.props.data.modal = new bootstrap.Modal(modalBodyElement[0]); - parametersModal.props.data.modal.show(); - }, - closeModal: function closeModal() { - parametersModal.props.data.modal.hide(); - } - } - }; - new Vue({ - components: { - parametersTable: parametersTable, - parametersModal: parametersModal - }, - data: { - sharedState: store.state, - modal: null - }, - el: elem, - methods: { - showModal: function showModal() { - parametersModal.methods.showModal(); - } + + var store = { + state: { + parameters: data + }, + addParameter: function () { + this.state.parameters.push({ name: '', value: '' }); + }, + removeParameter: function (index) { + this.state.parameters.splice(index, 1); + }, + getParametersFormattedList: function () { + return JSON.stringify(this.state.parameters.filter(function (x) { return !IsNullOrWhiteSpace(x.name) })); + } } - }); + + var parametersTable = { + template: '#parameters-table', + props: ['data'], + name: 'parameters-table', + methods: { + add: function () { + store.addParameter(); + }, + remove: function (index) { + store.removeParameter(index); + }, + getParametersFormattedList: function () { + return store.getParametersFormattedList(); + } + } + }; + + var parametersModal = { + template: '#parameters-modal', + props: ['data'], + name: 'parameters-modal', + methods: { + getParametersFormattedList: function () { + return store.getParametersFormattedList(); + }, + showModal: function () { + parametersModal.props.data.modal = new bootstrap.Modal(modalBodyElement[0]); + parametersModal.props.data.modal.show(); + }, + closeModal: function () { + parametersModal.props.data.modal.hide(); + } + } + }; + + new Vue({ + components: { + parametersTable: parametersTable, + parametersModal: parametersModal + }, + data: { + sharedState: store.state, + modal: null + }, + el: elem, + methods: { + showModal: function () { + parametersModal.methods.showModal(); + } + } + }); + } + function IsNullOrWhiteSpace(str) { - return str === null || str.match(/^ *$/) !== null; -} \ No newline at end of file + return str === null || str.match(/^ *$/) !== null; +} diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.map b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.map new file mode 100644 index 00000000000..aad18216a39 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["function initializeParametersEditor(elem, data, modalBodyElement) {\r\n\r\n var store = {\r\n state: {\r\n parameters: data\r\n },\r\n addParameter: function () {\r\n this.state.parameters.push({ name: '', value: '' });\r\n },\r\n removeParameter: function (index) {\r\n this.state.parameters.splice(index, 1);\r\n },\r\n getParametersFormattedList: function () {\r\n return JSON.stringify(this.state.parameters.filter(function (x) { return !IsNullOrWhiteSpace(x.name) }));\r\n }\r\n }\r\n\r\n var parametersTable = {\r\n template: '#parameters-table',\r\n props: ['data'],\r\n name: 'parameters-table',\r\n methods: {\r\n add: function () {\r\n store.addParameter();\r\n },\r\n remove: function (index) {\r\n store.removeParameter(index);\r\n },\r\n getParametersFormattedList: function () {\r\n return store.getParametersFormattedList();\r\n }\r\n }\r\n };\r\n\r\n var parametersModal = {\r\n template: '#parameters-modal',\r\n props: ['data'],\r\n name: 'parameters-modal',\r\n methods: {\r\n getParametersFormattedList: function () {\r\n return store.getParametersFormattedList();\r\n },\r\n showModal: function () {\r\n parametersModal.props.data.modal = new bootstrap.Modal(modalBodyElement[0]);\r\n parametersModal.props.data.modal.show();\r\n },\r\n closeModal: function () {\r\n parametersModal.props.data.modal.hide();\r\n }\r\n }\r\n };\r\n\r\n new Vue({\r\n components: {\r\n parametersTable: parametersTable,\r\n parametersModal: parametersModal\r\n },\r\n data: {\r\n sharedState: store.state,\r\n modal: null\r\n },\r\n el: elem,\r\n methods: {\r\n showModal: function () {\r\n parametersModal.methods.showModal();\r\n }\r\n }\r\n });\r\n\r\n}\r\n\r\nfunction IsNullOrWhiteSpace(str) {\r\n return str === null || str.match(/^ *$/) !== null;\r\n}\r\n"],"names":["initializeParametersEditor","elem","data","modalBodyElement","store","state","parameters","addParameter","push","name","value","removeParameter","index","splice","getParametersFormattedList","JSON","stringify","filter","x","IsNullOrWhiteSpace","parametersModal","template","props","methods","showModal","modal","bootstrap","Modal","show","closeModal","hide","Vue","components","parametersTable","add","remove","sharedState","el","str","match"],"mappings":"AAAA,SAASA,2BAA2BC,CAAI,CAAEC,CAAI,CAAEC,CAAgB,EAE5D,IAAIC,EAAQ,CACRC,MAAO,CACHC,WAAYJ,CAChB,EACAK,aAAc,WACV,IAAI,CAACF,KAAK,CAACC,UAAU,CAACE,IAAI,CAAC,CAAEC,KAAM,GAAIC,MAAO,EAAG,EACrD,EACAC,gBAAiB,SAAUC,CAAK,EAC5B,IAAI,CAACP,KAAK,CAACC,UAAU,CAACO,MAAM,CAACD,EAAO,EACxC,EACAE,2BAA4B,WACxB,OAAOC,KAAKC,SAAS,CAAC,IAAI,CAACX,KAAK,CAACC,UAAU,CAACW,MAAM,CAAC,SAAUC,CAAC,EAAI,MAAO,CAACC,mBAAmBD,EAAET,IAAI,CAAE,GACzG,CACJ,EAmBIW,EAAkB,CAClBC,SAAU,oBACVC,MAAO,CAAC,OAAO,CACfb,KAAM,mBACNc,QAAS,CACLT,2BAA4B,WACxB,OAAOV,EAAMU,0BAA0B,EAC3C,EACAU,UAAW,WACPJ,EAAgBE,KAAK,CAACpB,IAAI,CAACuB,KAAK,CAAG,IAAIC,UAAUC,KAAK,CAACxB,CAAgB,CAAC,EAAE,EAC1EiB,EAAgBE,KAAK,CAACpB,IAAI,CAACuB,KAAK,CAACG,IAAI,EACzC,EACAC,WAAY,WACRT,EAAgBE,KAAK,CAACpB,IAAI,CAACuB,KAAK,CAACK,IAAI,EACzC,CACJ,CACJ,EAEA,IAAIC,IAAI,CACJC,WAAY,CACRC,gBArCc,CAClBZ,SAAU,oBACVC,MAAO,CAAC,OAAO,CACfb,KAAM,mBACNc,QAAS,CACLW,IAAK,WACD9B,EAAMG,YAAY,EACtB,EACA4B,OAAQ,SAAUvB,CAAK,EACnBR,EAAMO,eAAe,CAACC,EAC1B,EACAE,2BAA4B,WACxB,OAAOV,EAAMU,0BAA0B,EAC3C,CACJ,CACJ,EAuBQM,gBAAiBA,CACrB,EACAlB,KAAM,CACFkC,YAAahC,EAAMC,KAAK,CACxBoB,MAAO,IACX,EACAY,GAAIpC,EACJsB,QAAS,CACLC,UAAW,WACPJ,EAAgBG,OAAO,CAACC,SAAS,EACrC,CACJ,CACJ,EAEJ,CAEA,SAASL,mBAAmBmB,CAAG,EAC3B,OAAOA,AAAQ,OAARA,GAAgBA,AAAsB,OAAtBA,EAAIC,KAAK,CAAC,OACrC"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.min.js b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.min.js index ce7082ed38d..cadc5d0d05d 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.min.js +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Scripts/parametersEditor.min.js @@ -1 +1 @@ -function initializeParametersEditor(t,e,a){var r={state:{parameters:e},addParameter:function(){this.state.parameters.push({name:"",value:""})},removeParameter:function(t){this.state.parameters.splice(t,1)},getParametersFormattedList:function(){return JSON.stringify(this.state.parameters.filter((function(t){return!IsNullOrWhiteSpace(t.name)})))}},o={template:"#parameters-modal",props:["data"],name:"parameters-modal",methods:{getParametersFormattedList:function(){return r.getParametersFormattedList()},showModal:function(){o.props.data.modal=new bootstrap.Modal(a[0]),o.props.data.modal.show()},closeModal:function(){o.props.data.modal.hide()}}};new Vue({components:{parametersTable:{template:"#parameters-table",props:["data"],name:"parameters-table",methods:{add:function(){r.addParameter()},remove:function(t){r.removeParameter(t)},getParametersFormattedList:function(){return r.getParametersFormattedList()}}},parametersModal:o},data:{sharedState:r.state,modal:null},el:t,methods:{showModal:function(){o.methods.showModal()}}})}function IsNullOrWhiteSpace(t){return null===t||null!==t.match(/^ *$/)} +function initializeParametersEditor(t,e,a){var r={state:{parameters:e},addParameter:function(){this.state.parameters.push({name:"",value:""})},removeParameter:function(t){this.state.parameters.splice(t,1)},getParametersFormattedList:function(){return JSON.stringify(this.state.parameters.filter(function(t){return!IsNullOrWhiteSpace(t.name)}))}},o={template:"#parameters-modal",props:["data"],name:"parameters-modal",methods:{getParametersFormattedList:function(){return r.getParametersFormattedList()},showModal:function(){o.props.data.modal=new bootstrap.Modal(a[0]),o.props.data.modal.show()},closeModal:function(){o.props.data.modal.hide()}}};new Vue({components:{parametersTable:{template:"#parameters-table",props:["data"],name:"parameters-table",methods:{add:function(){r.addParameter()},remove:function(t){r.removeParameter(t)},getParametersFormattedList:function(){return r.getParametersFormattedList()}}},parametersModal:o},data:{sharedState:r.state,modal:null},el:t,methods:{showModal:function(){o.methods.showModal()}}})}function IsNullOrWhiteSpace(t){return null===t||null!==t.match(/^ *$/)} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.css b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.css index 7c8d84e8665..0f37df5fab7 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.css +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.css @@ -1,3 +1,3 @@ .parameters-table .courrier { font-family: Courier New, Courier, monospace; -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.css.map b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.css.map new file mode 100644 index 00000000000..a9401462069 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA","sources":["style.css"],"sourcesContent":[".parameters-table .courrier {\n font-family: Courier New, Courier, monospace;\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.min.css b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.min.css index d66e99dd06e..dbab7e40f8b 100644 --- a/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.min.css +++ b/src/OrchardCore.Modules/OrchardCore.OpenId/wwwroot/Styles/parametersEditor.min.css @@ -1 +1 @@ -.parameters-table .courrier{font-family:Courier New,Courier,monospace} +.parameters-table .courrier{font-family:Courier New,Courier,monospace} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/Assets.json b/src/OrchardCore.Modules/OrchardCore.Rules/Assets.json deleted file mode 100644 index 919e17f871e..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Rules/Assets.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "inputs": [ - "Assets/scss/rules.scss" - ], - "output": "wwwroot/Styles/rules.css" - }, - { - "inputs": [ - "Assets/js/rules.js" - ], - "output": "wwwroot/Scripts/rules.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Rules/Assets2.json new file mode 100644 index 00000000000..aa8b6d37530 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Rules/Assets2.json @@ -0,0 +1,15 @@ +[ + { + "action": "sass", + "name": "rules", + "source": "Assets/scss/rules.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "min", + "name": "rules", + "source": "Assets/js/rules.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.js b/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.js index a05509342a1..b0664fdccdf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.js +++ b/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.js @@ -1,43 +1,41 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - function updateRuleOrders(conditionId, toConditionId, toPosition) { - var url = $('#ruleOrderUrl').data("url"); - var parameters = {}; - $('.ruleorderparameters').each(function (i, val) { - parameters[$(val).data("param")] = $(val).data("value"); - }); - parameters["__RequestVerificationToken"] = $("input[name='__RequestVerificationToken']").val(); - parameters["conditionId"] = conditionId; - parameters["toConditionId"] = toConditionId; - parameters["toPosition"] = toPosition; - $.ajax({ - url: url, - method: 'POST', - data: parameters, - error: function error(_error) { - alert($('#ruleOrderErrorMessage').data("message")); - } - }); + var url = $('#ruleOrderUrl').data("url"); + var parameters = {}; + $('.ruleorderparameters').each(function(i, val) { + parameters[$(val).data("param")] = $(val).data("value"); + }); + + parameters["__RequestVerificationToken"] = $("input[name='__RequestVerificationToken']").val(); + parameters["conditionId"] = conditionId; + parameters["toConditionId"] = toConditionId; + parameters["toPosition"] = toPosition; + + $.ajax({ + url: url, + method: 'POST', + data: parameters, + error: function (error) { + alert($('#ruleOrderErrorMessage').data("message")); + } + }); } + $(function () { - var sortableOptions = { - group: { - name: "sortable-list" - }, - animation: 250, - forceFallback: true, - fallbackOnBody: true, - swapThreshold: 0.65, - onEnd: function onEnd(evt) { - // When nesting groups use onEnd as onSort fires for every group it passes through. - updateRuleOrders($(evt.item).data("conditionid"), $(evt.item).parent().data("conditiongroupid"), evt.newIndex); + var sortableOptions = { + group: { + name: "sortable-list" + }, + animation: 250, + forceFallback: true, + fallbackOnBody: true, + swapThreshold: 0.65, + onEnd: function (evt) { + // When nesting groups use onEnd as onSort fires for every group it passes through. + updateRuleOrders($(evt.item).data("conditionid"), $(evt.item).parent().data("conditiongroupid"), evt.newIndex); + } + }; + var groups = document.querySelectorAll(".condition-group"); + for (var i = 0; i < groups.length; i++) { + new Sortable(groups[i], sortableOptions); } - }; - var groups = document.querySelectorAll(".condition-group"); - for (var i = 0; i < groups.length; i++) { - new Sortable(groups[i], sortableOptions); - } -}); \ No newline at end of file +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.map b/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.map new file mode 100644 index 00000000000..ca6fa1496a2 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["function updateRuleOrders(conditionId, toConditionId, toPosition) {\r\n var url = $('#ruleOrderUrl').data(\"url\");\r\n var parameters = {};\r\n $('.ruleorderparameters').each(function(i, val) {\r\n parameters[$(val).data(\"param\")] = $(val).data(\"value\");\r\n });\r\n\r\n parameters[\"__RequestVerificationToken\"] = $(\"input[name='__RequestVerificationToken']\").val();\r\n parameters[\"conditionId\"] = conditionId;\r\n parameters[\"toConditionId\"] = toConditionId;\r\n parameters[\"toPosition\"] = toPosition;\r\n\r\n $.ajax({\r\n url: url,\r\n method: 'POST',\r\n data: parameters,\r\n error: function (error) {\r\n alert($('#ruleOrderErrorMessage').data(\"message\"));\r\n }\r\n });\r\n}\r\n\r\n$(function () {\r\n var sortableOptions = {\r\n group: {\r\n name: \"sortable-list\"\r\n },\r\n animation: 250,\r\n forceFallback: true,\r\n fallbackOnBody: true,\r\n swapThreshold: 0.65,\r\n onEnd: function (evt) {\r\n // When nesting groups use onEnd as onSort fires for every group it passes through.\r\n updateRuleOrders($(evt.item).data(\"conditionid\"), $(evt.item).parent().data(\"conditiongroupid\"), evt.newIndex);\r\n }\r\n }; \r\n var groups = document.querySelectorAll(\".condition-group\");\r\n for (var i = 0; i < groups.length; i++) {\r\n new Sortable(groups[i], sortableOptions);\r\n }\r\n});\r\n"],"names":["updateRuleOrders","conditionId","toConditionId","toPosition","url","$","data","parameters","each","i","val","ajax","method","error","alert","sortableOptions","group","name","animation","forceFallback","fallbackOnBody","swapThreshold","onEnd","evt","item","parent","newIndex","groups","document","querySelectorAll","length","Sortable"],"mappings":"AAAA,SAASA,iBAAiBC,CAAW,CAAEC,CAAa,CAAEC,CAAU,EAC5D,IAAIC,EAAMC,EAAE,iBAAiBC,IAAI,CAAC,OAC9BC,EAAa,CAAC,EAClBF,EAAE,wBAAwBG,IAAI,CAAC,SAASC,CAAC,CAAEC,CAAG,EAC1CH,CAAU,CAACF,EAAEK,GAAKJ,IAAI,CAAC,SAAS,CAAGD,EAAEK,GAAKJ,IAAI,CAAC,QACnD,GAEAC,EAAW,0BAA6B,CAAGF,EAAE,4CAA4CK,GAAG,GAC5FH,EAAW,WAAc,CAAGN,EAC5BM,EAAW,aAAgB,CAAGL,EAC9BK,EAAW,UAAa,CAAGJ,EAE3BE,EAAEM,IAAI,CAAC,CACHP,IAAKA,EACLQ,OAAQ,OACRN,KAAMC,EACNM,MAAO,SAAUA,CAAK,EAClBC,MAAMT,EAAE,0BAA0BC,IAAI,CAAC,WAC3C,CACJ,EACJ,CAEAD,EAAE,WAeE,IAAK,IAdDU,EAAkB,CACpBC,MAAO,CACLC,KAAM,eACR,EACAC,UAAW,IACXC,cAAe,CAAA,EACfC,eAAgB,CAAA,EAChBC,cAAe,IACfC,MAAO,SAAUC,CAAG,EAElBvB,iBAAiBK,EAAEkB,EAAIC,IAAI,EAAElB,IAAI,CAAC,eAAgBD,EAAEkB,EAAIC,IAAI,EAAEC,MAAM,GAAGnB,IAAI,CAAC,oBAAqBiB,EAAIG,QAAQ,CAC/G,CACF,EACIC,EAASC,SAASC,gBAAgB,CAAC,oBAC9BpB,EAAI,EAAGA,EAAIkB,EAAOG,MAAM,CAAErB,IACjC,IAAIsB,SAASJ,CAAM,CAAClB,EAAE,CAAEM,EAE9B"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.min.js b/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.min.js index 8d9a9c5eb37..483cf2df402 100644 --- a/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Rules/wwwroot/Scripts/rules.min.js @@ -1 +1 @@ -function updateRuleOrders(e,a,r){var o=$("#ruleOrderUrl").data("url"),t={};$(".ruleorderparameters").each((function(e,a){t[$(a).data("param")]=$(a).data("value")})),t.__RequestVerificationToken=$("input[name='__RequestVerificationToken']").val(),t.conditionId=e,t.toConditionId=a,t.toPosition=r,$.ajax({url:o,method:"POST",data:t,error:function(e){alert($("#ruleOrderErrorMessage").data("message"))}})}$((function(){for(var e={group:{name:"sortable-list"},animation:250,forceFallback:!0,fallbackOnBody:!0,swapThreshold:.65,onEnd:function(e){updateRuleOrders($(e.item).data("conditionid"),$(e.item).parent().data("conditiongroupid"),e.newIndex)}},a=document.querySelectorAll(".condition-group"),r=0;r"],"sourcesContent":["function initializeCustomMetaTagsEditor(elem, data, modalBodyElement) {\r\n\r\n var store = {\r\n debug: false,\r\n state: {\r\n metaTags: data\r\n },\r\n addMetaTag: function () {\r\n this.state.metaTags.push({ content: '', name: '', property: '', charset: '', httpEquiv: '' });\r\n },\r\n removeMetaTag: function (index) {\r\n this.state.metaTags.splice(index, 1);\r\n },\r\n getMetaTagsFormattedList: function () {\r\n return JSON.stringify(this.state.metaTags);\r\n }\r\n }\r\n\r\n var metaTagsTable = {\r\n template: '#meta-tags-table',\r\n props: ['data'],\r\n name: 'meta-tags-table',\r\n methods: {\r\n add: function () {\r\n store.addMetaTag();\r\n },\r\n remove: function (index) {\r\n store.removeMetaTag(index);\r\n },\r\n getMetaTagsFormattedList: function () {\r\n return store.getMetaTagsFormattedList();\r\n }\r\n }\r\n };\r\n\r\n var metaTagsModal = {\r\n template: '#meta-tags-modal',\r\n props: ['data'],\r\n name: 'meta-tags-modal',\r\n methods: {\r\n getMetaTagsFormattedList: function () {\r\n return store.getMetaTagsFormattedList();\r\n },\r\n showModal: function () {\r\n metaTagsModal.props.data.modal = new bootstrap.Modal(modalBodyElement[0]);\r\n metaTagsModal.props.data.modal.show();\r\n },\r\n closeModal: function () {\r\n metaTagsModal.props.data.modal.hide();\r\n }\r\n }\r\n };\r\n\r\n new Vue({\r\n components: {\r\n metaTagsTable: metaTagsTable,\r\n metaTagsModal: metaTagsModal\r\n },\r\n data: {\r\n sharedState: store.state,\r\n modal: null\r\n },\r\n el: elem,\r\n methods: {\r\n showModal: function () {\r\n metaTagsModal.methods.showModal();\r\n }\r\n }\r\n });\r\n}\r\n"],"names":["initializeCustomMetaTagsEditor","elem","data","modalBodyElement","store","state","metaTags","addMetaTag","push","content","name","property","charset","httpEquiv","removeMetaTag","index","splice","getMetaTagsFormattedList","JSON","stringify","metaTagsModal","template","props","methods","showModal","modal","bootstrap","Modal","show","closeModal","hide","Vue","components","metaTagsTable","add","remove","sharedState","el"],"mappings":"AAAA,SAASA,+BAA+BC,CAAI,CAAEC,CAAI,CAAEC,CAAgB,EAEhE,IAAIC,EAAQ,CAERC,MAAO,CACHC,SAAUJ,CACd,EACAK,WAAY,WACR,IAAI,CAACF,KAAK,CAACC,QAAQ,CAACE,IAAI,CAAC,CAAEC,QAAS,GAAIC,KAAM,GAAIC,SAAU,GAAIC,QAAS,GAAIC,UAAW,EAAG,EAC/F,EACAC,cAAe,SAAUC,CAAK,EAC1B,IAAI,CAACV,KAAK,CAACC,QAAQ,CAACU,MAAM,CAACD,EAAO,EACtC,EACAE,yBAA0B,WACtB,OAAOC,KAAKC,SAAS,CAAC,IAAI,CAACd,KAAK,CAACC,QAAQ,CAC7C,CACJ,EAmBIc,EAAgB,CAChBC,SAAU,mBACVC,MAAO,CAAC,OAAO,CACfZ,KAAM,kBACNa,QAAS,CACLN,yBAA0B,WACtB,OAAOb,EAAMa,wBAAwB,EACzC,EACAO,UAAW,WACPJ,EAAcE,KAAK,CAACpB,IAAI,CAACuB,KAAK,CAAG,IAAIC,UAAUC,KAAK,CAACxB,CAAgB,CAAC,EAAE,EACxEiB,EAAcE,KAAK,CAACpB,IAAI,CAACuB,KAAK,CAACG,IAAI,EACvC,EACAC,WAAY,WACRT,EAAcE,KAAK,CAACpB,IAAI,CAACuB,KAAK,CAACK,IAAI,EACvC,CACJ,CACJ,EAEA,IAAIC,IAAI,CACJC,WAAY,CACRC,cArCY,CAChBZ,SAAU,mBACVC,MAAO,CAAC,OAAO,CACfZ,KAAM,kBACNa,QAAS,CACLW,IAAK,WACD9B,EAAMG,UAAU,EACpB,EACA4B,OAAQ,SAAUpB,CAAK,EACnBX,EAAMU,aAAa,CAACC,EACxB,EACAE,yBAA0B,WACtB,OAAOb,EAAMa,wBAAwB,EACzC,CACJ,CACJ,EAuBQG,cAAeA,CACnB,EACAlB,KAAM,CACFkC,YAAahC,EAAMC,KAAK,CACxBoB,MAAO,IACX,EACAY,GAAIpC,EACJsB,QAAS,CACLC,UAAW,WACPJ,EAAcG,OAAO,CAACC,SAAS,EACnC,CACJ,CACJ,EACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Scripts/customMetaTagsEditor.min.js b/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Scripts/customMetaTagsEditor.min.js index 8d90bea6b3e..23aa8c5c831 100644 --- a/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Scripts/customMetaTagsEditor.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Scripts/customMetaTagsEditor.min.js @@ -1 +1 @@ -function initializeCustomMetaTagsEditor(t,a,e){var o={debug:!1,state:{metaTags:a},addMetaTag:function(){this.state.metaTags.push({content:"",name:"",property:"",charset:"",httpEquiv:""})},removeMetaTag:function(t){this.state.metaTags.splice(t,1)},getMetaTagsFormattedList:function(){return JSON.stringify(this.state.metaTags)}},s={template:"#meta-tags-modal",props:["data"],name:"meta-tags-modal",methods:{getMetaTagsFormattedList:function(){return o.getMetaTagsFormattedList()},showModal:function(){s.props.data.modal=new bootstrap.Modal(e[0]),s.props.data.modal.show()},closeModal:function(){s.props.data.modal.hide()}}};new Vue({components:{metaTagsTable:{template:"#meta-tags-table",props:["data"],name:"meta-tags-table",methods:{add:function(){o.addMetaTag()},remove:function(t){o.removeMetaTag(t)},getMetaTagsFormattedList:function(){return o.getMetaTagsFormattedList()}}},metaTagsModal:s},data:{sharedState:o.state,modal:null},el:t,methods:{showModal:function(){s.methods.showModal()}}})} +function initializeCustomMetaTagsEditor(t,a,e){var o={state:{metaTags:a},addMetaTag:function(){this.state.metaTags.push({content:"",name:"",property:"",charset:"",httpEquiv:""})},removeMetaTag:function(t){this.state.metaTags.splice(t,1)},getMetaTagsFormattedList:function(){return JSON.stringify(this.state.metaTags)}},s={template:"#meta-tags-modal",props:["data"],name:"meta-tags-modal",methods:{getMetaTagsFormattedList:function(){return o.getMetaTagsFormattedList()},showModal:function(){s.props.data.modal=new bootstrap.Modal(e[0]),s.props.data.modal.show()},closeModal:function(){s.props.data.modal.hide()}}};new Vue({components:{metaTagsTable:{template:"#meta-tags-table",props:["data"],name:"meta-tags-table",methods:{add:function(){o.addMetaTag()},remove:function(t){o.removeMetaTag(t)},getMetaTagsFormattedList:function(){return o.getMetaTagsFormattedList()}}},metaTagsModal:s},data:{sharedState:o.state,modal:null},el:t,methods:{showModal:function(){s.methods.showModal()}}})} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.css b/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.css index f864f4c8b96..329a6a82642 100644 --- a/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.css +++ b/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.css @@ -1,3 +1,3 @@ .meta-tags-table .courier { font-family: Courier New, Courier, monospace; -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.css.map b/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.css.map new file mode 100644 index 00000000000..188c8016933 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA","sources":["style.css"],"sourcesContent":[".meta-tags-table .courier {\n font-family: Courier New, Courier, monospace;\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.min.css b/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.min.css index 946a96cce60..69536f7df5f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.min.css +++ b/src/OrchardCore.Modules/OrchardCore.Seo/wwwroot/Styles/customMetaTagsEditor.min.css @@ -1 +1 @@ -.meta-tags-table .courier{font-family:Courier New,Courier,monospace} +.meta-tags-table .courier{font-family:Courier New,Courier,monospace} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Assets.json b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Assets.json deleted file mode 100644 index 5dc46f6e97b..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Assets.json +++ /dev/null @@ -1,21 +0,0 @@ -[ - { - "generateRTL": true, - "inputs": [ - "Assets/scss/shortcodes.scss" - ], - "output": "wwwroot/Styles/shortcodes.css" - }, - { - "inputs": [ - "Assets/js/shortcodes.js" - ], - "output": "wwwroot/Scripts/shortcodes.js" - }, - { - "inputs": [ - "Assets/js/shortcode-templates.js" - ], - "output": "wwwroot/Scripts/shortcode-templates.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Assets2.json new file mode 100644 index 00000000000..295c8361e72 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/Assets2.json @@ -0,0 +1,22 @@ +[ + { + "action": "sass", + "name": "shortcodes", + "source": "Assets/scss/shortcodes.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "min", + "name": "shortcodes", + "source": "Assets/js/shortcodes.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "min", + "name": "shortcodes-templates", + "source": "Assets/js/shortcode-templates.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.js b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.js index a6aec5c3661..d73a7f590e4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.js +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.js @@ -1,78 +1,73 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - function initializeShortcodesTemplateEditor(categoriesElement, contentElement, usageElement, previewElement, nameElement, hintElement) { - if (contentElement) { - CodeMirror.fromTextArea(contentElement, { - autoCloseTags: true, - autoRefresh: true, - lineNumbers: true, - lineWrapping: true, - matchBrackets: true, - styleActiveLine: true, - mode: { - name: "liquid" - } - }); - } - if (usageElement) { - var editor = CodeMirror.fromTextArea(usageElement, { - autoCloseTags: true, - autoRefresh: true, - lineNumbers: true, - lineWrapping: true, - matchBrackets: true, - styleActiveLine: true, - mode: { - name: "htmlmixed" - } - }); - if (previewElement) { - editor.on('change', function (e) { - $(previewElement).show(); - $(previewElement).find('.shortcode-usage').html(e.doc.getValue()); - }); + if (contentElement) { + CodeMirror.fromTextArea(contentElement, { + autoCloseTags: true, + autoRefresh: true, + lineNumbers: true, + lineWrapping: true, + matchBrackets: true, + styleActiveLine: true, + mode: { name: "liquid" } + }); } - } - if (nameElement && previewElement) { - $(nameElement).on('keyup paste', function () { - $(previewElement).show(); - $(previewElement).find('.shortcode-name').html($(this).val()); - }); - } - if (hintElement && previewElement) { - $(hintElement).on('keyup paste', function () { - $(previewElement).show(); - $(previewElement).find('.shortcode-hint').html($(this).val()); - }); - } - if (categoriesElement) { - var vueMultiselect = Vue.component('vue-multiselect', window.VueMultiselect["default"]); - var vm = new Vue({ - el: categoriesElement, - components: { - 'vue-multiselect': vueMultiselect - }, - data: function data() { - var allCategories = JSON.parse(categoriesElement.dataset.categories || "[]"); - var selectedCategories = JSON.parse(categoriesElement.dataset.selectedCategories || "[]"); - return { - value: selectedCategories, - options: allCategories - }; - }, - methods: { - getSelectedCategories: function getSelectedCategories() { - return JSON.stringify(this.value); - }, - addCategory: function addCategory(category) { - this.options.push(category); - this.value.push(category); + + if (usageElement) { + var editor = CodeMirror.fromTextArea(usageElement, { + autoCloseTags: true, + autoRefresh: true, + lineNumbers: true, + lineWrapping: true, + matchBrackets: true, + styleActiveLine: true, + mode: { name: "htmlmixed" } + }); + if (previewElement) { + editor.on('change', function (e) { + $(previewElement).show(); + $(previewElement).find('.shortcode-usage').html(e.doc.getValue()); + }); } - } - }); - return vm; - } -} \ No newline at end of file + } + + if (nameElement && previewElement) { + $(nameElement).on('keyup paste', function () { + $(previewElement).show(); + $(previewElement).find('.shortcode-name').html($(this).val()) + }); + } + + if (hintElement && previewElement) { + $(hintElement).on('keyup paste', function () { + $(previewElement).show(); + $(previewElement).find('.shortcode-hint').html($(this).val()) + }); + } + + if (categoriesElement) { + var vueMultiselect = Vue.component('vue-multiselect', window.VueMultiselect["default"]); + var vm = new Vue({ + el: categoriesElement, + components: { + 'vue-multiselect': vueMultiselect + }, + data: function data() { + var allCategories = JSON.parse(categoriesElement.dataset.categories || "[]"); + var selectedCategories = JSON.parse(categoriesElement.dataset.selectedCategories || "[]"); + return { + value: selectedCategories, + options: allCategories + }; + }, + methods: { + getSelectedCategories() { + return JSON.stringify(this.value); + }, + addCategory(category) { + this.options.push(category); + this.value.push(category); + } + } + }); + return vm; + } +} diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.map b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.map new file mode 100644 index 00000000000..fd31a658de8 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["function initializeShortcodesTemplateEditor(categoriesElement, contentElement, usageElement, previewElement, nameElement, hintElement) {\r\n if (contentElement) {\r\n CodeMirror.fromTextArea(contentElement, {\r\n autoCloseTags: true,\r\n autoRefresh: true,\r\n lineNumbers: true,\r\n lineWrapping: true,\r\n matchBrackets: true,\r\n styleActiveLine: true,\r\n mode: { name: \"liquid\" }\r\n });\r\n }\r\n\r\n if (usageElement) {\r\n var editor = CodeMirror.fromTextArea(usageElement, {\r\n autoCloseTags: true,\r\n autoRefresh: true,\r\n lineNumbers: true,\r\n lineWrapping: true,\r\n matchBrackets: true,\r\n styleActiveLine: true,\r\n mode: { name: \"htmlmixed\" }\r\n });\r\n if (previewElement) {\r\n editor.on('change', function (e) {\r\n $(previewElement).show();\r\n $(previewElement).find('.shortcode-usage').html(e.doc.getValue());\r\n });\r\n }\r\n }\r\n\r\n if (nameElement && previewElement) {\r\n $(nameElement).on('keyup paste', function () {\r\n $(previewElement).show();\r\n $(previewElement).find('.shortcode-name').html($(this).val())\r\n });\r\n }\r\n\r\n if (hintElement && previewElement) {\r\n $(hintElement).on('keyup paste', function () {\r\n $(previewElement).show();\r\n $(previewElement).find('.shortcode-hint').html($(this).val())\r\n });\r\n }\r\n\r\n if (categoriesElement) {\r\n var vueMultiselect = Vue.component('vue-multiselect', window.VueMultiselect[\"default\"]);\r\n var vm = new Vue({\r\n el: categoriesElement,\r\n components: {\r\n 'vue-multiselect': vueMultiselect\r\n },\r\n data: function data() {\r\n var allCategories = JSON.parse(categoriesElement.dataset.categories || \"[]\");\r\n var selectedCategories = JSON.parse(categoriesElement.dataset.selectedCategories || \"[]\");\r\n return {\r\n value: selectedCategories,\r\n options: allCategories\r\n };\r\n },\r\n methods: {\r\n getSelectedCategories() {\r\n return JSON.stringify(this.value);\r\n },\r\n addCategory(category) {\r\n this.options.push(category);\r\n this.value.push(category);\r\n }\r\n }\r\n });\r\n return vm;\r\n }\r\n}\r\n"],"names":["initializeShortcodesTemplateEditor","categoriesElement","contentElement","usageElement","previewElement","nameElement","hintElement","CodeMirror","fromTextArea","autoCloseTags","autoRefresh","lineNumbers","lineWrapping","matchBrackets","styleActiveLine","mode","name","editor","on","e","$","show","find","html","doc","getValue","val","vueMultiselect","Vue","component","window","VueMultiselect","el","components","data","allCategories","JSON","parse","dataset","categories","value","selectedCategories","options","methods","getSelectedCategories","stringify","addCategory","category","push"],"mappings":"AAAA,SAASA,mCAAmCC,CAAiB,CAAEC,CAAc,CAAEC,CAAY,CAAEC,CAAc,CAAEC,CAAW,CAAEC,CAAW,EAajI,GAZIJ,GACAK,WAAWC,YAAY,CAACN,EAAgB,CACpCO,cAAe,CAAA,EACfC,YAAa,CAAA,EACbC,YAAa,CAAA,EACbC,aAAc,CAAA,EACdC,cAAe,CAAA,EACfC,gBAAiB,CAAA,EACjBC,KAAM,CAAEC,KAAM,QAAS,CAC3B,GAGAb,EAAc,CACd,IAAIc,EAASV,WA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,IAAI,CAACP,KAAK,CAACQ,IAAI,CAACD,EACpB,CACJ,CACJ,EAEJ,CACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.min.js b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.min.js index cedbd921bc7..011c9ca7006 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcode-templates.min.js @@ -1 +1 @@ -function initializeShortcodesTemplateEditor(e,t,o,i,a,n){if(t&&CodeMirror.fromTextArea(t,{autoCloseTags:!0,autoRefresh:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,styleActiveLine:!0,mode:{name:"liquid"}}),o){var s=CodeMirror.fromTextArea(o,{autoCloseTags:!0,autoRefresh:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,styleActiveLine:!0,mode:{name:"htmlmixed"}});i&&s.on("change",(function(e){$(i).show(),$(i).find(".shortcode-usage").html(e.doc.getValue())}))}if(a&&i&&$(a).on("keyup paste",(function(){$(i).show(),$(i).find(".shortcode-name").html($(this).val())})),n&&i&&$(n).on("keyup paste",(function(){$(i).show(),$(i).find(".shortcode-hint").html($(this).val())})),e){var r=Vue.component("vue-multiselect",window.VueMultiselect.default);return new Vue({el:e,components:{"vue-multiselect":r},data:function(){var t=JSON.parse(e.dataset.categories||"[]");return{value:JSON.parse(e.dataset.selectedCategories||"[]"),options:t}},methods:{getSelectedCategories:function(){return JSON.stringify(this.value)},addCategory:function(e){this.options.push(e),this.value.push(e)}}})}} +function initializeShortcodesTemplateEditor(e,t,o,i,a,s){if(t&&CodeMirror.fromTextArea(t,{autoCloseTags:!0,autoRefresh:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,styleActiveLine:!0,mode:{name:"liquid"}}),o){var n=CodeMirror.fromTextArea(o,{autoCloseTags:!0,autoRefresh:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,styleActiveLine:!0,mode:{name:"htmlmixed"}});i&&n.on("change",function(e){$(i).show(),$(i).find(".shortcode-usage").html(e.doc.getValue())})}if(a&&i&&$(a).on("keyup paste",function(){$(i).show(),$(i).find(".shortcode-name").html($(this).val())}),s&&i&&$(s).on("keyup paste",function(){$(i).show(),$(i).find(".shortcode-hint").html($(this).val())}),e){var r=Vue.component("vue-multiselect",window.VueMultiselect.default);return new Vue({el:e,components:{"vue-multiselect":r},data:function(){var t=JSON.parse(e.dataset.categories||"[]");return{value:JSON.parse(e.dataset.selectedCategories||"[]"),options:t}},methods:{getSelectedCategories(){return JSON.stringify(this.value)},addCategory(e){this.options.push(e),this.value.push(e)}}})}} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.js b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.js index ee52ea072b4..6d1dcddec41 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.js +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.js @@ -1,133 +1,143 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - /// jQuery helper to append text to a textarea or input. jQuery.fn.extend({ - insertAtCaret: function insertAtCaret(myValue) { - return this.each(function (i) { - if (document.selection) { - //For browsers like Internet Explorer - this.focus(); - sel = document.selection.createRange(); - sel.text = myValue; - this.focus(); - } else if (this.selectionStart || this.selectionStart === "0") { - //For browsers like Firefox and Webkit based - var startPos = this.selectionStart; - var endPos = this.selectionEnd; - var scrollTop = this.scrollTop; - this.value = this.value.substring(0, startPos) + myValue + this.value.substring(endPos, this.value.length); - this.focus(); - this.selectionStart = startPos + myValue.length; - this.selectionEnd = startPos + myValue.length; - this.scrollTop = scrollTop; - } else { - this.value += myValue; - this.focus(); - } - }); - } + insertAtCaret: function (myValue) { + return this.each(function (i) { + if (document.selection) { + //For browsers like Internet Explorer + this.focus(); + sel = document.selection.createRange(); + sel.text = myValue; + this.focus(); + } else if (this.selectionStart || this.selectionStart === "0") { + //For browsers like Firefox and Webkit based + var startPos = this.selectionStart; + var endPos = this.selectionEnd; + var scrollTop = this.scrollTop; + this.value = this.value.substring(0, startPos) + myValue + this.value.substring(endPos, this.value.length); + this.focus(); + this.selectionStart = startPos + myValue.length; + this.selectionEnd = startPos + myValue.length; + this.scrollTop = scrollTop; + } else { + this.value += myValue; + this.focus(); + } + }); + } }); -var shortcodeWrapperTemplate = "\n
\n"; -var shortcodeBtnTemplate = "\n\n"; + +const shortcodeWrapperTemplate = ` +
+`; + +const shortcodeBtnTemplate = ` + +`; // Wraps each .shortcode-modal-input class with a wrapper, and attaches detaches the shortcode app as required. $(function () { - $('.shortcode-modal-input').each(function () { - $(this).wrap(shortcodeWrapperTemplate); - $(this).parent().append(shortcodeBtnTemplate); - }); - $('.shortcode-modal-btn').on('click', function () { - var input = $(this).siblings('.shortcode-modal-input'); - shortcodesApp.init(function (defaultValue) { - input.insertAtCaret(defaultValue); + $('.shortcode-modal-input').each(function () { + $(this).wrap(shortcodeWrapperTemplate); + $(this).parent().append(shortcodeBtnTemplate); }); - }); -}); + + $('.shortcode-modal-btn').on('click', function() { + var input = $(this).siblings('.shortcode-modal-input'); + + shortcodesApp.init(function (defaultValue) { + input.insertAtCaret(defaultValue); + }); + }); +}) + var shortcodesApp; + function initializeShortcodesApp(element) { - if (element && !shortcodesApp) { - var elementId = element.id; - shortcodesApp = new Vue({ - el: '#' + elementId, - data: function data() { - var shortcodes = JSON.parse(element.dataset.shortcodes || "[]"); - var categories = JSON.parse(element.dataset.categories || "[]"); - return { - filter: '', - allShortcodes: shortcodes, - filteredShortcodes: shortcodes, - categories: categories, - defaultValue: '', - modal: null - }; - }, - watch: { - filter: function filter(_filter) { - if (_filter) { - var lower = _filter.toLowerCase(); - this.filteredShortcodes = this.allShortcodes.filter(function (s) { - return s.name.startsWith(lower); - }); - } else { - this.filteredShortcodes = this.allShortcodes; - } - } - }, - methods: { - init: function init(onClose) { - if (onClose) { - this.onClose = onClose; - } - this.selectedValue = ''; - this.modal = new bootstrap.Modal(this.$el); - this.modal.show(); - var self = this; - $(this.$el).on('shown.bs.modal', function (e) { - self.$refs.filter.focus(); - }); - }, - onClose: function onClose(defaultValue) { - return; - }, - setCategory: function setCategory(category) { - if (category) { - this.filteredShortcodes = this.allShortcodes.filter(function (s) { - return s.categories.some(function (c) { - return c.toLowerCase() === category.toLowerCase(); - }); - }); - } else { - this.filteredShortcodes = this.allShortcodes; - } - this.filter = ''; - }, - isVisible: function isVisible(name) { - return this.filteredShortcodes.some(function (s) { - return s.name === name; - }); - }, - insertShortcode: function insertShortcode(event) { - this.defaultValue = event.target.dataset.defaultValue; - this.modal.hide(); - this.onClose(this.defaultValue); - } - } - }); - return shortcodesApp; - } + if (element && !shortcodesApp) { + var elementId = element.id; + + shortcodesApp = new Vue({ + el: '#' + elementId, + data : function () { + + var shortcodes = JSON.parse(element.dataset.shortcodes || "[]"); + var categories = JSON.parse(element.dataset.categories || "[]"); + + return { + filter: '', + allShortcodes: shortcodes, + filteredShortcodes: shortcodes, + categories: categories, + defaultValue: '', + modal: null + } + }, + watch: + { + filter(filter) { + if (filter) { + var lower = filter.toLowerCase(); + this.filteredShortcodes = this.allShortcodes + .filter(s => s.name.startsWith(lower)); + } else { + this.filteredShortcodes = this.allShortcodes; + } + } + }, + methods: { + init(onClose) + { + if (onClose) { + this.onClose = onClose; + } + this.selectedValue = ''; + this.modal = new bootstrap.Modal(this.$el); + this.modal.show(); + var self = this; + $(this.$el).on('shown.bs.modal', function (e) { + self.$refs.filter.focus(); + }); + }, + onClose(defaultValue) + { + return; + }, + setCategory(category) + { + if (category) { + this.filteredShortcodes = this.allShortcodes + .filter(s => s.categories.some(c => c.toLowerCase() === category.toLowerCase())); + } else { + this.filteredShortcodes = this.allShortcodes; + } + this.filter = ''; + }, + isVisible(name) { + return this.filteredShortcodes.some(s => s.name === name); + }, + insertShortcode(event) { + this.defaultValue = event.target.dataset.defaultValue; + this.modal.hide(); + this.onClose(this.defaultValue); + } + } + }); + + return shortcodesApp; + } } // initializes a code mirror editor with a shortcode modal. function initializeCodeMirrorShortcodeWrapper(editor) { - var codemirrorWrapper = editor.display.wrapper; - $(codemirrorWrapper).wrap(shortcodeWrapperTemplate); - $(codemirrorWrapper).parent().append(shortcodeBtnTemplate); - $(codemirrorWrapper).siblings('.shortcode-modal-btn').on('click', function () { - shortcodesApp.init(function (defaultValue) { - editor.replaceSelection(defaultValue); - }); - }); -} \ No newline at end of file + const codemirrorWrapper = editor.display.wrapper; + + $(codemirrorWrapper).wrap(shortcodeWrapperTemplate); + $(codemirrorWrapper).parent().append(shortcodeBtnTemplate); + $(codemirrorWrapper).siblings('.shortcode-modal-btn').on('click', function () { + shortcodesApp.init(function (defaultValue) { + editor.replaceSelection(defaultValue); + }); + }); +} diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.map b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.map new file mode 100644 index 00000000000..8ad7e2449f6 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["/// jQuery helper to append text to a textarea or input.\r\njQuery.fn.extend({\r\n insertAtCaret: function (myValue) {\r\n return this.each(function (i) {\r\n if (document.selection) {\r\n //For browsers like Internet Explorer\r\n this.focus();\r\n sel = document.selection.createRange();\r\n sel.text = myValue;\r\n this.focus();\r\n } else if (this.selectionStart || this.selectionStart === \"0\") {\r\n //For browsers like Firefox and Webkit based\r\n var startPos = this.selectionStart;\r\n var endPos = this.selectionEnd;\r\n var scrollTop = this.scrollTop;\r\n this.value = this.value.substring(0, startPos) + myValue + this.value.substring(endPos, this.value.length);\r\n this.focus();\r\n this.selectionStart = startPos + myValue.length;\r\n this.selectionEnd = startPos + myValue.length;\r\n this.scrollTop = scrollTop;\r\n } else {\r\n this.value += myValue;\r\n this.focus();\r\n }\r\n });\r\n }\r\n});\r\n\r\nconst shortcodeWrapperTemplate = `\r\n
\r\n`;\r\n\r\nconst shortcodeBtnTemplate = `\r\n\r\n`;\r\n\r\n// Wraps each .shortcode-modal-input class with a wrapper, and attaches detaches the shortcode app as required.\r\n$(function () {\r\n $('.shortcode-modal-input').each(function () {\r\n $(this).wrap(shortcodeWrapperTemplate);\r\n $(this).parent().append(shortcodeBtnTemplate);\r\n });\r\n\r\n $('.shortcode-modal-btn').on('click', function() {\r\n var input = $(this).siblings('.shortcode-modal-input');\r\n\r\n shortcodesApp.init(function (defaultValue) {\r\n input.insertAtCaret(defaultValue);\r\n }); \r\n });\r\n})\r\n\r\nvar shortcodesApp;\r\n\r\nfunction initializeShortcodesApp(element) {\r\n if (element && !shortcodesApp) {\r\n var elementId = element.id;\r\n\r\n shortcodesApp = new Vue({\r\n el: '#' + elementId,\r\n data : function () {\r\n \r\n var shortcodes = JSON.parse(element.dataset.shortcodes || \"[]\");\r\n var categories = JSON.parse(element.dataset.categories || \"[]\");\r\n\r\n return {\r\n filter: '',\r\n allShortcodes: shortcodes,\r\n filteredShortcodes: shortcodes,\r\n categories: categories,\r\n defaultValue: '',\r\n modal: null\r\n }\r\n },\r\n watch:\r\n {\r\n filter(filter) {\r\n if (filter) {\r\n var lower = filter.toLowerCase();\r\n this.filteredShortcodes = this.allShortcodes\r\n .filter(s => s.name.startsWith(lower));\r\n } else {\r\n this.filteredShortcodes = this.allShortcodes;\r\n }\r\n }\r\n }, \r\n methods: {\r\n init(onClose)\r\n {\r\n if (onClose) {\r\n this.onClose = onClose;\r\n }\r\n this.selectedValue = '';\r\n this.modal = new bootstrap.Modal(this.$el);\r\n this.modal.show();\r\n var self = this;\r\n $(this.$el).on('shown.bs.modal', function (e) {\r\n self.$refs.filter.focus();\r\n });\r\n },\r\n onClose(defaultValue)\r\n {\r\n return;\r\n },\r\n setCategory(category)\r\n {\r\n if (category) {\r\n this.filteredShortcodes = this.allShortcodes\r\n .filter(s => s.categories.some(c => c.toLowerCase() === category.toLowerCase()));\r\n } else {\r\n this.filteredShortcodes = this.allShortcodes;\r\n }\r\n this.filter = '';\r\n }, \r\n isVisible(name) {\r\n return this.filteredShortcodes.some(s => s.name === name);\r\n },\r\n insertShortcode(event) {\r\n this.defaultValue = event.target.dataset.defaultValue;\r\n this.modal.hide();\r\n this.onClose(this.defaultValue);\r\n }\r\n }\r\n });\r\n\r\n return shortcodesApp;\r\n }\r\n}\r\n\r\n// initializes a code mirror editor with a shortcode modal.\r\nfunction initializeCodeMirrorShortcodeWrapper(editor) {\r\n const codemirrorWrapper = editor.display.wrapper;\r\n\r\n $(codemirrorWrapper).wrap(shortcodeWrapperTemplate);\r\n $(codemirrorWrapper).parent().append(shortcodeBtnTemplate);\r\n $(codemirrorWrapper).siblings('.shortcode-modal-btn').on('click', function () {\r\n shortcodesApp.init(function (defaultValue) {\r\n editor.replaceSelection(defaultValue); \r\n }); \r\n }); \r\n}\r\n"],"names":["shortcodesApp","jQuery","fn","extend","insertAtCaret","myValue","each","i","document","selection","focus","sel","createRange","text","selectionStart","startPos","endPos","selectionEnd","scrollTop","value","substring","length","shortcodeWrapperTemplate","shortcodeBtnTemplate","initializeShortcodesApp","element","Vue","el","id","data","shortcodes","JSON","parse","dataset","filter","allShortcodes","filteredShortcodes","categories","defaultValue","modal","watch","lower","toLowerCase","s","name","startsWith","methods","init","onClose","selectedValue","bootstrap","Modal","$el","show","self","$","on","e","$refs","setCategory","category","some","c","isVisible","insertShortcode","event","target","hide","initializeCodeMirrorShortcodeWrapper","editor","codemirrorWrapper","display","wrapper","wrap","parent","append","siblings","replaceSelection","input"],"mappings":"IAsDIA,cArDJC,OAAOC,EAAE,CAACC,MAAM,CAAC,CACbC,cAAe,S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IAAI,CAACV,YAAY,CAClC,CACJ,CACJ,EAIR,CAGA,SAAS8B,qCAAqCC,CAAM,EAChD,IAAMC,EAAoBD,EAAOE,OAAO,CAACC,OAAO,CAEhDjB,EAAEe,GAAmBG,IAAI,CAACnD,0BAC1BiC,EAAEe,GAAmBI,MAAM,GAAGC,MAAM,CAACpD,sBACrCgC,EAAEe,GAAmBM,QAAQ,CAAC,wBAAwBpB,EAAE,CAAC,QAAS,WAC9DxD,cAAc+C,IAAI,CAAC,SAAUT,CAAY,EACrC+B,EAAOQ,gBAAgB,CAACvC,EAC5B,EACJ,EACJ,CAvGAiB,EAAE,WACEA,EAAE,0BAA0BjD,IAAI,CAAC,WAC7BiD,EAAE,IAAI,EAAEkB,IAAI,CAACnD,0BACbiC,EAAE,IAAI,EAAEmB,MAAM,GAAGC,MAAM,CAACpD,qBAC5B,GAEAgC,EAAE,wBAAwBC,EAAE,CAAC,QAAS,WAClC,IAAIsB,EAAQvB,EAAE,IAAI,EAAEqB,QAAQ,CAAC,0BAE7B5E,cAAc+C,IAAI,CAAC,SAAUT,CAAY,EACrCwC,EAAM1E,aAAa,CAACkC,EACxB,EACJ,EACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.min.js b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.min.js index 08f3b3f74de..53763ba4f26 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Scripts/shortcodes.min.js @@ -1 +1,7 @@ -jQuery.fn.extend({insertAtCaret:function(t){return this.each((function(e){if(document.selection)this.focus(),sel=document.selection.createRange(),sel.text=t,this.focus();else if(this.selectionStart||"0"===this.selectionStart){var o=this.selectionStart,s=this.selectionEnd,i=this.scrollTop;this.value=this.value.substring(0,o)+t+this.value.substring(s,this.value.length),this.focus(),this.selectionStart=o+t.length,this.selectionEnd=o+t.length,this.scrollTop=i}else this.value+=t,this.focus()}))}});var shortcodesApp,shortcodeWrapperTemplate='\n
\n',shortcodeBtnTemplate='\n\n';function initializeShortcodesApp(t){if(t&&!shortcodesApp){var e=t.id;return shortcodesApp=new Vue({el:"#"+e,data:function(){var e=JSON.parse(t.dataset.shortcodes||"[]");return{filter:"",allShortcodes:e,filteredShortcodes:e,categories:JSON.parse(t.dataset.categories||"[]"),defaultValue:"",modal:null}},watch:{filter:function(t){if(t){var e=t.toLowerCase();this.filteredShortcodes=this.allShortcodes.filter((function(t){return t.name.startsWith(e)}))}else this.filteredShortcodes=this.allShortcodes}},methods:{init:function(t){t&&(this.onClose=t),this.selectedValue="",this.modal=new bootstrap.Modal(this.$el),this.modal.show();var e=this;$(this.$el).on("shown.bs.modal",(function(t){e.$refs.filter.focus()}))},onClose:function(t){},setCategory:function(t){this.filteredShortcodes=t?this.allShortcodes.filter((function(e){return e.categories.some((function(e){return e.toLowerCase()===t.toLowerCase()}))})):this.allShortcodes,this.filter=""},isVisible:function(t){return this.filteredShortcodes.some((function(e){return e.name===t}))},insertShortcode:function(t){this.defaultValue=t.target.dataset.defaultValue,this.modal.hide(),this.onClose(this.defaultValue)}}})}}function initializeCodeMirrorShortcodeWrapper(t){var e=t.display.wrapper;$(e).wrap(shortcodeWrapperTemplate),$(e).parent().append(shortcodeBtnTemplate),$(e).siblings(".shortcode-modal-btn").on("click",(function(){shortcodesApp.init((function(e){t.replaceSelection(e)}))}))}$((function(){$(".shortcode-modal-input").each((function(){$(this).wrap(shortcodeWrapperTemplate),$(this).parent().append(shortcodeBtnTemplate)})),$(".shortcode-modal-btn").on("click",(function(){var t=$(this).siblings(".shortcode-modal-input");shortcodesApp.init((function(e){t.insertAtCaret(e)}))}))})); +var shortcodesApp;jQuery.fn.extend({insertAtCaret:function(t){return this.each(function(e){if(document.selection)this.focus(),(sel=document.selection.createRange()).text=t,this.focus();else if(this.selectionStart||"0"===this.selectionStart){var s=this.selectionStart,o=this.selectionEnd,i=this.scrollTop;this.value=this.value.substring(0,s)+t+this.value.substring(o,this.value.length),this.focus(),this.selectionStart=s+t.length,this.selectionEnd=s+t.length,this.scrollTop=i}else this.value+=t,this.focus()})}});let shortcodeWrapperTemplate=` +
+`,shortcodeBtnTemplate=` + +`;function initializeShortcodesApp(t){if(t&&!shortcodesApp)return shortcodesApp=new Vue({el:"#"+t.id,data:function(){var e=JSON.parse(t.dataset.shortcodes||"[]");return{filter:"",allShortcodes:e,filteredShortcodes:e,categories:JSON.parse(t.dataset.categories||"[]"),defaultValue:"",modal:null}},watch:{filter(t){if(t){var e=t.toLowerCase();this.filteredShortcodes=this.allShortcodes.filter(t=>t.name.startsWith(e))}else this.filteredShortcodes=this.allShortcodes}},methods:{init(t){t&&(this.onClose=t),this.selectedValue="",this.modal=new bootstrap.Modal(this.$el),this.modal.show();var e=this;$(this.$el).on("shown.bs.modal",function(t){e.$refs.filter.focus()})},onClose(t){},setCategory(t){t?this.filteredShortcodes=this.allShortcodes.filter(e=>e.categories.some(e=>e.toLowerCase()===t.toLowerCase())):this.filteredShortcodes=this.allShortcodes,this.filter=""},isVisible(t){return this.filteredShortcodes.some(e=>e.name===t)},insertShortcode(t){this.defaultValue=t.target.dataset.defaultValue,this.modal.hide(),this.onClose(this.defaultValue)}}})}function initializeCodeMirrorShortcodeWrapper(t){let e=t.display.wrapper;$(e).wrap(shortcodeWrapperTemplate),$(e).parent().append(shortcodeBtnTemplate),$(e).siblings(".shortcode-modal-btn").on("click",function(){shortcodesApp.init(function(e){t.replaceSelection(e)})})}$(function(){$(".shortcode-modal-input").each(function(){$(this).wrap(shortcodeWrapperTemplate),$(this).parent().append(shortcodeBtnTemplate)}),$(".shortcode-modal-btn").on("click",function(){var t=$(this).siblings(".shortcode-modal-input");shortcodesApp.init(function(e){t.insertAtCaret(e)})})}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.css b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.css index 154b9768ccb..501cda8f2f7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.css +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.css @@ -1,11 +1,8 @@ .shortcode-modal-btn { position: absolute; top: 0; - z-index: 500; -}[dir=ltr] .shortcode-modal-btn { right: 0; -}[dir=rtl] .shortcode-modal-btn { - left: 0; + z-index: 500; } .shortcode-modal-btn svg { width: 24px; @@ -30,4 +27,4 @@ [data-bs-theme=dark] .icon-shortcode::after { content: url(../Icons/shortcode-dark.svg); -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.css.map b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.css.map new file mode 100644 index 00000000000..df4eeb5bb16 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA,iEAMA,oCAIA,2CAIA,sBACE,8CAIF,kCAIA,gEAIA","sources":["style.css"],"sourcesContent":[".shortcode-modal-btn {\n position: absolute;\n top: 0;\n right: 0;\n z-index: 500;\n}\n.shortcode-modal-btn svg {\n width: 24px;\n}\n\n.shortcode-modal-wrapper {\n position: relative;\n}\n\n@media (min-width: 992px) {\n .modal-shortcodes .modal-lg {\n max-width: 1200px;\n }\n}\n#shortcodePreview {\n max-width: 310px;\n}\n\n.icon-shortcode::after {\n content: url(../Icons/shortcode-light.svg);\n}\n\n[data-bs-theme=dark] .icon-shortcode::after {\n content: url(../Icons/shortcode-dark.svg);\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.min.css b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.min.css index b2f9e2364a9..a54f011c325 100644 --- a/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.min.css +++ b/src/OrchardCore.Modules/OrchardCore.Shortcodes/wwwroot/Styles/shortcodes.min.css @@ -1 +1 @@ -.shortcode-modal-btn{position:absolute;top:0;z-index:500}[dir=ltr] .shortcode-modal-btn{right:0}[dir=rtl] .shortcode-modal-btn{left:0}.shortcode-modal-btn svg{width:24px}.shortcode-modal-wrapper{position:relative}@media (min-width:992px){.modal-shortcodes .modal-lg{max-width:1200px}}#shortcodePreview{max-width:310px}.icon-shortcode::after{content:url(../Icons/shortcode-light.svg)}[data-bs-theme=dark] .icon-shortcode::after{content:url(../Icons/shortcode-dark.svg)} +.shortcode-modal-btn{z-index:500;position:absolute;top:0;right:0}.shortcode-modal-btn svg{width:24px}.shortcode-modal-wrapper{position:relative}@media (width>=992px){.modal-shortcodes .modal-lg{max-width:1200px}}#shortcodePreview{max-width:310px}.icon-shortcode:after{content:url(../Icons/shortcode-light.svg)}[data-bs-theme=dark] .icon-shortcode:after{content:url(../Icons/shortcode-dark.svg)} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets.json b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets.json deleted file mode 100644 index 5a65a562703..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "inputs": [ - "Assets/scss/menu.scss" - ], - "output": "wwwroot/Styles/menu.css" - }, - { - "inputs": [ - "Assets/scss/tags-editor.scss" - ], - "output": "wwwroot/Styles/tags-editor.css" - }, - { - "inputs": [ - "Assets/js/jquery.mjs.nestedSortable.js" - ], - "output": "wwwroot/Scripts/menu.js" - }, - { - "inputs": [ - "Assets/js/activate-links.js" - ], - "output": "wwwroot/Scripts/activate-links.js" - }, - { - "inputs": [ - "Assets/js/tags-editor.js" - ], - "output": "wwwroot/Scripts/tags-editor.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets/js/jquery.mjs.nestedSortable.js b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets/js/menu.js similarity index 100% rename from src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets/js/jquery.mjs.nestedSortable.js rename to src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets/js/menu.js diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets2.json new file mode 100644 index 00000000000..7ac527124b0 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/Assets2.json @@ -0,0 +1,35 @@ +[ + { + "action": "sass", + "name": "taxonomies-menu", + "source": "Assets/scss/menu.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "sass", + "name": "taxonomies-tags-editor", + "source": "Assets/scss/tags-editor.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "min", + "name": "taxonomies-menu", + "source": "Assets/js/menu.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "min", + "name": "taxonomies-activate-links", + "source": "Assets/js/activate-links.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "min", + "name": "taxonomies-tags-editor", + "source": "Assets/js/tags-editor.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.js b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.js index 9d154441b1d..e10d83cd651 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.js +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.js @@ -1,25 +1,27 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - // This script is used to add a class on the active link of a menu. // Because Menus are often cached, the class needs to be set dynamically using JavaScript. (function ($) { - $.fn.activateLinks = function (options) { - var settings = $.extend({ - // class to add to the selector - "class": "active", - // custom selector based on the parent of the link - selector: null - }, options); - var currentUrl = window.location.href.replace(window.location.protocol + '//' + window.location.host, ''); - var items = $(this).find('a[href="' + currentUrl + '"]').parent(); - if (settings.selector) { - items = items.find(settings.selector); - } - items.addClass(settings["class"]); - return this; - }; -})(jQuery); \ No newline at end of file + + $.fn.activateLinks = function (options) { + + var settings = $.extend({ + // class to add to the selector + class: "active", + // custom selector based on the parent of the link + selector: null + }, options); + + var currentUrl = window.location.href.replace(window.location.protocol + '//' + window.location.host, ''); + + var items = $(this).find('a[href="' + currentUrl + '"]').parent(); + + if (settings.selector) { + items = items.find(settings.selector); + } + + items.addClass(settings.class) + + return this; + }; +}(jQuery)); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.map b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.map new file mode 100644 index 00000000000..ac0e5b96321 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["// This script is used to add a class on the active link of a menu.\r\n// Because Menus are often cached, the class needs to be set dynamically using JavaScript.\r\n\r\n(function ($) {\r\n\r\n $.fn.activateLinks = function (options) {\r\n\r\n var settings = $.extend({\r\n // class to add to the selector\r\n class: \"active\",\r\n // custom selector based on the parent of the link\r\n selector: null\r\n }, options);\r\n\r\n var currentUrl = window.location.href.replace(window.location.protocol + '//' + window.location.host, '');\r\n\r\n var items = $(this).find('a[href=\"' + currentUrl + '\"]').parent();\r\n\r\n if (settings.selector) {\r\n items = items.find(settings.selector);\r\n }\r\n\r\n items.addClass(settings.class)\r\n\r\n return this;\r\n };\r\n}(jQuery));"],"names":["$","fn","activateLinks","options","settings","extend","class","selector","currentUrl","window","location","href","replace","protocol","host","items","find","parent","addClass","jQuery"],"mappings":"CAGC,SAAUA,CAAC,EAERA,EAAEC,EAAE,CAACC,aAAa,CAAG,SAAUC,CAAO,EAElC,IAAIC,EAAWJ,EAAEK,MAAM,CAAC,CAEpBC,MAAO,SAEPC,SAAU,IACd,EAAGJ,GAECK,EAAaC,OAAOC,QAAQ,CAACC,IAAI,CAACC,OAAO,CAACH,OAAOC,QAAQ,CAACG,QAAQ,CAAG,KAAOJ,OAAOC,QAAQ,CAACI,IAAI,CAAE,IAElGC,EAAQf,EAAE,IAAI,EAAEgB,IAAI,CAAC,WAAaR,EAAa,MAAMS,MAAM,GAQ/D,OANIb,EAASG,QAAQ,EACjBQ,CAAAA,EAAQA,EAAMC,IAAI,CAACZ,EAASG,QAAQ,CAAA,EAGxCQ,EAAMG,QAAQ,CAACd,EAASE,KAAK,EAEtB,IAAI,AACf,CACJ,EAAEa"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.min.js b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.min.js index ce57004a621..6c028347bd7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/activate-links.min.js @@ -1 +1 @@ -!function(n){n.fn.activateLinks=function(o){var t=n.extend({class:"active",selector:null},o),e=window.location.href.replace(window.location.protocol+"//"+window.location.host,""),i=n(this).find('a[href="'+e+'"]').parent();return t.selector&&(i=i.find(t.selector)),i.addClass(t.class),this}}(jQuery); +!function(n){n.fn.activateLinks=function(o){var t=n.extend({class:"active",selector:null},o),e=window.location.href.replace(window.location.protocol+"//"+window.location.host,""),i=n(this).find('a[href="'+e+'"]').parent();return t.selector&&(i=i.find(t.selector)),i.addClass(t.class),this}}(jQuery); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.js b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.js index 41b5053dc54..38bf5f7eb0d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.js +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.js @@ -1,8 +1,3 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - /* * jQuery UI Nested Sortable * v 2.1a / 2016-02-04 @@ -15,630 +10,898 @@ * Licensed under the MIT License * http://www.opensource.org/licenses/mit-license.php */ -(function (factory) { - "use strict"; - - if (typeof define === "function" && define.amd) { - // AMD. Register as an anonymous module. - define(["jquery", "jquery-ui/sortable"], factory); - } else { - // Browser globals - factory(window.jQuery); - } -})(function ($) { - "use strict"; - - function isOverAxis(x, reference, size) { - return x > reference && x < reference + size; - } - $.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, { - options: { - disableParentChange: false, - doNotClear: false, - expandOnHover: 700, - isAllowed: function isAllowed() { - return true; - }, - isTree: false, - listType: "ol", - maxLevels: 0, - protectRoot: false, - rootID: null, - rtl: false, - startCollapsed: false, - tabSize: 20, - branchClass: "mjs-nestedSortable-branch", - collapsedClass: "mjs-nestedSortable-collapsed", - disableNestingClass: "mjs-nestedSortable-no-nesting", - errorClass: "mjs-nestedSortable-error", - expandedClass: "mjs-nestedSortable-expanded", - hoveringClass: "mjs-nestedSortable-hovering", - leafClass: "mjs-nestedSortable-leaf", - disabledClass: "mjs-nestedSortable-disabled" - }, - _create: function _create() { - var self = this, - err; - this.element.data("ui-sortable", this.element.data("mjs-nestedSortable")); - - // mjs - prevent browser from freezing if the HTML is not correct - if (!this.element.is(this.options.listType)) { - err = "nestedSortable: " + "Please check that the listType option is set to your actual list type"; - throw new Error(err); - } - - // if we have a tree with expanding/collapsing functionality, - // force 'intersect' tolerance method - if (this.options.isTree && this.options.expandOnHover) { - this.options.tolerance = "intersect"; - } - $.ui.sortable.prototype._create.apply(this, arguments); - - // prepare the tree by applying the right classes - // (the CSS is responsible for actual hide/show functionality) - if (this.options.isTree) { - $(this.items).each(function () { - var $li = this.item, - hasCollapsedClass = $li.hasClass(self.options.collapsedClass), - hasExpandedClass = $li.hasClass(self.options.expandedClass); - if ($li.children(self.options.listType).length) { - $li.addClass(self.options.branchClass); - // expand/collapse class only if they have children - - if (!hasCollapsedClass && !hasExpandedClass) { - if (self.options.startCollapsed) { - $li.addClass(self.options.collapsedClass); - } else { - $li.addClass(self.options.expandedClass); - } - } - } else { - $li.addClass(self.options.leafClass); - } - }); - } - }, - _destroy: function _destroy() { - this.element.removeData("mjs-nestedSortable").removeData("ui-sortable"); - return $.ui.sortable.prototype._destroy.apply(this, arguments); - }, - _mouseDrag: function _mouseDrag(event) { - var i, - item, - itemElement, - intersection, - self = this, - o = this.options, - scrolled = false, - $document = $(document), - previousTopOffset, - parentItem, - level, - childLevels, - itemAfter, - itemBefore, - newList, - method, - a, - previousItem, - nextItem, - helperIsNotSibling; - - //Compute the helpers position - this.position = this._generatePosition(event); - this.positionAbs = this._convertPositionTo("absolute"); - if (!this.lastPositionAbs) { - this.lastPositionAbs = this.positionAbs; - } - - //Do scrolling - if (this.options.scroll) { - if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { - if (this.overflowOffset.top + this.scrollParent[0].offsetHeight - event.pageY < o.scrollSensitivity) { - scrolled = this.scrollParent.scrollTop() + o.scrollSpeed; - this.scrollParent.scrollTop(scrolled); - } else if (event.pageY - this.overflowOffset.top < o.scrollSensitivity) { - scrolled = this.scrollParent.scrollTop() - o.scrollSpeed; - this.scrollParent.scrollTop(scrolled); - } - if (this.overflowOffset.left + this.scrollParent[0].offsetWidth - event.pageX < o.scrollSensitivity) { - scrolled = this.scrollParent.scrollLeft() + o.scrollSpeed; - this.scrollParent.scrollLeft(scrolled); - } else if (event.pageX - this.overflowOffset.left < o.scrollSensitivity) { - scrolled = this.scrollParent.scrollLeft() - o.scrollSpeed; - this.scrollParent.scrollLeft(scrolled); - } - } else { - if (event.pageY - $document.scrollTop() < o.scrollSensitivity) { - scrolled = $document.scrollTop() - o.scrollSpeed; - $document.scrollTop(scrolled); - } else if ($(window).height() - (event.pageY - $document.scrollTop()) < o.scrollSensitivity) { - scrolled = $document.scrollTop() + o.scrollSpeed; - $document.scrollTop(scrolled); - } - if (event.pageX - $document.scrollLeft() < o.scrollSensitivity) { - scrolled = $document.scrollLeft() - o.scrollSpeed; - $document.scrollLeft(scrolled); - } else if ($(window).width() - (event.pageX - $document.scrollLeft()) < o.scrollSensitivity) { - scrolled = $document.scrollLeft() + o.scrollSpeed; - $document.scrollLeft(scrolled); - } - } - if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { - $.ui.ddmanager.prepareOffsets(this, event); - } - } - - //Regenerate the absolute position used for position checks - this.positionAbs = this._convertPositionTo("absolute"); - - // mjs - find the top offset before rearrangement, - previousTopOffset = this.placeholder.offset().top; - - //Set the helper position - if (!this.options.axis || this.options.axis !== "y") { - this.helper[0].style.left = this.position.left + "px"; - } - if (!this.options.axis || this.options.axis !== "x") { - this.helper[0].style.top = this.position.top + "px"; - } - - // mjs - check and reset hovering state at each cycle - this.hovering = this.hovering ? this.hovering : null; - this.mouseentered = this.mouseentered ? this.mouseentered : false; - - // mjs - let's start caching some variables - (function () { - var _parentItem = this.placeholder.parent().parent(); - if (_parentItem && _parentItem.closest(".ui-sortable").length) { - parentItem = _parentItem; - } - }).call(this); - level = this._getLevel(this.placeholder); - childLevels = this._getChildLevels(this.helper); - newList = document.createElement(o.listType); - - //Rearrange - for (i = this.items.length - 1; i >= 0; i--) { - //Cache variables and intersection, continue if no intersection - item = this.items[i]; - itemElement = item.item[0]; - intersection = this._intersectsWithPointer(item); - if (!intersection) { - continue; - } - - // Only put the placeholder inside the current Container, skip all - // items form other containers. This works because when moving - // an item from one container to another the - // currentContainer is switched before the placeholder is moved. - // - // Without this moving items in "sub-sortables" can cause the placeholder to jitter - // beetween the outer and inner container. - if (item.instance !== this.currentContainer) { - continue; - } - - // No action if intersected item is disabled - // and the element above or below in the direction we're going is also disabled - if (itemElement.className.indexOf(o.disabledClass) !== -1) { - // Note: intersection hardcoded direction values from - // jquery.ui.sortable.js:_intersectsWithPointer - if (intersection === 2) { - // Going down - itemAfter = this.items[i + 1]; - if (itemAfter && itemAfter.item.hasClass(o.disabledClass)) { - continue; - } - } else if (intersection === 1) { - // Going up - itemBefore = this.items[i - 1]; - if (itemBefore && itemBefore.item.hasClass(o.disabledClass)) { - continue; - } - } - } - method = intersection === 1 ? "next" : "prev"; - - // cannot intersect with itself - // no useless actions that have been done before - // no action if the item moved is the parent of the item checked - if (itemElement !== this.currentItem[0] && this.placeholder[method]()[0] !== itemElement && !$.contains(this.placeholder[0], itemElement) && (this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)) { - // mjs - we are intersecting an element: - // trigger the mouseenter event and store this state - if (!this.mouseentered) { - $(itemElement).mouseenter(); - this.mouseentered = true; - } - - // mjs - if the element has children and they are hidden, - // show them after a delay (CSS responsible) - if (o.isTree && $(itemElement).hasClass(o.collapsedClass) && o.expandOnHover) { - if (!this.hovering) { - $(itemElement).addClass(o.hoveringClass); - this.hovering = window.setTimeout(function () { - $(itemElement).removeClass(o.collapsedClass).addClass(o.expandedClass); - self.refreshPositions(); - self._trigger("expand", event, self._uiHash()); - }, o.expandOnHover); - } - } - this.direction = intersection === 1 ? "down" : "up"; - - // mjs - rearrange the elements and reset timeouts and hovering state - if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { - $(itemElement).mouseleave(); - this.mouseentered = false; - $(itemElement).removeClass(o.hoveringClass); - if (this.hovering) { - window.clearTimeout(this.hovering); - } - this.hovering = null; - - // mjs - do not switch container if - // it's a root item and 'protectRoot' is true - // or if it's not a root item but we are trying to make it root - if (o.protectRoot && !(this.currentItem[0].parentNode === this.element[0] && - // it's a root item - itemElement.parentNode !== this.element[0] - // it's intersecting a non-root item - )) { - if (this.currentItem[0].parentNode !== this.element[0] && itemElement.parentNode === this.element[0]) { - if (!$(itemElement).children(o.listType).length) { - itemElement.appendChild(newList); - if (o.isTree) { - $(itemElement).removeClass(o.leafClass).addClass(o.branchClass + " " + o.expandedClass); - } - } - if (this.direction === "down") { - a = $(itemElement).prev().children(o.listType); - } else { - a = $(itemElement).children(o.listType); - } - if (a[0] !== undefined) { - this._rearrange(event, null, a); - } - } else { - this._rearrange(event, item); - } - } else if (!o.protectRoot) { - this._rearrange(event, item); - } - } else { - break; - } - - // Clear emtpy ul's/ol's - this._clearEmpty(itemElement); - this._trigger("change", event, this._uiHash()); - break; - } - } - - // mjs - to find the previous sibling in the list, - // keep backtracking until we hit a valid list item. - (function () { - var _previousItem = this.placeholder.prev(); - if (_previousItem.length) { - previousItem = _previousItem; - } else { - previousItem = null; - } - }).call(this); - if (previousItem != null) { - while (previousItem[0].nodeName.toLowerCase() !== "li" || previousItem[0].className.indexOf(o.disabledClass) !== -1 || previousItem[0] === this.currentItem[0] || previousItem[0] === this.helper[0]) { - if (previousItem[0].previousSibling) { - previousItem = $(previousItem[0].previousSibling); - } else { - previousItem = null; - break; - } - } - } - - // mjs - to find the next sibling in the list, - // keep stepping forward until we hit a valid list item. - (function () { - var _nextItem = this.placeholder.next(); - if (_nextItem.length) { - nextItem = _nextItem; - } else { - nextItem = null; - } - }).call(this); - if (nextItem != null) { - while (nextItem[0].nodeName.toLowerCase() !== "li" || nextItem[0].className.indexOf(o.disabledClass) !== -1 || nextItem[0] === this.currentItem[0] || nextItem[0] === this.helper[0]) { - if (nextItem[0].nextSibling) { - nextItem = $(nextItem[0].nextSibling); - } else { - nextItem = null; - break; - } - } - } - this.beyondMaxLevels = 0; - - // mjs - if the item is moved to the left, send it one level up - // but only if it's at the bottom of the list - if (parentItem != null && nextItem == null && !(o.protectRoot && parentItem[0].parentNode == this.element[0]) && (o.rtl && this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth() || !o.rtl && this.positionAbs.left < parentItem.offset().left)) { - parentItem.after(this.placeholder[0]); - helperIsNotSibling = !parentItem.children(o.listItem).children("li:visible:not(.ui-sortable-helper)").length; - if (o.isTree && helperIsNotSibling) { - parentItem.removeClass(this.options.branchClass + " " + this.options.expandedClass).addClass(this.options.leafClass); - } - if (typeof parentItem !== 'undefined') this._clearEmpty(parentItem[0]); - this._trigger("change", event, this._uiHash()); - // mjs - if the item is below a sibling and is moved to the right, - // make it a child of that sibling - } else if (previousItem != null && !previousItem.hasClass(o.disableNestingClass) && (previousItem.children(o.listType).length && previousItem.children(o.listType).is(":visible") || !previousItem.children(o.listType).length) && !(o.protectRoot && this.currentItem[0].parentNode === this.element[0]) && (o.rtl && this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize || !o.rtl && this.positionAbs.left > previousItem.offset().left + o.tabSize)) { - this._isAllowed(previousItem, level, level + childLevels + 1); - if (!previousItem.children(o.listType).length) { - previousItem[0].appendChild(newList); - if (o.isTree) { - previousItem.removeClass(o.leafClass).addClass(o.branchClass + " " + o.expandedClass); - } - } - - // mjs - if this item is being moved from the top, add it to the top of the list. - if (previousTopOffset && previousTopOffset <= previousItem.offset().top) { - previousItem.children(o.listType).prepend(this.placeholder); - } else { - // mjs - otherwise, add it to the bottom of the list. - previousItem.children(o.listType)[0].appendChild(this.placeholder[0]); - } - if (typeof parentItem !== 'undefined') this._clearEmpty(parentItem[0]); - this._trigger("change", event, this._uiHash()); - } else { - this._isAllowed(parentItem, level, level + childLevels); - } - - //Post events to containers - this._contactContainers(event); - - //Interconnect with droppables - if ($.ui.ddmanager) { - $.ui.ddmanager.drag(this, event); - } - - //Call callbacks - this._trigger("sort", event, this._uiHash()); - this.lastPositionAbs = this.positionAbs; - return false; - }, - _mouseStop: function _mouseStop(event) { - // mjs - if the item is in a position not allowed, send it back - if (this.beyondMaxLevels) { - this.placeholder.removeClass(this.options.errorClass); - if (this.domPosition.prev) { - $(this.domPosition.prev).after(this.placeholder); - } else { - $(this.domPosition.parent).prepend(this.placeholder); - } - this._trigger("revert", event, this._uiHash()); - } - - // mjs - clear the hovering timeout, just to be sure - $("." + this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass); - this.mouseentered = false; - if (this.hovering) { - window.clearTimeout(this.hovering); - } - this.hovering = null; - this._relocate_event = event; - this._pid_current = $(this.domPosition.parent).parent().attr("id"); - this._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0; - $.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event. - }, - // mjs - this function is slightly modified - // to make it easier to hover over a collapsed element and have it expand - _intersectsWithSides: function _intersectsWithSides(item) { - var half = this.options.isTree ? .8 : .5, - isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + item.height * half, item.height), - isOverTopHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top - item.height * half, item.height), - isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + item.width / 2, item.width), - verticalDirection = this._getDragVerticalDirection(), - horizontalDirection = this._getDragHorizontalDirection(); - if (this.floating && horizontalDirection) { - return horizontalDirection === "right" && isOverRightHalf || horizontalDirection === "left" && !isOverRightHalf; - } else { - return verticalDirection && (verticalDirection === "down" && isOverBottomHalf || verticalDirection === "up" && isOverTopHalf); - } - }, - _contactContainers: function _contactContainers() { - if (this.options.protectRoot && this.currentItem[0].parentNode === this.element[0]) { - return; - } - $.ui.sortable.prototype._contactContainers.apply(this, arguments); - }, - _clear: function _clear() { - var i, item; - $.ui.sortable.prototype._clear.apply(this, arguments); - - //relocate event - if (!(this._pid_current === this._uiHash().item.parent().parent().attr("id") && this._sort_current === this._uiHash().item.index())) { - this._trigger("relocate", this._relocate_event, this._uiHash()); - } - - // mjs - clean last empty ul/ol - for (i = this.items.length - 1; i >= 0; i--) { - item = this.items[i].item[0]; - this._clearEmpty(item); - } - }, - serialize: function serialize(options) { - var o = $.extend({}, this.options, options), - items = this._getItemsAsjQuery(o && o.connected), - str = []; - $(items).each(function () { - var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || /(.+)[-=_](.+)/), - pid = ($(o.item || this).parent(o.listType).parent(o.items).attr(o.attribute || "id") || "").match(o.expression || /(.+)[-=_](.+)/); - if (res) { - str.push((o.key || res[1]) + "[" + (o.key && o.expression ? res[1] : res[2]) + "]" + "=" + (pid ? o.key && o.expression ? pid[1] : pid[2] : o.rootID)); - } - }); - if (!str.length && o.key) { - str.push(o.key + "="); - } - return str.join("&"); - }, - toHierarchy: function toHierarchy(options) { - var o = $.extend({}, this.options, options), - ret = []; - $(this.element).children(o.items).each(function () { - var level = _recursiveItems(this); - ret.push(level); - }); - return ret; - function _recursiveItems(item) { - var id = ($(item).attr(o.attribute || "id") || "").match(o.expression || /(.+)[-=_](.+)/), - currentItem; - var data = $(item).data(); - if (data.nestedSortableItem) { - delete data.nestedSortableItem; // Remove the nestedSortableItem object from the data - } - if (id) { - currentItem = { - "id": id[2] - }; - currentItem = $.extend({}, currentItem, data); // Combine the two objects - - if ($(item).children(o.listType).children(o.items).length > 0) { - currentItem.children = []; - $(item).children(o.listType).children(o.items).each(function () { - var level = _recursiveItems(this); - currentItem.children.push(level); - }); - } - return currentItem; - } - } - }, - toArray: function toArray(options) { - var o = $.extend({}, this.options, options), - sDepth = o.startDepthCount || 0, - ret = [], - left = 1; - if (!o.excludeRoot) { - ret.push({ - "item_id": o.rootID, - "parent_id": null, - "depth": sDepth, - "left": left, - "right": ($(o.items, this.element).length + 1) * 2 - }); - left++; - } - $(this.element).children(o.items).each(function () { - left = _recursiveArray(this, sDepth, left); - }); - ret = ret.sort(function (a, b) { - return a.left - b.left; - }); - return ret; - function _recursiveArray(item, depth, _left) { - var right = _left + 1, - id, - pid, - parentItem; - if ($(item).children(o.listType).children(o.items).length > 0) { - depth++; - $(item).children(o.listType).children(o.items).each(function () { - right = _recursiveArray($(this), depth, right); - }); - depth--; - } - id = ($(item).attr(o.attribute || "id") || "").match(o.expression || /(.+)[-=_](.+)/); - if (depth === sDepth) { - pid = o.rootID; - } else { - parentItem = $(item).parent(o.listType).parent(o.items).attr(o.attribute || "id").match(o.expression || /(.+)[-=_](.+)/); - pid = parentItem[2]; - } - if (id) { - var data = $(item).children('div').data(); - var itemObj = $.extend(data, { - "id": id[2], - "parent_id": pid, - "depth": depth, - "left": _left, - "right": right - }); - ret.push(itemObj); - } - _left = right + 1; - return _left; - } - }, - _clearEmpty: function _clearEmpty(item) { - function replaceClass(elem, search, replace, swap) { - if (swap) { - search = [replace, replace = search][0]; - } - $(elem).removeClass(search).addClass(replace); - } - var o = this.options, - childrenList = $(item).children(o.listType), - hasChildren = childrenList.has('li').length; - var doNotClear = o.doNotClear || hasChildren || o.protectRoot && $(item)[0] === this.element[0]; - if (o.isTree) { - replaceClass(item, o.branchClass, o.leafClass, doNotClear); - } - if (!doNotClear) { - childrenList.parent().removeClass(o.expandedClass); - childrenList.remove(); - } - }, - _getLevel: function _getLevel(item) { - var level = 1, - list; - if (this.options.listType) { - list = item.closest(this.options.listType); - while (list && list.length > 0 && !list.is(".ui-sortable")) { - level++; - list = list.parent().closest(this.options.listType); - } - } - return level; - }, - _getChildLevels: function _getChildLevels(parent, depth) { - var self = this, - o = this.options, - result = 0; - depth = depth || 0; - $(parent).children(o.listType).children(o.items).each(function (index, child) { - result = Math.max(self._getChildLevels(child, depth + 1), result); - }); - return depth ? result + 1 : result; - }, - _isAllowed: function _isAllowed(parentItem, level, levels) { - var o = this.options, - // this takes into account the maxLevels set to the recipient list - maxLevels = this.placeholder.closest(".ui-sortable").nestedSortable("option", "maxLevels"), - // Check if the parent has changed to prevent it, when o.disableParentChange is true - oldParent = this.currentItem.parent().parent(), - disabledByParentchange = o.disableParentChange && ( - //From somewhere to somewhere else, except the root - typeof parentItem !== 'undefined' && !oldParent.is(parentItem) || typeof parentItem === 'undefined' && oldParent.is("li") //From somewhere to the root - ); - // mjs - is the root protected? - // mjs - are we nesting too deep? - if (disabledByParentchange || !o.isAllowed(this.placeholder, parentItem, this.currentItem)) { - this.placeholder.addClass(o.errorClass); - if (maxLevels < levels && maxLevels !== 0) { - this.beyondMaxLevels = levels - maxLevels; - } else { - this.beyondMaxLevels = 1; - } - } else { - if (maxLevels < levels && maxLevels !== 0) { - this.placeholder.addClass(o.errorClass); - this.beyondMaxLevels = levels - maxLevels; - } else { - this.placeholder.removeClass(o.errorClass); - this.beyondMaxLevels = 0; - } - } - } - })); - $.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options); -}); \ No newline at end of file +(function( factory ) { + "use strict"; + + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define([ + "jquery", + "jquery-ui/sortable" + ], factory ); + } else { + + // Browser globals + factory( window.jQuery ); + } +}(function($) { + "use strict"; + + function isOverAxis( x, reference, size ) { + return ( x > reference ) && ( x < ( reference + size ) ); + } + + $.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, { + + options: { + disableParentChange: false, + doNotClear: false, + expandOnHover: 700, + isAllowed: function() { return true; }, + isTree: false, + listType: "ol", + maxLevels: 0, + protectRoot: false, + rootID: null, + rtl: false, + startCollapsed: false, + tabSize: 20, + + branchClass: "mjs-nestedSortable-branch", + collapsedClass: "mjs-nestedSortable-collapsed", + disableNestingClass: "mjs-nestedSortable-no-nesting", + errorClass: "mjs-nestedSortable-error", + expandedClass: "mjs-nestedSortable-expanded", + hoveringClass: "mjs-nestedSortable-hovering", + leafClass: "mjs-nestedSortable-leaf", + disabledClass: "mjs-nestedSortable-disabled" + }, + + _create: function() { + var self = this, + err; + + this.element.data("ui-sortable", this.element.data("mjs-nestedSortable")); + + // mjs - prevent browser from freezing if the HTML is not correct + if (!this.element.is(this.options.listType)) { + err = "nestedSortable: " + + "Please check that the listType option is set to your actual list type"; + + throw new Error(err); + } + + // if we have a tree with expanding/collapsing functionality, + // force 'intersect' tolerance method + if (this.options.isTree && this.options.expandOnHover) { + this.options.tolerance = "intersect"; + } + + $.ui.sortable.prototype._create.apply(this, arguments); + + // prepare the tree by applying the right classes + // (the CSS is responsible for actual hide/show functionality) + if (this.options.isTree) { + $(this.items).each(function() { + var $li = this.item, + hasCollapsedClass = $li.hasClass(self.options.collapsedClass), + hasExpandedClass = $li.hasClass(self.options.expandedClass); + + if ($li.children(self.options.listType).length) { + $li.addClass(self.options.branchClass); + // expand/collapse class only if they have children + + if ( !hasCollapsedClass && !hasExpandedClass ) { + if (self.options.startCollapsed) { + $li.addClass(self.options.collapsedClass); + } else { + $li.addClass(self.options.expandedClass); + } + } + } else { + $li.addClass(self.options.leafClass); + } + }); + } + }, + + _destroy: function() { + this.element + .removeData("mjs-nestedSortable") + .removeData("ui-sortable"); + return $.ui.sortable.prototype._destroy.apply(this, arguments); + }, + + _mouseDrag: function(event) { + var i, + item, + itemElement, + intersection, + self = this, + o = this.options, + scrolled = false, + $document = $(document), + previousTopOffset, + parentItem, + level, + childLevels, + itemAfter, + itemBefore, + newList, + method, + a, + previousItem, + nextItem, + helperIsNotSibling; + + //Compute the helpers position + this.position = this._generatePosition(event); + this.positionAbs = this._convertPositionTo("absolute"); + + if (!this.lastPositionAbs) { + this.lastPositionAbs = this.positionAbs; + } + + //Do scrolling + if (this.options.scroll) { + if (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") { + + if ( + ( + this.overflowOffset.top + + this.scrollParent[0].offsetHeight + ) - + event.pageY < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollTop() + o.scrollSpeed; + this.scrollParent.scrollTop(scrolled); + } else if ( + event.pageY - + this.overflowOffset.top < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollTop() - o.scrollSpeed; + this.scrollParent.scrollTop(scrolled); + } + + if ( + ( + this.overflowOffset.left + + this.scrollParent[0].offsetWidth + ) - + event.pageX < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollLeft() + o.scrollSpeed; + this.scrollParent.scrollLeft(scrolled); + } else if ( + event.pageX - + this.overflowOffset.left < + o.scrollSensitivity + ) { + scrolled = this.scrollParent.scrollLeft() - o.scrollSpeed; + this.scrollParent.scrollLeft(scrolled); + } + + } else { + + if ( + event.pageY - + $document.scrollTop() < + o.scrollSensitivity + ) { + scrolled = $document.scrollTop() - o.scrollSpeed; + $document.scrollTop(scrolled); + } else if ( + $(window).height() - + ( + event.pageY - + $document.scrollTop() + ) < + o.scrollSensitivity + ) { + scrolled = $document.scrollTop() + o.scrollSpeed; + $document.scrollTop(scrolled); + } + + if ( + event.pageX - + $document.scrollLeft() < + o.scrollSensitivity + ) { + scrolled = $document.scrollLeft() - o.scrollSpeed; + $document.scrollLeft(scrolled); + } else if ( + $(window).width() - + ( + event.pageX - + $document.scrollLeft() + ) < + o.scrollSensitivity + ) { + scrolled = $document.scrollLeft() + o.scrollSpeed; + $document.scrollLeft(scrolled); + } + + } + + if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) { + $.ui.ddmanager.prepareOffsets(this, event); + } + } + + //Regenerate the absolute position used for position checks + this.positionAbs = this._convertPositionTo("absolute"); + + // mjs - find the top offset before rearrangement, + previousTopOffset = this.placeholder.offset().top; + + //Set the helper position + if (!this.options.axis || this.options.axis !== "y") { + this.helper[0].style.left = this.position.left + "px"; + } + if (!this.options.axis || this.options.axis !== "x") { + this.helper[0].style.top = (this.position.top) + "px"; + } + + // mjs - check and reset hovering state at each cycle + this.hovering = this.hovering ? this.hovering : null; + this.mouseentered = this.mouseentered ? this.mouseentered : false; + + // mjs - let's start caching some variables + (function() { + var _parentItem = this.placeholder.parent().parent(); + if (_parentItem && _parentItem.closest(".ui-sortable").length) { + parentItem = _parentItem; + } + }.call(this)); + + level = this._getLevel(this.placeholder); + childLevels = this._getChildLevels(this.helper); + newList = document.createElement(o.listType); + + //Rearrange + for (i = this.items.length - 1; i >= 0; i--) { + + //Cache variables and intersection, continue if no intersection + item = this.items[i]; + itemElement = item.item[0]; + intersection = this._intersectsWithPointer(item); + if (!intersection) { + continue; + } + + // Only put the placeholder inside the current Container, skip all + // items form other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this moving items in "sub-sortables" can cause the placeholder to jitter + // beetween the outer and inner container. + if (item.instance !== this.currentContainer) { + continue; + } + + // No action if intersected item is disabled + // and the element above or below in the direction we're going is also disabled + if (itemElement.className.indexOf(o.disabledClass) !== -1) { + // Note: intersection hardcoded direction values from + // jquery.ui.sortable.js:_intersectsWithPointer + if (intersection === 2) { + // Going down + itemAfter = this.items[i + 1]; + if (itemAfter && itemAfter.item.hasClass(o.disabledClass)) { + continue; + } + + } else if (intersection === 1) { + // Going up + itemBefore = this.items[i - 1]; + if (itemBefore && itemBefore.item.hasClass(o.disabledClass)) { + continue; + } + } + } + + method = intersection === 1 ? "next" : "prev"; + + // cannot intersect with itself + // no useless actions that have been done before + // no action if the item moved is the parent of the item checked + if (itemElement !== this.currentItem[0] && + this.placeholder[method]()[0] !== itemElement && + !$.contains(this.placeholder[0], itemElement) && + ( + this.options.type === "semi-dynamic" ? + !$.contains(this.element[0], itemElement) : + true + ) + ) { + + // mjs - we are intersecting an element: + // trigger the mouseenter event and store this state + if (!this.mouseentered) { + $(itemElement).mouseenter(); + this.mouseentered = true; + } + + // mjs - if the element has children and they are hidden, + // show them after a delay (CSS responsible) + if (o.isTree && $(itemElement).hasClass(o.collapsedClass) && o.expandOnHover) { + if (!this.hovering) { + $(itemElement).addClass(o.hoveringClass); + this.hovering = window.setTimeout(function() { + $(itemElement) + .removeClass(o.collapsedClass) + .addClass(o.expandedClass); + + self.refreshPositions(); + self._trigger("expand", event, self._uiHash()); + }, o.expandOnHover); + } + } + + this.direction = intersection === 1 ? "down" : "up"; + + // mjs - rearrange the elements and reset timeouts and hovering state + if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) { + $(itemElement).mouseleave(); + this.mouseentered = false; + $(itemElement).removeClass(o.hoveringClass); + if (this.hovering) { + window.clearTimeout(this.hovering); + } + this.hovering = null; + + // mjs - do not switch container if + // it's a root item and 'protectRoot' is true + // or if it's not a root item but we are trying to make it root + if (o.protectRoot && + !( + this.currentItem[0].parentNode === this.element[0] && + // it's a root item + itemElement.parentNode !== this.element[0] + // it's intersecting a non-root item + ) + ) { + if (this.currentItem[0].parentNode !== this.element[0] && + itemElement.parentNode === this.element[0] + ) { + + if ( !$(itemElement).children(o.listType).length) { + itemElement.appendChild(newList); + if (o.isTree) { + $(itemElement) + .removeClass(o.leafClass) + .addClass(o.branchClass + " " + o.expandedClass); + } + } + + if (this.direction === "down") { + a = $(itemElement).prev().children(o.listType); + } else { + a = $(itemElement).children(o.listType); + } + + if (a[0] !== undefined) { + this._rearrange(event, null, a); + } + + } else { + this._rearrange(event, item); + } + } else if (!o.protectRoot) { + this._rearrange(event, item); + } + } else { + break; + } + + // Clear emtpy ul's/ol's + this._clearEmpty(itemElement); + + this._trigger("change", event, this._uiHash()); + break; + } + } + + // mjs - to find the previous sibling in the list, + // keep backtracking until we hit a valid list item. + (function() { + var _previousItem = this.placeholder.prev(); + if (_previousItem.length) { + previousItem = _previousItem; + } else { + previousItem = null; + } + }.call(this)); + + if (previousItem != null) { + while ( + previousItem[0].nodeName.toLowerCase() !== "li" || + previousItem[0].className.indexOf(o.disabledClass) !== -1 || + previousItem[0] === this.currentItem[0] || + previousItem[0] === this.helper[0] + ) { + if (previousItem[0].previousSibling) { + previousItem = $(previousItem[0].previousSibling); + } else { + previousItem = null; + break; + } + } + } + + // mjs - to find the next sibling in the list, + // keep stepping forward until we hit a valid list item. + (function() { + var _nextItem = this.placeholder.next(); + if (_nextItem.length) { + nextItem = _nextItem; + } else { + nextItem = null; + } + }.call(this)); + + if (nextItem != null) { + while ( + nextItem[0].nodeName.toLowerCase() !== "li" || + nextItem[0].className.indexOf(o.disabledClass) !== -1 || + nextItem[0] === this.currentItem[0] || + nextItem[0] === this.helper[0] + ) { + if (nextItem[0].nextSibling) { + nextItem = $(nextItem[0].nextSibling); + } else { + nextItem = null; + break; + } + } + } + + this.beyondMaxLevels = 0; + + // mjs - if the item is moved to the left, send it one level up + // but only if it's at the bottom of the list + if (parentItem != null && + nextItem == null && + !(o.protectRoot && parentItem[0].parentNode == this.element[0]) && + ( + o.rtl && + ( + this.positionAbs.left + + this.helper.outerWidth() > parentItem.offset().left + + parentItem.outerWidth() + ) || + !o.rtl && (this.positionAbs.left < parentItem.offset().left) + ) + ) { + + parentItem.after(this.placeholder[0]); + helperIsNotSibling = !parentItem + .children(o.listItem) + .children("li:visible:not(.ui-sortable-helper)") + .length; + if (o.isTree && helperIsNotSibling) { + parentItem + .removeClass(this.options.branchClass + " " + this.options.expandedClass) + .addClass(this.options.leafClass); + } + if(typeof parentItem !== 'undefined') + this._clearEmpty(parentItem[0]); + this._trigger("change", event, this._uiHash()); + // mjs - if the item is below a sibling and is moved to the right, + // make it a child of that sibling + } else if (previousItem != null && + !previousItem.hasClass(o.disableNestingClass) && + ( + previousItem.children(o.listType).length && + previousItem.children(o.listType).is(":visible") || + !previousItem.children(o.listType).length + ) && + !(o.protectRoot && this.currentItem[0].parentNode === this.element[0]) && + ( + o.rtl && + ( + this.positionAbs.left + + this.helper.outerWidth() < + previousItem.offset().left + + previousItem.outerWidth() - + o.tabSize + ) || + !o.rtl && + (this.positionAbs.left > previousItem.offset().left + o.tabSize) + ) + ) { + + this._isAllowed(previousItem, level, level + childLevels + 1); + + if (!previousItem.children(o.listType).length) { + previousItem[0].appendChild(newList); + if (o.isTree) { + previousItem + .removeClass(o.leafClass) + .addClass(o.branchClass + " " + o.expandedClass); + } + } + + // mjs - if this item is being moved from the top, add it to the top of the list. + if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) { + previousItem.children(o.listType).prepend(this.placeholder); + } else { + // mjs - otherwise, add it to the bottom of the list. + previousItem.children(o.listType)[0].appendChild(this.placeholder[0]); + } + if(typeof parentItem !== 'undefined') + this._clearEmpty(parentItem[0]); + this._trigger("change", event, this._uiHash()); + } else { + this._isAllowed(parentItem, level, level + childLevels); + } + + //Post events to containers + this._contactContainers(event); + + //Interconnect with droppables + if ($.ui.ddmanager) { + $.ui.ddmanager.drag(this, event); + } + + //Call callbacks + this._trigger("sort", event, this._uiHash()); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function(event) { + // mjs - if the item is in a position not allowed, send it back + if (this.beyondMaxLevels) { + + this.placeholder.removeClass(this.options.errorClass); + + if (this.domPosition.prev) { + $(this.domPosition.prev).after(this.placeholder); + } else { + $(this.domPosition.parent).prepend(this.placeholder); + } + + this._trigger("revert", event, this._uiHash()); + + } + + // mjs - clear the hovering timeout, just to be sure + $("." + this.options.hoveringClass) + .mouseleave() + .removeClass(this.options.hoveringClass); + + this.mouseentered = false; + if (this.hovering) { + window.clearTimeout(this.hovering); + } + this.hovering = null; + + this._relocate_event = event; + this._pid_current = $(this.domPosition.parent).parent().attr("id"); + this._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0; + $.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event. + }, + + // mjs - this function is slightly modified + // to make it easier to hover over a collapsed element and have it expand + _intersectsWithSides: function(item) { + + var half = this.options.isTree ? .8 : .5, + isOverBottomHalf = isOverAxis( + this.positionAbs.top + this.offset.click.top, + item.top + (item.height * half), + item.height + ), + isOverTopHalf = isOverAxis( + this.positionAbs.top + this.offset.click.top, + item.top - (item.height * half), + item.height + ), + isOverRightHalf = isOverAxis( + this.positionAbs.left + this.offset.click.left, + item.left + (item.width / 2), + item.width + ), + verticalDirection = this._getDragVerticalDirection(), + horizontalDirection = this._getDragHorizontalDirection(); + + if (this.floating && horizontalDirection) { + return ( + (horizontalDirection === "right" && isOverRightHalf) || + (horizontalDirection === "left" && !isOverRightHalf) + ); + } else { + return verticalDirection && ( + (verticalDirection === "down" && isOverBottomHalf) || + (verticalDirection === "up" && isOverTopHalf) + ); + } + + }, + + _contactContainers: function() { + + if (this.options.protectRoot && this.currentItem[0].parentNode === this.element[0] ) { + return; + } + + $.ui.sortable.prototype._contactContainers.apply(this, arguments); + + }, + + _clear: function() { + var i, + item; + + $.ui.sortable.prototype._clear.apply(this, arguments); + + //relocate event + if (!(this._pid_current === this._uiHash().item.parent().parent().attr("id") && + this._sort_current === this._uiHash().item.index())) { + this._trigger("relocate", this._relocate_event, this._uiHash()); + } + + // mjs - clean last empty ul/ol + for (i = this.items.length - 1; i >= 0; i--) { + item = this.items[i].item[0]; + this._clearEmpty(item); + } + + }, + + serialize: function(options) { + + var o = $.extend({}, this.options, options), + items = this._getItemsAsjQuery(o && o.connected), + str = []; + + $(items).each(function() { + var res = ($(o.item || this).attr(o.attribute || "id") || "") + .match(o.expression || (/(.+)[-=_](.+)/)), + pid = ($(o.item || this).parent(o.listType) + .parent(o.items) + .attr(o.attribute || "id") || "") + .match(o.expression || (/(.+)[-=_](.+)/)); + + if (res) { + str.push( + ( + (o.key || res[1]) + + "[" + + (o.key && o.expression ? res[1] : res[2]) + "]" + ) + + "=" + + (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID)); + } + }); + + if (!str.length && o.key) { + str.push(o.key + "="); + } + + return str.join("&"); + + }, + + toHierarchy: function(options) { + + var o = $.extend({}, this.options, options), + ret = []; + + $(this.element).children(o.items).each(function() { + var level = _recursiveItems(this); + ret.push(level); + }); + + return ret; + + function _recursiveItems(item) { + var id = ($(item).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[-=_](.+)/)), + currentItem; + + var data = $(item).data(); + if (data.nestedSortableItem) { + delete data.nestedSortableItem; // Remove the nestedSortableItem object from the data + } + + if (id) { + currentItem = { + "id": id[2] + }; + + currentItem = $.extend({}, currentItem, data); // Combine the two objects + + if ($(item).children(o.listType).children(o.items).length > 0) { + currentItem.children = []; + $(item).children(o.listType).children(o.items).each(function() { + var level = _recursiveItems(this); + currentItem.children.push(level); + }); + } + return currentItem; + } + } + }, + + toArray: function(options) { + + var o = $.extend({}, this.options, options), + sDepth = o.startDepthCount || 0, + ret = [], + left = 1; + + if (!o.excludeRoot) { + ret.push({ + "item_id": o.rootID, + "parent_id": null, + "depth": sDepth, + "left": left, + "right": ($(o.items, this.element).length + 1) * 2 + }); + left++; + } + + $(this.element).children(o.items).each(function() { + left = _recursiveArray(this, sDepth, left); + }); + + ret = ret.sort(function(a, b) { return (a.left - b.left); }); + + return ret; + + function _recursiveArray(item, depth, _left) { + + var right = _left + 1, + id, + pid, + parentItem; + + if ($(item).children(o.listType).children(o.items).length > 0) { + depth++; + $(item).children(o.listType).children(o.items).each(function() { + right = _recursiveArray($(this), depth, right); + }); + depth--; + } + + id = ($(item).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[-=_](.+)/)); + + if (depth === sDepth) { + pid = o.rootID; + } else { + parentItem = ($(item).parent(o.listType) + .parent(o.items) + .attr(o.attribute || "id")) + .match(o.expression || (/(.+)[-=_](.+)/)); + pid = parentItem[2]; + } + + if (id) { + var data = $(item).children('div').data(); + var itemObj = $.extend( data, { + "id":id[2], + "parent_id":pid, + "depth":depth, + "left":_left, + "right":right + } ); + ret.push( itemObj ); + } + + _left = right + 1; + return _left; + } + + }, + + _clearEmpty: function (item) { + function replaceClass(elem, search, replace, swap) { + if (swap) { + search = [replace, replace = search][0]; + } + + $(elem).removeClass(search).addClass(replace); + } + + var o = this.options, + childrenList = $(item).children(o.listType), + hasChildren = childrenList.has('li').length; + + var doNotClear = + o.doNotClear || + hasChildren || + o.protectRoot && $(item)[0] === this.element[0]; + + if (o.isTree) { + replaceClass(item, o.branchClass, o.leafClass, doNotClear); + } + + if (!doNotClear) { + childrenList.parent().removeClass(o.expandedClass); + childrenList.remove(); + } + }, + + _getLevel: function(item) { + + var level = 1, + list; + + if (this.options.listType) { + list = item.closest(this.options.listType); + while (list && list.length > 0 && !list.is(".ui-sortable")) { + level++; + list = list.parent().closest(this.options.listType); + } + } + + return level; + }, + + _getChildLevels: function(parent, depth) { + var self = this, + o = this.options, + result = 0; + depth = depth || 0; + + $(parent).children(o.listType).children(o.items).each(function(index, child) { + result = Math.max(self._getChildLevels(child, depth + 1), result); + }); + + return depth ? result + 1 : result; + }, + + _isAllowed: function(parentItem, level, levels) { + var o = this.options, + // this takes into account the maxLevels set to the recipient list + maxLevels = this + .placeholder + .closest(".ui-sortable") + .nestedSortable("option", "maxLevels"), + + // Check if the parent has changed to prevent it, when o.disableParentChange is true + oldParent = this.currentItem.parent().parent(), + disabledByParentchange = o.disableParentChange && ( + //From somewhere to somewhere else, except the root + typeof parentItem !== 'undefined' && !oldParent.is(parentItem) || + typeof parentItem === 'undefined' && oldParent.is("li") //From somewhere to the root + ); + // mjs - is the root protected? + // mjs - are we nesting too deep? + if ( + disabledByParentchange || + !o.isAllowed(this.placeholder, parentItem, this.currentItem) + ) { + this.placeholder.addClass(o.errorClass); + if (maxLevels < levels && maxLevels !== 0) { + this.beyondMaxLevels = levels - maxLevels; + } else { + this.beyondMaxLevels = 1; + } + } else { + if (maxLevels < levels && maxLevels !== 0) { + this.placeholder.addClass(o.errorClass); + this.beyondMaxLevels = levels - maxLevels; + } else { + this.placeholder.removeClass(o.errorClass); + this.beyondMaxLevels = 0; + } + } + } + + })); + + $.mjs.nestedSortable.prototype.options = $.extend( + {}, + $.ui.sortable.prototype.options, + $.mjs.nestedSortable.prototype.options + ); +})); diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.map b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.map new file mode 100644 index 00000000000..0c8f9a03b88 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["/*\r\n * jQuery UI Nested Sortable\r\n * v 2.1a / 2016-02-04\r\n * https://github.com/ilikenwf/nestedSortable\r\n *\r\n * Depends on:\r\n *\t jquery.ui.sortable.js 1.10+\r\n *\r\n * Copyright (c) 2010-2016 Manuele J Sarfatti and contributors\r\n * Licensed under the MIT License\r\n * http://www.opensource.org/licenses/mit-license.php\r\n */\r\n(function( factory ) {\r\n\t\"use strict\";\r\n\r\n\tif ( typeof define === \"function\" && define.amd ) {\r\n\r\n\t\t// AMD. Register as an anonymous module.\r\n\t\tdefine([\r\n\t\t\t\"jquery\",\r\n\t\t\t\"jquery-ui/sortable\"\r\n\t\t], factory );\r\n\t} else {\r\n\r\n\t\t// Browser globals\r\n\t\tfactory( window.jQuery );\r\n\t}\r\n}(function($) {\r\n\t\"use strict\";\r\n\r\n\tfunction isOverAxis( x, reference, size ) {\r\n\t\treturn ( x > reference ) && ( x < ( reference + size ) );\r\n\t}\r\n\r\n\t$.widget(\"mjs.nestedSortable\", $.extend({}, $.ui.sortable.prototype, {\r\n\r\n\t\toptions: {\r\n\t\t\tdisableParentChange: false,\r\n\t\t\tdoNotClear: false,\r\n\t\t\texpandOnHover: 700,\r\n\t\t\tisAllowed: function() { return true; },\r\n\t\t\tisTree: false,\r\n\t\t\tlistType: \"ol\",\r\n\t\t\tmaxLevels: 0,\r\n\t\t\tprotectRoot: false,\r\n\t\t\trootID: null,\r\n\t\t\trtl: false,\r\n\t\t\tstartCollapsed: false,\r\n\t\t\ttabSize: 20,\r\n\r\n\t\t\tbranchClass: \"mjs-nestedSortable-branch\",\r\n\t\t\tcollapsedClass: \"mjs-nestedSortable-collapsed\",\r\n\t\t\tdisableNestingClass: \"mjs-nestedSortable-no-nesting\",\r\n\t\t\terrorClass: \"mjs-nestedSortable-error\",\r\n\t\t\texpandedClass: \"mjs-nestedSortable-expanded\",\r\n\t\t\thoveringClass: \"mjs-nestedSortable-hovering\",\r\n\t\t\tleafClass: \"mjs-nestedSortable-leaf\",\r\n\t\t\tdisabledClass: \"mjs-nestedSortable-disabled\"\r\n\t\t},\r\n\r\n\t\t_create: function() {\r\n\t\t\tvar self = this,\r\n\t\t\t\terr;\r\n\r\n\t\t\tthis.element.data(\"ui-sortable\", this.element.data(\"mjs-nestedSortable\"));\r\n\r\n\t\t\t// mjs - prevent browser from freezing if the HTML is not correct\r\n\t\t\tif (!this.element.is(this.options.listType)) {\r\n\t\t\t\terr = \"nestedSortable: \" +\r\n\t\t\t\t\t\"Please check that the listType option is set to your actual list type\";\r\n\r\n\t\t\t\tthrow new Error(err);\r\n\t\t\t}\r\n\r\n\t\t\t// if we have a tree with expanding/collapsing functionality,\r\n\t\t\t// force 'intersect' tolerance method\r\n\t\t\tif (this.options.isTree && this.options.expandOnHover) {\r\n\t\t\t\tthis.options.tolerance = \"intersect\";\r\n\t\t\t}\r\n\r\n\t\t\t$.ui.sortable.prototype._create.apply(this, arguments);\r\n\r\n\t\t\t// prepare the tree by applying the right classes\r\n\t\t\t// (the CSS is responsible for actual hide/show functionality)\r\n\t\t\tif (this.options.isTree) {\r\n\t\t\t\t$(this.items).each(function() {\r\n\t\t\t\t\tvar $li = this.item,\r\n\t\t\t\t\t\thasCollapsedClass = $li.hasClass(self.options.collapsedClass),\r\n\t\t\t\t\t\thasExpandedClass = $li.hasClass(self.options.expandedClass);\r\n\r\n\t\t\t\t\tif ($li.children(self.options.listType).length) {\r\n\t\t\t\t\t\t$li.addClass(self.options.branchClass);\r\n\t\t\t\t\t\t// expand/collapse class only if they have children\r\n\r\n\t\t\t\t\t\tif ( !hasCollapsedClass && !hasExpandedClass ) {\r\n\t\t\t\t\t\t\tif (self.options.startCollapsed) {\r\n\t\t\t\t\t\t\t\t$li.addClass(self.options.collapsedClass);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$li.addClass(self.options.expandedClass);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$li.addClass(self.options.leafClass);\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_destroy: function() {\r\n\t\t\tthis.element\r\n\t\t\t\t.removeData(\"mjs-nestedSortable\")\r\n\t\t\t\t.removeData(\"ui-sortable\");\r\n\t\t\treturn $.ui.sortable.prototype._destroy.apply(this, arguments);\r\n\t\t},\r\n\r\n\t\t_mouseDrag: function(event) {\r\n\t\t\tvar i,\r\n\t\t\t\titem,\r\n\t\t\t\titemElement,\r\n\t\t\t\tintersection,\r\n\t\t\t\tself = this,\r\n\t\t\t\to = this.options,\r\n\t\t\t\tscrolled = false,\r\n\t\t\t\t$document = $(document),\r\n\t\t\t\tpreviousTopOffset,\r\n\t\t\t\tparentItem,\r\n\t\t\t\tlevel,\r\n\t\t\t\tchildLevels,\r\n\t\t\t\titemAfter,\r\n\t\t\t\titemBefore,\r\n\t\t\t\tnewList,\r\n\t\t\t\tmethod,\r\n\t\t\t\ta,\r\n\t\t\t\tpreviousItem,\r\n\t\t\t\tnextItem,\r\n\t\t\t\thelperIsNotSibling;\r\n\r\n\t\t\t//Compute the helpers position\r\n\t\t\tthis.position = this._generatePosition(event);\r\n\t\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\r\n\r\n\t\t\tif (!this.lastPositionAbs) {\r\n\t\t\t\tthis.lastPositionAbs = this.positionAbs;\r\n\t\t\t}\r\n\r\n\t\t\t//Do scrolling\r\n\t\t\tif (this.options.scroll) {\r\n\t\t\t\tif (this.scrollParent[0] !== document && this.scrollParent[0].tagName !== \"HTML\") {\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tthis.overflowOffset.top +\r\n\t\t\t\t\t\t\tthis.scrollParent[0].offsetHeight\r\n\t\t\t\t\t\t) -\r\n\t\t\t\t\t\tevent.pageY <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = this.scrollParent.scrollTop() + o.scrollSpeed;\r\n\t\t\t\t\t\tthis.scrollParent.scrollTop(scrolled);\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\tevent.pageY -\r\n\t\t\t\t\t\tthis.overflowOffset.top <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = this.scrollParent.scrollTop() - o.scrollSpeed;\r\n\t\t\t\t\t\tthis.scrollParent.scrollTop(scrolled);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tthis.overflowOffset.left +\r\n\t\t\t\t\t\t\tthis.scrollParent[0].offsetWidth\r\n\t\t\t\t\t\t) -\r\n\t\t\t\t\t\tevent.pageX <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = this.scrollParent.scrollLeft() + o.scrollSpeed;\r\n\t\t\t\t\t\tthis.scrollParent.scrollLeft(scrolled);\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\tevent.pageX -\r\n\t\t\t\t\t\tthis.overflowOffset.left <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = this.scrollParent.scrollLeft() - o.scrollSpeed;\r\n\t\t\t\t\t\tthis.scrollParent.scrollLeft(scrolled);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tevent.pageY -\r\n\t\t\t\t\t\t$document.scrollTop() <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = $document.scrollTop() - o.scrollSpeed;\r\n\t\t\t\t\t\t$document.scrollTop(scrolled);\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\t$(window).height() -\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tevent.pageY -\r\n\t\t\t\t\t\t\t$document.scrollTop()\r\n\t\t\t\t\t\t) <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = $document.scrollTop() + o.scrollSpeed;\r\n\t\t\t\t\t\t$document.scrollTop(scrolled);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (\r\n\t\t\t\t\t\tevent.pageX -\r\n\t\t\t\t\t\t$document.scrollLeft() <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = $document.scrollLeft() - o.scrollSpeed;\r\n\t\t\t\t\t\t$document.scrollLeft(scrolled);\r\n\t\t\t\t\t} else if (\r\n\t\t\t\t\t\t$(window).width() -\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\tevent.pageX -\r\n\t\t\t\t\t\t\t$document.scrollLeft()\r\n\t\t\t\t\t\t) <\r\n\t\t\t\t\t\to.scrollSensitivity\r\n\t\t\t\t\t) {\r\n\t\t\t\t\t\tscrolled = $document.scrollLeft() + o.scrollSpeed;\r\n\t\t\t\t\t\t$document.scrollLeft(scrolled);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {\r\n\t\t\t\t\t$.ui.ddmanager.prepareOffsets(this, event);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t//Regenerate the absolute position used for position checks\r\n\t\t\tthis.positionAbs = this._convertPositionTo(\"absolute\");\r\n\r\n\t\t\t// mjs - find the top offset before rearrangement,\r\n\t\t\tpreviousTopOffset = this.placeholder.offset().top;\r\n\r\n\t\t\t//Set the helper position\r\n\t\t\tif (!this.options.axis || this.options.axis !== \"y\") {\r\n\t\t\t\tthis.helper[0].style.left = this.position.left + \"px\";\r\n\t\t\t}\r\n\t\t\tif (!this.options.axis || this.options.axis !== \"x\") {\r\n\t\t\t\tthis.helper[0].style.top = (this.position.top) + \"px\";\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - check and reset hovering state at each cycle\r\n\t\t\tthis.hovering = this.hovering ? this.hovering : null;\r\n\t\t\tthis.mouseentered = this.mouseentered ? this.mouseentered : false;\r\n\r\n\t\t\t// mjs - let's start caching some variables\r\n\t\t\t(function() {\r\n\t\t\t\tvar _parentItem = this.placeholder.parent().parent();\r\n\t\t\t\tif (_parentItem && _parentItem.closest(\".ui-sortable\").length) {\r\n\t\t\t\t\tparentItem = _parentItem;\r\n\t\t\t\t}\r\n\t\t\t}.call(this));\r\n\r\n\t\t\tlevel = this._getLevel(this.placeholder);\r\n\t\t\tchildLevels = this._getChildLevels(this.helper);\r\n\t\t\tnewList = document.createElement(o.listType);\r\n\r\n\t\t\t//Rearrange\r\n\t\t\tfor (i = this.items.length - 1; i >= 0; i--) {\r\n\r\n\t\t\t\t//Cache variables and intersection, continue if no intersection\r\n\t\t\t\titem = this.items[i];\r\n\t\t\t\titemElement = item.item[0];\r\n\t\t\t\tintersection = this._intersectsWithPointer(item);\r\n\t\t\t\tif (!intersection) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Only put the placeholder inside the current Container, skip all\r\n\t\t\t\t// items form other containers. This works because when moving\r\n\t\t\t\t// an item from one container to another the\r\n\t\t\t\t// currentContainer is switched before the placeholder is moved.\r\n\t\t\t\t//\r\n\t\t\t\t// Without this moving items in \"sub-sortables\" can cause the placeholder to jitter\r\n\t\t\t\t// beetween the outer and inner container.\r\n\t\t\t\tif (item.instance !== this.currentContainer) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// No action if intersected item is disabled\r\n\t\t\t\t// and the element above or below in the direction we're going is also disabled\r\n\t\t\t\tif (itemElement.className.indexOf(o.disabledClass) !== -1) {\r\n\t\t\t\t\t// Note: intersection hardcoded direction values from\r\n\t\t\t\t\t// jquery.ui.sortable.js:_intersectsWithPointer\r\n\t\t\t\t\tif (intersection === 2) {\r\n\t\t\t\t\t\t// Going down\r\n\t\t\t\t\t\titemAfter = this.items[i + 1];\r\n\t\t\t\t\t\tif (itemAfter && itemAfter.item.hasClass(o.disabledClass)) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else if (intersection === 1) {\r\n\t\t\t\t\t\t// Going up\r\n\t\t\t\t\t\titemBefore = this.items[i - 1];\r\n\t\t\t\t\t\tif (itemBefore && itemBefore.item.hasClass(o.disabledClass)) {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tmethod = intersection === 1 ? \"next\" : \"prev\";\r\n\r\n\t\t\t\t// cannot intersect with itself\r\n\t\t\t\t// no useless actions that have been done before\r\n\t\t\t\t// no action if the item moved is the parent of the item checked\r\n\t\t\t\tif (itemElement !== this.currentItem[0] &&\r\n\t\t\t\t\tthis.placeholder[method]()[0] !== itemElement &&\r\n\t\t\t\t\t!$.contains(this.placeholder[0], itemElement) &&\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tthis.options.type === \"semi-dynamic\" ?\r\n\t\t\t\t\t\t\t!$.contains(this.element[0], itemElement) :\r\n\t\t\t\t\t\t\ttrue\r\n\t\t\t\t\t)\r\n\t\t\t\t) {\r\n\r\n\t\t\t\t\t// mjs - we are intersecting an element:\r\n\t\t\t\t\t// trigger the mouseenter event and store this state\r\n\t\t\t\t\tif (!this.mouseentered) {\r\n\t\t\t\t\t\t$(itemElement).mouseenter();\r\n\t\t\t\t\t\tthis.mouseentered = true;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// mjs - if the element has children and they are hidden,\r\n\t\t\t\t\t// show them after a delay (CSS responsible)\r\n\t\t\t\t\tif (o.isTree && $(itemElement).hasClass(o.collapsedClass) && o.expandOnHover) {\r\n\t\t\t\t\t\tif (!this.hovering) {\r\n\t\t\t\t\t\t\t$(itemElement).addClass(o.hoveringClass);\r\n\t\t\t\t\t\t\tthis.hovering = window.setTimeout(function() {\r\n\t\t\t\t\t\t\t\t$(itemElement)\r\n\t\t\t\t\t\t\t\t\t.removeClass(o.collapsedClass)\r\n\t\t\t\t\t\t\t\t\t.addClass(o.expandedClass);\r\n\r\n\t\t\t\t\t\t\t\tself.refreshPositions();\r\n\t\t\t\t\t\t\t\tself._trigger(\"expand\", event, self._uiHash());\r\n\t\t\t\t\t\t\t}, o.expandOnHover);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tthis.direction = intersection === 1 ? \"down\" : \"up\";\r\n\r\n\t\t\t\t\t// mjs - rearrange the elements and reset timeouts and hovering state\r\n\t\t\t\t\tif (this.options.tolerance === \"pointer\" || this._intersectsWithSides(item)) {\r\n\t\t\t\t\t\t$(itemElement).mouseleave();\r\n\t\t\t\t\t\tthis.mouseentered = false;\r\n\t\t\t\t\t\t$(itemElement).removeClass(o.hoveringClass);\r\n\t\t\t\t\t\tif (this.hovering) {\r\n\t\t\t\t\t\t\twindow.clearTimeout(this.hovering);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tthis.hovering = null;\r\n\r\n\t\t\t\t\t\t// mjs - do not switch container if\r\n\t\t\t\t\t\t// it's a root item and 'protectRoot' is true\r\n\t\t\t\t\t\t// or if it's not a root item but we are trying to make it root\r\n\t\t\t\t\t\tif (o.protectRoot &&\r\n\t\t\t\t\t\t\t!(\r\n\t\t\t\t\t\t\t\tthis.currentItem[0].parentNode === this.element[0] &&\r\n\t\t\t\t\t\t\t\t// it's a root item\r\n\t\t\t\t\t\t\t\titemElement.parentNode !== this.element[0]\r\n\t\t\t\t\t\t\t\t// it's intersecting a non-root item\r\n\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\tif (this.currentItem[0].parentNode !== this.element[0] &&\r\n\t\t\t\t\t\t\t\titemElement.parentNode === this.element[0]\r\n\t\t\t\t\t\t\t) {\r\n\r\n\t\t\t\t\t\t\t\tif ( !$(itemElement).children(o.listType).length) {\r\n\t\t\t\t\t\t\t\t\titemElement.appendChild(newList);\r\n\t\t\t\t\t\t\t\t\tif (o.isTree) {\r\n\t\t\t\t\t\t\t\t\t\t$(itemElement)\r\n\t\t\t\t\t\t\t\t\t\t\t.removeClass(o.leafClass)\r\n\t\t\t\t\t\t\t\t\t\t\t.addClass(o.branchClass + \" \" + o.expandedClass);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (this.direction === \"down\") {\r\n\t\t\t\t\t\t\t\t\ta = $(itemElement).prev().children(o.listType);\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\ta = $(itemElement).children(o.listType);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\tif (a[0] !== undefined) {\r\n\t\t\t\t\t\t\t\t\tthis._rearrange(event, null, a);\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tthis._rearrange(event, item);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t} else if (!o.protectRoot) {\r\n\t\t\t\t\t\t\tthis._rearrange(event, item);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Clear emtpy ul's/ol's\r\n\t\t\t\t\tthis._clearEmpty(itemElement);\r\n\r\n\t\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - to find the previous sibling in the list,\r\n\t\t\t// keep backtracking until we hit a valid list item.\r\n\t\t\t(function() {\r\n\t\t\t\tvar _previousItem = this.placeholder.prev();\r\n\t\t\t\tif (_previousItem.length) {\r\n\t\t\t\t\tpreviousItem = _previousItem;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tpreviousItem = null;\r\n\t\t\t\t}\r\n\t\t\t}.call(this));\r\n\r\n\t\t\tif (previousItem != null) {\r\n\t\t\t\twhile (\r\n\t\t\t\t\tpreviousItem[0].nodeName.toLowerCase() !== \"li\" ||\r\n\t\t\t\t\tpreviousItem[0].className.indexOf(o.disabledClass) !== -1 ||\r\n\t\t\t\t\tpreviousItem[0] === this.currentItem[0] ||\r\n\t\t\t\t\tpreviousItem[0] === this.helper[0]\r\n\t\t\t\t) {\r\n\t\t\t\t\tif (previousItem[0].previousSibling) {\r\n\t\t\t\t\t\tpreviousItem = $(previousItem[0].previousSibling);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpreviousItem = null;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - to find the next sibling in the list,\r\n\t\t\t// keep stepping forward until we hit a valid list item.\r\n\t\t\t(function() {\r\n\t\t\t\tvar _nextItem = this.placeholder.next();\r\n\t\t\t\tif (_nextItem.length) {\r\n\t\t\t\t\tnextItem = _nextItem;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tnextItem = null;\r\n\t\t\t\t}\r\n\t\t\t}.call(this));\r\n\r\n\t\t\tif (nextItem != null) {\r\n\t\t\t\twhile (\r\n\t\t\t\t\tnextItem[0].nodeName.toLowerCase() !== \"li\" ||\r\n\t\t\t\t\tnextItem[0].className.indexOf(o.disabledClass) !== -1 ||\r\n\t\t\t\t\tnextItem[0] === this.currentItem[0] ||\r\n\t\t\t\t\tnextItem[0] === this.helper[0]\r\n\t\t\t\t) {\r\n\t\t\t\t\tif (nextItem[0].nextSibling) {\r\n\t\t\t\t\t\tnextItem = $(nextItem[0].nextSibling);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnextItem = null;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.beyondMaxLevels = 0;\r\n\r\n\t\t\t// mjs - if the item is moved to the left, send it one level up\r\n\t\t\t// but only if it's at the bottom of the list\r\n\t\t\tif (parentItem != null &&\r\n\t\t\t\tnextItem == null &&\r\n\t\t\t\t!(o.protectRoot && parentItem[0].parentNode == this.element[0]) &&\r\n\t\t\t\t(\r\n\t\t\t\t\to.rtl &&\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tthis.positionAbs.left +\r\n\t\t\t\t\t\tthis.helper.outerWidth() > parentItem.offset().left +\r\n\t\t\t\t\t\tparentItem.outerWidth()\r\n\t\t\t\t\t) ||\r\n\t\t\t\t\t!o.rtl && (this.positionAbs.left < parentItem.offset().left)\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\r\n\t\t\t\tparentItem.after(this.placeholder[0]);\r\n\t\t\t\thelperIsNotSibling = !parentItem\r\n\t\t\t\t\t\t\t\t\t\t\t.children(o.listItem)\r\n\t\t\t\t\t\t\t\t\t\t\t.children(\"li:visible:not(.ui-sortable-helper)\")\r\n\t\t\t\t\t\t\t\t\t\t\t.length;\r\n\t\t\t\tif (o.isTree && helperIsNotSibling) {\r\n\t\t\t\t\tparentItem\r\n\t\t\t\t\t\t.removeClass(this.options.branchClass + \" \" + this.options.expandedClass)\r\n\t\t\t\t\t\t.addClass(this.options.leafClass);\r\n\t\t\t\t}\r\n if(typeof parentItem !== 'undefined')\r\n\t\t\t\t this._clearEmpty(parentItem[0]);\r\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\r\n\t\t\t\t// mjs - if the item is below a sibling and is moved to the right,\r\n\t\t\t\t// make it a child of that sibling\r\n\t\t\t} else if (previousItem != null &&\r\n\t\t\t\t!previousItem.hasClass(o.disableNestingClass) &&\r\n\t\t\t\t(\r\n\t\t\t\t\tpreviousItem.children(o.listType).length &&\r\n\t\t\t\t\tpreviousItem.children(o.listType).is(\":visible\") ||\r\n\t\t\t\t\t!previousItem.children(o.listType).length\r\n\t\t\t\t) &&\r\n\t\t\t\t!(o.protectRoot && this.currentItem[0].parentNode === this.element[0]) &&\r\n\t\t\t\t(\r\n\t\t\t\t\to.rtl &&\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\tthis.positionAbs.left +\r\n\t\t\t\t\t\tthis.helper.outerWidth() <\r\n\t\t\t\t\t\tpreviousItem.offset().left +\r\n\t\t\t\t\t\tpreviousItem.outerWidth() -\r\n\t\t\t\t\t\to.tabSize\r\n\t\t\t\t\t) ||\r\n\t\t\t\t\t!o.rtl &&\r\n\t\t\t\t\t(this.positionAbs.left > previousItem.offset().left + o.tabSize)\r\n\t\t\t\t)\r\n\t\t\t) {\r\n\r\n\t\t\t\tthis._isAllowed(previousItem, level, level + childLevels + 1);\r\n\r\n\t\t\t\tif (!previousItem.children(o.listType).length) {\r\n\t\t\t\t\tpreviousItem[0].appendChild(newList);\r\n\t\t\t\t\tif (o.isTree) {\r\n\t\t\t\t\t\tpreviousItem\r\n\t\t\t\t\t\t\t.removeClass(o.leafClass)\r\n\t\t\t\t\t\t\t.addClass(o.branchClass + \" \" + o.expandedClass);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// mjs - if this item is being moved from the top, add it to the top of the list.\r\n\t\t\t\tif (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) {\r\n\t\t\t\t\tpreviousItem.children(o.listType).prepend(this.placeholder);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// mjs - otherwise, add it to the bottom of the list.\r\n\t\t\t\t\tpreviousItem.children(o.listType)[0].appendChild(this.placeholder[0]);\r\n\t\t\t\t}\r\n if(typeof parentItem !== 'undefined')\r\n\t\t\t\t this._clearEmpty(parentItem[0]);\r\n\t\t\t\tthis._trigger(\"change\", event, this._uiHash());\r\n\t\t\t} else {\r\n\t\t\t\tthis._isAllowed(parentItem, level, level + childLevels);\r\n\t\t\t}\r\n\r\n\t\t\t//Post events to containers\r\n\t\t\tthis._contactContainers(event);\r\n\r\n\t\t\t//Interconnect with droppables\r\n\t\t\tif ($.ui.ddmanager) {\r\n\t\t\t\t$.ui.ddmanager.drag(this, event);\r\n\t\t\t}\r\n\r\n\t\t\t//Call callbacks\r\n\t\t\tthis._trigger(\"sort\", event, this._uiHash());\r\n\r\n\t\t\tthis.lastPositionAbs = this.positionAbs;\r\n\t\t\treturn false;\r\n\r\n\t\t},\r\n\r\n\t\t_mouseStop: function(event) {\r\n\t\t\t// mjs - if the item is in a position not allowed, send it back\r\n\t\t\tif (this.beyondMaxLevels) {\r\n\r\n\t\t\t\tthis.placeholder.removeClass(this.options.errorClass);\r\n\r\n\t\t\t\tif (this.domPosition.prev) {\r\n\t\t\t\t\t$(this.domPosition.prev).after(this.placeholder);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$(this.domPosition.parent).prepend(this.placeholder);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._trigger(\"revert\", event, this._uiHash());\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - clear the hovering timeout, just to be sure\r\n\t\t\t$(\".\" + this.options.hoveringClass)\r\n\t\t\t\t.mouseleave()\r\n\t\t\t\t.removeClass(this.options.hoveringClass);\r\n\r\n\t\t\tthis.mouseentered = false;\r\n\t\t\tif (this.hovering) {\r\n\t\t\t\twindow.clearTimeout(this.hovering);\r\n\t\t\t}\r\n\t\t\tthis.hovering = null;\r\n\r\n\t\t\tthis._relocate_event = event;\r\n\t\t\tthis._pid_current = $(this.domPosition.parent).parent().attr(\"id\");\r\n\t\t\tthis._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0;\r\n\t\t\t$.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event.\r\n\t\t},\r\n\r\n\t\t// mjs - this function is slightly modified\r\n\t\t// to make it easier to hover over a collapsed element and have it expand\r\n\t\t_intersectsWithSides: function(item) {\r\n\r\n\t\t\tvar half = this.options.isTree ? .8 : .5,\r\n\t\t\t\tisOverBottomHalf = isOverAxis(\r\n\t\t\t\t\tthis.positionAbs.top + this.offset.click.top,\r\n\t\t\t\t\titem.top + (item.height * half),\r\n\t\t\t\t\titem.height\r\n\t\t\t\t),\r\n\t\t\t\tisOverTopHalf = isOverAxis(\r\n\t\t\t\t\tthis.positionAbs.top + this.offset.click.top,\r\n\t\t\t\t\titem.top - (item.height * half),\r\n\t\t\t\t\titem.height\r\n\t\t\t\t),\r\n\t\t\t\tisOverRightHalf = isOverAxis(\r\n\t\t\t\t\tthis.positionAbs.left + this.offset.click.left,\r\n\t\t\t\t\titem.left + (item.width / 2),\r\n\t\t\t\t\titem.width\r\n\t\t\t\t),\r\n\t\t\t\tverticalDirection = this._getDragVerticalDirection(),\r\n\t\t\t\thorizontalDirection = this._getDragHorizontalDirection();\r\n\r\n\t\t\tif (this.floating && horizontalDirection) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\t(horizontalDirection === \"right\" && isOverRightHalf) ||\r\n\t\t\t\t\t(horizontalDirection === \"left\" && !isOverRightHalf)\r\n\t\t\t\t);\r\n\t\t\t} else {\r\n\t\t\t\treturn verticalDirection && (\r\n\t\t\t\t\t(verticalDirection === \"down\" && isOverBottomHalf) ||\r\n\t\t\t\t\t(verticalDirection === \"up\" && isOverTopHalf)\r\n\t\t\t\t);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t_contactContainers: function() {\r\n\r\n\t\t\tif (this.options.protectRoot && this.currentItem[0].parentNode === this.element[0] ) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t$.ui.sortable.prototype._contactContainers.apply(this, arguments);\r\n\r\n\t\t},\r\n\r\n\t\t_clear: function() {\r\n\t\t\tvar i,\r\n\t\t\t\titem;\r\n\r\n\t\t\t$.ui.sortable.prototype._clear.apply(this, arguments);\r\n\r\n\t\t\t//relocate event\r\n\t\t\tif (!(this._pid_current === this._uiHash().item.parent().parent().attr(\"id\") &&\r\n\t\t\t\tthis._sort_current === this._uiHash().item.index())) {\r\n\t\t\t\tthis._trigger(\"relocate\", this._relocate_event, this._uiHash());\r\n\t\t\t}\r\n\r\n\t\t\t// mjs - clean last empty ul/ol\r\n\t\t\tfor (i = this.items.length - 1; i >= 0; i--) {\r\n\t\t\t\titem = this.items[i].item[0];\r\n\t\t\t\tthis._clearEmpty(item);\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\tserialize: function(options) {\r\n\r\n\t\t\tvar o = $.extend({}, this.options, options),\r\n\t\t\t\titems = this._getItemsAsjQuery(o && o.connected),\r\n\t\t\t\tstr = [];\r\n\r\n\t\t\t$(items).each(function() {\r\n\t\t\t\tvar res = ($(o.item || this).attr(o.attribute || \"id\") || \"\")\r\n\t\t\t\t\t\t.match(o.expression || (/(.+)[-=_](.+)/)),\r\n\t\t\t\t\tpid = ($(o.item || this).parent(o.listType)\r\n\t\t\t\t\t\t.parent(o.items)\r\n\t\t\t\t\t\t.attr(o.attribute || \"id\") || \"\")\r\n\t\t\t\t\t\t.match(o.expression || (/(.+)[-=_](.+)/));\r\n\r\n\t\t\t\tif (res) {\r\n\t\t\t\t\tstr.push(\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t(o.key || res[1]) +\r\n\t\t\t\t\t\t\t\"[\" +\r\n\t\t\t\t\t\t\t(o.key && o.expression ? res[1] : res[2]) + \"]\"\r\n\t\t\t\t\t\t) +\r\n\t\t\t\t\t\t\"=\" +\r\n\t\t\t\t\t\t(pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID));\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (!str.length && o.key) {\r\n\t\t\t\tstr.push(o.key + \"=\");\r\n\t\t\t}\r\n\r\n\t\t\treturn str.join(\"&\");\r\n\r\n\t\t},\r\n\r\n\t\ttoHierarchy: function(options) {\r\n\r\n\t\t\tvar o = $.extend({}, this.options, options),\r\n\t\t\t\tret = [];\r\n\r\n\t\t\t$(this.element).children(o.items).each(function() {\r\n\t\t\t\tvar level = _recursiveItems(this);\r\n\t\t\t\tret.push(level);\r\n\t\t\t});\r\n\r\n\t\t\treturn ret;\r\n\r\n\t\t\tfunction _recursiveItems(item) {\r\n\t\t\t\tvar id = ($(item).attr(o.attribute || \"id\") || \"\").match(o.expression || (/(.+)[-=_](.+)/)),\r\n\t\t\t\t\tcurrentItem;\r\n\r\n\t\t\t\tvar data = $(item).data();\r\n\t\t\t\tif (data.nestedSortableItem) {\r\n\t\t\t\t\tdelete data.nestedSortableItem; // Remove the nestedSortableItem object from the data\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (id) {\r\n\t\t\t\t\tcurrentItem = {\r\n\t\t\t\t\t\t\"id\": id[2]\r\n\t\t\t\t\t};\r\n\r\n\t\t\t\t\tcurrentItem = $.extend({}, currentItem, data); // Combine the two objects\r\n\r\n\t\t\t\t\tif ($(item).children(o.listType).children(o.items).length > 0) {\r\n\t\t\t\t\t\tcurrentItem.children = [];\r\n\t\t\t\t\t\t$(item).children(o.listType).children(o.items).each(function() {\r\n\t\t\t\t\t\t\tvar level = _recursiveItems(this);\r\n\t\t\t\t\t\t\tcurrentItem.children.push(level);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn currentItem;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\ttoArray: function(options) {\r\n\r\n\t\t\tvar o = $.extend({}, this.options, options),\r\n\t\t\t\tsDepth = o.startDepthCount || 0,\r\n\t\t\t\tret = [],\r\n\t\t\t\tleft = 1;\r\n\r\n\t\t\tif (!o.excludeRoot) {\r\n\t\t\t\tret.push({\r\n\t\t\t\t\t\"item_id\": o.rootID,\r\n\t\t\t\t\t\"parent_id\": null,\r\n\t\t\t\t\t\"depth\": sDepth,\r\n\t\t\t\t\t\"left\": left,\r\n\t\t\t\t\t\"right\": ($(o.items, this.element).length + 1) * 2\r\n\t\t\t\t});\r\n\t\t\t\tleft++;\r\n\t\t\t}\r\n\r\n\t\t\t$(this.element).children(o.items).each(function() {\r\n\t\t\t\tleft = _recursiveArray(this, sDepth, left);\r\n\t\t\t});\r\n\r\n\t\t\tret = ret.sort(function(a, b) { return (a.left - b.left); });\r\n\r\n\t\t\treturn ret;\r\n\r\n\t\t\tfunction _recursiveArray(item, depth, _left) {\r\n\r\n\t\t\t\tvar right = _left + 1,\r\n\t\t\t\t\tid,\r\n\t\t\t\t\tpid,\r\n\t\t\t\t\tparentItem;\r\n\r\n\t\t\t\tif ($(item).children(o.listType).children(o.items).length > 0) {\r\n\t\t\t\t\tdepth++;\r\n\t\t\t\t\t$(item).children(o.listType).children(o.items).each(function() {\r\n\t\t\t\t\t\tright = _recursiveArray($(this), depth, right);\r\n\t\t\t\t\t});\r\n\t\t\t\t\tdepth--;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tid = ($(item).attr(o.attribute || \"id\") || \"\").match(o.expression || (/(.+)[-=_](.+)/));\r\n\r\n\t\t\t\tif (depth === sDepth) {\r\n\t\t\t\t\tpid = o.rootID;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tparentItem = ($(item).parent(o.listType)\r\n\t\t\t\t\t\t\t\t\t\t\t.parent(o.items)\r\n\t\t\t\t\t\t\t\t\t\t\t.attr(o.attribute || \"id\"))\r\n\t\t\t\t\t\t\t\t\t\t\t.match(o.expression || (/(.+)[-=_](.+)/));\r\n\t\t\t\t\tpid = parentItem[2];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (id) {\r\n\t\t\t\t\tvar data = $(item).children('div').data();\r\n\t\t\t\t\tvar itemObj = $.extend( data, {\r\n\t\t\t\t\t\t\"id\":id[2],\r\n\t\t\t\t\t\t\"parent_id\":pid,\r\n\t\t\t\t\t\t\"depth\":depth,\r\n\t\t\t\t\t\t\"left\":_left,\r\n\t\t\t\t\t\t\"right\":right\r\n\t\t\t\t\t\t} );\r\n\t\t\t\t\tret.push( itemObj );\r\n\t\t\t\t}\r\n\r\n\t\t\t\t_left = right + 1;\r\n\t\t\t\treturn _left;\r\n\t\t\t}\r\n\r\n\t\t},\r\n\r\n\t\t_clearEmpty: function (item) {\r\n\t\t\tfunction replaceClass(elem, search, replace, swap) {\r\n\t\t\t\tif (swap) {\r\n\t\t\t\t\tsearch = [replace, replace = search][0];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$(elem).removeClass(search).addClass(replace);\r\n\t\t\t}\r\n\r\n\t\t\tvar o = this.options,\r\n\t\t\t\tchildrenList = $(item).children(o.listType),\r\n\t\t\t\thasChildren = childrenList.has('li').length;\r\n\r\n\t\t\tvar doNotClear =\r\n\t\t\t\to.doNotClear ||\r\n\t\t\t\thasChildren ||\r\n\t\t\t\to.protectRoot && $(item)[0] === this.element[0];\r\n\r\n\t\t\tif (o.isTree) {\r\n\t\t\t\treplaceClass(item, o.branchClass, o.leafClass, doNotClear);\r\n\t\t\t}\r\n\r\n\t\t\tif (!doNotClear) {\r\n\t\t\t\tchildrenList.parent().removeClass(o.expandedClass);\r\n\t\t\t\tchildrenList.remove();\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\t_getLevel: function(item) {\r\n\r\n\t\t\tvar level = 1,\r\n\t\t\t\tlist;\r\n\r\n\t\t\tif (this.options.listType) {\r\n\t\t\t\tlist = item.closest(this.options.listType);\r\n\t\t\t\twhile (list && list.length > 0 && !list.is(\".ui-sortable\")) {\r\n\t\t\t\t\tlevel++;\r\n\t\t\t\t\tlist = list.parent().closest(this.options.listType);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn level;\r\n\t\t},\r\n\r\n\t\t_getChildLevels: function(parent, depth) {\r\n\t\t\tvar self = this,\r\n\t\t\t\to = this.options,\r\n\t\t\t\tresult = 0;\r\n\t\t\tdepth = depth || 0;\r\n\r\n\t\t\t$(parent).children(o.listType).children(o.items).each(function(index, child) {\r\n\t\t\t\tresult = Math.max(self._getChildLevels(child, depth + 1), result);\r\n\t\t\t});\r\n\r\n\t\t\treturn depth ? result + 1 : result;\r\n\t\t},\r\n\r\n\t\t_isAllowed: function(parentItem, level, levels) {\r\n\t\t\tvar o = this.options,\r\n\t\t\t\t// this takes into account the maxLevels set to the recipient list\r\n\t\t\t\tmaxLevels = this\r\n\t\t\t\t\t.placeholder\r\n\t\t\t\t\t.closest(\".ui-sortable\")\r\n\t\t\t\t\t.nestedSortable(\"option\", \"maxLevels\"),\r\n\r\n\t\t\t\t// Check if the parent has changed to prevent it, when o.disableParentChange is true\r\n\t\t\t\toldParent = this.currentItem.parent().parent(),\r\n\t\t\t\tdisabledByParentchange = o.disableParentChange && (\r\n\t\t\t\t\t//From somewhere to somewhere else, except the root\r\n\t\t\t\t\ttypeof parentItem !== 'undefined' && !oldParent.is(parentItem) ||\r\n\t\t\t\t\ttypeof parentItem === 'undefined' && oldParent.is(\"li\")\t//From somewhere to the root\r\n\t\t\t\t);\r\n\t\t\t// mjs - is the root protected?\r\n\t\t\t// mjs - are we nesting too deep?\r\n\t\t\tif (\r\n\t\t\t\tdisabledByParentchange ||\r\n\t\t\t\t!o.isAllowed(this.placeholder, parentItem, this.currentItem)\r\n\t\t\t) {\r\n\t\t\t\tthis.placeholder.addClass(o.errorClass);\r\n\t\t\t\tif (maxLevels < levels && maxLevels !== 0) {\r\n\t\t\t\t\tthis.beyondMaxLevels = levels - maxLevels;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.beyondMaxLevels = 1;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (maxLevels < levels && maxLevels !== 0) {\r\n\t\t\t\t\tthis.placeholder.addClass(o.errorClass);\r\n\t\t\t\t\tthis.beyondMaxLevels = levels - maxLevels;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.placeholder.removeClass(o.errorClass);\r\n\t\t\t\t\tthis.beyondMaxLevels = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}));\r\n\r\n\t$.mjs.nestedSortable.prototype.options = $.extend(\r\n\t\t{},\r\n\t\t$.ui.sortable.prototype.options,\r\n\t\t$.mjs.nestedSortable.prototype.options\r\n\t);\r\n}));\r\n"],"names":["factory","define","amd","window","jQuery","$","widget","extend","ui","sortable","prototype","options","disableParentChange","doNotClear","expandOnHover","isAllowed","isTree","listType","maxLevels","protectRoot","rootID","rtl","startCollapsed","tabSize","branchClass","collapsedClass","disableNestingClass","errorClass","expandedClass","hoveringClass","leafClass","disabledClass","_create","self","element","data","is","Error","tolerance","apply","arguments","items","each","$li","item","hasCollapsedClass","hasClass","hasExpandedClass","children","length","addClass","_destroy","removeData","_mouseDrag","event","i","itemElement","intersection","previousTopOffset","parentItem","level","childLevels","itemAfter","itemBefore","newList","method","a","previousItem","nextItem","helperIsNotSibling","o","scrolled","$document","document","position","_generatePosition","positionAbs","_convertPositionTo","lastPositionAbs","scroll","scrollParent","tagName","overflowOffset","top","offsetHeight","pageY","scrollSensitivity","scrollTop","scrollSpeed","left","offsetWidth","pageX","scrollLeft","height","width","ddmanager","dropBehaviour","prepareOffsets","placeholder","offset","axis","helper","style","hovering","mouseentered","_parentItem","parent","closest","call","_getLevel","_getChildLevels","createElement","_intersectsWithPointer","instance","currentContainer","className","indexOf","currentItem","contains","type","mouseenter","setTimeout","removeClass","refreshPositions","_trigger","_uiHash","direction","_intersectsWithSides","mouseleave","clearTimeout","parentNode","appendChild","undefined","prev","_rearrange","_clearEmpty","_previousItem","nodeName","toLowerCase","previousSibling","_nextItem","next","nextSibling","beyondMaxLevels","outerWidth","after","listItem","_isAllowed","prepend","_contactContainers","drag","_mouseStop","domPosition","_relocate_event","_pid_current","attr","_sort_current","index","x","reference","size","half","isOverBottomHalf","click","isOverTopHalf","isOverRightHalf","verticalDirection","_getDragVerticalDirection","horizontalDirection","_getDragHorizontalDirection","floating","_clear","serialize","_getItemsAsjQuery","connected","str","res","attribute","match","expression","pid","push","key","join","toHierarchy","ret","_recursiveItems","id","nestedSortableItem","toArray","sDepth","startDepthCount","excludeRoot","_recursiveArray","depth","_left","right","itemObj","sort","b","search","replace","childrenList","hasChildren","has","remove","list","result","child","Math","max","levels","nestedSortable","oldParent","disabledByParentchange","mjs"],"mappings":"CAYC,SAAUA,CAAO,EACjB,YAEK,AAAkB,CAAA,YAAlB,OAAOC,QAAy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SAAU,aAG3BC,EAAY,IAAI,CAAChG,WAAW,CAACX,MAAM,GAAGA,MAAM,EAS5C4G,AARyBhJ,CAAAA,EAAE1D,mBAAmB,EAE7C,CAAA,AAAsB,KAAA,IAAf+C,GAA8B,CAAC0J,EAAUjL,EAAE,CAACuB,IACnD,AAAsB,KAAA,IAAfA,GAA8B0J,EAAUjL,EAAE,CAAC,KAAI,GAMvD,CAACkC,EAAEvD,SAAS,CAAC,IAAI,CAACmF,WAAW,CAAEvC,EAAY,IAAI,CAAC0D,WAAW,GAE3D,IAAI,CAACnB,WAAW,CAAChD,QAAQ,CAACoB,EAAE3C,UAAU,EAClCT,EAAYiM,GAAUjM,AAAc,IAAdA,EACzB,IAAI,CAAC6H,eAAe,CAAGoE,EAASjM,EAEhC,IAAI,CAAC6H,eAAe,CAAG,GAGpB7H,EAAYiM,GAAUjM,AAAc,IAAdA,GACzB,IAAI,CAACgF,WAAW,CAAChD,QAAQ,CAACoB,EAAE3C,UAAU,EACtC,IAAI,CAACoH,eAAe,CAAGoE,EAASjM,IAEhC,IAAI,CAACgF,WAAW,CAACwB,WAAW,CAACpD,EAAE3C,UAAU,EACzC,IAAI,CAACoH,eAAe,CAAG,EAG1B,CAED,IAEA1I,EAAEkN,GAAG,CAACH,cAAc,CAAC1M,SAAS,CAACC,OAAO,CAAGN,EAAEE,MAAM,CAChD,CAAC,EACDF,EAAEG,EAAE,CAACC,QAAQ,CAACC,SAAS,CAACC,OAAO,CAC/BN,EAAEkN,GAAG,CAACH,cAAc,CAAC1M,SAAS,CAACC,OAAO,CAExC"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.min.js b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.min.js index 198b2d51a17..1206a13a301 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/menu.min.js @@ -1 +1 @@ -!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/sortable"],e):e(window.jQuery)}((function(e){"use strict";function t(e,t,s){return e>t&&e=0;s--)if(i=this.items[s],o=i.item[0],(l=this._intersectsWithPointer(i))&&i.instance===this.currentContainer){if(-1!==o.className.indexOf(b.disabledClass))if(2===l){if((p=this.items[s+1])&&p.item.hasClass(b.disabledClass))continue}else if(1===l&&(d=this.items[s-1])&&d.item.hasClass(b.disabledClass))continue;if(u=1===l?"next":"prev",!(o===this.currentItem[0]||this.placeholder[u]()[0]===o||e.contains(this.placeholder[0],o)||"semi-dynamic"===this.options.type&&e.contains(this.element[0],o))){if(this.mouseentered||(e(o).mouseenter(),this.mouseentered=!0),b.isTree&&e(o).hasClass(b.collapsedClass)&&b.expandOnHover&&(this.hovering||(e(o).addClass(b.hoveringClass),this.hovering=window.setTimeout((function(){e(o).removeClass(b.collapsedClass).addClass(b.expandedClass),C.refreshPositions(),C._trigger("expand",t,C._uiHash())}),b.expandOnHover))),this.direction=1===l?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(i))break;e(o).mouseleave(),this.mouseentered=!1,e(o).removeClass(b.hoveringClass),this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,!b.protectRoot||this.currentItem[0].parentNode===this.element[0]&&o.parentNode!==this.element[0]?b.protectRoot||this._rearrange(t,i):this.currentItem[0].parentNode!==this.element[0]&&o.parentNode===this.element[0]?(e(o).children(b.listType).length||(o.appendChild(c),b.isTree&&e(o).removeClass(b.leafClass).addClass(b.branchClass+" "+b.expandedClass)),void 0!==(f="down"===this.direction?e(o).prev().children(b.listType):e(o).children(b.listType))[0]&&this._rearrange(t,null,f)):this._rearrange(t,i),this._clearEmpty(o),this._trigger("change",t,this._uiHash());break}}if(function(){var e=this.placeholder.prev();m=e.length?e:null}.call(this),null!=m)for(;"li"!==m[0].nodeName.toLowerCase()||-1!==m[0].className.indexOf(b.disabledClass)||m[0]===this.currentItem[0]||m[0]===this.helper[0];){if(!m[0].previousSibling){m=null;break}m=e(m[0].previousSibling)}if(function(){var e=this.placeholder.next();v=e.length?e:null}.call(this),null!=v)for(;"li"!==v[0].nodeName.toLowerCase()||-1!==v[0].className.indexOf(b.disabledClass)||v[0]===this.currentItem[0]||v[0]===this.helper[0];){if(!v[0].nextSibling){v=null;break}v=e(v[0].nextSibling)}return this.beyondMaxLevels=0,null==n||null!=v||b.protectRoot&&n[0].parentNode==this.element[0]||!(b.rtl&&this.positionAbs.left+this.helper.outerWidth()>n.offset().left+n.outerWidth()||!b.rtl&&this.positionAbs.leftm.offset().left+b.tabSize)?this._isAllowed(n,a,a+h):(this._isAllowed(m,a,a+h+1),m.children(b.listType).length||(m[0].appendChild(c),b.isTree&&m.removeClass(b.leafClass).addClass(b.branchClass+" "+b.expandedClass)),r&&r<=m.offset().top?m.children(b.listType).prepend(this.placeholder):m.children(b.listType)[0].appendChild(this.placeholder[0]),void 0!==n&&this._clearEmpty(n[0]),this._trigger("change",t,this._uiHash())):(n.after(this.placeholder[0]),g=!n.children(b.listItem).children("li:visible:not(.ui-sortable-helper)").length,b.isTree&&g&&n.removeClass(this.options.branchClass+" "+this.options.expandedClass).addClass(this.options.leafClass),void 0!==n&&this._clearEmpty(n[0]),this._trigger("change",t,this._uiHash())),this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?e(this.domPosition.prev).after(this.placeholder):e(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",t,this._uiHash())),e("."+this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass),this.mouseentered=!1,this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,this._relocate_event=t,this._pid_current=e(this.domPosition.parent).parent().attr("id"),this._sort_current=this.domPosition.prev?e(this.domPosition.prev).next().index():0,e.ui.sortable.prototype._mouseStop.apply(this,arguments)},_intersectsWithSides:function(e){var s=this.options.isTree?.8:.5,i=t(this.positionAbs.top+this.offset.click.top,e.top+e.height*s,e.height),o=t(this.positionAbs.top+this.offset.click.top,e.top-e.height*s,e.height),l=t(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),r=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&l||"left"===n&&!l:r&&("down"===r&&i||"up"===r&&o)},_contactContainers:function(){this.options.protectRoot&&this.currentItem[0].parentNode===this.element[0]||e.ui.sortable.prototype._contactContainers.apply(this,arguments)},_clear:function(){var t,s;for(e.ui.sortable.prototype._clear.apply(this,arguments),this._pid_current===this._uiHash().item.parent().parent().attr("id")&&this._sort_current===this._uiHash().item.index()||this._trigger("relocate",this._relocate_event,this._uiHash()),t=this.items.length-1;t>=0;t--)s=this.items[t].item[0],this._clearEmpty(s)},serialize:function(t){var s=e.extend({},this.options,t),i=this._getItemsAsjQuery(s&&s.connected),o=[];return e(i).each((function(){var t=(e(s.item||this).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),i=(e(s.item||this).parent(s.listType).parent(s.items).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/);t&&o.push((s.key||t[1])+"["+(s.key&&s.expression?t[1]:t[2])+"]="+(i?s.key&&s.expression?i[1]:i[2]:s.rootID))})),!o.length&&s.key&&o.push(s.key+"="),o.join("&")},toHierarchy:function(t){var s=e.extend({},this.options,t),i=[];return e(this.element).children(s.items).each((function(){var e=o(this);i.push(e)})),i;function o(t){var i,l=(e(t).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),r=e(t).data();if(r.nestedSortableItem&&delete r.nestedSortableItem,l)return i={id:l[2]},i=e.extend({},i,r),e(t).children(s.listType).children(s.items).length>0&&(i.children=[],e(t).children(s.listType).children(s.items).each((function(){var e=o(this);i.children.push(e)}))),i}},toArray:function(t){var s=e.extend({},this.options,t),i=s.startDepthCount||0,o=[],l=1;return s.excludeRoot||(o.push({item_id:s.rootID,parent_id:null,depth:i,left:l,right:2*(e(s.items,this.element).length+1)}),l++),e(this.element).children(s.items).each((function(){l=r(this,i,l)})),o=o.sort((function(e,t){return e.left-t.left}));function r(t,l,n){var a,h,p=n+1;if(e(t).children(s.listType).children(s.items).length>0&&(l++,e(t).children(s.listType).children(s.items).each((function(){p=r(e(this),l,p)})),l--),a=(e(t).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),h=l===i?s.rootID:e(t).parent(s.listType).parent(s.items).attr(s.attribute||"id").match(s.expression||/(.+)[-=_](.+)/)[2],a){var d=e(t).children("div").data(),c=e.extend(d,{id:a[2],parent_id:h,depth:l,left:n,right:p});o.push(c)}return n=p+1}},_clearEmpty:function(t){var s,i,o,l=this.options,r=e(t).children(l.listType),n=r.has("li").length,a=l.doNotClear||n||l.protectRoot&&e(t)[0]===this.element[0];l.isTree&&(s=t,i=l.branchClass,o=l.leafClass,a&&(i=[o,o=i][0]),e(s).removeClass(i).addClass(o)),a||(r.parent().removeClass(l.expandedClass),r.remove())},_getLevel:function(e){var t,s=1;if(this.options.listType)for(t=e.closest(this.options.listType);t&&t.length>0&&!t.is(".ui-sortable");)s++,t=t.parent().closest(this.options.listType);return s},_getChildLevels:function(t,s){var i=this,o=this.options,l=0;return s=s||0,e(t).children(o.listType).children(o.items).each((function(e,t){l=Math.max(i._getChildLevels(t,s+1),l)})),s?l+1:l},_isAllowed:function(e,t,s){var i=this.options,o=this.placeholder.closest(".ui-sortable").nestedSortable("option","maxLevels"),l=this.currentItem.parent().parent();i.disableParentChange&&(void 0!==e&&!l.is(e)||void 0===e&&l.is("li"))||!i.isAllowed(this.placeholder,e,this.currentItem)?(this.placeholder.addClass(i.errorClass),this.beyondMaxLevels=o=0;s--)if(o=(i=this.items[s]).item[0],(l=this._intersectsWithPointer(i))&&i.instance===this.currentContainer){if(-1!==o.className.indexOf(b.disabledClass)){if(2===l){if((p=this.items[s+1])&&p.item.hasClass(b.disabledClass))continue}else if(1===l&&(d=this.items[s-1])&&d.item.hasClass(b.disabledClass))continue}if(u=1===l?"next":"prev",o!==this.currentItem[0]&&this.placeholder[u]()[0]!==o&&!e.contains(this.placeholder[0],o)&&("semi-dynamic"!==this.options.type||!e.contains(this.element[0],o))){if(this.mouseentered||(e(o).mouseenter(),this.mouseentered=!0),b.isTree&&e(o).hasClass(b.collapsedClass)&&b.expandOnHover&&!this.hovering&&(e(o).addClass(b.hoveringClass),this.hovering=window.setTimeout(function(){e(o).removeClass(b.collapsedClass).addClass(b.expandedClass),C.refreshPositions(),C._trigger("expand",t,C._uiHash())},b.expandOnHover)),this.direction=1===l?"down":"up","pointer"===this.options.tolerance||this._intersectsWithSides(i))e(o).mouseleave(),this.mouseentered=!1,e(o).removeClass(b.hoveringClass),this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,b.protectRoot&&!(this.currentItem[0].parentNode===this.element[0]&&o.parentNode!==this.element[0])?this.currentItem[0].parentNode!==this.element[0]&&o.parentNode===this.element[0]?(!e(o).children(b.listType).length&&(o.appendChild(c),b.isTree&&e(o).removeClass(b.leafClass).addClass(b.branchClass+" "+b.expandedClass)),void 0!==(f="down"===this.direction?e(o).prev().children(b.listType):e(o).children(b.listType))[0]&&this._rearrange(t,null,f)):this._rearrange(t,i):b.protectRoot||this._rearrange(t,i);else break;this._clearEmpty(o),this._trigger("change",t,this._uiHash());break}}if((function(){var e=this.placeholder.prev();m=e.length?e:null}).call(this),null!=m)for(;"li"!==m[0].nodeName.toLowerCase()||-1!==m[0].className.indexOf(b.disabledClass)||m[0]===this.currentItem[0]||m[0]===this.helper[0];)if(m[0].previousSibling)m=e(m[0].previousSibling);else{m=null;break}if((function(){var e=this.placeholder.next();v=e.length?e:null}).call(this),null!=v)for(;"li"!==v[0].nodeName.toLowerCase()||-1!==v[0].className.indexOf(b.disabledClass)||v[0]===this.currentItem[0]||v[0]===this.helper[0];)if(v[0].nextSibling)v=e(v[0].nextSibling);else{v=null;break}return this.beyondMaxLevels=0,null!=n&&null==v&&!(b.protectRoot&&n[0].parentNode==this.element[0])&&(b.rtl&&this.positionAbs.left+this.helper.outerWidth()>n.offset().left+n.outerWidth()||!b.rtl&&this.positionAbs.leftm.offset().left+b.tabSize)?(this._isAllowed(m,a,a+h+1),!m.children(b.listType).length&&(m[0].appendChild(c),b.isTree&&m.removeClass(b.leafClass).addClass(b.branchClass+" "+b.expandedClass)),r&&r<=m.offset().top?m.children(b.listType).prepend(this.placeholder):m.children(b.listType)[0].appendChild(this.placeholder[0]),void 0!==n&&this._clearEmpty(n[0]),this._trigger("change",t,this._uiHash())):this._isAllowed(n,a,a+h),this._contactContainers(t),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),this._trigger("sort",t,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(t){this.beyondMaxLevels&&(this.placeholder.removeClass(this.options.errorClass),this.domPosition.prev?e(this.domPosition.prev).after(this.placeholder):e(this.domPosition.parent).prepend(this.placeholder),this._trigger("revert",t,this._uiHash())),e("."+this.options.hoveringClass).mouseleave().removeClass(this.options.hoveringClass),this.mouseentered=!1,this.hovering&&window.clearTimeout(this.hovering),this.hovering=null,this._relocate_event=t,this._pid_current=e(this.domPosition.parent).parent().attr("id"),this._sort_current=this.domPosition.prev?e(this.domPosition.prev).next().index():0,e.ui.sortable.prototype._mouseStop.apply(this,arguments)},_intersectsWithSides:function(e){var t,s,i,o,l,r,n,a,h,p=this.options.isTree?.8:.5,d=(t=this.positionAbs.top+this.offset.click.top,s=e.top+e.height*p,i=e.height,t>s&&tl&&oa&&n=0;t--)s=this.items[t].item[0],this._clearEmpty(s)},serialize:function(t){var s=e.extend({},this.options,t),i=this._getItemsAsjQuery(s&&s.connected),o=[];return e(i).each(function(){var t=(e(s.item||this).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),i=(e(s.item||this).parent(s.listType).parent(s.items).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/);t&&o.push((s.key||t[1])+"["+(s.key&&s.expression?t[1]:t[2])+"]="+(i?s.key&&s.expression?i[1]:i[2]:s.rootID))}),!o.length&&s.key&&o.push(s.key+"="),o.join("&")},toHierarchy:function(t){var s=e.extend({},this.options,t),i=[];return e(this.element).children(s.items).each(function(){var t=function t(i){var o,l=(e(i).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),r=e(i).data();if(r.nestedSortableItem&&delete r.nestedSortableItem,l)return o={id:l[2]},o=e.extend({},o,r),e(i).children(s.listType).children(s.items).length>0&&(o.children=[],e(i).children(s.listType).children(s.items).each(function(){var e=t(this);o.children.push(e)})),o}(this);i.push(t)}),i},toArray:function(t){var s=e.extend({},this.options,t),i=s.startDepthCount||0,o=[],l=1;return!s.excludeRoot&&(o.push({item_id:s.rootID,parent_id:null,depth:i,left:l,right:(e(s.items,this.element).length+1)*2}),l++),e(this.element).children(s.items).each(function(){l=function t(l,r,n){var a,h,p=n+1;if(e(l).children(s.listType).children(s.items).length>0&&(r++,e(l).children(s.listType).children(s.items).each(function(){p=t(e(this),r,p)}),r--),a=(e(l).attr(s.attribute||"id")||"").match(s.expression||/(.+)[-=_](.+)/),h=r===i?s.rootID:e(l).parent(s.listType).parent(s.items).attr(s.attribute||"id").match(s.expression||/(.+)[-=_](.+)/)[2],a){var d=e(l).children("div").data(),c=e.extend(d,{id:a[2],parent_id:h,depth:r,left:n,right:p});o.push(c)}return n=p+1}(this,i,l)}),o=o.sort(function(e,t){return e.left-t.left})},_clearEmpty:function(t){var s,i,o=this.options,l=e(t).children(o.listType),r=l.has("li").length,n=o.doNotClear||r||o.protectRoot&&e(t)[0]===this.element[0];o.isTree&&(s=o.branchClass,i=o.leafClass,n&&(s=[i,i=s][0]),e(t).removeClass(s).addClass(i)),n||(l.parent().removeClass(o.expandedClass),l.remove())},_getLevel:function(e){var t,s=1;if(this.options.listType)for(t=e.closest(this.options.listType);t&&t.length>0&&!t.is(".ui-sortable");)s++,t=t.parent().closest(this.options.listType);return s},_getChildLevels:function(t,s){var i=this,o=this.options,l=0;return s=s||0,e(t).children(o.listType).children(o.items).each(function(e,t){l=Math.max(i._getChildLevels(t,s+1),l)}),s?l+1:l},_isAllowed:function(e,t,s){var i=this.options,o=this.placeholder.closest(".ui-sortable").nestedSortable("option","maxLevels"),l=this.currentItem.parent().parent();i.disableParentChange&&(void 0!==e&&!l.is(e)||void 0===e&&l.is("li"))||!i.isAllowed(this.placeholder,e,this.currentItem)?(this.placeholder.addClass(i.errorClass),o"],"sourcesContent":["function initializeTagsEditor(element) {\r\n if (element) {\r\n\r\n var elementId = element.id;\r\n var vueMultiselect = Vue.component('vue-multiselect', window.VueMultiselect.default);\r\n\r\n var vm = new Vue({\r\n el: '#' + elementId,\r\n components: { 'vue-multiselect': vueMultiselect },\r\n data: function () {\r\n // All terms generate a model binding.\r\n var allTagTerms = JSON.parse(element.dataset.allTagTerms || \"[]\");\r\n\r\n // Selectable terms are shown in options list.\r\n var selectableTagTerms = allTagTerms;\r\n\r\n // Leaves only filters selectableTerms.\r\n if (element.dataset.leavesOnly == 'true') {\r\n selectableTagTerms = selectableTagTerms.filter(function (tagTerm) { return tagTerm.isLeaf });\r\n // Self heal when leaves only value is updated.\r\n allTagTerms.forEach(function (tagTerm) {\r\n if (!selectableTagTerms.includes(tagTerm)) {\r\n tagTerm.selected = false;\r\n }\r\n });\r\n }\r\n\r\n // Selected terms are show in selected tags field.\r\n selectedTagTerms = allTagTerms.filter(function (tagTerm) { return tagTerm.selected });\r\n\r\n return {\r\n open: element.dataset.open,\r\n taxonomyContentItemId: element.dataset.taxonomyContentItemId,\r\n createTagUrl: element.dataset.createTagUrl,\r\n createTagErrorMessage: element.dataset.createTagErrorMessage,\r\n selectedTagTerms: selectedTagTerms,\r\n selectableTagTerms: selectableTagTerms,\r\n allTagTerms: allTagTerms\r\n }\r\n },\r\n computed: {\r\n isDisabled: function () {\r\n if (this.open == 'false' && this.selectableTagTerms.length === 0) {\r\n return true;\r\n }\r\n return false;\r\n },\r\n selectedTagTermsIds: function() {\r\n if (!this.selectedTagTerms) {\r\n return [];\r\n }\r\n if (Array.isArray(this.selectedTagTerms)) {\r\n return this.selectedTagTerms.map(function (tagTerm) { return tagTerm.contentItemId });\r\n } else {\r\n return this.selectedTagTerms.contentItemId;\r\n }\r\n }\r\n },\r\n methods: {\r\n createTagTerm(newTagTerm) {\r\n var self = this;\r\n $.ajax({\r\n url: self.createTagUrl,\r\n method: 'POST',\r\n data: {\r\n __RequestVerificationToken: $(\"input[name='__RequestVerificationToken']\").val(),\r\n taxonomyContentItemId: self.taxonomyContentItemId,\r\n displayText: newTagTerm\r\n },\r\n success: function (data) {\r\n var tagTerm = {\r\n contentItemId: data.contentItemId,\r\n displayText: data.displayText,\r\n selected: true\r\n }\r\n // Add to allTagTerms array so model binding will save tag as selected.\r\n self.allTagTerms.push(tagTerm);\r\n\r\n // Add to selectedTerms to display in vue-multi-select.\r\n self.selectedTagTerms.push(tagTerm);\r\n\r\n },\r\n error: function () {\r\n alert(self.createTagErrorMessage);\r\n }\r\n });\r\n },\r\n onSelect(selectedTagTerm) {\r\n var tagTerm = this.allTagTerms.find(function (tagTerm) { return tagTerm.contentItemId === selectedTagTerm.contentItemId });\r\n tagTerm.selected = true;\r\n $(document).trigger('contentpreview:render');\r\n },\r\n onRemove(removedTagTerm) {\r\n var tagTerm = this.allTagTerms.find(function (tagTerm) { return tagTerm.contentItemId === removedTagTerm.contentItemId });\r\n tagTerm.selected = false;\r\n $(document).trigger('contentpreview:render');\r\n }\r\n }\r\n });\r\n\r\n return vm;\r\n }\r\n}\r\n"],"names":["initializeTagsEditor","element","elementId","id","vueMultiselect","Vue","component","window","VueMultiselect","default","el","components","data","allTagTerms","JSON","parse","dataset","selectableTagTerms","leavesOnly","filter","tagTerm","isLeaf","forEach","includes","selected","selectedTagTerms","open","taxonomyContentItemId","createTagUrl","createTagErrorMessage","computed","isDisabled","length","selectedTagTermsIds","Array","isArray","map","contentItemId","methods","createTagTerm","newTagTerm","self","$","ajax","url","method","__RequestVerificationToken","val","displayText","success","push","error","alert","onSelect","selectedTagTerm","find","document","trigger","onRemove","removedTagTerm"],"mappings":"AAAA,SAASA,qBAAqBC,CAAO,EACjC,GAAIA,EAAS,CAET,IAAIC,EAAYD,EAAQE,EAAE,CACtBC,EAAiBC,IAAIC,SAAS,CAAC,kBAAmBC,OAAOC,cAAc,CAACC,OAAO,EAgGnF,OA9FS,IAAIJ,IAAI,CACbK,GAAI,IAAMR,EACVS,WAAY,CAAE,kBAAmBP,CAAe,EAChDQ,KAAM,WAEF,IAAIC,EAAcC,KAAKC,KAAK,CAACd,EAAQe,OAAO,CAACH,WAAW,EAAI,MAGxDI,EAAqBJ,EAgBzB,MAbkC,QAA9BZ,EAAQe,OAAO,CAACE,UAAU,GAC1BD,EAAqBA,EAAmBE,MAAM,CAAC,SAAUC,CAAO,EAAI,OAAOA,EAAQC,MAAM,AAAC,GAE1FR,EAAYS,OAAO,CAAC,SAAUF,CAAO,EAC5BH,EAAmBM,QAAQ,CAACH,IAC7BA,CAAAA,EAAQI,QAAQ,CAAG,CAAA,CAAI,CAE/B,IAIJC,iBAAmBZ,EAAYM,MAAM,CAAC,SAAUC,CAAO,EAAI,OAAOA,EAAQI,QAAQ,AAAC,GAE5E,CACHE,KAAMzB,EAAQe,OAAO,CAACU,IAAI,CAC1BC,sBAAuB1B,EAAQe,OAAO,CAACW,qBAAqB,CAC5DC,aAAc3B,EAAQe,OAAO,CAACY,YAAY,CAC1CC,sBAAuB5B,EAAQe,OAAO,CAACa,qBAAqB,CAC5DJ,iBAAkBA,iBAClBR,mBAAoBA,EACpBJ,YAAaA,CACjB,CACJ,EACAiB,SAAU,CACNC,WAAY,iBACJ,AAAa,SAAb,IAAI,CAACL,IAAI,EAAe,AAAmC,IAAnC,IAAI,CAACT,kBAAkB,CAACe,MAAM,AAI9D,EACAC,oBAAqB,kBACjB,AAAK,IAAI,CAACR,gBAAgB,CA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wwwroot/Scripts/tags-editor.min.js b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/tags-editor.min.js index 6e9278cf207..436c55d11b8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/tags-editor.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Scripts/tags-editor.min.js @@ -1 +1 @@ -function initializeTagsEditor(e){if(e){var t=e.id,n=Vue.component("vue-multiselect",window.VueMultiselect.default);return new Vue({el:"#"+t,components:{"vue-multiselect":n},data:function(){var t=JSON.parse(e.dataset.allTagTerms||"[]"),n=t;return"true"==e.dataset.leavesOnly&&(n=n.filter((function(e){return e.isLeaf})),t.forEach((function(e){n.includes(e)||(e.selected=!1)}))),selectedTagTerms=t.filter((function(e){return e.selected})),{open:e.dataset.open,taxonomyContentItemId:e.dataset.taxonomyContentItemId,createTagUrl:e.dataset.createTagUrl,createTagErrorMessage:e.dataset.createTagErrorMessage,selectedTagTerms:selectedTagTerms,selectableTagTerms:n,allTagTerms:t}},computed:{isDisabled:function(){return"false"==this.open&&0===this.selectableTagTerms.length},selectedTagTermsIds:function(){return this.selectedTagTerms?Array.isArray(this.selectedTagTerms)?this.selectedTagTerms.map((function(e){return e.contentItemId})):this.selectedTagTerms.contentItemId:[]}},methods:{createTagTerm:function(e){var t=this;$.ajax({url:t.createTagUrl,method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),taxonomyContentItemId:t.taxonomyContentItemId,displayText:e},success:function(e){var n={contentItemId:e.contentItemId,displayText:e.displayText,selected:!0};t.allTagTerms.push(n),t.selectedTagTerms.push(n)},error:function(){alert(t.createTagErrorMessage)}})},onSelect:function(e){this.allTagTerms.find((function(t){return t.contentItemId===e.contentItemId})).selected=!0,$(document).trigger("contentpreview:render")},onRemove:function(e){this.allTagTerms.find((function(t){return t.contentItemId===e.contentItemId})).selected=!1,$(document).trigger("contentpreview:render")}}})}} +function initializeTagsEditor(e){if(e){var t=e.id,n=Vue.component("vue-multiselect",window.VueMultiselect.default);return new Vue({el:"#"+t,components:{"vue-multiselect":n},data:function(){var t=JSON.parse(e.dataset.allTagTerms||"[]"),n=t;return"true"==e.dataset.leavesOnly&&(n=n.filter(function(e){return e.isLeaf}),t.forEach(function(e){n.includes(e)||(e.selected=!1)})),selectedTagTerms=t.filter(function(e){return e.selected}),{open:e.dataset.open,taxonomyContentItemId:e.dataset.taxonomyContentItemId,createTagUrl:e.dataset.createTagUrl,createTagErrorMessage:e.dataset.createTagErrorMessage,selectedTagTerms:selectedTagTerms,selectableTagTerms:n,allTagTerms:t}},computed:{isDisabled:function(){return"false"==this.open&&0===this.selectableTagTerms.length},selectedTagTermsIds:function(){return this.selectedTagTerms?Array.isArray(this.selectedTagTerms)?this.selectedTagTerms.map(function(e){return e.contentItemId}):this.selectedTagTerms.contentItemId:[]}},methods:{createTagTerm(e){var t=this;$.ajax({url:t.createTagUrl,method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),taxonomyContentItemId:t.taxonomyContentItemId,displayText:e},success:function(e){var n={contentItemId:e.contentItemId,displayText:e.displayText,selected:!0};t.allTagTerms.push(n),t.selectedTagTerms.push(n)},error:function(){alert(t.createTagErrorMessage)}})},onSelect(e){this.allTagTerms.find(function(t){return t.contentItemId===e.contentItemId}).selected=!0,$(document).trigger("contentpreview:render")},onRemove(e){this.allTagTerms.find(function(t){return t.contentItemId===e.contentItemId}).selected=!1,$(document).trigger("contentpreview:render")}}})}} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.css b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.css index 3d5e29186f6..da3795b5d6d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.css +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.css @@ -8,4 +8,4 @@ cursor: move; border: none; padding: 0; -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.css.map b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.css.map new file mode 100644 index 00000000000..0169db815cd --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA,qCAKA","sources":["style.css"],"sourcesContent":["#menu {\n list-style: none;\n padding-left: 0;\n}\n\n#menu li {\n list-style: none;\n cursor: move;\n border: none;\n padding: 0;\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.min.css b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.min.css index 822e91c88a7..a8a74964b28 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.min.css +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/menu.min.css @@ -1 +1 @@ -#menu{list-style:none;padding-left:0}#menu li{list-style:none;cursor:move;border:none;padding:0} +#menu{padding-left:0;list-style:none}#menu li{cursor:move;border:none;padding:0;list-style:none} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.css b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.css index bacce4af22e..e5b23103da1 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.css +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.css @@ -4,4 +4,4 @@ [v-cloak] { display: none; -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.css.map b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.css.map new file mode 100644 index 00000000000..b27c13334d7 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA,wCAIA","sources":["style.css"],"sourcesContent":[".tags .multiselect--active {\n z-index: 1000;\n}\n\n[v-cloak] {\n display: none;\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.min.css b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.min.css index c43bc0c5041..d5b03c72ae7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.min.css +++ b/src/OrchardCore.Modules/OrchardCore.Taxonomies/wwwroot/Styles/tags-editor.min.css @@ -1 +1 @@ -.tags .multiselect--active{z-index:1000}[v-cloak]{display:none} +.tags .multiselect--active{z-index:1000}[v-cloak]{display:none} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/Assets.json b/src/OrchardCore.Modules/OrchardCore.Templates/Assets.json deleted file mode 100644 index 31acbe17780..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Templates/Assets.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "inputs": [ - "Assets/js/templatepreview.edit.js" - ], - "output": "wwwroot/Scripts/templatepreview.edit.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Templates/Assets2.json new file mode 100644 index 00000000000..43b8ffaa5a1 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Templates/Assets2.json @@ -0,0 +1,9 @@ +[ + { + "action": "min", + "name": "templates", + "source": "Assets/js/templatepreview.edit.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.js b/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.js index 4d91a30229d..ec895139052 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.js +++ b/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.js @@ -1,65 +1,65 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - var editor; + function initializeTemplatePreview(nameElement, editorElement) { - var antiforgerytoken = $("[name='__RequestVerificationToken']").val(); - sendFormData = function sendFormData(nameElement) { - var formData = { - 'Name': nameElement.value, - 'Content': editor.getValue(), - '__RequestVerificationToken': antiforgerytoken - }; - // store the form data to pass it in the event handler - localStorage.setItem('OrchardCore.templates', JSON.stringify($.param(formData))); - }; - editor = CodeMirror.fromTextArea(editorElement, { - autoRefresh: true, - lineNumbers: true, - lineWrapping: true, - matchBrackets: true, - styleActiveLine: true, - mode: { - name: "liquid" - }, - extraKeys: { - "F11": function F11(cm) { - cm.setOption("fullScreen", !cm.getOption("fullScreen")); - }, - "Esc": function Esc(cm) { - if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); - } - } - }); - editor.on('change', function (cm) { - sendFormData(nameElement); - }); - window.addEventListener('storage', function (ev) { - if (ev.key != 'OrchardCore.templates:ready') return; // ignore other keys + var antiforgerytoken = $("[name='__RequestVerificationToken']").val(); - // triggered by the preview window the first time it is loaded in order - // to pre-render the view even if no contentpreview:render is already sent - sendFormData(nameElement); - }, false); - $(nameElement).on('input', function () { - sendFormData(nameElement); - }).on('propertychange', function () { - sendFormData(nameElement); - }).on('change', function () { - sendFormData(nameElement); - }).on('keyup', function (event) { - // handle backspace - if (event.keyCode == 46 || event.ctrlKey) { - sendFormData(nameElement); + sendFormData = function (nameElement) { + + var formData = { + 'Name': nameElement.value, + 'Content': editor.getValue(), + '__RequestVerificationToken': antiforgerytoken + }; + + // store the form data to pass it in the event handler + localStorage.setItem('OrchardCore.templates', JSON.stringify($.param(formData))); } - }); - $(window).on('unload', function () { - localStorage.removeItem('OrchardCore.templates'); - // this will raise an event in the preview window to notify that the live preview is no longer active. - localStorage.setItem('OrchardCore.templates:not-connected', ''); - localStorage.removeItem('OrchardCore.templates:not-connected'); - }); -} \ No newline at end of file + + editor = CodeMirror.fromTextArea(editorElement, { + autoRefresh: true, + lineNumbers: true, + lineWrapping: true, + matchBrackets: true, + styleActiveLine: true, + mode: { name: "liquid" }, + extraKeys: { + "F11": function (cm) { + cm.setOption("fullScreen", !cm.getOption("fullScreen")); + }, + "Esc": function (cm) { + if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false); + } + } + }); + + editor.on('change', function (cm) { + sendFormData(nameElement); + }); + + window.addEventListener('storage', function (ev) { + if (ev.key != 'OrchardCore.templates:ready') return; // ignore other keys + + // triggered by the preview window the first time it is loaded in order + // to pre-render the view even if no contentpreview:render is already sent + sendFormData(nameElement); + }, false); + + $(nameElement) + .on('input', function () { sendFormData(nameElement); }) + .on('propertychange', function () { sendFormData(nameElement); }) + .on('change', function () { sendFormData(nameElement); }) + .on('keyup', function (event) { + // handle backspace + if (event.keyCode == 46 || event.ctrlKey) { + sendFormData(nameElement); + } + }); + + $(window).on('unload', function () { + localStorage.removeItem('OrchardCore.templates'); + // this will raise an event in the preview window to notify that the live preview is no longer active. + localStorage.setItem('OrchardCore.templates:not-connected', ''); + localStorage.removeItem('OrchardCore.templates:not-connected'); + }); +} diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.map b/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.map new file mode 100644 index 00000000000..fa8a9a46a56 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["var editor;\r\n\r\nfunction initializeTemplatePreview(nameElement, editorElement) {\r\n\r\n var antiforgerytoken = $(\"[name='__RequestVerificationToken']\").val();\r\n\r\n sendFormData = function (nameElement) {\r\n\r\n var formData = {\r\n 'Name': nameElement.value,\r\n 'Content': editor.getValue(),\r\n '__RequestVerificationToken': antiforgerytoken\r\n };\r\n\r\n // store the form data to pass it in the event handler\r\n localStorage.setItem('OrchardCore.templates', JSON.stringify($.param(formData)));\r\n }\r\n\r\n editor = CodeMirror.fromTextArea(editorElement, {\r\n autoRefresh: true,\r\n lineNumbers: true,\r\n lineWrapping: true,\r\n matchBrackets: true,\r\n styleActiveLine: true,\r\n mode: { name: \"liquid\" },\r\n extraKeys: {\r\n \"F11\": function (cm) {\r\n cm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\r\n },\r\n \"Esc\": function (cm) {\r\n if (cm.getOption(\"fullScreen\")) cm.setOption(\"fullScreen\", false);\r\n }\r\n }\r\n });\r\n\r\n editor.on('change', function (cm) {\r\n sendFormData(nameElement);\r\n });\r\n\r\n window.addEventListener('storage', function (ev) {\r\n if (ev.key != 'OrchardCore.templates:ready') return; // ignore other keys\r\n\r\n // triggered by the preview window the first time it is loaded in order\r\n // to pre-render the view even if no contentpreview:render is already sent\r\n sendFormData(nameElement);\r\n }, false);\r\n\r\n $(nameElement)\r\n .on('input', function () { sendFormData(nameElement); })\r\n .on('propertychange', function () { sendFormData(nameElement); })\r\n .on('change', function () { sendFormData(nameElement); })\r\n .on('keyup', function (event) {\r\n // handle backspace\r\n if (event.keyCode == 46 || event.ctrlKey) {\r\n sendFormData(nameElement);\r\n }\r\n });\r\n\r\n $(window).on('unload', function () {\r\n localStorage.removeItem('OrchardCore.templates');\r\n // this will raise an event in the preview window to notify that the live preview is no longer active.\r\n localStorage.setItem('OrchardCore.templates:not-connected', '');\r\n localStorage.removeItem('OrchardCore.templates:not-connected');\r\n });\r\n}\r\n"],"names":["editor","initializeTemplatePreview","nameElement","editorElement","antiforgerytoken","$","val","sendFormData","formData","value","getValue","localStorage","setItem","JSON","stringify","param","CodeMirror","fromTextArea","autoRefresh","lineNumbers","lineWrapping","matchBrackets","styleActiveLine","mode","name","extraKeys","cm","setOption","getOption","on","window","addEventListener","ev","key","event","keyCode","ctrlKey","removeItem"],"mappings":"AAAA,IAAIA,OAEJ,SAASC,0BAA0BC,CAAW,CAAEC,CAAa,EAEzD,IAAIC,EAAmBC,EAAE,uCAAuCC,GAAG,GAEnEC,aAAe,SAAUL,CAAW,EAEhC,IAAIM,EAAW,CACX,KAAQN,EAAYO,KAAK,CACzB,QAAWT,OAAOU,QAAQ,GAC1B,2BAA8BN,CAClC,EAGAO,aAAaC,OAAO,CAAC,wBAAyBC,KAAKC,SAAS,CAACT,EAAEU,KAAK,CAACP,IACzE,EAmBAR,AAjBAA,CAAAA,OAASgB,WAAWC,YAAY,CAACd,EAAe,CAC5Ce,YAAa,CAAA,EACbC,YAAa,CAAA,EACbC,aAAc,CAAA,EACdC,cAAe,CAAA,EACfC,gBAAiB,CAAA,EACjBC,KAAM,CAAEC,KAAM,QAAS,EACvBC,UAAW,CACP,IAAO,SAAUC,CAAE,EACfA,EAAGC,SAAS,CAAC,aAAc,CAACD,EAAGE,SAAS,CAAC,cAC7C,EACA,IAAO,SAAUF,CAAE,EACXA,EAAGE,SAAS,CAAC,eAAeF,EAAGC,SAAS,CAAC,aAAc,CAAA,EAC/D,CACJ,CACJ,EAAC,EAEME,EAAE,CAAC,SAAU,SAAUH,CAAE,EAC5BnB,aAAaL,EACjB,GAEA4B,OAAOC,gBAAgB,CAAC,UAAW,SAAUC,CAAE,EAC7B,+BAAVA,EAAGC,GAAG,EAIV1B,aAAaL,EACjB,EAAG,CAAA,GAEHG,EAAEH,GACG2B,EAAE,CAAC,QAAS,WAActB,aAAaL,EAAc,GACrD2B,EAAE,CAAC,iBAAkB,WAActB,aAAaL,EAAc,GAC9D2B,EAAE,CAAC,SAAU,WAActB,aAAaL,EAAc,GACtD2B,EAAE,CAAC,QAAS,SAAUK,CAAK,EAEpBA,CAAAA,AAAiB,IAAjBA,EAAMC,OAAO,EAAUD,EAAME,OAAO,AAAD,GACnC7B,aAAaL,EAErB,GAEJG,EAAEyB,QAAQD,EAAE,CAAC,SAAU,WACnBlB,aAAa0B,UAAU,CAAC,yBAExB1B,aAAaC,OAAO,CAAC,sCAAuC,IAC5DD,aAAa0B,UAAU,CAAC,sCAC7B,EACH"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.min.js b/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.min.js index 151fe5146cd..a44487ecabd 100644 --- a/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Templates/wwwroot/Scripts/templatepreview.edit.min.js @@ -1 +1 @@ -var editor;function initializeTemplatePreview(e,t){var n=$("[name='__RequestVerificationToken']").val();sendFormData=function(e){var t={Name:e.value,Content:editor.getValue(),__RequestVerificationToken:n};localStorage.setItem("OrchardCore.templates",JSON.stringify($.param(t)))},(editor=CodeMirror.fromTextArea(t,{autoRefresh:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,styleActiveLine:!0,mode:{name:"liquid"},extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}})).on("change",(function(t){sendFormData(e)})),window.addEventListener("storage",(function(t){"OrchardCore.templates:ready"==t.key&&sendFormData(e)}),!1),$(e).on("input",(function(){sendFormData(e)})).on("propertychange",(function(){sendFormData(e)})).on("change",(function(){sendFormData(e)})).on("keyup",(function(t){(46==t.keyCode||t.ctrlKey)&&sendFormData(e)})),$(window).on("unload",(function(){localStorage.removeItem("OrchardCore.templates"),localStorage.setItem("OrchardCore.templates:not-connected",""),localStorage.removeItem("OrchardCore.templates:not-connected")}))} +var editor;function initializeTemplatePreview(e,t){var n=$("[name='__RequestVerificationToken']").val();sendFormData=function(e){var t={Name:e.value,Content:editor.getValue(),__RequestVerificationToken:n};localStorage.setItem("OrchardCore.templates",JSON.stringify($.param(t)))},(editor=CodeMirror.fromTextArea(t,{autoRefresh:!0,lineNumbers:!0,lineWrapping:!0,matchBrackets:!0,styleActiveLine:!0,mode:{name:"liquid"},extraKeys:{F11:function(e){e.setOption("fullScreen",!e.getOption("fullScreen"))},Esc:function(e){e.getOption("fullScreen")&&e.setOption("fullScreen",!1)}}})).on("change",function(t){sendFormData(e)}),window.addEventListener("storage",function(t){"OrchardCore.templates:ready"==t.key&&sendFormData(e)},!1),$(e).on("input",function(){sendFormData(e)}).on("propertychange",function(){sendFormData(e)}).on("change",function(){sendFormData(e)}).on("keyup",function(t){(46==t.keyCode||t.ctrlKey)&&sendFormData(e)}),$(window).on("unload",function(){localStorage.removeItem("OrchardCore.templates"),localStorage.setItem("OrchardCore.templates:not-connected",""),localStorage.removeItem("OrchardCore.templates:not-connected")})} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/Assets.json b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/Assets.json deleted file mode 100644 index 86611620a8a..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/Assets.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "inputs": [ - "Assets/js/sortable-rules.js" - ], - "output": "wwwroot/Scripts/sortable-rules.js" - }, - { - "inputs": [ - "Assets/js/admin-ui.js" - ], - "output": "wwwroot/Scripts/admin-ui.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/Assets2.json b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/Assets2.json new file mode 100644 index 00000000000..8a7170d7c9a --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/Assets2.json @@ -0,0 +1,17 @@ + +[ + { + "action": "min", + "name": "url-rewriting", + "source": "Assets/js/sortable-rules.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "min", + "name": "url-rewriting", + "source": "Assets/js/admin-ui.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.js b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.js index d7bf0138e70..fe90d8a89af 100644 --- a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.js +++ b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.js @@ -1,159 +1,169 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } -function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } -function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } urlRewritingAdmin = function () { - var initialize = function initialize(url, errorLabel, selectedLabel) { - // Create the sortable UI. - sortingListManager.create('#rewrite-rules-sortable-list', url, errorLabel); - var searchBox = document.getElementById('search-box'); - var searchAlert = document.getElementById('list-alert'); - var filterElements = document.querySelectorAll('[data-filter-value]'); - - // If the user press Enter, don't submit. - searchBox.addEventListener('keydown', function (e) { - if (e.key === 'Enter') { - e.preventDefault(); - } - }); - searchBox.addEventListener('keyup', function (e) { - var search = e.target.value.toLowerCase(); - // On ESC, clear the search box and display all rules. - if (e.key == 'Escape' || search == '') { - searchAlert.classList.add('d-none'); - searchBox.value = ''; - for (var i = 0; i < filterElements.length; i++) { - filterElements[i].classList.remove("d-none"); - filterElements[i].classList.remove("first-child-visible"); - filterElements[i].classList.remove("last-child-visible"); - } - if (filterElements.length > 0) { - filterElements[0].classList.add('first-child-visible'); - filterElements[filterElements.length - 1].classList.add('last-child-visible'); - } - } else { - var visibleElements = []; - for (var _i = 0; _i < filterElements.length; _i++) { - var filter = filterElements[_i]; - var text = filter.getAttribute('data-filter-value'); - if (!text) { - filter.classList.add("d-none"); - continue; - } - var found = text.indexOf(search) > -1; - if (found) { - filter.classList.remove("d-none"); - filter.classList.remove("first-child-visible"); - filter.classList.remove("last-child-visible"); - visibleElements.push(filter); - } else { - filter.classList.add("d-none"); - } - } - if (visibleElements.length > 0) { - visibleElements[0].classList.add('first-child-visible'); - visibleElements[visibleElements.length - 1].classList.add('last-child-visible'); - searchAlert.classList.add('d-none'); - } else { - searchAlert.classList.remove('d-none'); - } - } - }); - var actions = document.getElementById('actions'); - var items = document.getElementById('items'); - var filters = document.querySelectorAll('.filter'); - var selectAllCtrl = document.getElementById('select-all'); - var selectedItems = document.getElementById('selected-items'); - var itemsCheckboxes = document.querySelectorAll("input[type='checkbox'][name='ruleIds']"); - function displayActionsOrFilters() { - // Select all checked checkboxes with name 'ruleIds' - var checkedCheckboxes = document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked"); - if (checkedCheckboxes.length > 1) { - actions.classList.remove('d-none'); - for (var i = 0; i < filters.length; i++) { - filters[i].classList.add('d-none'); - } - selectedItems.classList.remove('d-none'); - items.classList.add('d-none'); - } else { - actions.classList.add('d-none'); - for (var _i2 = 0; _i2 < filters.length; _i2++) { - filters[_i2].classList.remove('d-none'); + + const initialize = (url, errorLabel, selectedLabel) => { + + // Create the sortable UI. + sortingListManager.create('#rewrite-rules-sortable-list', url, errorLabel); + + let searchBox = document.getElementById('search-box'); + let searchAlert = document.getElementById('list-alert'); + + const filterElements = document.querySelectorAll('[data-filter-value]'); + + // If the user press Enter, don't submit. + searchBox.addEventListener('keydown', function (e) { + if (e.key === 'Enter') { + e.preventDefault(); + } + }); + + searchBox.addEventListener('keyup', e => { + + var search = e.target.value.toLowerCase(); + // On ESC, clear the search box and display all rules. + if (e.key == 'Escape' || search == '') { + searchAlert.classList.add('d-none'); + searchBox.value = ''; + for (let i = 0; i < filterElements.length; i++) { + filterElements[i].classList.remove("d-none"); + filterElements[i].classList.remove("first-child-visible"); + filterElements[i].classList.remove("last-child-visible"); + } + + if (filterElements.length > 0) { + filterElements[0].classList.add('first-child-visible'); + filterElements[filterElements.length - 1].classList.add('last-child-visible'); + } + } else { + let visibleElements = []; + for (let i = 0; i < filterElements.length; i++) { + let filter = filterElements[i]; + + var text = filter.getAttribute('data-filter-value'); + + if (!text) { + filter.classList.add("d-none"); + continue; + } + + var found = text.indexOf(search) > -1; + + if (found) { + filter.classList.remove("d-none"); + filter.classList.remove("first-child-visible"); + filter.classList.remove("last-child-visible"); + visibleElements.push(filter); + } else { + filter.classList.add("d-none"); + } + } + + if (visibleElements.length > 0) { + visibleElements[0].classList.add('first-child-visible'); + visibleElements[visibleElements.length - 1].classList.add('last-child-visible'); + searchAlert.classList.add('d-none'); + } else { + searchAlert.classList.remove('d-none'); + } + } + }); + + var actions = document.getElementById('actions'); + var items = document.getElementById('items'); + var filters = document.querySelectorAll('.filter'); + var selectAllCtrl = document.getElementById('select-all'); + var selectedItems = document.getElementById('selected-items'); + var itemsCheckboxes = document.querySelectorAll("input[type='checkbox'][name='ruleIds']"); + + function displayActionsOrFilters() { + // Select all checked checkboxes with name 'ruleIds' + var checkedCheckboxes = document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked"); + + if (checkedCheckboxes.length > 1) { + actions.classList.remove('d-none'); + for (let i = 0; i < filters.length; i++) { + filters[i].classList.add('d-none'); + } + selectedItems.classList.remove('d-none'); + items.classList.add('d-none'); + } else { + actions.classList.add('d-none'); + + for (let i = 0; i < filters.length; i++) { + filters[i].classList.remove('d-none'); + } + selectedItems.classList.add('d-none'); + items.classList.remove('d-none'); + } } - selectedItems.classList.add('d-none'); - items.classList.remove('d-none'); - } - } - var dropdownItems = document.querySelectorAll(".dropdown-menu .dropdown-item"); - - // Add click event listeners to each dropdown item - dropdownItems.forEach(function (item) { - // Check if the item has a data-action attribute - if (item.dataset.action) { - item.addEventListener("click", function () { - // Get all checked checkboxes - var checkedCheckboxes = document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked"); - - // Check if more than one checkbox is checked - if (checkedCheckboxes.length > 1) { - // Get data attributes from the clicked item - var actionData = Object.assign({}, item.dataset); - confirmDialog(_objectSpread(_objectSpread({}, actionData), {}, { - callback: function callback(r) { - if (r) { - // Set the value of the BulkAction option - document.querySelector("[name='Options.BulkAction']").value = actionData.action; - // Trigger the submit action - document.querySelector("[name='submit.BulkAction']").click(); + + var dropdownItems = document.querySelectorAll(".dropdown-menu .dropdown-item"); + + // Add click event listeners to each dropdown item + dropdownItems.forEach(function (item) { + // Check if the item has a data-action attribute + if (item.dataset.action) { + item.addEventListener("click", function () { + // Get all checked checkboxes + var checkedCheckboxes = document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked"); + + // Check if more than one checkbox is checked + if (checkedCheckboxes.length > 1) { + // Get data attributes from the clicked item + var actionData = Object.assign({}, item.dataset); + + confirmDialog({ + ...actionData, + callback: function (r) { + if (r) { + // Set the value of the BulkAction option + document.querySelector("[name='Options.BulkAction']").value = actionData.action; + // Trigger the submit action + document.querySelector("[name='submit.BulkAction']").click(); + } + } + }); + } + }); + } + }); + + selectAllCtrl.addEventListener("click", function () { + itemsCheckboxes.forEach(function (checkbox) { + if (checkbox !== selectAllCtrl) { + checkbox.checked = selectAllCtrl.checked; // Set the checked state of all checkboxes } - } - })); - } + }); + + // Update the selected items text + updateSelectedItemsText(); + displayActionsOrFilters(); }); - } - }); - selectAllCtrl.addEventListener("click", function () { - itemsCheckboxes.forEach(function (checkbox) { - if (checkbox !== selectAllCtrl) { - checkbox.checked = selectAllCtrl.checked; // Set the checked state of all checkboxes + + // Event listener for individual checkboxes + itemsCheckboxes.forEach(function (checkbox) { + checkbox.addEventListener("click", function () { + var itemsCount = itemsCheckboxes.length; + var selectedItemsCount = document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked").length; + + // Update selectAllCtrl state + selectAllCtrl.checked = selectedItemsCount === itemsCount; + selectAllCtrl.indeterminate = selectedItemsCount > 0 && selectedItemsCount < itemsCount; + + // Update the selected items text + updateSelectedItemsText(); + displayActionsOrFilters(); + }); + }); + + // Function to update selected items text + function updateSelectedItemsText() { + var selectedCount = document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked").length; + selectedItems.textContent = selectedCount + ' ' + selectedLabel; } - }); - - // Update the selected items text - updateSelectedItemsText(); - displayActionsOrFilters(); - }); - - // Event listener for individual checkboxes - itemsCheckboxes.forEach(function (checkbox) { - checkbox.addEventListener("click", function () { - var itemsCount = itemsCheckboxes.length; - var selectedItemsCount = document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked").length; - - // Update selectAllCtrl state - selectAllCtrl.checked = selectedItemsCount === itemsCount; - selectAllCtrl.indeterminate = selectedItemsCount > 0 && selectedItemsCount < itemsCount; - - // Update the selected items text - updateSelectedItemsText(); - displayActionsOrFilters(); - }); - }); - - // Function to update selected items text - function updateSelectedItemsText() { - var selectedCount = document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked").length; - selectedItems.textContent = selectedCount + ' ' + selectedLabel; } - }; - return { - initialize: initialize - }; -}(); \ No newline at end of file + + return { + initialize: initialize + } +}(); diff --git a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.map b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.map new file mode 100644 index 00000000000..ac51dc12351 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["urlRewritingAdmin = function () {\r\n\r\n const initialize = (url, errorLabel, selectedLabel) => {\r\n\r\n // Create the sortable UI.\r\n sortingListManager.create('#rewrite-rules-sortable-list', url, errorLabel);\r\n\r\n let searchBox = document.getElementById('search-box');\r\n let searchAlert = document.getElementById('list-alert');\r\n\r\n const filterElements = document.querySelectorAll('[data-filter-value]');\r\n\r\n // If the user press Enter, don't submit.\r\n searchBox.addEventListener('keydown', function (e) {\r\n if (e.key === 'Enter') {\r\n e.preventDefault();\r\n }\r\n });\r\n\r\n searchBox.addEventListener('keyup', e => {\r\n\r\n var search = e.target.value.toLowerCase();\r\n // On ESC, clear the search box and display all rules.\r\n if (e.key == 'Escape' || search == '') {\r\n searchAlert.classList.add('d-none');\r\n searchBox.value = '';\r\n for (let i = 0; i < filterElements.length; i++) {\r\n filterElements[i].classList.remove(\"d-none\");\r\n filterElements[i].classList.remove(\"first-child-visible\");\r\n filterElements[i].classList.remove(\"last-child-visible\");\r\n }\r\n\r\n if (filterElements.length > 0) {\r\n filterElements[0].classList.add('first-child-visible');\r\n filterElements[filterElements.length - 1].classList.add('last-child-visible');\r\n }\r\n } else {\r\n let visibleElements = [];\r\n for (let i = 0; i < filterElements.length; i++) {\r\n let filter = filterElements[i];\r\n\r\n var text = filter.getAttribute('data-filter-value');\r\n\r\n if (!text) {\r\n filter.classList.add(\"d-none\");\r\n continue;\r\n }\r\n\r\n var found = text.indexOf(search) > -1;\r\n\r\n if (found) {\r\n filter.classList.remove(\"d-none\");\r\n filter.classList.remove(\"first-child-visible\");\r\n filter.classList.remove(\"last-child-visible\");\r\n visibleElements.push(filter);\r\n } else {\r\n filter.classList.add(\"d-none\");\r\n }\r\n }\r\n\r\n if (visibleElements.length > 0) {\r\n visibleElements[0].classList.add('first-child-visible');\r\n visibleElements[visibleElements.length - 1].classList.add('last-child-visible');\r\n searchAlert.classList.add('d-none');\r\n } else {\r\n searchAlert.classList.remove('d-none');\r\n }\r\n }\r\n });\r\n\r\n var actions = document.getElementById('actions');\r\n var items = document.getElementById('items');\r\n var filters = document.querySelectorAll('.filter');\r\n var selectAllCtrl = document.getElementById('select-all');\r\n var selectedItems = document.getElementById('selected-items');\r\n var itemsCheckboxes = document.querySelectorAll(\"input[type='checkbox'][name='ruleIds']\");\r\n\r\n function displayActionsOrFilters() {\r\n // Select all checked checkboxes with name 'ruleIds'\r\n var checkedCheckboxes = document.querySelectorAll(\"input[type='checkbox'][name='ruleIds']:checked\");\r\n\r\n if (checkedCheckboxes.length > 1) {\r\n actions.classList.remove('d-none');\r\n for (let i = 0; i < filters.length; i++) {\r\n filters[i].classList.add('d-none');\r\n }\r\n selectedItems.classList.remove('d-none');\r\n items.classList.add('d-none');\r\n } else {\r\n actions.classList.add('d-none');\r\n\r\n for (let i = 0; i < filters.length; i++) {\r\n filters[i].classList.remove('d-none');\r\n }\r\n selectedItems.classList.add('d-none');\r\n items.classList.remove('d-none');\r\n }\r\n }\r\n\r\n var dropdownItems = document.querySelectorAll(\".dropdown-menu .dropdown-item\");\r\n\r\n // Add click event listeners to each dropdown item\r\n dropdownItems.forEach(function (item) {\r\n // Check if the item has a data-action attribute\r\n if (item.dataset.action) {\r\n item.addEventListener(\"click\", function () {\r\n // Get all checked checkboxes\r\n var checkedCheckboxes = document.querySelectorAll(\"input[type='checkbox'][name='ruleIds']:checked\");\r\n\r\n // Check if more than one checkbox is checked\r\n if (checkedCheckboxes.length > 1) {\r\n // Get data attributes from the clicked item\r\n var actionData = Object.assign({}, item.dataset);\r\n\r\n confirmDialog({\r\n ...actionData,\r\n callback: function (r) {\r\n if (r) {\r\n // Set the value of the BulkAction option\r\n document.querySelector(\"[name='Options.BulkAction']\").value = actionData.action;\r\n // Trigger the submit action\r\n document.querySelector(\"[name='submit.BulkAction']\").click();\r\n }\r\n }\r\n });\r\n }\r\n });\r\n }\r\n });\r\n\r\n selectAllCtrl.addEventListener(\"click\", function () {\r\n itemsCheckboxes.forEach(function (checkbox) {\r\n if (checkbox !== selectAllCtrl) {\r\n checkbox.checked = selectAllCtrl.checked; // Set the checked state of all checkboxes\r\n }\r\n });\r\n\r\n // Update the selected items text\r\n updateSelectedItemsText();\r\n displayActionsOrFilters();\r\n });\r\n\r\n // Event listener for individual checkboxes\r\n itemsCheckboxes.forEach(function (checkbox) {\r\n checkbox.addEventListener(\"click\", function () {\r\n var itemsCount = itemsCheckboxes.length;\r\n var selectedItemsCount = document.querySelectorAll(\"input[type='checkbox'][name='ruleIds']:checked\").length;\r\n\r\n // Update selectAllCtrl state\r\n selectAllCtrl.checked = selectedItemsCount === itemsCount;\r\n selectAllCtrl.indeterminate = selectedItemsCount > 0 && selectedItemsCount < itemsCount;\r\n\r\n // Update the selected items text\r\n updateSelectedItemsText();\r\n displayActionsOrFilters();\r\n });\r\n });\r\n\r\n // Function to update selected items text\r\n function updateSelectedItemsText() {\r\n var selectedCount = document.querySelectorAll(\"input[type='checkbox'][name='ruleIds']:checked\").length;\r\n selectedItems.textContent = selectedCount + ' ' + selectedLabel;\r\n }\r\n }\r\n\r\n return {\r\n initialize: initialize\r\n }\r\n}();\r\n"],"names":["urlRewritingAdmin","initialize","url","errorLabel","selectedLabel","sortingListManager","create","searchBox","document","getElementById","searchAlert","filterElements","querySelectorAll","addEventListener","e","key","preventDefault","search","target","value","toLowerCase","classList","add","i","length","remove","visibleElements","filter","text","getAttribute","indexOf","push","actions","items","filters","selectAllCtrl","selectedItems","itemsCheckboxes","displayActionsOrFilters","checkedCheckboxes","updateSelectedItemsText","selectedCount","textContent","dropdownItems","forEach","item","dataset","action","actionData","Object","assign","confirmDialog","callback","r","querySelector","click","checkbox","checked","itemsCount","selectedItemsCount","indeterminate"],"mappings":"AAAAA,kBAqKW,CACHC,WApKe,CAACC,EAAKC,EAAYC,KAGjCC,mBAAmBC,MAAM,CAAC,+BAAgCJ,EAAKC,GAE/D,IAAII,EAAYC,SAASC,cAAc,CAAC,cACpCC,EAAcF,SAASC,cAAc,CAAC,cAEpCE,EAAiBH,SAASI,gBAAgB,CAAC,uBAGjDL,EAAUM,gBAAgB,CAAC,UAAW,SAAUC,CAAC,EAC/B,UAAVA,EAAEC,GAAG,EACLD,EAAEE,cAAc,EAExB,GAEAT,EAAUM,gBAAgB,CAAC,QAASC,IAEhC,IAAIG,EAASH,EAAEI,MAAM,CAACC,KAAK,CAACC,WAAW,GAEvC,GAAIN,AAAS,UAATA,EAAEC,GAAG,EAAgBE,AAAU,IAAVA,EAAc,CACnCP,EAAYW,SAAS,CAACC,GAAG,CAAC,UAC1Bf,EAAUY,KAAK,CAAG,GAClB,IAAK,IAAII,EAAI,EAAGA,EAAIZ,EAAea,MAAM,CAAED,IACvCZ,CAAc,CAACY,EAAE,CAACF,SAAS,CAACI,MAAM,CAAC,UACnCd,CAAc,CAACY,EAAE,CAACF,SAAS,CAACI,MAAM,CAAC,uBACnCd,CAAc,CAACY,EAAE,CAACF,SAAS,CAACI,MAAM,CAAC,qBAGnCd,CAAAA,EAAea,MAAM,CAAG,IACxBb,CAAc,CAAC,EAAE,CAACU,SAAS,CAACC,GAAG,CAAC,uBAChCX,CAAc,CAACA,EAAea,MAAM,CAAG,EAAE,CAACH,SAAS,CAACC,GAAG,CAAC,sBAEhE,KAAO,CACH,IAAII,EAAkB,EAAE,C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M,AAG3GW,CAAAA,EAAcsB,OAAO,CAAGE,IAAuBD,EAC/CvB,EAAcyB,aAAa,CAAGD,EAAqB,GAAKA,EAAqBD,EAG7ElB,IACAF,GACJ,EACJ,EAOJ,CAIA"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.min.js b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.min.js index 30673869019..1275b409e78 100644 --- a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.min.js +++ b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/admin-ui.min.js @@ -1 +1 @@ -function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t0&&(i[0].classList.add("first-child-visible"),i[i.length-1].classList.add("last-child-visible"))}else{for(var c=[],l=0;l-1?(s.classList.remove("d-none"),s.classList.remove("first-child-visible"),s.classList.remove("last-child-visible"),c.push(s)):s.classList.add("d-none")}c.length>0?(c[0].classList.add("first-child-visible"),c[c.length-1].classList.add("last-child-visible"),o.classList.add("d-none")):o.classList.remove("d-none")}}));var c=document.getElementById("actions"),l=document.getElementById("items"),s=document.querySelectorAll(".filter"),a=document.getElementById("select-all"),d=document.getElementById("selected-items"),u=document.querySelectorAll("input[type='checkbox'][name='ruleIds']");function f(){if(document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked").length>1){c.classList.remove("d-none");for(var e=0;e1){var t=Object.assign({},e.dataset);confirmDialog(_objectSpread(_objectSpread({},t),{},{callback:function(e){e&&(document.querySelector("[name='Options.BulkAction']").value=t.action,document.querySelector("[name='submit.BulkAction']").click())}}))}}))})),a.addEventListener("click",(function(){u.forEach((function(e){e!==a&&(e.checked=a.checked)})),m(),f()})),u.forEach((function(e){e.addEventListener("click",(function(){var e=u.length,t=document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked").length;a.checked=t===e,a.indeterminate=t>0&&t{sortingListManager.create("#rewrite-rules-sortable-list",e,t);let l=document.getElementById("search-box"),s=document.getElementById("list-alert"),c=document.querySelectorAll("[data-filter-value]");l.addEventListener("keydown",function(e){"Enter"===e.key&&e.preventDefault()}),l.addEventListener("keyup",e=>{var t=e.target.value.toLowerCase();if("Escape"==e.key||""==t){s.classList.add("d-none"),l.value="";for(let e=0;e0&&(c[0].classList.add("first-child-visible"),c[c.length-1].classList.add("last-child-visible"))}else{let e=[];for(let l=0;l-1?(s.classList.remove("d-none"),s.classList.remove("first-child-visible"),s.classList.remove("last-child-visible"),e.push(s)):s.classList.add("d-none")}e.length>0?(e[0].classList.add("first-child-visible"),e[e.length-1].classList.add("last-child-visible"),s.classList.add("d-none")):s.classList.remove("d-none")}});var i=document.getElementById("actions"),d=document.getElementById("items"),o=document.querySelectorAll(".filter"),a=document.getElementById("select-all"),r=document.getElementById("selected-items"),u=document.querySelectorAll("input[type='checkbox'][name='ruleIds']");function m(){if(document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked").length>1){i.classList.remove("d-none");for(let e=0;e1){var t=Object.assign({},e.dataset);confirmDialog({...t,callback:function(e){e&&(document.querySelector("[name='Options.BulkAction']").value=t.action,document.querySelector("[name='submit.BulkAction']").click())}})}})}),a.addEventListener("click",function(){u.forEach(function(e){e!==a&&(e.checked=a.checked)}),h(),m()}),u.forEach(function(e){e.addEventListener("click",function(){var e=u.length,t=document.querySelectorAll("input[type='checkbox'][name='ruleIds']:checked").length;a.checked=t===e,a.indeterminate=t>0&&t { + + var data = { + oldIndex: evt.oldIndex, + newIndex: evt.newIndex + }; + fetch(url, { + method: 'POST', + headers: { + 'Content-Type': 'application/json' + }, + body: JSON.stringify(data) + }).catch(error => { + console.log(error); + alert(errorMessage || 'Unable to sort the list'); + }); } - if (!orderUrl) { - console.log('Unable to determine the sort post URI. Either pass it to the create function or set it as data-sort-uri to the sorting element.'); - return; + + const create = (selector, sortUrl, errorMessage) => { + + var sortable = document.querySelector(selector); + + if (!sortable) { + console.log('Unable to find the sortable element. The given selector is: ' + selector); + + return; + } + + if (sortUrl) { + orderUrl = sortUrl; + } else { + orderUrl = sortable.getAttribute('data-sort-uri'); + } + + if (!orderUrl) { + console.log('Unable to determine the sort post URI. Either pass it to the create function or set it as data-sort-uri to the sorting element.'); + + return; + } + + var sortable = Sortable.create(sortable, { + handle: ".ui-sortable-handle", + animation: 150, + filter: ".ignore-elements", + draggable: ".item", + onUpdate: function (evt) { + saveOrders(evt, orderUrl, errorMessage); + } + }); + }; + + return { + create: create } - var sortable = Sortable.create(sortable, { - handle: ".ui-sortable-handle", - animation: 150, - filter: ".ignore-elements", - draggable: ".item", - onUpdate: function onUpdate(evt) { - saveOrders(evt, orderUrl, errorMessage); - } - }); - }; - return { - create: create - }; -}(); \ No newline at end of file +}(); diff --git a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/sortable-rules.map b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/sortable-rules.map new file mode 100644 index 00000000000..fb0ced993e8 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/sortable-rules.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["sortingListManager = function () {\r\n\r\n const saveOrders = (evt, url, errorMessage) => {\r\n\r\n var data = {\r\n oldIndex: evt.oldIndex,\r\n newIndex: evt.newIndex\r\n };\r\n fetch(url, {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(data)\r\n }).catch(error => {\r\n console.log(error);\r\n alert(errorMessage || 'Unable to sort the list');\r\n });\r\n }\r\n\r\n const create = (selector, sortUrl, errorMessage) => {\r\n\r\n var sortable = document.querySelector(selector);\r\n\r\n if (!sortable) {\r\n console.log('Unable to find the sortable element. The given selector is: ' + selector);\r\n\r\n return;\r\n }\r\n\r\n if (sortUrl) {\r\n orderUrl = sortUrl;\r\n } else {\r\n orderUrl = sortable.getAttribute('data-sort-uri');\r\n }\r\n\r\n if (!orderUrl) {\r\n console.log('Unable to determine the sort post URI. Either pass it to the create function or set it as data-sort-uri to the sorting element.');\r\n\r\n return;\r\n }\r\n\r\n var sortable = Sortable.create(sortable, {\r\n handle: \".ui-sortable-handle\",\r\n animation: 150,\r\n filter: \".ignore-elements\",\r\n draggable: \".item\",\r\n onUpdate: function (evt) {\r\n saveOrders(evt, orderUrl, errorMessage);\r\n }\r\n });\r\n };\r\n\r\n return {\r\n create: create\r\n }\r\n}();\r\n"],"names":["sortingListManager","saveOrders","evt","url","errorMessage","fetch","method","headers","body","JSON","stringify","oldIndex","newIndex","catch","error","console","log","alert","create","selector","sortUrl","sortable","document","querySelector","orderUrl","getAttribute","Sortable","handle","animation","filter","draggable","onUpdate"],"mappings":"AAAAA,mBAAqB,WAEjB,IAAMC,EAAa,CAACC,EAAKC,EAAKC,KAM1BC,MAAMF,EAAK,CACPG,OAAQ,OACRC,QAAS,CACL,eAAgB,kBACpB,EACAC,KAAMC,KAAKC,SAAS,CATb,CACPC,SAAUT,EAAIS,QAAQ,CACtBC,SAAUV,EAAIU,QAAQ,AAC1B,EAOA,GAAGC,KAAK,CAACC,IACLC,QAAQC,GAAG,CAACF,GACZG,MAAMb,GAAgB,0BAC1B,EACJ,EAmCA,MAAO,CACHc,OAlCW,CAACC,EAAUC,EAAShB,KAE/B,IAAIiB,EAAWC,SAASC,aAAa,CAACJ,GAEtC,GAAI,CAACE,EAAU,CACXN,QAAQC,GAAG,CAAC,+DAAiEG,GAE7E,MACJ,CAQA,GAAI,EALAK,SADAJ,GAGWC,EAASI,YAAY,CAAC,kBAGtB,CACXV,QAAQC,GAAG,CAAC,mIAEZ,MACJ,CAEA,IAAIK,EAAWK,SAASR,MAAM,CAACG,EAAU,CACrCM,OAAQ,sBACRC,UAAW,IACXC,OAAQ,mBACRC,UAAW,QACXC,SAAU,SAAU7B,CAAG,EACnBD,EAAWC,EAAKsB,SAAUpB,EAC9B,CACJ,EACJ,CAIA,CACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/sortable-rules.min.js b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/sortable-rules.min.js index d297c9bf52c..1cd19775e63 100644 --- a/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/sortable-rules.min.js +++ b/src/OrchardCore.Modules/OrchardCore.UrlRewriting/wwwroot/Scripts/sortable-rules.min.js @@ -1 +1 @@ -sortingListManager={create:function(e,t,o){if(n=document.querySelector(e))if(orderUrl=t||n.getAttribute("data-sort-uri"),orderUrl)var n=Sortable.create(n,{handle:".ui-sortable-handle",animation:150,filter:".ignore-elements",draggable:".item",onUpdate:function(e){!function(e,t,o){var n={oldIndex:e.oldIndex,newIndex:e.newIndex};fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).catch((function(e){console.log(e),alert(o||"Unable to sort the list")}))}(e,orderUrl,o)}});else console.log("Unable to determine the sort post URI. Either pass it to the create function or set it as data-sort-uri to the sorting element.");else console.log("Unable to find the sortable element. The given selector is: "+e)}}; +sortingListManager=function(){let e=(e,t,o)=>{fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldIndex:e.oldIndex,newIndex:e.newIndex})}).catch(e=>{console.log(e),alert(o||"Unable to sort the list")})};return{create:(t,o,n)=>{var r=document.querySelector(t);if(!r){console.log("Unable to find the sortable element. The given selector is: "+t);return}if(!(orderUrl=o||r.getAttribute("data-sort-uri"))){console.log("Unable to determine the sort post URI. Either pass it to the create function or set it as data-sort-uri to the sorting element.");return}var r=Sortable.create(r,{handle:".ui-sortable-handle",animation:150,filter:".ignore-elements",draggable:".item",onUpdate:function(t){e(t,orderUrl,n)}})}}}(); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Assets.json b/src/OrchardCore.Modules/OrchardCore.Users/Assets.json deleted file mode 100644 index 9a8df0daf16..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Users/Assets.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "inputs": [ - "Assets/js/password-generator.js" - ], - "output": "wwwroot/Scripts/password-generator.js" - }, - { - "inputs": [ - "../../../node_modules/qrcodejs/qrcode.js" - ], - "output": "wwwroot/Scripts/qrcode.js" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Users/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Users/Assets2.json new file mode 100644 index 00000000000..376eb6b507f --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Users/Assets2.json @@ -0,0 +1,16 @@ +[ + { + "action": "min", + "name": "users-password-generator", + "source": "Assets/js/password-generator.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + }, + { + "action": "min", + "name": "users-qrcode", + "source": "../../../node_modules/qrcodejs/qrcode.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.js b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.js index 621d86b80cd..ff9e56c2ede 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.js +++ b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.js @@ -1,67 +1,64 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - passwordManager = function () { - var allowed = { - uppers: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', - lowers: 'abcdefghijklmnopqrstuvwxyz', - digits: '0123456789', - symbols: '!#$%&\()*+,-./:;<=>\'?@@[\]^_`{|}~' - }; - var getRandomChar = function getRandomChar(str) { - return str.charAt(Math.floor(Math.random() * str.length)); - }; - var shuffle = function shuffle(str) { - return str.sort(function () { - return 0.5 - Math.random(); - }); - }; - var meetUniqueRule = function meetUniqueRule(str, requiredUniqueChars) { - var uniqueCharacters = str.filter(function (item, i, ar) { - return ar.indexOf(item) === i; - }); - return uniqueCharacters.length >= requiredUniqueChars; - }; - var copyPassword = function copyPassword(str) { - return navigator.clipboard.writeText(str); - }; - var _generatePassword = function generatePassword(requiredPasswordLength, requireUppercase, requireLowercase, requireDigit, requireNonAlphanumeric, requiredUniqueChars) { - var password = []; - requiredUniqueChars = requiredUniqueChars | 1; - if (requireUppercase) { - // At least one uppercase - password.push(getRandomChar(allowed.uppers)); - } - if (requireLowercase) { - // At least one lowercase - password.push(getRandomChar(allowed.lowers)); - } - if (requireDigit) { - // At least one digit - password.push(getRandomChar(allowed.digits)); - } - if (requireNonAlphanumeric) { - // At least one special character - password.push(getRandomChar(allowed.symbols)); - } - var passwordLength = password.length; - if (passwordLength < requiredPasswordLength) { - // At this point we need lengthier password.Fill the rest of the password with random characters - var combineAllowed = shuffle(Object.values(allowed)).join(''); - for (var i = passwordLength; i < requiredPasswordLength; i++) { - password.push(getRandomChar(combineAllowed)); - } - } - if (requiredUniqueChars > 1 && !meetUniqueRule(password, requiredUniqueChars)) { - // The generated password does not meet the required-unique-chars requirment, create another one - return _generatePassword(requiredPasswordLength, requireUppercase, requireLowercase, requireDigit, requireNonAlphanumeric, requiredUniqueChars); + const allowed = { + uppers: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', + lowers: 'abcdefghijklmnopqrstuvwxyz', + digits: '0123456789', + symbols: '!#$%&\()*+,-./:;<=>\'?@@[\]^_`{|}~' + }; + + const getRandomChar = (str) => str.charAt(Math.floor(Math.random() * str.length)); + + const shuffle = (str) => str.sort(function () { return 0.5 - Math.random() }); + + const meetUniqueRule = (str, requiredUniqueChars) => { + let uniqueCharacters = str.filter((item, i, ar) => ar.indexOf(item) === i); + + return uniqueCharacters.length >= requiredUniqueChars; + }; + + const copyPassword = (str) => navigator.clipboard.writeText(str); + + const generatePassword = (requiredPasswordLength, requireUppercase, requireLowercase, requireDigit, requireNonAlphanumeric, requiredUniqueChars) => { + let password = []; + requiredUniqueChars = requiredUniqueChars | 1; + + if (requireUppercase) { + // At least one uppercase + password.push(getRandomChar(allowed.uppers)); + } + if (requireLowercase) { + // At least one lowercase + password.push(getRandomChar(allowed.lowers)); + } + if (requireDigit) { + // At least one digit + password.push(getRandomChar(allowed.digits)); + } + + if (requireNonAlphanumeric) { + // At least one special character + password.push(getRandomChar(allowed.symbols)); + } + + let passwordLength = password.length; + if (passwordLength < requiredPasswordLength) { + // At this point we need lengthier password.Fill the rest of the password with random characters + let combineAllowed = shuffle(Object.values(allowed)).join(''); + for (let i = passwordLength; i < requiredPasswordLength; i++) { + password.push(getRandomChar(combineAllowed)); + } + } + + if (requiredUniqueChars > 1 && !meetUniqueRule(password, requiredUniqueChars)) { + // The generated password does not meet the required-unique-chars requirment, create another one + return generatePassword(requiredPasswordLength, requireUppercase, requireLowercase, requireDigit, requireNonAlphanumeric, requiredUniqueChars); + } + + return shuffle(password).join(''); } - return shuffle(password).join(''); - }; - return { - generatePassword: _generatePassword, - copyPassword: copyPassword - }; -}(); \ No newline at end of file + + return { + generatePassword: generatePassword, + copyPassword: copyPassword + }; +}(); diff --git a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.map b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.map new file mode 100644 index 00000000000..970e6622974 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["passwordManager = function () {\r\n const allowed = {\r\n uppers: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\r\n lowers: 'abcdefghijklmnopqrstuvwxyz',\r\n digits: '0123456789',\r\n symbols: '!#$%&\\()*+,-./:;<=>\\'?@@[\\]^_`{|}~'\r\n };\r\n\r\n const getRandomChar = (str) => str.charAt(Math.floor(Math.random() * str.length));\r\n\r\n const shuffle = (str) => str.sort(function () { return 0.5 - Math.random() });\r\n\r\n const meetUniqueRule = (str, requiredUniqueChars) => {\r\n let uniqueCharacters = str.filter((item, i, ar) => ar.indexOf(item) === i);\r\n\r\n return uniqueCharacters.length >= requiredUniqueChars;\r\n };\r\n\r\n const copyPassword = (str) => navigator.clipboard.writeText(str);\r\n\r\n const generatePassword = (requiredPasswordLength, requireUppercase, requireLowercase, requireDigit, requireNonAlphanumeric, requiredUniqueChars) => {\r\n let password = [];\r\n requiredUniqueChars = requiredUniqueChars | 1;\r\n\r\n if (requireUppercase) {\r\n // At least one uppercase\r\n password.push(getRandomChar(allowed.uppers));\r\n }\r\n if (requireLowercase) {\r\n // At least one lowercase\r\n password.push(getRandomChar(allowed.lowers));\r\n }\r\n if (requireDigit) {\r\n // At least one digit\r\n password.push(getRandomChar(allowed.digits));\r\n }\r\n\r\n if (requireNonAlphanumeric) {\r\n // At least one special character\r\n password.push(getRandomChar(allowed.symbols));\r\n }\r\n\r\n let passwordLength = password.length;\r\n if (passwordLength < requiredPasswordLength) {\r\n // At this point we need lengthier password.Fill the rest of the password with random characters\r\n let combineAllowed = shuffle(Object.values(allowed)).join('');\r\n for (let i = passwordLength; i < requiredPasswordLength; i++) {\r\n password.push(getRandomChar(combineAllowed));\r\n }\r\n }\r\n\r\n if (requiredUniqueChars > 1 && !meetUniqueRule(password, requiredUniqueChars)) {\r\n // The generated password does not meet the required-unique-chars requirment, create another one\r\n return generatePassword(requiredPasswordLength, requireUppercase, requireLowercase, requireDigit, requireNonAlphanumeric, requiredUniqueChars);\r\n }\r\n\r\n return shuffle(password).join('');\r\n }\r\n\r\n return {\r\n generatePassword: generatePassword,\r\n copyPassword: copyPassword\r\n };\r\n}();\r\n"],"names":["passwordManager","allowed","uppers","lowers","digits","symbols","getRandomChar","str","charAt","Math","floor","random","length","shuffle","sort","meetUniqueRule","requiredUniqueChars","uniqueCharacters","filter","item","i","ar","indexOf","generatePassword","requiredPasswordLength","requireUppercase","requireLowercase","requireDigit","requireNonAlphanumeric","password","push","passwordLength","combineAllowed","Object","values","join","copyPassword","navigator","clipboard","writeText"],"mappings":"AAAAA,gBAAkB,WACd,IAAMC,EAAU,CACZC,OAAQ,6BACRC,OAAQ,6BACRC,OAAQ,aACRC,QAAS,iCACb,EAEMC,EAAgB,AAACC,GAAQA,EAAIC,MAAM,CAACC,KAAKC,KAAK,CAACD,KAAKE,MAAM,GAAKJ,EAAIK,MAAM,GAEzEC,EAAU,AAACN,GAAQA,EAAIO,IAAI,CAAC,WAAc,OAAO,GAAML,KAAKE,MAAM,EAAG,GAErEI,EAAiB,CAACR,EAAKS,IAGlBC,AAFgBV,EAAIW,MAAM,CAAC,CAACC,EAAMC,EAAGC,IAAOA,EAAGC,OAAO,CAACH,KAAUC,GAEhDR,MAAM,EAAII,EAKhCO,EAAmB,CAACC,EAAwBC,EAAkBC,EAAkBC,EAAcC,EAAwBZ,KACxH,IAAIa,EAAW,EAAE,CACjBb,GAA4C,EAExCS,GAEAI,EAASC,IAAI,CAACxB,EAAcL,EAAQC,MAAM,GAE1CwB,GAEAG,EAASC,IAAI,CAACxB,EAAcL,EAAQE,MAAM,GAE1CwB,GAEAE,EAASC,IAAI,CAACxB,EAAcL,EAAQG,MAAM,GAG1CwB,GAEAC,EAASC,IAAI,CAACxB,EAAcL,EAAQI,OAAO,GAG/C,IAAI0B,EAAiBF,EAASjB,MAAM,CACpC,GAAImB,EAAiBP,EAAwB,CAEzC,IAAIQ,EAAiBnB,EAAQoB,OAAOC,MAAM,CAACjC,IAAUkC,IAAI,CAAC,IAC1D,IAAK,IAAIf,EAAIW,EAAgBX,EAAII,EAAwBJ,IACrDS,EAASC,IAAI,CAACxB,EAAc0B,GAEpC,QAEA,AAAIhB,EAAsB,GAAK,CAACD,EAAec,EAAUb,GAE9CO,EAAiBC,EAAwBC,EAAkBC,EAAkBC,EAAcC,EAAwBZ,GAGvHH,EAAQgB,GAAUM,IAAI,CAAC,GAClC,EAEA,MAAO,CACHZ,iBAAkBA,EAClBa,aA3CiB,AAAC7B,GAAQ8B,UAAUC,SAAS,CAACC,SAAS,CAAChC,EA4C5D,CACJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.min.js b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.min.js index fbdaffd5511..948cdd8f7bc 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/password-generator.min.js @@ -1 +1 @@ -passwordManager=function(){var r={uppers:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",lowers:"abcdefghijklmnopqrstuvwxyz",digits:"0123456789",symbols:"!#$%&()*+,-./:;<=>'?@@[]^_`{|}~"},n=function(r){return r.charAt(Math.floor(Math.random()*r.length))},t=function(r){return r.sort((function(){return.5-Math.random()}))},o=function(e,u,s,a,i,f){var c=[];f|=1,u&&c.push(n(r.uppers)),s&&c.push(n(r.lowers)),a&&c.push(n(r.digits)),i&&c.push(n(r.symbols));var h=c.length;if(h1&&!function(r,n){return r.filter((function(r,n,t){return t.indexOf(r)===n})).length>=n}(c,f)?o(e,u,s,a,i,f):t(c).join("")};return{generatePassword:o,copyPassword:function(r){return navigator.clipboard.writeText(r)}}}(); +passwordManager=function(){let t={uppers:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",lowers:"abcdefghijklmnopqrstuvwxyz",digits:"0123456789",symbols:"!#$%&()*+,-./:;<=>'?@@[]^_`{|}~"},e=t=>t.charAt(Math.floor(Math.random()*t.length)),r=t=>t.sort(function(){return .5-Math.random()}),s=(t,e)=>t.filter((t,e,r)=>r.indexOf(t)===e).length>=e,o=(n,a,l,i,u,h)=>{let p=[];h|=1,a&&p.push(e(t.uppers)),l&&p.push(e(t.lowers)),i&&p.push(e(t.digits)),u&&p.push(e(t.symbols));let d=p.length;if(d1&&!s(p,h)?o(n,a,l,i,u,h):r(p).join("")};return{generatePassword:o,copyPassword:t=>navigator.clipboard.writeText(t)}}(); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.js b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.js index 01225a3cf54..1980d680f22 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.js +++ b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.js @@ -1,8 +1,3 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - /** * @fileoverview * - Using the 'QRCode for Javascript library' @@ -14,1105 +9,606 @@ * @see http://jeromeetienne.github.com/jquery-qrcode/ */ var QRCode; + (function () { - //--------------------------------------------------------------------- - // QRCode for JavaScript - // - // Copyright (c) 2009 Kazuhiko Arase - // - // URL: http://www.d-project.com/ - // - // Licensed under the MIT license: - // http://www.opensource.org/licenses/mit-license.php - // - // The word "QR Code" is registered trademark of - // DENSO WAVE INCORPORATED - // http://www.denso-wave.com/qrcode/faqpatent-e.html - // - //--------------------------------------------------------------------- - function QR8bitByte(data) { - this.mode = QRMode.MODE_8BIT_BYTE; - this.data = data; - this.parsedData = []; + //--------------------------------------------------------------------- + // QRCode for JavaScript + // + // Copyright (c) 2009 Kazuhiko Arase + // + // URL: http://www.d-project.com/ + // + // Licensed under the MIT license: + // http://www.opensource.org/licenses/mit-license.php + // + // The word "QR Code" is registered trademark of + // DENSO WAVE INCORPORATED + // http://www.denso-wave.com/qrcode/faqpatent-e.html + // + //--------------------------------------------------------------------- + function QR8bitByte(data) { + this.mode = QRMode.MODE_8BIT_BYTE; + this.data = data; + this.parsedData = []; - // Added to support UTF-8 Characters - for (var i = 0, l = this.data.length; i < l; i++) { - var byteArray = []; - var code = this.data.charCodeAt(i); - if (code > 0x10000) { - byteArray[0] = 0xF0 | (code & 0x1C0000) >>> 18; - byteArray[1] = 0x80 | (code & 0x3F000) >>> 12; - byteArray[2] = 0x80 | (code & 0xFC0) >>> 6; - byteArray[3] = 0x80 | code & 0x3F; - } else if (code > 0x800) { - byteArray[0] = 0xE0 | (code & 0xF000) >>> 12; - byteArray[1] = 0x80 | (code & 0xFC0) >>> 6; - byteArray[2] = 0x80 | code & 0x3F; - } else if (code > 0x80) { - byteArray[0] = 0xC0 | (code & 0x7C0) >>> 6; - byteArray[1] = 0x80 | code & 0x3F; - } else { - byteArray[0] = code; - } - this.parsedData.push(byteArray); - } - this.parsedData = Array.prototype.concat.apply([], this.parsedData); - if (this.parsedData.length != this.data.length) { - this.parsedData.unshift(191); - this.parsedData.unshift(187); - this.parsedData.unshift(239); - } - } - QR8bitByte.prototype = { - getLength: function getLength(buffer) { - return this.parsedData.length; - }, - write: function write(buffer) { - for (var i = 0, l = this.parsedData.length; i < l; i++) { - buffer.put(this.parsedData[i], 8); - } - } - }; - function QRCodeModel(typeNumber, errorCorrectLevel) { - this.typeNumber = typeNumber; - this.errorCorrectLevel = errorCorrectLevel; - this.modules = null; - this.moduleCount = 0; - this.dataCache = null; - this.dataList = []; - } - QRCodeModel.prototype = { - addData: function addData(data) { - var newData = new QR8bitByte(data); - this.dataList.push(newData); - this.dataCache = null; - }, - isDark: function isDark(row, col) { - if (row < 0 || this.moduleCount <= row || col < 0 || this.moduleCount <= col) { - throw new Error(row + "," + col); - } - return this.modules[row][col]; - }, - getModuleCount: function getModuleCount() { - return this.moduleCount; - }, - make: function make() { - this.makeImpl(false, this.getBestMaskPattern()); - }, - makeImpl: function makeImpl(test, maskPattern) { - this.moduleCount = this.typeNumber * 4 + 17; - this.modules = new Array(this.moduleCount); - for (var row = 0; row < this.moduleCount; row++) { - this.modules[row] = new Array(this.moduleCount); - for (var col = 0; col < this.moduleCount; col++) { - this.modules[row][col] = null; - } - } - this.setupPositionProbePattern(0, 0); - this.setupPositionProbePattern(this.moduleCount - 7, 0); - this.setupPositionProbePattern(0, this.moduleCount - 7); - this.setupPositionAdjustPattern(); - this.setupTimingPattern(); - this.setupTypeInfo(test, maskPattern); - if (this.typeNumber >= 7) { - this.setupTypeNumber(test); - } - if (this.dataCache == null) { - this.dataCache = QRCodeModel.createData(this.typeNumber, this.errorCorrectLevel, this.dataList); - } - this.mapData(this.dataCache, maskPattern); - }, - setupPositionProbePattern: function setupPositionProbePattern(row, col) { - for (var r = -1; r <= 7; r++) { - if (row + r <= -1 || this.moduleCount <= row + r) continue; - for (var c = -1; c <= 7; c++) { - if (col + c <= -1 || this.moduleCount <= col + c) continue; - if (0 <= r && r <= 6 && (c == 0 || c == 6) || 0 <= c && c <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= c && c <= 4) { - this.modules[row + r][col + c] = true; - } else { - this.modules[row + r][col + c] = false; - } - } - } - }, - getBestMaskPattern: function getBestMaskPattern() { - var minLostPoint = 0; - var pattern = 0; - for (var i = 0; i < 8; i++) { - this.makeImpl(true, i); - var lostPoint = QRUtil.getLostPoint(this); - if (i == 0 || minLostPoint > lostPoint) { - minLostPoint = lostPoint; - pattern = i; - } - } - return pattern; - }, - createMovieClip: function createMovieClip(target_mc, instance_name, depth) { - var qr_mc = target_mc.createEmptyMovieClip(instance_name, depth); - var cs = 1; - this.make(); - for (var row = 0; row < this.modules.length; row++) { - var y = row * cs; - for (var col = 0; col < this.modules[row].length; col++) { - var x = col * cs; - var dark = this.modules[row][col]; - if (dark) { - qr_mc.beginFill(0, 100); - qr_mc.moveTo(x, y); - qr_mc.lineTo(x + cs, y); - qr_mc.lineTo(x + cs, y + cs); - qr_mc.lineTo(x, y + cs); - qr_mc.endFill(); - } - } - } - return qr_mc; - }, - setupTimingPattern: function setupTimingPattern() { - for (var r = 8; r < this.moduleCount - 8; r++) { - if (this.modules[r][6] != null) { - continue; - } - this.modules[r][6] = r % 2 == 0; - } - for (var c = 8; c < this.moduleCount - 8; c++) { - if (this.modules[6][c] != null) { - continue; - } - this.modules[6][c] = c % 2 == 0; - } - }, - setupPositionAdjustPattern: function setupPositionAdjustPattern() { - var pos = QRUtil.getPatternPosition(this.typeNumber); - for (var i = 0; i < pos.length; i++) { - for (var j = 0; j < pos.length; j++) { - var row = pos[i]; - var col = pos[j]; - if (this.modules[row][col] != null) { - continue; - } - for (var r = -2; r <= 2; r++) { - for (var c = -2; c <= 2; c++) { - if (r == -2 || r == 2 || c == -2 || c == 2 || r == 0 && c == 0) { - this.modules[row + r][col + c] = true; - } else { - this.modules[row + r][col + c] = false; - } - } - } - } - } - }, - setupTypeNumber: function setupTypeNumber(test) { - var bits = QRUtil.getBCHTypeNumber(this.typeNumber); - for (var i = 0; i < 18; i++) { - var mod = !test && (bits >> i & 1) == 1; - this.modules[Math.floor(i / 3)][i % 3 + this.moduleCount - 8 - 3] = mod; - } - for (var i = 0; i < 18; i++) { - var mod = !test && (bits >> i & 1) == 1; - this.modules[i % 3 + this.moduleCount - 8 - 3][Math.floor(i / 3)] = mod; - } - }, - setupTypeInfo: function setupTypeInfo(test, maskPattern) { - var data = this.errorCorrectLevel << 3 | maskPattern; - var bits = QRUtil.getBCHTypeInfo(data); - for (var i = 0; i < 15; i++) { - var mod = !test && (bits >> i & 1) == 1; - if (i < 6) { - this.modules[i][8] = mod; - } else if (i < 8) { - this.modules[i + 1][8] = mod; - } else { - this.modules[this.moduleCount - 15 + i][8] = mod; - } - } - for (var i = 0; i < 15; i++) { - var mod = !test && (bits >> i & 1) == 1; - if (i < 8) { - this.modules[8][this.moduleCount - i - 1] = mod; - } else if (i < 9) { - this.modules[8][15 - i - 1 + 1] = mod; - } else { - this.modules[8][15 - i - 1] = mod; - } - } - this.modules[this.moduleCount - 8][8] = !test; - }, - mapData: function mapData(data, maskPattern) { - var inc = -1; - var row = this.moduleCount - 1; - var bitIndex = 7; - var byteIndex = 0; - for (var col = this.moduleCount - 1; col > 0; col -= 2) { - if (col == 6) col--; - while (true) { - for (var c = 0; c < 2; c++) { - if (this.modules[row][col - c] == null) { - var dark = false; - if (byteIndex < data.length) { - dark = (data[byteIndex] >>> bitIndex & 1) == 1; - } - var mask = QRUtil.getMask(maskPattern, row, col - c); - if (mask) { - dark = !dark; - } - this.modules[row][col - c] = dark; - bitIndex--; - if (bitIndex == -1) { - byteIndex++; - bitIndex = 7; - } - } - } - row += inc; - if (row < 0 || this.moduleCount <= row) { - row -= inc; - inc = -inc; - break; - } - } - } - } - }; - QRCodeModel.PAD0 = 0xEC; - QRCodeModel.PAD1 = 0x11; - QRCodeModel.createData = function (typeNumber, errorCorrectLevel, dataList) { - var rsBlocks = QRRSBlock.getRSBlocks(typeNumber, errorCorrectLevel); - var buffer = new QRBitBuffer(); - for (var i = 0; i < dataList.length; i++) { - var data = dataList[i]; - buffer.put(data.mode, 4); - buffer.put(data.getLength(), QRUtil.getLengthInBits(data.mode, typeNumber)); - data.write(buffer); - } - var totalDataCount = 0; - for (var i = 0; i < rsBlocks.length; i++) { - totalDataCount += rsBlocks[i].dataCount; - } - if (buffer.getLengthInBits() > totalDataCount * 8) { - throw new Error("code length overflow. (" + buffer.getLengthInBits() + ">" + totalDataCount * 8 + ")"); - } - if (buffer.getLengthInBits() + 4 <= totalDataCount * 8) { - buffer.put(0, 4); - } - while (buffer.getLengthInBits() % 8 != 0) { - buffer.putBit(false); - } - while (true) { - if (buffer.getLengthInBits() >= totalDataCount * 8) { - break; - } - buffer.put(QRCodeModel.PAD0, 8); - if (buffer.getLengthInBits() >= totalDataCount * 8) { - break; - } - buffer.put(QRCodeModel.PAD1, 8); - } - return QRCodeModel.createBytes(buffer, rsBlocks); - }; - QRCodeModel.createBytes = function (buffer, rsBlocks) { - var offset = 0; - var maxDcCount = 0; - var maxEcCount = 0; - var dcdata = new Array(rsBlocks.length); - var ecdata = new Array(rsBlocks.length); - for (var r = 0; r < rsBlocks.length; r++) { - var dcCount = rsBlocks[r].dataCount; - var ecCount = rsBlocks[r].totalCount - dcCount; - maxDcCount = Math.max(maxDcCount, dcCount); - maxEcCount = Math.max(maxEcCount, ecCount); - dcdata[r] = new Array(dcCount); - for (var i = 0; i < dcdata[r].length; i++) { - dcdata[r][i] = 0xff & buffer.buffer[i + offset]; - } - offset += dcCount; - var rsPoly = QRUtil.getErrorCorrectPolynomial(ecCount); - var rawPoly = new QRPolynomial(dcdata[r], rsPoly.getLength() - 1); - var modPoly = rawPoly.mod(rsPoly); - ecdata[r] = new Array(rsPoly.getLength() - 1); - for (var i = 0; i < ecdata[r].length; i++) { - var modIndex = i + modPoly.getLength() - ecdata[r].length; - ecdata[r][i] = modIndex >= 0 ? modPoly.get(modIndex) : 0; - } - } - var totalCodeCount = 0; - for (var i = 0; i < rsBlocks.length; i++) { - totalCodeCount += rsBlocks[i].totalCount; - } - var data = new Array(totalCodeCount); - var index = 0; - for (var i = 0; i < maxDcCount; i++) { - for (var r = 0; r < rsBlocks.length; r++) { - if (i < dcdata[r].length) { - data[index++] = dcdata[r][i]; - } - } - } - for (var i = 0; i < maxEcCount; i++) { - for (var r = 0; r < rsBlocks.length; r++) { - if (i < ecdata[r].length) { - data[index++] = ecdata[r][i]; - } - } - } - return data; - }; - var QRMode = { - MODE_NUMBER: 1 << 0, - MODE_ALPHA_NUM: 1 << 1, - MODE_8BIT_BYTE: 1 << 2, - MODE_KANJI: 1 << 3 - }; - var QRErrorCorrectLevel = { - L: 1, - M: 0, - Q: 3, - H: 2 - }; - var QRMaskPattern = { - PATTERN000: 0, - PATTERN001: 1, - PATTERN010: 2, - PATTERN011: 3, - PATTERN100: 4, - PATTERN101: 5, - PATTERN110: 6, - PATTERN111: 7 - }; - var QRUtil = { - PATTERN_POSITION_TABLE: [[], [6, 18], [6, 22], [6, 26], [6, 30], [6, 34], [6, 22, 38], [6, 24, 42], [6, 26, 46], [6, 28, 50], [6, 30, 54], [6, 32, 58], [6, 34, 62], [6, 26, 46, 66], [6, 26, 48, 70], [6, 26, 50, 74], [6, 30, 54, 78], [6, 30, 56, 82], [6, 30, 58, 86], [6, 34, 62, 90], [6, 28, 50, 72, 94], [6, 26, 50, 74, 98], [6, 30, 54, 78, 102], [6, 28, 54, 80, 106], [6, 32, 58, 84, 110], [6, 30, 58, 86, 114], [6, 34, 62, 90, 118], [6, 26, 50, 74, 98, 122], [6, 30, 54, 78, 102, 126], [6, 26, 52, 78, 104, 130], [6, 30, 56, 82, 108, 134], [6, 34, 60, 86, 112, 138], [6, 30, 58, 86, 114, 142], [6, 34, 62, 90, 118, 146], [6, 30, 54, 78, 102, 126, 150], [6, 24, 50, 76, 102, 128, 154], [6, 28, 54, 80, 106, 132, 158], [6, 32, 58, 84, 110, 136, 162], [6, 26, 54, 82, 110, 138, 166], [6, 30, 58, 86, 114, 142, 170]], - G15: 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0, - G18: 1 << 12 | 1 << 11 | 1 << 10 | 1 << 9 | 1 << 8 | 1 << 5 | 1 << 2 | 1 << 0, - G15_MASK: 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1, - getBCHTypeInfo: function getBCHTypeInfo(data) { - var d = data << 10; - while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15) >= 0) { - d ^= QRUtil.G15 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G15); - } - return (data << 10 | d) ^ QRUtil.G15_MASK; - }, - getBCHTypeNumber: function getBCHTypeNumber(data) { - var d = data << 12; - while (QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18) >= 0) { - d ^= QRUtil.G18 << QRUtil.getBCHDigit(d) - QRUtil.getBCHDigit(QRUtil.G18); - } - return data << 12 | d; - }, - getBCHDigit: function getBCHDigit(data) { - var digit = 0; - while (data != 0) { - digit++; - data >>>= 1; - } - return digit; - }, - getPatternPosition: function getPatternPosition(typeNumber) { - return QRUtil.PATTERN_POSITION_TABLE[typeNumber - 1]; - }, - getMask: function getMask(maskPattern, i, j) { - switch (maskPattern) { - case QRMaskPattern.PATTERN000: - return (i + j) % 2 == 0; - case QRMaskPattern.PATTERN001: - return i % 2 == 0; - case QRMaskPattern.PATTERN010: - return j % 3 == 0; - case QRMaskPattern.PATTERN011: - return (i + j) % 3 == 0; - case QRMaskPattern.PATTERN100: - return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 == 0; - case QRMaskPattern.PATTERN101: - return i * j % 2 + i * j % 3 == 0; - case QRMaskPattern.PATTERN110: - return (i * j % 2 + i * j % 3) % 2 == 0; - case QRMaskPattern.PATTERN111: - return (i * j % 3 + (i + j) % 2) % 2 == 0; - default: - throw new Error("bad maskPattern:" + maskPattern); - } - }, - getErrorCorrectPolynomial: function getErrorCorrectPolynomial(errorCorrectLength) { - var a = new QRPolynomial([1], 0); - for (var i = 0; i < errorCorrectLength; i++) { - a = a.multiply(new QRPolynomial([1, QRMath.gexp(i)], 0)); - } - return a; - }, - getLengthInBits: function getLengthInBits(mode, type) { - if (1 <= type && type < 10) { - switch (mode) { - case QRMode.MODE_NUMBER: - return 10; - case QRMode.MODE_ALPHA_NUM: - return 9; - case QRMode.MODE_8BIT_BYTE: - return 8; - case QRMode.MODE_KANJI: - return 8; - default: - throw new Error("mode:" + mode); - } - } else if (type < 27) { - switch (mode) { - case QRMode.MODE_NUMBER: - return 12; - case QRMode.MODE_ALPHA_NUM: - return 11; - case QRMode.MODE_8BIT_BYTE: - return 16; - case QRMode.MODE_KANJI: - return 10; - default: - throw new Error("mode:" + mode); - } - } else if (type < 41) { - switch (mode) { - case QRMode.MODE_NUMBER: - return 14; - case QRMode.MODE_ALPHA_NUM: - return 13; - case QRMode.MODE_8BIT_BYTE: - return 16; - case QRMode.MODE_KANJI: - return 12; - default: - throw new Error("mode:" + mode); - } - } else { - throw new Error("type:" + type); - } - }, - getLostPoint: function getLostPoint(qrCode) { - var moduleCount = qrCode.getModuleCount(); - var lostPoint = 0; - for (var row = 0; row < moduleCount; row++) { - for (var col = 0; col < moduleCount; col++) { - var sameCount = 0; - var dark = qrCode.isDark(row, col); - for (var r = -1; r <= 1; r++) { - if (row + r < 0 || moduleCount <= row + r) { - continue; - } - for (var c = -1; c <= 1; c++) { - if (col + c < 0 || moduleCount <= col + c) { - continue; - } - if (r == 0 && c == 0) { - continue; - } - if (dark == qrCode.isDark(row + r, col + c)) { - sameCount++; - } - } - } - if (sameCount > 5) { - lostPoint += 3 + sameCount - 5; - } - } - } - for (var row = 0; row < moduleCount - 1; row++) { - for (var col = 0; col < moduleCount - 1; col++) { - var count = 0; - if (qrCode.isDark(row, col)) count++; - if (qrCode.isDark(row + 1, col)) count++; - if (qrCode.isDark(row, col + 1)) count++; - if (qrCode.isDark(row + 1, col + 1)) count++; - if (count == 0 || count == 4) { - lostPoint += 3; - } - } - } - for (var row = 0; row < moduleCount; row++) { - for (var col = 0; col < moduleCount - 6; col++) { - if (qrCode.isDark(row, col) && !qrCode.isDark(row, col + 1) && qrCode.isDark(row, col + 2) && qrCode.isDark(row, col + 3) && qrCode.isDark(row, col + 4) && !qrCode.isDark(row, col + 5) && qrCode.isDark(row, col + 6)) { - lostPoint += 40; - } - } - } - for (var col = 0; col < moduleCount; col++) { - for (var row = 0; row < moduleCount - 6; row++) { - if (qrCode.isDark(row, col) && !qrCode.isDark(row + 1, col) && qrCode.isDark(row + 2, col) && qrCode.isDark(row + 3, col) && qrCode.isDark(row + 4, col) && !qrCode.isDark(row + 5, col) && qrCode.isDark(row + 6, col)) { - lostPoint += 40; - } - } - } - var darkCount = 0; - for (var col = 0; col < moduleCount; col++) { - for (var row = 0; row < moduleCount; row++) { - if (qrCode.isDark(row, col)) { - darkCount++; - } - } - } - var ratio = Math.abs(100 * darkCount / moduleCount / moduleCount - 50) / 5; - lostPoint += ratio * 10; - return lostPoint; - } - }; - var QRMath = { - glog: function glog(n) { - if (n < 1) { - throw new Error("glog(" + n + ")"); - } - return QRMath.LOG_TABLE[n]; - }, - gexp: function gexp(n) { - while (n < 0) { - n += 255; - } - while (n >= 256) { - n -= 255; - } - return QRMath.EXP_TABLE[n]; - }, - EXP_TABLE: new Array(256), - LOG_TABLE: new Array(256) - }; - for (var i = 0; i < 8; i++) { - QRMath.EXP_TABLE[i] = 1 << i; - } - for (var i = 8; i < 256; i++) { - QRMath.EXP_TABLE[i] = QRMath.EXP_TABLE[i - 4] ^ QRMath.EXP_TABLE[i - 5] ^ QRMath.EXP_TABLE[i - 6] ^ QRMath.EXP_TABLE[i - 8]; - } - for (var i = 0; i < 255; i++) { - QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]] = i; - } - function QRPolynomial(num, shift) { - if (num.length == undefined) { - throw new Error(num.length + "/" + shift); - } - var offset = 0; - while (offset < num.length && num[offset] == 0) { - offset++; - } - this.num = new Array(num.length - offset + shift); - for (var i = 0; i < num.length - offset; i++) { - this.num[i] = num[i + offset]; - } - } - QRPolynomial.prototype = { - get: function get(index) { - return this.num[index]; - }, - getLength: function getLength() { - return this.num.length; - }, - multiply: function multiply(e) { - var num = new Array(this.getLength() + e.getLength() - 1); - for (var i = 0; i < this.getLength(); i++) { - for (var j = 0; j < e.getLength(); j++) { - num[i + j] ^= QRMath.gexp(QRMath.glog(this.get(i)) + QRMath.glog(e.get(j))); - } - } - return new QRPolynomial(num, 0); - }, - mod: function mod(e) { - if (this.getLength() - e.getLength() < 0) { - return this; - } - var ratio = QRMath.glog(this.get(0)) - QRMath.glog(e.get(0)); - var num = new Array(this.getLength()); - for (var i = 0; i < this.getLength(); i++) { - num[i] = this.get(i); - } - for (var i = 0; i < e.getLength(); i++) { - num[i] ^= QRMath.gexp(QRMath.glog(e.get(i)) + ratio); - } - return new QRPolynomial(num, 0).mod(e); - } - }; - function QRRSBlock(totalCount, dataCount) { - this.totalCount = totalCount; - this.dataCount = dataCount; - } - QRRSBlock.RS_BLOCK_TABLE = [[1, 26, 19], [1, 26, 16], [1, 26, 13], [1, 26, 9], [1, 44, 34], [1, 44, 28], [1, 44, 22], [1, 44, 16], [1, 70, 55], [1, 70, 44], [2, 35, 17], [2, 35, 13], [1, 100, 80], [2, 50, 32], [2, 50, 24], [4, 25, 9], [1, 134, 108], [2, 67, 43], [2, 33, 15, 2, 34, 16], [2, 33, 11, 2, 34, 12], [2, 86, 68], [4, 43, 27], [4, 43, 19], [4, 43, 15], [2, 98, 78], [4, 49, 31], [2, 32, 14, 4, 33, 15], [4, 39, 13, 1, 40, 14], [2, 121, 97], [2, 60, 38, 2, 61, 39], [4, 40, 18, 2, 41, 19], [4, 40, 14, 2, 41, 15], [2, 146, 116], [3, 58, 36, 2, 59, 37], [4, 36, 16, 4, 37, 17], [4, 36, 12, 4, 37, 13], [2, 86, 68, 2, 87, 69], [4, 69, 43, 1, 70, 44], [6, 43, 19, 2, 44, 20], [6, 43, 15, 2, 44, 16], [4, 101, 81], [1, 80, 50, 4, 81, 51], [4, 50, 22, 4, 51, 23], [3, 36, 12, 8, 37, 13], [2, 116, 92, 2, 117, 93], [6, 58, 36, 2, 59, 37], [4, 46, 20, 6, 47, 21], [7, 42, 14, 4, 43, 15], [4, 133, 107], [8, 59, 37, 1, 60, 38], [8, 44, 20, 4, 45, 21], [12, 33, 11, 4, 34, 12], [3, 145, 115, 1, 146, 116], [4, 64, 40, 5, 65, 41], [11, 36, 16, 5, 37, 17], [11, 36, 12, 5, 37, 13], [5, 109, 87, 1, 110, 88], [5, 65, 41, 5, 66, 42], [5, 54, 24, 7, 55, 25], [11, 36, 12], [5, 122, 98, 1, 123, 99], [7, 73, 45, 3, 74, 46], [15, 43, 19, 2, 44, 20], [3, 45, 15, 13, 46, 16], [1, 135, 107, 5, 136, 108], [10, 74, 46, 1, 75, 47], [1, 50, 22, 15, 51, 23], [2, 42, 14, 17, 43, 15], [5, 150, 120, 1, 151, 121], [9, 69, 43, 4, 70, 44], [17, 50, 22, 1, 51, 23], [2, 42, 14, 19, 43, 15], [3, 141, 113, 4, 142, 114], [3, 70, 44, 11, 71, 45], [17, 47, 21, 4, 48, 22], [9, 39, 13, 16, 40, 14], [3, 135, 107, 5, 136, 108], [3, 67, 41, 13, 68, 42], [15, 54, 24, 5, 55, 25], [15, 43, 15, 10, 44, 16], [4, 144, 116, 4, 145, 117], [17, 68, 42], [17, 50, 22, 6, 51, 23], [19, 46, 16, 6, 47, 17], [2, 139, 111, 7, 140, 112], [17, 74, 46], [7, 54, 24, 16, 55, 25], [34, 37, 13], [4, 151, 121, 5, 152, 122], [4, 75, 47, 14, 76, 48], [11, 54, 24, 14, 55, 25], [16, 45, 15, 14, 46, 16], [6, 147, 117, 4, 148, 118], [6, 73, 45, 14, 74, 46], [11, 54, 24, 16, 55, 25], [30, 46, 16, 2, 47, 17], [8, 132, 106, 4, 133, 107], [8, 75, 47, 13, 76, 48], [7, 54, 24, 22, 55, 25], [22, 45, 15, 13, 46, 16], [10, 142, 114, 2, 143, 115], [19, 74, 46, 4, 75, 47], [28, 50, 22, 6, 51, 23], [33, 46, 16, 4, 47, 17], [8, 152, 122, 4, 153, 123], [22, 73, 45, 3, 74, 46], [8, 53, 23, 26, 54, 24], [12, 45, 15, 28, 46, 16], [3, 147, 117, 10, 148, 118], [3, 73, 45, 23, 74, 46], [4, 54, 24, 31, 55, 25], [11, 45, 15, 31, 46, 16], [7, 146, 116, 7, 147, 117], [21, 73, 45, 7, 74, 46], [1, 53, 23, 37, 54, 24], [19, 45, 15, 26, 46, 16], [5, 145, 115, 10, 146, 116], [19, 75, 47, 10, 76, 48], [15, 54, 24, 25, 55, 25], [23, 45, 15, 25, 46, 16], [13, 145, 115, 3, 146, 116], [2, 74, 46, 29, 75, 47], [42, 54, 24, 1, 55, 25], [23, 45, 15, 28, 46, 16], [17, 145, 115], [10, 74, 46, 23, 75, 47], [10, 54, 24, 35, 55, 25], [19, 45, 15, 35, 46, 16], [17, 145, 115, 1, 146, 116], [14, 74, 46, 21, 75, 47], [29, 54, 24, 19, 55, 25], [11, 45, 15, 46, 46, 16], [13, 145, 115, 6, 146, 116], [14, 74, 46, 23, 75, 47], [44, 54, 24, 7, 55, 25], [59, 46, 16, 1, 47, 17], [12, 151, 121, 7, 152, 122], [12, 75, 47, 26, 76, 48], [39, 54, 24, 14, 55, 25], [22, 45, 15, 41, 46, 16], [6, 151, 121, 14, 152, 122], [6, 75, 47, 34, 76, 48], [46, 54, 24, 10, 55, 25], [2, 45, 15, 64, 46, 16], [17, 152, 122, 4, 153, 123], [29, 74, 46, 14, 75, 47], [49, 54, 24, 10, 55, 25], [24, 45, 15, 46, 46, 16], [4, 152, 122, 18, 153, 123], [13, 74, 46, 32, 75, 47], [48, 54, 24, 14, 55, 25], [42, 45, 15, 32, 46, 16], [20, 147, 117, 4, 148, 118], [40, 75, 47, 7, 76, 48], [43, 54, 24, 22, 55, 25], [10, 45, 15, 67, 46, 16], [19, 148, 118, 6, 149, 119], [18, 75, 47, 31, 76, 48], [34, 54, 24, 34, 55, 25], [20, 45, 15, 61, 46, 16]]; - QRRSBlock.getRSBlocks = function (typeNumber, errorCorrectLevel) { - var rsBlock = QRRSBlock.getRsBlockTable(typeNumber, errorCorrectLevel); - if (rsBlock == undefined) { - throw new Error("bad rs block @ typeNumber:" + typeNumber + "/errorCorrectLevel:" + errorCorrectLevel); - } - var length = rsBlock.length / 3; - var list = []; - for (var i = 0; i < length; i++) { - var count = rsBlock[i * 3 + 0]; - var totalCount = rsBlock[i * 3 + 1]; - var dataCount = rsBlock[i * 3 + 2]; - for (var j = 0; j < count; j++) { - list.push(new QRRSBlock(totalCount, dataCount)); - } - } - return list; - }; - QRRSBlock.getRsBlockTable = function (typeNumber, errorCorrectLevel) { - switch (errorCorrectLevel) { - case QRErrorCorrectLevel.L: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 0]; - case QRErrorCorrectLevel.M: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 1]; - case QRErrorCorrectLevel.Q: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 2]; - case QRErrorCorrectLevel.H: - return QRRSBlock.RS_BLOCK_TABLE[(typeNumber - 1) * 4 + 3]; - default: - return undefined; - } - }; - function QRBitBuffer() { - this.buffer = []; - this.length = 0; - } - QRBitBuffer.prototype = { - get: function get(index) { - var bufIndex = Math.floor(index / 8); - return (this.buffer[bufIndex] >>> 7 - index % 8 & 1) == 1; - }, - put: function put(num, length) { - for (var i = 0; i < length; i++) { - this.putBit((num >>> length - i - 1 & 1) == 1); - } - }, - getLengthInBits: function getLengthInBits() { - return this.length; - }, - putBit: function putBit(bit) { - var bufIndex = Math.floor(this.length / 8); - if (this.buffer.length <= bufIndex) { - this.buffer.push(0); - } - if (bit) { - this.buffer[bufIndex] |= 0x80 >>> this.length % 8; - } - this.length++; - } - }; - var QRCodeLimitLength = [[17, 14, 11, 7], [32, 26, 20, 14], [53, 42, 32, 24], [78, 62, 46, 34], [106, 84, 60, 44], [134, 106, 74, 58], [154, 122, 86, 64], [192, 152, 108, 84], [230, 180, 130, 98], [271, 213, 151, 119], [321, 251, 177, 137], [367, 287, 203, 155], [425, 331, 241, 177], [458, 362, 258, 194], [520, 412, 292, 220], [586, 450, 322, 250], [644, 504, 364, 280], [718, 560, 394, 310], [792, 624, 442, 338], [858, 666, 482, 382], [929, 711, 509, 403], [1003, 779, 565, 439], [1091, 857, 611, 461], [1171, 911, 661, 511], [1273, 997, 715, 535], [1367, 1059, 751, 593], [1465, 1125, 805, 625], [1528, 1190, 868, 658], [1628, 1264, 908, 698], [1732, 1370, 982, 742], [1840, 1452, 1030, 790], [1952, 1538, 1112, 842], [2068, 1628, 1168, 898], [2188, 1722, 1228, 958], [2303, 1809, 1283, 983], [2431, 1911, 1351, 1051], [2563, 1989, 1423, 1093], [2699, 2099, 1499, 1139], [2809, 2213, 1579, 1219], [2953, 2331, 1663, 1273]]; - function _isSupportCanvas() { - return typeof CanvasRenderingContext2D != "undefined"; - } + // Added to support UTF-8 Characters + for (var i = 0, l = this.data.length; i < l; i++) { + var byteArray = []; + var code = this.data.charCodeAt(i); - // android 2.x doesn't support Data-URI spec - function _getAndroid() { - var android = false; - var sAgent = navigator.userAgent; - if (/android/i.test(sAgent)) { - // android - android = true; - var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i); - if (aMat && aMat[1]) { - android = parseFloat(aMat[1]); - } - } - return android; - } - var svgDrawer = function () { - var Drawing = function Drawing(el, htOption) { - this._el = el; - this._htOption = htOption; - }; - Drawing.prototype.draw = function (oQRCode) { - var _htOption = this._htOption; - var _el = this._el; - var nCount = oQRCode.getModuleCount(); - var nWidth = Math.floor(_htOption.width / nCount); - var nHeight = Math.floor(_htOption.height / nCount); - this.clear(); - function makeSVG(tag, attrs) { - var el = document.createElementNS('http://www.w3.org/2000/svg', tag); - for (var k in attrs) if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]); - return el; - } - var svg = makeSVG("svg", { - 'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), - 'width': '100%', - 'height': '100%', - 'fill': _htOption.colorLight - }); - svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); - _el.appendChild(svg); - svg.appendChild(makeSVG("rect", { - "fill": _htOption.colorLight, - "width": "100%", - "height": "100%" - })); - svg.appendChild(makeSVG("rect", { - "fill": _htOption.colorDark, - "width": "1", - "height": "1", - "id": "template" - })); - for (var row = 0; row < nCount; row++) { - for (var col = 0; col < nCount; col++) { - if (oQRCode.isDark(row, col)) { - var child = makeSVG("use", { - "x": String(row), - "y": String(col) - }); - child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template"); - svg.appendChild(child); - } - } - } - }; - Drawing.prototype.clear = function () { - while (this._el.hasChildNodes()) this._el.removeChild(this._el.lastChild); - }; - return Drawing; - }(); - var useSVG = document.documentElement.tagName.toLowerCase() === "svg"; + if (code > 0x10000) { + byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18); + byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12); + byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6); + byteArray[3] = 0x80 | (code & 0x3F); + } else if (code > 0x800) { + byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12); + byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6); + byteArray[2] = 0x80 | (code & 0x3F); + } else if (code > 0x80) { + byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6); + byteArray[1] = 0x80 | (code & 0x3F); + } else { + byteArray[0] = code; + } - // Drawing in DOM by using Table tag - var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? function () { - var Drawing = function Drawing(el, htOption) { - this._el = el; - this._htOption = htOption; - }; + this.parsedData.push(byteArray); + } - /** - * Draw the QRCode - * - * @param {QRCode} oQRCode - */ - Drawing.prototype.draw = function (oQRCode) { - var _htOption = this._htOption; - var _el = this._el; - var nCount = oQRCode.getModuleCount(); - var nWidth = Math.floor(_htOption.width / nCount); - var nHeight = Math.floor(_htOption.height / nCount); - var aHTML = ['']; - for (var row = 0; row < nCount; row++) { - aHTML.push(''); - for (var col = 0; col < nCount; col++) { - aHTML.push(''); - } - aHTML.push(''); - } - aHTML.push('
'); - _el.innerHTML = aHTML.join(''); + this.parsedData = Array.prototype.concat.apply([], this.parsedData); - // Fix the margin values as real size. - var elTable = _el.childNodes[0]; - var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2; - var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2; - if (nLeftMarginTable > 0 && nTopMarginTable > 0) { - elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px"; - } - }; + if (this.parsedData.length != this.data.length) { + this.parsedData.unshift(191); + this.parsedData.unshift(187); + this.parsedData.unshift(239); + } + } - /** - * Clear the QRCode - */ - Drawing.prototype.clear = function () { - this._el.innerHTML = ''; - }; - return Drawing; - }() : function () { - // Drawing in Canvas - function _onMakeImage() { - this._elImage.src = this._elCanvas.toDataURL("image/png"); - this._elImage.style.display = "block"; - this._elCanvas.style.display = "none"; - } + QR8bitByte.prototype = { + getLength: function (buffer) { + return this.parsedData.length; + }, + write: function (buffer) { + for (var i = 0, l = this.parsedData.length; i < l; i++) { + buffer.put(this.parsedData[i], 8); + } + } + }; - // Android 2.1 bug workaround - // http://code.google.com/p/android/issues/detail?id=5141 - if (this._android && this._android <= 2.1) { - var factor = 1 / window.devicePixelRatio; - var drawImage = CanvasRenderingContext2D.prototype.drawImage; - CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) { - if ("nodeName" in image && /img/i.test(image.nodeName)) { - for (var i = arguments.length - 1; i >= 1; i--) { - arguments[i] = arguments[i] * factor; - } - } else if (typeof dw == "undefined") { - arguments[1] *= factor; - arguments[2] *= factor; - arguments[3] *= factor; - arguments[4] *= factor; - } - drawImage.apply(this, arguments); - }; - } + function QRCodeModel(typeNumber, errorCorrectLevel) { + this.typeNumber = typeNumber; + this.errorCorrectLevel = errorCorrectLevel; + this.modules = null; + this.moduleCount = 0; + this.dataCache = null; + this.dataList = []; + } - /** - * Check whether the user's browser supports Data URI or not - * - * @private - * @param {Function} fSuccess Occurs if it supports Data URI - * @param {Function} fFail Occurs if it doesn't support Data URI - */ - function _safeSetDataURI(fSuccess, fFail) { - var self = this; - self._fFail = fFail; - self._fSuccess = fSuccess; + QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);} + return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row=7){this.setupTypeNumber(test);} + if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);} + this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}} + return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;} + for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}} + for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}} + this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex>>bitIndex)&1)==1);} + var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;} + this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}} + row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;itotalDataCount*8){throw new Error("code length overflow. (" + +buffer.getLengthInBits() + +">" + +totalDataCount*8 + +")");} + if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);} + while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);} + while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;} + buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;} + buffer.put(QRCodeModel.PAD1,8);} + return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r=0)?modPoly.get(modIndex):0;}} + var totalCodeCount=0;for(var i=0;i=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));} + return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));} + return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;} + return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i5){lostPoint+=(3+sameCount-5);}}} + for(var row=0;row=256){n-=255;} + return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);} + if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));} + this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]; + + function _isSupportCanvas() { + return typeof CanvasRenderingContext2D != "undefined"; + } + + // android 2.x doesn't support Data-URI spec + function _getAndroid() { + var android = false; + var sAgent = navigator.userAgent; + + if (/android/i.test(sAgent)) { // android + android = true; + var aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i); + + if (aMat && aMat[1]) { + android = parseFloat(aMat[1]); + } + } + + return android; + } + + var svgDrawer = (function() { - // Check it just once - if (self._bSupportDataURI === null) { - var el = document.createElement("img"); - var fOnError = function fOnError() { - self._bSupportDataURI = false; - if (self._fFail) { - self._fFail.call(self); - } - }; - var fOnSuccess = function fOnSuccess() { - self._bSupportDataURI = true; - if (self._fSuccess) { - self._fSuccess.call(self); - } - }; - el.onabort = fOnError; - el.onerror = fOnError; - el.onload = fOnSuccess; - el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data. - return; - } else if (self._bSupportDataURI === true && self._fSuccess) { - self._fSuccess.call(self); - } else if (self._bSupportDataURI === false && self._fFail) { - self._fFail.call(self); - } - } - ; + var Drawing = function (el, htOption) { + this._el = el; + this._htOption = htOption; + }; - /** - * Drawing QRCode by using canvas - * - * @constructor - * @param {HTMLElement} el - * @param {Object} htOption QRCode Options - */ - var Drawing = function Drawing(el, htOption) { - this._bIsPainted = false; - this._android = _getAndroid(); - this._htOption = htOption; - this._elCanvas = document.createElement("canvas"); - this._elCanvas.width = htOption.width; - this._elCanvas.height = htOption.height; - el.appendChild(this._elCanvas); - this._el = el; - this._oContext = this._elCanvas.getContext("2d"); - this._bIsPainted = false; - this._elImage = document.createElement("img"); - this._elImage.alt = "Scan me!"; - this._elImage.style.display = "none"; - this._el.appendChild(this._elImage); - this._bSupportDataURI = null; - }; + Drawing.prototype.draw = function (oQRCode) { + var _htOption = this._htOption; + var _el = this._el; + var nCount = oQRCode.getModuleCount(); + var nWidth = Math.floor(_htOption.width / nCount); + var nHeight = Math.floor(_htOption.height / nCount); - /** - * Draw the QRCode - * - * @param {QRCode} oQRCode - */ - Drawing.prototype.draw = function (oQRCode) { - var _elImage = this._elImage; - var _oContext = this._oContext; - var _htOption = this._htOption; - var nCount = oQRCode.getModuleCount(); - var nWidth = _htOption.width / nCount; - var nHeight = _htOption.height / nCount; - var nRoundedWidth = Math.round(nWidth); - var nRoundedHeight = Math.round(nHeight); - _elImage.style.display = "none"; - this.clear(); - for (var row = 0; row < nCount; row++) { - for (var col = 0; col < nCount; col++) { - var bIsDark = oQRCode.isDark(row, col); - var nLeft = col * nWidth; - var nTop = row * nHeight; - _oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; - _oContext.lineWidth = 1; - _oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; - _oContext.fillRect(nLeft, nTop, nWidth, nHeight); + this.clear(); - // 안티 앨리어싱 방지 처리 - _oContext.strokeRect(Math.floor(nLeft) + 0.5, Math.floor(nTop) + 0.5, nRoundedWidth, nRoundedHeight); - _oContext.strokeRect(Math.ceil(nLeft) - 0.5, Math.ceil(nTop) - 0.5, nRoundedWidth, nRoundedHeight); - } - } - this._bIsPainted = true; - }; + function makeSVG(tag, attrs) { + var el = document.createElementNS('http://www.w3.org/2000/svg', tag); + for (var k in attrs) + if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]); + return el; + } - /** - * Make the image from Canvas if the browser supports Data URI. - */ - Drawing.prototype.makeImage = function () { - if (this._bIsPainted) { - _safeSetDataURI.call(this, _onMakeImage); - } - }; + var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight}); + svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); + _el.appendChild(svg); - /** - * Return whether the QRCode is painted or not - * - * @return {Boolean} - */ - Drawing.prototype.isPainted = function () { - return this._bIsPainted; - }; + svg.appendChild(makeSVG("rect", {"fill": _htOption.colorLight, "width": "100%", "height": "100%"})); + svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"})); - /** - * Clear the QRCode - */ - Drawing.prototype.clear = function () { - this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height); - this._bIsPainted = false; - }; + for (var row = 0; row < nCount; row++) { + for (var col = 0; col < nCount; col++) { + if (oQRCode.isDark(row, col)) { + var child = makeSVG("use", {"x": String(row), "y": String(col)}); + child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template") + svg.appendChild(child); + } + } + } + }; + Drawing.prototype.clear = function () { + while (this._el.hasChildNodes()) + this._el.removeChild(this._el.lastChild); + }; + return Drawing; + })(); - /** - * @private - * @param {Number} nNumber - */ - Drawing.prototype.round = function (nNumber) { - if (!nNumber) { - return nNumber; - } - return Math.floor(nNumber * 1000) / 1000; - }; - return Drawing; - }(); + var useSVG = document.documentElement.tagName.toLowerCase() === "svg"; - /** - * Get the type by string length - * - * @private - * @param {String} sText - * @param {Number} nCorrectLevel - * @return {Number} type - */ - function _getTypeNumber(sText, nCorrectLevel) { - var nType = 1; - var length = _getUTF8Length(sText); - for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) { - var nLimit = 0; - switch (nCorrectLevel) { - case QRErrorCorrectLevel.L: - nLimit = QRCodeLimitLength[i][0]; - break; - case QRErrorCorrectLevel.M: - nLimit = QRCodeLimitLength[i][1]; - break; - case QRErrorCorrectLevel.Q: - nLimit = QRCodeLimitLength[i][2]; - break; - case QRErrorCorrectLevel.H: - nLimit = QRCodeLimitLength[i][3]; - break; - } - if (length <= nLimit) { - break; - } else { - nType++; - } - } - if (nType > QRCodeLimitLength.length) { - throw new Error("Too long data"); - } - return nType; - } - function _getUTF8Length(sText) { - var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a'); - return replacedText.length + (replacedText.length != sText ? 3 : 0); - } + // Drawing in DOM by using Table tag + var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () { + var Drawing = function (el, htOption) { + this._el = el; + this._htOption = htOption; + }; + + /** + * Draw the QRCode + * + * @param {QRCode} oQRCode + */ + Drawing.prototype.draw = function (oQRCode) { + var _htOption = this._htOption; + var _el = this._el; + var nCount = oQRCode.getModuleCount(); + var nWidth = Math.floor(_htOption.width / nCount); + var nHeight = Math.floor(_htOption.height / nCount); + var aHTML = ['']; + + for (var row = 0; row < nCount; row++) { + aHTML.push(''); + + for (var col = 0; col < nCount; col++) { + aHTML.push(''); + } + + aHTML.push(''); + } + + aHTML.push('
'); + _el.innerHTML = aHTML.join(''); + + // Fix the margin values as real size. + var elTable = _el.childNodes[0]; + var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2; + var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2; + + if (nLeftMarginTable > 0 && nTopMarginTable > 0) { + elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px"; + } + }; + + /** + * Clear the QRCode + */ + Drawing.prototype.clear = function () { + this._el.innerHTML = ''; + }; + + return Drawing; + })() : (function () { // Drawing in Canvas + function _onMakeImage() { + this._elImage.src = this._elCanvas.toDataURL("image/png"); + this._elImage.style.display = "block"; + this._elCanvas.style.display = "none"; + } + + // Android 2.1 bug workaround + // http://code.google.com/p/android/issues/detail?id=5141 + if (this._android && this._android <= 2.1) { + var factor = 1 / window.devicePixelRatio; + var drawImage = CanvasRenderingContext2D.prototype.drawImage; + CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) { + if (("nodeName" in image) && /img/i.test(image.nodeName)) { + for (var i = arguments.length - 1; i >= 1; i--) { + arguments[i] = arguments[i] * factor; + } + } else if (typeof dw == "undefined") { + arguments[1] *= factor; + arguments[2] *= factor; + arguments[3] *= factor; + arguments[4] *= factor; + } + + drawImage.apply(this, arguments); + }; + } + + /** + * Check whether the user's browser supports Data URI or not + * + * @private + * @param {Function} fSuccess Occurs if it supports Data URI + * @param {Function} fFail Occurs if it doesn't support Data URI + */ + function _safeSetDataURI(fSuccess, fFail) { + var self = this; + self._fFail = fFail; + self._fSuccess = fSuccess; - /** - * @class QRCode - * @constructor - * @example - * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie"); - * - * @example - * var oQRCode = new QRCode("test", { - * text : "http://naver.com", - * width : 128, - * height : 128 - * }); - * - * oQRCode.clear(); // Clear the QRCode. - * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode. - * - * @param {HTMLElement|String} el target element or 'id' attribute of element. - * @param {Object|String} vOption - * @param {String} vOption.text QRCode link data - * @param {Number} [vOption.width=256] - * @param {Number} [vOption.height=256] - * @param {String} [vOption.colorDark="#000000"] - * @param {String} [vOption.colorLight="#ffffff"] - * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H] - */ - QRCode = function QRCode(el, vOption) { - this._htOption = { - width: 256, - height: 256, - typeNumber: 4, - colorDark: "#000000", - colorLight: "#ffffff", - correctLevel: QRErrorCorrectLevel.H - }; - if (typeof vOption === 'string') { - vOption = { - text: vOption - }; - } + // Check it just once + if (self._bSupportDataURI === null) { + var el = document.createElement("img"); + var fOnError = function() { + self._bSupportDataURI = false; - // Overwrites options - if (vOption) { - for (var i in vOption) { - this._htOption[i] = vOption[i]; - } - } - if (typeof el == "string") { - el = document.getElementById(el); - } - if (this._htOption.useSVG) { - Drawing = svgDrawer; - } - this._android = _getAndroid(); - this._el = el; - this._oQRCode = null; - this._oDrawing = new Drawing(this._el, this._htOption); - if (this._htOption.text) { - this.makeCode(this._htOption.text); - } - }; + if (self._fFail) { + self._fFail.call(self); + } + }; + var fOnSuccess = function() { + self._bSupportDataURI = true; - /** - * Make the QRCode - * - * @param {String} sText link data - */ - QRCode.prototype.makeCode = function (sText) { - this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel); - this._oQRCode.addData(sText); - this._oQRCode.make(); - this._el.title = sText; - this._oDrawing.draw(this._oQRCode); - this.makeImage(); - }; + if (self._fSuccess) { + self._fSuccess.call(self); + } + }; + + el.onabort = fOnError; + el.onerror = fOnError; + el.onload = fOnSuccess; + el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data. + return; + } else if (self._bSupportDataURI === true && self._fSuccess) { + self._fSuccess.call(self); + } else if (self._bSupportDataURI === false && self._fFail) { + self._fFail.call(self); + } + }; + + /** + * Drawing QRCode by using canvas + * + * @constructor + * @param {HTMLElement} el + * @param {Object} htOption QRCode Options + */ + var Drawing = function (el, htOption) { + this._bIsPainted = false; + this._android = _getAndroid(); + + this._htOption = htOption; + this._elCanvas = document.createElement("canvas"); + this._elCanvas.width = htOption.width; + this._elCanvas.height = htOption.height; + el.appendChild(this._elCanvas); + this._el = el; + this._oContext = this._elCanvas.getContext("2d"); + this._bIsPainted = false; + this._elImage = document.createElement("img"); + this._elImage.alt = "Scan me!"; + this._elImage.style.display = "none"; + this._el.appendChild(this._elImage); + this._bSupportDataURI = null; + }; + + /** + * Draw the QRCode + * + * @param {QRCode} oQRCode + */ + Drawing.prototype.draw = function (oQRCode) { + var _elImage = this._elImage; + var _oContext = this._oContext; + var _htOption = this._htOption; + + var nCount = oQRCode.getModuleCount(); + var nWidth = _htOption.width / nCount; + var nHeight = _htOption.height / nCount; + var nRoundedWidth = Math.round(nWidth); + var nRoundedHeight = Math.round(nHeight); - /** - * Make the Image from Canvas element - * - It occurs automatically - * - Android below 3 doesn't support Data-URI spec. - * - * @private - */ - QRCode.prototype.makeImage = function () { - if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) { - this._oDrawing.makeImage(); - } - }; + _elImage.style.display = "none"; + this.clear(); + + for (var row = 0; row < nCount; row++) { + for (var col = 0; col < nCount; col++) { + var bIsDark = oQRCode.isDark(row, col); + var nLeft = col * nWidth; + var nTop = row * nHeight; + _oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; + _oContext.lineWidth = 1; + _oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; + _oContext.fillRect(nLeft, nTop, nWidth, nHeight); + + // 안티 앨리어싱 방지 처리 + _oContext.strokeRect( + Math.floor(nLeft) + 0.5, + Math.floor(nTop) + 0.5, + nRoundedWidth, + nRoundedHeight + ); + + _oContext.strokeRect( + Math.ceil(nLeft) - 0.5, + Math.ceil(nTop) - 0.5, + nRoundedWidth, + nRoundedHeight + ); + } + } + + this._bIsPainted = true; + }; + + /** + * Make the image from Canvas if the browser supports Data URI. + */ + Drawing.prototype.makeImage = function () { + if (this._bIsPainted) { + _safeSetDataURI.call(this, _onMakeImage); + } + }; + + /** + * Return whether the QRCode is painted or not + * + * @return {Boolean} + */ + Drawing.prototype.isPainted = function () { + return this._bIsPainted; + }; + + /** + * Clear the QRCode + */ + Drawing.prototype.clear = function () { + this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height); + this._bIsPainted = false; + }; + + /** + * @private + * @param {Number} nNumber + */ + Drawing.prototype.round = function (nNumber) { + if (!nNumber) { + return nNumber; + } + + return Math.floor(nNumber * 1000) / 1000; + }; + + return Drawing; + })(); + + /** + * Get the type by string length + * + * @private + * @param {String} sText + * @param {Number} nCorrectLevel + * @return {Number} type + */ + function _getTypeNumber(sText, nCorrectLevel) { + var nType = 1; + var length = _getUTF8Length(sText); + + for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) { + var nLimit = 0; + + switch (nCorrectLevel) { + case QRErrorCorrectLevel.L : + nLimit = QRCodeLimitLength[i][0]; + break; + case QRErrorCorrectLevel.M : + nLimit = QRCodeLimitLength[i][1]; + break; + case QRErrorCorrectLevel.Q : + nLimit = QRCodeLimitLength[i][2]; + break; + case QRErrorCorrectLevel.H : + nLimit = QRCodeLimitLength[i][3]; + break; + } + + if (length <= nLimit) { + break; + } else { + nType++; + } + } + + if (nType > QRCodeLimitLength.length) { + throw new Error("Too long data"); + } + + return nType; + } - /** - * Clear the QRCode - */ - QRCode.prototype.clear = function () { - this._oDrawing.clear(); - }; + function _getUTF8Length(sText) { + var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a'); + return replacedText.length + (replacedText.length != sText ? 3 : 0); + } + + /** + * @class QRCode + * @constructor + * @example + * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie"); + * + * @example + * var oQRCode = new QRCode("test", { + * text : "http://naver.com", + * width : 128, + * height : 128 + * }); + * + * oQRCode.clear(); // Clear the QRCode. + * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode. + * + * @param {HTMLElement|String} el target element or 'id' attribute of element. + * @param {Object|String} vOption + * @param {String} vOption.text QRCode link data + * @param {Number} [vOption.width=256] + * @param {Number} [vOption.height=256] + * @param {String} [vOption.colorDark="#000000"] + * @param {String} [vOption.colorLight="#ffffff"] + * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H] + */ + QRCode = function (el, vOption) { + this._htOption = { + width : 256, + height : 256, + typeNumber : 4, + colorDark : "#000000", + colorLight : "#ffffff", + correctLevel : QRErrorCorrectLevel.H + }; + + if (typeof vOption === 'string') { + vOption = { + text : vOption + }; + } + + // Overwrites options + if (vOption) { + for (var i in vOption) { + this._htOption[i] = vOption[i]; + } + } + + if (typeof el == "string") { + el = document.getElementById(el); + } - /** - * @name QRCode.CorrectLevel - */ - QRCode.CorrectLevel = QRErrorCorrectLevel; -})(); \ No newline at end of file + if (this._htOption.useSVG) { + Drawing = svgDrawer; + } + + this._android = _getAndroid(); + this._el = el; + this._oQRCode = null; + this._oDrawing = new Drawing(this._el, this._htOption); + + if (this._htOption.text) { + this.makeCode(this._htOption.text); + } + }; + + /** + * Make the QRCode + * + * @param {String} sText link data + */ + QRCode.prototype.makeCode = function (sText) { + this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel); + this._oQRCode.addData(sText); + this._oQRCode.make(); + this._el.title = sText; + this._oDrawing.draw(this._oQRCode); + this.makeImage(); + }; + + /** + * Make the Image from Canvas element + * - It occurs automatically + * - Android below 3 doesn't support Data-URI spec. + * + * @private + */ + QRCode.prototype.makeImage = function () { + if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) { + this._oDrawing.makeImage(); + } + }; + + /** + * Clear the QRCode + */ + QRCode.prototype.clear = function () { + this._oDrawing.clear(); + }; + + /** + * @name QRCode.CorrectLevel + */ + QRCode.CorrectLevel = QRErrorCorrectLevel; +})(); diff --git a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.map b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.map new file mode 100644 index 00000000000..0589c1032db --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["/**\r\n * @fileoverview\r\n * - Using the 'QRCode for Javascript library'\r\n * - Fixed dataset of 'QRCode for Javascript library' for support full-spec.\r\n * - this library has no dependencies.\r\n * \r\n * @author davidshimjs\r\n * @see http://www.d-project.com/\r\n * @see http://jeromeetienne.github.com/jquery-qrcode/\r\n */\r\nvar QRCode;\r\n\r\n(function () {\r\n\t//---------------------------------------------------------------------\r\n\t// QRCode for JavaScript\r\n\t//\r\n\t// Copyright (c) 2009 Kazuhiko Arase\r\n\t//\r\n\t// URL: http://www.d-project.com/\r\n\t//\r\n\t// Licensed under the MIT license:\r\n\t// http://www.opensource.org/licenses/mit-license.php\r\n\t//\r\n\t// The word \"QR Code\" is registered trademark of \r\n\t// DENSO WAVE INCORPORATED\r\n\t// http://www.denso-wave.com/qrcode/faqpatent-e.html\r\n\t//\r\n\t//---------------------------------------------------------------------\r\n\tfunction QR8bitByte(data) {\r\n\t\tthis.mode = QRMode.MODE_8BIT_BYTE;\r\n\t\tthis.data = data;\r\n\t\tthis.parsedData = [];\r\n\r\n\t\t// Added to support UTF-8 Characters\r\n\t\tfor (var i = 0, l = this.data.length; i < l; i++) {\r\n\t\t\tvar byteArray = [];\r\n\t\t\tvar code = this.data.charCodeAt(i);\r\n\r\n\t\t\tif (code > 0x10000) {\r\n\t\t\t\tbyteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18);\r\n\t\t\t\tbyteArray[1] = 0x80 | ((code & 0x3F000) >>> 12);\r\n\t\t\t\tbyteArray[2] = 0x80 | ((code & 0xFC0) >>> 6);\r\n\t\t\t\tbyteArray[3] = 0x80 | (code & 0x3F);\r\n\t\t\t} else if (code > 0x800) {\r\n\t\t\t\tbyteArray[0] = 0xE0 | ((code & 0xF000) >>> 12);\r\n\t\t\t\tbyteArray[1] = 0x80 | ((code & 0xFC0) >>> 6);\r\n\t\t\t\tbyteArray[2] = 0x80 | (code & 0x3F);\r\n\t\t\t} else if (code > 0x80) {\r\n\t\t\t\tbyteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6);\r\n\t\t\t\tbyteArray[1] = 0x80 | (code & 0x3F);\r\n\t\t\t} else {\r\n\t\t\t\tbyteArray[0] = code;\r\n\t\t\t}\r\n\r\n\t\t\tthis.parsedData.push(byteArray);\r\n\t\t}\r\n\r\n\t\tthis.parsedData = Array.prototype.concat.apply([], this.parsedData);\r\n\r\n\t\tif (this.parsedData.length != this.data.length) {\r\n\t\t\tthis.parsedData.unshift(191);\r\n\t\t\tthis.parsedData.unshift(187);\r\n\t\t\tthis.parsedData.unshift(239);\r\n\t\t}\r\n\t}\r\n\r\n\tQR8bitByte.prototype = {\r\n\t\tgetLength: function (buffer) {\r\n\t\t\treturn this.parsedData.length;\r\n\t\t},\r\n\t\twrite: function (buffer) {\r\n\t\t\tfor (var i = 0, l = this.parsedData.length; i < l; i++) {\r\n\t\t\t\tbuffer.put(this.parsedData[i], 8);\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\tfunction QRCodeModel(typeNumber, errorCorrectLevel) {\r\n\t\tthis.typeNumber = typeNumber;\r\n\t\tthis.errorCorrectLevel = errorCorrectLevel;\r\n\t\tthis.modules = null;\r\n\t\tthis.moduleCount = 0;\r\n\t\tthis.dataCache = null;\r\n\t\tthis.dataList = [];\r\n\t}\r\n\r\n\tQRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+\",\"+col);}\r\n\treturn this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row=7){this.setupTypeNumber(test);}\r\n\tif(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);}\r\n\tthis.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}}\r\n\treturn pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;}\r\n\tfor(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}}\r\n\tfor(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}}\r\n\tthis.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex>>bitIndex)&1)==1);}\r\n\tvar mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;}\r\n\tthis.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}}\r\n\trow+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;itotalDataCount*8){throw new Error(\"code length overflow. (\"\r\n\t+buffer.getLengthInBits()\r\n\t+\">\"\r\n\t+totalDataCount*8\r\n\t+\")\");}\r\n\tif(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);}\r\n\twhile(buffer.getLengthInBits()%8!=0){buffer.putBit(false);}\r\n\twhile(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;}\r\n\tbuffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;}\r\n\tbuffer.put(QRCodeModel.PAD1,8);}\r\n\treturn QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r=0)?modPoly.get(modIndex):0;}}\r\n\tvar totalCodeCount=0;for(var i=0;i=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));}\r\n\treturn((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));}\r\n\treturn(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;}\r\n\treturn digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error(\"bad maskPattern:\"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i5){lostPoint+=(3+sameCount-5);}}}\r\n\tfor(var row=0;row=256){n-=255;}\r\n\treturn QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);}\r\n\tif(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));}\r\n\tthis.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];\r\n\t\r\n\tfunction _isSupportCanvas() {\r\n\t\treturn typeof CanvasRenderingContext2D != \"undefined\";\r\n\t}\r\n\t\r\n\t// android 2.x doesn't support Data-URI spec\r\n\tfunction _getAndroid() {\r\n\t\tvar android = false;\r\n\t\tvar sAgent = navigator.userAgent;\r\n\t\t\r\n\t\tif (/android/i.test(sAgent)) { // android\r\n\t\t\tandroid = true;\r\n\t\t\tvar aMat = sAgent.toString().match(/android ([0-9]\\.[0-9])/i);\r\n\t\t\t\r\n\t\t\tif (aMat && aMat[1]) {\r\n\t\t\t\tandroid = parseFloat(aMat[1]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn android;\r\n\t}\r\n\t\r\n\tvar svgDrawer = (function() {\r\n\r\n\t\tvar Drawing = function (el, htOption) {\r\n\t\t\tthis._el = el;\r\n\t\t\tthis._htOption = htOption;\r\n\t\t};\r\n\r\n\t\tDrawing.prototype.draw = function (oQRCode) {\r\n\t\t\tvar _htOption = this._htOption;\r\n\t\t\tvar _el = this._el;\r\n\t\t\tvar nCount = oQRCode.getModuleCount();\r\n\t\t\tvar nWidth = Math.floor(_htOption.width / nCount);\r\n\t\t\tvar nHeight = Math.floor(_htOption.height / nCount);\r\n\r\n\t\t\tthis.clear();\r\n\r\n\t\t\tfunction makeSVG(tag, attrs) {\r\n\t\t\t\tvar el = document.createElementNS('http://www.w3.org/2000/svg', tag);\r\n\t\t\t\tfor (var k in attrs)\r\n\t\t\t\t\tif (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]);\r\n\t\t\t\treturn el;\r\n\t\t\t}\r\n\r\n\t\t\tvar svg = makeSVG(\"svg\" , {'viewBox': '0 0 ' + String(nCount) + \" \" + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight});\r\n\t\t\tsvg.setAttributeNS(\"http://www.w3.org/2000/xmlns/\", \"xmlns:xlink\", \"http://www.w3.org/1999/xlink\");\r\n\t\t\t_el.appendChild(svg);\r\n\r\n\t\t\tsvg.appendChild(makeSVG(\"rect\", {\"fill\": _htOption.colorLight, \"width\": \"100%\", \"height\": \"100%\"}));\r\n\t\t\tsvg.appendChild(makeSVG(\"rect\", {\"fill\": _htOption.colorDark, \"width\": \"1\", \"height\": \"1\", \"id\": \"template\"}));\r\n\r\n\t\t\tfor (var row = 0; row < nCount; row++) {\r\n\t\t\t\tfor (var col = 0; col < nCount; col++) {\r\n\t\t\t\t\tif (oQRCode.isDark(row, col)) {\r\n\t\t\t\t\t\tvar child = makeSVG(\"use\", {\"x\": String(row), \"y\": String(col)});\r\n\t\t\t\t\t\tchild.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"href\", \"#template\")\r\n\t\t\t\t\t\tsvg.appendChild(child);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tDrawing.prototype.clear = function () {\r\n\t\t\twhile (this._el.hasChildNodes())\r\n\t\t\t\tthis._el.removeChild(this._el.lastChild);\r\n\t\t};\r\n\t\treturn Drawing;\r\n\t})();\r\n\r\n\tvar useSVG = document.documentElement.tagName.toLowerCase() === \"svg\";\r\n\r\n\t// Drawing in DOM by using Table tag\r\n\tvar Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () {\r\n\t\tvar Drawing = function (el, htOption) {\r\n\t\t\tthis._el = el;\r\n\t\t\tthis._htOption = htOption;\r\n\t\t};\r\n\t\t\t\r\n\t\t/**\r\n\t\t * Draw the QRCode\r\n\t\t * \r\n\t\t * @param {QRCode} oQRCode\r\n\t\t */\r\n\t\tDrawing.prototype.draw = function (oQRCode) {\r\n var _htOption = this._htOption;\r\n var _el = this._el;\r\n\t\t\tvar nCount = oQRCode.getModuleCount();\r\n\t\t\tvar nWidth = Math.floor(_htOption.width / nCount);\r\n\t\t\tvar nHeight = Math.floor(_htOption.height / nCount);\r\n\t\t\tvar aHTML = [''];\r\n\t\t\t\r\n\t\t\tfor (var row = 0; row < nCount; row++) {\r\n\t\t\t\taHTML.push('');\r\n\t\t\t\t\r\n\t\t\t\tfor (var col = 0; col < nCount; col++) {\r\n\t\t\t\t\taHTML.push('');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\taHTML.push('');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\taHTML.push('
');\r\n\t\t\t_el.innerHTML = aHTML.join('');\r\n\t\t\t\r\n\t\t\t// Fix the margin values as real size.\r\n\t\t\tvar elTable = _el.childNodes[0];\r\n\t\t\tvar nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2;\r\n\t\t\tvar nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2;\r\n\t\t\t\r\n\t\t\tif (nLeftMarginTable > 0 && nTopMarginTable > 0) {\r\n\t\t\t\telTable.style.margin = nTopMarginTable + \"px \" + nLeftMarginTable + \"px\";\t\r\n\t\t\t}\r\n\t\t};\r\n\t\t\r\n\t\t/**\r\n\t\t * Clear the QRCode\r\n\t\t */\r\n\t\tDrawing.prototype.clear = function () {\r\n\t\t\tthis._el.innerHTML = '';\r\n\t\t};\r\n\t\t\r\n\t\treturn Drawing;\r\n\t})() : (function () { // Drawing in Canvas\r\n\t\tfunction _onMakeImage() {\r\n\t\t\tthis._elImage.src = this._elCanvas.toDataURL(\"image/png\");\r\n\t\t\tthis._elImage.style.display = \"block\";\r\n\t\t\tthis._elCanvas.style.display = \"none\";\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Android 2.1 bug workaround\r\n\t\t// http://code.google.com/p/android/issues/detail?id=5141\r\n\t\tif (this._android && this._android <= 2.1) {\r\n\t \tvar factor = 1 / window.devicePixelRatio;\r\n\t var drawImage = CanvasRenderingContext2D.prototype.drawImage; \r\n\t \tCanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) {\r\n\t \t\tif ((\"nodeName\" in image) && /img/i.test(image.nodeName)) {\r\n\t\t \tfor (var i = arguments.length - 1; i >= 1; i--) {\r\n\t\t \targuments[i] = arguments[i] * factor;\r\n\t\t \t}\r\n\t \t\t} else if (typeof dw == \"undefined\") {\r\n\t \t\t\targuments[1] *= factor;\r\n\t \t\t\targuments[2] *= factor;\r\n\t \t\t\targuments[3] *= factor;\r\n\t \t\t\targuments[4] *= factor;\r\n\t \t\t}\r\n\t \t\t\r\n\t \tdrawImage.apply(this, arguments); \r\n\t \t};\r\n\t\t}\r\n\t\t\r\n\t\t/**\r\n\t\t * Check whether the user's browser supports Data URI or not\r\n\t\t * \r\n\t\t * @private\r\n\t\t * @param {Function} fSuccess Occurs if it supports Data URI\r\n\t\t * @param {Function} fFail Occurs if it doesn't support Data URI\r\n\t\t */\r\n\t\tfunction _safeSetDataURI(fSuccess, fFail) {\r\n var self = this;\r\n self._fFail = fFail;\r\n self._fSuccess = fSuccess;\r\n\r\n // Check it just once\r\n if (self._bSupportDataURI === null) {\r\n var el = document.createElement(\"img\");\r\n var fOnError = function() {\r\n self._bSupportDataURI = false;\r\n\r\n if (self._fFail) {\r\n self._fFail.call(self);\r\n }\r\n };\r\n var fOnSuccess = function() {\r\n self._bSupportDataURI = true;\r\n\r\n if (self._fSuccess) {\r\n self._fSuccess.call(self);\r\n }\r\n };\r\n\r\n el.onabort = fOnError;\r\n el.onerror = fOnError;\r\n el.onload = fOnSuccess;\r\n el.src = \"data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==\"; // the Image contains 1px data.\r\n return;\r\n } else if (self._bSupportDataURI === true && self._fSuccess) {\r\n self._fSuccess.call(self);\r\n } else if (self._bSupportDataURI === false && self._fFail) {\r\n self._fFail.call(self);\r\n }\r\n\t\t};\r\n\t\t\r\n\t\t/**\r\n\t\t * Drawing QRCode by using canvas\r\n\t\t * \r\n\t\t * @constructor\r\n\t\t * @param {HTMLElement} el\r\n\t\t * @param {Object} htOption QRCode Options \r\n\t\t */\r\n\t\tvar Drawing = function (el, htOption) {\r\n \t\tthis._bIsPainted = false;\r\n \t\tthis._android = _getAndroid();\r\n\t\t\r\n\t\t\tthis._htOption = htOption;\r\n\t\t\tthis._elCanvas = document.createElement(\"canvas\");\r\n\t\t\tthis._elCanvas.width = htOption.width;\r\n\t\t\tthis._elCanvas.height = htOption.height;\r\n\t\t\tel.appendChild(this._elCanvas);\r\n\t\t\tthis._el = el;\r\n\t\t\tthis._oContext = this._elCanvas.getContext(\"2d\");\r\n\t\t\tthis._bIsPainted = false;\r\n\t\t\tthis._elImage = document.createElement(\"img\");\r\n\t\t\tthis._elImage.alt = \"Scan me!\";\r\n\t\t\tthis._elImage.style.display = \"none\";\r\n\t\t\tthis._el.appendChild(this._elImage);\r\n\t\t\tthis._bSupportDataURI = null;\r\n\t\t};\r\n\t\t\t\r\n\t\t/**\r\n\t\t * Draw the QRCode\r\n\t\t * \r\n\t\t * @param {QRCode} oQRCode \r\n\t\t */\r\n\t\tDrawing.prototype.draw = function (oQRCode) {\r\n var _elImage = this._elImage;\r\n var _oContext = this._oContext;\r\n var _htOption = this._htOption;\r\n \r\n\t\t\tvar nCount = oQRCode.getModuleCount();\r\n\t\t\tvar nWidth = _htOption.width / nCount;\r\n\t\t\tvar nHeight = _htOption.height / nCount;\r\n\t\t\tvar nRoundedWidth = Math.round(nWidth);\r\n\t\t\tvar nRoundedHeight = Math.round(nHeight);\r\n\r\n\t\t\t_elImage.style.display = \"none\";\r\n\t\t\tthis.clear();\r\n\t\t\t\r\n\t\t\tfor (var row = 0; row < nCount; row++) {\r\n\t\t\t\tfor (var col = 0; col < nCount; col++) {\r\n\t\t\t\t\tvar bIsDark = oQRCode.isDark(row, col);\r\n\t\t\t\t\tvar nLeft = col * nWidth;\r\n\t\t\t\t\tvar nTop = row * nHeight;\r\n\t\t\t\t\t_oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;\r\n\t\t\t\t\t_oContext.lineWidth = 1;\r\n\t\t\t\t\t_oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight;\t\t\t\t\t\r\n\t\t\t\t\t_oContext.fillRect(nLeft, nTop, nWidth, nHeight);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// 안티 앨리어싱 방지 처리\r\n\t\t\t\t\t_oContext.strokeRect(\r\n\t\t\t\t\t\tMath.floor(nLeft) + 0.5,\r\n\t\t\t\t\t\tMath.floor(nTop) + 0.5,\r\n\t\t\t\t\t\tnRoundedWidth,\r\n\t\t\t\t\t\tnRoundedHeight\r\n\t\t\t\t\t);\r\n\t\t\t\t\t\r\n\t\t\t\t\t_oContext.strokeRect(\r\n\t\t\t\t\t\tMath.ceil(nLeft) - 0.5,\r\n\t\t\t\t\t\tMath.ceil(nTop) - 0.5,\r\n\t\t\t\t\t\tnRoundedWidth,\r\n\t\t\t\t\t\tnRoundedHeight\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._bIsPainted = true;\r\n\t\t};\r\n\t\t\t\r\n\t\t/**\r\n\t\t * Make the image from Canvas if the browser supports Data URI.\r\n\t\t */\r\n\t\tDrawing.prototype.makeImage = function () {\r\n\t\t\tif (this._bIsPainted) {\r\n\t\t\t\t_safeSetDataURI.call(this, _onMakeImage);\r\n\t\t\t}\r\n\t\t};\r\n\t\t\t\r\n\t\t/**\r\n\t\t * Return whether the QRCode is painted or not\r\n\t\t * \r\n\t\t * @return {Boolean}\r\n\t\t */\r\n\t\tDrawing.prototype.isPainted = function () {\r\n\t\t\treturn this._bIsPainted;\r\n\t\t};\r\n\t\t\r\n\t\t/**\r\n\t\t * Clear the QRCode\r\n\t\t */\r\n\t\tDrawing.prototype.clear = function () {\r\n\t\t\tthis._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height);\r\n\t\t\tthis._bIsPainted = false;\r\n\t\t};\r\n\t\t\r\n\t\t/**\r\n\t\t * @private\r\n\t\t * @param {Number} nNumber\r\n\t\t */\r\n\t\tDrawing.prototype.round = function (nNumber) {\r\n\t\t\tif (!nNumber) {\r\n\t\t\t\treturn nNumber;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn Math.floor(nNumber * 1000) / 1000;\r\n\t\t};\r\n\t\t\r\n\t\treturn Drawing;\r\n\t})();\r\n\t\r\n\t/**\r\n\t * Get the type by string length\r\n\t * \r\n\t * @private\r\n\t * @param {String} sText\r\n\t * @param {Number} nCorrectLevel\r\n\t * @return {Number} type\r\n\t */\r\n\tfunction _getTypeNumber(sText, nCorrectLevel) {\t\t\t\r\n\t\tvar nType = 1;\r\n\t\tvar length = _getUTF8Length(sText);\r\n\t\t\r\n\t\tfor (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) {\r\n\t\t\tvar nLimit = 0;\r\n\t\t\t\r\n\t\t\tswitch (nCorrectLevel) {\r\n\t\t\t\tcase QRErrorCorrectLevel.L :\r\n\t\t\t\t\tnLimit = QRCodeLimitLength[i][0];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase QRErrorCorrectLevel.M :\r\n\t\t\t\t\tnLimit = QRCodeLimitLength[i][1];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase QRErrorCorrectLevel.Q :\r\n\t\t\t\t\tnLimit = QRCodeLimitLength[i][2];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase QRErrorCorrectLevel.H :\r\n\t\t\t\t\tnLimit = QRCodeLimitLength[i][3];\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (length <= nLimit) {\r\n\t\t\t\tbreak;\r\n\t\t\t} else {\r\n\t\t\t\tnType++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (nType > QRCodeLimitLength.length) {\r\n\t\t\tthrow new Error(\"Too long data\");\r\n\t\t}\r\n\t\t\r\n\t\treturn nType;\r\n\t}\r\n\r\n\tfunction _getUTF8Length(sText) {\r\n\t\tvar replacedText = encodeURI(sText).toString().replace(/\\%[0-9a-fA-F]{2}/g, 'a');\r\n\t\treturn replacedText.length + (replacedText.length != sText ? 3 : 0);\r\n\t}\r\n\t\r\n\t/**\r\n\t * @class QRCode\r\n\t * @constructor\r\n\t * @example \r\n\t * new QRCode(document.getElementById(\"test\"), \"http://jindo.dev.naver.com/collie\");\r\n\t *\r\n\t * @example\r\n\t * var oQRCode = new QRCode(\"test\", {\r\n\t * text : \"http://naver.com\",\r\n\t * width : 128,\r\n\t * height : 128\r\n\t * });\r\n\t * \r\n\t * oQRCode.clear(); // Clear the QRCode.\r\n\t * oQRCode.makeCode(\"http://map.naver.com\"); // Re-create the QRCode.\r\n\t *\r\n\t * @param {HTMLElement|String} el target element or 'id' attribute of element.\r\n\t * @param {Object|String} vOption\r\n\t * @param {String} vOption.text QRCode link data\r\n\t * @param {Number} [vOption.width=256]\r\n\t * @param {Number} [vOption.height=256]\r\n\t * @param {String} [vOption.colorDark=\"#000000\"]\r\n\t * @param {String} [vOption.colorLight=\"#ffffff\"]\r\n\t * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H] \r\n\t */\r\n\tQRCode = function (el, vOption) {\r\n\t\tthis._htOption = {\r\n\t\t\twidth : 256, \r\n\t\t\theight : 256,\r\n\t\t\ttypeNumber : 4,\r\n\t\t\tcolorDark : \"#000000\",\r\n\t\t\tcolorLight : \"#ffffff\",\r\n\t\t\tcorrectLevel : QRErrorCorrectLevel.H\r\n\t\t};\r\n\t\t\r\n\t\tif (typeof vOption === 'string') {\r\n\t\t\tvOption\t= {\r\n\t\t\t\ttext : vOption\r\n\t\t\t};\r\n\t\t}\r\n\t\t\r\n\t\t// Overwrites options\r\n\t\tif (vOption) {\r\n\t\t\tfor (var i in vOption) {\r\n\t\t\t\tthis._htOption[i] = vOption[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (typeof el == \"string\") {\r\n\t\t\tel = document.getElementById(el);\r\n\t\t}\r\n\r\n\t\tif (this._htOption.useSVG) {\r\n\t\t\tDrawing = svgDrawer;\r\n\t\t}\r\n\t\t\r\n\t\tthis._android = _getAndroid();\r\n\t\tthis._el = el;\r\n\t\tthis._oQRCode = null;\r\n\t\tthis._oDrawing = new Drawing(this._el, this._htOption);\r\n\t\t\r\n\t\tif (this._htOption.text) {\r\n\t\t\tthis.makeCode(this._htOption.text);\t\r\n\t\t}\r\n\t};\r\n\t\r\n\t/**\r\n\t * Make the QRCode\r\n\t * \r\n\t * @param {String} sText link data\r\n\t */\r\n\tQRCode.prototype.makeCode = function (sText) {\r\n\t\tthis._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel);\r\n\t\tthis._oQRCode.addData(sText);\r\n\t\tthis._oQRCode.make();\r\n\t\tthis._el.title = sText;\r\n\t\tthis._oDrawing.draw(this._oQRCode);\t\t\t\r\n\t\tthis.makeImage();\r\n\t};\r\n\t\r\n\t/**\r\n\t * Make the Image from Canvas element\r\n\t * - It occurs automatically\r\n\t * - Android below 3 doesn't support Data-URI spec.\r\n\t * \r\n\t * @private\r\n\t */\r\n\tQRCode.prototype.makeImage = function () {\r\n\t\tif (typeof this._oDrawing.makeImage == \"function\" && (!this._android || this._android >= 3)) {\r\n\t\t\tthis._oDrawing.makeImage();\r\n\t\t}\r\n\t};\r\n\t\r\n\t/**\r\n\t * Clear the QRCode\r\n\t */\r\n\tQRCode.prototype.clear = function () {\r\n\t\tthis._oDrawing.clear();\r\n\t};\r\n\t\r\n\t/**\r\n\t * @name QRCode.CorrectLevel\r\n\t */\r\n\tQRCode.CorrectLevel = QRErrorCorrectLevel;\r\n})();\r\n"],"names":["QRCode","QR8bitByte","data","mode","QRMode","MODE_8BIT_BYTE","parsedData","i","l","length","byteArray","code","charCodeAt","push","Array","prototype","concat","apply","unshift","QRCodeModel","typeNumber","errorCorrectLevel","modules","moduleCount","dataCache","dataList","getLength","buffer","write","put","addData","newData","isDark","row","col","Error","getModuleCount","make","makeImpl","getBestMaskPattern","test","maskPattern","setupPositionProbePattern","setupPositionAdjustPattern","setupTimingPattern","setupTypeInfo","setupTypeNumber","createData","mapData","r","c","minLostPoint","pattern","lostPoint","QRUtil","getLostPoint","createMovieClip","target_mc","instance_name","depth","qr_mc","createEmptyMovieClip","y","x","beginFill","moveTo","lineTo","endFill","pos","getPatternPosition","j","bits","getBCHTypeNumber","mod","Math","floor","getBCHTypeInfo","inc","bitIndex","byteIndex","dark","getMask","PAD0","PAD1","rsBlocks","QRRSBlock","getRSBlocks","QRBitBuffer","getLengthInBits","totalDataCount","dataCount","putBit","createBytes","offset","maxDcCount","maxEcCount","dcdata","ecdata","dcCount","ecCount","totalCount","max","rsPoly","getErrorCorrectPolynomial","modPoly","rawPoly","QRPolynomial","modIndex","get","totalCodeCount","index","Drawing","MODE_NUMBER","MODE_ALPHA_NUM","MODE_KANJI","QRErrorCorrectLevel","L","M","Q","H","QRMaskPattern","PATTERN000","PATTERN001","PATTERN010","PATTERN011","PATTERN100","PATTERN101","PATTERN110","PATTERN111","PATTERN_POSITION_TABLE","G15","G18","G15_MASK","d","getBCHDigit","digit","errorCorrectLength","a","multiply","QRMath","gexp","type","qrCode","sameCount","count","darkCount","ratio","abs","glog","n","LOG_TABLE","EXP_TABLE","num","shift","undefined","e","RS_BLOCK_TABLE","rsBlock","getRsBlockTable","list","bit","bufIndex","QRCodeLimitLength","_getAndroid","android","sAgent","navigator","userAgent","aMat","toString","match","parseFloat","svgDrawer","el","htOption","_el","_htOption","draw","oQRCode","nCount","makeSVG","tag","attrs","document","createElementNS","k","hasOwnProperty","setAttribute","width","height","clear","svg","String","colorLight","setAttributeNS","appendChild","colorDark","child","hasChildNodes","removeChild","lastChild","useSVG","documentElement","tagName","toLowerCase","CanvasRenderingContext2D","_onMakeImage","_elImage","src","_elCanvas","toDataURL","style","display","_android","factor","window","devicePixelRatio","drawImage","image","sx","sy","sw","sh","dx","dy","dw","dh","nodeName","arguments","_safeSetDataURI","fSuccess","fFail","self","_fFail","_fSuccess","_bSupportDataURI","createElement","fOnError","call","onabort","onerror","onload","_bIsPainted","_oContext","getContext","alt","nWidth","nHeight","nRoundedWidth","round","nRoundedHeight","bIsDark","nLeft","nTop","strokeStyle","lineWidth","fillStyle","fillRect","strokeRect","ceil","makeImage","isPainted","clearRect","nNumber","aHTML","innerHTML","join","elTable","childNodes","nLeftMarginTable","offsetWidth","nTopMarginTable","offsetHeight","margin","vOption","correctLevel","text","getElementById","_oQRCode","_oDrawing","makeCode","sText","_getTypeNumber","nCorrectLevel","replacedText","nType","encodeURI","replace","len","nLimit","title","CorrectLevel"],"mappings":"AAUA,IAAIA,QAEJ,AAAC,WAgBA,SAAS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OAAQN,GACP,KAAKxK,EAAoBC,CAAC,CACzB6K,EAAS/H,CAAiB,CAAC3J,EAAE,CAAC,EAAE,CAChC,KACD,MAAK4G,EAAoBE,CAAC,CACzB4K,EAAS/H,CAAiB,CAAC3J,EAAE,CAAC,EAAE,CAChC,KACD,MAAK4G,EAAoBG,CAAC,CACzB2K,EAAS/H,CAAiB,CAAC3J,EAAE,CAAC,EAAE,CAChC,KACD,MAAK4G,EAAoBI,CAAC,CACzB0K,EAAS/H,CAAiB,CAAC3J,EAAE,CAAC,EAAE,AAElC,CAEA,GAAIE,GAAUwR,EACb,KAEAJ,CAAAA,GAEF,CAEA,GAAIA,EAAQ3H,EAAkBzJ,MAAM,CACnC,MAAM,AAAI0B,MAAM,iBAGjB,OAAO0P,CACR,EA+EgDJ,EAAO,IAAI,CAACzG,SAAS,CAACmG,YAAY,EAAG,IAAI,CAACnG,SAAS,CAACmG,YAAY,EAC/G,IAAI,CAACG,QAAQ,CAACxP,OAAO,CAAC2P,GACtB,IAAI,CAACH,QAAQ,CAACjP,IAAI,GAClB,IAAI,CAAC0I,GAAG,CAACmH,KAAK,CAAGT,EACjB,IAAI,CAACF,SAAS,CAACtG,IAAI,CAAC,IAAI,CAACqG,QAAQ,EACjC,IAAI,CAAClB,SAAS,EACf,EASApQ,OAAOe,SAAS,CAACqP,SAAS,CAAG,WACW,YAAnC,OAAO,IAAI,CAACmB,SAAS,CAACnB,SAAS,EAAmB,CAAA,CAAC,IAAI,CAAC/C,QAAQ,EAAI,IAAI,CAACA,QAAQ,EAAI,CAAA,GACxF,IAAI,CAACkE,SAAS,CAACnB,SAAS,EAE1B,EAKApQ,OAAOe,SAAS,CAAC+K,KAAK,CAAG,WACxB,IAAI,CAACyF,SAAS,CAACzF,KAAK,EACrB,EAKA9L,OAAOmS,YAAY,CAAGhL,CACvB"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.min.js b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.min.js index 8c346770a2b..f4bf29c297d 100644 --- a/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Users/wwwroot/Scripts/qrcode.min.js @@ -1 +1 @@ -var QRCode;!function(){function t(t){this.mode=r.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,o=this.data.length;e65536?(i[0]=240|(1835008&n)>>>18,i[1]=128|(258048&n)>>>12,i[2]=128|(4032&n)>>>6,i[3]=128|63&n):n>2048?(i[0]=224|(61440&n)>>>12,i[1]=128|(4032&n)>>>6,i[2]=128|63&n):n>128?(i[0]=192|(1984&n)>>>6,i[1]=128|63&n):i[0]=n,this.parsedData.push(i)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function e(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}t.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,r)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var o=-1;o<=7;o++)e+o<=-1||this.moduleCount<=e+o||(this.modules[t+r][e+o]=0<=r&&r<=6&&(0==o||6==o)||0<=o&&o<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=o&&o<=4)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var o=f.getLostPoint(this);(0==r||t>o)&&(t=o,e=r)}return e},createMovieClip:function(t,e,r){var o=t.createEmptyMovieClip(e,r);this.make();for(var i=0;i>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=o}for(r=0;r<18;r++){o=!t&&1==(e>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=o}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,o=f.getBCHTypeInfo(r),i=0;i<15;i++){var n=!t&&1==(o>>i&1);i<6?this.modules[i][8]=n:i<8?this.modules[i+1][8]=n:this.modules[this.moduleCount-15+i][8]=n}for(i=0;i<15;i++){n=!t&&1==(o>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=n:i<9?this.modules[8][15-i-1+1]=n:this.modules[8][15-i-1]=n}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,o=this.moduleCount-1,i=7,n=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[o][a-s]){var h=!1;n>>i&1)),f.getMask(e,o,a-s)&&(h=!h),this.modules[o][a-s]=h,-1==--i&&(n++,i=7)}if((o+=r)<0||this.moduleCount<=o){o-=r,r=-r;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(t,r,o){for(var i=m.getRSBlocks(t,r),n=new _,a=0;a8*h)throw new Error("code length overflow. ("+n.getLengthInBits()+">"+8*h+")");for(n.getLengthInBits()+4<=8*h&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(!1);for(;!(n.getLengthInBits()>=8*h||(n.put(e.PAD0,8),n.getLengthInBits()>=8*h));)n.put(e.PAD1,8);return e.createBytes(n,i)},e.createBytes=function(t,e){for(var r=0,o=0,i=0,n=new Array(e.length),a=new Array(e.length),s=0;s=0?d.get(c):0}}var m=0;for(u=0;u=0;)e^=f.G15<=0;)e^=f.G18<>>=1;return e},getPatternPosition:function(t){return f.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case i:return(e+r)%2==0;case n:return e%2==0;case a:return r%3==0;case s:return(e+r)%3==0;case h:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case l:return e*r%2+e*r%3==0;case u:return(e*r%2+e*r%3)%2==0;case g:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new p([1],0),r=0;r5&&(r+=3+n-5)}for(o=0;o=256;)t-=255;return d.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},c=0;c<8;c++)d.EXP_TABLE[c]=1<>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var v=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function C(){var t=!1,e=navigator.userAgent;if(/android/i.test(e)){t=!0;var r=e.toString().match(/android ([0-9]\.[0-9])/i);r&&r[1]&&(t=parseFloat(r[1]))}return t}var w=function(){var t=function(t,e){this._el=t,this._htOption=e};return t.prototype.draw=function(t){var e=this._htOption,r=this._el,o=t.getModuleCount();Math.floor(e.width/o),Math.floor(e.height/o);function i(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg",t);for(var o in e)e.hasOwnProperty(o)&&r.setAttribute(o,e[o]);return r}this.clear();var n=i("svg",{viewBox:"0 0 "+String(o)+" "+String(o),width:"100%",height:"100%",fill:e.colorLight});n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),r.appendChild(n),n.appendChild(i("rect",{fill:e.colorLight,width:"100%",height:"100%"})),n.appendChild(i("rect",{fill:e.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a'],s=0;s");for(var h=0;h');a.push("")}a.push(""),r.innerHTML=a.join("");var l=r.childNodes[0],u=(e.width-l.offsetWidth)/2,g=(e.height-l.offsetHeight)/2;u>0&&g>0&&(l.style.margin=g+"px "+u+"px")},t.prototype.clear=function(){this._el.innerHTML=""},t}():function(){function t(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}if(this._android&&this._android<=2.1){var e=1/window.devicePixelRatio,r=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(t,o,i,n,a,s,h,l,u){if("nodeName"in t&&/img/i.test(t.nodeName))for(var g=arguments.length-1;g>=1;g--)arguments[g]=arguments[g]*e;else void 0===l&&(arguments[1]*=e,arguments[2]*=e,arguments[3]*=e,arguments[4]*=e);r.apply(this,arguments)}}function o(t,e){var r=this;if(r._fFail=e,r._fSuccess=t,null===r._bSupportDataURI){var o=document.createElement("img"),i=function(){r._bSupportDataURI=!1,r._fFail&&r._fFail.call(r)};return o.onabort=i,o.onerror=i,o.onload=function(){r._bSupportDataURI=!0,r._fSuccess&&r._fSuccess.call(r)},void(o.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==")}!0===r._bSupportDataURI&&r._fSuccess?r._fSuccess.call(r):!1===r._bSupportDataURI&&r._fFail&&r._fFail.call(r)}var i=function(t,e){this._bIsPainted=!1,this._android=C(),this._htOption=e,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=e.width,this._elCanvas.height=e.height,t.appendChild(this._elCanvas),this._el=t,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return i.prototype.draw=function(t){var e=this._elImage,r=this._oContext,o=this._htOption,i=t.getModuleCount(),n=o.width/i,a=o.height/i,s=Math.round(n),h=Math.round(a);e.style.display="none",this.clear();for(var l=0;lv.length)throw new Error("Too long data");return r}QRCode=function(t,e){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:o.H},"string"==typeof e&&(e={text:e}),e)for(var r in e)this._htOption[r]=e[r];"string"==typeof t&&(t=document.getElementById(t)),this._htOption.useSVG&&(D=w),this._android=C(),this._el=t,this._oQRCode=null,this._oDrawing=new D(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},QRCode.prototype.makeCode=function(t){this._oQRCode=new e(A(t,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(t),this._oQRCode.make(),this._el.title=t,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=o}(); +var QRCode;!function(){function t(t){this.mode=i.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e65536?(o[0]=240|(1835008&n)>>>18,o[1]=128|(258048&n)>>>12,o[2]=128|(4032&n)>>>6,o[3]=128|63&n):n>2048?(o[0]=224|(61440&n)>>>12,o[1]=128|(4032&n)>>>6,o[2]=128|63&n):n>128?(o[0]=192|(1984&n)>>>6,o[1]=128|63&n):o[0]=n,this.parsedData.push(o)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function e(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}t.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,r)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1)&&!(this.moduleCount<=t+r))for(var o=-1;o<=7;o++)e+o<=-1||this.moduleCount<=e+o||(0<=r&&r<=6&&(0==o||6==o)||0<=o&&o<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=o&&o<=4?this.modules[t+r][e+o]=!0:this.modules[t+r][e+o]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var o=s.getLostPoint(this);(0==r||t>o)&&(t=o,e=r)}return e},createMovieClip:function(t,e,r){var o=t.createEmptyMovieClip(e,r);this.make();for(var i=0;i>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=o}for(var r=0;r<18;r++){var o=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=o}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,o=s.getBCHTypeInfo(r),i=0;i<15;i++){var n=!t&&(o>>i&1)==1;i<6?this.modules[i][8]=n:i<8?this.modules[i+1][8]=n:this.modules[this.moduleCount-15+i][8]=n}for(var i=0;i<15;i++){var n=!t&&(o>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=n:i<9?this.modules[8][15-i-1+1]=n:this.modules[8][15-i-1]=n}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,o=this.moduleCount-1,i=7,n=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var h=0;h<2;h++)if(null==this.modules[o][a-h]){var l=!1;n>>i&1)==1),s.getMask(e,o,a-h)&&(l=!l),this.modules[o][a-h]=l,-1==--i&&(n++,i=7)}if((o+=r)<0||this.moduleCount<=o){o-=r,r=-r;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(t,r,o){for(var i=g.getRSBlocks(t,r),n=new f,a=0;a8*l)throw Error("code length overflow. ("+n.getLengthInBits()+">"+8*l+")");for(n.getLengthInBits()+4<=8*l&&n.put(0,4);n.getLengthInBits()%8!=0;)n.putBit(!1);for(;!(n.getLengthInBits()>=8*l)&&(n.put(e.PAD0,8),!(n.getLengthInBits()>=8*l));)n.put(e.PAD1,8);return e.createBytes(n,i)},e.createBytes=function(t,e){for(var r=0,o=0,i=0,n=Array(e.length),a=Array(e.length),h=0;h=0?c.get(p):0}}for(var m=0,f=0;f=0;)e^=s.G15<=0;)e^=s.G18<>>=1;return e},getPatternPosition:function(t){return s.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case a.PATTERN000:return(e+r)%2==0;case a.PATTERN001:return e%2==0;case a.PATTERN010:return r%3==0;case a.PATTERN011:return(e+r)%3==0;case a.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case a.PATTERN101:return e*r%2+e*r%3==0;case a.PATTERN110:return(e*r%2+e*r%3)%2==0;case a.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new u([1],0),r=0;r5&&(r+=3+n-5)}for(var o=0;o=256;)t-=255;return h.EXP_TABLE[t]},EXP_TABLE:Array(256),LOG_TABLE:Array(256)},l=0;l<8;l++)h.EXP_TABLE[l]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var d=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function c(){var t=!1,e=navigator.userAgent;if(/android/i.test(e)){t=!0;var r=e.toString().match(/android ([0-9]\.[0-9])/i);r&&r[1]&&(t=parseFloat(r[1]))}return t}var p=((r=function(t,e){this._el=t,this._htOption=e}).prototype.draw=function(t){var e=this._htOption,r=this._el,o=t.getModuleCount();function i(t,e){var r=document.createElementNS("http://www.w3.org/2000/svg",t);for(var o in e)e.hasOwnProperty(o)&&r.setAttribute(o,e[o]);return r}e.width,e.height,this.clear();var n=i("svg",{viewBox:"0 0 "+String(o)+" "+String(o),width:"100%",height:"100%",fill:e.colorLight});n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),r.appendChild(n),n.appendChild(i("rect",{fill:e.colorLight,width:"100%",height:"100%"})),n.appendChild(i("rect",{fill:e.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a=1;g--)arguments[g]=arguments[g]*e;else void 0===l&&(arguments[1]*=e,arguments[2]*=e,arguments[3]*=e,arguments[4]*=e);r.apply(this,arguments)}}function o(t,e){var r=this;if(r._fFail=e,r._fSuccess=t,null===r._bSupportDataURI){var o=document.createElement("img"),i=function(){r._bSupportDataURI=!1,r._fFail&&r._fFail.call(r)};o.onabort=i,o.onerror=i,o.onload=function(){r._bSupportDataURI=!0,r._fSuccess&&r._fSuccess.call(r)},o.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==";return}!0===r._bSupportDataURI&&r._fSuccess?r._fSuccess.call(r):!1===r._bSupportDataURI&&r._fFail&&r._fFail.call(r)}var i=function(t,e){this._bIsPainted=!1,this._android=c(),this._htOption=e,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=e.width,this._elCanvas.height=e.height,t.appendChild(this._elCanvas),this._el=t,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return i.prototype.draw=function(t){var e=this._elImage,r=this._oContext,o=this._htOption,i=t.getModuleCount(),n=o.width/i,a=o.height/i,s=Math.round(n),h=Math.round(a);e.style.display="none",this.clear();for(var l=0;l'],s=0;s");for(var h=0;h');a.push("")}a.push(""),r.innerHTML=a.join("");var l=r.childNodes[0],u=(e.width-l.offsetWidth)/2,g=(e.height-l.offsetHeight)/2;u>0&&g>0&&(l.style.margin=g+"px "+u+"px")},o.prototype.clear=function(){this._el.innerHTML=""},o);(QRCode=function(t,e){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:n.H},"string"==typeof e&&(e={text:e}),e)for(var r in e)this._htOption[r]=e[r];"string"==typeof t&&(t=document.getElementById(t)),this._htOption.useSVG&&(m=p),this._android=c(),this._el=t,this._oQRCode=null,this._oDrawing=new m(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)}).prototype.makeCode=function(t){this._oQRCode=new e(function(t,e){for(var r,o=1,i=(r=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a")).length+(r.length!=t?3:0),a=0,s=d.length;a<=s;a++){var h=0;switch(e){case n.L:h=d[a][0];break;case n.M:h=d[a][1];break;case n.Q:h=d[a][2];break;case n.H:h=d[a][3]}if(i<=h)break;o++}if(o>d.length)throw Error("Too long data");return o}(t,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(t),this._oQRCode.make(),this._el.title=t,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=n}(); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/Assets.json b/src/OrchardCore.Modules/OrchardCore.Widgets/Assets.json deleted file mode 100644 index 27389601ef4..00000000000 --- a/src/OrchardCore.Modules/OrchardCore.Widgets/Assets.json +++ /dev/null @@ -1,14 +0,0 @@ -[ - { - "inputs": [ - "Assets/js/widgetslist.edit.js" - ], - "output": "wwwroot/Scripts/widgetslist.edit.js" - }, - { - "inputs": [ - "Assets/scss/widgetslist.edit.scss" - ], - "output": "wwwroot/Styles/widgetslist.edit.css" - } -] diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/Assets2.json b/src/OrchardCore.Modules/OrchardCore.Widgets/Assets2.json new file mode 100644 index 00000000000..86f99ee4b63 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/Assets2.json @@ -0,0 +1,15 @@ +[ + { + "action": "sass", + "name": "widgets", + "source": "Assets/scss/widgetslist.edit.scss", + "tags": ["admin", "dashboard", "scss"] + }, + { + "action": "min", + "name": "widgets", + "source": "Assets/js/widgetslist.edit.js", + "dest": "wwwroot/Scripts/", + "tags": ["admin", "dashboard", "js"] + } +] diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.js b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.js index 984e376fef1..1788b923832 100644 --- a/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.js +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.js @@ -1,99 +1,103 @@ -/* -** NOTE: This file is generated by Gulp and should not be edited directly! -** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. -*/ - -function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } -function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } -function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } -function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } $(function () { - $(document).on('click', '.add-list-widget', function (event) { - var type = $(this).data("widget-type"); - var targetId = $(this).data("target-id"); - var htmlFieldPrefix = $(this).data("html-field-prefix"); - var createEditorUrl = $('#' + targetId).data("buildeditorurl"); - var prefixesName = $(this).data("prefixes-name"); - var parentContentType = $(this).data("parent-content-type"); - var partName = $(this).data("part-name"); - var zonesName = $(this).data("zones-name"); - var zone = $(this).data("zone"); + $(document).on('click', '.add-list-widget', function (event) { + var type = $(this).data("widget-type"); + var targetId = $(this).data("target-id"); + var htmlFieldPrefix = $(this).data("html-field-prefix"); + var createEditorUrl = $('#' + targetId).data("buildeditorurl"); + var prefixesName = $(this).data("prefixes-name"); + var parentContentType = $(this).data("parent-content-type"); + var partName = $(this).data("part-name"); + var zonesName = $(this).data("zones-name"); + var zone = $(this).data("zone"); + + // Retrieve all index values knowing that some elements may have been moved / removed. + var indexes = $('#' + targetId).closest("form").find("input[name*='Prefixes']") + .filter(function (i, e) { + return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix; + }) + .map(function (i, e) { + return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0; + }); + + // Use a prefix based on the items count (not a guid) so that the browser autofill still works. + var index = indexes.length ? Math.max(...indexes) + 1 : 0; + var prefix = htmlFieldPrefix + '-' + index.toString(); - // Retrieve all index values knowing that some elements may have been moved / removed. - var indexes = $('#' + targetId).closest("form").find("input[name*='Prefixes']").filter(function (i, e) { - return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix; - }).map(function (i, e) { - return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0; + var contentTypesName = $(this).data("contenttypes-name"); + var contentItemsName = $(this).data("contentitems-name"); + $.ajax({ + url: createEditorUrl + "?id=" + type + "&prefix=" + prefix + "&prefixesName=" + prefixesName + "&contentTypesName=" + contentTypesName + "&contentItemsName=" + contentItemsName + "&zonesName=" + zonesName + "&zone=" + zone + "&targetId=" + targetId + "&parentContentType=" + parentContentType + "&partName=" + partName + }) + .done(function (data) { + var result = JSON.parse(data); + $(document.getElementById(targetId)).append(result.Content); + + var dom = $(result.Scripts); + dom.filter('script').each(function () { + $.globalEval(this.text || this.textContent || this.innerHTML || ''); + }); + }); }); - // Use a prefix based on the items count (not a guid) so that the browser autofill still works. - var index = indexes.length ? Math.max.apply(Math, _toConsumableArray(indexes)) + 1 : 0; - var prefix = htmlFieldPrefix + '-' + index.toString(); - var contentTypesName = $(this).data("contenttypes-name"); - var contentItemsName = $(this).data("contentitems-name"); - $.ajax({ - url: createEditorUrl + "?id=" + type + "&prefix=" + prefix + "&prefixesName=" + prefixesName + "&contentTypesName=" + contentTypesName + "&contentItemsName=" + contentItemsName + "&zonesName=" + zonesName + "&zone=" + zone + "&targetId=" + targetId + "&parentContentType=" + parentContentType + "&partName=" + partName - }).done(function (data) { - var result = JSON.parse(data); - $(document.getElementById(targetId)).append(result.Content); - var dom = $(result.Scripts); - dom.filter('script').each(function () { - $.globalEval(this.text || this.textContent || this.innerHTML || ''); - }); + $(document).on('click', '.insert-list-widget', function (event) { + var type = $(this).data("widget-type"); + var target = $(this).closest('.widget-template'); + var targetId = $(this).data("target-id"); + var htmlFieldPrefix = $(this).data("html-field-prefix"); + var createEditorUrl = $('#' + targetId).data("buildeditorurl"); + var prefixesName = $(this).data("prefixes-name"); + var parentContentType = $(this).data("parent-content-type"); + var partName = $(this).data("part-name"); + var zonesName = $(this).data("zones-name"); + var zone = $(this).data("zone"); + + // Retrieve all index values knowing that some elements may have been moved / removed. + var indexes = $('#' + targetId).closest("form").find("input[name*='Prefixes']") + .filter(function (i, e) { + return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix; + }) + .map(function (i, e) { + return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0; + }); + + // Use a prefix based on the items count (not a guid) so that the browser autofill still works. + var index = indexes.length ? Math.max(...indexes) + 1 : 0; + var prefix = htmlFieldPrefix + '-' + index.toString(); + + var contentTypesName = $(this).data("contenttypes-name"); + var contentItemsName = $(this).data("contentitems-name"); + $.ajax({ + url: createEditorUrl + "?id=" + type + "&prefix=" + prefix + "&prefixesName=" + prefixesName + "&contentTypesName=" + contentTypesName + "&contentItemsName=" + contentItemsName + "&zonesName=" + zonesName + "&zone=" + zone + "&targetId=" + targetId + "&parentContentType=" + parentContentType + "&partName=" + partName + }) + .done(function (data) { + var result = JSON.parse(data); + $(result.Content).insertBefore(target); + + var dom = $(result.Scripts); + dom.filter('script').each(function () { + $.globalEval(this.text || this.textContent || this.innerHTML || ''); + }); + }); }); - }); - $(document).on('click', '.insert-list-widget', function (event) { - var type = $(this).data("widget-type"); - var target = $(this).closest('.widget-template'); - var targetId = $(this).data("target-id"); - var htmlFieldPrefix = $(this).data("html-field-prefix"); - var createEditorUrl = $('#' + targetId).data("buildeditorurl"); - var prefixesName = $(this).data("prefixes-name"); - var parentContentType = $(this).data("parent-content-type"); - var partName = $(this).data("part-name"); - var zonesName = $(this).data("zones-name"); - var zone = $(this).data("zone"); - // Retrieve all index values knowing that some elements may have been moved / removed. - var indexes = $('#' + targetId).closest("form").find("input[name*='Prefixes']").filter(function (i, e) { - return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix; - }).map(function (i, e) { - return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0; + $(document).on('click', '.widget-list-delete', function () { + var $this = $(this); + confirmDialog(_objectSpread({}, $this.data(), { + callback: function callback(r) { + if (r) { + $this.closest('.widget-template').remove(); + $(document).trigger('contentpreview:render'); + } + } + })); }); - // Use a prefix based on the items count (not a guid) so that the browser autofill still works. - var index = indexes.length ? Math.max.apply(Math, _toConsumableArray(indexes)) + 1 : 0; - var prefix = htmlFieldPrefix + '-' + index.toString(); - var contentTypesName = $(this).data("contenttypes-name"); - var contentItemsName = $(this).data("contentitems-name"); - $.ajax({ - url: createEditorUrl + "?id=" + type + "&prefix=" + prefix + "&prefixesName=" + prefixesName + "&contentTypesName=" + contentTypesName + "&contentItemsName=" + contentItemsName + "&zonesName=" + zonesName + "&zone=" + zone + "&targetId=" + targetId + "&parentContentType=" + parentContentType + "&partName=" + partName - }).done(function (data) { - var result = JSON.parse(data); - $(result.Content).insertBefore(target); - var dom = $(result.Scripts); - dom.filter('script').each(function () { - $.globalEval(this.text || this.textContent || this.innerHTML || ''); - }); + $(document).on('change', '.widget-editor-footer label', function () { + $(document).trigger('contentpreview:render'); }); - }); - $(document).on('click', '.widget-list-delete', function () { - var $this = $(this); - confirmDialog(_objectSpread({}, $this.data(), { - callback: function callback(r) { - if (r) { - $this.closest('.widget-template').remove(); - $(document).trigger('contentpreview:render'); - } - } - })); - }); - $(document).on('change', '.widget-editor-footer label', function () { - $(document).trigger('contentpreview:render'); - }); - $(document).on('click', '.widget-list-editor-btn-toggle', function () { - $(this).closest('.widget-editor').toggleClass('collapsed'); - }); -}); \ No newline at end of file + + $(document).on('click', '.widget-list-editor-btn-toggle', function () { + $(this).closest('.widget-editor').toggleClass('collapsed'); + }); + +}); diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.map b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.map new file mode 100644 index 00000000000..52a74b093ad --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.map @@ -0,0 +1 @@ +{"version":3,"sources":[""],"sourcesContent":["$(function () {\r\n $(document).on('click', '.add-list-widget', function (event) {\r\n var type = $(this).data(\"widget-type\");\r\n var targetId = $(this).data(\"target-id\");\r\n var htmlFieldPrefix = $(this).data(\"html-field-prefix\");\r\n var createEditorUrl = $('#' + targetId).data(\"buildeditorurl\");\r\n var prefixesName = $(this).data(\"prefixes-name\");\r\n var parentContentType = $(this).data(\"parent-content-type\");\r\n var partName = $(this).data(\"part-name\");\r\n var zonesName = $(this).data(\"zones-name\");\r\n var zone = $(this).data(\"zone\");\r\n\r\n // Retrieve all index values knowing that some elements may have been moved / removed.\r\n var indexes = $('#' + targetId).closest(\"form\").find(\"input[name*='Prefixes']\")\r\n .filter(function (i, e) {\r\n return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix;\r\n })\r\n .map(function (i, e) {\r\n return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0;\r\n });\r\n\r\n // Use a prefix based on the items count (not a guid) so that the browser autofill still works.\r\n var index = indexes.length ? Math.max(...indexes) + 1 : 0;\r\n var prefix = htmlFieldPrefix + '-' + index.toString();\r\n\r\n var contentTypesName = $(this).data(\"contenttypes-name\");\r\n var contentItemsName = $(this).data(\"contentitems-name\");\r\n $.ajax({\r\n url: createEditorUrl + \"?id=\" + type + \"&prefix=\" + prefix + \"&prefixesName=\" + prefixesName + \"&contentTypesName=\" + contentTypesName + \"&contentItemsName=\" + contentItemsName + \"&zonesName=\" + zonesName + \"&zone=\" + zone + \"&targetId=\" + targetId + \"&parentContentType=\" + parentContentType + \"&partName=\" + partName\r\n })\r\n .done(function (data) {\r\n var result = JSON.parse(data);\r\n $(document.getElementById(targetId)).append(result.Content);\r\n\r\n var dom = $(result.Scripts);\r\n dom.filter('script').each(function () {\r\n $.globalEval(this.text || this.textContent || this.innerHTML || '');\r\n });\r\n });\r\n });\r\n\r\n $(document).on('click', '.insert-list-widget', function (event) {\r\n var type = $(this).data(\"widget-type\");\r\n var target = $(this).closest('.widget-template');\r\n var targetId = $(this).data(\"target-id\");\r\n var htmlFieldPrefix = $(this).data(\"html-field-prefix\");\r\n var createEditorUrl = $('#' + targetId).data(\"buildeditorurl\");\r\n var prefixesName = $(this).data(\"prefixes-name\");\r\n var parentContentType = $(this).data(\"parent-content-type\");\r\n var partName = $(this).data(\"part-name\");\r\n var zonesName = $(this).data(\"zones-name\");\r\n var zone = $(this).data(\"zone\");\r\n\r\n // Retrieve all index values knowing that some elements may have been moved / removed.\r\n var indexes = $('#' + targetId).closest(\"form\").find(\"input[name*='Prefixes']\")\r\n .filter(function (i, e) {\r\n return $(e).val().substring(0, $(e).val().lastIndexOf('-')) === htmlFieldPrefix;\r\n })\r\n .map(function (i, e) {\r\n return parseInt($(e).val().substring($(e).val().lastIndexOf('-') + 1)) || 0;\r\n });\r\n\r\n // Use a prefix based on the items count (not a guid) so that the browser autofill still works.\r\n var index = indexes.length ? Math.max(...indexes) + 1 : 0;\r\n var prefix = htmlFieldPrefix + '-' + index.toString();\r\n\r\n var contentTypesName = $(this).data(\"contenttypes-name\");\r\n var contentItemsName = $(this).data(\"contentitems-name\");\r\n $.ajax({\r\n url: createEditorUrl + \"?id=\" + type + \"&prefix=\" + prefix + \"&prefixesName=\" + prefixesName + \"&contentTypesName=\" + contentTypesName + \"&contentItemsName=\" + contentItemsName + \"&zonesName=\" + zonesName + \"&zone=\" + zone + \"&targetId=\" + targetId + \"&parentContentType=\" + parentContentType + \"&partName=\" + partName\r\n })\r\n .done(function (data) {\r\n var result = JSON.parse(data);\r\n $(result.Content).insertBefore(target);\r\n\r\n var dom = $(result.Scripts);\r\n dom.filter('script').each(function () {\r\n $.globalEval(this.text || this.textContent || this.innerHTML || '');\r\n });\r\n });\r\n });\r\n\r\n $(document).on('click', '.widget-list-delete', function () {\r\n var $this = $(this);\r\n confirmDialog(_objectSpread({}, $this.data(), {\r\n callback: function callback(r) {\r\n if (r) {\r\n $this.closest('.widget-template').remove();\r\n $(document).trigger('contentpreview:render');\r\n }\r\n }\r\n }));\r\n });\r\n\r\n $(document).on('change', '.widget-editor-footer label', function () {\r\n $(document).trigger('contentpreview:render');\r\n });\r\n\r\n $(document).on('click', '.widget-list-editor-btn-toggle', function () {\r\n $(this).closest('.widget-editor').toggleClass('collapsed');\r\n });\r\n\r\n});\r\n"],"names":["$","document","on","event","type","data","targetId","htmlFieldPrefix","createEditorUrl","prefixesName","parentContentType","partName","zonesName","zone","indexes","closest","find","filter","i","e","val","substring","lastIndexOf","map","parseInt","prefix","index","length","Math","max","toString","contentTypesName","contentItemsName","ajax","url","done","result","JSON","parse","getElementById","append","Content","dom","Scripts","each","globalEval","text","textContent","innerHTML","target","insertBefore","$this","confirmDialog","_objectSpread","callback","r","remove","trigger","toggleClass"],"mappings":"AAAAA,EAAE,WACEA,EAAEC,UAAUC,EAAE,CAAC,QAAS,mBAAoB,SAAUC,CAAK,EACvD,IAAIC,EAAOJ,EAAE,IAAI,EAAEK,IAAI,CAAC,eACpBC,EAAWN,EAAE,IAAI,EAAEK,IAAI,CAAC,aACxBE,EAAkBP,EAAE,IAAI,EAAEK,IAAI,CAAC,qBAC/BG,EAAkBR,EAAE,IAAMM,GAAUD,IAAI,CAAC,kBACzCI,EAAeT,EAAE,I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,IAAI,EAAEK,IAAI,CAAC,qBAChC2B,EAAmBhC,EAAE,IAAI,EAAEK,IAAI,CAAC,qBACpCL,EAAEiC,IAAI,CAAC,CACHC,IAAK1B,EAAkB,OAASJ,EAAO,WAAaqB,EAAS,iBAAmBhB,EAAe,qBAAuBsB,EAAmB,qBAAuBC,EAAmB,cAAgBpB,EAAY,SAAWC,EAAO,aAAeP,EAAW,sBAAwBI,EAAoB,aAAeC,CAC1T,GACCwB,IAAI,CAAC,SAAU9B,CAAI,EAChB,IAAI+B,EAASC,KAAKC,KAAK,CAACjC,GACxBL,EAAEoC,EAAOK,OAAO,EAAES,YAAY,CAACD,GAG/BP,AADU1C,EAAEoC,EAAOO,OAAO,EACtB1B,MAAM,CAAC,UAAU2B,IAAI,CAAC,WACtB5C,EAAE6C,UAAU,CAAC,IAAI,CAACC,IAAI,EAAI,IAAI,CAACC,WAAW,EAAI,IAAI,CAACC,SAAS,EAAI,GACpE,EACJ,EACJ,GAEAhD,EAAEC,UAAUC,EAAE,CAAC,QAAS,sBAAuB,WAC3C,IAAIiD,EAAQnD,EAAE,IAAI,EAClBoD,cAAcC,cAAc,CAAC,EAAGF,EAAM9C,IAAI,GAAI,CAC1CiD,SAAU,SAAkBC,CAAC,EACrBA,IACAJ,EAAMpC,OAAO,CAAC,oBAAoByC,MAAM,GACxCxD,EAAEC,UAAUwD,OAAO,CAAC,yBAE5B,CACJ,GACJ,GAEAzD,EAAEC,UAAUC,EAAE,CAAC,SAAU,8BAA+B,WACpDF,EAAEC,UAAUwD,OAAO,CAAC,wBACxB,GAEAzD,EAAEC,UAAUC,EAAE,CAAC,QAAS,iCAAkC,WACtDF,EAAE,IAAI,EAAEe,OAAO,CAAC,kBAAkB2C,WAAW,CAAC,YAClD,EAEJ"} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.min.js b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.min.js index a89eb32e308..255a39d321b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Scripts/widgetslist.edit.min.js @@ -1 +1 @@ -function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,e){if(t){if("string"==typeof t)return _arrayLikeToArray(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(t,e):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,n=Array(e);a .btn-group { right: calc(-14px + 50%); -} +} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Styles/widgetslist.edit.css.map b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Styles/widgetslist.edit.css.map new file mode 100644 index 00000000000..791c3b5f522 --- /dev/null +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Styles/widgetslist.edit.css.map @@ -0,0 +1 @@ +{"version":3,"sourceRoot":null,"mappings":"AAAA,sEAGA,iPASA,6EAIA,uDAIA,sFAIA,+CAIA,sGAMA,kLAYA,mKAWA,0CAIA,gFAIA,6CAGA,qFAKA,qFAMA,2DAKA,iEAIA","sources":["style.css"],"sourcesContent":[".widget-editor .card-body, .widget-editor .card-footer {\n display: inherit;\n}\n.widget-editor.collapsed .card-body, .widget-editor.collapsed .card-footer {\n display: none;\n}\n.widget-editor.collapsed > .widget-editor-header .widget-editor-btn-collapse {\n display: none;\n}\n.widget-editor:not(.collapsed) > .widget-editor-header .widget-editor-btn-expand {\n display: none;\n}\n.widget-editor .widget-editor-handle {\n display: inline-block;\n margin-right: 0.5rem;\n}\n.widget-editor .widget-editor-handle:hover {\n cursor: move;\n}\n\n.widget-editor-btn-collapse, .collapsed .widget-editor-btn-expand {\n display: inline-block;\n}\n\n.widget-dropzone-hint {\n border: 3px dashed orange;\n}\n\n.widget-dragdrop-placeholder div {\n margin-top: 6px;\n margin-bottom: 6px;\n min-height: 6px;\n display: inline-block;\n}\n.widget-dragdrop-placeholder div:before {\n position: absolute;\n content: \"\";\n width: 0;\n height: 0;\n border: 8px solid transparent;\n border-left-color: orange;\n border-right: none;\n top: 5px;\n margin-left: -10px;\n}\n\n.btn-widget-metadata {\n margin: 0 auto;\n left: 0;\n top: -6px;\n position: absolute;\n visibility: collapse;\n height: 1px;\n white-space: nowrap;\n text-align: center;\n transition: 0.3s visibility;\n}\n.btn-widget-metadata > .btn-group {\n top: -20px;\n}\n\n.widget-editor-header.card-header:hover > .btn-widget-metadata {\n visibility: visible;\n}\n\n.btn-widget-add-below-wrapper {\n min-height: 5px;\n}\n.btn-widget-add-below-wrapper:hover > .btn-widget-add-below {\n border-width: 5px;\n opacity: 1;\n}\n\n.btn-widget-add-below {\n height: 1px;\n position: relative;\n opacity: 0.5;\n transition: 0.3s opacity;\n}\n.btn-widget-add-below > .btn-group {\n margin: 0 auto;\n bottom: 17px;\n}\n\n[dir=ltr] .btn-widget-add-below > .btn-group {\n left: calc(-14px + 50%);\n}\n\n[dir=rtl] .btn-widget-add-below > .btn-group {\n right: calc(-14px + 50%);\n}"],"names":[]} \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Styles/widgetslist.edit.min.css b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Styles/widgetslist.edit.min.css index 7dd42d414ae..207694cefd2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Styles/widgetslist.edit.min.css +++ b/src/OrchardCore.Modules/OrchardCore.Widgets/wwwroot/Styles/widgetslist.edit.min.css @@ -1 +1 @@ -.widget-editor .card-body,.widget-editor .card-footer{display:inherit}.widget-editor.collapsed .card-body,.widget-editor.collapsed .card-footer{display:none}.widget-editor.collapsed>.widget-editor-header .widget-editor-btn-collapse{display:none}.widget-editor:not(.collapsed)>.widget-editor-header .widget-editor-btn-expand{display:none}.widget-editor .widget-editor-handle{display:inline-block;margin-right:.5rem}.widget-editor .widget-editor-handle:hover{cursor:move}.collapsed .widget-editor-btn-expand,.widget-editor-btn-collapse{display:inline-block}.widget-dropzone-hint{border:3px dashed orange}.widget-dragdrop-placeholder div{margin-top:6px;margin-bottom:6px;min-height:6px;display:inline-block}.widget-dragdrop-placeholder div:before{position:absolute;content:"";width:0;height:0;border:8px solid transparent;border-left-color:orange;border-right:none;top:5px;margin-left:-10px}.btn-widget-metadata{margin:0 auto;left:0;top:-6px;position:absolute;visibility:collapse;height:1px;white-space:nowrap;text-align:center;transition:.3s visibility}.btn-widget-metadata>.btn-group{top:-20px}.widget-editor-header.card-header:hover>.btn-widget-metadata{visibility:visible}.btn-widget-add-below-wrapper{min-height:5px}.btn-widget-add-below-wrapper:hover>.btn-widget-add-below{border-width:5px;opacity:1}.btn-widget-add-below{height:1px;position:relative;opacity:.5;transition:.3s opacity}.btn-widget-add-below>.btn-group{margin:0 auto;bottom:17px}[dir=ltr] .btn-widget-add-below>.btn-group{left:calc(-14px + 50%)}[dir=rtl] .btn-widget-add-below>.btn-group{right:calc(-14px + 50%)} +.widget-editor .card-body,.widget-editor .card-footer{display:inherit}.widget-editor.collapsed .card-body,.widget-editor.collapsed .card-footer,.widget-editor.collapsed>.widget-editor-header .widget-editor-btn-collapse,.widget-editor:not(.collapsed)>.widget-editor-header .widget-editor-btn-expand{display:none}.widget-editor .widget-editor-handle{margin-right:.5rem;display:inline-block}.widget-editor .widget-editor-handle:hover{cursor:move}.widget-editor-btn-collapse,.collapsed .widget-editor-btn-expand{display:inline-block}.widget-dropzone-hint{border:3px dashed orange}.widget-dragdrop-placeholder div{min-height:6px;margin-top:6px;margin-bottom:6px;display:inline-block}.widget-dragdrop-placeholder div:before{content:"";border:8px solid #0000;border-left-color:orange;border-right:none;width:0;height:0;margin-left:-10px;position:absolute;top:5px}.btn-widget-metadata{visibility:collapse;white-space:nowrap;text-align:center;height:1px;margin:0 auto;transition:visibility .3s;position:absolute;top:-6px;left:0}.btn-widget-metadata>.btn-group{top:-20px}.widget-editor-header.card-header:hover>.btn-widget-metadata{visibility:visible}.btn-widget-add-below-wrapper{min-height:5px}.btn-widget-add-below-wrapper:hover>.btn-widget-add-below{opacity:1;border-width:5px}.btn-widget-add-below{opacity:.5;height:1px;transition:opacity .3s;position:relative}.btn-widget-add-below>.btn-group{margin:0 auto;bottom:17px}[dir=ltr] .btn-widget-add-below>.btn-group{left:calc(50% - 14px)}[dir=rtl] .btn-widget-add-below>.btn-group{right:calc(50% - 14px)} \ No newline at end of file