This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Spin = { | |
spinner: {}, | |
startSpin: function (option) { | |
var settings = $.extend({ | |
element: 'formBody' | |
}, option); | |
var target = document.getElementById(settings.element); | |
var spinner = new Spinner().spin(target); | |
this.spinner = spinner; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var module = (function () { | |
var | |
_privateVar = 0, | |
_privateArray=[], | |
_privateString="", | |
_privateObj={}, | |
_privateBool=false; | |
function _privateFunc () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PrefixInteger(num, length) { | |
return (Array(length).join('0') + num).slice(-length); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajaxSetup({ | |
cache: false, | |
tryCount: 0, | |
retryLimit: 3, | |
error: function (xhr, textStatus, errorThrown) { | |
$.unblockUI(); | |
Spin.stopSpin(); | |
// lang = "HI"; | |
if (xhr.status == 404) { | |
console.log("Service not found"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var GlbDatepickerOptions = { | |
dateFormat: 'dd/mm/yy', timeFormat: 'hh:mm tt', dateonly: true, changeMonth: true, | |
changeYear: true | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Function to bind Datepicker to the element passed | |
*/ | |
ko.bindingHandlers.datepicker = { | |
after: ['attr'], | |
init: function (element, valueAccessor, allBindingsAccessor) { | |
//initialize datepicker with some optional options | |
var options = allBindingsAccessor().datepickerOptions || { | |
dateFormat: GlbDatepickerOptions.dateFormat, timeFormat: GlbDatepickerOptions.timeFormat, dateonly: GlbDatepickerOptions.dateonly, changeMonth: GlbDatepickerOptions.changeMonth, | |
changeYear: GlbDatepickerOptions.changeYear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CheckRequired($element) { | |
if ($element.is('input:text')) { | |
if (!$element.val()) { | |
validated = false; | |
objValidationFailed.push($element[0]); | |
$element.addClass('error'); | |
} | |
// else { | |
//Validation passed | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ajaxCall = { | |
getData: function (urlPart, callback) { | |
var xhr = $.ajax({ | |
url: siteurl + "/_vti_bin/ERIMS.SPWCFService/Rolta.DOI.ERIMS.SPWCFService.svc/" + urlPart, | |
type: "GET", | |
headers: { | |
"content-type": "application/json;odata=verbose", | |
"accept": "application/json;odata=verbose", | |
"X-RequestDigest": $("#__REQUESTDIGEST").val() | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Utility = { | |
validate: function (str, option, varOpts) { | |
if (str == null) { | |
return false; | |
} | |
if (typeof (str) === "object") { | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateFloatKeyPress(el, evt) { | |
var charCode = (evt.which) ? evt.which : event.keyCode; | |
var number = el.value.split('.'); | |
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) { | |
return false; | |
} | |
//just one dot | |
if (number.length > 1 && charCode == 46) { | |
return false; | |
} |
OlderNewer