mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2025-12-30 13:07:55 -05:00
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
function get_dimensions()
|
|
{
|
|
var dims = {width:0,height:0};
|
|
|
|
if( typeof( window.innerWidth ) == 'number' ) {
|
|
//Non-IE
|
|
dims.width = window.innerWidth;
|
|
dims.height = window.innerHeight;
|
|
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
|
|
//IE 6+ in 'standards compliant mode'
|
|
dims.width = document.documentElement.clientWidth;
|
|
dims.height = document.documentElement.clientHeight;
|
|
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
|
|
//IE 4 compatible
|
|
dims.width = document.body.clientWidth;
|
|
dims.height = document.body.clientHeight;
|
|
}
|
|
|
|
return dims;
|
|
}
|
|
|
|
function set_feedback(text, classname, keep_displayed)
|
|
{
|
|
if(text)
|
|
{
|
|
$('#feedback_bar').removeClass().addClass(classname).html(text).css('opacity','1');
|
|
|
|
if(!keep_displayed)
|
|
{
|
|
$('#feedback_bar').fadeTo(5000, 1).fadeTo("fast",0);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$('#feedback_bar').css('opacity','0');
|
|
}
|
|
}
|
|
|
|
;(function($){
|
|
//keylisteners
|
|
$.each(['customers', 'items', 'reports', 'receivings', 'sales'], function(key, value) {
|
|
$(window).jkey('f' + (key+1), function(){
|
|
window.location = BASE_URL + '/' + value + '/index';
|
|
});
|
|
});
|
|
})(jQuery);
|