Skip to content

Instantly share code, notes, and snippets.

Avatar

Evgenii Vilkov zzeneg

View GitHub Profile
View tj_comments.js
$.get('https://cdnjs.cloudflare.com/ajax/libs/jquery.devbridge-autocomplete/1.2.21/jquery.autocomplete.min.js', function() {
$('.b-article-add-form__title__input input').autocomplete({
serviceUrl: 'https://api.tjournal.ru/2/club?category=news&sortMode=all&count=50',
minChars: 2,
//forceFixPosition: true,
noCache: true,
transformResult: function(res, orig) {
var data = JSON.parse(res);
var suggestions = [];
var origArr = orig.split(' ');
View index-content.js
// ### Content Helper
//
// *Usage example:*
// `{{content}}`
// `{{content words="20"}}`
// `{{content characters="256"}}`
// `{{content preview="true"}}`
// `{{content preview="true" words="20"}}`
//
// Turns content html into a safestring so that the user doesn't have to
@zzeneg
zzeneg / items.d.ts
Last active Aug 29, 2015
GenTSDefFromSP
View items.d.ts
declare module Portal {
export interface IListItem {
ID: number;
Title: string;
Author: SP.FieldUserValue;
Created: Date;
}
export interface IBook extends IListItem {
@zzeneg
zzeneg / timerjobshistory.cs
Created Jul 9, 2014
TimerJobsLastRunTime
View timerjobshistory.cs
using System;
using System.Linq;
using Microsoft.SharePoint;
namespace ConsoleApplication1
{
internal class Program
{
private static void Main()
{
View bootstrap-editor.html
<div class="btn-toolbar" data-role="editor-toolbar" data-target="#editor">
<div class="btn-group">
<a class="btn btn-default" data-edit="bold" title="Bold (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a>
<a class="btn btn-default" data-edit="italic" title="Italic (Ctrl/Cmd+I)"><i class="fa fa-italic"></i></a>
<a class="btn btn-default" data-edit="strikethrough" title="Strikethrough"><i class="fa fa-strikethrough"></i></a>
<a class="btn btn-default" data-edit="underline" title="Underline (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a>
</div>
<div class="btn-group">
<a class="btn btn-default" data-edit="insertunorderedlist" title="Bullet list"><i class="fa fa-list-ul"></i></a>
<a class="btn btn-default" data-edit="insertorderedlist" title="Number list"><i class="fa fa-list-ol"></i></a>
@zzeneg
zzeneg / Autocomplete.js
Last active Dec 27, 2015
SharePoint autocomplete solution with At.js.
View Autocomplete.js
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function() {
$('div[id^=PostBody]').atwho({
at: "@",
search_key: "DisplayText",
limit: 10,
callbacks: {
remote_filter: function(query, callback) {
var context = SP.ClientContext.get_current();
var picker = new SP.UI.ApplicationPages.ClientPeoplePickerQueryParameters();
picker.set_allowMultipleEntities(false);
@zzeneg
zzeneg / BlogsWebPart.ascx
Last active Nov 22, 2020
SharePoint Blogs Feed web part
View BlogsWebPart.ascx
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="BlogsWebPart.ascx.cs" Inherits="Portal.Blogs.WebParts.BlogsWebPart.BlogsWebPart" %>
<SharePoint:CssRegistration ID="CssRegistration1" Name="/_layouts/15/Portal/Blogs/BlogsWebPart.css" runat="server" After="corev15.css" />
<SharePoint:ScriptLink ID="ScriptLink1" runat="server" Name="~SiteCollection/_layouts/15/Portal/Blogs/BlogsWebPart.js" Localizable="False"></SharePoint:ScriptLink>
<div id="blogsWebPart" ><img alt="Loading..." src="/_layouts/15/images/loading.gif"/></div>
@zzeneg
zzeneg / aspx.cs
Last active Dec 21, 2015
SharePoint Lync Control HTML Code
View aspx.cs
private UserProfile _profile;
public string PublicUrl
{
get
{
return _profile.PublicUrl != null ? _profile.PublicUrl.AbsoluteUri : string.Empty;
}
}
You can’t perform that action at this time.