@resconet/jsbridge 17.1.0-beta.1 → 17.1.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/JSBridge.js +5 -2
- package/src/README.md +45 -22
package/package.json
CHANGED
package/src/JSBridge.js
CHANGED
|
@@ -156,8 +156,10 @@
|
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
};
|
|
159
|
+
var _global = window || global;
|
|
160
|
+
var MobileCrmException = _global.MobileCrmException;
|
|
159
161
|
if (typeof MobileCrmException === "undefined") {
|
|
160
|
-
MobileCrmException = function (msg) {
|
|
162
|
+
_global.MobileCrmException = MobileCrmException = function (msg) {
|
|
161
163
|
this.message = msg;
|
|
162
164
|
this.name = "MobileCrmException";
|
|
163
165
|
};
|
|
@@ -169,8 +171,9 @@
|
|
|
169
171
|
return "message" in err ? err.message : "Message" in err ? err.Message : err.toString();
|
|
170
172
|
}
|
|
171
173
|
// MobileCRM object definition
|
|
174
|
+
var MobileCRM = _global.MobileCRM;
|
|
172
175
|
if (typeof MobileCRM === "undefined") {
|
|
173
|
-
MobileCRM = {
|
|
176
|
+
_global.MobileCRM = MobileCRM = {
|
|
174
177
|
/// <summary>An entry point for Mobile CRM data model.</summary>
|
|
175
178
|
/// <field name="bridge" type="MobileCRM.Bridge">Singleton instance of <see cref="MobileCRM.Bridge">MobileCRM.Bridge</see> providing the management of the Javascript/native code cross-calls.</field>
|
|
176
179
|
bridge: null,
|
package/src/README.md
CHANGED
|
@@ -1,49 +1,71 @@
|
|
|
1
|
-
# JSBridge
|
|
1
|
+
# JSBridge
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
JSBridge - Javascript API for Resco Mobile CRM
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Getting started with working and debugging of an offline HTML solution.
|
|
6
|
+
https://www.resco.net/debugging-offline-html-solution/
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
## Introduction
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
Resco Mobile CRM application functionality can be extended using HTML + Javascript code.
|
|
11
|
+
Your html file containing custom code can be executed both online and offline.
|
|
12
|
+
Offline html files are part of Woodford customization project.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
Watch webinars for intro to OfflineHTML in Resco MobileCRM.
|
|
15
|
+
<br />[Webinar Offline HTML in Resco Mobile CRM - Part 1/2 (Intro)](https://www.youtube.com/watch?v=cplZLC_mAc0&list=PLPMCnAPD5b56XNEiGTcy5VBxdP8rcB86b&index=12)
|
|
16
|
+
[Webinar Offline HTML in Resco Mobile CRM - Part 2/2 (Data Access)](https://www.youtube.com/watch?v=R7GpdC_y17Y&t=1s)
|
|
17
|
+
|
|
18
|
+
Release contains the debugging/development build(s) of the Resco Mobile CRM application.
|
|
19
|
+
Per platform application packages are available.
|
|
20
|
+
|
|
21
|
+
## IFrame
|
|
22
|
+
|
|
23
|
+
You can put a web browser, known as IFrame, in various components in the app.
|
|
24
|
+
IFrames can be used within EntityForm, EntityList or within HomeForm.
|
|
25
|
+
IFrame points to your custom html code file.
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
Description of the methods and objects defined in Resco JavaScript Bridge.
|
|
30
|
+
[Latest Reference](https://www.resco.net/javascript-bridge-reference/)
|
|
31
|
+
[Guide](http://www.resco.net/mobilecrm/support/jsbridge.aspx)
|
|
32
|
+
|
|
33
|
+
## Installing the package
|
|
14
34
|
|
|
15
35
|
In your project directory use **npm init** to set up a new or existing npm package. If you want to create default package json file then use --yes parameter. For more information please visit https://docs.npmjs.com/cli/init
|
|
16
36
|
|
|
17
|
-
|
|
18
|
-
|
|
37
|
+
- install package **npm i @resconet/jsbridge**
|
|
38
|
+
|
|
39
|
+
## Using the library
|
|
19
40
|
|
|
20
|
-
|
|
21
|
-
You can use require to include
|
|
41
|
+
- **Javascript file**
|
|
42
|
+
You can use require to include the module from installed packages. For example
|
|
22
43
|
|
|
23
44
|
```javascript
|
|
24
|
-
require
|
|
45
|
+
require("@resconet/jsbridge");
|
|
25
46
|
|
|
26
|
-
function testAlert(){
|
|
27
|
-
|
|
47
|
+
function testAlert() {
|
|
48
|
+
MobileCRM.bridge.alert("Test");
|
|
28
49
|
}
|
|
29
50
|
```
|
|
30
51
|
|
|
31
|
-
|
|
32
|
-
You can use import to include
|
|
52
|
+
- **Typescript file**
|
|
53
|
+
You can use import to include the module from installed packages. For example
|
|
33
54
|
|
|
34
55
|
```javascript
|
|
35
|
-
import "@resconet/jsbridge
|
|
56
|
+
import "@resconet/jsbridge";
|
|
36
57
|
|
|
37
|
-
function testAlert(){
|
|
38
|
-
|
|
58
|
+
function testAlert() {
|
|
59
|
+
MobileCRM.bridge.alert("Test");
|
|
39
60
|
}
|
|
40
61
|
```
|
|
41
62
|
|
|
42
63
|
## Versioning
|
|
43
64
|
|
|
44
65
|
The package.json defines the version of JSBridge. e.g. "version": "12.3.1", it means
|
|
45
|
-
|
|
46
|
-
|
|
66
|
+
|
|
67
|
+
- 12.3: Major revision (copies the version of underlying Mobile CRM app)
|
|
68
|
+
- 1: Bug fix release
|
|
47
69
|
|
|
48
70
|
**important** first two numbers mirror the latest version of Mobile CRM native application that supports the features.
|
|
49
71
|
|
|
@@ -58,4 +80,5 @@ The Package is published to npm registry page on release publish event.
|
|
|
58
80
|
The Bug fix release number is automatically updated when new js or ts file is pushed.
|
|
59
81
|
|
|
60
82
|
## Contact
|
|
83
|
+
|
|
61
84
|
For any questions or any specific circumstances, please contact us on the email mobilecrm@resco.net
|