MaketRandevu/doc/code/js/GeneralFunctions.html

1276 lines
17 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: GeneralFunctions</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">Namespace: GeneralFunctions</h1>
<section>
<header>
<h2>
GeneralFunctions
</h2>
</header>
<article>
<div class="container-overview">
<div class="description">This file contains the General Functions javascript namespace.
It contains functions that apply both on the front and back
end of the application.</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="centerElementOnPage"><span class="type-signature">&lt;static> </span>centerElementOnPage<span class="signature">(elementHandle)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
This method centers a DOM element vertically and horizontally
on the page.
</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>elementHandle</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">The object that is going to be
centered.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line70">line 70</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="clone"><span class="type-signature">&lt;static> </span>clone<span class="signature">(originalObject)</span><span class="type-signature"> &rarr; {object}</span></h4>
</dt>
<dd>
<div class="description">
This method creates and returns an exact copy of the provided object.
It is very usefull whenever changes need to be made to an object without
modyfing the original data.
</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>originalObject</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Object to be copied.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line134">line 134</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns an exact copy of the provided element.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">object</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="displayMessageBox"><span class="type-signature">&lt;static> </span>displayMessageBox<span class="signature">(title, message, messageButtons)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
This functions displays a message box in
the admin array. It is usefull when user
decisions or verifications are needed.
</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>title</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The title of the message box.</td>
</tr>
<tr>
<td class="name"><code>message</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The message of the dialog.</td>
</tr>
<tr>
<td class="name"><code>messageButtons</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="description last">Contains the dialog
buttons along with their functions.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line19">line 19</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="exceptionsToHtml"><span class="type-signature">&lt;static> </span>exceptionsToHtml<span class="signature">(exceptions)</span><span class="type-signature"> &rarr; {String}</span></h4>
</dt>
<dd>
<div class="description">
This method returns the exception html display for javascript ajax calls.
It uses the Bootstrap collapse module to show exception messages when the
user opens the "Details" collapse component.
</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>exceptions</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="description last">Contains the exceptions to be displayed.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line188">line 188</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the html markup for the exceptions.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getUrlParameter"><span class="type-signature">&lt;static> </span>getUrlParameter<span class="signature">(url, name)</span><span class="type-signature"> &rarr; {String}</span></h4>
</dt>
<dd>
<div class="description">
This function retrieves a parameter from a "GET" formed url.
</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">The selected url.</td>
</tr>
<tr>
<td class="name"><code>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The parameter name.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line95">line 95</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the parameter value.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="ISODateString"><span class="type-signature">&lt;static> </span>ISODateString<span class="signature">(dt)</span><span class="type-signature"> &rarr; {String}</span></h4>
</dt>
<dd>
<div class="description">
This function creates a RFC 3339 date string. This string is needed
by the Google Calendar API in order to pass dates as parameters.
</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>dt</code></td>
<td class="type">
<span class="param-type">date</span>
</td>
<td class="description last">The given date that will be transformed</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line113">line 113</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the transformed string.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="parseExceptions"><span class="type-signature">&lt;static> </span>parseExceptions<span class="signature">(exceptions)</span><span class="type-signature"> &rarr; {Array}</span></h4>
</dt>
<dd>
<div class="description">
This method parse the json encoded strings that are fetched by ajax calls.
</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>exceptions</code></td>
<td class="type">
<span class="param-type">array</span>
</td>
<td class="description last">Exception array returned by an ajax call.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line219">line 219</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the parsed js objects.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="validateEmail"><span class="type-signature">&lt;static> </span>validateEmail<span class="signature">(email)</span><span class="type-signature"> &rarr; {bool}</span></h4>
</dt>
<dd>
<div class="description">
This method validates an email address. If the address is not on the proper
form then the result is FALSE.
</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>email</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The email address to be checked.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="general_functions.js.html">general_functions.js</a>, <a href="general_functions.js.html#line175">line 175</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the validation result.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">bool</span>
</dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="AdminsHelper.html">AdminsHelper</a></li><li><a href="CategoriesHelper.html">CategoriesHelper</a></li><li><a href="ProvidersHelper.html">ProvidersHelper</a></li><li><a href="SecretariesHelper.html">SecretariesHelper</a></li><li><a href="ServicesHelper.html">ServicesHelper</a></li></ul><h3>Namespaces</h3><ul><li><a href="Backend.html">Backend</a></li><li><a href="Customers.html">Backend Customers</a></li><li><a href="BackendCalendar.html">BackendCalendar</a></li><li><a href="BackendServices.html">BackendServices</a></li><li><a href="BackendUsers..html">BackendUsers.</a></li><li><a href="FrontendBook.html">FrontendBook</a></li><li><a href="GeneralFunctions.html">GeneralFunctions</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Fri Sep 13 2013 11:50:17 GMT+0300 (EEST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>