enhanced administration of activities/projects/customers added navbar for active records and recent activities added edit timesheet entry form added translation packages for errors and flashmessages upgraded composer packages
57 lines
1.9 KiB
JavaScript
57 lines
1.9 KiB
JavaScript
$(document).ready(function() {
|
|
|
|
(function( $ ) {
|
|
|
|
var pubSub = $({});
|
|
|
|
var methods = {
|
|
init : function(options) {
|
|
$.fn.kimai.settings = $.extend( {}, $.fn.kimai.defaults, options );
|
|
},
|
|
hook: function(name) {
|
|
alert('Hook: ' + name);
|
|
},
|
|
subscribe: function() {
|
|
pubSub.on.apply(pubSub, arguments);
|
|
},
|
|
unsubscribe: function() {
|
|
pubSub.off.apply(pubSub, arguments);
|
|
},
|
|
publish: function() {
|
|
pubSub.trigger.apply(pubSub, arguments);
|
|
},
|
|
pauseRecord: function(selector) {
|
|
$(selector + ' .pull-left i').hover(function () {
|
|
var link = $(this).parents('a');
|
|
link.attr('href', link.attr('href').replace('/stop', '/pause'));
|
|
$(this).removeClass('fa-stop-circle').addClass('fa-pause-circle').addClass('text-orange');
|
|
},function () {
|
|
var link = $(this).parents('a');
|
|
link.attr('href', link.attr('href').replace('/pause', '/stop'));
|
|
$(this).removeClass('fa-pause-circle').removeClass('text-orange').addClass('fa-stop-circle');
|
|
});
|
|
}
|
|
};
|
|
|
|
$.fn.kimai = function(options) {
|
|
if (methods[options]) {
|
|
return methods[options].apply( this, Array.prototype.slice.call(arguments, 1));
|
|
} else if (typeof options === 'object') {
|
|
return methods.init.apply( this, arguments );
|
|
}
|
|
return this;
|
|
};
|
|
|
|
// default values
|
|
$.fn.kimai.defaults = {
|
|
baseUrl: '/',
|
|
imagePath: '/images'
|
|
};
|
|
|
|
// once initialized, here are all values
|
|
$.fn.kimai.settings = {};
|
|
|
|
}( jQuery ));
|
|
|
|
});
|