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
<input | |
accept=".doc,.docx,.dot,.rtf,.pdf" | |
name="MyAwesomeFileUploader" | |
type="file" | |
id="MyAwesomeFileUploader" | |
className="inputFile" | |
multiple="false" | |
onchange="fileUploader.upload(this.files[0])" /> |
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
import utils from './utils'; | |
// First we need to make sure we are backwards compatible with IE (no ArrayBuffer.slice) | |
if (!ArrayBuffer.prototype.slice) { | |
ArrayBuffer.prototype.slice = function (begin, end) { | |
let len = this.byteLength; | |
begin = (begin|0) || 0; | |
end = end === (void 0) ? len : (end|0); | |
// Handle negative values. |
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
//Between 1 - 255 characters... | |
/^.{1,255}$/ | |
//Letters only with spaces (no numbers or special characters)... | |
/^[a-zA-Z\s]*$/ | |
//Number required... | |
/^\d+$/ | |
//Number to two decimal places... |
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
/* | |
With the example below, we safely check to see if the object exists already before creating one (if it does exist, use this). | |
e.g. var SharePointCookies = SharePointCookies if it exists else create a new empty JavaScript object | |
This approach safely checks to make sure each portion of the namespace exists before creating it (to not write over pre-existing code) | |
*/ | |
var SharePointCookies = SharePointCookies || {}; | |
SharePointCookies.NameSpaces = SharePointCookies.NameSpaces || {}; | |
SharePointCookies.NameSpaces.Example = SharePointCookies.NameSpaces.Example || {}; |
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
#Ribbon\.WikiPageTab\.EditAndCheckout\.SaveEdit\.Menu\.EditInDesigner, | |
#Ribbon\.Library\.CustomizeLibrary\.EditList-Large, | |
#Ribbon\.List\.CustomViews\.ModifyView\.Menu\.Manage\.ModifyViewInDesigner-Menu { display: none; } |
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
/* | |
Issues | |
- We need to swap in value to the layout (react select etc..) | |
- Passing in new layouts from options is back on the cards :) | |
*/ | |
//Examples of use... |
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
setSearchFocus () { | |
if (this.refs['searchInput'] !== null) { | |
if (Golfish.interval !== null) { | |
window.clearInterval(Goldfish.interval); | |
} | |
//in the console check the value of this.refs['searchInput']; | |
this.refs['searchInput'].focus(); | |
} else { | |
Goldfish.interval = Goldfish.interval || window.setInterval(function () { | |
this.setSearchFocus(); |
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
/* | |
JSX version | |
*/ | |
getAvailableLayoutFieldsHolder (available) { | |
if (available.length > 0) { | |
return ( | |
<div key="available"> | |
<p styleName='info'><strong>Add</strong> additional items to the layout.</p> | |
<Available | |
options={available} |
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 addHeadLink(src, type, callback) { | |
var link = document.createElement(type === 'js' ? 'script' : 'link'); | |
link.setAttribute(type === 'js' ? 'src' : 'href', src); | |
link.setAttribute(type === 'js' ? 'type' : 'rel', type === 'js' ? 'text/javascript' : 'stylesheet'); | |
if (typeof callback !== 'undefined') { | |
link.onreadystatechange = function ( ) { | |
if (this.readyState == 'complete') { | |
callback(); | |
} | |
}; |