Skip to content

Instantly share code, notes, and snippets.

View pawelgur's full-sized avatar

Pavel Gurecki pawelgur

View GitHub Profile
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@using PG.UmbracoExtensions.Helpers
@*
OPEN GRAPH METATAGS widget
Used by social networks to fetch right data about page (shared).
Must be inserted in head element with prefix="og: http://ogp.me/ns#" attribute.
@pawelgur
pawelgur / Umbraco - Sharing buttons.cshtml
Created August 4, 2014 20:30
Partial view for displaying standard sharing buttons
@inherits Umbraco.Web.Mvc.UmbracoViewPage<IPublishedContent>
@using ClientDependency.Core.Mvc
@{
Html.RequiresJs("~/Scripts/modules/social.js", 20);
String shareUrl = library.NiceUrlWithDomain(Model.Id);
String text = Model.Name;//Umbraco.StripHtml(Model.GetPropertyValue<String>("bodyText")).ToString().Substring(0, 100);
}
@pawelgur
pawelgur / social.js
Created August 4, 2014 20:32
Standard sharing buttons insert script
////////////////////////////////////////////
//
// SHARING BUTTONS SCRIPTS
// Included with _standard_PostSharingButtons.cshtml
//
////////////////////////////////////////////
window.onload = function () //add after document has fully loaded
{
/* ************* tweet it button ******************** */
@pawelgur
pawelgur / cookieHelper.js
Last active August 29, 2015 14:23
Helper for working with cookies
var CookieHelper = {
namespace: "",
////////////////// BASE METHODS /////////////////////
createCookie : function (name, value, days) {
var expires;
name = this.namespace + "." + name;
if (days) {
@pawelgur
pawelgur / fadeInOut.css
Created December 28, 2015 14:23
Element fade in and out with pure css
/*
This will show/hide element with fade transition. Hidden element won't overlap any other.
*/
.fade-in-out {
height: 0;
opacity: 0;
transition: opacity 300ms, height 10ms 300ms; /* delay height transition until opacity is done */
&.hover{
height: 100%;