if (typeof itsmo == 'undefined') { var itsmo = {}; } if (typeof itsmo.special === 'undefined') { itsmo.special = {}; } itsmo.special.wrestling = {}; itsmo.special.wrestling.fbShareSP = function (title, url) { title = encodeURIComponent(title); url = encodeURI(url); var app_id = 'app_id=' + '268920203204669' + '&'; var redirect_uri = 'redirect_uri=' + getBaseURL() + '/c/close_popup.php&'; var display = 'display=touch&'; var _link = 'link=' + url + '&'; var name = 'name=' + title + '&'; var description = 'description=' + url + '&'; var picture = '&picture=https://www.its-mo.com/design/img/smart/bookmark.png&'; var sdk = 'sdk=joey'; var https = 'https://m.facebook.com/dialog/feed?' + app_id + redirect_uri + picture + name + description + _link + display + sdk; wind = window.open(https, "_blank", "width=450, height=450"); wind.onBeforeUnload = function () { window.close(); }; }; itsmo.special.wrestling.fbSharePC = function (title, url) { title = encodeURIComponent(title); url = encodeURI(url); var app_id = 'app_id=' + '268920203204669' + '&'; var redirect_uri = 'redirect_uri=https://facebook.com&'; var display = 'display=page&'; var _link = 'link=' + url + '&'; var name = 'name=' + title + '&'; var description = 'description=' + url + '&'; var picture = '&picture=https://www.its-mo.com/design/img/smart/bookmark.png&'; var sdk = 'sdk=joey'; var https = 'https://facebook.com/dialog/feed?' + app_id + redirect_uri + picture + name + description + _link + display + sdk; window.open(https); }; itsmo.special.wrestling.twitterShare = function (title, url) { var href = 'http://twitter.com/share?text='; title = encodeURIComponent(title); url = encodeURI(url); href += title + '%0a' + url; var width = 575, height = 400, left = ($(window).width() - width) / 2, top = ($(window).height() - height) / 2, opts = 'status=1' + ',width=' + width + ',height=' + height + ',top=' + top + ',left=' + left; window.open(href, 'twitter', opts); }; itsmo.special.wrestling.lineShare = function (title, url) { var href = 'http://line.naver.jp/R/msg/text/?'; title = encodeURIComponent(title); url = encodeURI(url); href += title + '%0a' + url; window.open(href); }; function getBaseURL() { // entire url including querystring - also: window.location.href; var url = location.href; var baseURL = url.substring(0, url.indexOf('/', 14)); if (baseURL.indexOf('http://localhost') != -1) { // Base Url for localhost var url = location.href; // window.location.href; var pathname = location.pathname; // window.location.pathname; var index1 = url.indexOf(pathname); var index2 = url.indexOf("/", index1 + 1); var baseLocalUrl = url.substr(0, index2); return baseLocalUrl + ""; } else { // Root Url for domain name return baseURL + ""; } }