Reindent code by 2 spaces, instead of 4
This commit is contained in:
@ -1,28 +1,27 @@
|
||||
var fs = require('fs');
|
||||
module.exports = {
|
||||
loadFileToContainer: function (path, window, containerTagName, options) {
|
||||
var contents = fs.readFileSync(path),
|
||||
container = window.document.createElement(containerTagName);
|
||||
options = options || {};
|
||||
container.innerHTML = contents;
|
||||
loadFileToContainer: function (path, window, containerTagName, options) {
|
||||
var contents = fs.readFileSync(path),
|
||||
container = window.document.createElement(containerTagName);
|
||||
options = options || {};
|
||||
container.innerHTML = contents;
|
||||
|
||||
if (options.type) {
|
||||
container.type = options.type;
|
||||
}
|
||||
if (options.id) {
|
||||
container.id = options.id;
|
||||
}
|
||||
global.window.document.body.appendChild(container);
|
||||
},
|
||||
loadScript: function (scriptPath, window, options) {
|
||||
this.loadFileToContainer(scriptPath, window, 'script', options);
|
||||
},
|
||||
loadTemplate: function (path, window, options) {
|
||||
var w = window || global.window;
|
||||
options = options || {};
|
||||
options.type = "text/x-handlebars-template";
|
||||
if (options.type) {
|
||||
container.type = options.type;
|
||||
}
|
||||
if (options.id) {
|
||||
container.id = options.id;
|
||||
}
|
||||
global.window.document.body.appendChild(container);
|
||||
},
|
||||
loadScript: function (scriptPath, window, options) {
|
||||
this.loadFileToContainer(scriptPath, window, 'script', options);
|
||||
},
|
||||
loadTemplate: function (path, window, options) {
|
||||
var w = window || global.window;
|
||||
options = options || {};
|
||||
options.type = "text/x-handlebars-template";
|
||||
|
||||
this.loadScript("views/newsletter/templates/" + path, w, options);
|
||||
},
|
||||
this.loadScript("views/newsletter/templates/" + path, w, options);
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user