diff --git a/.gitignore b/.gitignore index 59c3fb532..544c9b50c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ node_modules bower_components -dist/*_bower.* +tmp application/config/email.php application/config/database.php *.patch diff --git a/Gruntfile.js b/Gruntfile.js index 05f7cdce8..a77249f8f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -17,11 +17,11 @@ module.exports = function(grunt) { bower_concat: { all: { mainFiles: { - 'bootswatch-dist': ['bootstrap/dist/js/bootstrap.js'] + 'bootswatch-dist': ['bootstrap/dist/js/bootstrap.js'], }, dest: { - 'js': 'dist/opensourcepos_bower.js', - 'css': 'dist/opensourcepos_bower.css' + 'js': 'tmp/opensourcepos_bower.js', + 'css': 'tmp/opensourcepos_bower.css' } } }, @@ -30,20 +30,28 @@ module.exports = function(grunt) { // Bower components folder will be removed afterwards // clean: true }, - bootstrap: { + targetdist: { options: { destPrefix: 'dist' }, files: { - 'jquery-ui.css': 'jquery-ui/themes/base/jquery-ui.css', + 'jquery-ui.css': 'jquery-ui/themes/base/jquery-ui.css', 'bootstrap.min.css': 'bootswatch-dist/css/bootstrap.min.css' } - } + }/*, + targettmp: { + options: { + destPrefix: 'tmp' + }, + files: { + // add here anything that should be copied in a tmp directory + } + }*/ }, cssmin: { target: { files: { - 'dist/<%= pkg.name %>.min.css': ['dist/opensourcepos_bower.css', 'css/*.css', '!css/login.css', '!css/invoice_email.css'] + 'dist/<%= pkg.name %>.min.css': ['tmp/opensourcepos_bower.css', 'css/*.css', '!css/login.css', '!css/invoice_email.css'] } } }, @@ -53,7 +61,7 @@ module.exports = function(grunt) { separator: ';' }, files: { - 'dist/<%= pkg.name %>.js': ['dist/opensourcepos_bower.js', 'js/jquery*', 'js/*.js'] + 'dist/<%= pkg.name %>.js': ['tmp/opensourcepos_bower.js', 'js/*.js'] } }, sql: { @@ -107,7 +115,7 @@ module.exports = function(grunt) { closeTag: '', absolutePath: true }, - src: [ 'dist/*.css', '!dist/opensourcepos_bower.css' ], + src: [ 'dist/*.css' ], dest: 'application/views/partial/header.php', }, mincss_header_templates: { @@ -117,7 +125,7 @@ module.exports = function(grunt) { closeTag: '', absolutePath: true }, - src: [ 'dist/*.css', '!dist/bootstrap.min.css', '!dist/opensourcepos_bower.css' ], + src: [ 'dist/*.css', '!dist/bootstrap.min.css' ], dest: 'templates/spacelab/views/partial/header.php' }, css_login: { @@ -127,7 +135,7 @@ module.exports = function(grunt) { closeTag: '', absolutePath: true }, - src: [ 'dist/jquery-ui.min.css', 'dist/bootstrap.min.css', 'css/login.css' ], + src: [ 'dist/bootstrap.min.css', 'css/login.css' ], dest: 'application/views/login.php' }, js: { @@ -137,7 +145,7 @@ module.exports = function(grunt) { closeTag: '', absolutePath: true }, - src: [ 'js/jquery*', 'js/*.js' ], + src: [ 'js/*.js' ], dest: 'application/views/partial/header.php', dest: 'templates/spacelab/views/partial/header.php' }, diff --git a/application/views/partial/header.php b/application/views/partial/header.php index 4dc728c15..fea01f2d7 100644 --- a/application/views/partial/header.php +++ b/application/views/partial/header.php @@ -64,7 +64,7 @@ - + diff --git a/bower.json b/bower.json index ad035864c..ec3b93413 100644 --- a/bower.json +++ b/bower.json @@ -30,7 +30,7 @@ "jquery": "~1.12.3", "jquery-ui": "1.11.4", "swfobject-bower": "2.3.0", - "tablesorter": "jquery.tablesorter#^2.25.7", + "tablesorter": "jquery.tablesorter#^2.25.8", "bootstrap3-dialog": "bootstrap-dialog#^1.35.1", "jasny-bootstrap": "^3.1.3", "bootswatch-dist": "3.3.6-flatly", diff --git a/dist/opensourcepos.js b/dist/opensourcepos.js index 4cc1b88e3..d96430705 100644 --- a/dist/opensourcepos.js +++ b/dist/opensourcepos.js @@ -44052,7 +44052,7 @@ var swfobject=function(){var D="undefined",r="object",T="Shockwave Flash",Z="Sho aa+="SWFObjectNew";ab.setAttribute("id",aa);ah.parentNode.insertBefore(ab,ah);ah.style.display="none";y(ah)}u(ad,ae,aa)}}function b(ab){if(O.ie&&ab.readyState!=4){ab.style.display="none";var aa=C("div");ab.parentNode.insertBefore(aa,ab);aa.parentNode.replaceChild(J(ab),aa);y(ab)}else{ab.parentNode.replaceChild(J(ab),ab)}}function J(af){var ae=C("div");if(O.win&&O.ie){ae.innerHTML=af.innerHTML}else{var ab=af.getElementsByTagName(r)[0];if(ab){var ag=ab.childNodes;if(ag){var aa=ag.length;for(var ad=0;ad"+ab+"";return ac.firstChild}function u(ai,ag,ab){var aa,ad=c(ab);ab=W(ab);if(O.wk&&O.wk<312){return aa}if(ad){var ac=(O.ie)?C("div"):C(r),af,ah,ae;if(typeof ai.id==D){ai.id=ab}for(ae in ag){if(ag.hasOwnProperty(ae)&&ae.toLowerCase()!=="movie"){e(ac,ae,ag[ae])}}if(O.ie){ac=k(ai.data,ac.innerHTML)}for(af in ai){if(ai.hasOwnProperty(af)){ah=af.toLowerCase();if(ah==="styleclass"){ac.setAttribute("class",ai[af])}else{if(ah!=="classid"&&ah!=="data"){ac.setAttribute(af,ai[af])}}}}if(O.ie){P[P.length]=ai.id}else{ac.setAttribute("type",q);ac.setAttribute("data",ai.data)}ad.parentNode.replaceChild(ac,ad);aa=ac}return aa}function e(ac,aa,ab){var ad=C("param");ad.setAttribute("name",aa);ad.setAttribute("value",ab);ac.appendChild(ad)}function y(ac){var ab=c(ac);if(ab&&ab.nodeName.toUpperCase()=="OBJECT"){if(O.ie){ab.style.display="none";(function aa(){if(ab.readyState==4){for(var ad in ab){if(typeof ab[ad]=="function"){ab[ad]=null}}ab.parentNode.removeChild(ab)}else{setTimeout(aa,10)}}())}else{ab.parentNode.removeChild(ab)}}}function U(aa){return(aa&&aa.nodeType&&aa.nodeType===1)}function W(aa){return(U(aa))?aa.id:aa}function c(ac){if(U(ac)){return ac}var aa=null;try{aa=h.getElementById(ac)}catch(ab){}return aa}function C(aa){return h.createElement(aa)}function n(aa){return parseInt(aa,10)}function g(ac,aa,ab){ac.attachEvent(aa,ab);K[K.length]=[ac,aa,ab]}function F(ac){ac+="";var ab=O.pv,aa=ac.split(".");aa[0]=n(aa[0]);aa[1]=n(aa[1])||0;aa[2]=n(aa[2])||0;return(ab[0]>aa[0]||(ab[0]==aa[0]&&ab[1]>aa[1])||(ab[0]==aa[0]&&ab[1]==aa[1]&&ab[2]>=aa[2]))?true:false}function v(af,ab,ag,ae){var ad=h.getElementsByTagName("head")[0];if(!ad){return}var aa=(typeof ag=="string")?ag:"screen";if(ae){m=null;G=null}if(!m||G!=aa){var ac=C("style");ac.setAttribute("type","text/css");ac.setAttribute("media",aa);m=ad.appendChild(ac);if(O.ie&&typeof h.styleSheets!=D&&h.styleSheets.length>0){m=h.styleSheets[h.styleSheets.length-1]}G=aa}if(m){if(typeof m.addRule!=D){m.addRule(af,ab)}else{if(typeof h.createTextNode!=D){m.appendChild(h.createTextNode(af+" {"+ab+"}"))}}}}function w(ad,aa){if(!j){return}var ab=aa?"visible":"hidden",ac=c(ad);if(L&&ac){ac.style.visibility=ab}else{if(typeof ad==="string"){v("#"+ad,"visibility:"+ab)}}}function N(ab){var ac=/[\\\"<>\.;]/;var aa=ac.exec(ab)!=null;return aa&&typeof encodeURIComponent!=D?encodeURIComponent(ab):ab}var d=function(){if(O.ie){window.attachEvent("onunload",function(){var af=K.length;for(var ae=0;ae element itself for later use. - $('tbody .static', table).each(function() { - $(this).data('tableindex', $(this).index()); - }); - } - else - { - // Loop the static rows, moving them to their - // original "indexed" position, and keep doing - // this until no more re-shuffling needs doing - var hasShuffled = true; - - while (hasShuffled) - { - hasShuffled = false; - $('tbody .static', table).each(function() { - var targetIndex = $(this).data('tableindex'); - if (targetIndex != $(this).index()) - { - hasShuffled = true; - var thisRow = $(this).detach(); - var numRows = $('tbody tr', table).length; - - // Are we trying to be the last row? - if (targetIndex >= numRows) - { - thisRow.appendTo($('tbody', table)); - } - // Are we trying to be the first row? - else if (targetIndex == 0) - { - thisRow.prependTo($('tbody', table)); - } - // No, we want to be somewhere in the middle! - else - { - thisRow.insertBefore($('tbody tr:eq(' + targetIndex + ')', table)); - } - } - }); - } - } - - $('tbody .static-last', table).each(function() { - var row = $(this).detach(); - row.appendTo($('tbody', table)); - }); - - } -}); ;function set_feedback(text, classname, keep_displayed) { if(text) @@ -49934,7 +49860,88 @@ $.tablesorter.addWidget({ }; -})(jQuery);;function checkbox_click(event) +})(jQuery);;/* + * + * StaticRow widget for jQuery TableSorter 2.0 + * Version 1.0 + * + * Copyright (c) 2011 Nils Luxton + * Licensed under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + * + */ + +$.tablesorter.addWidget({ + + // Give the new Widget an ID to be used in the tablesorter() call, as follows: + // $('#myElement').tablesorter({ widgets: ['zebra','staticRow'] }); + id: 'staticRow', + + // "Format" is run on all widgets once when the tablesorter has finished initialising, + // and then again every time a sort has finished. + format: function(table) { + + // Use a property of the function to determine + // whether this is the first run of "Format" + // (i.e. is this the table's default starting position, + // or has it been sorted?) + if (typeof $(table).data('hasSorted') == 'undefined') + { + $(table).data('hasSorted', true); // This will force us into the "else" block the next time "Format" is run + + // "Index" the static rows, saving their current (starting) + // position in the table inside a data() param on the + // element itself for later use. + $('tbody .static', table).each(function() { + $(this).data('tableindex', $(this).index()); + }); + } + else + { + // Loop the static rows, moving them to their + // original "indexed" position, and keep doing + // this until no more re-shuffling needs doing + var hasShuffled = true; + + while (hasShuffled) + { + hasShuffled = false; + $('tbody .static', table).each(function() { + var targetIndex = $(this).data('tableindex'); + if (targetIndex != $(this).index()) + { + hasShuffled = true; + var thisRow = $(this).detach(); + var numRows = $('tbody tr', table).length; + + // Are we trying to be the last row? + if (targetIndex >= numRows) + { + thisRow.appendTo($('tbody', table)); + } + // Are we trying to be the first row? + else if (targetIndex == 0) + { + thisRow.prependTo($('tbody', table)); + } + // No, we want to be somewhere in the middle! + else + { + thisRow.insertBefore($('tbody tr:eq(' + targetIndex + ')', table)); + } + } + }); + } + } + + $('tbody .static-last', table).each(function() { + var row = $(this).detach(); + row.appendTo($('tbody', table)); + }); + + } +}); +;function checkbox_click(event) { event.stopPropagation(); do_email(enable_email.url); diff --git a/dist/opensourcepos.min.js b/dist/opensourcepos.min.js index 4875029aa..fe3bd6d15 100644 --- a/dist/opensourcepos.min.js +++ b/dist/opensourcepos.min.js @@ -1,4 +1,4 @@ -/*! opensourcepos 09-04-2016 */ +/*! opensourcepos 12-04-2016 */ function set_feedback(a,b,c){a?($("#feedback_bar").removeClass().addClass(b).html(a).css("opacity","1"),c||$("#feedback_bar").fadeTo(5e3,1).fadeTo("fast",0)):$("#feedback_bar").css("opacity","0")}function checkbox_click(a){a.stopPropagation(),do_email(enable_email.url),$(a.target).is(":checked")?$(a.target).parent().parent().find("td").addClass("selected").css("backgroundColor",""):$(a.target).parent().parent().find("td").removeClass()}function enable_search(a){a.format_item||(format_item=function(a){return a[0]}),enable_search.enabled||(enable_search.enabled=!0),$("#search").click(function(){$(this).attr("value","")});var b=$("#search").autocomplete({source:function(b,c){var d={limit:100};$.each(a.extra_params,function(a,b){d[a]="function"==typeof b?b():b}),$.ajax({type:"POST",url:a.suggest_url,dataType:"json",data:$.extend(b,d),success:function(a){c($.map(a,function(a){return{value:a.label}}))}})},delay:10,autoFocus:!1,select:function(b,c){$(this).val(c.item.value),do_search(!0,a.on_complete)}});return attach_search_listener(),$("#search_form").submit(function(b){b.preventDefault(),$("#limit_from").val(0),get_selected_values().length>0&&!confirm(a.confirm_search_message)||do_search(!0,a.on_complete)}),b}function attach_search_listener(){$("#pagination a").click(function(a){if($("#search").val()||$("#search_form input:checked")){a.preventDefault();var b=a.currentTarget.href.split("/"),c=b.pop();$("#limit_from").val(c),do_search(!0)}})}function do_search(a,b){enable_search.enabled&&(a&&$("#search").addClass("ac_loading"),$.post($("#search_form").attr("action"),$("#search_form").serialize(),function(a){$("#sortable_table tbody").html(a.rows),"function"==typeof b&&b(a),$("#search").removeClass("ac_loading"),$("#pagination").html(a.pagination),dialog_support.init("#sortable_table a.modal-dlg"),$("#sortable_table tbody :checkbox").click(checkbox_click),$("#select_all").prop("checked",!1),a.total_rows>0&&(update_sortable_table(),enable_row_selection()),attach_search_listener()},"json"))}function enable_email(a){enable_email.enabled||(enable_email.enabled=!0),enable_email.url||(enable_email.url=a),$("#select_all, #sortable_table tbody :checkbox").click(checkbox_click)}function do_email(a){enable_email.enabled&&$.post(a,{"ids[]":get_selected_values()},function(a){$("#email").attr("href",a)})}function enable_checkboxes(){$("#sortable_table tbody :checkbox").click(checkbox_click)}function enable_delete(a,b){enable_delete.enabled||(enable_delete.enabled=!0),$("#delete").click(function(c){if(c.preventDefault(),$("#sortable_table tbody :checkbox:checked").length>0){if(!confirm(a))return!1;do_delete($(this).attr("href"))}else alert(b)})}function do_delete(a){if(enable_delete.enabled){var b=get_selected_values(),c=get_selected_rows();$.post(a,{"ids[]":b},function(a){a.success?($(c).each(function(){$(this).find("td").animate({backgroundColor:"green"},1200,"linear").end().animate({opacity:0},1200,"linear",function(){$(this).remove(),$("#sortable_table tbody tr").length>0&&update_sortable_table()})}),set_feedback(a.message,"alert alert-dismissible alert-success",!1)):set_feedback(a.message,"alert alert-dismissible alert-danger",!0)},"json")}}function enable_bulk_edit(a){enable_bulk_edit.enabled||(enable_bulk_edit.enabled=!0),$("#bulk_edit").click(function(b){return 0==$("#sortable_table tbody :checkbox:checked").length?(alert(a),!1):void b.preventDefault()})}function enable_select_all(){enable_select_all.enabled||(enable_select_all.enabled=!0),$("#select_all").click(function(){$("#sortable_table tbody :checkbox").each($(this).is(":checked")?function(){$(this).prop("checked",!0),$(this).parent().parent().find("td").addClass("selected").css("backgroundColor","")}:function(){$(this).prop("checked",!1),$(this).parent().parent().find("td").removeClass()})})}function enable_row_selection(a){enable_row_selection.enabled||(enable_row_selection.enabled=!0),"undefined"==typeof a&&(a=$("#sortable_table tbody tr")),a.hover(function(){$(this).find("td").addClass("over").css("backgroundColor",""),$(this).css("cursor","pointer")},function(){$(this).find("td").hasClass("selected")||$(this).find("td").removeClass()}),a.click(function(){var a=$(this).find(":checkbox");a.prop("checked",!a.is(":checked")),do_email(enable_email.url),a.is(":checked")?$(this).find("td").addClass("selected").css("backgroundColor",""):$(this).find("td").removeClass()})}function update_sortable_table(){if($("#sortable_table").trigger("update"),"undefined"!=typeof $("#sortable_table")[0].config){var a=$("#sortable_table")[0].config.sortList;$("#sortable_table").trigger("sorton",[a])}else window.init_table_sorting&&init_table_sorting()}function get_table_row(a){a=a||$("input[name='sale_id']").val();var b=$("#sortable_table tbody :checkbox[value='"+a+"']");return 0===b.length&&(b=$("#sortable_table tbody a[href*='/"+a+"/']")),b}function update_row(a,b,c){$.post(b,{row_id:a},function(b){var d=get_table_row(a).parent().parent();d.replaceWith(b),reinit_row(a),hightlight_row(a),c&&"function"==typeof c&&c()},"html")}function reinit_row(a){var b=$("#sortable_table tbody tr :checkbox[value="+a+"]"),c=b.parent().parent();enable_row_selection(c),update_sortable_table(),dialog_support.init(c.find("a.modal-dlg")),b.click(checkbox_click)}function animate_row(a,b){b=b||"#e1ffdd",a.find("td").css("backgroundColor","#ffffff").animate({backgroundColor:b},"slow","linear").animate({backgroundColor:b},5e3).animate({backgroundColor:"#ffffff"},"slow","linear")}function hightlight_row(a){var b=$("#sortable_table tbody tr :checkbox[value="+a+"]"),c=b.parent().parent();animate_row(c)}function get_selected_values(){var a=new Array;return $("#sortable_table tbody :checkbox:checked").each(function(){a.push($(this).val())}),a}function get_selected_rows(){var a=new Array;return $("#sortable_table tbody :checkbox:checked").each(function(){a.push($(this).parent().parent())}),a}function get_visible_checkbox_ids(){var a=new Array;return $("#sortable_table tbody :checkbox").each(function(){a.push($(this).val())}),a}function phpjsDate(a,b){var c,d,e=this,f=["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur","January","February","March","April","May","June","July","August","September","October","November","December"],g=/\\?(.?)/gi,h=function(a,b){return d[a]?d[a]():b},i=function(a,b){for(a=String(a);a.length=b&&1==parseInt(a%100/10,10)&&(b=0),["st","nd","rd"][b-1]||"th"},w:function(){return c.getDay()},z:function(){var a=new Date(d.Y(),d.n()-1,d.j()),b=new Date(d.Y(),0,1);return Math.round((a-b)/864e5)},W:function(){var a=new Date(d.Y(),d.n()-1,d.j()-d.N()+3),b=new Date(a.getFullYear(),0,4);return i(1+Math.round((a-b)/864e5/7),2)},F:function(){return f[6+d.n()]},m:function(){return i(d.n(),2)},M:function(){return d.F().slice(0,3)},n:function(){return c.getMonth()+1},t:function(){return new Date(d.Y(),d.n(),0).getDate()},L:function(){var a=d.Y();return a%4===0&a%100!==0|a%400===0},o:function(){var a=d.n(),b=d.W(),c=d.Y();return c+(12===a&&9>b?1:1===a&&b>9?-1:0)},Y:function(){return c.getFullYear()},y:function(){return d.Y().toString().slice(-2)},a:function(){return c.getHours()>11?"pm":"am"},A:function(){return d.a().toUpperCase()},B:function(){var a=3600*c.getUTCHours(),b=60*c.getUTCMinutes(),d=c.getUTCSeconds();return i(Math.floor((a+b+d+3600)/86.4)%1e3,3)},g:function(){return d.G()%12||12},G:function(){return c.getHours()},h:function(){return i(d.g(),2)},H:function(){return i(d.G(),2)},i:function(){return i(c.getMinutes(),2)},s:function(){return i(c.getSeconds(),2)},u:function(){return i(1e3*c.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){var a=new Date(d.Y(),0),b=Date.UTC(d.Y(),0),c=new Date(d.Y(),6),e=Date.UTC(d.Y(),6);return a-b!==c-e?1:0},O:function(){var a=c.getTimezoneOffset(),b=Math.abs(a);return(a>0?"-":"+")+i(100*Math.floor(b/60)+b%60,4)},P:function(){var a=d.O();return a.substr(0,3)+":"+a.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-c.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(g,h)},r:function(){return"D, d M Y H:i:s O".replace(g,h)},U:function(){return c/1e3|0}},this.date=function(a,b){return e=this,c=void 0===b?new Date:new Date(b instanceof Date?b:1e3*b),a.replace(g,h)},this.date(a,b)}if(function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){function c(a){var b=!!a&&"length"in a&&a.length,c=na.type(a);return"function"===c||na.isWindow(a)?!1:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}function d(a,b,c){if(na.isFunction(b))return na.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return na.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(xa.test(b))return na.filter(b,a,c);b=na.filter(b,a)}return na.grep(a,function(a){return na.inArray(a,b)>-1!==c})}function e(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function f(a){var b={};return na.each(a.match(Da)||[],function(a,c){b[c]=!0}),b}function g(){da.addEventListener?(da.removeEventListener("DOMContentLoaded",h),a.removeEventListener("load",h)):(da.detachEvent("onreadystatechange",h),a.detachEvent("onload",h))}function h(){(da.addEventListener||"load"===a.event.type||"complete"===da.readyState)&&(g(),na.ready())}function i(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(Ia,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:Ha.test(c)?na.parseJSON(c):c}catch(e){}na.data(a,b,c)}else c=void 0}return c}function j(a){var b;for(b in a)if(("data"!==b||!na.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function k(a,b,c,d){if(Ga(a)){var e,f,g=na.expando,h=a.nodeType,i=h?na.cache:a,j=h?a[g]:a[g]&&g;if(j&&i[j]&&(d||i[j].data)||void 0!==c||"string"!=typeof b)return j||(j=h?a[g]=ca.pop()||na.guid++:g),i[j]||(i[j]=h?{}:{toJSON:na.noop}),("object"==typeof b||"function"==typeof b)&&(d?i[j]=na.extend(i[j],b):i[j].data=na.extend(i[j].data,b)),f=i[j],d||(f.data||(f.data={}),f=f.data),void 0!==c&&(f[na.camelCase(b)]=c),"string"==typeof b?(e=f[b],null==e&&(e=f[na.camelCase(b)])):e=f,e}}function l(a,b,c){if(Ga(a)){var d,e,f=a.nodeType,g=f?na.cache:a,h=f?a[na.expando]:na.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){na.isArray(b)?b=b.concat(na.map(b,na.camelCase)):b in d?b=[b]:(b=na.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;for(;e--;)delete d[b[e]];if(c?!j(d):!na.isEmptyObject(d))return}(c||(delete g[h].data,j(g[h])))&&(f?na.cleanData([a],!0):la.deleteExpando||g!=g.window?delete g[h]:g[h]=void 0)}}}function m(a,b,c,d){var e,f=1,g=20,h=d?function(){return d.cur()}:function(){return na.css(a,b,"")},i=h(),j=c&&c[3]||(na.cssNumber[b]?"":"px"),k=(na.cssNumber[b]||"px"!==j&&+i)&&Ka.exec(na.css(a,b));if(k&&k[3]!==j){j=j||k[3],c=c||[],k=+i||1;do f=f||".5",k/=f,na.style(a,b,k+j);while(f!==(f=h()/i)&&1!==f&&--g)}return c&&(k=+k||+i||0,e=c[1]?k+(c[1]+1)*c[2]:+c[2],d&&(d.unit=j,d.start=k,d.end=e)),e}function n(a){var b=Sa.split("|"),c=a.createDocumentFragment();if(c.createElement)for(;b.length;)c.createElement(b.pop());return c}function o(a,b){var c,d,e=0,f="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||na.nodeName(d,b)?f.push(d):na.merge(f,o(d,b));return void 0===b||b&&na.nodeName(a,b)?na.merge([a],f):f}function p(a,b){for(var c,d=0;null!=(c=a[d]);d++)na._data(c,"globalEval",!b||na._data(b[d],"globalEval"))}function q(a){Oa.test(a.type)&&(a.defaultChecked=a.checked)}function r(a,b,c,d,e){for(var f,g,h,i,j,k,l,m=a.length,r=n(b),s=[],t=0;m>t;t++)if(g=a[t],g||0===g)if("object"===na.type(g))na.merge(s,g.nodeType?[g]:g);else if(Ua.test(g)){for(i=i||r.appendChild(b.createElement("div")),j=(Pa.exec(g)||["",""])[1].toLowerCase(),l=Ta[j]||Ta._default,i.innerHTML=l[1]+na.htmlPrefilter(g)+l[2],f=l[0];f--;)i=i.lastChild;if(!la.leadingWhitespace&&Ra.test(g)&&s.push(b.createTextNode(Ra.exec(g)[0])),!la.tbody)for(g="table"!==j||Va.test(g)?""!==l[1]||Va.test(g)?0:i:i.firstChild,f=g&&g.childNodes.length;f--;)na.nodeName(k=g.childNodes[f],"tbody")&&!k.childNodes.length&&g.removeChild(k);for(na.merge(s,i.childNodes),i.textContent="";i.firstChild;)i.removeChild(i.firstChild);i=r.lastChild}else s.push(b.createTextNode(g));for(i&&r.removeChild(i),la.appendChecked||na.grep(o(s,"input"),q),t=0;g=s[t++];)if(d&&na.inArray(g,d)>-1)e&&e.push(g);else if(h=na.contains(g.ownerDocument,g),i=o(r.appendChild(g),"script"),h&&p(i),c)for(f=0;g=i[f++];)Qa.test(g.type||"")&&c.push(g);return i=null,r}function s(){return!0}function t(){return!1}function u(){try{return da.activeElement}catch(a){}}function v(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)v(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=t;else if(!e)return a;return 1===f&&(g=e,e=function(a){return na().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=na.guid++)),a.each(function(){na.event.add(this,b,e,d,c)})}function w(a,b){return na.nodeName(a,"table")&&na.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function x(a){return a.type=(null!==na.find.attr(a,"type"))+"/"+a.type,a}function y(a){var b=eb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function z(a,b){if(1===b.nodeType&&na.hasData(a)){var c,d,e,f=na._data(a),g=na._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)na.event.add(b,c,h[c][d])}g.data&&(g.data=na.extend({},g.data))}}function A(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!la.noCloneEvent&&b[na.expando]){e=na._data(b);for(d in e.events)na.removeEvent(b,d,e.handle);b.removeAttribute(na.expando)}"script"===c&&b.text!==a.text?(x(b).text=a.text,y(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),la.html5Clone&&a.innerHTML&&!na.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&Oa.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}function B(a,b,c,d){b=fa.apply([],b);var e,f,g,h,i,j,k=0,l=a.length,m=l-1,n=b[0],p=na.isFunction(n);if(p||l>1&&"string"==typeof n&&!la.checkClone&&db.test(n))return a.each(function(e){var f=a.eq(e);p&&(b[0]=n.call(this,e,f.html())),B(f,b,c,d)});if(l&&(j=r(b,a[0].ownerDocument,!1,a,d),e=j.firstChild,1===j.childNodes.length&&(j=e),e||d)){for(h=na.map(o(j,"script"),x),g=h.length;l>k;k++)f=j,k!==m&&(f=na.clone(f,!0,!0),g&&na.merge(h,o(f,"script"))),c.call(a[k],f,k);if(g)for(i=h[h.length-1].ownerDocument,na.map(h,y),k=0;g>k;k++)f=h[k],Qa.test(f.type||"")&&!na._data(f,"globalEval")&&na.contains(i,f)&&(f.src?na._evalUrl&&na._evalUrl(f.src):na.globalEval((f.text||f.textContent||f.innerHTML||"").replace(fb,"")));j=e=null}return a}function C(a,b,c){for(var d,e=b?na.filter(b,a):a,f=0;null!=(d=e[f]);f++)c||1!==d.nodeType||na.cleanData(o(d)),d.parentNode&&(c&&na.contains(d.ownerDocument,d)&&p(o(d,"script")),d.parentNode.removeChild(d));return a}function D(a,b){var c=na(b.createElement(a)).appendTo(b.body),d=na.css(c[0],"display");return c.detach(),d}function E(a){var b=da,c=jb[a];return c||(c=D(a,b),"none"!==c&&c||(ib=(ib||na("