Skip to content

Commit

Permalink
Build 1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PeteGCole committed Oct 16, 2020
1 parent ff94f91 commit 5596525
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ npm install meadco-scriptxjs --save

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

1. Link to meadco-scriptx.js `<script src="meadco-scriptx.js"></script>`
1. Link to meadco-scriptx.js `<script src="https://cdn.jsdelivr.net/npm/meadco-scriptxjs@1/dist/meadco-scriptx.min.js"></script>`
2. Initialise the library in the document ready/window loaded event handler, and initialise printing parameters. For example, when using jQuery:

```javascript
Expand Down Expand Up @@ -86,19 +86,18 @@ A promise polyfill is required if the browser does not support promises (for exa
We recommend (and test with) [Promise Polyfill](https://github.com/taylorhakes/promise-polyfill)

```javascript
<script src="/scripts/meadco-scriptx.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meadco-scriptxjs@1/dist/meadco-scriptx.min.js"></script>

<!-- ScriptX Services client emulation libraries - depend on jQuery -->
<script src="/scripts/jquery-3.1.1.js"></script>

<script src="/scripts/MeadCo.ScriptX/core.js"></script>
<script src="/scripts/MeadCo.ScriptX/scriptxprint.js"></script>
<script src="/scripts/MeadCo.ScriptX/scriptxprinthtml.js"></script>
<script src="/scripts/MeadCo.ScriptX/scriptxfactory.js"
<!-- A promise library will be required if also targetting IE 11. -->
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/scriptxprint-html@1.7/dist/meadco-scriptxservices.min.js"
data-meadco-server="https://scriptxservices.meadroid.com"
data-meadco-license="xxx-xxx-xxxxxxx-xxx"></script>

<!-- A promise library will be required if targetting IE. -->
<script type="text/javascript">
$(window).on('load', function () {
MeadCo.ScriptX.InitAsync().then(function {
Expand Down
22 changes: 11 additions & 11 deletions ScriptXJSTest/Views/Home/AsyncService.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<script src="~/Scripts/MeadCo.ScriptX/meadco-secmgr-1.7.0.js"></script>
<script src="~/Scripts/MeadCo.ScriptX/meadco-scriptxfactory-1.7.0.js" data-meadco-server="@serviceUrl" data-meadco-subscription="{13598d2f-8724-467b-ae64-6e53e9e9f642}" data-meadco-syncinit="false"></script>

<script src="~/Scripts/promise.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>

<script src="@Url.Action("Script", new {filename = "meadco-scriptx.js"})"></script>

Expand All @@ -53,10 +53,10 @@
// do not use $(function() {}) as the license may still be loading / scripts for the service still loading
$(window).on("load",
function() {
function () {
console.log("starting window.onload");
$("#libVersion").text(MeadCo.ScriptX.LibVersion);
MeadCo.ScriptX.InitAsync().then(function() {
MeadCo.ScriptX.InitAsync().then(function () {
console.log("Init succeeded to: " + MeadCo.ScriptX.Connector);
$("span[data-purpose='sxversion']").text(MeadCo.ScriptX.Version()).addClass("text-success")
.removeClass("text-danger");
Expand All @@ -77,24 +77,24 @@
$("#btn-test4").click(function () {
setSimpleFormatting();
MeadCo.ScriptX.PrintPage2(true).then(function(bStarted) {
MeadCo.ScriptX.PrintPage2(true).then(function (bStarted) {
console.log("Print started: " + bStarted);
MeadCo.ScriptX.WaitForSpoolingComplete().then(function() {
MeadCo.ScriptX.WaitForSpoolingComplete().then(function () {
console.log("printing completed.");
});
});
});
}).catch(function() {
}).catch(function () {
$("#licCheck").text("** UNKNOWN **");
$("#errMsg").text(MeadCo.Licensing.ErrorMessage());
});
}).catch(function(e) {
$("span[data-purpose='sxversion']").text("** UNKNOWN (Failed to init) **");
$("#licCheck").text("** UNKNOWN **");
console.log("Warning :: Failed to initialise scriptx, is it installed? : " + e + " (" + MeadCo.Licensing.ErrorMessage() + ")");
}).catch(function (e) {
$("span[data-purpose='sxversion']").text("** UNKNOWN (Failed to init) **");
$("#licCheck").text("** UNKNOWN **");
console.log("Warning :: Failed to initialise scriptx, is it installed? : " + e + " (" + MeadCo.Licensing.ErrorMessage() + ")");
});
});
});
</script>

}
2 changes: 1 addition & 1 deletion dist/meadco-scriptx.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/MeadCoLicensing.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ <h4 class="name" id=".ErrorMessage">
<p class="tag-source">
<a href="meadco-scriptx.js.html" class="button">View Source</a>
<span>
<a href="meadco-scriptx.js.html">meadco-scriptx.js</a>, <a href="meadco-scriptx.js.html#line1383">line 1383</a>
<a href="meadco-scriptx.js.html">meadco-scriptx.js</a>, <a href="meadco-scriptx.js.html#line1387">line 1387</a>
</span>
</p>

Expand Down Expand Up @@ -793,7 +793,7 @@ <h4 class="name" id=".IsLicensedAsync">
<p class="tag-source">
<a href="meadco-scriptx.js.html" class="button">View Source</a>
<span>
<a href="meadco-scriptx.js.html">meadco-scriptx.js</a>, <a href="meadco-scriptx.js.html#line1356">line 1356</a>
<a href="meadco-scriptx.js.html">meadco-scriptx.js</a>, <a href="meadco-scriptx.js.html#line1360">line 1360</a>
</span>
</p>

Expand Down Expand Up @@ -972,7 +972,7 @@ <h5>Parameters:</h5>
<p class="tag-source">
<a href="meadco-scriptx.js.html" class="button">View Source</a>
<span>
<a href="meadco-scriptx.js.html">meadco-scriptx.js</a>, <a href="meadco-scriptx.js.html#line1398">line 1398</a>
<a href="meadco-scriptx.js.html">meadco-scriptx.js</a>, <a href="meadco-scriptx.js.html#line1402">line 1402</a>
</span>
</p>

Expand Down
4 changes: 4 additions & 0 deletions docs/meadco-scriptx.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,10 @@ <h1>meadco-scriptx.js</h1>
licensing.IsLicensed = function () {

if (licensing.Init()) {
if (licensing.Connector === licensing.Connection.SERVICE) {
var l = licensing.LicMgr.License;
}

return licensing.LicMgr.result === 0 &amp;&amp; licensing.LicMgr.validLicense;
}

Expand Down

0 comments on commit 5596525

Please sign in to comment.