Skip to content

Instantly share code, notes, and snippets.

View msrivastav13's full-sized avatar
🎯
Focusing

Mohith Shrivastava msrivastav13

🎯
Focusing
View GitHub Profile
@msrivastav13
msrivastav13 / CurrencyDataSourceProvider
Created August 16, 2015 03:45
Extends the DataSource.Provider base class to create a custom adapter for Lightning Connect. The class informs Salesforce of the functional and authentication capabilities that are supported by or required to connect to an external system.
/**
* Extends the DataSource.Provider base class to create a
* custom adapter for Lightning Connect. The class informs
* Salesforce of the functional and authentication
* capabilities that are supported by or required to connect
* to an external system.
**/
global class CurrencyDataSourceProvider extends DataSource.Provider {
/**
<apex:page standardStylesheets="false" showHeader="false" applyHtmlTag="false" docType="html-5.0">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<meta charset="UTF-8" />
<title>Hello React</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/JSXTransformer.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<apex:includeScript value="{!$Resource.makeDeferredProvider}"/>
git clone https://github.com/msrivastav13/SalesforceReact.git
gulp.task('build', function(){
browserify({
entries: [path.ENTRY_POINT],
transform: [reactify]
})
.bundle()
.pipe(source(path.MINIFIED_OUT))
//.pipe(streamify(uglify(path.MINIFIED_OUT)))
//Open the above line for final PRODUCTION deployment
.pipe(gulp.dest(path.DEST_BUILD));
gulp.task ('zip',function(){
gulp.src ('dist/build/*')
.pipe(zip(path.RESOURCE_NAME))
.pipe(gulp.dest (path.RESOURCE_DESTINATION));
});
var path = {
MINIFIED_OUT: 'build.min.js',
OUT: 'build.js',
DEST: 'dist',
DEST_BUILD: 'dist/build',
DEST_SRC: 'dist/src',
ENTRY_POINT: 'ReactJS/js/App.js',
RESOURCE_DESTINATION: 'src/staticresources',
RESOURCE_NAME: 'App.resource'
};
@msrivastav13
msrivastav13 / SampleReactPage.Page
Last active October 5, 2015 00:42
ReactSamplePage
<apex:page standardStylesheets="false" showHeader="false" applyHtmlTag="false" docType="html-5.0">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<meta charset="UTF-8" />
<title>Hello React</title>
<apex:stylesheet value="{!URLFOR($Resource.SLDS090, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
</head>
@msrivastav13
msrivastav13 / SLDS_Validator.js
Last active November 2, 2015 02:52
SLDS Validator plugin
var validatorSLDSplugin = (function(j$) {
return {
validate: function() {
var error = false;
var allInputs = j$(":input");
j$(allInputs).each(function() {
var isrequired = j$(this).attr("data-required");
if (typeof isrequired != 'undefined') {
if (typeof j$(this).attr("id") != 'undefined') {
if (isrequired === 'true') {
@msrivastav13
msrivastav13 / MortgageComponent.cmp
Created October 25, 2015 19:20
MortgageComponent
<aura:component implements="forceCommunity:availableForAllPageTypes">
<c:MortgageForm/>
<br/><br/>
<c:MortgageResponse/>
</aura:component>
@msrivastav13
msrivastav13 / SLDSValidatorDEMO.page
Last active November 2, 2015 03:24
SLDSValidatorDEMO
<apex:page showHeader="false" sidebar="false" standardController="Account" standardStylesheets="false" extensions="SLDSValidatordemocontroller" docType="html-5.0" id="thePage" applyHtmlTag="false" applyBodyTag="false">
<html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<apex:stylesheet value="{!URLFOR($Resource.SLDS0102, 'assets/styles/salesforce-lightning-design-system-vf.css')}" />
<apex:includeScript value="//code.jquery.com/jquery-2.1.4.min.js" />
<apex:includeScript value="{!URLFOR($Resource.SLDSValidator)}" />
</head>
<body>
<div class="slds">