From 8e0c6322632322b1168b4728b6b6fa7e7dcd1689 Mon Sep 17 00:00:00 2001 From: getBlup Date: Tue, 23 Aug 2022 17:41:11 +0200 Subject: [PATCH] added a folder view --- README.md | 4 ++- Shared/LinkHelper.cs | 20 ++++++++++++++- Shared/_Assets.cshtml | 3 +++ bs3/_FileList.cshtml | 2 +- bs3/_Folder.cshtml | 39 ++++++++++++++++++++++++++++ bs3/_Subfolder.cshtml | 44 ++++++++++++++++++++++++++++++++ bs3/dist/styles.min.css | 2 +- bs3/dist/styles.min.css.map | 2 +- bs3/styles/_style.scss | 6 +++++ bs4/_FileList.cshtml | 2 +- bs4/_Folder.cshtml | 39 ++++++++++++++++++++++++++++ bs4/_Subfolder.cshtml | 44 ++++++++++++++++++++++++++++++++ bs4/dist/styles.min.css | 2 +- bs4/dist/styles.min.css.map | 2 +- bs4/styles/_style.scss | 6 +++++ bs5/_FileList.cshtml | 4 +-- bs5/_Folder.cshtml | 43 +++++++++++++++++++++++++++++++ bs5/_Subfolder.cshtml | 51 +++++++++++++++++++++++++++++++++++++ bs5/dist/scripts.min.js | 2 ++ bs5/dist/scripts.min.js.map | 1 + bs5/dist/styles.min.css | 2 +- bs5/dist/styles.min.css.map | 2 +- bs5/styles/_style.scss | 6 +++++ src/ts/index.ts | 36 ++++++++++++++++++++++++++ webpack.config.js | 1 + 25 files changed, 353 insertions(+), 12 deletions(-) create mode 100644 bs3/_Folder.cshtml create mode 100644 bs3/_Subfolder.cshtml create mode 100644 bs4/_Folder.cshtml create mode 100644 bs4/_Subfolder.cshtml create mode 100644 bs5/_Folder.cshtml create mode 100644 bs5/_Subfolder.cshtml create mode 100644 bs5/dist/scripts.min.js.map create mode 100644 src/ts/index.ts diff --git a/README.md b/README.md index db849cf..f650442 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,6 @@ If you want to customize the CSS, you will usually follow the ["Create Custom St * 2022-07 * Activated lightspeed * Activated ajax reloading - * Updated webpack.config \ No newline at end of file + * Updated webpack.config +* 2022-08 v01.01.00 + * Added a folder view \ No newline at end of file diff --git a/Shared/LinkHelper.cs b/Shared/LinkHelper.cs index 44aaeb2..5af8805 100644 --- a/Shared/LinkHelper.cs +++ b/Shared/LinkHelper.cs @@ -19,6 +19,8 @@ public dynamic LinkInfos(string link, string window, string icon) { // process remaining properties, in case we want to override them with automatic stuff if(found) { var linkExt = Path.GetExtension(link.ToLower()); + // get the right fontawesome class ending for the file type + var filetypeIcon = iconEnding(linkExt); var isDoc = fileExtensions.Contains(linkExt); // try to find out if it's a local link @@ -31,7 +33,7 @@ public dynamic LinkInfos(string link, string window, string icon) { // but only if no icon was specified already if(!Text.Has(icon)) icon = isDoc - ? "fas fa-file" // if doc, then file-icon + ? "fas fa-file" + filetypeIcon // if doc, then file-icon + add the file ending for the right file type : (isInternal ? "fas fa-caret-right" // else if internal, use play-button : "fas fa-external-link-alt"); // else if external, show "open new window" @@ -48,4 +50,20 @@ public dynamic LinkInfos(string link, string window, string icon) { Window = window, }); } + + public string iconEnding(string linkExt){ + + if(linkExt == ".pdf") + return "-pdf"; + else if(linkExt == ".doc" || linkExt == ".docx") + return "-word"; + else if(linkExt == ".xls" || linkExt == ".xlsx") + return "-excel"; + else if(linkExt == ".ppt" || linkExt == ".pptx" || linkExt == ".ppsx") + return "-powerpoint"; + else if(linkExt == ".txt") + return "-alt"; + else + return ""; + } } diff --git a/Shared/_Assets.cshtml b/Shared/_Assets.cshtml index d1609cc..590495e 100644 --- a/Shared/_Assets.cshtml +++ b/Shared/_Assets.cshtml @@ -18,4 +18,7 @@ // 4. Include styles of the App + + // 5. Include scritps of the App + } diff --git a/bs3/_FileList.cshtml b/bs3/_FileList.cshtml index 2d479e4..e596a77 100644 --- a/bs3/_FileList.cshtml +++ b/bs3/_FileList.cshtml @@ -7,7 +7,7 @@ var listItemToolbar = Kit.Toolbar.Default().Layout("-"); } -
+
@* call sub-template to show the title with the correct H1-H6 tag *@ @Html.Partial("../Shared/_Header tag.cshtml", new { Title = Header.Title }) diff --git a/bs3/_Folder.cshtml b/bs3/_Folder.cshtml new file mode 100644 index 0000000..aa70c2a --- /dev/null +++ b/bs3/_Folder.cshtml @@ -0,0 +1,39 @@ +@inherits Custom.Hybrid.Razor14 + +@{ + // get helper commands + var linkHelper = CreateInstance("../Shared/LinkHelper.cs"); + + var fileMetadataToolbar = Kit.Toolbar.Empty().Edit().Add(); + + Kit.Page.Activate("Fontawesome5"); +} + +
+

@Content.Title

+
+ @foreach (var file in AsList(AsAdam(Content,"Files").Files as object)) { + + + + @file.Metadata.Title + @{ + var sizeInfo = Kit.Adam.File(file.Id).SizeInfo; + } + @if(sizeInfo.BestSize > 0){ + (@sizeInfo.BestSize.ToString("#.##") @sizeInfo.BestUnit) + } + + @Html.Raw(file.Metadata.Description) + + + + } + + @foreach(var folder in AsList(AsAdam(Content, "Files").Folders as object)){ + @Html.Partial("_Subfolder.cshtml", new { Folder = folder, Level = 2 }) + } +
+
+ +@Html.Partial("../Shared/_Assets.cshtml") diff --git a/bs3/_Subfolder.cshtml b/bs3/_Subfolder.cshtml new file mode 100644 index 0000000..72e6d3b --- /dev/null +++ b/bs3/_Subfolder.cshtml @@ -0,0 +1,44 @@ +@inherits Custom.Hybrid.Razor14 +@using System.Text.RegularExpressions; +@using ToSic.Razor.Blade; +@{ + var Folder = DynamicModel.Folder; + + var level = DynamicModel.Level; + + var fileMetadataToolbar = Kit.Toolbar.Empty().Edit().Add(); +} + + +@{ + level = level + 1; +} +
+ @if(AsList(Folder.Files) != null){ + foreach(var file in AsList(Folder.Files)){ + + + + @file.Metadata.Title + @{ + var sizeInfo = Kit.Adam.File(file.Id).SizeInfo; + } + @if(sizeInfo.BestSize > 0){ + (@sizeInfo.BestSize.ToString("#.##") @sizeInfo.BestUnit) + } + + @Html.Raw(file.Metadata.Description) + + + + } + } + @if(AsList(Folder.Files) != null){ + foreach(var folder in AsList(Folder.Folders)){ + @Html.Partial("_Subfolder.cshtml", new { Folder = folder, Level = level }) + } + } +
\ No newline at end of file diff --git a/bs3/dist/styles.min.css b/bs3/dist/styles.min.css index edbb3b7..3f924bb 100644 --- a/bs3/dist/styles.min.css +++ b/bs3/dist/styles.min.css @@ -2,6 +2,6 @@ * This file was auto-generated using SASS * You can manually modify it - but usually you will want to * Re-generate it using the SASS variables of your theme -*/@media all{.app-filelist{margin-bottom:35px}.app-filelist .list-group a>svg{width:20px;margin-right:4px}} +*/@media all{.app-filelist{margin-bottom:35px}.app-filelist .list-group a>svg{width:20px;margin-right:4px}.app-filelist .description-wrapper p{margin:0 !important}} /*# sourceMappingURL=styles.min.css.map*/ \ No newline at end of file diff --git a/bs3/dist/styles.min.css.map b/bs3/dist/styles.min.css.map index 858ffba..1d996f9 100644 --- a/bs3/dist/styles.min.css.map +++ b/bs3/dist/styles.min.css.map @@ -1 +1 @@ -{"version":3,"file":"styles.min.css","mappings":"AAEA;;;;CAAA,CCEA,WACE,cACE,mBAII,gCACE,WACA,kB","sources":["webpack://app-success-story/./bs3/styles/_sass-comments.scss","webpack://app-success-story/./bs3/styles/_style.scss"],"sourcesContent":["// the following comment is multi-line and will be included in the final CSS\r\n// which helps users understand where it comes from\r\n/*!\r\n * This file was auto-generated using SASS\r\n * You can manually modify it - but usually you will want to \r\n * Re-generate it using the SASS variables of your theme\r\n*/","// This SCSS generates the css for the general styles\r\n// To keep things simple, it uses the standard variables of\r\n// bootstrap 4 conventions.\r\n\r\n@media all {\r\n .app-filelist {\r\n margin-bottom: 35px;\r\n \r\n .list-group {\r\n a > {\r\n svg {\r\n width: 20px;\r\n margin-right: 4px;\r\n }\r\n }\r\n }\r\n }\r\n}"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"styles.min.css","mappings":"AAEA;;;;CAAA,CCEA,WACE,cACE,mBAII,gCACE,WACA,iBAMJ,qCACE,qB","sources":["webpack://app-success-story/./bs3/styles/_sass-comments.scss","webpack://app-success-story/./bs3/styles/_style.scss"],"sourcesContent":["// the following comment is multi-line and will be included in the final CSS\r\n// which helps users understand where it comes from\r\n/*!\r\n * This file was auto-generated using SASS\r\n * You can manually modify it - but usually you will want to \r\n * Re-generate it using the SASS variables of your theme\r\n*/","// This SCSS generates the css for the general styles\r\n// To keep things simple, it uses the standard variables of\r\n// bootstrap 4 conventions.\r\n\r\n@media all {\r\n .app-filelist {\r\n margin-bottom: 35px;\r\n \r\n .list-group {\r\n a > {\r\n svg {\r\n width: 20px;\r\n margin-right: 4px;\r\n }\r\n }\r\n }\r\n \r\n .description-wrapper{\r\n p{\r\n margin: 0!important;\r\n }\r\n }\r\n }\r\n}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/bs3/styles/_style.scss b/bs3/styles/_style.scss index 5cee9b3..a0b756b 100644 --- a/bs3/styles/_style.scss +++ b/bs3/styles/_style.scss @@ -14,5 +14,11 @@ } } } + + .description-wrapper{ + p{ + margin: 0!important; + } + } } } \ No newline at end of file diff --git a/bs4/_FileList.cshtml b/bs4/_FileList.cshtml index 502986f..9d2c038 100644 --- a/bs4/_FileList.cshtml +++ b/bs4/_FileList.cshtml @@ -7,7 +7,7 @@ var listItemToolbar = Kit.Toolbar.Default().Layout("-"); } -
+
@* call sub-template to show the title with the correct H1-H6 tag *@ @Html.Partial("../Shared/_Header tag.cshtml", new { Title = Header.Title }) diff --git a/bs4/_Folder.cshtml b/bs4/_Folder.cshtml new file mode 100644 index 0000000..951f63d --- /dev/null +++ b/bs4/_Folder.cshtml @@ -0,0 +1,39 @@ +@inherits Custom.Hybrid.Razor14 + +@{ + // get helper commands + var linkHelper = CreateInstance("../Shared/LinkHelper.cs"); + + var fileMetadataToolbar = Kit.Toolbar.Empty().Edit().Add(); + + Kit.Page.Activate("Fontawesome5"); +} + +
+

@Content.Title

+
+ @foreach (var file in AsList(AsAdam(Content,"Files").Files as object)) { + + + + @file.Metadata.Title + @{ + var sizeInfo = Kit.Adam.File(file.Id).SizeInfo; + } + @if(sizeInfo.BestSize > 0){ + (@sizeInfo.BestSize.ToString("#.##") @sizeInfo.BestUnit) + } + + @Html.Raw(file.Metadata.Description) + + + + } + + @foreach(var folder in AsList(AsAdam(Content, "Files").Folders as object)){ + @Html.Partial("_Subfolder.cshtml", new { Folder = folder, Level = 2 }) + } +
+
+ +@Html.Partial("../Shared/_Assets.cshtml") diff --git a/bs4/_Subfolder.cshtml b/bs4/_Subfolder.cshtml new file mode 100644 index 0000000..6e2f1f8 --- /dev/null +++ b/bs4/_Subfolder.cshtml @@ -0,0 +1,44 @@ +@inherits Custom.Hybrid.Razor14 +@using System.Text.RegularExpressions; +@using ToSic.Razor.Blade; +@{ + var Folder = DynamicModel.Folder; + + var level = DynamicModel.Level; + + var fileMetadataToolbar = Kit.Toolbar.Empty().Edit().Add(); +} + + +@{ + level = level + 1; +} +
+ @if(AsList(Folder.Files) != null){ + foreach(var file in AsList(Folder.Files)){ + + + + @file.Metadata.Title + @{ + var sizeInfo = Kit.Adam.File(file.Id).SizeInfo; + } + @if(sizeInfo.BestSize > 0){ + (@sizeInfo.BestSize.ToString("#.##") @sizeInfo.BestUnit) + } + + @Html.Raw(file.Metadata.Description) + + + + } + } + @if(AsList(Folder.Files) != null){ + foreach(var folder in AsList(Folder.Folders)){ + @Html.Partial("_Subfolder.cshtml", new { Folder = folder, Level = level }) + } + } +
\ No newline at end of file diff --git a/bs4/dist/styles.min.css b/bs4/dist/styles.min.css index f2af596..a64c99a 100644 --- a/bs4/dist/styles.min.css +++ b/bs4/dist/styles.min.css @@ -2,6 +2,6 @@ * This file was auto-generated using SASS * You can manually modify it - but usually you will want to * Re-generate it using the SASS variables of your theme -*/@media all{.app-filelist .list-group a>svg{width:20px;margin-right:4px}} +*/@media all{.app-filelist .list-group a>svg{width:20px;margin-right:4px}.description-wrapper p{margin:0 !important}} /*# sourceMappingURL=styles.min.css.map*/ \ No newline at end of file diff --git a/bs4/dist/styles.min.css.map b/bs4/dist/styles.min.css.map index 7990aa8..5e547ff 100644 --- a/bs4/dist/styles.min.css.map +++ b/bs4/dist/styles.min.css.map @@ -1 +1 @@ -{"version":3,"file":"styles.min.css","mappings":"AAEA;;;;CAAA,CCEA,WAIQ,gCACE,WACA,kB","sources":["webpack://app-success-story/./bs4/styles/_sass-comments.scss","webpack://app-success-story/./bs4/styles/_style.scss"],"sourcesContent":["// the following comment is multi-line and will be included in the final CSS\r\n// which helps users understand where it comes from\r\n/*!\r\n * This file was auto-generated using SASS\r\n * You can manually modify it - but usually you will want to \r\n * Re-generate it using the SASS variables of your theme\r\n*/","// This SCSS generates the css for the general styles\r\n// To keep things simple, it uses the standard variables of\r\n// bootstrap 4 conventions.\r\n\r\n@media all {\r\n .app-filelist {\r\n .list-group {\r\n a > {\r\n svg {\r\n width: 20px;\r\n margin-right: 4px;\r\n }\r\n }\r\n }\r\n }\r\n}"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"styles.min.css","mappings":"AAEA;;;;CAAA,CCEA,WAIQ,gCACE,WACA,iBAON,uBACE,qB","sources":["webpack://app-success-story/./bs4/styles/_sass-comments.scss","webpack://app-success-story/./bs4/styles/_style.scss"],"sourcesContent":["// the following comment is multi-line and will be included in the final CSS\r\n// which helps users understand where it comes from\r\n/*!\r\n * This file was auto-generated using SASS\r\n * You can manually modify it - but usually you will want to \r\n * Re-generate it using the SASS variables of your theme\r\n*/","// This SCSS generates the css for the general styles\r\n// To keep things simple, it uses the standard variables of\r\n// bootstrap 4 conventions.\r\n\r\n@media all {\r\n .app-filelist {\r\n .list-group {\r\n a > {\r\n svg {\r\n width: 20px;\r\n margin-right: 4px;\r\n }\r\n }\r\n }\r\n }\r\n \r\n .description-wrapper{\r\n p{\r\n margin: 0!important;\r\n }\r\n }\r\n}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/bs4/styles/_style.scss b/bs4/styles/_style.scss index d334dcf..6e29c8d 100644 --- a/bs4/styles/_style.scss +++ b/bs4/styles/_style.scss @@ -13,4 +13,10 @@ } } } + + .description-wrapper{ + p{ + margin: 0!important; + } + } } \ No newline at end of file diff --git a/bs5/_FileList.cshtml b/bs5/_FileList.cshtml index 4fc93ea..f8a3a53 100644 --- a/bs5/_FileList.cshtml +++ b/bs5/_FileList.cshtml @@ -7,12 +7,12 @@ var listItemToolbar = Kit.Toolbar.Default().Layout("-"); } -
+
@* call sub-template to show the title with the correct H1-H6 tag *@ @Html.Partial("../Shared/_Header tag.cshtml", new { Title = Header.Title })
- @foreach (var listItem in AsList(Data)) { + @foreach (var listItem in AsList(Data)) { var linkInfo = linkHelper.LinkInfos(listItem); var isLocalFile = !listItem.FileLink.Contains("http"); diff --git a/bs5/_Folder.cshtml b/bs5/_Folder.cshtml new file mode 100644 index 0000000..29fcc90 --- /dev/null +++ b/bs5/_Folder.cshtml @@ -0,0 +1,43 @@ +@inherits Custom.Hybrid.Razor14 +@using ToSic.Razor.Blade; +@{ + // get helper commands + var linkHelper = CreateInstance("../Shared/LinkHelper.cs"); + + Kit.Page.Activate("Fontawesome5"); + + var fileMetadataToolbar = Kit.Toolbar.Empty().Edit().Add(); +} + +
+

@Content.Title

+
+ @foreach (var file in AsAdam(Content,"Files").Files) { + var fileTitle = Text.First(file.Metadata.Title, file.Name); + + + + + @fileTitle + @{ + var sizeInfo = Kit.Adam.File(file.Id).SizeInfo; + } + @if(sizeInfo.BestSize > 0){ + (@sizeInfo.BestSize.ToString("#.##") @sizeInfo.BestUnit) + } else { + (0 KB) + } + + @Html.Raw(file.Metadata.Description) + + + + } + + @foreach(var folder in AsAdam(Content, "Files").Folders) { + @Html.Partial("_Subfolder.cshtml", new { Folder = folder, Level = 2 }) + } +
+
+ +@Html.Partial("../Shared/_Assets.cshtml") diff --git a/bs5/_Subfolder.cshtml b/bs5/_Subfolder.cshtml new file mode 100644 index 0000000..4f0c477 --- /dev/null +++ b/bs5/_Subfolder.cshtml @@ -0,0 +1,51 @@ +@inherits Custom.Hybrid.Razor14 +@using System.Text.RegularExpressions; +@using ToSic.Razor.Blade; +@{ + var Folder = DynamicModel.Folder as ToSic.Sxc.Adam.IFolder; + + var level = DynamicModel.Level; + + var linkHelper = CreateInstance("../Shared/LinkHelper.cs"); + + var fileMetadataToolbar = Kit.Toolbar.Empty().Edit().Add(); +} + + +@{ + level = level + 1; +} +
+ @if(AsList(Folder.Files) != null){ + foreach(var file in AsList(Folder.Files)){ + var fileTitle = Text.First(file.Metadata.Title, file.FullName); + var linkInfo = linkHelper.LinkInfos(file.Path, "", file.Metadata.Icon); + + + + + @fileTitle + @{ + var sizeInfo = Kit.Adam.File(file.Id).SizeInfo; + } + @if(sizeInfo.BestSize > 0){ + (@sizeInfo.BestSize.ToString("#.##") @sizeInfo.BestUnit) + } else { + (0 KB) + } + + @Html.Raw(file.Metadata.Description) + + + + } + } + @if(AsList(Folder.Files) != null){ + foreach(var folder in AsList(Folder.Folders)){ + @Html.Partial("_Subfolder.cshtml", new { Folder = folder, Level = level }) + } + } +
\ No newline at end of file diff --git a/bs5/dist/scripts.min.js b/bs5/dist/scripts.min.js index e69de29..ef983c1 100644 --- a/bs5/dist/scripts.min.js +++ b/bs5/dist/scripts.min.js @@ -0,0 +1,2 @@ +!function(){var o=window.location.search;console.log("the url is:"+o),new URLSearchParams(o)}(),document.querySelectorAll(".folder").forEach((function(o){})); +//# sourceMappingURL=scripts.min.js.map \ No newline at end of file diff --git a/bs5/dist/scripts.min.js.map b/bs5/dist/scripts.min.js.map new file mode 100644 index 0000000..3bb7861 --- /dev/null +++ b/bs5/dist/scripts.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"scripts.min.js","mappings":"CAGA,WACE,IAAIA,EAAcC,OAAOC,SAASC,OAClCC,QAAQC,IAAI,cAAgBL,GACV,IAAIM,gBAAgBN,GALxCO,GAQiBC,SAASC,iBAAiB,WAChCC,SAAQ,SAAAC","sources":["webpack://app-success-story/./src/ts/index.ts"],"sourcesContent":["\r\ncheckCollapseState();\r\n\r\nfunction checkCollapseState(){\r\n var queryString = window.location.search;\r\n console.log(\"the url is:\" + queryString);\r\n const urlParams = new URLSearchParams(queryString)\r\n}\r\n\r\nvar allFolders = document.querySelectorAll(\".folder\");\r\nallFolders.forEach(element => {\r\n // element.addEventListener(\"click\", setUrlParameters(element));\r\n});\r\n\r\nvar folders: { [id: number] : number };\r\n\r\nfunction setUrlParameters(folder: any){ \r\n var folderLevel = folder.folderId;\r\n var folderId = folder.folderLevel;\r\n console.log(\"set started\")\r\n if(folderId in folders){\r\n delete folders[folderId];\r\n } else {\r\n for(var singleFolder in folders){\r\n if(folders[singleFolder] < folderLevel){\r\n delete folders[singleFolder];\r\n folders[folderId] = folderLevel;\r\n } else if(folders[singleFolder] == folderLevel){\r\n folders[folderId] = folderLevel\r\n }\r\n }\r\n }\r\n var paramters = \"arg=1\";\r\n var refresh = window.location.protocol + \"//\" + window.location.host + window.location.pathname + '?' + folders; \r\n window.history.pushState({ path: refresh }, '', refresh);\r\n}"],"names":["queryString","window","location","search","console","log","URLSearchParams","checkCollapseState","document","querySelectorAll","forEach","element"],"sourceRoot":""} \ No newline at end of file diff --git a/bs5/dist/styles.min.css b/bs5/dist/styles.min.css index f2af596..a64c99a 100644 --- a/bs5/dist/styles.min.css +++ b/bs5/dist/styles.min.css @@ -2,6 +2,6 @@ * This file was auto-generated using SASS * You can manually modify it - but usually you will want to * Re-generate it using the SASS variables of your theme -*/@media all{.app-filelist .list-group a>svg{width:20px;margin-right:4px}} +*/@media all{.app-filelist .list-group a>svg{width:20px;margin-right:4px}.description-wrapper p{margin:0 !important}} /*# sourceMappingURL=styles.min.css.map*/ \ No newline at end of file diff --git a/bs5/dist/styles.min.css.map b/bs5/dist/styles.min.css.map index 84652a1..c6960db 100644 --- a/bs5/dist/styles.min.css.map +++ b/bs5/dist/styles.min.css.map @@ -1 +1 @@ -{"version":3,"file":"styles.min.css","mappings":"AAEA;;;;CAAA,CCEA,WAIQ,gCACE,WACA,kB","sources":["webpack://app-success-story/./bs5/styles/_sass-comments.scss","webpack://app-success-story/./bs5/styles/_style.scss"],"sourcesContent":["// the following comment is multi-line and will be included in the final CSS\r\n// which helps users understand where it comes from\r\n/*!\r\n * This file was auto-generated using SASS\r\n * You can manually modify it - but usually you will want to \r\n * Re-generate it using the SASS variables of your theme\r\n*/","// This SCSS generates the css for the general styles\r\n// To keep things simple, it uses the standard variables of\r\n// bootstrap 4 conventions.\r\n\r\n@media all {\r\n .app-filelist {\r\n .list-group {\r\n a > {\r\n svg {\r\n width: 20px;\r\n margin-right: 4px;\r\n }\r\n }\r\n }\r\n }\r\n}"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"styles.min.css","mappings":"AAEA;;;;CAAA,CCEA,WAIQ,gCACE,WACA,iBAON,uBACE,qB","sources":["webpack://app-success-story/./bs5/styles/_sass-comments.scss","webpack://app-success-story/./bs5/styles/_style.scss"],"sourcesContent":["// the following comment is multi-line and will be included in the final CSS\r\n// which helps users understand where it comes from\r\n/*!\r\n * This file was auto-generated using SASS\r\n * You can manually modify it - but usually you will want to \r\n * Re-generate it using the SASS variables of your theme\r\n*/","// This SCSS generates the css for the general styles\r\n// To keep things simple, it uses the standard variables of\r\n// bootstrap 4 conventions.\r\n\r\n@media all {\r\n .app-filelist {\r\n .list-group {\r\n a > {\r\n svg {\r\n width: 20px;\r\n margin-right: 4px;\r\n }\r\n }\r\n }\r\n }\r\n\r\n .description-wrapper{\r\n p{\r\n margin: 0!important;\r\n }\r\n }\r\n}"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/bs5/styles/_style.scss b/bs5/styles/_style.scss index d334dcf..5956e70 100644 --- a/bs5/styles/_style.scss +++ b/bs5/styles/_style.scss @@ -13,4 +13,10 @@ } } } + + .description-wrapper{ + p{ + margin: 0!important; + } + } } \ No newline at end of file diff --git a/src/ts/index.ts b/src/ts/index.ts new file mode 100644 index 0000000..8105010 --- /dev/null +++ b/src/ts/index.ts @@ -0,0 +1,36 @@ + +// checkCollapseState(); + +// function checkCollapseState(){ +// var queryString = window.location.search; +// console.log("the url is:" + queryString); +// const urlParams = new URLSearchParams(queryString) +// } + +// var allFolders = document.querySelectorAll(".folder"); +// allFolders.forEach(element => { +// // element.addEventListener("click", setUrlParameters(element)); +// }); + +// var folders: { [id: number] : number }; + +// function setUrlParameters(folder: any){ +// var folderLevel = folder.folderId; +// var folderId = folder.folderLevel; +// console.log("set started") +// if(folderId in folders){ +// delete folders[folderId]; +// } else { +// for(var singleFolder in folders){ +// if(folders[singleFolder] < folderLevel){ +// delete folders[singleFolder]; +// folders[folderId] = folderLevel; +// } else if(folders[singleFolder] == folderLevel){ +// folders[folderId] = folderLevel +// } +// } +// } +// var paramters = "arg=1"; +// var refresh = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + folders; +// window.history.pushState({ path: refresh }, '', refresh); +// } \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 30cf6cd..5527076 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -5,6 +5,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin'); module.exports = (env) => { return { entry: { + scripts: `./src/ts/index.ts`, styles: `./${env.style}/styles/${env.style}.scss`, }, output: {