function LoadFBSDk () { /* (function (d) { var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0]; if (d.getElementById(id)) { return; } js = d.createElement('script'); js.id = id; js.async = true; js.src = "//connect.facebook.net/el_GR/all.js"; ref.parentNode.insertBefore(js, ref); } (document));*/ (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/el_GR/sdk.js"; fjs.parentNode.insertBefore(js, fjs); } (document, 'script', 'facebook-jssdk')); } function FBinitWillStatusandLike() { //Function is depricated. Use FBinitWillStatusandLike2 window.fbAsyncInit = function () { FB.init({ appId: '680411745315810', // Production //appId: 249589925215628, // test status: true, // check login status cookie: true, // enable cookies to allow the server to access the session xfbml: true, // parse XFBML version: 'v2.6' }); FB.Event.subscribe('edge.create', function (href, widget) { // alert('You liked the URL: ' + href); // doredirect(); WriteLike(); } ); }; } function FBinitWillStatusandLike2(fbClientId) { checkifLikedWithCheckin(); checklikedloopWithCheckin(); } function getCheckInPermissions(ltoken){ var oauth_url = 'https://www.facebook.com/dialog/oauth/'; oauth_url += '?client_id=680411745315810'; oauth_url += '&redirect_uri=' + encodeURIComponent('http://www.oxygenwifi.com//access3/FBLike.aspx?authCheck=true<oken='+ltoken); oauth_url += '&response_type=granted_scopes'; oauth_url += '&scope=publish_actions'; window.top.location = oauth_url; } function createCheckInGraphStory(ltoken){ showDialog(); //var CheckIn_Url = 'https://graph.facebook.com/me/feed'; //CheckIn_Url += '?app_id=680411745315810'; //CheckIn_Url += '&display=page'; //CheckIn_Url += '&place=0'; //CheckIn_Url += '&access_token='+ltoken; //CheckIn_Url += '&redirect_uri=' + encodeURIComponent('http://www.oxygenwifi.com//access3/FBLike.aspx?checkinDone=true<oken='+ltoken); //window.top.location = CheckIn_Url; } function authedCheckIn(ltoken){ createCheckInGraphStory(ltoken); //setTimeout(function(){eventFire(document.getElementById('dlgOkButton'), 'click');},2000);//PostWithLocation(ltoken); //alert("Pressed Checked In and Authorized"); } function AnnouncePage(msg) { FB.api( "/me/feed", "POST", { "message": msg, "tags": "0", "link": "", "action": {"name": "place"} }, function (response) { //debugger; if (response ) { if (response.error) { } else { //alert('Ευχαριστούμε! 0, 0'); // writeCheckin(0, 0); } } } ); } function eventFire(el, etype){ if (el.fireEvent) { el.fireEvent('on' + etype); } else { var evObj = document.createEvent('Events'); evObj.initEvent(etype, true, false); el.dispatchEvent(evObj); } } function PostWithLocation(ltoken) { if (window.localStorage) { FB.ui({ method: 'share_open_graph', action_type: 'oxygenwifi:check_in_at', redirect_uri:'http://www.oxygenwifi.com//Default.aspx?chapid=&link-login-only=&link-orig=https://www.google.com&server-name=&chapchallenge=&ipaddr=&mac=&itype=fb', place: '0', action_properties: JSON.stringify({ "object": "", "place": "0", "tags": "0" }) }, function(response){ if (response && !response.error_message) { //alert(JSON.stringify(response)); writeCheckin(0, 0); } }); } else { FB.getLoginStatus(function(response) { if (response.status != 'connected') { getAccess('fb','1'); } else{ FB.api( "/me/feed", "POST", { "place": 0, "tags": "0", "action": {"name": "place"} }, function (response) { if (response ) { //alert(JSON.stringify(response)); if (response.error) { getAccess('fb','1'); } else { writeCheckin(0, 0); } } } ); } }); } } function PostMessageNew(msg, resfunc, msgurl) { FB.ui({ method: 'feed', link: msgurl, description: msg, caption: msg }, function (response) { resfunc }); } function PostMessage(msg, resfunc, msgurl) { $('#errmsg1').text(''); FB.login(function (resp1) { if (resp1.authResponse) { FB.api( "/me/feed", "POST", { "message": msg, "link": msgurl //lcfg.dataset[0].facebookpage }, function (response) { if (response /*&& !response.error*/) { /* handle the result */ /// resfunc(); if (response.error) { $('#errmsg1').text(response.error); } else { resfunc(); } } } ); } }, { scope: 'publish_actions' }); } function PostButton() { PostMessage($('#postspan').text(), function () { PostDone() }, $('#msgurl').val()); } function ShareButton(text, url) { PostMessage(text, function () { PostDone() }, url); } function hasLiked() { FB.api('/me/likes/0', function(response) { console.log(response.data); }); }