492 lines
17 KiB
HTML
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() {
|
|
$(".sideMenuLink a").click(function () {
|
|
$(".sideMenuLink a").removeClass("activeSideLink");
|
|
$(this).addClass("activeSideLink");
|
|
});
|
|
}
|
|
|
|
$.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("readonly", "readonly");
|
|
if (options.defaultDate) { dateObject.val(options.defaultDate); }
|
|
$("#ui-datepicker-div").hide();
|
|
}
|
|
|
|
$(document).ajaxStart(function (e) {
|
|
// console.log("ajax request start");
|
|
showLoadingMessage("Loading...");
|
|
});
|
|
|
|
$(document).ajaxStop(function () {
|
|
////console.log("ajax request end.");
|
|
hideLoadingMessage();
|
|
});
|
|
|
|
function showLoadingMessage(message) {
|
|
if (!message) { message = "Loading.." }
|
|
message = "<div>" + message + "</div>";
|
|
$("#divLoadingElement").html(message).show();
|
|
}
|
|
|
|
function hideLoadingMessage() {
|
|
$("#divLoadingElement").hide();
|
|
}
|
|
|
|
function getCurrentTime() {
|
|
var currDate = new Date();
|
|
return currDate.getDay() + '' + currDate.getMonth() + '' + currDate.getYear() + '' + currDate.getHours() + '' + currDate.getMinutes() + '' + currDate.getSeconds() + '' + currDate.getMilliseconds();
|
|
}
|
|
|
|
/* ================================Call for alive session================================*/
|
|
function aliveSession() { var currtime = getCurrentTime(); $.get("/Home/SessionTimeout/", { currtime: currtime }, function (result) { }); }
|
|
|
|
//setInterval(function () { aliveSession(); }, 1000 * 60 * 10);
|
|
|
|
/*========================================End============================================*/
|
|
|
|
/*==================================Time Picker==========================================*/
|
|
function timePicker(startTimeId, endTimeId) {
|
|
var id = "#" + startTimeId + ", #" + endTimeId;
|
|
// Use default settings
|
|
$(id).timePicker();
|
|
|
|
// Store time used by duration.
|
|
var oldTime = $.timePicker("#" + startTimeId).getTime();
|
|
|
|
// Keep the duration between the two inputs.
|
|
$("#" + startTimeId).change(function () {
|
|
if ($("#" + endTimeId).val()) { // Only update when second input has a value.
|
|
// Calculate duration.
|
|
var duration = ($.timePicker("#" + endTimeId).getTime() - oldTime);
|
|
var time = $.timePicker("#" + startTimeId).getTime();
|
|
// Calculate and update the time in the second input.
|
|
$.timePicker("#" + endTimeId).setTime(new Date(new Date(time.getTime() + duration)));
|
|
oldTime = time;
|
|
}
|
|
|
|
});
|
|
// Validate.
|
|
$("#" + endTimeId).change(function () {
|
|
if ($.timePicker("#" + startTimeId).getTime() > $.timePicker(this).getTime()) {
|
|
$(this).addClass("error").removeClass('valid');
|
|
}
|
|
else {
|
|
$(this).removeClass("error");
|
|
}
|
|
//changeSliderValue(); //call for slider value update
|
|
});
|
|
}
|
|
/*=====================================End===============================================*/
|
|
|
|
// Show title on kendo grid header
|
|
function addTitleAttribute() {
|
|
$.each($(".k-grid-header").find('tr th'), function (idx, th) {
|
|
var a = $(th).attr('data-title');
|
|
if ($(th).attr('data-title')) {
|
|
$(th).attr('title', $(th).attr('data-title'));
|
|
} else {
|
|
$(th).attr('title', $(th).attr('data-field'));
|
|
}
|
|
});
|
|
}
|
|
|
|
// Call when data bound on the grid
|
|
function onDataBound() {
|
|
|
|
addTitleAttribute();
|
|
}
|
|
//
|
|
function setPagerAndGroupBarWidth() {
|
|
//console.log($('.k-grid-header tr'));
|
|
var headersWidth = $('.k-grid-header tr').width();
|
|
// alert(headersWidth);
|
|
$(".k-grid-pager").width(headersWidth);
|
|
$(".k-grouping-header").width(headersWidth);
|
|
addTitleAttribute();
|
|
}
|
|
|
|
|
|
function fitPagerToGrid() {
|
|
var headersWidth = $('.k-grid-header tr').width();
|
|
//console.log(headersWidth);
|
|
$(".k-grid-pager").width(headersWidth);
|
|
}
|
|
|
|
// open and close Right slider.
|
|
function rightSlider() {
|
|
/* right silder for text */
|
|
$(".button").click(function () {
|
|
if ($(this).hasClass('open DD_close')) {
|
|
$(".container").animate({
|
|
right: "-187px"
|
|
}, 250, "linear", function () {
|
|
$('.button').removeClass('open DD_close');
|
|
});
|
|
}
|
|
else {
|
|
$(".container").animate({
|
|
right: "0px"
|
|
}, 250, "linear", function () {
|
|
$('.button').addClass('open DD_close');
|
|
});
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
|
|
/**
|
|
* 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(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
|
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
|
results = regex.exec(location.search);
|
|
return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
|
}
|
|
|
|
/**
|
|
* Add Attributes (Href,target) to given anchor element.
|
|
* @method addLinkValue
|
|
*/
|
|
function addLinkValue($eleParentHref, linkValue) {
|
|
$eleParentHref.attr({
|
|
'href': linkValue,
|
|
'target': '_blank'
|
|
}).css("cursor", "pointer");
|
|
|
|
}
|
|
|
|
/**
|
|
* function which dynamically add Query parameter on given uri.
|
|
* @method updateQueryStringParameter
|
|
*/
|
|
function updateQueryStringParameter(uri, key, value) {
|
|
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i");
|
|
var separator = uri.indexOf('?') !== -1 ? "&" : "?";
|
|
if (uri.match(re)) {
|
|
return uri.replace(re, '$1' + key + "=" + value + '$2');
|
|
}
|
|
else {
|
|
return uri + separator + key + "=" + value;
|
|
}
|
|
}
|
|
//============================== End of query String functionality========================
|
|
/**
|
|
* Refresh kendo grid when resize coloum.
|
|
* @method onColumnResize
|
|
*/
|
|
function onColumnResize(e) {
|
|
var activeGridId = e.sender._cellId;
|
|
var replaceString = "_active_cell";
|
|
var updatedId = (activeGridId.replace(replaceString, '')).trim();
|
|
$("#" + updatedId).data("kendoGrid").refresh();
|
|
}
|
|
|
|
/**
|
|
* Set numeric filter values as intger.
|
|
* @method NumericFilter
|
|
*/
|
|
function NumericFilter(control) {
|
|
$(control).kendoNumericTextBox({ "format": "n0", "decimals": 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('tbody')
|
|
.append('<tr class="kendo-data-row"><td colspan="' + colCount + '" style="text-align:center"><b>No data available!</b></td></tr>');
|
|
}
|
|
}
|
|
|
|
|
|
//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 ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -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("kendoWindow");
|
|
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>
|