🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →

vue-add-to-calendar

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-add-to-calendar - npm Package Compare versions

Comparing version

to
1.0.2

@@ -0,1 +1,5 @@

<a name="1.0.2"></a>
# [1.0.2](https://github.com/nicolasbeauvais/vue-social-sharing/compare/1.0.1...1.0.2) (2017-02-11)
- Remove parameters from url when null, refactor parser for more flexibility
<a name="1.0.1"></a>

@@ -2,0 +6,0 @@ # [1.0.1](https://github.com/nicolasbeauvais/vue-social-sharing/compare/1.0.0...1.0.1) (2017-02-11)

/*!
* vue-add-to-calendar v1.0.1
* vue-add-to-calendar v1.0.2
* (c) 2017 nicolasbeauvais

@@ -14,7 +14,29 @@ * Released under the MIT License.

google: {
url: 'http://www.google.com/calendar/event?action=TEMPLATE&trp=false&text=@title&dates=@start/@end&location=@location&details=@details'
url: 'http://www.google.com/calendar/event?action=TEMPLATE&trp=false',
parameters: function parameters (title, location, details, start, end) {
var parameters = {
text: title,
location: location,
details: details,
};
if (start && end) {
parameters.dates = start + "/" + end;
}
return parameters;
}
},
microsoft: {
url: 'http://calendar.live.com/calendar/calendar.aspx?rru=addevent&dtstart=@start&dtend=@end&summary=@title&location=@location'
url: 'http://calendar.live.com/calendar/calendar.aspx?rru=addevent',
parameters: function parameters$1 (title, location, details, start, end) {
return {
summary: title,
location: location,
details: details,
dtstart: start,
dtend: end,
};
}
}

@@ -35,2 +57,20 @@ };

/**
* Event location.
* @var string
*/
location: {
type: String,
default: ''
},
/**
* Event details.
* @var string
*/
details: {
type: String,
default: ''
},
/**
* Event start.

@@ -52,20 +92,2 @@ * @var date

},
/**
* Event location.
* @var string
*/
location: {
type: String,
default: ''
},
/**
* Event details.
* @var string
*/
details: {
type: String,
default: ''
}
},

@@ -90,8 +112,18 @@

calendarUrl: function calendarUrl (calendar) {
return this.calendars[calendar].url
.replace(/@title/g, this.title)
.replace(/@start/g, this.formattedDate(this.start))
.replace(/@end/g, this.formattedDate(this.end))
.replace(/@location/g, this.location)
.replace(/@details/g, this.details);
var url = this.calendars[calendar].url;
var parameters = this.calendars[calendar].parameters(
this.title,
this.location,
this.details,
this.formattedDate(this.start),
this.formattedDate(this.end)
);
for (var key in parameters) {
if (parameters.hasOwnProperty(key) && parameters[key]) {
url += "&" + key + "=" + (parameters[key]);
}
}
return url;
},

@@ -123,3 +155,3 @@

AddToCalendar.version = '1.0.1';
AddToCalendar.version = '1.0.2';

@@ -126,0 +158,0 @@ AddToCalendar.install = function (Vue) {

/*!
* vue-add-to-calendar v1.0.1
* vue-add-to-calendar v1.0.2
* (c) 2017 nicolasbeauvais

@@ -18,7 +18,29 @@ * Released under the MIT License.

google: {
url: 'http://www.google.com/calendar/event?action=TEMPLATE&trp=false&text=@title&dates=@start/@end&location=@location&details=@details'
url: 'http://www.google.com/calendar/event?action=TEMPLATE&trp=false',
parameters: function parameters (title, location, details, start, end) {
var parameters = {
text: title,
location: location,
details: details,
};
if (start && end) {
parameters.dates = start + "/" + end;
}
return parameters;
}
},
microsoft: {
url: 'http://calendar.live.com/calendar/calendar.aspx?rru=addevent&dtstart=@start&dtend=@end&summary=@title&location=@location'
url: 'http://calendar.live.com/calendar/calendar.aspx?rru=addevent',
parameters: function parameters$1 (title, location, details, start, end) {
return {
summary: title,
location: location,
details: details,
dtstart: start,
dtend: end,
};
}
}

@@ -39,2 +61,20 @@ };

/**
* Event location.
* @var string
*/
location: {
type: String,
default: ''
},
/**
* Event details.
* @var string
*/
details: {
type: String,
default: ''
},
/**
* Event start.

@@ -56,20 +96,2 @@ * @var date

},
/**
* Event location.
* @var string
*/
location: {
type: String,
default: ''
},
/**
* Event details.
* @var string
*/
details: {
type: String,
default: ''
}
},

