This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Helper service for creating JSON necessary for creating block list items programatically using Umbraco <see cref="ContentService"/> | |
/// </summary> | |
/// <remarks> | |
/// Based of this: https://github.com/umbraco/UmbracoDocs/blob/e64ec0e5b28b4e5a37b7865691621e45dd82701f/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Block-List-Editor/index.md | |
/// It's intended for simple content | |
/// </remarks> | |
public class BlockListCreatorService | |
{ | |
/// <summary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> | |
<title>Test Page</title> | |
<script> | |
// early compute the vw/vh units more reliably than CSS does itself | |
computeViewportDimensions(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
using System.Net; | |
using System.Threading.Tasks; | |
using System.Web; | |
using System.Web.Hosting; | |
using ImageProcessor.Web.Services; | |
namespace UmbrellaInc.Web.Services | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private readonly IMediaService _mediaSvc = ApplicationContext.Current.Services.MediaService; | |
// Updating profile pic | |
internal void UpdateProfilePic(int profileId, string picPath) | |
{ | |
if (profileId == 0) throw new ArgumentException("Error updating profile, no profile id in request"); | |
var contentItem = _contentSvc.GetById(profileId); | |
// Set mediaitem | |
var mediaFilename = contentItem.Name + Path.GetExtension(picPath); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage | |
@{ | |
Layout = null; | |
} | |
@functions{ | |
/* | |
* Poor mans "Code First" implementation for Umbraco |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input[type=submit]').not('.cancel').click(function (evt) { | |
evt.preventDefault(); | |
var self = $(this); | |
var frm = self.closest('form'); | |
frm.validate(); | |
if (frm.valid()) { | |
$.ajax({ | |
cache: false, | |
async: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MediaFileSystem mediaFileSystem = FileSystemProviderManager.Current.GetFileSystemProvider<MediaFileSystem>(); | |
IContentSection contentSection = UmbracoConfig.For.UmbracoSettings().Content; | |
IEnumerable<string> supportedTypes = contentSection.ImageFileTypes.ToList(); | |
foreach (IMedia media in e.SavedEntities) | |
{ | |
if (media.HasProperty("umbracoFile")) | |
{ | |
// Make sure it's an image. | |
string path = media.GetValue<string>("umbracoFile"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Umbraco Cloud - UI Fixes | |
// @namespace http://leekelleher.com/ | |
// @version 0.6.1 | |
// @description Hacking around on umbraco.io | |
// @author Lee Kelleher | |
// @match https://www.umbraco.io/project/* | |
// @match https://www.s1.umbraco.io/project/* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
* | |
* To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
* the height of element `.foo` —which is a full width and height cover image. | |
* | |
* iOS Resolution Quick Reference: http://www.iosres.com/ | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using Umbraco.Web.Models | |
@inherits UmbracoViewPage<IPublishedContent> | |
@{ | |
var internalMediaFolder = Umbraco.TypedMediaAtRoot().FirstOrDefault(x => x.DocumentTypeAlias == "InternalMediaFolder"); | |
if (internalMediaFolder != null) | |
{ | |
var appleTouchIcon = internalMediaFolder.Descendants().FirstOrDefault(x => x.DocumentTypeAlias == "AppleTouchIcon"); |
NewerOlder