Skip to content

Commit

Permalink
Merge pull request #43 from skartknet/release/v5.4.0
Browse files Browse the repository at this point in the history
Release/v5.4.0
  • Loading branch information
skartknet authored Oct 1, 2023
2 parents 444ec02 + 283f652 commit a72dc06
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 17 deletions.
23 changes: 19 additions & 4 deletions Documentation/Configuration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,30 @@ If everything is configured properly, and Iconic can extract a list of your icon

![Icon preview](icon-preview.png)

### Saving your configuration
Click the *Add Package* button to add the configuration to your packages listing. Before adding the package, Iconic will extract the css rules from the file using the regex selector. Some checking is ran that will let you know if something went wrong with your configuration.


## <a name="preconfigured"></a>Pre configured packages
To make your life easier we have included some help to configure your packages in the form of pre-configured packages. If you select *Pre-Configured* when creating your package, you will have access to a list of pre-configured ones. You will still have to enter your css file path.

![Pre-configured package](addPreConfig.png)

### User preconfigurations

You can add as many packages you like. You can also arrange their order or remove those you don't want to use anymore.
You can add your own preconfigurations. For this to work you will need to create an `/App_Plugins/Iconic/` file in your project and add the desired configurations in there. This file needs to look like:

**Note**: the regex included in the preconfigs are valid for the **minimised versions** of them.
``` json
{
"preconfigs": [
{
"name": "My custom config",
"selector": "\\.(glyphicon-[\\w-]+):before{",
"template": "<i class=\"glyphicon {icon}\"></i>"
}
]
}
```
These configs will be added to the Iconic preconfigs.

