@mornya/react-social-libs
Version:
The project of React.js Social Share and Widget modules.
1 lines • 1.51 kB
JavaScript
var e,n,t=this&&this.__extends||(e=function(n,t){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}))(n,t)},function(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=n}e(n,t),n.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),o=(Object.defineProperty(exports,"__esModule",{value:!0}),require("../utils/BaseShareComponent")),i=require("../utils/UI"),o=(n=o.BaseShareComponent,t(Line,n),Line.prototype.onInit=function(){this.initialize("Line",{message:function(n){return"".concat(n.title,"\n\n").concat(n.description,"\n\n").concat(n.url)}})},Line.prototype.onMount=function(n){this.setApiStep()},Line.prototype.onShare=function(n,t){var e=this,n=null!=(o=null==(o=n.message)?void 0:o.call(n,t))?o:"".concat(t.title,"\n\n").concat(t.description,"\n\n").concat(t.url),o="\n";this.deviceInfo.isIOS&&(n=n.replace(/^https?:\/\//,""),o="\r"),n=n.replace(/\n/g,o).replace(/\r/g,""),(0,i.openShareWindow)(this.mapToParam(Line.LINK_URL,{url:t.url,text:n,from:"line-scheme"}),"line",this.deviceInfo.isMobile?[]:[640,500]).then(function(){return e.onComplete(!0,null)}).catch(function(n){return console.error(n)})},Line.LINK_URL="https://social-plugins.line.me/lineit/share",Line);function Line(){return null!==n&&n.apply(this,arguments)||this}exports.default=o;