2012-12-14 08:38:56 +00:00
|
|
|
|
|
|
|
|
|
$(document).ready( function() {
|
2012-12-17 18:30:59 +00:00
|
|
|
|
$('body').on('hidden', '.modal', function () {
|
|
|
|
|
$(this).removeData('modal');
|
2012-12-14 08:38:56 +00:00
|
|
|
|
});
|
|
|
|
|
|
2012-12-17 18:30:59 +00:00
|
|
|
|
$('body').on('touchstart.dropdown', '.dropdown-menu', function (e) { e.stopPropagation(); });
|
|
|
|
|
|
2013-01-24 09:02:48 +00:00
|
|
|
|
$('#expirationdate, #fromdate, #todate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate')
|
2012-12-17 18:30:59 +00:00
|
|
|
|
.datepicker()
|
|
|
|
|
.on('changeDate', function(ev){
|
2013-01-24 09:02:48 +00:00
|
|
|
|
$('#expirationdate, #fromdate, #todate, #createstartdate, #createenddate, #expirationstartdate, #expirationenddate').datepicker('hide');
|
2012-12-17 18:30:59 +00:00
|
|
|
|
});
|
|
|
|
|
|
2012-12-14 08:38:56 +00:00
|
|
|
|
$(".chzn-select").chosen();
|
|
|
|
|
$(".chzn-select-deselect").chosen({allow_single_deselect:true});
|
|
|
|
|
|
|
|
|
|
$(".pwd").passStrength({
|
|
|
|
|
url: "../op/op.Ajax.php",
|
|
|
|
|
onChange: function(data, target) {
|
|
|
|
|
pwsp = 100*data.score;
|
|
|
|
|
$('#'+target+' div.bar').width(pwsp+'%');
|
|
|
|
|
if(data.ok) {
|
|
|
|
|
$('#'+target+' div.bar').removeClass('bar-danger');
|
|
|
|
|
$('#'+target+' div.bar').addClass('bar-success');
|
|
|
|
|
} else {
|
|
|
|
|
$('#'+target+' div.bar').removeClass('bar-success');
|
|
|
|
|
$('#'+target+' div.bar').addClass('bar-danger');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
2013-01-24 09:02:48 +00:00
|
|
|
|
|
|
|
|
|
/* The typeahead functionality useѕ the rest api */
|
|
|
|
|
$("#searchfield").typeahead({
|
|
|
|
|
minLength: 3,
|
|
|
|
|
source: function(query, process) {
|
|
|
|
|
$.get('../restapi/index.php/search', { query: query, limit: 8, mode: 'typeahead' }, function(data) {
|
|
|
|
|
process(data);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
updater: function (item) {
|
|
|
|
|
document.location = "../op/op.Search.php?query=" + encodeURIComponent(item);
|
|
|
|
|
return item;
|
|
|
|
|
}
|
|
|
|
|
});
|
2012-12-14 08:38:56 +00:00
|
|
|
|
});
|