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
!(function($, d) { | |
'use strict'; | |
var debug = false; | |
$(function() { | |
$('[id*=btnSubmitForm]').click(onSubmitClick); | |
}); | |
function onSubmitClick(e) { | |
var formID = returnFormId($(this).attr('id')); |
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
!(function($, window, d) { | |
'use strict'; | |
var debug = false; | |
var defaultSpeed = 500; | |
$.fn.scrollTo = function(elem, speed) { | |
var elemTop = $(elem).offset().top - $(this).offset().top; | |
var thisScrollTop = $(this).scrollTop(); | |
var targetScrollTop = thisScrollTop + elemTop; |
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
var OpenGraphImage = "https://www.cumbria.police.uk/SiteElements/Images/Facebook-logo.png"; | |
if(CurrentNode.ThumbnailUrl!="") { | |
OpenGraphImage = "https://www.cumbria.police.uk" + CurrentNode.ThumbnailUrl; | |
} | |
CurrentContext.Page.Head.Add("meta", new { property = "og:title", content = CurrentNode.Title }); | |
CurrentContext.Page.Head.Add("meta", new { property = "og:description", content = CurrentNode.Data.Description }); | |
CurrentContext.Page.Head.Add("meta", new { property = "og:image", content = OpenGraphImage }); | |
CurrentContext.Page.Head.Add("meta", new { property = "og:url", content = CurrentNode.FullPath }); | |
CurrentContext.Page.Head.Add("meta", new { property = "og:site_name", content = "Cumbria Constabulary" }); |
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
@{ | |
var obj = something; | |
@AsJson(obj); | |
} | |
@functions{ | |
string AsJson(object obj) { | |
return Newtonsoft.Json.JsonConvert.SerializeObject(obj); | |
} |
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 Contensis.Framework.Web | |
@{ | |
// Variables | |
var dateTime = Properties.time; | |
var day = dateTime.ToString("d ").Replace(" ", ""); | |
var dateTimeOne = dateTime.ToString("yyyy-MM-ddTHH:mm"); | |
var dateTimeTwo = dateTime.ToString("dd") + DateSuffix(day) + dateTime.ToString(" MMMM yyyy"); | |
// Format one | |
<div>@dateTimeOne</div> |
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.Text.RegularExpressions; | |
@{ | |
string image = String.Empty; | |
string youtubeid = string.Empty; | |
// Strip youtube id from the url so we can use it as a poster image | |
Regex regex = new Regex(@"^(?:https?\:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v\=))([\w-]{10,12})(?:$|\&|\?\#).*"); | |
Match youtubeMatch = regex.Match("youtubeurl"); | |
if (youtubeMatch.Success) { |
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 Contensis.Framework.Web | |
@{ | |
// Variables | |
var link = Properties.link; | |
<a href="@HyperlinkPath(link)">Link Text</a> | |
} | |
@functions { | |
// Check if its a hyperlink or not | |
public string HyperlinkPath(ContentNode property) { |
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
'hide placeholder | |
If Control.IsEmptyOrDefaultContent("[right column]") then | |
Control.visible = false | |
End If | |
'add class if placeholder is hidden | |
If Control.IsEmptyOrDefaultContent("[right column]") then | |
Control.visible = false | |
[idSelector].attributes("class")= [idSelector].attributes("class") & " testing" |
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
@{ | |
// Counter | |
int columnCounter = 0; | |
<div class="row"> | |
@foreach (ContentNode feature in features) { | |
<div class="columns"> | |
content in here | |
</div> |
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
@{ | |
int counter=0; | |
} | |
@foreach (var item in Model) | |
{ | |
counter++; | |
<div class="@(counter<=3 ? "classRed":"classBlue")"> | |
<img src="@item.Blog.Image.img_path" alt="Not Found" /> | |
//other markup also here |