Skip to content

Commit

Permalink
Merge pull request #7 from vbanos/drop-jquery
Browse files Browse the repository at this point in the history
Drop jQuery
  • Loading branch information
eagle19243 committed Dec 10, 2017
2 parents 77392e8 + 2d808d7 commit ad4933e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 61 deletions.
27 changes: 14 additions & 13 deletions build/js/radial-tree.min.js

Large diffs are not rendered by default.

16 changes: 1 addition & 15 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,7 @@ banner = [
' * (c) 2017 - <%= author %>',
' * =============================================================',
' */\n\n'
].join('\n'),
umdDeps = {
dependencies: function() {
return [
{
name: '$',
amd: 'jquery',
cjs: 'jquery',
global: 'jQuery',
param: '$'
}
];
}
};
].join('\n');

var onError = function (err) {
$.util.beep();
Expand Down Expand Up @@ -63,7 +50,6 @@ return gulp.src([jsDir + '*.js'])
.pipe(browserify())
.pipe($.plumber({ errorHandler: onError }))
// .pipe(gulp.dest(distDir + "/js")) //
.pipe($.umd(umdDeps))
.pipe($.header(banner, meta))
.pipe($.rename(meta.name + '.js'))
// .pipe(gulp.dest(distDir + "/js"))
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
},
"homepage": "https://github.com/internetarchive/wayback-radial-tree#readme",
"dependencies": {
"d3": "^4.12.0",
"jquery": "^3.2.1"
"d3": "^4.12.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",
"browserify": "^14.5.0",
"browserify-gulp": "^1.0.0",
Expand Down
37 changes: 6 additions & 31 deletions src/js/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import $ from 'jquery';
import * as d3 from 'd3';

var pluginName = "radialtree";
/**
* Radial Tree Library
*
* @param {DOMElement} element
* @param {Object} option
* Option baseURL defines the target Wayback Machine server.
* Option indicatorImg defines the graphic to display while loading data from
* the Wayback Machine. If undefined, no loading graphic is displayed.
*/
function RadialTree(element, option){
this.element = element;
this.option = option;
import 'babel-polyfill';
import * as d3 from 'd3';


export function RadialTree(element, option){
var GlobYear = 0;
var baseURL = 'https://web.archive.org';
var indicatorImg;
Expand Down Expand Up @@ -415,27 +414,3 @@ function RadialTree(element, option){
return text;
}
}

/**
* Show Radial Tree element
*/
RadialTree.prototype.show = function(){
this.element.style.display = "block";
};

/**
* Hide Radial Tree element
*/
RadialTree.prototype.hide = function(){
this.element.style.display = "none";
};

$.fn[pluginName] = function(options){
this.each(function(){
if (!$.data(this, pluginName)){
$.data(this, pluginName, new RadialTree(this, options));
}
});

return this;
};

0 comments on commit ad4933e

Please sign in to comment.