|
1 | 1 | /*
|
2 | 2 | * angular-socialshare
|
3 |
| - * 2.1.11 |
| 3 | + * 2.1.12 |
4 | 4 | *
|
5 |
| - * A social media url and content share directive for angularjs. |
| 5 | + * A social media url and content share module for angularjs. |
6 | 6 | * http://720kb.githb.io/angular-socialshare
|
7 | 7 | *
|
8 | 8 | * MIT license
|
9 |
| - * Thu Jun 09 2016 |
10 |
| - */ |
11 |
| -/* |
12 |
| - * angular-socialshare |
13 |
| - * @latest |
14 |
| - * |
15 |
| - * A social urls and content sharing directive for angularjs. |
16 |
| - * http://720kb.githb.io/angular-socialshare |
17 |
| - * |
18 |
| - * MIT license |
19 |
| - * Thu Feb 04 2016 |
| 9 | + * Fri Jun 10 2016 |
20 | 10 | */
|
21 | 11 | /*global angular*/
|
22 | 12 | /*eslint no-loop-func:0, func-names:0*/
|
|
331 | 321 | configElement.conf[aConfigurationKey] = configuration[configIndex].conf[aConfigurationKey];
|
332 | 322 | }
|
333 | 323 | }
|
| 324 | + |
| 325 | + // once the provider has been found and configuration applied |
| 326 | + // we should reset the internIndex for the next provider match to work correctly |
| 327 | + // and break, to skip loops on unwanted next providers |
| 328 | + internIndex = 0; |
| 329 | + break; |
334 | 330 | }
|
335 | 331 | }
|
336 | 332 | } else {
|
|
500 | 496 |
|
501 | 497 | $window.open(
|
502 | 498 | urlString,
|
503 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 499 | + 'Facebook', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
504 | 500 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
505 | 501 |
|
506 | 502 | } else if (attrs.socialshareType && attrs.socialshareType === 'send') {
|
|
533 | 529 |
|
534 | 530 | $window.open(
|
535 | 531 | urlString,
|
536 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 532 | + 'Facebook', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
537 | 533 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
538 | 534 |
|
539 | 535 | } else {
|
540 | 536 | //otherwise default to using sharer.php
|
541 | 537 | $window.open(
|
542 | 538 | 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl())
|
543 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 539 | + , 'Facebook', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
544 | 540 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
545 | 541 | }
|
546 | 542 | }
|
|
570 | 566 |
|
571 | 567 | $window.open(
|
572 | 568 | urlString,
|
573 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 569 | + 'Twitter', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
574 | 570 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
575 | 571 | }
|
576 | 572 | , manageGooglePlusShare = function manageGooglePlusShare($window, $location, attrs) {
|
577 | 573 |
|
578 | 574 | $window.open(
|
579 | 575 | 'https://plus.google.com/share?url=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl())
|
580 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 576 | + , 'Google+', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
581 | 577 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
582 | 578 | }
|
583 | 579 | , manageRedditShare = function manageRedditShare($window, $location, attrs) {
|
|
603 | 599 |
|
604 | 600 | $window.open(
|
605 | 601 | urlString + encodeURIComponent(attrs.socialshareUrl || $location.absUrl()) + '&title=' + encodeURIComponent(attrs.socialshareText)
|
606 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 602 | + , 'Reddit', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
607 | 603 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
608 | 604 | }
|
609 | 605 | , manageStumbleuponShare = function manageStumbleuponShare($window, $location, attrs) {
|
610 | 606 |
|
611 | 607 | $window.open(
|
612 | 608 | 'https://www.stumbleupon.com/submit?url=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl()) + '&title=' + encodeURIComponent(attrs.socialshareText)
|
613 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 609 | + , 'StumbleUpon', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
614 | 610 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
615 | 611 | }
|
616 | 612 | , manageLinkedinShare = function manageLinkedinShare($window, $location, attrs) {
|
|
636 | 632 |
|
637 | 633 | $window.open(
|
638 | 634 | urlString,
|
639 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 635 | + 'Linkedin', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
640 | 636 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
641 | 637 | }
|
642 | 638 | , managePinterestShare = function managePinterestShare($window, $location, attrs) {
|
643 | 639 |
|
644 | 640 | $window.open(
|
645 | 641 | 'https://www.pinterest.com/pin/create/button/?url=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl()) + '&media=' + encodeURIComponent(attrs.socialshareMedia) + '&description=' + encodeURIComponent(attrs.socialshareText)
|
646 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 642 | + , 'Pinterest', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
647 | 643 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
648 | 644 | }
|
649 | 645 | , manageDiggShare = function manageDiggShare($window, $location, attrs) {
|
650 | 646 |
|
651 | 647 | $window.open(
|
652 | 648 | 'https://www.digg.com/submit?url=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl()) + '&title=' + encodeURIComponent(attrs.socialshareText)
|
653 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 649 | + , 'Digg', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
654 | 650 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
655 | 651 | }
|
656 | 652 | , manageTumblrShare = function manageTumblrShare($window, $location, attrs) {
|
|
664 | 660 |
|
665 | 661 | $window.open(
|
666 | 662 | urlString,
|
667 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 663 | + 'Tumblr', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
668 | 664 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
669 | 665 | } else {
|
670 | 666 |
|
671 | 667 | $window.open(
|
672 | 668 | 'https://www.tumblr.com/share/link?url=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl()) + '&description=' + encodeURIComponent(attrs.socialshareText)
|
673 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 669 | + , 'Tumblr', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
674 | 670 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
675 | 671 | }
|
676 | 672 | }
|
|
691 | 687 |
|
692 | 688 | $window.open(
|
693 | 689 | urlString
|
694 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 690 | + , 'Vk', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
695 | 691 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
696 | 692 | }
|
697 | 693 | , manageOkShare = function manageOkShare($window, $location, attrs) {
|
698 | 694 | $window.open(
|
699 | 695 | 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl()) + '&st.comments=' + encodeURIComponent(attrs.socialshareText)
|
700 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 696 | + , 'Ok', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
701 | 697 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
702 | 698 | }
|
703 | 699 | , manageDeliciousShare = function manageDeliciousShare($window, $location, attrs) {
|
704 | 700 |
|
705 | 701 | $window.open(
|
706 | 702 | 'https://www.delicious.com/save?v=5&noui&jump=close&url=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl()) + '&title=' + encodeURIComponent(attrs.socialshareText)
|
707 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 703 | + , 'Delicious', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
708 | 704 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
709 | 705 | }
|
710 | 706 | , manageBufferShare = function manageBufferShare($window, $location, attrs) {
|
|
723 | 719 |
|
724 | 720 | $window.open(
|
725 | 721 | urlString,
|
726 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 722 | + 'Buffer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
727 | 723 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
728 | 724 | }
|
729 | 725 | , manageHackernewsShare = function manageHackernewsShare($window, $location, attrs) {
|
|
737 | 733 |
|
738 | 734 | $window.open(
|
739 | 735 | urlString,
|
740 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 736 | + 'Hackernews', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
741 | 737 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
742 | 738 | }
|
743 | 739 | , manageFlipboardShare = function manageFlipboardShare($window, $location, attrs) {
|
|
752 | 748 |
|
753 | 749 | $window.open(
|
754 | 750 | urlString,
|
755 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 751 | + 'Flipboard', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
756 | 752 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
757 | 753 | }
|
758 | 754 | , managePocketShare = function managePocketShare($window, $location, attrs) {
|
|
767 | 763 |
|
768 | 764 | $window.open(
|
769 | 765 | urlString,
|
770 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 766 | + 'Pocket', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
771 | 767 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
772 | 768 | }
|
773 | 769 | , manageWordpressShare = function manageWordpressShare($window, $location, attrs) {
|
|
785 | 781 |
|
786 | 782 | $window.open(
|
787 | 783 | urlString,
|
788 |
| - 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 784 | + 'Wordpress', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
789 | 785 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
790 | 786 | }
|
791 | 787 | , manageXingShare = function manageXingShare($window, $location, attrs) {
|
|
796 | 792 | }
|
797 | 793 | $window.open(
|
798 | 794 | 'https://www.xing.com/spi/shares/new?url=' + encodeURIComponent(attrs.socialshareUrl || $location.absUrl()) + followUrl
|
799 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 795 | + , 'Xing', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
800 | 796 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
801 | 797 | }
|
802 | 798 | , manageEvernoteShare = function manageEvernoteShare($window, $location, attrs) {
|
|
809 | 805 |
|
810 | 806 | $window.open(
|
811 | 807 | urlString
|
812 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 808 | + , 'Evernote', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
813 | 809 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
814 | 810 | }
|
815 | 811 | , manageWhatsappShare = function manageWhatsappShare($window, $location, attrs, element) {
|
|
834 | 830 |
|
835 | 831 | $window.open(
|
836 | 832 | urlString
|
837 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 833 | + , 'Telegram', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
838 | 834 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
839 | 835 | }
|
840 | 836 | , skypeShare = function skypeShare($window, $location, attrs) {
|
|
846 | 842 |
|
847 | 843 | $window.open(
|
848 | 844 | urlString
|
849 |
| - , 'sharer', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
| 845 | + , 'Skype', 'toolbar=0,status=0,resizable=yes,width=' + attrs.socialsharePopupWidth + ',height=' + attrs.socialsharePopupHeight |
850 | 846 | + ',top=' + ($window.innerHeight - attrs.socialsharePopupHeight) / 2 + ',left=' + ($window.innerWidth - attrs.socialsharePopupWidth) / 2);
|
851 | 847 | }
|
852 | 848 | , sharingFunctions = {
|
|
0 commit comments