Skip to content

Instantly share code, notes, and snippets.

View msrivastav13's full-sized avatar
🎯
Focusing

Mohith Shrivastava msrivastav13

🎯
Focusing
View GitHub Profile
public class SLDSValidatordemocontroller{
public SLDSValidatordemocontroller(ApexPages.StandardController controller) {
}
@RemoteAction
public static Id createAccount(String name,String fax){
Account acc = new Account();
acc.Name = name;
acc.Fax = fax;
<aura:component >
<aura:attribute name="richtextData" type="String"></aura:attribute>
<ui:inputRichText value="{!v.richtextData}" aura:id="inputRT" label="Rich Text Demo"/>
</aura:component>
@msrivastav13
msrivastav13 / SimpleTestApp.app
Created November 5, 2015 23:06
SimpleTestApp.app
<aura:application access="GLOBAL" extends="ltng:outApp">
<aura:dependency resource="c:SimpleTestCmp" />
</aura:application>
<apex:page standardStylesheets="false" showHeader="false" sidebar="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:includeLightning />
</head>
<body>
<div class="slds">
<div class="slds-grid slds-wrap">
<!--Action Buttons -->
@msrivastav13
msrivastav13 / unfreezeSF1Keys.js
Last active December 6, 2015 20:04
Workaround for Ipad key freezing issues on SF1 app
<script type="text/javascript">
window.onkeydown=function(){ // Workaround for known issue with SFDC(https://success.salesforce.com/issues_view?id=a1p30000000T5l1AAC)
window.focus();
}
</script>
@msrivastav13
msrivastav13 / iframeSF1Scroll.js
Last active May 15, 2017 16:44
Add the scrolling behavior for iframe embedded in visualforce inside SF1 app
<script type="text/javascript">
(function() {
try {
var a = navigator.userAgent;
if ((a.indexOf('Salesforce') != -1) && (a.indexOf('iPhone') != -1 || a.indexOf('iPad') != -1) && (a.indexOf('OS/8') != -1 || a.indexOf('OS 8') != -1 || a.indexOf('OS/9') != -1 || a.indexOf('OS 9') != -1) && (a.indexOf('Safari') == -1)) {
var s = document.createElement('style');
if (a.indexOf('OS/8') != -1 || a.indexOf('OS 8') != -1) {
s.innerHTML = "html,html body{overflow: auto;-webkit-overflow-scrolling:touch;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
} else if (a.indexOf('OS/9') != -1 || a.indexOf('OS 9') != -1) {
s.innerHTML = "html,html body{overflow: auto;-webkit-overflow-scrolling:auto;}body{position:absolute;left:0;right:0;top:0;bottom:0;}";
@isTest
private class TestCreatedDateSetter{
static testmethod void createAccountTest(){
Account acc = new Account();
acc.Name = 'Test';
insert acc;
DateTime myDateTime = DateTime.newInstance(1997, 1, 31, 7, 8, 16);
Test.setCreatedDate(acc.Id, myDateTime );
Test.startTest();
<aura:tokens extends="force:base">
<aura:token name="myBodyTextFontFace"
value="'Salesforce Sans', Helvetica, Arial, sans-serif"/>
<aura:token name="myBodyTextFontWeight" value="bold"/>
</aura:tokens>
@msrivastav13
msrivastav13 / sampleTokenTest.cmp
Created January 10, 2016 18:58
simple component showing how to use design tokens
<aura:component implements="force:appHostable">
<div>
<p>How you doing ?</p>
</div>
</aura:component>
@msrivastav13
msrivastav13 / SF1LG
Created January 18, 2016 02:08
SF1LG
<aura:component implements="force:appHostable">