From 5a2942027da22300740d501511c213e79723bcd5 Mon Sep 17 00:00:00 2001 From: Rystraum Gamonez Date: Tue, 21 Jun 2011 13:42:27 +0800 Subject: [PATCH 1/3] added parameter for copying of jo.js and jo_min.js to remote directory --- build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build b/build index 0b05804..e6e1cd3 100755 --- a/build +++ b/build @@ -18,7 +18,11 @@ jsmin < jo.js > jo_min.js # echo "Compiling jo.js -> jo_com.js" # java -jar ~/bin/compiler.jar --js=jo.js --js_output_file=jo_com.js # gzip -c jo_com.js > jo_com.js.gz -cd .. -echo "Done." +if [[ ${1} && -d ${1} ]]; then +echo "Copying files to test directory" +cp jo.js jo_min.js ${1} +fi +cd .. +echo "Done compiling." From ee1369ba37584ccd02a9bdfd2defff2f4bd3fe15 Mon Sep 17 00:00:00 2001 From: Rystraum Gamonez Date: Tue, 21 Jun 2011 14:53:02 +0800 Subject: [PATCH 2/3] added setOmmitCols(array) to joTable --- js/ui/table.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/js/ui/table.js b/js/ui/table.js index 999d94a..45bace5 100644 --- a/js/ui/table.js +++ b/js/ui/table.js @@ -40,20 +40,41 @@ - `getRow()`, `getCol()` Return the current row or column + + - `setOmittCols(array)` + + Sets the columns whose header is in the passed array be omitted. + */ joTable = function(data) { + this.omittCols = new Array(); + this.omittIndex = new Array(); joList.apply(this, arguments); }; + joTable.extend(joList, { tagName: "jotable", + // With another round of formatItem as overhead because of refresh() + setOmittCols: function(omittArray){ + this.omittCols = omittArray; + this.refresh(); + }, + // default row formatter formatItem: function(row, index) { var tr = document.createElement("tr"); - + for (var i = 0, l = row.length; i < l; i++) { var o = document.createElement(index ? "td" : "th"); + + if ((this.omittCols.indexOf(row[i]) != -1)) { + this.omittIndex.push(i); + } + + if (this.omittIndex.indexOf(i%l) > -1) continue; + o.innerHTML = row[i]; // this is a little brittle, but plays nicely with joList's select event @@ -88,6 +109,5 @@ joTable.extend(joList, { var rowsize = this.data[0].length; return index % rowsize; - } + } }); - From 680094d2b7edd3655138c5da3437fb0297ff74dc Mon Sep 17 00:00:00 2001 From: Rystraum Gamonez Date: Tue, 21 Jun 2011 15:12:15 +0800 Subject: [PATCH 3/3] Fixed typo on omit --- js/ui/table.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/js/ui/table.js b/js/ui/table.js index 45bace5..16f5425 100644 --- a/js/ui/table.js +++ b/js/ui/table.js @@ -41,15 +41,15 @@ Return the current row or column - - `setOmittCols(array)` + - `setOmitCols(array)` - Sets the columns whose header is in the passed array be omitted. + Sets the columns whose header is in the passed array be omited. */ joTable = function(data) { - this.omittCols = new Array(); - this.omittIndex = new Array(); + this.omitCols = new Array(); + this.omitIndex = new Array(); joList.apply(this, arguments); }; @@ -57,8 +57,8 @@ joTable.extend(joList, { tagName: "jotable", // With another round of formatItem as overhead because of refresh() - setOmittCols: function(omittArray){ - this.omittCols = omittArray; + setOmitCols: function(omitArray){ + this.omitCols = omitArray; this.refresh(); }, @@ -69,11 +69,11 @@ joTable.extend(joList, { for (var i = 0, l = row.length; i < l; i++) { var o = document.createElement(index ? "td" : "th"); - if ((this.omittCols.indexOf(row[i]) != -1)) { - this.omittIndex.push(i); + if ((this.omitCols.indexOf(row[i]) != -1)) { + this.omitIndex.push(i); } - if (this.omittIndex.indexOf(i%l) > -1) continue; + if (this.omitIndex.indexOf(i%l) > -1) continue; o.innerHTML = row[i];