Skip to content

Commit

Permalink
fix countif and countifs, bump to version 2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhsan017 committed Jan 22, 2015
1 parent 4e30382 commit d38314b
Show file tree
Hide file tree
Showing 19 changed files with 73 additions and 55 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<<<<<<< HEAD
dev
=======
dev
2.0.dev
IE-dev
extended
>>>>>>> a452b7b72fe57a0bde4dcf8f529f56951b4c7a39
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery-calx",
"version": "2.0.4",
"version": "2.0.5",
"authors": [
"Ikhsan Agustian <ikhsan017@gmail.com>"
],
Expand Down
2 changes: 1 addition & 1 deletion calx.jquery.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"title": "jQuery Calx",
"description": "jQuery plugin for creating calculation form or calculation table with user provided formula",
"keywords": ["form", "calculator", "excel", "formula"],
"version": "2.0.4",
"version": "2.0.5",
"author": {
"name": "Ikhsan Agustian",
"url": "http://www.xsanisty.com/"
Expand Down
28 changes: 24 additions & 4 deletions jquery-calx-2.0.4.js → jquery-calx-2.0.5.js
Original file line number Diff line number Diff line change
Expand Up @@ -4727,8 +4727,8 @@ financial: {
},

COUNTIF : function(range, criteria) {
var matches = 0;
for (var i = 0; i < range.length; i++) {
var matches = 0, i;
for (i in range) {
if (range[i].match(new RegExp(criteria))) {
matches++;
}
Expand All @@ -4740,7 +4740,8 @@ financial: {
var criteria = (arguments.length - 1) / 2;
var range = arguments[0];
var result = 0;
for (var i = 0; i < range.length; i++) {
var i;
for (i in range) {
var fit = true;
for (var j = 0; j < criteria; j++) {
if (!eval(arguments[2 * j + 1][i] + arguments[2 * j + 2])) {
Expand Down Expand Up @@ -9208,7 +9209,7 @@ sheet.fx.buildCellDependency = function(){
},

notEqual: function(a,b){
return a!= b;
return a != b;
}
};sheet.fx.getVariable = function(varName){
var varIndex = varName[0],
Expand Down Expand Up @@ -9982,6 +9983,25 @@ calculate : function(){
calx.sheetRegistry[sheetIdentifier].calculate();
}
});
},
/**
* set value of specific cell on the sheet related to the selected element,
* the selector should only select single object, e.g. $('#id')
*
* @param {string} address the cell's address
* @param {string} value the cell's value
* @return {void}
*/
setValue : function(address, value){
var $this = $(this),
$identifier = $this.attr('data-calx-identifier'),
$sheet = calx.sheetRegistry[$identifier],
$cell = $sheet.getCell(address);

$cell.setValue(value);
$cell.processDependant();

$sheet.renderComputedValue();
}
}; /**
* the surrogate of the calx world to the jQuery world
Expand Down
12 changes: 6 additions & 6 deletions jquery-calx-2.0.4.min.js → jquery-calx-2.0.5.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions php-build/build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
$unminifiedFile = '../jquery-calx-2.0.4.js';
$minifiedFile = '../jquery-calx-2.0.4.min.js';
$unminifiedFile = '../jquery-calx-2.0.5.js';
$minifiedFile = '../jquery-calx-2.0.5.min.js';

/**
* gathering all js source and build into one package
Expand All @@ -25,5 +25,5 @@ $compiler = new ClosureCompiler;
$compiler->addSourceFile($unminifiedFile);
$compiler->setTargetFile($minifiedFile);

$compiler->compile();
echo $compiler->compile();
?>
4 changes: 2 additions & 2 deletions php-build/build-sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
$unminifiedFile = '../sample/js/jquery-calx-sample-2.0.4.js';
$minifiedFile = '../sample/js/jquery-calx-sample-2.0.4.min.js';
$unminifiedFile = '../sample/js/jquery-calx-sample-2.0.5.js';
$minifiedFile = '../sample/js/jquery-calx-sample-2.0.5.min.js';

/**
* gathering all js source and build into one package
Expand Down
3 changes: 2 additions & 1 deletion php-build/include/calx.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<?php require 'include/calx/evaluate.js' ?>,
<?php require 'include/calx/destroy.js' ?>,
<?php require 'include/calx/reset.js' ?>,
<?php require 'include/calx/calculate.js' ?>
<?php require 'include/calx/calculate.js' ?>,
<?php require 'include/calx/setValue.js' ?>

};
7 changes: 4 additions & 3 deletions php-build/include/formula/statistic.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ statistic: {
},

COUNTIF : function(range, criteria) {
var matches = 0;
for (var i = 0; i < range.length; i++) {
var matches = 0, i;
for (i in range) {
if (range[i].match(new RegExp(criteria))) {
matches++;
}
Expand All @@ -192,7 +192,8 @@ statistic: {
var criteria = (arguments.length - 1) / 2;
var range = arguments[0];
var result = 0;
for (var i = 0; i < range.length; i++) {
var i;
for (i in range) {
var fit = true;
for (var j = 0; j < criteria; j++) {
if (!eval(arguments[2 * j + 1][i] + arguments[2 * j + 2])) {
Expand Down
2 changes: 1 addition & 1 deletion php-build/include/sheet/comparator.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ sheet.fx.comparator = {
},

notEqual: function(a,b){
return a!= b;
return a != b;
}
};
2 changes: 1 addition & 1 deletion sample/app/budget_planner.html
Original file line number Diff line number Diff line change
Expand Up @@ -8194,7 +8194,7 @@ <h2>Yearly Budget Planner</h2>
</div>
</div>

<script src="../js/jquery-calx-sample-2.0.4.min.js" type="text/javascript"></script>
<script src="../js/jquery-calx-sample-2.0.5.min.js" type="text/javascript"></script>
<script src="../js/bootstrap.js" type="text/javascript"></script>
<script>
$('#budget_planner').calx({
Expand Down
6 changes: 3 additions & 3 deletions sample/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="description" content="">
<meta name="author" content="">
<title>
jQuery Calx 2.0.4 Sample - Basic Calculation
jQuery Calx 2.0.5 Sample - Basic Calculation
</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/sb-admin.css" rel="stylesheet" type="text/css">
Expand All @@ -20,7 +20,7 @@
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
</button>
<a class="navbar-brand" href="#">jQuery Calx 2.0.4 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.0.5 Sample</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
Expand Down Expand Up @@ -487,7 +487,7 @@ <h2>Basic Calculation</h2>
</div>
</div>

<script src="js/jquery-calx-sample-2.0.4.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.0.5.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script>
$('#basic_math').calx();
Expand Down
6 changes: 3 additions & 3 deletions sample/chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="description" content="">
<meta name="author" content="">
<title>
jQuery Calx 2.0.4 Sample
jQuery Calx 2.0.5 Sample
</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/sb-admin.css" rel="stylesheet" type="text/css">
Expand All @@ -20,7 +20,7 @@
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
</button>
<a class="navbar-brand" href="#">jQuery Calx 2.0.4 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.0.5 Sample</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
Expand Down Expand Up @@ -220,7 +220,7 @@ <h4 class="text-center">Bar Graph</h4>
</div>
</div>

<script src="js/jquery-calx-sample-2.0.4.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.0.5.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script>
var calc = $('#sheet1').calx();
Expand Down
2 changes: 1 addition & 1 deletion sample/checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ <h3>Burger Package</h3>
</div>
</div>

<script src="js/jquery-calx-sample-2.0.4.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.0.5.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script>
$('#pizza, #burger').calx();
Expand Down
2 changes: 1 addition & 1 deletion sample/complex.html
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@

</table>
</form>
<script src="jquery-calx-sample-2.0.4.min.js"></script>
<script src="jquery-calx-sample-2.0.5.min.js"></script>

<script>
$('#reset').click(function(){
Expand Down
6 changes: 3 additions & 3 deletions sample/dynamic_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta name="description" content="">
<meta name="author" content="">
<title>
jQuery Calx 2.0.4 Sample - Checkbox, Radio Button, and Select Box
jQuery Calx 2.0.5 Sample - Checkbox, Radio Button, and Select Box
</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/sb-admin.css" rel="stylesheet" type="text/css">
Expand All @@ -20,7 +20,7 @@
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
</button>
<a class="navbar-brand" href="#">jQuery Calx 2.0.4 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.0.5 Sample</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
Expand Down Expand Up @@ -141,7 +141,7 @@ <h2>Working with Dynamic Form</h2>
</div>
</div>

<script src="js/jquery-calx-sample-2.0.4.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.0.5.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script>
$form = $('#dynamic').calx();
Expand Down
Loading

0 comments on commit d38314b

Please sign in to comment.