Sat, 07 Sep 2019 19:25:17 +0200
Code optimize and compress.
www/js/rec_main-min.js | file | annotate | diff | comparison | revisions | |
www/js/rec_main.js | file | annotate | diff | comparison | revisions |
--- a/www/js/rec_main-min.js Sat Sep 07 10:47:24 2019 +0200 +++ b/www/js/rec_main-min.js Sat Sep 07 19:25:17 2019 +0200 @@ -1,1 +1,1 @@ -$(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"st_name",type:"string"},{name:"st_letter",type:"string"},{name:"st_guide",type:"string"},{name:"name",type:"string"},{name:"est_og",type:"float"},{name:"est_color",type:"float"},{name:"est_ibu",type:"float"},{name:"est_abv",type:"float"},],id:"record",url:"includes/db_recipes.php"};var b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,groupable:true,theme:theme,showstatusbar:true,renderstatusbar:function(e){var c=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");var d=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");c.append(d);e.append(c);d.jqxButton({theme:theme,width:100,height:20});d.click(function(g){var f="rec_new.php?return=rec_main.php";window.location.href=f})},filterable:true,filtermode:"excel",columns:[{text:"Stijlgids",datafield:"st_guide",width:120},{text:"Letter",datafield:"st_letter",width:60},{text:"Stijl",datafield:"st_name",width:160},{text:"Naam",datafield:"name"},{text:"OG",datafield:"est_og",width:60,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"EBC",datafield:"est_color",width:60,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"IBU",datafield:"est_ibu",width:60,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"ABV",datafield:"est_abv",width:60,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"",datafield:"Edit",width:120,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(e){var d=b.records[e];var c="rec_edit.php?record="+d.record+"&return=rec_main.php";window.location.href=c}}],groups:["st_guide","st_letter"]})}); \ No newline at end of file +$(document).ready(function(){var a={datatype:"json",cache:false,datafields:[{name:"record",type:"number"},{name:"st_name",type:"string"},{name:"st_letter",type:"string"},{name:"st_guide",type:"string"},{name:"name",type:"string"},{name:"est_og",type:"float"},{name:"est_color",type:"float"},{name:"est_ibu",type:"float"},{name:"est_abv",type:"float"},],id:"record",url:"includes/db_recipes.php"},b=new $.jqx.dataAdapter(a);$("#jqxgrid").jqxGrid({width:1280,height:630,source:b,groupable:true,theme:theme,showstatusbar:true,renderstatusbar:function(e){var d,c=$("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");d=$("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");c.append(d);e.append(c);d.jqxButton({theme:theme,width:100,height:20});d.click(function(f){window.location.href="rec_new.php?return=rec_main.php"})},filterable:true,filtermode:"excel",columns:[{text:"Stijlgids",datafield:"st_guide",width:120},{text:"Letter",datafield:"st_letter",width:60},{text:"Stijl",datafield:"st_name",width:160},{text:"Naam",datafield:"name"},{text:"OG",datafield:"est_og",width:60,align:"right",cellsalign:"right",cellsformat:"f3"},{text:"EBC",datafield:"est_color",width:60,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"IBU",datafield:"est_ibu",width:60,align:"right",cellsalign:"right",cellsformat:"f0"},{text:"ABV",datafield:"est_abv",width:60,align:"right",cellsalign:"right",cellsformat:"p1"},{text:"",datafield:"Edit",width:120,align:"center",columntype:"button",cellsrenderer:function(){return"Wijzig"},buttonclick:function(d){var c=b.records[d];window.location.href="rec_edit.php?record="+c.record+"&return=rec_main.php"}}],groups:["st_guide","st_letter"]})}); \ No newline at end of file
--- a/www/js/rec_main.js Sat Sep 07 10:47:24 2019 +0200 +++ b/www/js/rec_main.js Sat Sep 07 19:25:17 2019 +0200 @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (C) 2018 + * Copyright (C) 2018-2019 * * Michiel Broek <mbroek at mbse dot eu> * @@ -38,8 +38,9 @@ ], id: 'record', url: "includes/db_recipes.php" - }; - var dataAdapter = new $.jqx.dataAdapter(source); + }, + dataAdapter = new $.jqx.dataAdapter(source); + // initialize jqxGrid $("#jqxgrid").jqxGrid({ width: 1280, @@ -49,15 +50,14 @@ theme: theme, showstatusbar: true, renderstatusbar: function (statusbar) { - var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); - var addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>"); + var addButton, container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>"); + addButton = $("<div style='float: right; margin-right: 15px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>"); container.append(addButton); statusbar.append(container); addButton.jqxButton({ theme: theme, width: 100, height: 20 }); // add new recipe. addButton.click(function (event) { - var url= "rec_new.php?return=rec_main.php"; - window.location.href = url; + window.location.href = "rec_new.php?return=rec_main.php"; }); }, filterable: true, @@ -75,8 +75,7 @@ return "Wijzig"; }, buttonclick: function (row) { var datarecord = dataAdapter.records[row]; - var url= "rec_edit.php?record=" + datarecord.record + "&return=rec_main.php"; - window.location.href = url; + window.location.href = "rec_edit.php?record=" + datarecord.record + "&return=rec_main.php"; } } ],