Skip to content

Commit

Permalink
Update docs, demo v ref
Browse files Browse the repository at this point in the history
  • Loading branch information
Tewr committed Jul 30, 2021
1 parent 789eb46 commit 6c2f0ef
Show file tree
Hide file tree
Showing 8 changed files with 233 additions and 62 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -11,7 +11,7 @@ Blazor library exposing read-only file streams in [Blazor](https://github.com/do
using ```<input type="file" />```
and [FileReader](https://developer.mozilla.org/en-US/docs/Web/API/FileReader). Drag and drop targets may also be used to initialize streams.

Here is a [Live demo](https://tewr.github.io/BlazorFileReader/) that contains the output of [the wasm demo project](src/Demo/Blazor.FileReader.Wasm.Demo). Currently, its a build based on ```v2.0.0```.
Here is a [Live demo](https://tewr.github.io/BlazorFileReader/) that contains the output of [the wasm demo project](src/Demo/Blazor.FileReader.Wasm.Demo). Currently, its a build based on ```v3.2.0```.

## Installation

Expand Down Expand Up @@ -40,7 +40,7 @@ services.AddFileReaderService();
```
## Documentation

The public API is documented [here](src/Blazor.FileReader/Blazor.FileReader.md), generated from the XML comments.
The public API is documented [here](src/Blazor.FileReader/Tewr.Blazor.FileReader.md), generated from the XML comments.

To get started, the best is to look at the example razor files in the [demo project](src/Demo/Blazor.FileReader.Demo.Common).

Expand Down
2 changes: 1 addition & 1 deletion src/Blazor.FileReader/Blazor.FileReader.csproj
Expand Up @@ -30,7 +30,7 @@

<PropertyGroup>
<NoWarn>1701;1702;NU5104</NoWarn>
<DocumentationFile>Blazor.FileReader.xml</DocumentationFile>
<DocumentationFile>Tewr.Blazor.FileReader.xml</DocumentationFile>
</PropertyGroup>

<Target Name="BundleTypescript" BeforeTargets="CreateManifestResourceNames" Condition="'$(Configuration)'=='Debug'">
Expand Down
File renamed without changes.
222 changes: 207 additions & 15 deletions src/Blazor.FileReader/Tewr.Blazor.FileReader.xml

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions src/Blazor.FileReader/wwwroot/FileReaderComponent.js
Expand Up @@ -12,7 +12,6 @@
define("FileReaderJsInterop", ["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileReaderJsInterop = void 0;
var FileReaderJsInterop = (function () {
function FileReaderJsInterop() {
}
Expand All @@ -30,7 +29,6 @@
define("ConcatFileList", ["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConcatFileList = void 0;
var ConcatFileList = (function () {
function ConcatFileList(existing, additions) {
for (var i = 0; i < existing.length; i++) {
Expand Down Expand Up @@ -65,7 +63,6 @@
define("DragnDrop", ["require", "exports", "FileReaderJsInterop", "ConcatFileList"], function (require, exports, FileReaderJsInterop_1, ConcatFileList_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnregisterDropEvents = exports.RegisterDropEvents = exports.BuildDragEventHandler = void 0;
var nameof = function (name) { return name; };
var dropEvent = nameof("drop");
var dragOverEvent = nameof("dragover");
Expand Down Expand Up @@ -148,7 +145,6 @@
define("FileReaderComponent", ["require", "exports", "DragnDrop", "Clipboard", "FileReaderJsInterop"], function (require, exports, DragnDrop_1, Clipboard_1, FileReaderJsInterop_2) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FileReaderComponentInstance = exports.FileReaderComponent = void 0;
var FileReaderComponent = (function () {
function FileReaderComponent() {
var _this = this;
Expand Down Expand Up @@ -340,7 +336,6 @@
define("Clipboard", ["require", "exports", "ConcatFileList"], function (require, exports, ConcatFileList_2) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnregisterPasteEvent = exports.RegisterPasteEvent = void 0;
function RegisterPasteEvent(element, registerOptions) {
var _this = this;
this.LogIfNull(element);
Expand Down
2 changes: 1 addition & 1 deletion src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map

Large diffs are not rendered by default.

Expand Up @@ -7,62 +7,56 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<ProjectGuid>9fa01c57-bbb5-420e-aa9b-ad22f39b77ed</ProjectGuid>
<publishUrl>C:\Users\Tor\source\repos\GH-PAGES\BlazorFileReader\out</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<TargetFramework>netstandard2.1</TargetFramework>
<publishUrl>C:\git\GH-PAGES\BlazorFileReader\out</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
<TargetFramework>net5.0</TargetFramework>
<SelfContained>false</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>



<UsingTask TaskName="TokenReplace" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Path ParameterType="System.String" Required="true" />
<Token ParameterType="System.String" Required="true" />
<Replacement ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
<Code Type="Fragment" Language="cs"><![CDATA[
string content = File.ReadAllText(Path);
content = content.Replace(Token, Replacement);
File.WriteAllText(Path, content);
]]>
</Code>
]]></Code>
</Task>
</UsingTask>


<Target Name="RemoveDirectoriesBefore" BeforeTargets="Publish">
<RemoveDir Directories="$(PublishUrl).." />
</Target>

<Target Name="FixBasePathafterPublish" AfterTargets="Publish" >
<Message Text="Replacing tokens in '$(PublishDir)\$(ProjectName)\dist\index.html'..."></Message>
<TokenReplace Path="$(PublishDir)\wwwroot\index.html" Token="&lt;base href=&quot;/&quot; /&gt;" Replacement="&lt;base href=&quot;/BlazorFileReader/&quot; /&gt;"/>
<Target Name="FixBasePathafterPublish" AfterTargets="Publish">
<Message Text="Replacing tokens in '$(PublishDir)\$(ProjectName)\dist\index.html'...">
</Message>
<TokenReplace Path="$(PublishDir)\wwwroot\index.html" Token="&lt;base href=&quot;/&quot; /&gt;" Replacement="&lt;base href=&quot;/BlazorFileReader/&quot; /&gt;" />
</Target>

<Target Name="CopyToFinalFolder" AfterTargets="AfterPublish" >
<Message Text="Copying '$(PublishUrl)\wwwroot' to '$(PublishUrl)..'" Importance="high"></Message>
<Target Name="CopyToFinalFolder" AfterTargets="AfterPublish">
<Message Text="Copying '$(PublishUrl)\wwwroot' to '$(PublishUrl)..'" Importance="high">
</Message>
<Exec Command="(robocopy $(PublishUrl)\wwwroot $(PublishUrl).. /e /mt /njh /njs /ndl /nc /ns ) ^&amp; IF %ERRORLEVEL% LEQ 1 exit 0" IgnoreExitCode="true" />
</Target>

<Target Name="RemoveDirectories" AfterTargets="CopyToFinalFolder">
<RemoveDir Directories="$(PublishUrl)" />
</Target>

<Target Name="gh-pages publish" AfterTargets="RemoveDirectories" >
<Message Text="Commiting to github...'" Importance="high"></Message>
<Exec WorkingDirectory="$(PublishUrl).." Command="git checkout gh-pages" />
<Target Name="gh-pages publish" AfterTargets="RemoveDirectories">
<Message Text="Commiting to github...'" Importance="high">
</Message>
<Exec WorkingDirectory="$(PublishUrl).." Command="git fetch origin" />
<Exec WorkingDirectory="$(PublishUrl).." Command="git reset --hard origin/gh-pages" />
<Exec WorkingDirectory="$(PublishUrl).." Command="git pull" />
<Exec WorkingDirectory="$(PublishUrl).." Command="git add ." />
<Exec WorkingDirectory="$(PublishUrl).." Command="git commit -m &quot;Publish&quot;"/>
<Exec WorkingDirectory="$(PublishUrl).." Command="git push" ContinueOnError="true"/>
<Exec WorkingDirectory="$(PublishUrl).." Command="git commit -m &quot;Publish&quot;" />
<Exec WorkingDirectory="$(PublishUrl).." Command="git push" ContinueOnError="true" />
</Target>

</Project>
10 changes: 0 additions & 10 deletions src/Demo/Blazor3/Blazor.FileReader.Wasm.Demo/Shared/NavMenu.razor
Expand Up @@ -42,16 +42,6 @@
<span class="oi oi-clipboard" aria-hidden="true"></span> Paste
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="JSObjectReference">
<span class="oi oi-share-boxed" aria-hidden="true"></span> JSObjectReference
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="ObjectUrl">
<span class="oi oi-link-intact" aria-hidden="true"></span> Object Url
</NavLink>
</li>
<li class="nav-item px-3">
<NavLink class="nav-link" href="https://github.com/tewr/BlazorFileReader">
<span class="oi oi-fork" aria-hidden="true"></span> To the source!
Expand Down

0 comments on commit 6c2f0ef

Please sign in to comment.