Skip to content

Commit

Permalink
fix register variable, bump version to 2.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhsan017 committed Apr 25, 2015
1 parent e8c3264 commit d2ca1ca
Show file tree
Hide file tree
Showing 20 changed files with 139 additions and 121 deletions.
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "jquery-calx",
"version": "2.2.0",
"version": "2.2.1",
"authors": [
"Xsanisty Developer Team <developers@xsanisty.com>"
],
"repo": "xsanisty/jquery-calx",
"description": "jQuery plugin for building excel-formula based calculation form",
"main": "jquery-calx-2.2.0.min.js",
"scripts": ["jquery-calx-2.2.0.min.js"],
"main": "jquery-calx-2.2.1.min.js",
"scripts": ["jquery-calx-2.2.1.min.js"],
"moduleType": [
"globals"
],
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.2.0",
"version": "2.2.1",
"author": {
"name": "Xsanisty Development Team",
"url": "http://www.xsanisty.com/"
Expand Down
7 changes: 6 additions & 1 deletion jquery-calx-2.2.0.js → jquery-calx-2.2.1.js
Original file line number Diff line number Diff line change
Expand Up @@ -9056,7 +9056,7 @@ cell.fx.highlightDependency = function(){
};

/**
* Sheet object, represent each cell as single sheet
* Sheet object, represent each element as single sheet
* @param {string} identifier :unique key for accessing sheet object internally
* @param {domElement} element :dom element as scope for sheet to work with
* @param {object} config : configuration object
Expand Down Expand Up @@ -9857,6 +9857,10 @@ registerFunction : function (funcName, funcDefinition, override) {
registerVariable : function (varName, varValue, global) {
global = typeof(global) == 'undefined' ? false : global;

if(this.length === 0){
global = true;
}

if(global){
if(typeof(varName) == 'object'){
for(var a in varName){
Expand All @@ -9871,6 +9875,7 @@ registerVariable : function (varName, varValue, global) {

if(sheetIdentifier && typeof(calx.sheetRegistry[sheetIdentifier]) != 'undefined'){
calx.sheetRegistry[sheetIdentifier].registerVariable(varName, varValue);
calx.sheetRegistry[sheetIdentifier].calculate();
}
});
}
Expand Down
10 changes: 5 additions & 5 deletions jquery-calx-2.2.0.min.js → jquery-calx-2.2.1.min.js

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

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

/**
* gathering all js source and build into one package
Expand Down
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.2.0.js';
$minifiedFile = '../sample/js/jquery-calx-sample-2.2.0.min.js';
$unminifiedFile = '../sample/js/jquery-calx-sample-2.2.1.js';
$minifiedFile = '../sample/js/jquery-calx-sample-2.2.1.min.js';

/**
* gathering all js source and build into one package
Expand Down
2 changes: 1 addition & 1 deletion php-build/calx-build-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<?php
require '../js/flot_plugin/jquery.flot.pie.js';
require '../js/flot_plugin/jquery.flot.stack.js';
require '../jquery-calx-2.2.0.min.js';
require '../jquery-calx-2.2.1.min.js';
?>
}else{
var Zepto = Zepto || undefined,
Expand Down
5 changes: 5 additions & 0 deletions php-build/include/calx/registerVariable.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
registerVariable : function (varName, varValue, global) {
global = typeof(global) == 'undefined' ? false : global;

if(this.length === 0){
global = true;
}

if(global){
if(typeof(varName) == 'object'){
for(var a in varName){
Expand All @@ -21,6 +25,7 @@ registerVariable : function (varName, varValue, global) {

if(sheetIdentifier && typeof(calx.sheetRegistry[sheetIdentifier]) != 'undefined'){
calx.sheetRegistry[sheetIdentifier].registerVariable(varName, varValue);
calx.sheetRegistry[sheetIdentifier].calculate();
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion php-build/include/sheet.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Sheet object, represent each cell as single sheet
* Sheet object, represent each element as single sheet
* @param {string} identifier :unique key for accessing sheet object internally
* @param {domElement} element :dom element as scope for sheet to work with
* @param {object} config : configuration object
Expand Down
6 changes: 3 additions & 3 deletions sample/app/budget_planner.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.2.0 Sample
jQuery Calx 2.2.1 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.2.0 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.2.1 Sample</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
Expand Down Expand Up @@ -8194,7 +8194,7 @@ <h2>Yearly Budget Planner</h2>
</div>
</div>

<script src="../js/jquery-calx-sample-2.2.0.min.js" type="text/javascript"></script>
<script src="../js/jquery-calx-sample-2.2.1.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.2.0 Sample - Basic Calculation
jQuery Calx 2.2.1 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.2.0 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.2.1 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.2.0.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.2.1.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.2.0 Sample
jQuery Calx 2.2.1 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.2.0 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.2.1 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.2.0.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.2.1.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script>
var calc = $('#sheet1').calx();
Expand Down
6 changes: 3 additions & 3 deletions sample/checkbox.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.2.0 Sample - Checkbox, Radio Button, and Select Box
jQuery Calx 2.2.1 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.2.0 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.2.1 Sample</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
Expand Down Expand Up @@ -217,7 +217,7 @@ <h3>Burger Package</h3>
</div>
</div>

<script src="js/jquery-calx-sample-2.2.0.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.2.1.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.2.0.min.js"></script>
<script src="jquery-calx-sample-2.2.1.min.js"></script>

<script>
$('#reset').click(function(){
Expand Down
6 changes: 3 additions & 3 deletions sample/data.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.2.0 Sample
jQuery Calx 2.2.1 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-brandom" href="#">jQuery Calx 2.2.0 Sample</a>
<a class="navbar-brandom" href="#">jQuery Calx 2.2.1 Sample</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
Expand Down Expand Up @@ -134,7 +134,7 @@
</div>
</div>

<script src="js/jquery-calx-sample-2.2.0.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.2.1.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script>
$('#calx').calx({
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.2.0 Sample - Checkbox, Radio Button, and Select Box
jQuery Calx 2.2.1 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.2.0 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.2.1 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.2.0.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.2.1.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script>
$form = $('#dynamic').calx();
Expand Down
6 changes: 3 additions & 3 deletions sample/formula.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.2.0 Sample - Formula Showcase
jQuery Calx 2.2.1 Sample - Formula Showcase
</title>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/sb-admin.css" rel="stylesheet" type="text/css">
Expand Down Expand Up @@ -35,7 +35,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.2.0 Sample</a>
<a class="navbar-brand" href="#">jQuery Calx 2.2.1 Sample</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav side-nav">
Expand Down Expand Up @@ -196,7 +196,7 @@ <h2>Formula Showcase</h2>
</div>
</div>

<script src="js/jquery-calx-sample-2.2.0.min.js" type="text/javascript"></script>
<script src="js/jquery-calx-sample-2.2.1.min.js" type="text/javascript"></script>
<script src="js/bootstrap.js" type="text/javascript"></script>
<script>

Expand Down
Loading

0 comments on commit d2ca1ca

Please sign in to comment.