@mornya/react-social-libs
Version:
The project of React.js Social Share and Widget modules.
1 lines • 1.57 kB
JavaScript
var o,t,e=this&&this.__extends||(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}))(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}),n=(Object.defineProperty(exports,"__esModule",{value:!0}),require("../utils/BaseShareComponent")),n=(t=n.BaseShareComponent,e(SMS,t),SMS.prototype.onInit=function(){this.initialize("SMS",{message:function(t){return""},target:""})},SMS.prototype.onMount=function(t){this.setApiStep()},SMS.prototype.onShare=function(t,e){var o=this,n=(null==(n=t.message)?void 0:n.call(t,e))||e.title+"\n\n"+"".concat(e.description).concat(this.getHashtag(t.hashtags,"\n"))+"\n\n"+e.url,e=this.deviceInfo.isMobile?this.deviceInfo.isAOS?this.mapToParam("".concat(SMS.LINK_URL.sms,"//"),{body:n}):this.deviceInfo.isIOS?this.mapToParam("".concat(SMS.LINK_URL.sms).concat(t.target),{"&body":n}):this.mapToParam(SMS.LINK_URL.sms,{text:n}):"MAC"===this.deviceInfo.OS.vendor?this.mapToParam("".concat(SMS.LINK_URL.iMessage).concat(t.target),{"&body":n}):this.mapToParam(SMS.LINK_URL.sms,{text:n});window.location.href=e,setTimeout(function(){return o.onComplete(!0,null)},1e3)},SMS.LINK_URL={sms:"sms:",iMessage:"imessage:"},SMS);function SMS(){return null!==t&&t.apply(this,arguments)||this}exports.default=n;