rename n to config

This commit is contained in:
basti76
2018-09-15 20:53:29 +02:00
parent eff710f47b
commit c65a58a7cc

View File

@ -5,9 +5,9 @@ module.exports = function (RED) {
const ICAL = require('ical.js') const ICAL = require('ical.js')
const moment = require('moment') const moment = require('moment')
function NextcloudConfigNode (n) { function NextcloudConfigNode (config) {
RED.nodes.createNode(this, n) RED.nodes.createNode(this, config)
this.address = n.address this.address = config.address
} }
RED.nodes.registerType('nextcloud-credentials', NextcloudConfigNode, { RED.nodes.registerType('nextcloud-credentials', NextcloudConfigNode, {
credentials: { credentials: {
@ -16,12 +16,12 @@ module.exports = function (RED) {
} }
}) })
function NextcloudCalDav (n) { function NextcloudCalDav (config) {
RED.nodes.createNode(this, n) RED.nodes.createNode(this, config)
this.server = RED.nodes.getNode(n.server) this.server = RED.nodes.getNode(config.server)
this.calendar = n.calendar this.calendar = config.calendar
this.pastWeeks = n.pastWeeks || 0 this.pastWeeks = config.pastWeeks || 0
this.futureWeeks = n.futureWeeks || 4 this.futureWeeks = config.futureWeeks || 4
const node = this const node = this
node.on('input', (msg) => { node.on('input', (msg) => {
@ -106,10 +106,10 @@ module.exports = function (RED) {
} }
RED.nodes.registerType('nextcloud-caldav', NextcloudCalDav) RED.nodes.registerType('nextcloud-caldav', NextcloudCalDav)
function NextcloudCardDav (n) { function NextcloudCardDav (config) {
RED.nodes.createNode(this, n) RED.nodes.createNode(this, config)
this.server = RED.nodes.getNode(n.server) this.server = RED.nodes.getNode(config.server)
this.addressBook = n.addressBook this.addressBook = config.addressBook
const node = this const node = this
node.on('input', (msg) => { node.on('input', (msg) => {
@ -161,10 +161,10 @@ module.exports = function (RED) {
} }
RED.nodes.registerType('nextcloud-carddav', NextcloudCardDav) RED.nodes.registerType('nextcloud-carddav', NextcloudCardDav)
function NextcloudWebDavList (n) { function NextcloudWebDavList (config) {
RED.nodes.createNode(this, n) RED.nodes.createNode(this, config)
this.server = RED.nodes.getNode(n.server) this.server = RED.nodes.getNode(config.server)
this.directory = n.directory this.directory = config.directory
const node = this const node = this
node.on('input', (msg) => { node.on('input', (msg) => {
@ -188,10 +188,10 @@ module.exports = function (RED) {
} }
RED.nodes.registerType('nextcloud-webdav-list', NextcloudWebDavList) RED.nodes.registerType('nextcloud-webdav-list', NextcloudWebDavList)
function NextcloudWebDavOut (n) { function NextcloudWebDavOut (config) {
RED.nodes.createNode(this, n) RED.nodes.createNode(this, config)
this.server = RED.nodes.getNode(n.server) this.server = RED.nodes.getNode(config.server)
this.filename = n.filename this.filename = config.filename
const node = this const node = this
node.on('input', (msg) => { node.on('input', (msg) => {
@ -218,11 +218,11 @@ module.exports = function (RED) {
} }
RED.nodes.registerType('nextcloud-webdav-out', NextcloudWebDavOut) RED.nodes.registerType('nextcloud-webdav-out', NextcloudWebDavOut)
function NextcloudWebDavIn (n) { function NextcloudWebDavIn (config) {
RED.nodes.createNode(this, n) RED.nodes.createNode(this, config)
this.server = RED.nodes.getNode(n.server) this.server = RED.nodes.getNode(config.server)
this.directory = n.directory this.directory = config.directory
this.filename = n.filename this.filename = config.filename
const node = this const node = this
node.on('input', (msg) => { node.on('input', (msg) => {