Skip to content

Commit 11558ca

Browse files
committed
Add API IsService
Fixed some thinking the add-on was available when it wasnt.
1 parent fe33aca commit 11558ca

38 files changed

Lines changed: 2958 additions & 915 deletions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ As of version 1.2.0 this library facilitates being able to write the same code f
1111
[MeadCo's ScriptX Services](https://scriptxservices.meadroid.com) browser agnostic printing services in the cloud, on premise and on Windows PC.
1212
The dependency on the [ScriptX Service Client Library](https://github.com/MeadCo/ScriptX.Print.Client) is required for this to work.
1313

14-
v1.5 Adds support for ScriptX Services on Windows PC.
14+
v1.5 Added support for ScriptX Services on Windows PC.
1515

1616
## Current version
17-
1.5.5
17+
1.6.0
1818

1919
## Packages
2020

@@ -30,7 +30,7 @@ npm install meadco-scriptxjs --save
3030
### CDN Use
3131

3232
```html
33-
<script src="https://cdn.jsdelivr.net/npm/meadco-scriptxjs@1.5.5/dist/meadco-scriptx.min.js"></script>
33+
<script src="https://cdn.jsdelivr.net/npm/meadco-scriptxjs@1.6.0/dist/meadco-scriptx.min.js"></script>
3434
```
3535

3636
## Quick start for working with ScriptX Add-on only

ScriptXJSTest/ScriptXJSTest.csproj

Lines changed: 40 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
4-
<Import Project="..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" />
3+
<Import Project="..\packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props')" />
4+
<Import Project="..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props" Condition="Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" />
55
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
66
<PropertyGroup>
77
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -45,11 +45,16 @@
4545
<WarningLevel>4</WarningLevel>
4646
</PropertyGroup>
4747
<ItemGroup>
48-
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
49-
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
50-
<Private>True</Private>
48+
<Reference Include="Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
49+
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
50+
</Reference>
51+
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
52+
<HintPath>..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
5153
</Reference>
5254
<Reference Include="Microsoft.CSharp" />
55+
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
56+
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
57+
</Reference>
5358
<Reference Include="System" />
5459
<Reference Include="System.Data" />
5560
<Reference Include="System.Drawing" />
@@ -59,6 +64,21 @@
5964
<Reference Include="System.ComponentModel.DataAnnotations" />
6065
<Reference Include="System.Core" />
6166
<Reference Include="System.Data.DataSetExtensions" />
67+
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
68+
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.Helpers.dll</HintPath>
69+
</Reference>
70+
<Reference Include="System.Web.Mvc, Version=5.2.7.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
71+
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.7\lib\net45\System.Web.Mvc.dll</HintPath>
72+
</Reference>
73+
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
74+
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.dll</HintPath>
75+
</Reference>
76+
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
77+
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
78+
</Reference>
79+
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80+
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.7\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
81+
</Reference>
6282
<Reference Include="System.Xml.Linq" />
6383
<Reference Include="System.Web" />
6484
<Reference Include="System.Web.Extensions" />
@@ -76,45 +96,15 @@
7696
</Reference>
7797
<Reference Include="System.Net.Http.WebRequest">
7898
</Reference>
79-
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
80-
<Private>True</Private>
81-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll</HintPath>
82-
</Reference>
83-
<Reference Include="System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
84-
<Private>True</Private>
85-
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
86-
</Reference>
8799
<Reference Include="System.Web.Optimization">
88100
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
89101
</Reference>
90102
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
91103
<Private>True</Private>
92-
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
93-
</Reference>
94-
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
95-
<Private>True</Private>
96-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.dll</HintPath>
97-
</Reference>
98-
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
99-
<Private>True</Private>
100-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
101-
</Reference>
102-
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
103-
<Private>True</Private>
104-
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
105-
</Reference>
106-
<Reference Include="WebGrease">
107-
<Private>True</Private>
108-
<HintPath>..\packages\WebGrease.1.5.2\lib\WebGrease.dll</HintPath>
104+
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.7\lib\net45\System.Web.Razor.dll</HintPath>
109105
</Reference>
110-
<Reference Include="Antlr3.Runtime">
111-
<Private>True</Private>
112-
<HintPath>..\packages\Antlr.3.4.1.9004\lib\Antlr3.Runtime.dll</HintPath>
113-
</Reference>
114-
</ItemGroup>
115-
<ItemGroup>
116-
<Reference Include="Newtonsoft.Json">
117-
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
106+
<Reference Include="WebGrease, Version=1.6.5135.21930, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
107+
<HintPath>..\packages\WebGrease.1.6.0\lib\WebGrease.dll</HintPath>
118108
</Reference>
119109
</ItemGroup>
120110
<ItemGroup>
@@ -137,13 +127,13 @@
137127
<Content Include="Scripts\bootstrap.js" />
138128
<Content Include="Scripts\bootstrap.min.js" />
139129
<None Include="bundleconfig.json" />
140-
<None Include="Scripts\jquery-3.3.1.intellisense.js" />
141-
<Content Include="Scripts\jquery-3.3.1.js" />
142-
<Content Include="Scripts\jquery-3.3.1.min.js" />
143-
<Content Include="Scripts\jquery-3.3.1.slim.js" />
144-
<Content Include="Scripts\jquery-3.3.1.slim.min.js" />
145-
<Content Include="Scripts\jquery-3.3.1.slim.min.map" />
146-
<Content Include="Scripts\jquery-3.3.1.min.map" />
130+
<None Include="Scripts\jquery-3.4.1.intellisense.js" />
131+
<Content Include="Scripts\jquery-3.4.1.js" />
132+
<Content Include="Scripts\jquery-3.4.1.min.js" />
133+
<Content Include="Scripts\jquery-3.4.1.slim.js" />
134+
<Content Include="Scripts\jquery-3.4.1.slim.min.js" />
135+
<Content Include="Scripts\jquery-3.4.1.slim.min.map" />
136+
<Content Include="Scripts\jquery-3.4.1.min.map" />
147137
<None Include="Scripts\jquery.validate-vsdoc.js" />
148138
<Content Include="Scripts\jquery.validate.js" />
149139
<Content Include="Scripts\jquery.validate.min.js" />
@@ -158,8 +148,11 @@
158148
<Content Include="Scripts\MeadCo.ScriptX\meadco-scriptxprintpdf.js" />
159149
<Content Include="Scripts\MeadCo.ScriptX\meadco-secmgr.js" />
160150
<Content Include="Scripts\modernizr-2.6.2.js" />
151+
<Content Include="Scripts\modernizr-2.8.3.js" />
161152
<Content Include="Scripts\promise.min.js" />
162153
<Content Include="Scripts\respond.js" />
154+
<Content Include="Scripts\respond.matchmedia.addListener.js" />
155+
<Content Include="Scripts\respond.matchmedia.addListener.min.js" />
163156
<Content Include="Scripts\respond.min.js" />
164157
<Content Include="Scripts\_references.js" />
165158
<Content Include="Web.config" />
@@ -223,8 +216,8 @@
223216
<PropertyGroup>
224217
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
225218
</PropertyGroup>
226-
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.1.0.0\build\Microsoft.Net.Compilers.props'))" />
227-
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.0\build\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
219+
<Error Condition="!Exists('..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props'))" />
220+
<Error Condition="!Exists('..\packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Net.Compilers.3.0.0\build\Microsoft.Net.Compilers.props'))" />
228221
</Target>
229222
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
230223
Other similar extension points exist, see Microsoft.Common.targets.

ScriptXJSTest/Scripts/MeadCo.ScriptX/jQuery-MeadCo.ScriptX.Print.UI.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
var ui = MeadCo.createNS("MeadCo.ScriptX.Print.UI");
2727

28-
ui.moduleversion = "1.5.7.0";
28+
ui.moduleversion = "1.5.8.0";
2929

3030
// MeadCo.ScriptX.Print.UI.AttachPrintAction(
3131
// el - clickable html element

ScriptXJSTest/Scripts/MeadCo.ScriptX/meadco-core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
// protected API
5656
var module = this;
57-
var version = "1.5.7.0";
57+
var version = "1.5.8.0";
5858
var bLog = false;
5959

6060
var log = function (str) {

ScriptXJSTest/Scripts/MeadCo.ScriptX/meadco-scriptxfactory.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
})('factory', function () {
8484
// If this is executing, we believe we are needed.
8585
// protected API
86-
var moduleversion = "1.5.7.0";
86+
var moduleversion = "1.5.8.0";
8787
var emulatedVersion = "8.2.0.0";
8888
var module = this;
8989

@@ -870,6 +870,24 @@
870870
printApi.reportFeatureNotImplemented("onuserprintpreview", fn);
871871
},
872872

873+
DefaultPrinter: function () {
874+
var i = 0;
875+
var printerName = this.printer;
876+
877+
// optimise that the current printer is the default (often will be)
878+
if (printerName !== "" && printApi.deviceSettingsFor(printerName).isDefault) {
879+
return printerName;
880+
}
881+
else {
882+
while ((printerName = this.EnumPrinters(i++)) !== "") {
883+
if (printApi.deviceSettingsFor(printerName).isDefault) {
884+
return printerName;
885+
}
886+
}
887+
}
888+
return "";
889+
},
890+
873891
// duplicate to cope with COM objects were/are not case sensitive
874892
get CurrentPrinter() {
875893
return printApi.printerName;
@@ -1143,6 +1161,9 @@
11431161

11441162
// helpers for wrapper MeadCoJS
11451163
PolyfillInit: function () {
1164+
if (!MeadCo.ScriptX.Print.isConnected) {
1165+
printHtml.connect("", "");
1166+
}
11461167
return MeadCo.ScriptX.Print.isConnected;
11471168
},
11481169

ScriptXJSTest/Scripts/MeadCo.ScriptX/meadco-scriptxprint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
extendMeadCoNamespace(name, definition);
2020
})('MeadCo.ScriptX.Print', function () {
2121
// module version and the api we are coded for
22-
var version = "1.5.7.0";
22+
var version = "1.5.8.0";
2323
var htmlApiLocation = "v1/printHtml";
2424
var pdfApiLocation = "v1/printPdf";
2525

ScriptXJSTest/Scripts/MeadCo.ScriptX/meadco-scriptxprinthtml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
extendMeadCoNamespace(name, definition);
2020
})('MeadCo.ScriptX.Print.HTML', function () {
2121

22-
var moduleversion = "1.5.7.0";
22+
var moduleversion = "1.5.8.0";
2323

2424
/**
2525
* Enum to describe the units used on measurements - please use MeadCo.ScriptX.Print.MeasurementUnits instead

ScriptXJSTest/Scripts/MeadCo.ScriptX/meadco-scriptxprintlicensing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
; (function (name, definition) {
2525
extendMeadCoNamespace(name, definition);
2626
})('MeadCo.ScriptX.Print.Licensing', function () {
27-
var moduleversion = "1.5.7.0";
27+
var moduleversion = "1.5.8.0";
2828
var apiLocation = "v1/licensing";
2929

3030
var server = ""; // url to the server, server is CORS restricted

ScriptXJSTest/Scripts/MeadCo.ScriptX/meadco-scriptxprintpdf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
extendMeadCoNamespace(name, definition);
2121
})('MeadCo.ScriptX.Print.PDF', function () {
2222

23-
var moduleversion = "1.5.7.0";
23+
var moduleversion = "1.5.8.0";
2424

2525
/**
2626
* Enum to describe the orientation of the paper

ScriptXJSTest/Scripts/MeadCo.ScriptX/meadco-secmgr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
})('secmgr', function () {
6262

6363
// protected API
64-
var moduleversion = "1.5.7.0";
64+
var moduleversion = "1.5.8.0";
6565
var emulatedVersion = "8.2.0.0";
6666
var module = this;
6767

0 commit comments

Comments
 (0)