Skip to content

Instantly share code, notes, and snippets.

View vgrem's full-sized avatar
🏠
Working from home

Vadim Gremyachev vgrem

🏠
Working from home
View GitHub Profile
@vgrem
vgrem / GMapsGeolocatioFieldTemplate.js
Created November 3, 2012 16:20
Geolocation field template for Google Maps
function $_global_googlemapscontrol() {
(function() {
if (typeof GMapsControlTemplate == "object") {
return;
}
window.GMapsControlTemplate = (function() {
return {
@vgrem
vgrem / ContentQueryMainTableLayout.xsl
Created November 3, 2012 17:01
Main CQWP XSLT style sheet for rendering results in Table Layout
<xsl:stylesheet
version="1.0"
exclude-result-prefixes="x xsl cmswrt cbq"
xmlns:x="http://www.w3.org/2001/XMLSchema"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:cmswrt="http://schemas.microsoft.com/WebPart/v3/Publishing/runtime"
xmlns:cbq="urn:schemas-microsoft-com:ContentByQueryWebPart">
<xsl:output method="xml" indent="no" media-type="text/html" omit-xml-declaration="yes"/>
<xsl:param name="cbq_isgrouping" />
<xsl:param name="cbq_columnwidth" />
@vgrem
vgrem / fldtypes_VideoLinks.xsl
Created November 4, 2012 09:15
XSLT style sheet for rendering EmbeddedVideoOnForm field
@vgrem
vgrem / MediaFields_Elements.xml
Created November 6, 2012 09:24
Media fields manifest file
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field Type="Number"
DisplayName="Frame Border"
Required="FALSE"
EnforceUniqueValues="FALSE"
Group="Media Columns"
ID="{594e551f-180d-47ec-90e5-9195225c5932}"
StaticName="FrameBorder"
Name="FrameBorder"
@vgrem
vgrem / VideoLink_Elements.xml
Created November 6, 2012 09:32
Video Link Content Type
@vgrem
vgrem / PeopleEditorValidate.js
Created November 6, 2012 09:43
SharePoint People Editor Validator
function validateIfPeopleEditorNotEmpty(peId) {
var $pe = $("#" + peId);
var $peValHolder = $pe.find("input[id$='hiddenSpanData']");
return ($peValHolder.val().length > 0);
}
@vgrem
vgrem / PeopleEditorValidateWithJQuery.js
Created November 6, 2012 09:46
SharePoint People Editor Validator with jQuery Validation plugin
//People Editor Validator with jQuery Validation plugin
function validatePeopleEditor(peId,messageText)
{
var $pe = $("#" + peId);
var $peValHolder = $pe.find("input[id$='hiddenSpanData']");
$peValHolder.rules("add", {
required: true,
messages: {
required: messageText
@vgrem
vgrem / CBQTableLayoutToolPart.cs
Created November 6, 2012 10:38
SharePoint Custom Content Query Web Part (CQWP) For Arranging Items in Table Layout
using System;
using System.ComponentModel;
using System.Security.Permissions;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint.Publishing.WebControls;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.WebPartPages;
namespace CQWPWithTableLayout.WebControls
@vgrem
vgrem / CBQTableLayoutToolPart.cs
Created November 6, 2012 10:40
Tool Part Class Implementation with the ability to specify Table Layout properties
using System;
using System.Globalization;
using System.Web.UI.WebControls;
namespace CQWPWithTableLayout.WebControls
{
public class CBQTableLayoutToolPart : Microsoft.SharePoint.WebPartPages.ToolPart
{
public CBQTableLayoutToolPart()
{
@vgrem
vgrem / CBQTableLayout.webpart
Created November 6, 2012 10:45
Web Part manifest file for CQWP Table Layout
<?xml version="1.0" encoding="utf-8"?>
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="CQWPWithTableLayout.WebControls.CBQTableLayout, CQWPWithTableLayout, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f96554baea0809a2" />
<importErrorMessage>Cannot import this Web Part.</importErrorMessage>
</metaData>
<data>
<properties>
<property name="Title" type="string">Content Query (Plain Old Table Layout)</property>