Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsgantt-improved

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsgantt-improved - npm Package Compare versions

Comparing version 2.4.11 to 2.5.0

3

dist/src/draw.js

@@ -250,3 +250,4 @@ "use strict";

draw_utils_1.newNode(vTmpRow_1, 'td', null, 'gtasklist', '\u00A0');
vTmpCell = draw_utils_1.newNode(vTmpRow_1, 'td', null, 'gtaskname');
var editableClass = this_1.vEditable ? 'gtaskname gtaskeditable' : 'gtaskname';
vTmpCell = draw_utils_1.newNode(vTmpRow_1, 'td', null, editableClass);
var vCellContents = '';

@@ -253,0 +254,0 @@ for (var j_1 = 1; j_1 < this_1.vTaskList[i_1].getLevel(); j_1++) {

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (_) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
var task_1 = require("./task");
var general_utils_1 = require("./utils/general_utils");
/**

@@ -9,30 +45,28 @@ *

*/
exports.parseJSON = function (pFile, pGanttVar, vDebug) {
exports.parseJSON = function (pFile, pGanttVar, vDebug, redrawAfter) {
if (vDebug === void 0) { vDebug = false; }
var xhttp;
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
}
else { // IE 5/6
xhttp = new window.ActiveXObject('Microsoft.XMLHTTP');
}
xhttp.open('GET', pFile, false);
xhttp.send(null);
var bd;
if (vDebug) {
bd = new Date();
console.log('before jsonparse', bd);
}
var jsonObj = JSON.parse(xhttp.response);
if (vDebug) {
var ad = new Date();
console.log('after jsonparse', ad, (ad.getTime() - bd.getTime()));
bd = new Date();
}
exports.addJSONTask(pGanttVar, jsonObj);
if (this.vDebug) {
var ad = new Date();
console.log('after addJSONTask', ad, (ad.getTime() - bd.getTime()));
}
return jsonObj;
if (redrawAfter === void 0) { redrawAfter = true; }
return __awaiter(this, void 0, void 0, function () {
var jsonObj, bd, ad;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, general_utils_1.makeRequest(pFile, true, true)];
case 1:
jsonObj = _a.sent();
if (vDebug) {
bd = new Date();
console.log('before jsonparse', bd);
}
exports.addJSONTask(pGanttVar, jsonObj);
if (this.vDebug) {
ad = new Date();
console.log('after addJSONTask', ad, (ad.getTime() - bd.getTime()));
}
if (redrawAfter) {
pGanttVar.Draw();
}
return [2 /*return*/, jsonObj];
}
});
});
};

@@ -39,0 +73,0 @@ exports.parseJSONString = function (pStr, pGanttVar) {

@@ -647,2 +647,65 @@ "use strict";

};
exports.makeRequest = function (pFile, json, vDebug) {
if (json === void 0) { json = true; }
if (vDebug === void 0) { vDebug = false; }
if (window.fetch) {
var f = fetch(pFile);
if (json) {
return f.then(function (res) { return res.json(); });
}
else {
return f;
}
}
else {
return exports.makeRequestOldBrowsers(pFile, vDebug)
.then(function (xhttp) {
if (json) {
var jsonObj = JSON.parse(xhttp.response);
return jsonObj;
}
else {
var xmlDoc = xhttp.responseXML;
return xmlDoc;
}
});
}
};
exports.makeRequestOldBrowsers = function (pFile, vDebug) {
if (vDebug === void 0) { vDebug = false; }
return new Promise(function (resolve, reject) {
var bd;
if (vDebug) {
bd = new Date();
console.log('before jsonparse', bd);
}
var xhttp;
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
}
else { // IE 5/6
xhttp = new window.ActiveXObject('Microsoft.XMLHTTP');
}
xhttp.open('GET', pFile, true);
xhttp.send(null);
xhttp.onload = function (e) {
if (xhttp.readyState === 4) {
if (xhttp.status === 200) {
// resolve(xhttp.responseText);
}
else {
console.error(xhttp.statusText);
}
if (vDebug) {
bd = new Date();
console.log('before jsonparse', bd);
}
resolve(xhttp);
}
};
xhttp.onerror = function (e) {
reject(xhttp.statusText);
};
});
};
//# sourceMappingURL=general_utils.js.map

@@ -6,14 +6,8 @@ "use strict";

var draw_utils_1 = require("./utils/draw_utils");
var general_utils_1 = require("./utils/general_utils");
exports.parseXML = function (pFile, pGanttVar) {
var xhttp;
if (window.XMLHttpRequest) {
xhttp = new window.XMLHttpRequest();
}
else { // IE 5/6
xhttp = new window.ActiveXObject('Microsoft.XMLHTTP');
}
xhttp.open('GET', pFile, false);
xhttp.send(null);
var xmlDoc = xhttp.responseXML;
exports.AddXMLTask(pGanttVar, xmlDoc);
return general_utils_1.makeRequest(pFile, false, false)
.then(function (xmlDoc) {
exports.AddXMLTask(pGanttVar, xmlDoc);
});
};

@@ -63,3 +57,2 @@ exports.parseXMLString = function (pStr, pGanttVar) {

var project = '';
var vMSP = false;
var Task;

@@ -80,3 +73,2 @@ var n = 0;

if (project == 'http://schemas.microsoft.com/project') {
vMSP = true;
pGanttVar.setDateInputFormat('yyyy-mm-dd');

@@ -83,0 +75,0 @@ Task = exports.findXMLNode(pXmlDoc, 'Task');

@@ -112,3 +112,5 @@

This function returns a promise if you would like to do an event after the json is loaded.
The structure of the JSON file:

@@ -115,0 +117,0 @@ ```json

{
"name": "jsgantt-improved",
"version": "2.4.11",
"version": "2.5.0",
"description": "jsgantt-improved",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -18,3 +18,3 @@ [![Build Status](https://travis-ci.com/jsGanttImproved/jsgantt-improved.svg?branch=master)](https://travis-ci.com/jsGanttImproved/jsgantt-improved)

See the [FULL DOCUMENTATION](./docs/Documentation.md) for more details in all features.
See the [FULL DOCUMENTATION](./Documentation.md) for more details in all features.

@@ -21,0 +21,0 @@ For **Angular** use the component [ng-gantt](https://github.com/jsGanttImproved/ng-gantt)

@@ -267,3 +267,4 @@ import * as lang from './lang';

newNode(vTmpRow, 'td', null, 'gtasklist', '\u00A0');
vTmpCell = newNode(vTmpRow, 'td', null, 'gtaskname');
const editableClass = this.vEditable ? 'gtaskname gtaskeditable' : 'gtaskname';
vTmpCell = newNode(vTmpRow, 'td', null, editableClass);

@@ -270,0 +271,0 @@ let vCellContents = '';

import { TaskItem } from "./task";
import { makeRequest } from "./utils/general_utils";

@@ -8,12 +9,4 @@ /**

*/
export const parseJSON = function (pFile, pGanttVar, vDebug = false) {
let xhttp;
if ((<any>window).XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else { // IE 5/6
xhttp = new (<any>window).ActiveXObject('Microsoft.XMLHTTP');
}
xhttp.open('GET', pFile, false);
xhttp.send(null);
export const parseJSON = async function (pFile, pGanttVar, vDebug = false, redrawAfter = true) {
const jsonObj = await makeRequest(pFile, true, true);
let bd;

@@ -24,9 +17,2 @@ if (vDebug) {

}
let jsonObj = JSON.parse(xhttp.response);
if (vDebug) {
const ad = new Date();
console.log('after jsonparse', ad, (ad.getTime() - bd.getTime()));
bd = new Date();
}
addJSONTask(pGanttVar, jsonObj);

@@ -37,2 +23,5 @@ if (this.vDebug) {

}
if(redrawAfter){
pGanttVar.Draw();
}
return jsonObj;

@@ -39,0 +28,0 @@ };

@@ -667,2 +667,65 @@

}
};
};
export const makeRequest = (pFile, json = true, vDebug = false) => {
if ((<any>window).fetch) {
const f = fetch(pFile);
if (json) {
return f.then(res => res.json())
} else {
return f;
}
} else {
return makeRequestOldBrowsers(pFile, vDebug)
.then((xhttp: any) => {
if (json) {
let jsonObj = JSON.parse(xhttp.response);
return jsonObj;
} else {
let xmlDoc = xhttp.responseXML;
return xmlDoc;
}
});
}
};
export const makeRequestOldBrowsers = (pFile, vDebug = false) => {
return new Promise((resolve, reject) => {
let bd;
if (vDebug) {
bd = new Date();
console.log('before jsonparse', bd);
}
let xhttp;
if ((<any>window).XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else { // IE 5/6
xhttp = new (<any>window).ActiveXObject('Microsoft.XMLHTTP');
}
xhttp.open('GET', pFile, true);
xhttp.send(null);
xhttp.onload = function (e) {
if (xhttp.readyState === 4) {
if (xhttp.status === 200) {
// resolve(xhttp.responseText);
} else {
console.error(xhttp.statusText);
}
if (vDebug) {
bd = new Date();
console.log('before jsonparse', bd);
}
resolve(xhttp);
}
};
xhttp.onerror = function (e) {
reject(xhttp.statusText);
};
});
};
import { TaskItem } from "./task";
import { formatDateStr, parseDateFormatStr } from "./utils/date_utils";
import { newNode } from "./utils/draw_utils";
import { makeRequest } from "./utils/general_utils";
export const parseXML = function (pFile, pGanttVar) {
let xhttp;
if ((<any>window).XMLHttpRequest) {
xhttp = new (<any>window).XMLHttpRequest();
} else { // IE 5/6
xhttp = new (<any>window).ActiveXObject('Microsoft.XMLHTTP');
}
xhttp.open('GET', pFile, false);
xhttp.send(null);
let xmlDoc = xhttp.responseXML;
AddXMLTask(pGanttVar, xmlDoc);
return makeRequest(pFile, false, false)
.then(xmlDoc => {
AddXMLTask(pGanttVar, xmlDoc);
});
};

@@ -64,3 +57,2 @@

let project = '';
let vMSP = false;
let Task;

@@ -82,3 +74,2 @@ let n = 0;

if (project == 'http://schemas.microsoft.com/project') {
vMSP = true;
pGanttVar.setDateInputFormat('yyyy-mm-dd');

@@ -85,0 +76,0 @@ Task = findXMLNode(pXmlDoc, 'Task');

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc