Skip to content

Commit

Permalink
Merge "add license information to borrowed code" into R5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul v3 CI authored and opencontrail-ci-admin committed May 1, 2018
2 parents 2b44aa8 + 5a1783f commit 2d913ec
Show file tree
Hide file tree
Showing 16 changed files with 80 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/tools/cutils.js
Expand Up @@ -60,6 +60,10 @@ function pad(num, size) {
}

function clone(obj) {
/*
* License: CC-BY-SA-3.0
* https://stackoverflow.com/questions/728360/how-do-i-correctly-clone-a-javascript-object/728694#728694
*/
// Handle the 3 simple types, and null or undefined
if (null == obj || "object" != typeof obj) return obj;

Expand Down
@@ -1,5 +1,7 @@
/* Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. */

/* From https://robots.thoughtbot.com/how-to-make-a-chrome-extension */

// Called when the user clicks on the browser action.
chrome.browserAction.onClicked.addListener(function(tab) {
// Send a message to the active tab
Expand Down
12 changes: 12 additions & 0 deletions webroot/js/chart-utils.js
Expand Up @@ -1343,6 +1343,10 @@ function barChart() {
y.domain([0, 0]);
*/

/*
* License: Apache-2.0
* https://gist.github.com/tyrauber/3350666
*/
div.each(function () {
var div = d3.select(this),
g = div.select("g");
Expand Down Expand Up @@ -1571,6 +1575,10 @@ d3.custom.barChart = function barChart() {
xaxis_max_value = x.domain()[1];
logMessage('crossFilterChart','Start');

/*
* License: Apache-2.0
* https://gist.github.com/tyrauber/3350666
*/
div.each(function () {
var div = d3.select(this),
g = div.select("g");
Expand Down Expand Up @@ -1706,6 +1714,10 @@ d3.custom.barChart = function barChart() {
}
});

/*
* License: Apache-2.0
* https://gist.github.com/tyrauber/3350666
*/
brush.on("brushend.chart", function () {
if (brush.empty()) {
var div = d3.select(this.parentNode.parentNode.parentNode);
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/common/core.contrail.form.elements.js
Expand Up @@ -1369,6 +1369,11 @@ define([
more:results.length >= q.page*pageSize });
} else {
var t = q.term,filtered = { results: [] }, process;
/*
* License: GPL-2.0 or Apache-2.0
* Copyright 2012 Igor Vaynberg
* https://github.com/select2/select2/blob/3.5.0/select2.js
*/
process = function(datum, collection) {
var group, attr;
datum = datum[0];
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/common/core.hash.utils.js
Expand Up @@ -3,6 +3,11 @@
* All rights reserved.
*/

/*
* "License: GPL-2.0 or MIT
* Copyright (c) 2010 ""Cowboy"" Ben Alman
* https://github.com/cowboy/jquery-bbq/blob/master/jquery.ba-bbq.js
*/
define(['underscore'], function (_) {
var jq_param_fragment, jq_deparam_fragment,
str_querystring = 'querystring',
Expand Down
4 changes: 4 additions & 0 deletions webroot/js/common/joint.contrail.js
Expand Up @@ -485,6 +485,10 @@ define([
return new joint.dia.Link($.extend(true, {}, defaultLinkConfig, linkConfig));
};

/*
* License: MPL-2.0
* https://www.jointjs.com/opensource
*/
joint.layout.contrail.DirectedGraph = $.extend(true, joint.layout.DirectedGraph, {
layout: function (graph, opt) {

Expand Down
5 changes: 4 additions & 1 deletion webroot/js/contrail-layout.js
Expand Up @@ -2,7 +2,6 @@
* Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
*/


var lastHash = {};

Object.identical = function (a, b, sortArrays) {
Expand Down Expand Up @@ -237,6 +236,10 @@ function initWidget(widget) {
};

//code taken from http://code.jquery.com/jquery-1.8.3.js to provide simple browser detection for 1.9+ versions
/*
* "License: MIT
* Copyright 2012 jQuery Foundation and other contributors
*/
function addBrowserDetection($) {
if (!$.browser) {
var matched, browser;
Expand Down
4 changes: 4 additions & 0 deletions webroot/js/contrail-load.js
Expand Up @@ -263,6 +263,10 @@ function endWidgetLoading(selectorId) {
$.deparamURLArgs = function (query) {
var query_string = {};
var query = ifNull(query,'');
/*
* License: CC-BY-SA-3.0
* https://stackoverflow.com/questions/979975/how-to-get-the-value-from-the-get-parameters/979995
*/
if (query.indexOf('?') > -1) {
query = query.substr(query.indexOf('?') + 1);
var vars = query.split("&");
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/models/MultiDonutChartModel.js
Expand Up @@ -138,6 +138,11 @@ define([
return 0.5;
});

/*
* License: Apache-2.0
* Copyright (c) 2011-2014 Novus Partners, Inc
* https://github.com/novus/nvd3
*/
function outerArcTween(a) {
var i = d3.interpolate(this._current, a);
this._current = i(0);
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/slickgrid-utils.js
Expand Up @@ -1523,6 +1523,11 @@ var SlickGridPager = function (dataView, gridContainer, pagingInfo) {
csgCurrentPageDropDown.value('0');
}

/*
* License: MIT
* (c) 2010 Michael Leibman, http://github.com/mleibman/slickgrid
* https://github.com/mleibman/SlickGrid/blob/master/controls/slick.pager.js
*/
function getNavState() {
var pagingInfo = dataView.getPagingInfo();
var lastPage = pagingInfo.totalPages - 1;
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/views/BarChartView.js
Expand Up @@ -2,6 +2,11 @@
* Copyright (c) 2015 Juniper Networks, Inc. All rights reserved.
*/

/*
* License: Apache-2.0
* https://gist.github.com/tyrauber/3350666
*/

define([
'underscore',
'contrail-view'
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/views/FormHierarchicalDropdownView.js
Expand Up @@ -246,6 +246,11 @@ define([
}
}
} else {
/*
* License: GPL-2.0 or Apache-2.0
* Copyright 2012 Igor Vaynberg
* https://github.com/select2/select2/blob/3.5.0/select2.js
*/
process = function(datum, collection) {
var group, attr;
datum = datum[0];
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/views/GridFooterView.js
Expand Up @@ -131,6 +131,11 @@ define([
csgCurrentPageDropDown.value('0');
}

/*
* License: MIT
* (c) 2010 Michael Leibman, http://github.com/mleibman/slickgrid
* https://github.com/mleibman/SlickGrid/blob/master/controls/slick.pager.js
*/
function getNavState() {
var pagingInfo = dataView.getPagingInfo();
var lastPage = pagingInfo.totalPages - 1;
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/views/StackedBarChartWithFocusView.js
Expand Up @@ -390,6 +390,11 @@ define([
yExtent = [0,1];//Default y extent
yAxisMaxValue = 1;
}
/*
* License: MIT
* Copyright 2016 Graham Odds
* http://bl.ocks.org/godds/ec089a2cf3e06a2cd5fc
*/
x.domain(dateExtent);
y.domain(yExtent);
self.barPadding = 2; //Space between the bars
Expand Down
5 changes: 5 additions & 0 deletions webroot/js/views/ZoomScatterChartView.js
Expand Up @@ -335,6 +335,11 @@ define([

destroyTooltip(null);

/*
* License: ISC
* Copyright 2012 Jason Davies https://www.jasondavies.com
* http://bl.ocks.org/jasondavies/3689931
*/
var e = this,
origin = d3.mouse(e),
rect = chartSVG.append("rect").attr("class", "zoom");
Expand Down
5 changes: 5 additions & 0 deletions webroot/test/ui/js/grid/GridView.lib.test.suite.js
Expand Up @@ -12,6 +12,11 @@ define([

var libTestSuiteClass = function (suiteConfig){

/*
* License: MIT
* (c) 2010 Michael Leibman, http://github.com/mleibman/slickgrid
* https://github.com/mleibman/SlickGrid/blob/master/tests/grid/grid.js
*/
var grid;

var ROWS = 500, COLS = 10;
Expand Down

0 comments on commit 2d913ec

Please sign in to comment.