Created
October 13, 2018 21:54
-
-
Save TheVishnuKumar/102ea2006583cc299b53b5af9a27ef64 to your computer and use it in GitHub Desktop.
This file contains 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
<apex:page controller="ConvertPageMessagesController" > | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script> | |
<apex:slds /> | |
<style> | |
.msgIcon { | |
display: none!important | |
} | |
.customMessage * { | |
color: #fff!important | |
} | |
.customMessage { | |
margin: 5px 0!important; | |
max-width: 1280px; | |
opacity: 1!important; | |
width: 100%; | |
font-size: 12px; | |
border: 0px; | |
padding-left: 10px; | |
} | |
.message { | |
opacity: .1 | |
} | |
</style> | |
<script> | |
$(document).ready(function(){ | |
overridePageMessages(); | |
}); | |
function overridePageMessages(){ | |
var textureEffect = ''; | |
//Uncomment below line for texture effect on page messages | |
//textureEffect = 'slds-theme--alert-texture'; | |
$('.warningM3').addClass('slds-notify slds-notify--toast slds-theme--warning customMessage '+textureEffect); | |
$('.confirmM3').addClass('slds-notify slds-notify--alert slds-theme--success customMessage '+textureEffect); | |
$('.errorM3').addClass('slds-notify slds-notify--alert slds-theme--error customMessage '+textureEffect); | |
$('.infoM3').addClass('slds-notify slds-notify--toast customMessage '+textureEffect); | |
$('.errorM3').removeClass('errorM3'); | |
$('.confirmM3').removeClass('confirmM3'); | |
$('.infoM3').removeClass('infoM3'); | |
$('.warningM3').removeClass('warningM3'); | |
} | |
</script> | |
<apex:pagemessages/> | |
</apex:page> |
This file contains 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
/* | |
Description: This class is creating dummy page messages. | |
*/ | |
public class ConvertPageMessagesController{ | |
public ConvertPageMessagesController(){ | |
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'Please enter Account name')); | |
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter Account number')); | |
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter Account phone')); | |
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'Please enter Account site')); | |
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM,'Please enter Account industry')); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment