[TASK] Remove local storage test

This commit is contained in:
Xaver Maierhofer 2017-02-12 01:39:13 +01:00 committed by Geno
parent cd60af97c8
commit df9facb3f6
2 changed files with 12 additions and 29 deletions

View File

@ -38,10 +38,6 @@ define(['d3', 'helper'], function (d3, helper) {
} }
function savePositions() { function savePositions() {
if (!helper.localStorageTest()) {
return;
}
var save = intNodes.map(function (d) { var save = intNodes.map(function (d) {
return { id: d.o.id, x: d.x, y: d.y }; return { id: d.o.id, x: d.x, y: d.y };
}); });
@ -721,7 +717,6 @@ define(['d3', 'helper'], function (d3, helper) {
return !d.o.node; return !d.o.node;
}); });
if (helper.localStorageTest()) {
var save = JSON.parse(localStorage.getItem('graph/nodeposition')); var save = JSON.parse(localStorage.getItem('graph/nodeposition'));
if (save) { if (save) {
@ -737,7 +732,6 @@ define(['d3', 'helper'], function (d3, helper) {
} }
}); });
} }
}
var diameter = graphDiameter(intNodes); var diameter = graphDiameter(intNodes);

View File

@ -66,17 +66,6 @@ define({
return this.dictGet(dict[k], key); return this.dictGet(dict[k], key);
}, },
localStorageTest: function localStorageTest() {
var test = 'test';
try {
localStorage.setItem(test, test);
localStorage.removeItem(test);
return true;
} catch (e) {
return false;
}
},
listReplace: function listReplace(s, subst) { listReplace: function listReplace(s, subst) {
for (var key in subst) { for (var key in subst) {
var re = new RegExp(key, 'g'); var re = new RegExp(key, 'g');