Skip to content

Commit f6883ce

Browse files
KoddrKoddr
Koddr
authored and
Koddr
committed
Bug fixes (mobile)
1 parent eea7e51 commit f6883ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+590
-523
lines changed

dist/providers/Baidu.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -22,7 +24,7 @@ var Baidu = function () {
2224
function Baidu() {
2325
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.location.href;
2426
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.title;
25-
var description = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document.head.querySelector("meta[name=description]").content;
27+
var description = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document.querySelector('meta[name=description]').content;
2628

2729
_classCallCheck(this, Baidu);
2830

@@ -34,12 +36,13 @@ var Baidu = function () {
3436
_createClass(Baidu, [{
3537
key: 'shareWindow',
3638
value: function shareWindow() {
39+
var share_elements = document.querySelectorAll('[data-social=baidu]');
3740
var share_url = 'https://cang.baidu.com/do/add?iu=' + this.url + '&it=' + this.title + '&dc=' + this.description + '&fr=ien';
3841

39-
document.body.querySelectorAll("[data-social=baidu]").forEach(function (item) {
42+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
4043
item.addEventListener('click', function (event) {
4144
event.preventDefault();
42-
return window.open(share_url, 'Share window', 'width=400, height=400');
45+
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
4346
});
4447
});
4548
}

dist/providers/Blogger.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -32,12 +34,13 @@ var Blogger = function () {
3234
_createClass(Blogger, [{
3335
key: 'shareWindow',
3436
value: function shareWindow() {
37+
var share_elements = document.querySelectorAll('[data-social=blogger]');
3538
var share_url = 'https://www.blogger.com/blog-this.g?u=' + this.url + '&n=' + this.title;
3639

37-
document.body.querySelectorAll("[data-social=blogger]").forEach(function (item) {
40+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
3841
item.addEventListener('click', function (event) {
3942
event.preventDefault();
40-
return window.open(share_url, 'Share window', 'width=400, height=400');
43+
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
4144
});
4245
});
4346
}

dist/providers/Buffer.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -32,9 +34,10 @@ var Buffer = function () {
3234
_createClass(Buffer, [{
3335
key: 'shareWindow',
3436
value: function shareWindow() {
37+
var share_elements = document.querySelectorAll('[data-social=buffer]');
3538
var share_url = 'https://buffer.com/add?url=' + this.url + '&text=' + this.title;
3639

37-
document.body.querySelectorAll('[data-social=buffer]').forEach(function (item) {
40+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
3841
item.addEventListener('click', function (event) {
3942
event.preventDefault();
4043
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
@@ -45,11 +48,12 @@ var Buffer = function () {
4548
key: 'getCounter',
4649
value: function getCounter() {
4750
var script = document.createElement('script');
48-
var callback = ('cb_' + Math.random()).replace('.', '');
51+
var callback = ('goodshare_' + Math.random()).replace('.', '');
52+
var count_elements = document.querySelectorAll('[data-counter=buffer]');
4953
var count_url = 'https://api.bufferapp.com/1/links/shares.json?url=' + this.url + '&callback=' + callback;
5054

5155
window[callback] = function (counter) {
52-
document.body.querySelectorAll('[data-counter=buffer]').forEach(function (item) {
56+
[].concat(_toConsumableArray(count_elements)).forEach(function (item) {
5357
item.innerHTML = counter.shares ? counter.shares : 0;
5458
});
5559

dist/providers/Delicious.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -32,12 +34,13 @@ var Delicious = function () {
3234
_createClass(Delicious, [{
3335
key: 'shareWindow',
3436
value: function shareWindow() {
37+
var share_elements = document.querySelectorAll('[data-social=delicious]');
3538
var share_url = 'https://del.icio.us/save?url=' + this.url + '&title=' + this.title;
3639

37-
document.body.querySelectorAll("[data-social=delicious]").forEach(function (item) {
40+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
3841
item.addEventListener('click', function (event) {
3942
event.preventDefault();
40-
return window.open(share_url, 'Share window', 'width=400, height=400');
43+
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
4144
});
4245
});
4346
}

dist/providers/Digg.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -32,12 +34,13 @@ var Digg = function () {
3234
_createClass(Digg, [{
3335
key: 'shareWindow',
3436
value: function shareWindow() {
37+
var share_elements = document.querySelectorAll('[data-social=digg]');
3538
var share_url = 'http://digg.com/submit?url=' + this.url + '&title=' + this.title;
3639

37-
document.body.querySelectorAll("[data-social=digg]").forEach(function (item) {
40+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
3841
item.addEventListener('click', function (event) {
3942
event.preventDefault();
40-
return window.open(share_url, 'Share window', 'width=400, height=400');
43+
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
4144
});
4245
});
4346
}

dist/providers/Evernote.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -22,7 +24,7 @@ var Evernote = function () {
2224
function Evernote() {
2325
var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document.location.href;
2426
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.title;
25-
var description = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document.head.querySelector("meta[name=description]").content;
27+
var description = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : document.querySelector('meta[name=description]').content;
2628

2729
_classCallCheck(this, Evernote);
2830

@@ -34,12 +36,13 @@ var Evernote = function () {
3436
_createClass(Evernote, [{
3537
key: 'shareWindow',
3638
value: function shareWindow() {
39+
var share_elements = document.querySelectorAll('[data-social=evernote]');
3740
var share_url = 'https://www.evernote.com/clip.action?url=' + this.url + '&title=' + this.title + '&body=' + this.description;
3841

39-
document.body.querySelectorAll("[data-social=evernote]").forEach(function (item) {
42+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
4043
item.addEventListener('click', function (event) {
4144
event.preventDefault();
42-
return window.open(share_url, 'Share window', 'width=400, height=400');
45+
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
4346
});
4447
});
4548
}

dist/providers/Facebook.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -32,9 +34,10 @@ var Facebook = function () {
3234
_createClass(Facebook, [{
3335
key: 'shareWindow',
3436
value: function shareWindow() {
37+
var share_elements = document.querySelectorAll('[data-social=facebook]');
3538
var share_url = 'https://facebook.com/sharer/sharer.php?u=' + this.url + '&t=' + this.title;
3639

37-
document.body.querySelectorAll('[data-social=facebook]').forEach(function (item) {
40+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
3841
item.addEventListener('click', function (event) {
3942
event.preventDefault();
4043
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
@@ -45,11 +48,12 @@ var Facebook = function () {
4548
key: 'getCounter',
4649
value: function getCounter() {
4750
var script = document.createElement('script');
48-
var callback = ('cb_' + Math.random()).replace('.', '');
51+
var callback = ('goodshare_' + Math.random()).replace('.', '');
52+
var count_elements = document.querySelectorAll('[data-counter=facebook]');
4953
var count_url = 'https://graph.facebook.com/?id=' + this.url + '&callback=' + callback;
5054

5155
window[callback] = function (counter) {
52-
document.body.querySelectorAll('[data-counter=facebook]').forEach(function (item) {
56+
[].concat(_toConsumableArray(count_elements)).forEach(function (item) {
5357
item.innerHTML = counter.share ? counter.share.share_count : 0;
5458
});
5559

dist/providers/GooglePlus.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -30,9 +32,10 @@ var GooglePlus = function () {
3032
_createClass(GooglePlus, [{
3133
key: 'shareWindow',
3234
value: function shareWindow() {
35+
var share_elements = document.querySelectorAll('[data-social=googleplus]');
3336
var share_url = 'https://plus.google.com/share?url=' + this.url;
3437

35-
document.body.querySelectorAll('[data-social=googleplus]').forEach(function (item) {
38+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
3639
item.addEventListener('click', function (event) {
3740
event.preventDefault();
3841
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
@@ -43,12 +46,13 @@ var GooglePlus = function () {
4346
key: 'getCounter',
4447
value: function getCounter() {
4548
var script = document.createElement('script');
46-
var callback = ('cb_' + Math.random()).replace('.', '');
49+
var callback = ('goodshare_' + Math.random()).replace('.', '');
50+
var count_elements = document.querySelectorAll('[data-counter=googleplus]');
4751
var count_url = 'https://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent('select * from html where url="https://plusone.google.com/_/+1/fastbutton?url=' + this.url + '" and xpath="*"') + '&callback=' + callback;
4852

4953
window[callback] = function (counter) {
50-
document.body.querySelectorAll('[data-counter=googleplus]').forEach(function (item) {
51-
item.innerHTML = counter.results[0].match(/javascript">window.__SSR = \{c: (\d+).0/) != null ? counter.results[0].match(/javascript">window.__SSR = \{c: (\d+).0/)[1] / 1 : 0;
54+
[].concat(_toConsumableArray(count_elements)).forEach(function (item) {
55+
item.innerHTML = counter.results[0].match(/javascript">window.__SSR = \{c: (\d+).0/) !== null ? counter.results[0].match(/javascript">window.__SSR = \{c: (\d+).0/)[1] / 1 : 0;
5256
});
5357

5458
script.parentNode.removeChild(script);

dist/providers/Instapaper.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
66

77
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
88

9+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
10+
911
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
1012

1113
/**
@@ -32,12 +34,13 @@ var Instapaper = function () {
3234
_createClass(Instapaper, [{
3335
key: 'shareWindow',
3436
value: function shareWindow() {
37+
var share_elements = document.querySelectorAll('[data-social=instapaper]');
3538
var share_url = 'https://www.instapaper.com/edit?url=' + this.url + '&title=' + this.title;
3639

37-
document.body.querySelectorAll("[data-social=instapaper]").forEach(function (item) {
40+
[].concat(_toConsumableArray(share_elements)).forEach(function (item) {
3841
item.addEventListener('click', function (event) {
3942
event.preventDefault();
40-
return window.open(share_url, 'Share window', 'width=400, height=400');
43+
return window.open(share_url, 'Share this', 'width=640,height=480,location=no,toolbar=no,menubar=no');
4144
});
4245
});
4346
}

0 commit comments

Comments
 (0)