Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Vadim Gremyachev vgrem

🏠
Working from home
View GitHub Profile
@vgrem
vgrem / GMapsGeolocatioFieldTemplate.js
Created Nov 3, 2012
Geolocation field template for Google Maps
View GMapsGeolocatioFieldTemplate.js
function $_global_googlemapscontrol() {
(function() {
if (typeof GMapsControlTemplate == "object") {
return;
}
window.GMapsControlTemplate = (function() {
return {
@vgrem
vgrem / ContentQueryMainTableLayout.xsl
Created Nov 3, 2012
Main CQWP XSLT style sheet for rendering results in Table Layout
View ContentQueryMainTableLayout.xsl
<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 Nov 4, 2012
XSLT style sheet for rendering EmbeddedVideoOnForm field
View fldtypes_VideoLinks.xsl
@vgrem
vgrem / MediaFields_Elements.xml
Created Nov 6, 2012
Media fields manifest file
View MediaFields_Elements.xml
<?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 Nov 6, 2012
Video Link Content Type
View VideoLink_Elements.xml
@vgrem
vgrem / PeopleEditorValidate.js
Created Nov 6, 2012
SharePoint People Editor Validator
View PeopleEditorValidate.js
function validateIfPeopleEditorNotEmpty(peId) {
var $pe = $("#" + peId);
var $peValHolder = $pe.find("input[id$='hiddenSpanData']");
return ($peValHolder.val().length > 0);
}
@vgrem
vgrem / PeopleEditorValidateWithJQuery.js
Created Nov 6, 2012
SharePoint People Editor Validator with jQuery Validation plugin
View PeopleEditorValidateWithJQuery.js
//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 Nov 6, 2012
SharePoint Custom Content Query Web Part (CQWP) For Arranging Items in Table Layout
View CBQTableLayoutToolPart.cs
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 Nov 6, 2012
Tool Part Class Implementation with the ability to specify Table Layout properties
View CBQTableLayoutToolPart.cs
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 Nov 6, 2012
Web Part manifest file for CQWP Table Layout
View CBQTableLayout.webpart
<?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>