Use global namespace for importers

This commit is contained in:
brantje 2016-10-15 17:05:25 +02:00
parent 8b31278429
commit d5a123abf4
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F
9 changed files with 527 additions and 516 deletions

View file

@ -1,7 +1,7 @@
// Importers should always start with this var PassmanImporter = PassmanImporter || {};
if(!window['PassmanImporter']){ (function(window, $, PassmanImporter) {
var PassmanImporter = {} 'use strict';
}
PassmanImporter.parseRow_ = function(row) { PassmanImporter.parseRow_ = function(row) {
// Strip leading quote. // Strip leading quote.
@ -96,3 +96,4 @@ PassmanImporter.readCsv = function( csv, hasHeadings ){
PassmanImporter.readJson = function (string){ PassmanImporter.readJson = function (string){
return JSON.parse(string); return JSON.parse(string);
}; };
})(window, $, PassmanImporter);

View file

@ -1,8 +1,7 @@
// Importers should always start with this // Importers should always start with this
if (!window['PassmanImporter']) { var PassmanImporter = PassmanImporter || {};
var PassmanImporter = {} (function(window, $, PassmanImporter) {
} 'use strict';
// Define the importer
PassmanImporter.clippers = { PassmanImporter.clippers = {
info: { info: {
name: 'Clipperz.is', name: 'Clipperz.is',
@ -56,3 +55,4 @@ PassmanImporter.clippers.readFile = function (file_data) {
this.call_then(credential_list); this.call_then(credential_list);
}); });
}; };
})(window, $, PassmanImporter);

View file

@ -1,7 +1,7 @@
// Importers should always start with this // Importers should always start with this
if (!window['PassmanImporter']) { var PassmanImporter = PassmanImporter || {};
var PassmanImporter = {} (function(window, $, PassmanImporter) {
} 'use strict';
// Define the importer // Define the importer
PassmanImporter.dashLaneCsv = { PassmanImporter.dashLaneCsv = {
info: { info: {
@ -46,3 +46,4 @@ PassmanImporter.dashLaneCsv.readFile = function (file_data) {
this.call_then(credential_list); this.call_then(credential_list);
}); });
}; };
})(window, $, PassmanImporter);

View file

@ -1,7 +1,7 @@
// Importers should always start with this // Importers should always start with this
if (!window['PassmanImporter']) { var PassmanImporter = PassmanImporter || {};
var PassmanImporter = {} (function(window, $, PassmanImporter) {
} 'use strict';
// Define the importer // Define the importer
PassmanImporter.keepassCsv = { PassmanImporter.keepassCsv = {
info: { info: {
@ -48,3 +48,4 @@ PassmanImporter.keepassCsv.readFile = function (file_data) {
}); });
return p; return p;
}; };
})(window, $, PassmanImporter);

View file

@ -1,7 +1,7 @@
// Importers should always start with this // Importers should always start with this
if (!window['PassmanImporter']) { var PassmanImporter = PassmanImporter || {};
var PassmanImporter = {} (function(window, $, PassmanImporter) {
} 'use strict';
// Define the importer // Define the importer
PassmanImporter.lastpassCsv = { PassmanImporter.lastpassCsv = {
info: { info: {
@ -37,3 +37,4 @@ PassmanImporter.lastpassCsv.readFile = function (file_data) {
this.call_then(credential_list) this.call_then(credential_list)
}); });
}; };
})(window, $, PassmanImporter);

View file

@ -1,8 +1,7 @@
// Importers should always start with this // Importers should always start with this
if (!window['PassmanImporter']) { var PassmanImporter = PassmanImporter || {};
var PassmanImporter = {} (function(window, $, PassmanImporter) {
} 'use strict';
// Define the importer
PassmanImporter.passmanJson = { PassmanImporter.passmanJson = {
info: { info: {
name: 'Passman JSON', name: 'Passman JSON',
@ -68,3 +67,4 @@ PassmanImporter.passmanJson.readFile = function (file_data) {
this.call_then(credential_list); this.call_then(credential_list);
}); });
}; };
})(window, $, PassmanImporter);

View file

@ -1,7 +1,7 @@
// Importers should always start with this // Importers should always start with this
if (!window['PassmanImporter']) { var PassmanImporter = PassmanImporter || {};
var PassmanImporter = {} (function(window, $, PassmanImporter) {
} 'use strict';
// Define the importer // Define the importer
PassmanImporter.passpackCsv = { PassmanImporter.passpackCsv = {
info: { info: {
@ -50,3 +50,4 @@ PassmanImporter.passpackCsv.readFile = function (file_data) {
this.call_then(credential_list); this.call_then(credential_list);
}) })
}; };
})(window, $, PassmanImporter);

View file

@ -1,7 +1,9 @@
// Importers should always start with this // Importers should always start with this
if (!window['PassmanImporter']) { var PassmanImporter = PassmanImporter || {};
var PassmanImporter = {} (function(window, $, PassmanImporter) {
} 'use strict';
// Define the importer
// Define the importer // Define the importer
PassmanImporter.randomData = { PassmanImporter.randomData = {
info: { info: {
@ -92,3 +94,4 @@ PassmanImporter.randomData.readFile = function () {
}); });
}); });
}; };
})(window, $, PassmanImporter);

View file

@ -1,7 +1,9 @@
// Importers should always start with this // Importers should always start with this
if (!window['PassmanImporter']) { var PassmanImporter = PassmanImporter || {};
var PassmanImporter = {}
} (function(window, $, PassmanImporter) {
'use strict';
// Define the importer // Define the importer
PassmanImporter.zohoCsv = { PassmanImporter.zohoCsv = {
info: { info: {
@ -38,3 +40,4 @@ PassmanImporter.zohoCsv.readFile = function (file_data) {
this.call_then(credential_list); this.call_then(credential_list);
}) })
}; };
})(window, $, PassmanImporter);