cordova-plugin-mas-core
Version:
Cordova MAS Foundation Plugin
842 lines (185 loc) • 9.97 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: MASPluginUtils</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: MASPluginUtils</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>MASPluginUtils</h2>
<div class="class-description">A static utility class that enables the developers (and internal plugin classes) to validate object sanctity, allows setting of popup styles, launch a HTML page and close it.
<table>
<tr bgcolor="#D3D3D3"><th>Sample API usage</th></tr>
<tr><td><i>var isObjectAlive = MASPluginUtils.isEmpty(obj);</i></td></tr>
</table></div>
</header>
<article>
<div class="container-overview">
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUtils.js.html">MASPluginUtils.js</a>, <a href="MASPluginUtils.js.html#line10">line 10</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".closePopup"><span class="type-signature">(static) </span>closePopup<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Utility method to close the popup UI element. Developer can use this method to close the UI which is on top of the stack.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUtils.js.html">MASPluginUtils.js</a>, <a href="MASPluginUtils.js.html#line210">line 210</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".getPopUpStyle"><span class="type-signature">(static) </span>getPopUpStyle<span class="signature">()</span><span class="type-signature"> → {string}</span></h4>
<div class="description">
Utility method to get the popup style for a UI.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUtils.js.html">MASPluginUtils.js</a>, <a href="MASPluginUtils.js.html#line79">line 79</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The popup style. See MASPopupStyle
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">string</span>
</dd>
</dl>
<h4 class="name" id=".isEmpty"><span class="type-signature">(static) </span>isEmpty<span class="signature">(val)</span><span class="type-signature"></span></h4>
<div class="description">
Utility Method to validates the passed-in object for null/empty or undefined state. The type of object can be anything i.e. object, string, null etc.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>val</code></td>
<td class="type">
<span class="param-type">*</span>
</td>
<td class="description last">Object to be validated</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUtils.js.html">MASPluginUtils.js</a>, <a href="MASPluginUtils.js.html#line27">line 27</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".MASPopupUI"><span class="type-signature">(static) </span>MASPopupUI<span class="signature">(url, result, popupafterclose, onload)</span><span class="type-signature"></span></h4>
<div class="description">
Utility Method to popup a UI from a local HTML resource
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">path/name to the local HTML page</td>
</tr>
<tr>
<td class="name"><code>result</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">An object which the native Mobile SDK returns, loaded with data related to Authentication or OTP details.</td>
</tr>
<tr>
<td class="name"><code>popupafterclose</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">A user defined function that would be called after the popup closes.Any cleaning to be done post closure.</td>
</tr>
<tr>
<td class="name"><code>onload</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">A user defined function that would be called when the popup UI loads. Any initialization can be done here.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUtils.js.html">MASPluginUtils.js</a>, <a href="MASPluginUtils.js.html#line131">line 131</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".setPopUpStyle"><span class="type-signature">(static) </span>setPopUpStyle<span class="signature">(style)</span><span class="type-signature"></span></h4>
<div class="description">
Utility method to set the popup style of the UI that the MAS PLugin loads in case of Authentication/OTP-Channel Selection/OTP verification etc.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>style</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The style string. See MASPopupStyle</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="MASPluginUtils.js.html">MASPluginUtils.js</a>, <a href="MASPluginUtils.js.html#line70">line 70</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="MASPlugin.html">MASPlugin</a></li><li><a href="MASPluginApplication.html">MASPluginApplication</a></li><li><a href="MASPluginAuthProviders.html">MASPluginAuthProviders</a></li><li><a href="MASPluginConstants.html">MASPluginConstants</a></li><li><a href="MASPluginDevice.html">MASPluginDevice</a></li><li><a href="MASPluginMAS.html">MASPluginMAS</a></li><li><a href="MASPluginMultipartForm.html">MASPluginMultipartForm</a></li><li><a href="MASPluginSecurityConfiguration.html">MASPluginSecurityConfiguration</a></li><li><a href="MASPluginUser.html">MASPluginUser</a></li><li><a href="MASPluginUtils.html">MASPluginUtils</a></li></ul><h3><a href="global.html">Global</a></h3>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.3</a> on Tue Feb 18 2020 21:13:36 GMT+0530 (India Standard Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>