From 2b03d3bfd712727d3fae047d5d3aa237724a3be8 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 14 Apr 2016 21:31:01 +0200 Subject: [PATCH] Continue bootstrap-tables integration (#293) Refactor manage_tables code and use proper js namespacing Add glyphicons for most buttons in customers sections Tidy up HTML in customers table page Remove jquery-color plugin (not needed anymore) Fix some minor css issues (feedback bar bottom margin) --- application/controllers/Customers.php | 1 - application/controllers/Person_controller.php | 26 +- application/controllers/Suppliers.php | 1 - .../interfaces/Iperson_controller.php | 11 - application/helpers/table_helper.php | 2 +- application/views/partial/footer.php | 12 +- application/views/partial/header.php | 2 +- application/views/people/manage.php | 38 +- bower.json | 1 - css/ospos.css | 10 + dist/opensourcepos.js | 1329 +++-------------- dist/opensourcepos.min.css | 2 +- js/manage_tables.js | 350 +++-- templates/spacelab/views/partial/header.php | 2 +- 14 files changed, 449 insertions(+), 1338 deletions(-) delete mode 100644 application/controllers/interfaces/Iperson_controller.php diff --git a/application/controllers/Customers.php b/application/controllers/Customers.php index d88459d37..51b3ec13e 100644 --- a/application/controllers/Customers.php +++ b/application/controllers/Customers.php @@ -1,6 +1,5 @@ input->post('ids'); - - if($people_to_email!=false) - { - $mailto_url='mailto:'; - foreach($this->Person->get_multiple_info($people_to_email)->result() as $person) - { - $mailto_url.=$person->email.','; - } - //remove last comma - $mailto_url=substr($mailto_url,0,strlen($mailto_url)-1); - - echo $mailto_url; - exit; - } - echo '#'; - } - /* Gives search suggestions based on what is being searched for */ diff --git a/application/controllers/Suppliers.php b/application/controllers/Suppliers.php index 58d3c492d..7553a1349 100644 --- a/application/controllers/Suppliers.php +++ b/application/controllers/Suppliers.php @@ -1,6 +1,5 @@ \ No newline at end of file diff --git a/application/helpers/table_helper.php b/application/helpers/table_helper.php index faea6ae51..c0c303d72 100644 --- a/application/helpers/table_helper.php +++ b/application/helpers/table_helper.php @@ -171,7 +171,7 @@ function get_person_data_row($person, $controller) { 'id' => $person->person_id, 'last_name' => character_limiter($person->last_name,13), 'first_name' => character_limiter($person->first_name,13), - 'email' => mailto($person->email,character_limiter($person->email,22)), + 'email' => empty($person->email) ? '' : mailto($person->email,character_limiter($person->email,22)), 'phone_number' => character_limiter($person->phone_number,13), 'messages' => anchor("Messages/view/$person->person_id", '', array('class'=>"modal-dlg modal-btn-submit", 'title'=>$CI->lang->line('messages_sms_send'))), diff --git a/application/views/partial/footer.php b/application/views/partial/footer.php index b2cdfd0d5..8b8c7a920 100644 --- a/application/views/partial/footer.php +++ b/application/views/partial/footer.php @@ -3,12 +3,12 @@ ", - array('class'=>'modal-dlg modal-btn-submit', 'title'=>$this->lang->line($controller_name . '_new'))); ?> +
-
- - ' . $this->lang->line("common_delete") . '
', array('id'=>'delete')); ?> -
lang->line("common_email");?>
+
+ +
diff --git a/bower.json b/bower.json index ec3b93413..a55991722 100644 --- a/bower.json +++ b/bower.json @@ -24,7 +24,6 @@ "tests" ], "dependencies": { - "jquery-color": "~2.1.2", "jquery-form": "~3.46.0", "jquery-validate": "~1.13.1", "jquery": "~1.12.3", diff --git a/css/ospos.css b/css/ospos.css index c8f85ad22..3a4d08f48 100644 --- a/css/ospos.css +++ b/css/ospos.css @@ -29,6 +29,16 @@ a.none background-color: #FFFFFF; } +.alert +{ + margin-bottom: 0; +} + +.jumbotron.push-spaces +{ + margin:0; /*add this*/ +} + .navbar .menu-icon { text-align: center; diff --git a/dist/opensourcepos.js b/dist/opensourcepos.js index 675265084..ddce0f818 100644 --- a/dist/opensourcepos.js +++ b/dist/opensourcepos.js @@ -24180,670 +24180,6 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr }(window.jQuery); -/*! - * jQuery Color Animations v@VERSION - * https://github.com/jquery/jquery-color - * - * Copyright 2013 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - * - * Date: @DATE - */ -(function( jQuery, undefined ) { - - var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", - - // plusequals test for += 100 -= 100 - rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, - // a set of RE's that can match strings and generate color tuples. - stringParsers = [{ - re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, - parse: function( execResult ) { - return [ - execResult[ 1 ], - execResult[ 2 ], - execResult[ 3 ], - execResult[ 4 ] - ]; - } - }, { - re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, - parse: function( execResult ) { - return [ - execResult[ 1 ] * 2.55, - execResult[ 2 ] * 2.55, - execResult[ 3 ] * 2.55, - execResult[ 4 ] - ]; - } - }, { - // this regex ignores A-F because it's compared against an already lowercased string - re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/, - parse: function( execResult ) { - return [ - parseInt( execResult[ 1 ], 16 ), - parseInt( execResult[ 2 ], 16 ), - parseInt( execResult[ 3 ], 16 ) - ]; - } - }, { - // this regex ignores A-F because it's compared against an already lowercased string - re: /#([a-f0-9])([a-f0-9])([a-f0-9])/, - parse: function( execResult ) { - return [ - parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), - parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), - parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ) - ]; - } - }, { - re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, - space: "hsla", - parse: function( execResult ) { - return [ - execResult[ 1 ], - execResult[ 2 ] / 100, - execResult[ 3 ] / 100, - execResult[ 4 ] - ]; - } - }], - - // jQuery.Color( ) - color = jQuery.Color = function( color, green, blue, alpha ) { - return new jQuery.Color.fn.parse( color, green, blue, alpha ); - }, - spaces = { - rgba: { - props: { - red: { - idx: 0, - type: "byte" - }, - green: { - idx: 1, - type: "byte" - }, - blue: { - idx: 2, - type: "byte" - } - } - }, - - hsla: { - props: { - hue: { - idx: 0, - type: "degrees" - }, - saturation: { - idx: 1, - type: "percent" - }, - lightness: { - idx: 2, - type: "percent" - } - } - } - }, - propTypes = { - "byte": { - floor: true, - max: 255 - }, - "percent": { - max: 1 - }, - "degrees": { - mod: 360, - floor: true - } - }, - support = color.support = {}, - - // element for support tests - supportElem = jQuery( "

" )[ 0 ], - - // colors = jQuery.Color.names - colors, - - // local aliases of functions called often - each = jQuery.each; - -// determine rgba support immediately -supportElem.style.cssText = "background-color:rgba(1,1,1,.5)"; -support.rgba = supportElem.style.backgroundColor.indexOf( "rgba" ) > -1; - -// define cache name and alpha properties -// for rgba and hsla spaces -each( spaces, function( spaceName, space ) { - space.cache = "_" + spaceName; - space.props.alpha = { - idx: 3, - type: "percent", - def: 1 - }; -}); - -function clamp( value, prop, allowEmpty ) { - var type = propTypes[ prop.type ] || {}; - - if ( value == null ) { - return (allowEmpty || !prop.def) ? null : prop.def; - } - - // ~~ is an short way of doing floor for positive numbers - value = type.floor ? ~~value : parseFloat( value ); - - // IE will pass in empty strings as value for alpha, - // which will hit this case - if ( isNaN( value ) ) { - return prop.def; - } - - if ( type.mod ) { - // we add mod before modding to make sure that negatives values - // get converted properly: -10 -> 350 - return (value + type.mod) % type.mod; - } - - // for now all property types without mod have min and max - return 0 > value ? 0 : type.max < value ? type.max : value; -} - -function stringParse( string ) { - var inst = color(), - rgba = inst._rgba = []; - - string = string.toLowerCase(); - - each( stringParsers, function( i, parser ) { - var parsed, - match = parser.re.exec( string ), - values = match && parser.parse( match ), - spaceName = parser.space || "rgba"; - - if ( values ) { - parsed = inst[ spaceName ]( values ); - - // if this was an rgba parse the assignment might happen twice - // oh well.... - inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; - rgba = inst._rgba = parsed._rgba; - - // exit each( stringParsers ) here because we matched - return false; - } - }); - - // Found a stringParser that handled it - if ( rgba.length ) { - - // if this came from a parsed string, force "transparent" when alpha is 0 - // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) - if ( rgba.join() === "0,0,0,0" ) { - jQuery.extend( rgba, colors.transparent ); - } - return inst; - } - - // named colors - return colors[ string ]; -} - -color.fn = jQuery.extend( color.prototype, { - parse: function( red, green, blue, alpha ) { - if ( red === undefined ) { - this._rgba = [ null, null, null, null ]; - return this; - } - if ( red.jquery || red.nodeType ) { - red = jQuery( red ).css( green ); - green = undefined; - } - - var inst = this, - type = jQuery.type( red ), - rgba = this._rgba = []; - - // more than 1 argument specified - assume ( red, green, blue, alpha ) - if ( green !== undefined ) { - red = [ red, green, blue, alpha ]; - type = "array"; - } - - if ( type === "string" ) { - return this.parse( stringParse( red ) || colors._default ); - } - - if ( type === "array" ) { - each( spaces.rgba.props, function( key, prop ) { - rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); - }); - return this; - } - - if ( type === "object" ) { - if ( red instanceof color ) { - each( spaces, function( spaceName, space ) { - if ( red[ space.cache ] ) { - inst[ space.cache ] = red[ space.cache ].slice(); - } - }); - } else { - each( spaces, function( spaceName, space ) { - var cache = space.cache; - each( space.props, function( key, prop ) { - - // if the cache doesn't exist, and we know how to convert - if ( !inst[ cache ] && space.to ) { - - // if the value was null, we don't need to copy it - // if the key was alpha, we don't need to copy it either - if ( key === "alpha" || red[ key ] == null ) { - return; - } - inst[ cache ] = space.to( inst._rgba ); - } - - // this is the only case where we allow nulls for ALL properties. - // call clamp with alwaysAllowEmpty - inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); - }); - - // everything defined but alpha? - if ( inst[ cache ] && jQuery.inArray( null, inst[ cache ].slice( 0, 3 ) ) < 0 ) { - // use the default of 1 - inst[ cache ][ 3 ] = 1; - if ( space.from ) { - inst._rgba = space.from( inst[ cache ] ); - } - } - }); - } - return this; - } - }, - is: function( compare ) { - var is = color( compare ), - same = true, - inst = this; - - each( spaces, function( _, space ) { - var localCache, - isCache = is[ space.cache ]; - if (isCache) { - localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; - each( space.props, function( _, prop ) { - if ( isCache[ prop.idx ] != null ) { - same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); - return same; - } - }); - } - return same; - }); - return same; - }, - _space: function() { - var used = [], - inst = this; - each( spaces, function( spaceName, space ) { - if ( inst[ space.cache ] ) { - used.push( spaceName ); - } - }); - return used.pop(); - }, - transition: function( other, distance ) { - var end = color( other ), - spaceName = end._space(), - space = spaces[ spaceName ], - startColor = this.alpha() === 0 ? color( "transparent" ) : this, - start = startColor[ space.cache ] || space.to( startColor._rgba ), - result = start.slice(); - - end = end[ space.cache ]; - each( space.props, function( key, prop ) { - var index = prop.idx, - startValue = start[ index ], - endValue = end[ index ], - type = propTypes[ prop.type ] || {}; - - // if null, don't override start value - if ( endValue === null ) { - return; - } - // if null - use end - if ( startValue === null ) { - result[ index ] = endValue; - } else { - if ( type.mod ) { - if ( endValue - startValue > type.mod / 2 ) { - startValue += type.mod; - } else if ( startValue - endValue > type.mod / 2 ) { - startValue -= type.mod; - } - } - result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); - } - }); - return this[ spaceName ]( result ); - }, - blend: function( opaque ) { - // if we are already opaque - return ourself - if ( this._rgba[ 3 ] === 1 ) { - return this; - } - - var rgb = this._rgba.slice(), - a = rgb.pop(), - blend = color( opaque )._rgba; - - return color( jQuery.map( rgb, function( v, i ) { - return ( 1 - a ) * blend[ i ] + a * v; - })); - }, - toRgbaString: function() { - var prefix = "rgba(", - rgba = jQuery.map( this._rgba, function( v, i ) { - return v == null ? ( i > 2 ? 1 : 0 ) : v; - }); - - if ( rgba[ 3 ] === 1 ) { - rgba.pop(); - prefix = "rgb("; - } - - return prefix + rgba.join() + ")"; - }, - toHslaString: function() { - var prefix = "hsla(", - hsla = jQuery.map( this.hsla(), function( v, i ) { - if ( v == null ) { - v = i > 2 ? 1 : 0; - } - - // catch 1 and 2 - if ( i && i < 3 ) { - v = Math.round( v * 100 ) + "%"; - } - return v; - }); - - if ( hsla[ 3 ] === 1 ) { - hsla.pop(); - prefix = "hsl("; - } - return prefix + hsla.join() + ")"; - }, - toHexString: function( includeAlpha ) { - var rgba = this._rgba.slice(), - alpha = rgba.pop(); - - if ( includeAlpha ) { - rgba.push( ~~( alpha * 255 ) ); - } - - return "#" + jQuery.map( rgba, function( v ) { - - // default to 0 when nulls exist - v = ( v || 0 ).toString( 16 ); - return v.length === 1 ? "0" + v : v; - }).join(""); - }, - toString: function() { - return this._rgba[ 3 ] === 0 ? "transparent" : this.toRgbaString(); - } -}); -color.fn.parse.prototype = color.fn; - -// hsla conversions adapted from: -// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 - -function hue2rgb( p, q, h ) { - h = ( h + 1 ) % 1; - if ( h * 6 < 1 ) { - return p + (q - p) * h * 6; - } - if ( h * 2 < 1) { - return q; - } - if ( h * 3 < 2 ) { - return p + (q - p) * ((2/3) - h) * 6; - } - return p; -} - -spaces.hsla.to = function ( rgba ) { - if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { - return [ null, null, null, rgba[ 3 ] ]; - } - var r = rgba[ 0 ] / 255, - g = rgba[ 1 ] / 255, - b = rgba[ 2 ] / 255, - a = rgba[ 3 ], - max = Math.max( r, g, b ), - min = Math.min( r, g, b ), - diff = max - min, - add = max + min, - l = add * 0.5, - h, s; - - if ( min === max ) { - h = 0; - } else if ( r === max ) { - h = ( 60 * ( g - b ) / diff ) + 360; - } else if ( g === max ) { - h = ( 60 * ( b - r ) / diff ) + 120; - } else { - h = ( 60 * ( r - g ) / diff ) + 240; - } - - // chroma (diff) == 0 means greyscale which, by definition, saturation = 0% - // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add) - if ( diff === 0 ) { - s = 0; - } else if ( l <= 0.5 ) { - s = diff / add; - } else { - s = diff / ( 2 - add ); - } - return [ Math.round(h) % 360, s, l, a == null ? 1 : a ]; -}; - -spaces.hsla.from = function ( hsla ) { - if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { - return [ null, null, null, hsla[ 3 ] ]; - } - var h = hsla[ 0 ] / 360, - s = hsla[ 1 ], - l = hsla[ 2 ], - a = hsla[ 3 ], - q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, - p = 2 * l - q; - - return [ - Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), - Math.round( hue2rgb( p, q, h ) * 255 ), - Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), - a - ]; -}; - - -each( spaces, function( spaceName, space ) { - var props = space.props, - cache = space.cache, - to = space.to, - from = space.from; - - // makes rgba() and hsla() - color.fn[ spaceName ] = function( value ) { - - // generate a cache for this space if it doesn't exist - if ( to && !this[ cache ] ) { - this[ cache ] = to( this._rgba ); - } - if ( value === undefined ) { - return this[ cache ].slice(); - } - - var ret, - type = jQuery.type( value ), - arr = ( type === "array" || type === "object" ) ? value : arguments, - local = this[ cache ].slice(); - - each( props, function( key, prop ) { - var val = arr[ type === "object" ? key : prop.idx ]; - if ( val == null ) { - val = local[ prop.idx ]; - } - local[ prop.idx ] = clamp( val, prop ); - }); - - if ( from ) { - ret = color( from( local ) ); - ret[ cache ] = local; - return ret; - } else { - return color( local ); - } - }; - - // makes red() green() blue() alpha() hue() saturation() lightness() - each( props, function( key, prop ) { - // alpha is included in more than one space - if ( color.fn[ key ] ) { - return; - } - color.fn[ key ] = function( value ) { - var vtype = jQuery.type( value ), - fn = ( key === "alpha" ? ( this._hsla ? "hsla" : "rgba" ) : spaceName ), - local = this[ fn ](), - cur = local[ prop.idx ], - match; - - if ( vtype === "undefined" ) { - return cur; - } - - if ( vtype === "function" ) { - value = value.call( this, cur ); - vtype = jQuery.type( value ); - } - if ( value == null && prop.empty ) { - return this; - } - if ( vtype === "string" ) { - match = rplusequals.exec( value ); - if ( match ) { - value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); - } - } - local[ prop.idx ] = value; - return this[ fn ]( local ); - }; - }); -}); - -// add cssHook and .fx.step function for each named hook. -// accept a space separated string of properties -color.hook = function( hook ) { - var hooks = hook.split( " " ); - each( hooks, function( i, hook ) { - jQuery.cssHooks[ hook ] = { - set: function( elem, value ) { - var parsed, curElem, - backgroundColor = ""; - - if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) { - value = color( parsed || value ); - if ( !support.rgba && value._rgba[ 3 ] !== 1 ) { - curElem = hook === "backgroundColor" ? elem.parentNode : elem; - while ( - (backgroundColor === "" || backgroundColor === "transparent") && - curElem && curElem.style - ) { - try { - backgroundColor = jQuery.css( curElem, "backgroundColor" ); - curElem = curElem.parentNode; - } catch ( e ) { - } - } - - value = value.blend( backgroundColor && backgroundColor !== "transparent" ? - backgroundColor : - "_default" ); - } - - value = value.toRgbaString(); - } - try { - elem.style[ hook ] = value; - } catch( e ) { - // wrapped to prevent IE from throwing errors on "invalid" values like 'auto' or 'inherit' - } - } - }; - jQuery.fx.step[ hook ] = function( fx ) { - if ( !fx.colorInit ) { - fx.start = color( fx.elem, hook ); - fx.end = color( fx.end ); - fx.colorInit = true; - } - jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); - }; - }); - -}; - -color.hook( stepHooks ); - -jQuery.cssHooks.borderColor = { - expand: function( value ) { - var expanded = {}; - - each( [ "Top", "Right", "Bottom", "Left" ], function( i, part ) { - expanded[ "border" + part + "Color" ] = value; - }); - return expanded; - } -}; - -// Basic color names only. -// Usage of any of the other color names requires adding yourself or including -// jquery.color.svg-names.js. -colors = jQuery.Color.names = { - // 4.1. Basic color keywords - aqua: "#00ffff", - black: "#000000", - blue: "#0000ff", - fuchsia: "#ff00ff", - gray: "#808080", - green: "#008000", - lime: "#00ff00", - maroon: "#800000", - navy: "#000080", - olive: "#808000", - purple: "#800080", - red: "#ff0000", - silver: "#c0c0c0", - teal: "#008080", - white: "#ffffff", - yellow: "#ffff00", - - // 4.2.3. "transparent" color keyword - transparent: [ null, null, null, 0 ], - - _default: "#ffffff" -}; - -})( jQuery ); - /*! * jQuery Form Plugin * version: 3.46.0-2013.11.21 @@ -49941,413 +49277,7 @@ $.tablesorter.addWidget({ }; -})(jQuery);;function checkbox_click(event) -{ - event.stopPropagation(); - do_email(enable_email.url); - if($(event.target).is(':checked')) - { - $(event.target).parent().parent().find("td").addClass('selected').css("backgroundColor",""); - } - else - { - $(event.target).parent().parent().find("td").removeClass(); - } -} - -function enable_search(options) -{ - if (!options.format_item) { - format_item = function(results) { - return results[0]; - }; - } - //Keep track of enable_email has been called - if(!enable_search.enabled) - enable_search.enabled=true; - - $('#search').click(function() - { - $(this).attr('value',''); - }); - - var widget = $("#search").autocomplete({ - source: function (request, response) { - var extra_params = {limit: 100}; - $.each(options.extra_params, function(key, param) { - extra_params[key] = typeof param == "function" ? param() : param; - }); - - $.ajax({ - type: "POST", - url: options.suggest_url, - dataType: "json", - data: $.extend(request, extra_params), - success: function(data) { - response($.map(data, function(item) { - return { - value: item.label, - }; - }))} - }); - }, - delay:10, - autoFocus: false, - select: function (a, ui) { - $(this).val(ui.item.value); - do_search(true, options.on_complete); - } - }); - - attach_search_listener(); - - $('#search_form').submit(function(event) - { - event.preventDefault(); - // reset page number when selecting a specific page number - $('#limit_from').val(0); - if(get_selected_values().length >0) - { - if(!confirm(options.confirm_search_message)) - return; - } - do_search(true, options.on_complete); - }); - - return widget; -} -enable_search.enabled=false; - -function attach_search_listener() -{ - // prevent redirecting to link when search enabled - $("#pagination a").click(function(event) { - if ($("#search").val() || $("#search_form input:checked")) { - event.preventDefault(); - // set limit_from to value included in the link - var uri_segments = event.currentTarget.href.split('/'); - var limit_from = uri_segments.pop(); - $('#limit_from').val(limit_from); - do_search(true); - } - }); -} - -function do_search(show_feedback,on_complete) -{ - //If search is not enabled, don't do anything - if(!enable_search.enabled) - return; - - if(show_feedback) - $('#search').addClass("ac_loading"); - - $.post( - $('#search_form').attr('action'), - // serialize all the input fields in the form - $('#search_form').serialize(), - function(response) { - $('#sortable_table tbody').html(response.rows); - if(typeof on_complete=='function') - on_complete(response); - $('#search').removeClass("ac_loading"); - $('#pagination').html(response.pagination); - //re-init elements in new table, as table tbody children were replaced - dialog_support.init('#sortable_table a.modal-dlg'); - $('#sortable_table tbody :checkbox').click(checkbox_click); - $("#select_all").prop('checked',false); - if (response.total_rows > 0) - { - update_sortable_table(); - enable_row_selection(); - } - attach_search_listener(); - }, "json" - ); -} - -function enable_email(email_url) -{ - //Keep track of enable_email has been called - if(!enable_email.enabled) - enable_email.enabled=true; - - //store url in function cache - if(!enable_email.url) - { - enable_email.url=email_url; - } - - $('#select_all, #sortable_table tbody :checkbox').click(checkbox_click); -} -enable_email.enabled=false; -enable_email.url=false; - -function do_email(url) -{ - //If email is not enabled, don't do anything - if(!enable_email.enabled) - return; - - $.post(url, { 'ids[]': get_selected_values() },function(response) - { - $('#email').attr('href',response); - }); - -} - -function enable_checkboxes() -{ - $('#sortable_table tbody :checkbox').click(checkbox_click); -} - -function enable_delete(confirm_message,none_selected_message) -{ - //Keep track of enable_delete has been called - if(!enable_delete.enabled) - enable_delete.enabled=true; - - $("#delete").click(function(event) - { - event.preventDefault(); - if($("#sortable_table tbody :checkbox:checked").length >0) - { - if(confirm(confirm_message)) - { - do_delete($(this).attr('href')); - } else { - return false; - } - } - else - { - alert(none_selected_message); - } - }); -} -enable_delete.enabled=false; - -function do_delete(url) -{ - //If delete is not enabled, don't do anything - if(!enable_delete.enabled) - return; - - var row_ids = get_selected_values(); - var selected_rows = get_selected_rows(); - $.post(url, { 'ids[]': row_ids },function(response) - { - //delete was successful, remove checkbox rows - if(response.success) - { - $(selected_rows).each(function(index, dom) - { - $(this).find("td").animate({backgroundColor:"green"},1200,"linear") - .end().animate({opacity:0},1200,"linear",function() - { - $(this).remove(); - //Re-init sortable table as we removed a row - $("#sortable_table tbody tr").length > 0 && update_sortable_table(); - - }); - }); - - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } - },"json"); -} - -function enable_bulk_edit(none_selected_message) -{ - //Keep track of enable_bulk_edit has been called - if(!enable_bulk_edit.enabled) - enable_bulk_edit.enabled=true; - - $('#bulk_edit').click(function(event) - { - if($("#sortable_table tbody :checkbox:checked").length == 0) - { - alert(none_selected_message); - return false; - } - event.preventDefault(); - }); -} -enable_bulk_edit.enabled=false; - -function enable_select_all() -{ - //Keep track of enable_select_all has been called - if(!enable_select_all.enabled) - enable_select_all.enabled=true; - - $('#select_all').click(function() - { - if($(this).is(':checked')) - { - $("#sortable_table tbody :checkbox").each(function() - { - $(this).prop('checked',true); - $(this).parent().parent().find("td").addClass('selected').css("backgroundColor",""); - - }); - } - else - { - $("#sortable_table tbody :checkbox").each(function() - { - $(this).prop('checked',false); - $(this).parent().parent().find("td").removeClass(); - }); - } - }); -} -enable_select_all.enabled=false; - -function enable_row_selection(rows) -{ - //Keep track of enable_row_selection has been called - if(!enable_row_selection.enabled) - enable_row_selection.enabled=true; - - if(typeof rows =="undefined") - rows=$("#sortable_table tbody tr"); - - rows.hover( - function row_over() - { - $(this).find("td").addClass('over').css("backgroundColor",""); - $(this).css("cursor","pointer"); - }, - - function row_out() - { - if(!$(this).find("td").hasClass("selected")) - { - $(this).find("td").removeClass(); - } - } - ); - - rows.click(function row_click(event) - { - var checkbox = $(this).find(":checkbox"); - checkbox.prop('checked',!checkbox.is(':checked')); - do_email(enable_email.url); - - if(checkbox.is(':checked')) - { - $(this).find("td").addClass('selected').css("backgroundColor",""); - } - else - { - $(this).find("td").removeClass(); - } - }); -} -enable_row_selection.enabled=false; - -function update_sortable_table() -{ - //let tablesorter know we changed and then triger a resort - $("#sortable_table").trigger("update"); - if(typeof $("#sortable_table")[0].config!="undefined") - { - var sorting = $("#sortable_table")[0].config.sortList; - $("#sortable_table").trigger("sorton",[sorting]); - } - else - { - window['init_table_sorting'] && init_table_sorting(); - } -} - -function get_table_row(id) -{ - id = id || $("input[name='sale_id']").val(); - var $element = $("#sortable_table tbody :checkbox[value='" + id + "']"); - if ($element.length === 0) { - $element = $("#sortable_table tbody a[href*='/" + id + "/']"); - } - return $element; -} - -function update_row(row_id,url,callback) -{ - $.post(url, { 'row_id': row_id },function(response) - { - //Replace previous row - var row_to_update = get_table_row(row_id).parent().parent(); - row_to_update.replaceWith(response); - reinit_row(row_id); - hightlight_row(row_id); - callback && typeof(callback) == "function" && callback(); - }, 'html'); -} - -function reinit_row(checkbox_id) -{ - var new_checkbox = $("#sortable_table tbody tr :checkbox[value="+checkbox_id+"]"); - var new_row = new_checkbox.parent().parent(); - enable_row_selection(new_row); - //Re-init some stuff as we replaced row - update_sortable_table(); - dialog_support.init(new_row.find("a.modal-dlg")); - //re-enable email - new_checkbox.click(checkbox_click); -} - -function animate_row(row,color) -{ - color = color || "#e1ffdd"; - row.find("td").css("backgroundColor", "#ffffff").animate({backgroundColor:color},"slow","linear") - .animate({backgroundColor:color},5000) - .animate({backgroundColor:"#ffffff"},"slow","linear"); -} - -function hightlight_row(checkbox_id) -{ - var new_checkbox = $("#sortable_table tbody tr :checkbox[value="+checkbox_id+"]"); - var new_row = new_checkbox.parent().parent(); - - animate_row(new_row); -} - -function get_selected_values() -{ - var selected_values = new Array(); - $("#sortable_table tbody :checkbox:checked").each(function() - { - selected_values.push($(this).val()); - }); - return selected_values; -} - -function get_selected_rows() -{ - var selected_rows = new Array(); - $("#sortable_table tbody :checkbox:checked").each(function() - { - selected_rows.push($(this).parent().parent()); - }); - return selected_rows; -} - -function get_visible_checkbox_ids() -{ - var row_ids = new Array(); - $("#sortable_table tbody :checkbox").each(function() - { - row_ids.push($(this).val()); - }); - return row_ids; -} - -dialog_support = (function() { +})(jQuery);;(function(dialog_support, $) { var btn_id, dialog_ref; @@ -50360,23 +49290,21 @@ dialog_support = (function() { }; var submit = function(button_id) { - return function(dlog_ref) - { + return function(dlog_ref) { btn_id = button_id; dialog_ref = dlog_ref; - if (button_id == 'delete') - { + + if (button_id == 'delete') { $("form[id*='delete_form']").submit(); - } - else - { + } else { $('form', dlog_ref.$modalBody).first().submit(); } } }; var init = function(selector) { - return $(selector).click(function(event) { + + var buttons = function(event) { var buttons = []; var dialog_class = 'modal-dlg'; $.each($(this).attr('class').split(/\s+/), function(classIndex, className) { @@ -50406,53 +49334,226 @@ dialog_support = (function() { dialog_ref.close(); } }); + return { buttons: buttons, cssClass: dialog_class}; + }; - var $link = $(event.target); - $link = $link.is("a") ? $link : $link.parents("a"); - BootstrapDialog.show({ - cssClass: dialog_class, - title: $link.attr('title'), - buttons: buttons, - message: (function() { - var node = $('

'); - $.get($link.attr('href'), function(data) { - node.html(data); - }); - return node; - }) + $(selector).each(function(index, $element) { + + return $(selector).off('click').on('click', function(event) { + var $link = $(event.target); + $link = !$link.is("a, button") ? $link.parents("a") : $link ; + BootstrapDialog.show($.extend({ + title: $link.attr('title'), + message: (function() { + var node = $('
'); + $.get($link.attr('href') || $link.data('href'), function(data) { + node.html(data); + }); + return node; + }) + }, buttons.call(this, event))); + + event.preventDefault(); }); - - event.preventDefault(); }); }; - $(document).ready(function() { - init("a.modal-dlg"); - }); + dialog_support.error = { + errorClass: "has-error", + errorLabelContainer: "#error_message_box", + wrapper: "li", + highlight: function (e) { + $(e).closest('.form-group').addClass('has-error'); + }, + unhighlight: function (e) { + $(e).closest('.form-group').removeClass('has-error'); + } + }; - return { - hide: hide, - clicked_id: clicked_id, + $.extend(dialog_support, { init: init, submit: submit, - error: { - errorClass: "has-error", - errorLabelContainer: "#error_message_box", - wrapper: "li", - highlight: function (e) - { - $(e).closest('.form-group').addClass('has-error'); + hide: hide, + clicked_id: clicked_id + }); + +})(window.dialog_support = window.dialog_support || {}, jQuery); + +(function(table_support, $) { + var init_autocomplete = function () { + + var widget = $("#search").autocomplete({ + source: function (request, response) { + var extra_params = {limit: 100}; + $.each(options.extra_params, function (key, param) { + extra_params[key] = typeof param == "function" ? param() : param; + }); + + $.ajax({ + type: "POST", + url: options.suggest_url, + dataType: "json", + data: $.extend(request, extra_params), + success: function (data) { + response($.map(data, function (item) { + return { + value: item.label, + }; + })) + } + }); }, - unhighlight: function (e) - { - $(e).closest('.form-group').removeClass('has-error'); + delay: 10, + autoFocus: false, + select: function (a, ui) { + $(this).val(ui.item.value); + do_search(true, options.on_complete); + } + }); + }; + + var table = function() { + return $("#table").data('bootstrap.table'); + } + + var selected_ids = function () { + return $.map(table().getSelections(), function (element) { + return element.id; + }); + }; + + var selected_rows = function () { + return $("#table input:checkbox:checked").parents("tr"); + }; + + var do_delete = function (url) { + $.post(url, {'ids[]': selected_ids()}, function (response) { + //delete was successful, remove checkbox rows + if (response.success) { + table().remove({ + field: 'id', + values: selected_ids() + }); + + // animated delete below + /*$(selected_rows()).each(function (index, dom) { + /*$(this).find("td").animate({backgroundColor: "green"}, 1200, "linear") + .end().animate({opacity: 0}, 1200, "linear", function () { + $(this).remove(); + }); + });*/ + set_feedback(response.message, 'alert alert-dismissible alert-success', false); + } else { + set_feedback(response.message, 'alert alert-dismissible alert-danger', true); + } + enable_actions(); + }, "json"); + }; + + var do_email = function() { + var recipients = $.map($("tr.selected a[href^='mailto:']"), function(element) { + return $(element).attr('href').replace(/^mailto:/, ''); + }); + location.href = "mailto:" + recipients.join(","); + }; + + var highlight_rows = function (id, color) { + var original = $("tr.selected").css('backgroundColor'); + var selector = ((id && "tr[data-uniqueid='" + id + "']")) || "tr.selected"; + $(selector).removeClass("selected").animate({backgroundColor: color || '#e1ffdd'}, "slow", "linear") + .animate({backgroundColor: color || '#e1ffdd'}, 5000) + .animate({backgroundColor: original}, "slow", "linear"); + $("tr input:checkbox:checked").prop("checked", false); + }; + + var init_email = function() { + $("#email").click(function(evvent) { + do_email(); + }); + }; + + var enable_actions = function() { + var delete_disabled = selected_rows().length == 0; + $("#delete").attr('disabled', delete_disabled); + var email_disabled = $("tr.selected a[href^='mailto:']").length == 0; + $("#email").attr('disabled', email_disabled); + }; + + var load_callback; + + var load_success = function() { + typeof load_callback == 'function' && load_callback(); + load_callback = undefined; + dialog_support.init("a.modal-dlg, button.modal-dlg"); + }; + + var init = function (resource, headers) { + $('#table').bootstrapTable({ + columns: headers, + url: resource + '/search', + sidePagination: 'server', + striped: true, + pagination: true, + search: true, + showColumns: true, + clickToSelect: true, + toolbar: '#toolbar', + uniqueId: 'id', + onCheck: enable_actions, + onUncheck: enable_actions, + onLoadSuccess: load_success + }); + init_email(); + enable_actions(); + }; + + var init_delete = function (confirm_message) { + $("#delete").click(function (event) { + if (confirm(confirm_message)) { + do_delete($(this).attr('href') || $(this).data('href')); + } else { + return false; + } + }); + }; + + var handle_submit = function (resource, response) { + var $table = $("#table").data('bootstrap.table'); + var id = response.id; + + if (!response.success) { + set_feedback(response.message, 'alert alert-dismissible alert-danger', true); + } else { + //This is an update, just update one row + var message = response.message; + + if (jQuery.inArray(id, selected_ids()) != -1) { + $.get({ + url: resource + '/get_row/' + id, + success: function (response) { + $table.updateByUniqueId({id: response.id, row: response}); + highlight_rows(); + set_feedback(message, 'alert alert-dismissible alert-success', false); + }, + dataType: 'json' + }); + } else { + // call hightlight function once after refresh + load_callback = function() { highlight_rows(id); }; + $table.refresh(); + set_feedback(message, 'alert alert-dismissible alert-success', false); } } }; -})(); + $.extend(table_support, { + handle_submit: handle_submit, + init_delete: init_delete, + init: init, + init_email: init_email + }); -;(function($) { +})(window.table_support = window.table_support || {}, jQuery);;(function($) { function http_s(url) { @@ -50461,13 +49562,13 @@ dialog_support = (function() { if (window.sessionStorage && !sessionStorage['country']) { - $.ajax({ + /*$.ajax({ type: "GET", url: http_s('ipinfo.io/json'), success: function(response) { sessionStorage['country'] = response.country; }, dataType: 'jsonp' - }); + })*/; } var url = http_s('nominatim.openstreetmap.org/search'); diff --git a/dist/opensourcepos.min.css b/dist/opensourcepos.min.css index 3e0a122d8..d0261d1d4 100644 --- a/dist/opensourcepos.min.css +++ b/dist/opensourcepos.min.css @@ -15,4 +15,4 @@ * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * - */.datetimepicker{padding:4px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;direction:ltr}.datetimepicker-inline{width:220px}.datetimepicker.datetimepicker-rtl{direction:rtl}.datetimepicker.datetimepicker-rtl table tr td span{float:right}.datetimepicker-dropdown,.datetimepicker-dropdown-left{top:0;left:0}[class*=" datetimepicker-dropdown"]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);position:absolute}[class*=" datetimepicker-dropdown"]:after{border-bottom:6px solid #fff;position:absolute}[class*=" datetimepicker-dropdown-top"]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);border-bottom:0}[class*=" datetimepicker-dropdown-top"]:after{border-top:6px solid #fff;border-bottom:0}.datetimepicker-dropdown-bottom-left:before{top:-7px;right:6px}.datetimepicker-dropdown-bottom-left:after{top:-6px;right:7px}.datetimepicker-dropdown-bottom-right:before{top:-7px;left:6px}.datetimepicker-dropdown-bottom-right:after{top:-6px;left:7px}.datetimepicker-dropdown-top-left:before{bottom:-7px;right:6px}.datetimepicker-dropdown-top-left:after{bottom:-6px;right:7px}.datetimepicker-dropdown-top-right:before{bottom:-7px;left:6px}.datetimepicker-dropdown-top-right:after{bottom:-6px;left:7px}.datetimepicker>div{display:none}.datetimepicker.days div.datetimepicker-days,.datetimepicker.hours div.datetimepicker-hours,.datetimepicker.minutes div.datetimepicker-minutes,.datetimepicker.months div.datetimepicker-months,.datetimepicker.years div.datetimepicker-years{display:block}.datetimepicker table{margin:0}.datetimepicker td,.datetimepicker th{text-align:center;width:20px;height:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0}.table-striped .datetimepicker table tr td,.table-striped .datetimepicker table tr th{background-color:transparent}.datetimepicker table tr td.day:hover,.datetimepicker table tr td.hour:hover,.datetimepicker table tr td.minute:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.new,.datetimepicker table tr td.old{color:#999}.datetimepicker table tr td.disabled,.datetimepicker table tr td.disabled:hover{background:0;color:#999;cursor:default}.datetimepicker table tr td.today,.datetimepicker table tr td.today.disabled,.datetimepicker table tr td.today.disabled:hover,.datetimepicker table tr td.today:hover{background-color:#fde19a;background-image:-moz-linear-gradient(top,#fdd49a,#fdf59a);background-image:-ms-linear-gradient(top,#fdd49a,#fdf59a);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdd49a),to(#fdf59a));background-image:-webkit-linear-gradient(top,#fdd49a,#fdf59a);background-image:-o-linear-gradient(top,#fdd49a,#fdf59a);background-image:linear-gradient(top,#fdd49a,#fdf59a);background-repeat:repeat-x;border-color:#fdf59a #fdf59a #fbed50;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.datetimepicker table tr td.today.active,.datetimepicker table tr td.today.disabled,.datetimepicker table tr td.today.disabled.active,.datetimepicker table tr td.today.disabled.disabled,.datetimepicker table tr td.today.disabled:active,.datetimepicker table tr td.today.disabled:hover,.datetimepicker table tr td.today.disabled:hover.active,.datetimepicker table tr td.today.disabled:hover.disabled,.datetimepicker table tr td.today.disabled:hover:active,.datetimepicker table tr td.today.disabled:hover:hover,.datetimepicker table tr td.today.disabled:hover[disabled],.datetimepicker table tr td.today.disabled[disabled],.datetimepicker table tr td.today:active,.datetimepicker table tr td.today:hover,.datetimepicker table tr td.today:hover.active,.datetimepicker table tr td.today:hover.disabled,.datetimepicker table tr td.today:hover:active,.datetimepicker table tr td.today:hover:hover,.datetimepicker table tr td.today:hover[disabled],.datetimepicker table tr td.today[disabled]{background-color:#fdf59a}.datetimepicker table tr td.today.active,.datetimepicker table tr td.today.disabled.active,.datetimepicker table tr td.today.disabled:active,.datetimepicker table tr td.today.disabled:hover.active,.datetimepicker table tr td.today.disabled:hover:active,.datetimepicker table tr td.today:active,.datetimepicker table tr td.today:hover.active,.datetimepicker table tr td.today:hover:active{background-color:#fbf069}.datetimepicker table tr td.active,.datetimepicker table tr td.active.disabled,.datetimepicker table tr td.active.disabled:hover,.datetimepicker table tr td.active:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-ms-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(top,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datetimepicker table tr td.active.active,.datetimepicker table tr td.active.disabled,.datetimepicker table tr td.active.disabled.active,.datetimepicker table tr td.active.disabled.disabled,.datetimepicker table tr td.active.disabled:active,.datetimepicker table tr td.active.disabled:hover,.datetimepicker table tr td.active.disabled:hover.active,.datetimepicker table tr td.active.disabled:hover.disabled,.datetimepicker table tr td.active.disabled:hover:active,.datetimepicker table tr td.active.disabled:hover:hover,.datetimepicker table tr td.active.disabled:hover[disabled],.datetimepicker table tr td.active.disabled[disabled],.datetimepicker table tr td.active:active,.datetimepicker table tr td.active:hover,.datetimepicker table tr td.active:hover.active,.datetimepicker table tr td.active:hover.disabled,.datetimepicker table tr td.active:hover:active,.datetimepicker table tr td.active:hover:hover,.datetimepicker table tr td.active:hover[disabled],.datetimepicker table tr td.active[disabled]{background-color:#04c}.datetimepicker table tr td.active.active,.datetimepicker table tr td.active.disabled.active,.datetimepicker table tr td.active.disabled:active,.datetimepicker table tr td.active.disabled:hover.active,.datetimepicker table tr td.active.disabled:hover:active,.datetimepicker table tr td.active:active,.datetimepicker table tr td.active:hover.active,.datetimepicker table tr td.active:hover:active{background-color:#039}.datetimepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.datetimepicker .datetimepicker-hours span{height:26px;line-height:26px}.datetimepicker .datetimepicker-hours table tr td span.hour_am,.datetimepicker .datetimepicker-hours table tr td span.hour_pm{width:14.6%}.datetimepicker .datetimepicker-hours fieldset legend,.datetimepicker .datetimepicker-minutes fieldset legend{margin-bottom:inherit;line-height:30px}.datetimepicker .datetimepicker-minutes span{height:26px;line-height:26px}.datetimepicker table tr td span:hover{background:#eee}.datetimepicker table tr td span.disabled,.datetimepicker table tr td span.disabled:hover{background:0;color:#999;cursor:default}.datetimepicker table tr td span.active,.datetimepicker table tr td span.active.disabled,.datetimepicker table tr td span.active.disabled:hover,.datetimepicker table tr td span.active:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-ms-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(top,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datetimepicker table tr td span.active.active,.datetimepicker table tr td span.active.disabled,.datetimepicker table tr td span.active.disabled.active,.datetimepicker table tr td span.active.disabled.disabled,.datetimepicker table tr td span.active.disabled:active,.datetimepicker table tr td span.active.disabled:hover,.datetimepicker table tr td span.active.disabled:hover.active,.datetimepicker table tr td span.active.disabled:hover.disabled,.datetimepicker table tr td span.active.disabled:hover:active,.datetimepicker table tr td span.active.disabled:hover:hover,.datetimepicker table tr td span.active.disabled:hover[disabled],.datetimepicker table tr td span.active.disabled[disabled],.datetimepicker table tr td span.active:active,.datetimepicker table tr td span.active:hover,.datetimepicker table tr td span.active:hover.active,.datetimepicker table tr td span.active:hover.disabled,.datetimepicker table tr td span.active:hover:active,.datetimepicker table tr td span.active:hover:hover,.datetimepicker table tr td span.active:hover[disabled],.datetimepicker table tr td span.active[disabled]{background-color:#04c}.datetimepicker table tr td span.active.active,.datetimepicker table tr td span.active.disabled.active,.datetimepicker table tr td span.active.disabled:active,.datetimepicker table tr td span.active.disabled:hover.active,.datetimepicker table tr td span.active.disabled:hover:active,.datetimepicker table tr td span.active:active,.datetimepicker table tr td span.active:hover.active,.datetimepicker table tr td span.active:hover:active{background-color:#039}.datetimepicker table tr td span.old{color:#999}.datetimepicker th.switch{width:145px}.datetimepicker th span.glyphicon{pointer-events:none}.datetimepicker tfoot th,.datetimepicker thead tr:first-child th{cursor:pointer}.datetimepicker tfoot th:hover,.datetimepicker thead tr:first-child th:hover{background:#eee}.input-append.date .add-on i,.input-group.date .input-group-addon span,.input-prepend.date .add-on i{cursor:pointer;width:14px;height:14px}.tablesorter-blue{width:100%;background-color:#fff;margin:10px 0 15px;text-align:left;border-spacing:0;border:1px solid #cdcdcd;border-width:1px 0 0 1px}.tablesorter-blue td,.tablesorter-blue th{border:1px solid #cdcdcd;border-width:0 1px 1px 0}.tablesorter-blue th,.tablesorter-blue thead td{font:12px/18px Arial,Sans-serif;font-weight:700;color:#000;background-color:#99bfe6;border-collapse:collapse;padding:4px;text-shadow:0 1px 0 rgba(204,204,204,.7)}.tablesorter-blue tbody td,.tablesorter-blue tfoot td,.tablesorter-blue tfoot th{padding:4px;vertical-align:top}.tablesorter-blue .header,.tablesorter-blue .tablesorter-header{background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-repeat:no-repeat;background-position:center right;padding:4px 18px 4px 4px;white-space:normal;cursor:pointer}.tablesorter-blue .headerSortUp,.tablesorter-blue .tablesorter-headerAsc,.tablesorter-blue .tablesorter-headerSortUp{background-color:#9fbfdf;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7)}.tablesorter-blue .headerSortDown,.tablesorter-blue .tablesorter-headerDesc,.tablesorter-blue .tablesorter-headerSortDown{background-color:#8cb3d9;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7)}.tablesorter-blue thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-blue tfoot .tablesorter-headerAsc,.tablesorter-blue tfoot .tablesorter-headerDesc,.tablesorter-blue tfoot .tablesorter-headerSortDown,.tablesorter-blue tfoot .tablesorter-headerSortUp{background-image:none}.tablesorter-blue td{color:#3d3d3d;background-color:#fff;padding:4px;vertical-align:top}.tablesorter-blue tbody>tr.even.hover>td,.tablesorter-blue tbody>tr.even:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.even:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.even:hover>td,.tablesorter-blue tbody>tr.hover>td,.tablesorter-blue tbody>tr:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr:hover>td{background-color:#d9d9d9}.tablesorter-blue tbody>tr.odd.hover>td,.tablesorter-blue tbody>tr.odd:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.odd:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.odd:hover>td{background-color:#bfbfbf}.tablesorter-blue .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-blue tbody tr.odd>td{background-color:#ebf2fa}.tablesorter-blue tbody tr.even>td{background-color:#fff}.tablesorter-blue td.primary,.tablesorter-blue tr.odd td.primary{background-color:#99b3e6}.tablesorter-blue td.secondary,.tablesorter-blue tr.even td.primary,.tablesorter-blue tr.odd td.secondary{background-color:#c2d1f0}.tablesorter-blue td.tertiary,.tablesorter-blue tr.even td.secondary,.tablesorter-blue tr.odd td.tertiary{background-color:#d6e0f5}.tablesorter-blue tr.even td.tertiary{background-color:#ebf0fa}caption{background-color:#fff}.tablesorter-blue .tablesorter-filter-row{background-color:#eee}.tablesorter-blue .tablesorter-filter-row td{background-color:#eee;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-blue .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-blue .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-blue .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-blue input.tablesorter-filter,.tablesorter-blue select.tablesorter-filter{width:98%;height:auto;margin:0;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99}#logo,#meta td{text-align:right}@font-face{font-family:SansationLight;src:url(../fonts/SansationLight.eot);src:local('SansationLight'),url(../fonts/SansationLight.woff) format('woff'),url(../fonts/SansationLight.ttf) format('truetype')}.font_SansationLight{font-family:SansationLight!important}@font-face{font-family:Arial;src:url(../fonts/Arial.eot);src:local('Arial'),url(../fonts/Arial.woff) format('woff'),url(../fonts/Arial.ttf) format('truetype')}.font_Arial{font-family:Arial!important}@font-face{font-family:JUNEBUG;src:url(../fonts/JUNEBUG.eot);src:local('JUNEBUG'),url(../fonts/JUNEBUG.woff) format('woff'),url(../fonts/JUNEBUG.ttf) format('truetype')}.font_JUNEBUG{font-family:JUNEBUG!important}@font-face{font-family:b-de-bonita-shadow;src:url(../fonts/b-de-bonita-shadow.eot);src:local('JUNEBUG'),url(../fonts/b-de-bonita-shadow.woff) format('woff'),url(../fonts/b-de-bonita-shadow.ttf) format('truetype')}.font_b-de-bonita-shadow{font-family:b-de-bonita-shadow!important}.ui-autocomplete{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:13px;background-color:#fff;border-color:#ccc;border-color:rgba(0,0,0,.15);border-style:solid;border-width:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.175);-moz-box-shadow:0 5px 10px rgba(0,0,0,.175);box-shadow:0 5px 10px rgba(0,0,0,.175);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}#logo,.delete-wpr{position:relative}.ui-autocomplete .ui-menu-item>a.ui-corner-all{display:block;padding:3px 15px;clear:both;font-weight:400;line-height:18px;color:#7b8a8b;white-space:nowrap}#header,.delete{font-weight:700}.ui-autocomplete .ui-menu-item>a.ui-corner-all.ui-state-active,.ui-autocomplete .ui-menu-item>a.ui-corner-all.ui-state-hover{color:#fff;text-decoration:none;background-color:#f5f5f5;border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;background-image:none}*{margin:0;padding:0}#page-wrap{width:100%;margin:0 auto;max-width:800px}#page-wrap textarea{border:0;font-size:14px;resize:none}#page-wrap table td,#page-wrap table th{border:1px solid #000;padding:5px}#page-wrap table td{padding:5px}#header{margin:20px 0;background:#222;text-align:center;color:#fff;font-size:2em;letter-spacing:4px;padding:10px 0}#logo{margin-top:15px;float:left;border:1px solid #fff}#logo img{max-width:150px}#logoctr{display:none}#logo.edit #logoctr,#logo:hover #logoctr{display:block;text-align:right;line-height:25px;background:#eee;padding:0 5px}#logohelp{text-align:left;display:none;font-style:italic;padding:10px 5px}#logohelp input{margin-bottom:5px}.edit #logohelp{display:block}.edit #cancel-logo,.edit #save-logo{display:inline}#cancel-logo,#save-logo,.edit #change-logo,.edit #delete-logo,.edit #image{display:none}#customer-title{height:100px;float:right;margin-top:40px}#customer-title textarea{width:150px}#block2{width:100%}#company-title{float:left}#meta{margin-top:1px;width:300px;float:right}#meta td.meta-head{text-align:left;background:#eee}#meta td textarea{width:100%;height:20px;text-align:right}#items{clear:both;width:100%;margin:30px 0 0;border:1px solid #000}#items th{background:#eee;text-align:center}#items textarea{width:80px;height:20px}#items tr.item-row td{border:0;vertical-align:top}#items td.description{width:300px}#items td.item-name{width:175px}#items td.description textarea,#items td.item-name textarea{width:100%}#items td.total-line{border-right:0;text-align:right}#config_wrapper,#feedback_bar,#footer,#home_module_list,#item_kit_items td,#item_kit_items th,#items_count_details td,#items_count_details th,#page_subtitle,#receipt_header,#receipt_wrapper #barcode,#required_fields_message,#sale_return_policy,#terms,#terms textarea,.navbar .menu-icon{text-align:center}#items td.total-value{border-left:0;padding:10px}#items td.total-value textarea{height:20px;background:0 0}#items td.total-line textarea{height:20px;width:150px;background:0 0}#items td.balance{background:#eee}#items td.blank{border:0}#items td.blank-bottom{border:1px}#terms{margin:20px 0 0}#terms h5{text-transform:uppercase;font-size:13px;letter-spacing:10px;border-bottom:1px solid #000;padding:0 0 8px;margin:0 0 8px}#terms textarea{width:100%}.delete{display:block;color:#000;text-decoration:none;position:absolute;background:#EEE;padding:0 3px;border:1px solid;top:-6px;left:-22px;font-family:Verdana;font-size:12px}body,html{height:100%}a.none{text-decoration:none}.topbar{color:#eee;font-size:12px;background:#182735;padding:.2em}.navbar{border-radius:0}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#2C3E50;background-color:#FFF}.navbar .menu-icon{font-size:12px}.navbar .menu-icon img{width:24px}.wrapper{font-size:14px}.pagination{margin:0!important}#title_bar{position:relative;width:100%;height:3em}#page_title{font-size:22px;font-family:Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400}#company_name,#employee_permission_info p,#info_provided_by,#page_subtitle,.discount,.error_message_box,.totals table tr:last-child td{font-weight:700}#page_subtitle{margin-bottom:.5em;font-size:16px}#feedback_bar{position:fixed;bottom:0;left:0;width:100%;z-index:1;line-height:3.3}#home_module_list{position:relative;padding:2em 0}.module_item{min-width:7em;display:inline-block;text-align:center}.module_item a{display:block}#config_info{text-align:left}#config_info .wide{width:30%}#footer{margin-top:5em;position:relative;font-size:11px;color:#777;clear:both}a.rollover img{padding:3px}button.btn.dropdown-toggle.btn-sm{background-color:#fff;color:#000;border:2px solid #dce4ec}#add_item_form,#overall_sale{background-color:#BBB}#mode_form,#payment_details{background-color:#DDD}#payment_details,#payment_totals,#sale_totals{border-top:2px solid #000}.dropdown-menu{font-size:13px}label.required{color:red}@media (min-width:768px){.navbar-nav>li>a{padding:10px 10px 9px}.modal-dlg .modal-dialog{width:500px}.modal-dlg-wide .modal-dialog{width:750px}}.modal-body{max-height:calc(100vh - 212px);overflow-y:auto}@media print{table.innertable a,table.report a{color:#000;text-decoration:none}.no-print,.no-print *{display:none!important}#receipt_wrapper{font-size:75%}#footer,#menubar,.topbar{display:none}#sale_return_policy{width:100%;text-align:center}.short_name{display:inline}#receipt_items td{white-space:nowrap}table.innertable{display:table}table.report a.expand{visibility:hidden}.print_show{display:block!important}.print_hide{display:none!important}}#required_fields_message{width:100%;margin-bottom:3px;font-style:italic}.error_message_box{margin-bottom:7px;margin-left:20px;color:red}#company_phone,#receipt_items{margin-bottom:15px}#receipt_items td,#receipt_items tr,#sale_time{margin-bottom:5px}#customer_basic_info,#employee_basic_info,#employee_login_info,#employee_permission_info,#item_basic_info,#item_number_info,#permission_list li,#sale_basic_info,#supplier_basic_info{padding:5px}#info_provided_by{display:none}#permission_list{list-style:none}#permission_list ul li{padding-left:20px;padding-bottom:0;list-style:none}#permission_list input{top:3px}#employee_permission_info span.small{font-style:italic;font-size:80%}#items_count_details{font-size:80%}#item_kit_items,#items_count_details,#receipt_wrapper{width:100%}#item_kit_items thead tr,#items_count_details thead tr{background-color:#CCC}#item_kit_items th,#items_count_details th{font-weight:700}#company_name{font-size:150%}#company_name img{max-width:150px;max-height:150px}#receipt_items{position:relative;margin-top:15px;width:100%}#receipt_items td{position:relative;padding:3px}.short_name{display:none}#sale_return_policy{width:80%;margin:0 auto}#receipt_wrapper #barcode{margin-top:10px}.total-value{text-align:right}#chart_wrapper,#overall_sale,#register td,#register th,#report_summary{text-align:center}#register_wrapper{float:left;width:70%;font-size:13px}#add_item_form,#mode_form{margin:0}#add_item_form .panel-body,#mode_form .panel-body{padding:.7em;margin:0}#add_item_form ul,#mode_form ul{list-style:none;padding:0;margin:0}#add_item_form ul li,#mode_form ul li{margin-left:1em}.first_li{margin-left:.2em!important}#add_item_form ul.dropdown-menu.inner,#mode_form ul.dropdown-menu.inner{margin-left:-1em!important}#register{padding:0}#register th{background-color:#999;padding:5px;color:#FFF}#register td{background-color:#EEE;padding:3px}#overall_sale{width:28%;float:left;margin-left:.1em;padding-bottom:1em;padding-top:1em;font-size:13px}#overall_sale .panel-body{padding-top:0;padding-bottom:0}#overall_sale .form-group{margin:0}#overall_sale .btn{margin-top:.5em;margin-bottom:.5em}#buttons_sale,#payment_details,#suspended_sales_table,.sales_table_100{width:100%}#payment_details{float:left;margin-top:.2em;padding:.5em;text-align:left;clear:both}#report_list li ul li{margin-left:35px}#report_date_range_complex,#report_date_range_simple{margin-bottom:10px}.report{font-size:.85em}#report_summary{margin:2em 0 auto}#table_action_header{position:relative;width:100%;height:2em;border:0;margin-top:1em;margin-left:0;background-color:transparent;background-image:url(../images/checkbox_arrow.gif);background-position:.5em 1.2em;background-repeat:no-repeat}#table_action_header ul{list-style:none;padding:0;margin:0 0 0 1em}#table_action_header ul.dropdown-menu.inner{margin-left:-1em!important}#table_action_header ul li{margin-left:1em}#table_action_header ul li label{margin-top:.5em}#table_holder{position:relative;margin-bottom:50px}table.tablesorter{position:relative;width:100%;border:0}table.tablesorter tfoot tr th,table.tablesorter thead tr th{color:#FFF;text-align:left;background-color:#999;padding:8px}table.tablesorter thead tr .header{background-image:url(../images/tables/bg.gif);background-repeat:no-repeat;background-position:center right;cursor:pointer}table.tablesorter tbody td{color:#3D3D3D;background-color:#FFF;vertical-align:top;padding:8px;border-bottom:1px solid #DDD}table.tablesorter tbody td.over{background-color:#F5F5F5}table.tablesorter tbody td.selected{background-color:#ECECEC}table.tablesorter thead tr .tablesorter-headerAsc{background-image:url(../images/tables/asc.gif);background-repeat:no-repeat;background-position:right}table.tablesorter thead .tablesorter-headerDesc{background-image:url(../images/tables/desc.gif);background-repeat:no-repeat;background-position:right}table.tablesorter thead tr .headerSortDown,table.tablesorter thead tr .headerSortUp{background-color:#555}table.innertable{display:none;width:100%}table.innertable thead tr th{background-color:#999}table.innertable tbody tr td{background-color:#DDD} \ No newline at end of file + */.datetimepicker{padding:4px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;direction:ltr}.datetimepicker-inline{width:220px}.datetimepicker.datetimepicker-rtl{direction:rtl}.datetimepicker.datetimepicker-rtl table tr td span{float:right}.datetimepicker-dropdown,.datetimepicker-dropdown-left{top:0;left:0}[class*=" datetimepicker-dropdown"]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0,0,0,.2);position:absolute}[class*=" datetimepicker-dropdown"]:after{border-bottom:6px solid #fff;position:absolute}[class*=" datetimepicker-dropdown-top"]:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-top:7px solid #ccc;border-top-color:rgba(0,0,0,.2);border-bottom:0}[class*=" datetimepicker-dropdown-top"]:after{border-top:6px solid #fff;border-bottom:0}.datetimepicker-dropdown-bottom-left:before{top:-7px;right:6px}.datetimepicker-dropdown-bottom-left:after{top:-6px;right:7px}.datetimepicker-dropdown-bottom-right:before{top:-7px;left:6px}.datetimepicker-dropdown-bottom-right:after{top:-6px;left:7px}.datetimepicker-dropdown-top-left:before{bottom:-7px;right:6px}.datetimepicker-dropdown-top-left:after{bottom:-6px;right:7px}.datetimepicker-dropdown-top-right:before{bottom:-7px;left:6px}.datetimepicker-dropdown-top-right:after{bottom:-6px;left:7px}.datetimepicker>div{display:none}.datetimepicker.days div.datetimepicker-days,.datetimepicker.hours div.datetimepicker-hours,.datetimepicker.minutes div.datetimepicker-minutes,.datetimepicker.months div.datetimepicker-months,.datetimepicker.years div.datetimepicker-years{display:block}.datetimepicker table{margin:0}.datetimepicker td,.datetimepicker th{text-align:center;width:20px;height:20px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;border:0}.table-striped .datetimepicker table tr td,.table-striped .datetimepicker table tr th{background-color:transparent}.datetimepicker table tr td.day:hover,.datetimepicker table tr td.hour:hover,.datetimepicker table tr td.minute:hover{background:#eee;cursor:pointer}.datetimepicker table tr td.new,.datetimepicker table tr td.old{color:#999}.datetimepicker table tr td.disabled,.datetimepicker table tr td.disabled:hover{background:0;color:#999;cursor:default}.datetimepicker table tr td.today,.datetimepicker table tr td.today.disabled,.datetimepicker table tr td.today.disabled:hover,.datetimepicker table tr td.today:hover{background-color:#fde19a;background-image:-moz-linear-gradient(top,#fdd49a,#fdf59a);background-image:-ms-linear-gradient(top,#fdd49a,#fdf59a);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdd49a),to(#fdf59a));background-image:-webkit-linear-gradient(top,#fdd49a,#fdf59a);background-image:-o-linear-gradient(top,#fdd49a,#fdf59a);background-image:linear-gradient(top,#fdd49a,#fdf59a);background-repeat:repeat-x;border-color:#fdf59a #fdf59a #fbed50;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.datetimepicker table tr td.today.active,.datetimepicker table tr td.today.disabled,.datetimepicker table tr td.today.disabled.active,.datetimepicker table tr td.today.disabled.disabled,.datetimepicker table tr td.today.disabled:active,.datetimepicker table tr td.today.disabled:hover,.datetimepicker table tr td.today.disabled:hover.active,.datetimepicker table tr td.today.disabled:hover.disabled,.datetimepicker table tr td.today.disabled:hover:active,.datetimepicker table tr td.today.disabled:hover:hover,.datetimepicker table tr td.today.disabled:hover[disabled],.datetimepicker table tr td.today.disabled[disabled],.datetimepicker table tr td.today:active,.datetimepicker table tr td.today:hover,.datetimepicker table tr td.today:hover.active,.datetimepicker table tr td.today:hover.disabled,.datetimepicker table tr td.today:hover:active,.datetimepicker table tr td.today:hover:hover,.datetimepicker table tr td.today:hover[disabled],.datetimepicker table tr td.today[disabled]{background-color:#fdf59a}.datetimepicker table tr td.today.active,.datetimepicker table tr td.today.disabled.active,.datetimepicker table tr td.today.disabled:active,.datetimepicker table tr td.today.disabled:hover.active,.datetimepicker table tr td.today.disabled:hover:active,.datetimepicker table tr td.today:active,.datetimepicker table tr td.today:hover.active,.datetimepicker table tr td.today:hover:active{background-color:#fbf069}.datetimepicker table tr td.active,.datetimepicker table tr td.active.disabled,.datetimepicker table tr td.active.disabled:hover,.datetimepicker table tr td.active:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-ms-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(top,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datetimepicker table tr td.active.active,.datetimepicker table tr td.active.disabled,.datetimepicker table tr td.active.disabled.active,.datetimepicker table tr td.active.disabled.disabled,.datetimepicker table tr td.active.disabled:active,.datetimepicker table tr td.active.disabled:hover,.datetimepicker table tr td.active.disabled:hover.active,.datetimepicker table tr td.active.disabled:hover.disabled,.datetimepicker table tr td.active.disabled:hover:active,.datetimepicker table tr td.active.disabled:hover:hover,.datetimepicker table tr td.active.disabled:hover[disabled],.datetimepicker table tr td.active.disabled[disabled],.datetimepicker table tr td.active:active,.datetimepicker table tr td.active:hover,.datetimepicker table tr td.active:hover.active,.datetimepicker table tr td.active:hover.disabled,.datetimepicker table tr td.active:hover:active,.datetimepicker table tr td.active:hover:hover,.datetimepicker table tr td.active:hover[disabled],.datetimepicker table tr td.active[disabled]{background-color:#04c}.datetimepicker table tr td.active.active,.datetimepicker table tr td.active.disabled.active,.datetimepicker table tr td.active.disabled:active,.datetimepicker table tr td.active.disabled:hover.active,.datetimepicker table tr td.active.disabled:hover:active,.datetimepicker table tr td.active:active,.datetimepicker table tr td.active:hover.active,.datetimepicker table tr td.active:hover:active{background-color:#039}.datetimepicker table tr td span{display:block;width:23%;height:54px;line-height:54px;float:left;margin:1%;cursor:pointer;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.datetimepicker .datetimepicker-hours span{height:26px;line-height:26px}.datetimepicker .datetimepicker-hours table tr td span.hour_am,.datetimepicker .datetimepicker-hours table tr td span.hour_pm{width:14.6%}.datetimepicker .datetimepicker-hours fieldset legend,.datetimepicker .datetimepicker-minutes fieldset legend{margin-bottom:inherit;line-height:30px}.datetimepicker .datetimepicker-minutes span{height:26px;line-height:26px}.datetimepicker table tr td span:hover{background:#eee}.datetimepicker table tr td span.disabled,.datetimepicker table tr td span.disabled:hover{background:0;color:#999;cursor:default}.datetimepicker table tr td span.active,.datetimepicker table tr td span.active.disabled,.datetimepicker table tr td span.active.disabled:hover,.datetimepicker table tr td span.active:hover{background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-ms-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(top,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.25);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.25)}.datetimepicker table tr td span.active.active,.datetimepicker table tr td span.active.disabled,.datetimepicker table tr td span.active.disabled.active,.datetimepicker table tr td span.active.disabled.disabled,.datetimepicker table tr td span.active.disabled:active,.datetimepicker table tr td span.active.disabled:hover,.datetimepicker table tr td span.active.disabled:hover.active,.datetimepicker table tr td span.active.disabled:hover.disabled,.datetimepicker table tr td span.active.disabled:hover:active,.datetimepicker table tr td span.active.disabled:hover:hover,.datetimepicker table tr td span.active.disabled:hover[disabled],.datetimepicker table tr td span.active.disabled[disabled],.datetimepicker table tr td span.active:active,.datetimepicker table tr td span.active:hover,.datetimepicker table tr td span.active:hover.active,.datetimepicker table tr td span.active:hover.disabled,.datetimepicker table tr td span.active:hover:active,.datetimepicker table tr td span.active:hover:hover,.datetimepicker table tr td span.active:hover[disabled],.datetimepicker table tr td span.active[disabled]{background-color:#04c}.datetimepicker table tr td span.active.active,.datetimepicker table tr td span.active.disabled.active,.datetimepicker table tr td span.active.disabled:active,.datetimepicker table tr td span.active.disabled:hover.active,.datetimepicker table tr td span.active.disabled:hover:active,.datetimepicker table tr td span.active:active,.datetimepicker table tr td span.active:hover.active,.datetimepicker table tr td span.active:hover:active{background-color:#039}.datetimepicker table tr td span.old{color:#999}.datetimepicker th.switch{width:145px}.datetimepicker th span.glyphicon{pointer-events:none}.datetimepicker tfoot tr:first-child th,.datetimepicker thead tr:first-child th{cursor:pointer}.datetimepicker tfoot tr:first-child th:hover,.datetimepicker thead tr:first-child th:hover{background:#eee}.input-append.date .add-on i,.input-group.date .input-group-addon span,.input-prepend.date .add-on i{cursor:pointer;width:14px;height:14px}.tablesorter-blue{width:100%;background-color:#fff;margin:10px 0 15px;text-align:left;border-spacing:0;border:1px solid #cdcdcd;border-width:1px 0 0 1px}.tablesorter-blue td,.tablesorter-blue th{border:1px solid #cdcdcd;border-width:0 1px 1px 0}.tablesorter-blue th,.tablesorter-blue thead td{font:12px/18px Arial,Sans-serif;font-weight:700;color:#000;background-color:#99bfe6;border-collapse:collapse;padding:4px;text-shadow:0 1px 0 rgba(204,204,204,.7)}.tablesorter-blue tbody td,.tablesorter-blue tfoot td,.tablesorter-blue tfoot th{padding:4px;vertical-align:top}.tablesorter-blue .header,.tablesorter-blue .tablesorter-header{background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-repeat:no-repeat;background-position:center right;padding:4px 18px 4px 4px;white-space:normal;cursor:pointer}.tablesorter-blue .headerSortUp,.tablesorter-blue .tablesorter-headerAsc,.tablesorter-blue .tablesorter-headerSortUp{background-color:#9fbfdf;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7)}.tablesorter-blue .headerSortDown,.tablesorter-blue .tablesorter-headerDesc,.tablesorter-blue .tablesorter-headerSortDown{background-color:#8cb3d9;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7)}.tablesorter-blue thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-blue tfoot .tablesorter-headerAsc,.tablesorter-blue tfoot .tablesorter-headerDesc,.tablesorter-blue tfoot .tablesorter-headerSortDown,.tablesorter-blue tfoot .tablesorter-headerSortUp{background-image:none}.tablesorter-blue td{color:#3d3d3d;background-color:#fff;padding:4px;vertical-align:top}.tablesorter-blue tbody>tr.even.hover>td,.tablesorter-blue tbody>tr.even:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.even:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.even:hover>td,.tablesorter-blue tbody>tr.hover>td,.tablesorter-blue tbody>tr:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr:hover>td{background-color:#d9d9d9}.tablesorter-blue tbody>tr.odd.hover>td,.tablesorter-blue tbody>tr.odd:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.odd:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.odd:hover>td{background-color:#bfbfbf}.tablesorter-blue .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-blue tbody tr.odd>td{background-color:#ebf2fa}.tablesorter-blue tbody tr.even>td{background-color:#fff}.tablesorter-blue td.primary,.tablesorter-blue tr.odd td.primary{background-color:#99b3e6}.tablesorter-blue td.secondary,.tablesorter-blue tr.even td.primary,.tablesorter-blue tr.odd td.secondary{background-color:#c2d1f0}.tablesorter-blue td.tertiary,.tablesorter-blue tr.even td.secondary,.tablesorter-blue tr.odd td.tertiary{background-color:#d6e0f5}.tablesorter-blue tr.even td.tertiary{background-color:#ebf0fa}caption{background-color:#fff}.tablesorter-blue .tablesorter-filter-row{background-color:#eee}.tablesorter-blue .tablesorter-filter-row td{background-color:#eee;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-blue .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-blue .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-blue .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-blue input.tablesorter-filter,.tablesorter-blue select.tablesorter-filter{width:98%;height:auto;margin:0;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99}#logo,#meta td{text-align:right}@font-face{font-family:SansationLight;src:url(../fonts/SansationLight.eot);src:local('SansationLight'),url(../fonts/SansationLight.woff) format('woff'),url(../fonts/SansationLight.ttf) format('truetype')}.font_SansationLight{font-family:SansationLight!important}@font-face{font-family:Arial;src:url(../fonts/Arial.eot);src:local('Arial'),url(../fonts/Arial.woff) format('woff'),url(../fonts/Arial.ttf) format('truetype')}.font_Arial{font-family:Arial!important}@font-face{font-family:JUNEBUG;src:url(../fonts/JUNEBUG.eot);src:local('JUNEBUG'),url(../fonts/JUNEBUG.woff) format('woff'),url(../fonts/JUNEBUG.ttf) format('truetype')}.font_JUNEBUG{font-family:JUNEBUG!important}@font-face{font-family:b-de-bonita-shadow;src:url(../fonts/b-de-bonita-shadow.eot);src:local('JUNEBUG'),url(../fonts/b-de-bonita-shadow.woff) format('woff'),url(../fonts/b-de-bonita-shadow.ttf) format('truetype')}.font_b-de-bonita-shadow{font-family:b-de-bonita-shadow!important}.ui-autocomplete{position:absolute;top:100%;left:0;z-index:1000;float:left;display:none;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:13px;background-color:#fff;border-color:#ccc;border-color:rgba(0,0,0,.15);border-style:solid;border-width:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.175);-moz-box-shadow:0 5px 10px rgba(0,0,0,.175);box-shadow:0 5px 10px rgba(0,0,0,.175);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}#logo,.delete-wpr{position:relative}.ui-autocomplete .ui-menu-item>a.ui-corner-all{display:block;padding:3px 15px;clear:both;font-weight:400;line-height:18px;color:#7b8a8b;white-space:nowrap}#header,.delete{font-weight:700}.ui-autocomplete .ui-menu-item>a.ui-corner-all.ui-state-active,.ui-autocomplete .ui-menu-item>a.ui-corner-all.ui-state-hover{color:#fff;text-decoration:none;background-color:#f5f5f5;border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;background-image:none}*{margin:0;padding:0}#page-wrap{width:100%;margin:0 auto;max-width:800px}#page-wrap textarea{border:0;font-size:14px;resize:none}#page-wrap table td,#page-wrap table th{border:1px solid #000;padding:5px}#page-wrap table td{padding:5px}#header{margin:20px 0;background:#222;text-align:center;color:#fff;font-size:2em;letter-spacing:4px;padding:10px 0}#logo{margin-top:15px;float:left;border:1px solid #fff}#logo img{max-width:150px}#logoctr{display:none}#logo.edit #logoctr,#logo:hover #logoctr{display:block;text-align:right;line-height:25px;background:#eee;padding:0 5px}#logohelp{text-align:left;display:none;font-style:italic;padding:10px 5px}#logohelp input{margin-bottom:5px}.edit #logohelp{display:block}.edit #cancel-logo,.edit #save-logo{display:inline}#cancel-logo,#save-logo,.edit #change-logo,.edit #delete-logo,.edit #image{display:none}#customer-title{height:100px;float:right;margin-top:40px}#customer-title textarea{width:150px}#company-title{float:left}#meta{margin-top:1px;width:300px;float:right}#meta td.meta-head{text-align:left;background:#eee}#meta td textarea{width:100%;height:20px;text-align:right}#items{clear:both;width:100%;margin:30px 0 0;border:1px solid #000}#items th{background:#eee;text-align:center}#items textarea{width:80px;height:20px}#items tr.item-row td{border:0;vertical-align:top}#items td.description{width:300px}#items td.item-name{width:175px}#items td.description textarea,#items td.item-name textarea{width:100%}#items td.total-line{border-right:0;text-align:right}#config_wrapper,#feedback_bar,#footer,#home_module_list,#item_kit_items td,#item_kit_items th,#item_kit_items_title,#page_subtitle,#receipt_header,#receipt_wrapper #barcode,#required_fields_message,#sale_return_policy,#terms,#terms textarea,.navbar .menu-icon{text-align:center}#items td.total-value{border-left:0;padding:10px}#items td.total-value textarea{height:20px;background:0 0}#items td.total-line textarea{height:20px;width:150px;background:0 0}#items td.balance{background:#eee}#items td.blank{border:0}#items td.blank-bottom{border:1px}#terms{margin:20px 0 0}#terms h5{text-transform:uppercase;font-size:13px;letter-spacing:10px;border-bottom:1px solid #000;padding:0 0 8px;margin:0 0 8px}#terms textarea{width:100%}.delete{display:block;color:#000;text-decoration:none;position:absolute;background:#EEE;padding:0 3px;border:1px solid;top:-6px;left:-22px;font-family:Verdana;font-size:12px}body,html{height:100%}a.none{text-decoration:none}.topbar{color:#eee;font-size:12px;background:#182735;padding:.2em}.navbar{border-radius:0}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#2C3E50;background-color:#FFF}.alert{margin-bottom:0}.jumbotron.push-spaces{margin:0}.navbar .menu-icon{font-size:12px}.navbar .menu-icon img{width:24px}.wrapper{font-size:14px}.pagination{margin:0!important}#title_bar{position:relative;width:100%;height:3em}#page_title{font-size:22px;font-family:Lato,"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:400}#company_name,#employee_permission_info p,#info_provided_by,#item_kit_items th,#page_subtitle,.discount,.totals table tr:last-child td{font-weight:700}#page_subtitle{margin-bottom:.5em;font-size:16px}#feedback_bar{position:fixed;bottom:0;left:0;width:100%;z-index:1;line-height:3.3}#home_module_list{position:relative;padding:2em 0}.module_item{min-width:7em;display:inline-block;text-align:center}.module_item a{display:block}#config_info{text-align:left}#config_info .wide{width:30%}#footer{margin-top:5em;position:relative;font-size:11px;color:#777;clear:both}a.rollover img{padding:3px}button.btn.dropdown-toggle.btn-sm{background-color:#fff;color:#000;border:2px solid #dce4ec}#add_item_form,#overall_sale{background-color:#BBB}#mode_form,#payment_details{background-color:#DDD}#payment_details,#payment_totals,#sale_totals{border-top:2px solid #000}.dropdown-menu{font-size:13px}label.required{color:red}@media (min-width:768px){.navbar-nav>li>a{padding:10px 10px 9px}.modal-dlg .modal-dialog{width:500px}.modal-dlg-wide .modal-dialog{width:750px}}.modal-body{max-height:calc(100vh - 212px);overflow-y:auto}@media print{table.innertable a,table.report a{color:#000;text-decoration:none}.no-print,.no-print *{display:none!important}#receipt_wrapper{font-size:75%}#footer,#menubar,.topbar{display:none}#sale_return_policy{width:100%;text-align:center}.short_name{display:inline}#receipt_items td{white-space:nowrap}table.innertable{display:table}table.report a.expand{visibility:hidden}.print_show{display:block!important}.print_hide{display:none!important}}#required_fields_message{width:100%;margin-bottom:3px;font-style:italic}.error_message_box{margin-bottom:7px;margin-left:20px;color:red;font-weight:700}#company_phone,#receipt_items{margin-bottom:15px}#receipt_items td,#receipt_items tr,#sale_time{margin-bottom:5px}#customer_basic_info,#employee_basic_info,#employee_login_info,#employee_permission_info,#item_basic_info,#item_number_info,#permission_list li,#sale_basic_info,#supplier_basic_info{padding:5px}#info_provided_by{display:none}#permission_list{list-style:none}#permission_list ul li{padding-left:20px;padding-bottom:0;list-style:none}#permission_list input{top:3px}#employee_permission_info span.small{font-style:italic;font-size:80%}#item_kit_items,#receipt_wrapper{width:100%}#company_name{font-size:150%}#company_name img{max-width:150px;max-height:150px}#receipt_items{position:relative;margin-top:15px;width:100%}#receipt_items td{position:relative;padding:3px}.short_name{display:none}#sale_return_policy{width:80%;margin:0 auto}#receipt_wrapper #barcode{margin-top:10px}.total-value{text-align:right}#chart_wrapper,#overall_sale,#register td,#register th,#report_summary{text-align:center}#register_wrapper{float:left;width:70%;font-size:13px}#add_item_form,#mode_form{margin:0}#add_item_form .panel-body,#mode_form .panel-body{padding:.7em;margin:0}#add_item_form ul,#mode_form ul{list-style:none;padding:0;margin:0}#add_item_form ul li,#mode_form ul li{margin-left:1em}.first_li{margin-left:.2em!important}#add_item_form ul.dropdown-menu.inner,#mode_form ul.dropdown-menu.inner{margin-left:-1em!important}#register{padding:0}#register th{background-color:#999;padding:5px;color:#FFF}#register td{background-color:#EEE;padding:3px}#overall_sale{width:28%;float:left;margin-left:.1em;padding-bottom:1em;padding-top:1em;font-size:13px}#overall_sale .panel-body{padding-top:0;padding-bottom:0}#overall_sale .form-group{margin:0}#overall_sale .btn{margin-top:.5em;margin-bottom:.5em}#buttons_sale,#payment_details,#suspended_sales_table,.sales_table_100{width:100%}#payment_details{float:left;margin-top:.2em;padding:.5em;text-align:left;clear:both}#table_action_header,.arrow-left{background-color:transparent;background-image:url(../images/checkbox_arrow.gif);background-repeat:no-repeat}#report_list li ul li{margin-left:35px}#report_date_range_complex,#report_date_range_simple{margin-bottom:10px}.report{font-size:.85em}#report_summary{margin:2em 0 auto}#table_action_header{position:relative;width:100%;height:2em;border:0;margin-top:1em;margin-left:0;background-position:.5em 1.2em}#table_action_header ul{list-style:none;padding:0;margin:0 0 0 1em}#table_action_header ul.dropdown-menu.inner{margin-left:-1em!important}#table_action_header ul li{margin-left:1em}#table_action_header ul li label{margin-top:.5em}#table_holder{position:relative;margin-bottom:50px}table.tablesorter{position:relative;width:100%;border:0}table.tablesorter tfoot tr th,table.tablesorter thead tr th{color:#FFF;text-align:left;background-color:#999;padding:8px}table.tablesorter thead tr .header{background-image:url(../images/tables/bg.gif);background-repeat:no-repeat;background-position:center right;cursor:pointer}table.tablesorter tbody td{color:#3D3D3D;background-color:#FFF;vertical-align:top;padding:8px;border-bottom:1px solid #DDD}table.tablesorter tbody td.over{background-color:#F5F5F5}table.tablesorter tbody td.selected{background-color:#ECECEC}table.tablesorter thead tr .tablesorter-headerAsc{background-image:url(../images/tables/asc.gif);background-repeat:no-repeat;background-position:right}table.tablesorter thead .tablesorter-headerDesc{background-image:url(../images/tables/desc.gif);background-repeat:no-repeat;background-position:right}table.tablesorter thead tr .headerSortDown,table.tablesorter thead tr .headerSortUp{background-color:#555}table.innertable{display:none;width:100%}table.innertable thead tr th{background-color:#999}table.innertable tbody tr td{background-color:#DDD} \ No newline at end of file diff --git a/js/manage_tables.js b/js/manage_tables.js index 539083c4a..e84bb9647 100644 --- a/js/manage_tables.js +++ b/js/manage_tables.js @@ -1,58 +1,4 @@ - -function do_delete(url) -{ - //If delete is not enabled, don't do anything - if(!enable_delete.enabled) - return; - - var row_ids = get_selected_values(); - var selected_rows = get_selected_rows(); - $.post(url, { 'ids[]': row_ids },function(response) - { - //delete was successful, remove checkbox rows - if(response.success) - { - $(selected_rows).each(function(index, dom) - { - $(this).find("td").animate({backgroundColor:"green"},1200,"linear") - .end().animate({opacity:0},1200,"linear",function() - { - $(this).remove(); - //Re-init sortable table as we removed a row - $("#sortable_table tbody tr").length > 0 && update_sortable_table(); - - }); - }); - - set_feedback(response.message, 'alert alert-dismissible alert-success', false); - } - else - { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); - } - },"json"); -} - -function enable_bulk_edit(none_selected_message) -{ - //Keep track of enable_bulk_edit has been called - if(!enable_bulk_edit.enabled) - enable_bulk_edit.enabled=true; - - $('#bulk_edit').click(function(event) - { - if($("#sortable_table tbody :checkbox:checked").length == 0) - { - alert(none_selected_message); - return false; - } - event.preventDefault(); - }); -} -enable_bulk_edit.enabled=false; - - -dialog_support = (function() { +(function(dialog_support, $) { var btn_id, dialog_ref; @@ -78,90 +24,89 @@ dialog_support = (function() { }; var init = function(selector) { + + var buttons = function(event) { + var buttons = []; + var dialog_class = 'modal-dlg'; + $.each($(this).attr('class').split(/\s+/), function(classIndex, className) { + var width_class = className.split("modal-dlg-"); + if (width_class && width_class.length > 1) { + dialog_class = className; + } + var btn_class = className.split("modal-btn-"); + if (btn_class && btn_class.length > 1) { + var btn_name = btn_class[1]; + var is_submit = btn_name == 'submit'; + buttons.push({ + id: btn_name, + label: btn_name.charAt(0).toUpperCase() + btn_name.slice(1), + cssClass: is_submit ? 'btn-primary' : (btn_name == 'delete' ? 'btn-danger' : ''), + hotkey: is_submit ? 13 : undefined, // Enter. + action: submit(btn_name) + }); + } + }); + + !buttons.length && buttons.push({ + id: 'close', + label: 'Close', + cssClass: 'btn-primary', + action: function(dialog_ref) { + dialog_ref.close(); + } + }); + return { buttons: buttons, cssClass: dialog_class}; + }; + $(selector).each(function(index, $element) { + return $(selector).off('click').on('click', function(event) { - var buttons = []; - var dialog_class = 'modal-dlg'; - $.each($(this).attr('class').split(/\s+/), function(classIndex, className) { - var width_class = className.split("modal-dlg-"); - if (width_class && width_class.length > 1) { - dialog_class = className; - } - var btn_class = className.split("modal-btn-"); - if (btn_class && btn_class.length > 1) { - var btn_name = btn_class[1]; - var is_submit = btn_name == 'submit'; - buttons.push({ - id: btn_name, - label: btn_name.charAt(0).toUpperCase() + btn_name.slice(1), - cssClass: is_submit ? 'btn-primary' : (btn_name == 'delete' ? 'btn-danger' : ''), - hotkey: is_submit ? 13 : undefined, // Enter. - action: submit(btn_name) - }); - } - }); - - !buttons.length && buttons.push({ - id: 'close', - label: 'Close', - cssClass: 'btn-primary', - action: function(dialog_ref) { - dialog_ref.close(); - } - }); - var $link = $(event.target); - $link = $link.is("a") ? $link : $link.parents("a"); - BootstrapDialog.show({ - cssClass: dialog_class, + $link = !$link.is("a, button") ? $link.parents("a") : $link ; + BootstrapDialog.show($.extend({ title: $link.attr('title'), - buttons: buttons, message: (function() { var node = $('
'); - $.get($link.attr('href'), function(data) { + $.get($link.attr('href') || $link.data('href'), function(data) { node.html(data); }); return node; }) - }); + }, buttons.call(this, event))); event.preventDefault(); }); }); }; - $(document).ajaxComplete(function() { - init("a.modal-dlg"); - }); - - return { - hide: hide, - clicked_id: clicked_id, - init: init, - submit: submit, - error: { - errorClass: "has-error", - errorLabelContainer: "#error_message_box", - wrapper: "li", - highlight: function (e) { - $(e).closest('.form-group').addClass('has-error'); - }, - unhighlight: function (e) { - $(e).closest('.form-group').removeClass('has-error'); - } + dialog_support.error = { + errorClass: "has-error", + errorLabelContainer: "#error_message_box", + wrapper: "li", + highlight: function (e) { + $(e).closest('.form-group').addClass('has-error'); + }, + unhighlight: function (e) { + $(e).closest('.form-group').removeClass('has-error'); } }; -})(); + $.extend(dialog_support, { + init: init, + submit: submit, + hide: hide, + clicked_id: clicked_id + }); -table_support = (function() { +})(window.dialog_support = window.dialog_support || {}, jQuery); - var init_autocomplete = function() { +(function(table_support, $) { + var init_autocomplete = function () { var widget = $("#search").autocomplete({ source: function (request, response) { var extra_params = {limit: 100}; - $.each(options.extra_params, function(key, param) { + $.each(options.extra_params, function (key, param) { extra_params[key] = typeof param == "function" ? param() : param; }); @@ -170,15 +115,16 @@ table_support = (function() { url: options.suggest_url, dataType: "json", data: $.extend(request, extra_params), - success: function(data) { - response($.map(data, function(item) { + success: function (data) { + response($.map(data, function (item) { return { value: item.label, }; - }))} + })) + } }); }, - delay:10, + delay: 10, autoFocus: false, select: function (a, ui) { $(this).val(ui.item.value); @@ -187,59 +133,145 @@ table_support = (function() { }); }; - var highlight_rows = function(id, color) { + var table = function() { + return $("#table").data('bootstrap.table'); + } + + var selected_ids = function () { + return $.map(table().getSelections(), function (element) { + return element.id; + }); + }; + + var selected_rows = function () { + return $("#table input:checkbox:checked").parents("tr"); + }; + + var do_delete = function (url) { + $.post(url, {'ids[]': selected_ids()}, function (response) { + //delete was successful, remove checkbox rows + if (response.success) { + table().remove({ + field: 'id', + values: selected_ids() + }); + + // animated delete below + /*$(selected_rows()).each(function (index, dom) { + /*$(this).find("td").animate({backgroundColor: "green"}, 1200, "linear") + .end().animate({opacity: 0}, 1200, "linear", function () { + $(this).remove(); + }); + });*/ + set_feedback(response.message, 'alert alert-dismissible alert-success', false); + } else { + set_feedback(response.message, 'alert alert-dismissible alert-danger', true); + } + enable_actions(); + }, "json"); + }; + + var do_email = function() { + var recipients = $.map($("tr.selected a[href^='mailto:']"), function(element) { + return $(element).attr('href').replace(/^mailto:/, ''); + }); + location.href = "mailto:" + recipients.join(","); + }; + + var highlight_rows = function (id, color) { var original = $("tr.selected").css('backgroundColor'); var selector = ((id && "tr[data-uniqueid='" + id + "']")) || "tr.selected"; - $(selector).removeClass("selected").animate({backgroundColor:color||'#e1ffdd'},"slow","linear") - .animate({backgroundColor:color||'#e1ffdd'},5000) - .animate({backgroundColor:original},"slow","linear"); + $(selector).removeClass("selected").animate({backgroundColor: color || '#e1ffdd'}, "slow", "linear") + .animate({backgroundColor: color || '#e1ffdd'}, 5000) + .animate({backgroundColor: original}, "slow", "linear"); $("tr input:checkbox:checked").prop("checked", false); }; - return { + var init_email = function() { + $("#email").click(function(evvent) { + do_email(); + }); + }; - init: function(resource, headers) { - $('#table').bootstrapTable({ - columns: headers, - url: resource + '/search', - sidePagination: 'server', - striped: true, - pagination: true, - search: true, - showColumns: true, - clickToSelect: true, - toolbar: '#toolbar', - uniqueId: 'id' - }); - }, + var enable_actions = function() { + var delete_disabled = selected_rows().length == 0; + $("#delete").attr('disabled', delete_disabled); + var email_disabled = $("tr.selected a[href^='mailto:']").length == 0; + $("#email").attr('disabled', email_disabled); + }; - handle_submit : function (resource, response) { - var $table = $("#table").data('bootstrap.table'); - var id = response.id; + var load_callback; - if(!response.success) { - set_feedback(response.message, 'alert alert-dismissible alert-danger', true); + var load_success = function() { + typeof load_callback == 'function' && load_callback(); + load_callback = undefined; + dialog_support.init("a.modal-dlg, button.modal-dlg"); + }; + + var init = function (resource, headers) { + $('#table').bootstrapTable({ + columns: headers, + url: resource + '/search', + sidePagination: 'server', + striped: true, + pagination: true, + search: true, + showColumns: true, + clickToSelect: true, + toolbar: '#toolbar', + uniqueId: 'id', + onCheck: enable_actions, + onUncheck: enable_actions, + onLoadSuccess: load_success + }); + init_email(); + enable_actions(); + }; + + var init_delete = function (confirm_message) { + $("#delete").click(function (event) { + if (confirm(confirm_message)) { + do_delete($(this).attr('href') || $(this).data('href')); } else { - //This is an update, just update one row - var message = response.message; - var selected_ids = $.map($table.getSelections(), function(element) { - return element.id; - }); + return false; + } + }); + }; - if(jQuery.inArray(id, selected_ids) != -1) { - $.get(resource + '/get_row/' + id, function(response) - { - $table.updateByUniqueId({id: id, row: response}); + var handle_submit = function (resource, response) { + var $table = $("#table").data('bootstrap.table'); + var id = response.id; + + if (!response.success) { + set_feedback(response.message, 'alert alert-dismissible alert-danger', true); + } else { + //This is an update, just update one row + var message = response.message; + + if (jQuery.inArray(id, selected_ids()) != -1) { + $.get({ + url: resource + '/get_row/' + id, + success: function (response) { + $table.updateByUniqueId({id: response.id, row: response}); highlight_rows(); set_feedback(message, 'alert alert-dismissible alert-success', false); - }); - } else { - $table.refresh(); - hightlight_rows(response.id); - set_feedback(message, 'alert alert-dismissible alert-success', false); - } + }, + dataType: 'json' + }); + } else { + // call hightlight function once after refresh + load_callback = function() { highlight_rows(id); }; + $table.refresh(); + set_feedback(message, 'alert alert-dismissible alert-success', false); } } - } + }; -})(); + $.extend(table_support, { + handle_submit: handle_submit, + init_delete: init_delete, + init: init, + init_email: init_email + }); + +})(window.table_support = window.table_support || {}, jQuery); \ No newline at end of file diff --git a/templates/spacelab/views/partial/header.php b/templates/spacelab/views/partial/header.php index ae3af2906..1afef34e6 100644 --- a/templates/spacelab/views/partial/header.php +++ b/templates/spacelab/views/partial/header.php @@ -61,7 +61,7 @@ - +