Skip to content

Commit f474874

Browse files
author
nicolasbeauvais
committed
Encode text parameters, fix microsoft description parameter
1 parent a987b8d commit f474874

File tree

8 files changed

+46
-30
lines changed

8 files changed

+46
-30
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<a name="1.0.4"></a>
2+
# [1.0.4](https://github.com/nicolasbeauvais/vue-social-sharing/compare/1.0.3...1.0.4) (2017-02-12)
3+
- Encode text parameters, fix microsoft description parameter
4+
15
<a name="1.0.3"></a>
26
# [1.0.3](https://github.com/nicolasbeauvais/vue-social-sharing/compare/1.0.2...1.0.3) (2017-02-11)
37
- Update slot rendering

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-add-to-calendar",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"homepage": "https://github.com/nicolasbeauvais/vue-add-to-calendar",
55
"authors": [
66
"nicolasbeauvais <nicolasbeauvais1@gmail.com>"

dist/vue-add-to-calendar.common.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-add-to-calendar v1.0.3
2+
* vue-add-to-calendar v1.0.4
33
* (c) 2017 nicolasbeauvais
44
* Released under the MIT License.
55
*/
@@ -39,7 +39,7 @@ var calendars = {
3939
return {
4040
summary: title,
4141
location: location,
42-
details: details,
42+
description: details,
4343
dtstart: start,
4444
dtend: end
4545
};
@@ -114,11 +114,11 @@ var AddToCalendar = {
114114
calendarUrl: function calendarUrl (calendar) {
115115
var url = this.calendars[calendar].url;
116116
var parameters = this.calendars[calendar].parameters(
117-
this.title,
118-
this.location,
119-
this.details,
120-
this.formattedDate(this.start),
121-
this.formattedDate(this.end)
117+
this.formatString(this.title),
118+
this.formatString(this.location),
119+
this.formatString(this.details),
120+
this.formatDate(this.start),
121+
this.formatDate(this.end)
122122
);
123123

124124
for (var key in parameters) {
@@ -130,7 +130,11 @@ var AddToCalendar = {
130130
return url;
131131
},
132132

133-
formattedDate: function formattedDate (date) {
133+
formatString: function formatString (string) {
134+
return encodeURIComponent(string).replace(/%20/g, '+');
135+
},
136+
137+
formatDate: function formatDate (date) {
134138
return date ? date.toISOString().replace(/-|:|\.\d+/g, '') : null;
135139
}
136140
},
@@ -154,7 +158,7 @@ var AddToCalendar = {
154158
}
155159
};
156160

157-
AddToCalendar.version = '1.0.3';
161+
AddToCalendar.version = '1.0.4';
158162

159163
AddToCalendar.install = function (Vue) {
160164
Vue.component('add-to-calendar', AddToCalendar);

dist/vue-add-to-calendar.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* vue-add-to-calendar v1.0.3
2+
* vue-add-to-calendar v1.0.4
33
* (c) 2017 nicolasbeauvais
44
* Released under the MIT License.
55
*/
@@ -43,7 +43,7 @@ var calendars = {
4343
return {
4444
summary: title,
4545
location: location,
46-
details: details,
46+
description: details,
4747
dtstart: start,
4848
dtend: end
4949
};
@@ -118,11 +118,11 @@ var AddToCalendar = {
118118
calendarUrl: function calendarUrl (calendar) {
119119
var url = this.calendars[calendar].url;
120120
var parameters = this.calendars[calendar].parameters(
121-
this.title,
122-
this.location,
123-
this.details,
124-
this.formattedDate(this.start),
125-
this.formattedDate(this.end)
121+
this.formatString(this.title),
122+
this.formatString(this.location),
123+
this.formatString(this.details),
124+
this.formatDate(this.start),
125+
this.formatDate(this.end)
126126
);
127127

128128
for (var key in parameters) {
@@ -134,7 +134,11 @@ var AddToCalendar = {
134134
return url;
135135
},
136136

137-
formattedDate: function formattedDate (date) {
137+
formatString: function formatString (string) {
138+
return encodeURIComponent(string).replace(/%20/g, '+');
139+
},
140+
141+
formatDate: function formatDate (date) {
138142
return date ? date.toISOString().replace(/-|:|\.\d+/g, '') : null;
139143
}
140144
},
@@ -158,7 +162,7 @@ var AddToCalendar = {
158162
}
159163
};
160164

161-
AddToCalendar.version = '1.0.3';
165+
AddToCalendar.version = '1.0.4';
162166

163167
AddToCalendar.install = function (Vue) {
164168
Vue.component('add-to-calendar', AddToCalendar);

dist/vue-add-to-calendar.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-add-to-calendar",
33
"description": "A Vue.js component that provides 'Add to Calendar' functionality",
4-
"version": "1.0.3",
4+
"version": "1.0.4",
55
"author": {
66
"name": "nicolasbeauvais",
77
"email": "nicolasbeauvais1@gmail.com"

src/add-to-calendar.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const calendars = {
2424
return {
2525
summary: title,
2626
location: location,
27-
details: details,
27+
description: details,
2828
dtstart: start,
2929
dtend: end
3030
};
@@ -99,11 +99,11 @@ export default {
9999
calendarUrl (calendar) {
100100
let url = this.calendars[calendar].url;
101101
const parameters = this.calendars[calendar].parameters(
102-
this.title,
103-
this.location,
104-
this.details,
105-
this.formattedDate(this.start),
106-
this.formattedDate(this.end)
102+
this.formatString(this.title),
103+
this.formatString(this.location),
104+
this.formatString(this.details),
105+
this.formatDate(this.start),
106+
this.formatDate(this.end)
107107
);
108108

109109
for (const key in parameters) {
@@ -115,7 +115,11 @@ export default {
115115
return url;
116116
},
117117

118-
formattedDate (date) {
118+
formatString (string) {
119+
return encodeURIComponent(string).replace(/%20/g, '+');
120+
},
121+
122+
formatDate (date) {
119123
return date ? date.toISOString().replace(/-|:|\.\d+/g, '') : null;
120124
}
121125
},

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import AddToCalendar from './add-to-calendar';
22

3-
AddToCalendar.version = '1.0.3';
3+
AddToCalendar.version = '1.0.4';
44

55
AddToCalendar.install = (Vue) => {
66
Vue.component('add-to-calendar', AddToCalendar);

0 commit comments

Comments
 (0)