EOS/Scripts/out/files/Shared_common.js.html
Nidhi Bhargava f0c1ab20e1 code push
2025-09-04 16:25:07 +05:30

492 lines
17 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Shared\common.js</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/3.9.1/build/cssgrids/cssgrids-min.css">
<link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
<link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
<link rel="shortcut icon" type="image/png" href="../assets/favicon.png">
<script src="http://yui.yahooapis.com/combo?3.9.1/build/yui/yui-min.js"></script>
</head>
<body class="yui3-skin-sam">
<div id="doc">
<div id="hd" class="yui3-g header">
<div class="yui3-u-3-4">
<h1><img src="../assets/css/logo.png" title=""></h1>
</div>
<div class="yui3-u-1-4 version">
<em>API Docs for: </em>
</div>
</div>
<div id="bd" class="yui3-g">
<div class="yui3-u-1-4">
<div id="docs-sidebar" class="sidebar apidocs">
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-classes">Classes</a></li>
<li><a href="#api-modules">Modules</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs">
</div>
<div id="api-tabview-panel">
<ul id="api-classes" class="apis classes">
<li><a href="../classes/CallFeedbackRating.html">CallFeedbackRating</a></li>
<li><a href="../classes/CloseTicketReport.html">CloseTicketReport</a></li>
<li><a href="../classes/ConsolidatedReport.html">ConsolidatedReport</a></li>
<li><a href="../classes/CustomerReport.html">CustomerReport</a></li>
<li><a href="../classes/DealerWiseCallDetails.html">DealerWiseCallDetails</a></li>
<li><a href="../classes/DeclinedCalls.html">DeclinedCalls</a></li>
<li><a href="../classes/DropDownData.html">DropDownData</a></li>
<li><a href="../classes/EicherPromise.html">EicherPromise</a></li>
<li><a href="../classes/EosCallCount.html">EosCallCount</a></li>
<li><a href="../classes/GeoAnalysis.html">GeoAnalysis</a></li>
<li><a href="../classes/HdBusLmdContrCallFeedbackRatingibution.html">HdBusLmdContrCallFeedbackRatingibution</a></li>
<li><a href="../classes/HdBusLmdContribution.html">HdBusLmdContribution</a></li>
<li><a href="../classes/HistoryTracking.html">HistoryTracking</a></li>
<li><a href="../classes/LiveTracking.html">LiveTracking</a></li>
<li><a href="../classes/ManageEscalation.html">ManageEscalation</a></li>
<li><a href="../classes/ManageFleet.html">ManageFleet</a></li>
<li><a href="../classes/ManageFleet_Detail.html">ManageFleet_Detail</a></li>
<li><a href="../classes/ManageFleet_details.html">ManageFleet_details</a></li>
<li><a href="../classes/ManageOwner.html">ManageOwner</a></li>
<li><a href="../classes/ManageReason.html">ManageReason</a></li>
<li><a href="../classes/ManageVechile.html">ManageVechile</a></li>
<li><a href="../classes/ManageVehicle.html">ManageVehicle</a></li>
<li><a href="../classes/NonVecvUserManagement.html">NonVecvUserManagement</a></li>
<li><a href="../classes/Notifications.html">Notifications</a></li>
<li><a href="../classes/OpenTicketReport.html">OpenTicketReport</a></li>
<li><a href="../classes/OrganizationChart.html">OrganizationChart</a></li>
<li><a href="../classes/PositioningTool.html">PositioningTool</a></li>
<li><a href="../classes/PositioningTool_Report.html">PositioningTool_Report</a></li>
<li><a href="../classes/ReasonForClosure.html">ReasonForClosure</a></li>
<li><a href="../classes/Report.html">Report</a></li>
<li><a href="../classes/ShowDealerMap.html">ShowDealerMap</a></li>
<li><a href="../classes/TicketAdministration.html">TicketAdministration</a></li>
<li><a href="../classes/TicketAdministration_FullDetail.html">TicketAdministration_FullDetail</a></li>
<li><a href="../classes/TicketFeedback.html">TicketFeedback</a></li>
<li><a href="../classes/TicketForDealer.html">TicketForDealer</a></li>
<li><a href="../classes/TicketForDealer_FullDetails.html">TicketForDealer_FullDetails</a></li>
<li><a href="../classes/TicketReassign.html">TicketReassign</a></li>
<li><a href="../classes/TileDashboard.html">TileDashboard</a></li>
<li><a href="../classes/TimeSlotClosure.html">TimeSlotClosure</a></li>
<li><a href="../classes/TollFreeAndOpportunityLoss.html">TollFreeAndOpportunityLoss</a></li>
<li><a href="../classes/VanCoverageDesigner.html">VanCoverageDesigner</a></li>
<li><a href="../classes/VecvUserManagement.html">VecvUserManagement</a></li>
</ul>
<ul id="api-modules" class="apis modules">
<li><a href="../modules/Dashboard.html">Dashboard</a></li>
<li><a href="../modules/DropDownData.html">DropDownData</a></li>
<li><a href="../modules/Geo.html">Geo</a></li>
<li><a href="../modules/Inventory.html">Inventory</a></li>
<li><a href="../modules/Notifications.html">Notifications</a></li>
<li><a href="../modules/ReportModule.html">ReportModule</a></li>
<li><a href="../modules/Ticket.html">Ticket</a></li>
<li><a href="../modules/TrackingModule.html">TrackingModule</a></li>
<li><a href="../modules/UserManagement.html">UserManagement</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="yui3-u-3-4">
<div id="api-options">
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>
<div class="apidocs">
<div id="docs-main">
<div class="content">
<h1 class="file-heading">File: Shared\common.js</h1>
<div class="file">
<pre class="code prettyprint linenums">
function activeSidebaarLink() {
$(&quot;.sideMenuLink a&quot;).click(function () {
$(&quot;.sideMenuLink a&quot;).removeClass(&quot;activeSideLink&quot;);
$(this).addClass(&quot;activeSideLink&quot;);
});
}
$.prototype.levydatepicker = function (options) {
var dateObject = $(this).datepicker({
dateFormat: options.dateFormat,
maxDate: +options.maxDate,
minDate: options.minDate,
beforeShowDay: options.beforeShowDay,
onSelect: options.onSelect,
changeMonth: options.changeMonth,
changeYear: options.changeYear,
yearRange: options.yearRange
});
$(this).attr(&quot;readonly&quot;, &quot;readonly&quot;);
if (options.defaultDate) { dateObject.val(options.defaultDate); }
$(&quot;#ui-datepicker-div&quot;).hide();
}
$(document).ajaxStart(function (e) {
// console.log(&quot;ajax request start&quot;);
showLoadingMessage(&quot;Loading...&quot;);
});
$(document).ajaxStop(function () {
////console.log(&quot;ajax request end.&quot;);
hideLoadingMessage();
});
function showLoadingMessage(message) {
if (!message) { message = &quot;Loading..&quot; }
message = &quot;&lt;div&gt;&quot; + message + &quot;&lt;/div&gt;&quot;;
$(&quot;#divLoadingElement&quot;).html(message).show();
}
function hideLoadingMessage() {
$(&quot;#divLoadingElement&quot;).hide();
}
function getCurrentTime() {
var currDate = new Date();
return currDate.getDay() + &#x27;&#x27; + currDate.getMonth() + &#x27;&#x27; + currDate.getYear() + &#x27;&#x27; + currDate.getHours() + &#x27;&#x27; + currDate.getMinutes() + &#x27;&#x27; + currDate.getSeconds() + &#x27;&#x27; + currDate.getMilliseconds();
}
/* ================================Call for alive session================================*/
function aliveSession() { var currtime = getCurrentTime(); $.get(&quot;/Home/SessionTimeout/&quot;, { currtime: currtime }, function (result) { }); }
//setInterval(function () { aliveSession(); }, 1000 * 60 * 10);
/*========================================End============================================*/
/*==================================Time Picker==========================================*/
function timePicker(startTimeId, endTimeId) {
var id = &quot;#&quot; + startTimeId + &quot;, #&quot; + endTimeId;
// Use default settings
$(id).timePicker();
// Store time used by duration.
var oldTime = $.timePicker(&quot;#&quot; + startTimeId).getTime();
// Keep the duration between the two inputs.
$(&quot;#&quot; + startTimeId).change(function () {
if ($(&quot;#&quot; + endTimeId).val()) { // Only update when second input has a value.
// Calculate duration.
var duration = ($.timePicker(&quot;#&quot; + endTimeId).getTime() - oldTime);
var time = $.timePicker(&quot;#&quot; + startTimeId).getTime();
// Calculate and update the time in the second input.
$.timePicker(&quot;#&quot; + endTimeId).setTime(new Date(new Date(time.getTime() + duration)));
oldTime = time;
}
});
// Validate.
$(&quot;#&quot; + endTimeId).change(function () {
if ($.timePicker(&quot;#&quot; + startTimeId).getTime() &gt; $.timePicker(this).getTime()) {
$(this).addClass(&quot;error&quot;).removeClass(&#x27;valid&#x27;);
}
else {
$(this).removeClass(&quot;error&quot;);
}
//changeSliderValue(); //call for slider value update
});
}
/*=====================================End===============================================*/
// Show title on kendo grid header
function addTitleAttribute() {
$.each($(&quot;.k-grid-header&quot;).find(&#x27;tr th&#x27;), function (idx, th) {
var a = $(th).attr(&#x27;data-title&#x27;);
if ($(th).attr(&#x27;data-title&#x27;)) {
$(th).attr(&#x27;title&#x27;, $(th).attr(&#x27;data-title&#x27;));
} else {
$(th).attr(&#x27;title&#x27;, $(th).attr(&#x27;data-field&#x27;));
}
});
}
// Call when data bound on the grid
function onDataBound() {
addTitleAttribute();
}
//
function setPagerAndGroupBarWidth() {
//console.log($(&#x27;.k-grid-header tr&#x27;));
var headersWidth = $(&#x27;.k-grid-header tr&#x27;).width();
// alert(headersWidth);
$(&quot;.k-grid-pager&quot;).width(headersWidth);
$(&quot;.k-grouping-header&quot;).width(headersWidth);
addTitleAttribute();
}
function fitPagerToGrid() {
var headersWidth = $(&#x27;.k-grid-header tr&#x27;).width();
//console.log(headersWidth);
$(&quot;.k-grid-pager&quot;).width(headersWidth);
}
// open and close Right slider.
function rightSlider() {
/* right silder for text */
$(&quot;.button&quot;).click(function () {
if ($(this).hasClass(&#x27;open DD_close&#x27;)) {
$(&quot;.container&quot;).animate({
right: &quot;-187px&quot;
}, 250, &quot;linear&quot;, function () {
$(&#x27;.button&#x27;).removeClass(&#x27;open DD_close&#x27;);
});
}
else {
$(&quot;.container&quot;).animate({
right: &quot;0px&quot;
}, 250, &quot;linear&quot;, function () {
$(&#x27;.button&#x27;).addClass(&#x27;open DD_close&#x27;);
});
}
});
}
/**
* Function to add kendo window
* @method addKendoWindow
* @param {String} divId The id of div
* @param {String} titleText The name of window title
* @param {String} width width of window
* @param {String} left margin from left
*/
function addKendoWindow(divId, titleText, width, left, top) {
$(divId).kendoWindow({
width: width,
title: titleText,
modal: true,
resizable: false,
draggable: true,
position: {
top: top,
left: left
}
});
}
//============================== query String functionality========================
// Get query string parameter
function getParameterByName(name) {
name = name.replace(/[\[]/, &quot;\\[&quot;).replace(/[\]]/, &quot;\\]&quot;);
var regex = new RegExp(&quot;[\\?&amp;]&quot; + name + &quot;=([^&amp;#]*)&quot;),
results = regex.exec(location.search);
return results == null ? &quot;&quot; : decodeURIComponent(results[1].replace(/\+/g, &quot; &quot;));
}
/**
* Add Attributes (Href,target) to given anchor element.
* @method addLinkValue
*/
function addLinkValue($eleParentHref, linkValue) {
$eleParentHref.attr({
&#x27;href&#x27;: linkValue,
&#x27;target&#x27;: &#x27;_blank&#x27;
}).css(&quot;cursor&quot;, &quot;pointer&quot;);
}
/**
* function which dynamically add Query parameter on given uri.
* @method updateQueryStringParameter
*/
function updateQueryStringParameter(uri, key, value) {
var re = new RegExp(&quot;([?&amp;])&quot; + key + &quot;=.*?(&amp;|$)&quot;, &quot;i&quot;);
var separator = uri.indexOf(&#x27;?&#x27;) !== -1 ? &quot;&amp;&quot; : &quot;?&quot;;
if (uri.match(re)) {
return uri.replace(re, &#x27;$1&#x27; + key + &quot;=&quot; + value + &#x27;$2&#x27;);
}
else {
return uri + separator + key + &quot;=&quot; + value;
}
}
//============================== End of query String functionality========================
/**
* Refresh kendo grid when resize coloum.
* @method onColumnResize
*/
function onColumnResize(e) {
var activeGridId = e.sender._cellId;
var replaceString = &quot;_active_cell&quot;;
var updatedId = (activeGridId.replace(replaceString, &#x27;&#x27;)).trim();
$(&quot;#&quot; + updatedId).data(&quot;kendoGrid&quot;).refresh();
}
/**
* Set numeric filter values as intger.
* @method NumericFilter
*/
function NumericFilter(control) {
$(control).kendoNumericTextBox({ &quot;format&quot;: &quot;n0&quot;, &quot;decimals&quot;: 0 });
}
// update grid with message if no result found.
function displayNoResult(e) {
var grid = e.sender;
if (grid.dataSource.total() == 0) {
var colCount = grid.columns.length;
$(e.sender.wrapper)
.find(&#x27;tbody&#x27;)
.append(&#x27;&lt;tr class=&quot;kendo-data-row&quot;&gt;&lt;td colspan=&quot;&#x27; + colCount + &#x27;&quot; style=&quot;text-align:center&quot;&gt;&lt;b&gt;No data available!&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&#x27;);
}
}
//function to decode html text
function stringToDecode(encodedString, id) {
var stringtodecode = encodedString;
document.getElementById(id).innerHTML = stringtodecode;
stringtodecode = document.getElementById(id).innerText;
return stringtodecode;
}
function AllowSpecialCharacterForOwner(e, t) {
var key;
var keychar;
if (window.event)
key = window.event.keyCode;
else if (e)
key = e.which;
else
return true;
keychar = String.fromCharCode(key);
keychar = keychar.toLowerCase();
// control keys
if ((key == null) || (key == 0) || (key == 8) ||
(key == 9) || (key == 13) || (key == 27))
return true;
else if (((&quot;abcdefghijklmnopqrstuvwxyz0123456789&quot;).indexOf(keychar) &gt; -1))
return true;
else
return true;
}
/**
* Function call on row bound of close tickets table
* @param {String} divId The id of div
* @method openKendoWindowInCenter
*/
function openKendoWindowInCenter(divId) {
var window = $(divId).data(&quot;kendoWindow&quot;);
window.center();
//window.open();
}
</pre>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="../assets/vendor/prettify/prettify-min.js"></script>
<script>prettyPrint();</script>
<script src="../assets/js/yui-prettify.js"></script>
<script src="../assets/../api.js"></script>
<script src="../assets/js/api-filter.js"></script>
<script src="../assets/js/api-list.js"></script>
<script src="../assets/js/api-search.js"></script>
<script src="../assets/js/apidocs.js"></script>
</body>
</html>