From 96a75e0adef7414fd56cd358055a4124646d32d3 Mon Sep 17 00:00:00 2001 From: Philipp Busse Date: Tue, 2 Dec 2014 00:25:58 +0100 Subject: [PATCH] build: add compatibility for "$.noConflict()" --- build/shariff.complete.js | 2 +- build/shariff.min.js | 6 +++--- demo/jquery-no-conflict.html | 34 ++++++++++++++++++++++++++++++++++ package.json | 2 +- 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 demo/jquery-no-conflict.html diff --git a/build/shariff.complete.js b/build/shariff.complete.js index 792dc64a..04370c32 100644 --- a/build/shariff.complete.js +++ b/build/shariff.complete.js @@ -1,6 +1,6 @@ /* - * shariff - v1.4.4 - 01.12.2014 + * shariff - v1.4.5 - 02.12.2014 * https://github.com/heiseonline/shariff * Copyright (c) 2014 Ines Pauer, Philipp Busse, Sebastian Hilbig, Erich Kramer, Deniz Sesli * Licensed under the MIT license diff --git a/build/shariff.min.js b/build/shariff.min.js index e9305ef6..7c5dccc2 100644 --- a/build/shariff.min.js +++ b/build/shariff.min.js @@ -1,6 +1,6 @@ /* - * shariff - v1.4.4 - 01.12.2014 + * shariff - v1.4.5 - 02.12.2014 * https://github.com/heiseonline/shariff * Copyright (c) 2014 Ines Pauer, Philipp Busse, Sebastian Hilbig, Erich Kramer, Deniz Sesli * Licensed under the MIT license @@ -17,12 +17,12 @@ "use strict";module.exports=function(e){return{popup:!1,shareText:"mail",name:"mail",title:{de:"Per E-Mail versenden",en:"Send by email"},shareUrl:e.getURL()+"?view=mail"}}; },{}],5:[function(require,module,exports){ (function (global){ -"use strict";var $=(typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null);module.exports=function(e){return{popup:!0,shareText:"tweet",name:"twitter",title:{de:"Bei Twitter teilen",en:"Share on Twitter"},shareUrl:"https://twitter.com/intent/tweet?text="+e.getShareText()+"&url="+e.getURL()+e.getReferrerTrack()}}; +"use strict";var $=(typeof window !== "undefined" ? window.jQuery : typeof global !== "undefined" ? global.jQuery : null);module.exports=function(e){return{popup:!0,shareText:"tweet",name:"twitter",title:{de:"Bei Twitter teilen",en:"Share on Twitter"},shareUrl:"https://twitter.com/intent/tweet?text="+e.getShareText()+"&url="+e.getURL()+e.getReferrerTrack()}}; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],6:[function(require,module,exports){ "use strict";module.exports=function(e){return{popup:!1,shareText:"WhatsApp",name:"whatsapp",title:{de:"Bei Whatsapp teilen",en:"Share on Whatsapp"},shareUrl:"whatsapp://send?text="+e.getShareText()+"%20"+e.getURL()+e.getReferrerTrack()}}; },{}],7:[function(require,module,exports){ (function (global){ -"use strict";var $=(typeof window !== "undefined" ? window.$ : typeof global !== "undefined" ? global.$ : null),_Shariff=function(t,e){var r=this;this.element=t,this.options=$.extend({},this.defaults,e,$(t).data());var n=[require("./services/facebook"),require("./services/googleplus"),require("./services/twitter"),require("./services/whatsapp"),require("./services/mail"),require("./services/info")];this.services=$.map(this.options.services,function(t){var e;return n.forEach(function(n){return n=n(r),n.name===t?(e=n,null):void 0}),e}),this._addButtonList(),null!==this.options.backendUrl&&this.getShares().then($.proxy(this._updateCounts,this))};_Shariff.prototype={defaults:{theme:"color",backendUrl:null,infoUrl:"http://ct.de/-2467514",lang:"de",orientation:"horizontal",referrerTrack:null,services:["twitter","facebook","googleplus","info"],url:function(){var t=global.document.location.href,e=$("link[rel=canonical]").attr("href")||this.getMeta("og:url")||"";return e.length>0&&(e.indexOf("http")<0&&(e=global.document.location.protocol+"//"+global.document.location.host+e),t=e),t}},$socialshareElement:function(){return $(this.element)},getLocalized:function(t,e){return"object"==typeof t[e]?t[e][this.options.lang]:"string"==typeof t[e]?t[e]:void 0},getMeta:function(t){var e=$('meta[name="'+t+'"],[property="'+t+'"]').attr("content");return e||""},getInfoUrl:function(){return this.options.infoUrl},getURL:function(){var t=this.options.url;return"function"==typeof t?$.proxy(t,this)():t},getReferrerTrack:function(){return this.options.referrerTrack||""},getShares:function(){return $.getJSON(this.options.backendUrl+"?url="+encodeURIComponent(this.getURL()))},_updateCounts:function(t){var e=this;$.each(t,function(t,r){r>=1e3&&(r=Math.round(r/1e3)+"k"),$(e.element).find("."+t+" a").append('