From d0177faf9a07c479e1f4596da23c212444cc851c Mon Sep 17 00:00:00 2001 From: Siddharth Bhagwan Date: Tue, 10 Mar 2015 16:08:42 +0530 Subject: [PATCH] Fb sharing added --- css/blogpagecss.css | 15 ++++++++++----- js/application.js | 12 +++++++++--- js/application.min.js | 2 +- js/main.js | 12 +++++++++--- showcase/gaming-controller/index.html | 4 +++- showcase/index.html | 4 +++- showcase/mood-lamp/index.html | 4 +++- showcase/motion-control/index.html | 4 +++- showcase/sensors-and-relays/index.html | 4 +++- showcase/smart-dice/index.html | 4 +++- showcase/smartphone-xbee-bridge/index.html | 4 +++- showcase/universal-remote/index.html | 4 +++- tutorials/index.html | 2 +- tutorials/tah-to-tah/index.html | 17 ++++------------- tutorials/tah-with-linux/index.html | 4 +++- 15 files changed, 61 insertions(+), 35 deletions(-) diff --git a/css/blogpagecss.css b/css/blogpagecss.css index a41fde5..4333732 100644 --- a/css/blogpagecss.css +++ b/css/blogpagecss.css @@ -24,12 +24,12 @@ display: none; } -/*.share-fb { +.share-fb { position: fixed; right: 82px; bottom: 205px; color: #3B5998; -}*/ +} .share-tw { position: fixed; @@ -41,8 +41,7 @@ .share-gplus { position: fixed; right: 72px; - bottom: 205px; - /*bottom: 150px;*/ + bottom: 150px; color: #d34836; } @@ -584,10 +583,16 @@ pre { bottom: 155px; } + .share-fb { + display: none; + right: 35px; + bottom: 205px; + } + .share-tw { display: none; right: 28px; - bottom: 210px; + bottom: 255px; } #nav-mobile { diff --git a/js/application.js b/js/application.js index a451898..360f8b4 100644 --- a/js/application.js +++ b/js/application.js @@ -614,12 +614,18 @@ $(document).ready(function (){ $(".share-tw").attr("href", $(".share-tw").attr("href") + default_share); })(); + (function () { + current_page = window.location.pathname; + fb_link = "http://docs.tah.io" + current_page; + title_link = "&p[title]=" + $(".page_heading").text(); + $(".share-fb").attr("href", $(".share-fb").attr("href") + fb_link + title_link); + })(); $(".share-btn").click(function(){ - if ($(".share-tw, .share-gplus").is(":visible")) { - $(".share-tw, .share-gplus").fadeOut(500); + if ($(".share-tw, .share-gplus, .share-fb").is(":visible")) { + $(".share-tw, .share-gplus, .share-fb").fadeOut(500); } else { - $(".share-tw, .share-gplus").fadeIn(500); + $(".share-tw, .share-gplus, .share-fb").fadeIn(500); } }); diff --git a/js/application.min.js b/js/application.min.js index e2c41b8..5723ef5 100644 --- a/js/application.min.js +++ b/js/application.min.js @@ -1,4 +1,4 @@ if(function(t,e){function n(t){var e=t.length,n=re.type(t);return re.isWindow(t)?!1:1===t.nodeType&&e?!0:"array"===n||"function"!==n&&(0===e||"number"==typeof e&&e>0&&e-1 in t)}function i(t){var e=he[t]={};return re.each(t.match(ae)||[],function(t,n){e[n]=!0}),e}function o(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=re.expando+Math.random()}function r(t,n,i){var o;if(i===e&&1===t.nodeType)if(o="data-"+n.replace(ye,"-$1").toLowerCase(),i=t.getAttribute(o),"string"==typeof i){try{i="true"===i?!0:"false"===i?!1:"null"===i?null:+i+""===i?+i:ve.test(i)?JSON.parse(i):i}catch(r){}ge.set(t,n,i)}else i=e;return i}function s(){return!0}function a(){return!1}function l(){try{return z.activeElement}catch(t){}}function c(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function u(t,e,n){if(re.isFunction(e))return re.grep(t,function(t,i){return!!e.call(t,i,t)!==n});if(e.nodeType)return re.grep(t,function(t){return t===e!==n});if("string"==typeof e){if(Se.test(e))return re.filter(e,t,n);e=re.filter(e,t)}return re.grep(t,function(t){return ee.call(e,t)>=0!==n})}function p(t,e){return re.nodeName(t,"table")&&re.nodeName(1===e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function f(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function d(t){var e=He.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function h(t,e){for(var n=t.length,i=0;n>i;i++)me.set(t[i],"globalEval",!e||me.get(e[i],"globalEval"))}function g(t,e){var n,i,o,r,s,a,l,c;if(1===e.nodeType){if(me.hasData(t)&&(r=me.access(t),s=re.extend({},r),c=r.events,me.set(e,s),c)){delete s.handle,s.events={};for(o in c)for(n=0,i=c[o].length;i>n;n++)re.event.add(e,o,c[o][n])}ge.hasData(t)&&(a=ge.access(t),l=re.extend({},a),ge.set(e,l))}}function m(t,n){var i=t.getElementsByTagName?t.getElementsByTagName(n||"*"):t.querySelectorAll?t.querySelectorAll(n||"*"):[];return n===e||n&&re.nodeName(t,n)?re.merge([t],i):i}function v(t,e){var n=e.nodeName.toLowerCase();"input"===n&&Le.test(t.type)?e.checked=t.checked:("input"===n||"textarea"===n)&&(e.defaultValue=t.defaultValue)}function y(t,e){if(e in t)return e;for(var n=e.charAt(0).toUpperCase()+e.slice(1),i=e,o=Ke.length;o--;)if(e=Ke[o]+n,e in t)return e;return i}function b(t,e){return t=e||t,"none"===re.css(t,"display")||!re.contains(t.ownerDocument,t)}function x(e){return t.getComputedStyle(e,null)}function w(t,e){for(var n,i,o,r=[],s=0,a=t.length;a>s;s++)i=t[s],i.style&&(r[s]=me.get(i,"olddisplay"),n=i.style.display,e?(r[s]||"none"!==n||(i.style.display=""),""===i.style.display&&b(i)&&(r[s]=me.access(i,"olddisplay",$(i.nodeName)))):r[s]||(o=b(i),(n&&"none"!==n||!o)&&me.set(i,"olddisplay",o?n:re.css(i,"display"))));for(s=0;a>s;s++)i=t[s],i.style&&(e&&"none"!==i.style.display&&""!==i.style.display||(i.style.display=e?r[s]||"":"none"));return t}function T(t,e,n){var i=ze.exec(e);return i?Math.max(0,i[1]-(n||0))+(i[2]||"px"):e}function C(t,e,n,i,o){for(var r=n===(i?"border":"content")?4:"width"===e?1:0,s=0;4>r;r+=2)"margin"===n&&(s+=re.css(t,n+Je[r],!0,o)),i?("content"===n&&(s-=re.css(t,"padding"+Je[r],!0,o)),"margin"!==n&&(s-=re.css(t,"border"+Je[r]+"Width",!0,o))):(s+=re.css(t,"padding"+Je[r],!0,o),"padding"!==n&&(s+=re.css(t,"border"+Je[r]+"Width",!0,o)));return s}function k(t,e,n){var i=!0,o="width"===e?t.offsetWidth:t.offsetHeight,r=x(t),s=re.support.boxSizing&&"border-box"===re.css(t,"boxSizing",!1,r);if(0>=o||null==o){if(o=We(t,e,r),(0>o||null==o)&&(o=t.style[e]),Xe.test(o))return o;i=s&&(re.support.boxSizingReliable||o===t.style[e]),o=parseFloat(o)||0}return o+C(t,e,n||(s?"border":"content"),i,r)+"px"}function $(t){var e=z,n=Qe[t];return n||(n=N(t,e),"none"!==n&&n||(Me=(Me||re("