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 / 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>
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'
};
gulp.task ('zip',function(){
gulp.src ('dist/build/*')
.pipe(zip(path.RESOURCE_NAME))
.pipe(gulp.dest (path.RESOURCE_DESTINATION));
});
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));
git clone https://github.com/msrivastav13/SalesforceReact.git
<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}"/>
@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 {
/**
@msrivastav13
msrivastav13 / CurrencyDataSourceConnection
Created August 16, 2015 03:39
Extends the DataSource.Connection class to enable Salesforce to sync the external system’s metadata schema and to handle queries and searches of the external data.
/**
* Extends the DataSource.Connection class to enable
* Salesforce to sync the external system’s metadata schema
* and to handle queries and searches of the external data.
**/
global class CurrencyDataSourceConnection extends DataSource.Connection {
private DataSource.ConnectionParams connectionInfo;
/**
<aura:attribute name="messages" type="Aura.Component[]" access="GLOBAL"/>
<div aura:id="messages">
{!v.messages}
</div>
//Script for Error handling
else if (state === "ERROR") {
var errors = response.getError();
hidenewBtn:function(component,event) {
var toggleBtn= component.find("Newbtn");
$A.util.removeClass(toggleBtn,'btn btn-primary btn-lg btn-block');
$A.util.addClass(toggleBtn,'toggle');
}
//CSS file
/*toggleCss.css*/
.THIS .toggle {