### Saving your configuration
Click the *Add Package* button to add the configuration to your packages listing. Before adding the package, Iconic will extract the css rules from the file using the regex selector. Some checking is ran that will let you know if something went wrong with your configuration.
Note that the new config objects go in a `preconfigs` array and need to specify three properties: name, selector and template.
9 changes: 8 additions & 1 deletion Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ If you have information to share about how to configure a specific icon set, or
To contribute [Code](https://github.com/skartknet/Iconic/pulls), [Issues/Bugs](https://github.com/skartknet/Iconic/issues), [Ideas, etc.](https://github.com/skartknet/Iconic/discussions) check out the [GitHub site](https://github.com/skartknet/Iconic).

## Need Help?
Head over to the [Discussions section](https://github.com/skartknet/Iconic/discussions/categories/q-a) to see if anyone else has solved you particular issue, or [add your own "Q&A" categorized post](https://github.com/skartknet/Iconic/discussions/new?category=q-a).
Head over to the [Discussions section](https://github.com/skartknet/Iconic/discussions/categories/q-a) to see if anyone else has solved you particular issue, or [add your own "Q&A" categorized post](https://github.com/skartknet/Iconic/discussions/new?category=q-a).

# Changelog

## v5.4
- Update Material icons codepoints
- Fixed Rules source file not taking default CSS file is empty. (#41)
- Added support for user preconfigs
2 changes: 1 addition & 1 deletion Our.Iconic/Our.Iconic.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</Description>
<Product>$(AssemblyName)</Product>
<PackageTags>umbraco plugin package icon picker editor backoffice umbraco-marketplace</PackageTags>
<Version>5.3.0</Version>
<Version>5.4.0</Version>
<Authors>Mario Lopez</Authors>
<PackageProjectUrl>https://github.com/Skartknet/Iconic</PackageProjectUrl>
<PackageIcon>iconic_logo.png</PackageIcon>
Expand Down
8 changes: 2 additions & 6 deletions Our.Iconic/wwwroot/Views/iconic.edit.dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,11 @@

<div class="flex">
<label class="control-label">File Path: </label>
<input type="text" class="umb-property-editor" name="editSourceFile" required ng-model="model.package.sourcefile" placeholder="Enter partial or absolute URL, or select from the filesystem." />
<input type="text" class="umb-property-editor" name="editSourceFile" ng-model="model.package.sourcefile" placeholder="Enter partial or absolute URL, or select from the filesystem." />

<umb-button action="openRulesFilePicker()" label="Select" type="button"></umb-button>

</div>

<span ng-messages="packageForm.editSourceFile.$error" show-validation-on-submit>
<span class="help-inline" ng-message="required"><localize key="iconicValidation_rules">Please select a valid CSS file</localize></span>
</span>
</umb-control-group>

</fieldset>
Expand All @@ -93,7 +89,7 @@
</div>
<button ng-click="removeFilteredIcon($index)" class="button-remove" prevent-default>
<localize key="general_remove" class="ng-isolate-scope">Remove</localize>
</umb-button>
</button>
</div>

<div class="umb-panel-header-icon" ng-click="openFilterIconsOverlay()">
Expand Down
27 changes: 23 additions & 4 deletions Our.Iconic/wwwroot/js/src/iconic.prevalues.editor.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,38 @@
}

function loadPreConfigs() {
$http
return $http
.get(
umbRequestHelper.convertVirtualToAbsolutePath(
"~/App_Plugins/Iconic/preconfigs.json"
)
)
.then(
function (response) {
$scope.preconfig = response.data.preconfigs;
$scope.preconfig = response.data.preconfigs;
},
function () {
displayError("iconicErrors_loading_preconfigs");
}
);
}
}

function loadUserPreConfigs() {
$http
.get(
umbRequestHelper.convertVirtualToAbsolutePath(
"~/App_Plugins/Iconic/preconfigs.user.json"
)
)
.then(
function (response) {
$scope.preconfig = $scope.preconfig.concat(response.data.preconfigs);
},
function () {
displayError("iconicErrors_loading_userpreconfigs");
}
);
}

function isExternalUri(uri) {
return uri.indexOf("://") > -1;
Expand Down Expand Up @@ -261,7 +278,9 @@
);
}

loadPreConfigs();
loadPreConfigs().then(function () {
loadUserPreConfigs();
});;
$scope.loadPreview();
}
);
1 change: 1 addition & 0 deletions Our.Iconic/wwwroot/lang/en-US.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<area alias="iconicErrors">
<key alias="analysing">There was an error extracting icon rules. Please check the files' paths and selector regex.</key>
<key alias="loading_preconfigs">Error loading the preconfigs file.</key>
<key alias="loading_userpreconfigs">Error loading the user preconfigs file.</key>
<key alias="loadingCss">Error loading the CSS file.</key>
<key alias="no_rules">No icons were extracted, please check that the selector regex is correct.</key>
<key alias="regexIssue">Error loading the regex, please check that it is a valid selector.</key>
Expand Down
9 changes: 9 additions & 0 deletions UmbracoV12/App_Plugins/Iconic/preconfigs.user.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"preconfigs": [
{
"name": "Test1",
"selector": "\\.(glyphicon-[\\w-]+):before{",
"template": "<i class=\"glyphicon {icon}\"></i>"
}
]
}
7 changes: 7 additions & 0 deletions UmbracoV12/UmbracoV12.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<Content Include="app_plugins\iconic\preconfigs.user.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Umbraco.Cms" Version="12.0.0" />
Expand All @@ -16,6 +19,10 @@
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2.0.9" Condition="$(RuntimeIdentifier.StartsWith('linux')) or $(RuntimeIdentifier.StartsWith('win')) or ('$(RuntimeIdentifier)' == '' and !$([MSBuild]::IsOSPlatform('osx')))" />
</ItemGroup>

<ItemGroup>
<Folder Include="App_Plugins\Iconic\" />
</ItemGroup>

<PropertyGroup>
<!-- Razor files are needed for the backoffice to work correctly -->
<CopyRazorGenerateFilesToPublishDirectory>true</CopyRazorGenerateFilesToPublishDirectory>
Expand Down
2 changes: 1 addition & 1 deletion UmbracoV12/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
},
"RuntimeMinification": {
"UseInMemoryCache": true,
"CacheBuster": "Timestamp"
"CacheBuster": "AppDomain"
}
}
}
Expand Down

0 comments on commit a72dc06

Please sign in to comment.