@@ -94,8 +116,18 @@

calendarUrl: function calendarUrl (calendar) {
return this.calendars[calendar].url
.replace(/@title/g, this.title)
.replace(/@start/g, this.formattedDate(this.start))
.replace(/@end/g, this.formattedDate(this.end))
.replace(/@location/g, this.location)
.replace(/@details/g, this.details);
var url = this.calendars[calendar].url;
var parameters = this.calendars[calendar].parameters(
this.title,
this.location,
this.details,
this.formattedDate(this.start),
this.formattedDate(this.end)
);
for (var key in parameters) {
if (parameters.hasOwnProperty(key) && parameters[key]) {
url += "&" + key + "=" + (parameters[key]);
}
}
return url;
},

@@ -127,3 +159,3 @@

AddToCalendar.version = '1.0.1';
AddToCalendar.version = '1.0.2';

@@ -130,0 +162,0 @@ AddToCalendar.install = function (Vue) {

/*!
* vue-add-to-calendar v1.0.1
* vue-add-to-calendar v1.0.2
* (c) 2017 nicolasbeauvais
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueAddToCalendar=e()}(this,function(){"use strict";var t={template:'<a :href="$parent.calendarUrl(calendar)" v-bind:class="`vue-add-to-calendar ${calendar}-calendar`" target="_blank"><slot></slot></a>'},e={google:{url:"http://www.google.com/calendar/event?action=TEMPLATE&trp=false&text=@title&dates=@start/@end&location=@location&details=@details"},microsoft:{url:"http://calendar.live.com/calendar/calendar.aspx?rru=addevent&dtstart=@start&dtend=@end&summary=@title&location=@location"}},a={props:{title:{type:String,default:""},start:{type:Date,default:null},end:{type:Date,default:null},location:{type:String,default:""},details:{type:String,default:""}},data:function(){return{calendars:e}},methods:{calendarUrl:function(t){return this.calendars[t].url.replace(/@title/g,this.title).replace(/@start/g,this.formattedDate(this.start)).replace(/@end/g,this.formattedDate(this.end)).replace(/@location/g,this.location).replace(/@details/g,this.details)},formattedDate:function(t){return t?t.toISOString().replace(/-|:|\.\d+/g,""):null}},mounted:function(){},components:{"google-calendar":{mixins:[t],data:function(){return{calendar:"google"}}},"microsoft-calendar":{mixins:[t],data:function(){return{calendar:"microsoft"}}}}};return a.version="1.0.1",a.install=function(t){t.component("add-to-calendar",a)},"undefined"!=typeof window&&(window.AddToCalendar=a),a});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueAddToCalendar=e()}(this,function(){"use strict";var t={template:'<a :href="$parent.calendarUrl(calendar)" v-bind:class="`vue-add-to-calendar ${calendar}-calendar`" target="_blank"><slot></slot></a>'},e={google:{url:"http://www.google.com/calendar/event?action=TEMPLATE&trp=false",parameters:function t(e,a,n,r,o){var t={text:e,location:a,details:n};return r&&o&&(t.dates=r+"/"+o),t}},microsoft:{url:"http://calendar.live.com/calendar/calendar.aspx?rru=addevent",parameters:function(t,e,a,n,r){return{summary:t,location:e,details:a,dtstart:n,dtend:r}}}},a={props:{title:{type:String,default:""},location:{type:String,default:""},details:{type:String,default:""},start:{type:Date,default:null},end:{type:Date,default:null}},data:function(){return{calendars:e}},methods:{calendarUrl:function(t){var e=this.calendars[t].url,a=this.calendars[t].parameters(this.title,this.location,this.details,this.formattedDate(this.start),this.formattedDate(this.end));for(var n in a)a.hasOwnProperty(n)&&a[n]&&(e+="&"+n+"="+a[n]);return e},formattedDate:function(t){return t?t.toISOString().replace(/-|:|\.\d+/g,""):null}},mounted:function(){},components:{"google-calendar":{mixins:[t],data:function(){return{calendar:"google"}}},"microsoft-calendar":{mixins:[t],data:function(){return{calendar:"microsoft"}}}}};return a.version="1.0.2",a.install=function(t){t.component("add-to-calendar",a)},"undefined"!=typeof window&&(window.AddToCalendar=a),a});
{
"name": "vue-add-to-calendar",
"description": "A Vue.js component that provides 'Add to Calendar' functionality",
"version": "1.0.1",
"version": "1.0.2",
"author": {

@@ -6,0 +6,0 @@ "name": "nicolasbeauvais",

@@ -5,3 +5,2 @@ # vue-add-to-calendar

[![Build Status](https://travis-ci.org/nicolasbeauvais/vue-add-to-calendar.svg?branch=master)](https://travis-ci.org/nicolasbeauvais/vue-add-to-calendar)
[![Build Status](https://img.shields.io/travis/nicolasbeauvais/vue-add-to-calendar.svg?style=flat-square)](https://travis-ci.org/nicolasbeauvais/vue-add-to-calendar)
[![Coverage Status](https://img.shields.io/coveralls/nicolasbeauvais/vue-add-to-calendar/master.svg?style=flat-square)](https://coveralls.io/github/nicolasbeauvais/vue-add-to-calendar?branch=master)

@@ -8,0 +7,0 @@ [![Downloads](https://img.shields.io/npm/dt/vue-add-to-calendar.svg?style=flat-square)](https://www.npmjs.com/package/vue-add-to-calendar)

@@ -5,7 +5,29 @@ import AddToCalendarMixin from './add-to-calendar-mixin';

google: {
url: 'http://www.google.com/calendar/event?action=TEMPLATE&trp=false&text=@title&dates=@start/@end&location=@location&details=@details'
url: 'http://www.google.com/calendar/event?action=TEMPLATE&trp=false',
parameters (title, location, details, start, end) {
let parameters = {
text: title,
location: location,
details: details,
};
if (start && end) {
parameters.dates = `${start}/${end}`;
}
return parameters;
}
},
microsoft: {
url: 'http://calendar.live.com/calendar/calendar.aspx?rru=addevent&dtstart=@start&dtend=@end&summary=@title&location=@location'
url: 'http://calendar.live.com/calendar/calendar.aspx?rru=addevent',
parameters (title, location, details, start, end) {
return {
summary: title,
location: location,
details: details,
dtstart: start,
dtend: end,
};
}
}

@@ -26,2 +48,20 @@ };

/**
* Event location.
* @var string
*/
location: {
type: String,
default: ''
},
/**
* Event details.
* @var string
*/
details: {
type: String,
default: ''
},
/**
* Event start.

@@ -43,20 +83,2 @@ * @var date

},
/**
* Event location.
* @var string
*/
location: {
type: String,
default: ''
},
/**
* Event details.
* @var string
*/
details: {
type: String,
default: ''
}
},

@@ -81,8 +103,18 @@

calendarUrl (calendar) {
return this.calendars[calendar].url
.replace(/@title/g, this.title)
.replace(/@start/g, this.formattedDate(this.start))
.replace(/@end/g, this.formattedDate(this.end))
.replace(/@location/g, this.location)
.replace(/@details/g, this.details);
let url = this.calendars[calendar].url;
let parameters = this.calendars[calendar].parameters(
this.title,
this.location,
this.details,
this.formattedDate(this.start),
this.formattedDate(this.end)
);
for (let key in parameters) {
if (parameters.hasOwnProperty(key) && parameters[key]) {
url += `&${key}=${parameters[key]}`;
}
}
return url;
},

@@ -89,0 +121,0 @@

import AddToCalendar from './add-to-calendar';
AddToCalendar.version = '1.0.1';
AddToCalendar.version = '1.0.2';

@@ -5,0 +5,0 @@ AddToCalendar.install = (Vue) => {