Skip to content

Commit

Permalink
fix(update): change jquery reference address to cdnjs
Browse files Browse the repository at this point in the history
  • Loading branch information
dabeng committed Jul 7, 2017
1 parent cae8ddc commit e90681a
Show file tree
Hide file tree
Showing 30 changed files with 52 additions and 50 deletions.
22 changes: 12 additions & 10 deletions dist/js/jquery.orgchart.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
$chartContainer.on('wheel', function(event) {
event.preventDefault();
var newScale = 1 + (event.originalEvent.deltaY > 0 ? -0.2 : 0.2);
setChartScale($chart, newScale);
that.setChartScale($chart, newScale);
});

$chartContainer.on('touchstart',function(e){
Expand All @@ -270,9 +270,9 @@
$chart.data('pinching', false);
var diff = $chart.data('pinchDistEnd') - $chart.data('pinchDistStart');
if (diff > 0) {
setChartScale($chart, 1.2);
that.setChartScale($chart, 1.2);
} else if (diff < 0) {
setChartScale($chart, 0.8);
that.setChartScale($chart, 0.8);
}
}
});
Expand Down Expand Up @@ -310,6 +310,7 @@
},
//
buildJsonDS ($li) {
var that = this;
var subObj = {
'name': $li.contents().eq(0).text().trim(),
'relationship': ($li.parent().parent().is('li') ? '1': '0') + ($li.siblings('li').length ? 1: 0) + ($li.children('ul').length ? 1 : 0)
Expand All @@ -319,7 +320,7 @@
}
$li.children('ul').children().each(function() {
if (!subObj.children) { subObj.children = []; }
subObj.children.push(buildJsonDS($(this)));
subObj.children.push(that.buildJsonDS($(this)));
});
return subObj;
},
Expand All @@ -336,21 +337,22 @@
},
//
loopChart ($chart) {
var that = this;
var $tr = $chart.find('tr:first');
var subObj = { 'id': $tr.find('.node')[0].id };
$tr.siblings(':last').children().each(function() {
if (!subObj.children) { subObj.children = []; }
subObj.children.push(loopChart($(this)));
subObj.children.push(that.loopChart($(this)));
});
return subObj;
},
//
getHierarchy ($chart) {
var $chart = $chart || $(this).find('.orgchart');
var $chart = $chart || this.$chart;
if (!$chart.find('.node:first')[0].id) {
return 'Error: Nodes of orghcart to be exported must have id attribute!';
}
return loopChart($chart);
return this.loopChart($chart);
},
// detect the exist/display state of related node
getNodeState ($node, relation) {
Expand Down Expand Up @@ -697,7 +699,7 @@
.done(function(data) {
if ($node.closest('.orgchart').data('inAjax')) {
if (!$.isEmptyObject(data)) {
addParent.call($node.closest('.orgchart').parent(), $node, data, opts);
that.addParent($node, data, opts);
}
}
})
Expand Down Expand Up @@ -737,7 +739,7 @@
console.log('Failed to get children nodes data');
})
.always(function() {
endLoading($that, $node, opts);
that.endLoading($that, $node, opts);
});
}
}
Expand Down Expand Up @@ -818,7 +820,7 @@
console.log('Failed to get sibling nodes data');
})
.always(function() {
endLoading($that, $node, opts);
that.endLoading($that, $node, opts);
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ajax-datasource/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/jakerella/jquery-mockjax/master/dist/jquery.mockjax.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/color-coded/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/default-collapsed/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/direction/bottom2top.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="b2t.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/direction/left2right.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="l2r.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/direction/right2left.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="r2l.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/drag-drop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/edit-orgchart/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/niklasvh/html2canvas/master/dist/html2canvas.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions examples/export-orgchart/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>Organization Chart Plugin</title>

<link rel="icon" href="../img/logo.png" type="image/png">
<link rel="stylesheet" href="https://cdn.rawgit.com/FortAwesome/Font-Awesome/master/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="style.css">
Expand All @@ -20,7 +20,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<!-- the following reference is specific for IE -->
<script type="text/javascript" src="https://cdn.rawgit.com/stefanpenner/es6-promise/master/dist/es6-promise.auto.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/niklasvh/html2canvas/master/dist/html2canvas.min.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/export-orgchart/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]
};

$('#chart-container').orgchart({
var oc = $('#chart-container').orgchart({
'data' : datascource,
'depth': 2,
'nodeContent': 'title',
Expand Down
4 changes: 2 additions & 2 deletions examples/get-hierarchy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>Organization Chart Plugin</title>

<link rel="icon" href="../img/logo.png" type="image/png">
<link rel="stylesheet" href="https://cdn.rawgit.com/FortAwesome/Font-Awesome/master/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="style.css">
Expand Down Expand Up @@ -38,7 +38,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions examples/get-hierarchy/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

$(function() {

$('#chart-container').orgchart({
var oc = $('#chart-container').orgchart({
'data' : $('#ul-data')
});

$('#btn-export-hier').on('click', function() {
if (!$('pre').length) {
var hierarchy = $('#chart-container').orgchart('getHierarchy');
var hierarchy = oc.getHierarchy();
$('#btn-export-hier').after('<pre>').next().append(JSON.stringify(hierarchy, null, 2));
}
});
Expand Down
4 changes: 2 additions & 2 deletions examples/integrate-map/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>Organization Chart Plugin</title>

<link rel="icon" href="../img/logo.png" type="image/png">
<link rel="stylesheet" href="https://cdn.rawgit.com/FortAwesome/Font-Awesome/master/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.18.2/ol.css">
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css">
<link rel="stylesheet" href="../css/style.css">
Expand All @@ -18,7 +18,7 @@
<body id="pageBody">
<div id="chart-container"></div>

<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.18.2/ol.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/integrate-map/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
]
};

$('#chart-container').orgchart({
var oc = $('#chart-container').orgchart({
'data' : datascource,
'nodeContent': 'title',
'createNode': function($node, data) {
Expand Down
2 changes: 1 addition & 1 deletion examples/local-datasource/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/local-datasource/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]
};

$('#chart-container').orgchart({
var oc = $('#chart-container').orgchart({
'data' : datascource,
'depth': 2,
'nodeContent': 'title'
Expand Down
4 changes: 2 additions & 2 deletions examples/multiple-layers/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>Organization Chart Plugin</title>

<link rel="icon" href="../img/logo.png" type="image/png">
<link rel="stylesheet" href="https://cdn.rawgit.com/FortAwesome/Font-Awesome/master/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="style.css">
Expand All @@ -20,7 +20,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/jakerella/jquery-mockjax/master/dist/jquery.mockjax.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
Expand Down
4 changes: 2 additions & 2 deletions examples/ondemand-loading-data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>Organization Chart Plugin</title>

<link rel="icon" href="../img/logo.png" type="image/png">
<link rel="stylesheet" href="https://cdn.rawgit.com/FortAwesome/Font-Awesome/master/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css">
<link rel="stylesheet" href="../css/style.css">

Expand All @@ -19,7 +19,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/jakerella/jquery-mockjax/master/dist/jquery.mockjax.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/ondemand-loading-data/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}
};

$('#chart-container').orgchart({
var oc = $('#chart-container').orgchart({
'data' : datascource,
'ajaxURL': ajaxURLs,
'nodeContent': 'title',
Expand Down
4 changes: 2 additions & 2 deletions examples/option-createNode/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>Organization Chart Plugin</title>

<link rel="icon" href="../img/logo.png" type="image/png">
<link rel="stylesheet" href="https://cdn.rawgit.com/FortAwesome/Font-Awesome/master/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="style.css">
Expand All @@ -20,7 +20,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/niklasvh/html2canvas/master/dist/html2canvas.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion examples/option-createNode/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
]
};

$('#chart-container').orgchart({
var oc = $('#chart-container').orgchart({
'data' : datascource,
'depth': 2,
'nodeContent': 'title',
Expand Down
4 changes: 2 additions & 2 deletions examples/pan-zoom/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>Organization Chart Plugin</title>

<link rel="icon" href="../img/logo.png" type="image/png">
<link rel="stylesheet" href="https://cdn.rawgit.com/FortAwesome/Font-Awesome/master/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css">
<link rel="stylesheet" href="../css/style.css">
</head>
Expand All @@ -18,7 +18,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/pan-zoom/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
]
};

$('#chart-container').orgchart({
var oc = $('#chart-container').orgchart({
'data' : datascource,
'nodeContent': 'title',
'pan': true,
Expand Down
4 changes: 2 additions & 2 deletions examples/toggle-sibs-resp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<title>Organization Chart Plugin</title>

<link rel="icon" href="../img/logo.png" type="image/png">
<link rel="stylesheet" href="https://cdn.rawgit.com/FortAwesome/Font-Awesome/master/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="../../dist/css/jquery.orgchart.css">
<link rel="stylesheet" href="../css/style.css">

Expand All @@ -19,7 +19,7 @@
<a href="https://github.com/dabeng/OrgChart" >More orgcharts</a>
<img src="../img/logo.png"></img>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.0.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script type="text/javascript" src="../../dist/js/jquery.orgchart.js"></script>
<script type="text/javascript" src="scripts.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion examples/toggle-sibs-resp/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
]
};

$('#chart-container').orgchart({
var oc = $('#chart-container').orgchart({
'data' : datascource,
'nodeContent': 'title',
'toggleSiblingsResp': true
Expand Down
Loading

0 comments on commit e90681a

Please sign in to comment.