1/*! hideshare - v0.1.0 - 2013-09-11 2* https://github.com/arnonate/jQuery-FASS-Widget 3* Copyright (c) 2013 Nate Arnold; Licensed MIT */ 4/* ======================================================================== 5 * HIDESHARE v1.0.0 6 * https://github.com/arnonate/hideshare 7 * ======================================================================== 8 9 Copyright (c) 2013 Nate Arnold 10 11 Permission is hereby granted, free of charge, to any person 12 obtaining a copy of this software and associated documentation 13 files (the "Software"), to deal in the Software without 14 restriction, including without limitation the rights to use, 15 copy, modify, merge, publish, distribute, sublicense, and/or sell 16 copies of the Software, and to permit persons to whom the 17 Software is furnished to do so, subject to the following 18 conditions: 19 20 The above copyright notice and this permission notice shall be 21 included in all copies or substantial portions of the Software. 22 23 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 25 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 27 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 28 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 29 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 30 OTHER DEALINGS IN THE SOFTWARE. 31 */ 32 33/*global jQuery:false, window:false, document:false */ 34 35; (function (window, $) { 36 37 "use strict"; 38 39 // HIDESHARE PUBLIC CLASS DEFINITION 40 // ================================= 41 42 var descriptionText = null; 43 44 $.each($(document).find('meta[name="description"]'), function (idx, item) { 45 descriptionText = $(item).attr("content"); 46 }); 47 48 49 50 51 var Hideshare = function (elem, options) { 52 this.elem = elem; 53 this.$elem = $(elem); 54 this.options = options; 55 }; 56 57 Hideshare.prototype = { 58 defaults: { 59 link: document.URL, 60 title: document.title, 61 description: descriptionText, // description: $("meta[name='description']").attr("content"), this also work 62 media: null, 63 facebook: true, 64 twitter: true, 65 pinterest: true, 66 googleplus: true, 67 linkedin: true, 68 whatsapp: true, 69 mail: true, 70 //position: "bottom", 71 //speed: 100 72 73 }, 74 75 init: function () { 76 this.config = $.extend({}, this.defaults, this.options); 77 this.wrapHideshare(); 78 return this; 79 }, 80 81 wrapHideshare: function () { 82 var output = output, 83 width = this.$elem.outerWidth(), 84 height = this.$elem.outerHeight(), 85 liWidth = 0, 86 placement = this.config.position, 87 transition = this.config.speed, 88 shareTitle = this.config.title, 89 shareLink = this.config.link, 90 shareMedia = this.config.media, 91 shareDescription = this.config.description, 92 facebookTemplate = '', 93 twitterTemplate = '', 94 pinterestTemplate = '', 95 googleplusTemplate = '', 96 linkedinTemplate = '', 97 whatsappTemplate = '', 98 mailTemplate = ''; 99 100 // Construct sharing list 101 var hideshareList = ''; 102 103 // Wrap button 104 this.$elem.addClass("").wrap("<div class='hideshare-wrap'/>"); 105 this.$wrap = this.$elem.parent(); 106 107 // Insert sharing button list 108 $(hideshareList).insertAfter(this.$elem); 109 110 // SHARING FUNCTIONS 111 //var shareFacebook = function () { 112 // window.open('//www.facebook.com/share.php?m2w&s=100&p[url]=' + encodeURIComponent(shareLink) + '&p[images][0]=' + encodeURIComponent(shareMedia) + '&p[title]=' + encodeURIComponent(shareTitle) + '&p[summary]=' + encodeURIComponent(shareDescription), 'Facebook', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); 113 //}; 114 var shareFacebook = function () { 115 window.open('//www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(shareLink) + '&p[images][0]=' + encodeURIComponent(shareMedia) + '&p[title]=' + encodeURIComponent(shareTitle) + '&p[summary]=' + encodeURIComponent(shareDescription), 'Facebook', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); 116 }; 117 118 var shareTwitter = function () { 119 window.open('https://twitter.com/intent/tweet?original_referer=' + encodeURIComponent(shareLink) + '&text=' + encodeURIComponent(shareTitle) + '%20' + encodeURIComponent(shareLink), 'Twitter', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); 120 }; 121 122 var sharePinterest = function () { 123 window.open('//pinterest.com/pin/create/button/?url=' + encodeURIComponent(shareLink) + '&media=' + encodeURIComponent(shareMedia) + '&description=' + encodeURIComponent(shareDescription), 'Pinterest', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); 124 }; 125 var shareGooglePlus = function () { 126 window.open('//plus.google.com/share?url=' + encodeURIComponent(shareLink), 'GooglePlus', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); 127 }; 128 var shareLinkedIn = function () { 129 window.open('//www.linkedin.com/shareArticle?mini=true&url=' + encodeURIComponent(shareLink) + '&title=' + encodeURIComponent(shareTitle) + '&summary=' + encodeURIComponent(shareDescription) + '&source=' + encodeURIComponent(shareLink), 'LinkedIn', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600'); 130 }; 131 132 var shareWhatsApp = function () { 133 window.open('whatsapp://send?text=' + encodeURIComponent(shareTitle) + '%0A%0A' + encodeURIComponent(shareDescription) + '%0A%0A' + encodeURIComponent(shareLink), 'WhatsApp'); 134 }; 135 136 var shareMail = function () { 137 window.open('mailto:?subject=' + encodeURIComponent(shareTitle) + '&body=' + encodeURIComponent(shareTitle) + '%0A%0A' + encodeURIComponent(shareLink) + '%0A%0A' + encodeURIComponent(shareDescription), 'Mail'); 138 }; 139 140 141 142 this.$wrap.find(".hideshare-facebook").click(function () { 143 shareFacebook(); 144 return false; 145 }); 146 147 this.$wrap.find(".hideshare-twitter").click(function () { 148 shareTwitter(); 149 return false; 150 }); 151 152 this.$wrap.find(".hideshare-pinterest").click(function () { 153 sharePinterest(); 154 return false; 155 }); 156 157 this.$wrap.find(".hideshare-google-plus").click(function () { 158 shareGooglePlus(); 159 return false; 160 }); 161 162 this.$wrap.find(".hideshare-linkedin").click(function () { 163 shareLinkedIn(); 164 return false; 165 }); 166 167 this.$wrap.find(".hideshare-whatsapp").click(function () { 168 shareWhatsApp(); 169 return false; 170 }); 171 172 this.$wrap.find(".hideshare-mail").click(function () { 173 shareMail(); 174 return false; 175 }); 176 177 } 178 }; 179 180 Hideshare.defaults = Hideshare.prototype.defaults; 181 182 $.fn.hideshare = function (options) { 183 return this.each(function () { 184 new Hideshare(this, options).init(); 185 }); 186 }; 187 188 window.Hideshare = Hideshare; 189 190})(window, jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.