Skip to content

Instantly share code, notes, and snippets.

View mutuadavid93's full-sized avatar
🎯
Focusing

David Mutua mutuadavid93

🎯
Focusing
  • Squad Africa
  • NAIROBI
View GitHub Profile
// Dynamic Image Slider for SharePoint
// Image Carousel
// SharePoint Image Slider
$(document).ready(function () {
// ### Fecth Data from The List
var resourcez = "/_api/web/lists/GetByTitle('SlideMagic')/items?$select=Title,EncodedAbsUrl,Description,Alive";
//var eureka = "$top=3";
var orient = "$orderby=Created desc";
/*
Get a SharePoint List Metadata for Use in REST API code.
1. Create a List and Add one item into it.
2. Create a SitePage and Insert a Script Editor into it.
3. Edit the WebPart to insert the code below inside.
4. Save the File.
5. Open Fiddler and inspect the Data from JSON tab.
6. You are good.
*/
<!--
1. The best Idea is that the File Even when Updating other items,
will be overwritten, so no need to worry about the update code.
:)
-->
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){
//your code goes here...
<div id="message"></div>
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
/*
When looping Multiple items from a SharePoint List
and You want to render them on UI into individual rows
containing only a specific number of columns. :)
*/
$(function() {
var $render = function (myarr){
console.dir(myarr); // rendering logic.
// BEGIN PERSON OR GROUP QUERY
// Queery Person or Group Properties
function getItemDetails(webUrl,listTitle,itemId,selectFields, expandFields){
var endpointUrl = webUrl + "/_api/web/lists/getbytitle('" + listTitle + "')/items(" + itemId + ")";
endpointUrl+= '?$select=' + selectFields.join(",");
endpointUrl+= '&$expand=' + expandFields.join(",");
return executeRequest(endpointUrl,'GET');
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
#myInput {
/*********************************
*
* JSOM: WAKE SHAREPOINT MODAL:
*
********************************/
// Create your Link and Then give it an ID:
// Pass the the Id and List name into spModal() below:
// That is it, Dynamic SharePoint Modal it's.
/**
A Project in the Future using Skeleton CSS.
*/
var SharePointNews = function() {
// Use Powershell to get siteGUID.
this.siteGUID = '504db699a61e4ad4b39bbeae516e0af4' || '';
// use JSOM to get webGUID:
this.webGUID = '769d73c8a3f240e18129382f5f6d6ce9';
this.api_domain =
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: mariadb
name: mariadb-deployment
spec:
replicas: 1
selector:
matchLabels: