Skip to content

Instantly share code, notes, and snippets.

View Frelseren's full-sized avatar

Nikita Verkhoshintcev Frelseren

View GitHub Profile
import { LightningElement } from 'lwc';
import { NavigationMixin } from 'lightning/navigation';
import { subscribe } from 'lightning/empApi';
export default class CustomDataTable extends NavigationMixin(LightningElement) {
data = [
// data table data
];
columns = [
// other data table column definitions,
<template>
<!-- <lightning-input-rich-text value={value} onkeydown={handleKeyDown}></lightning-input-rich-text> -->
<c-custom-input value={value} onkeydown={handleKeyDown}></c-custom-input>
</template>
import { LightningElement } from 'lwc';
export default class TestRichInput extends LightningElement {
value = `
<table>
<thead>
<tr>
<td>Header 1</td>
<tr>
<tr>
import { api } from 'lwc'
import LightningInputRichText from 'lightning/inputRichText';
export default class CustomInput extends LightningInputRichText {
@api
getContent() {
console.log('get content');
return this.value;
}
@Frelseren
Frelseren / manifest.json
Created November 9, 2019 22:33
Sample manifest.json file for the lightning container application
{
"landing-pages": [{
"path": "index.html",
"apex-controller": "Namespace.ControllerName"
}]
}
@Frelseren
Frelseren / DownloadAttachments.cls
Created October 13, 2018 16:09
The Apex class to send out the email with the attachments
global class DownloadAttachments {
/**
* Send out the startup object attachments to the specified email and save it as the activity
* @param {String} startupId The Id of the target startup object, which files we should attach to the email
* @param {String} emailAddress The email address of the recipient
*/
global static void download(String startupId, String emailAddress) {
Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
// Set the recipient address
message.setToAddresses(new String[] { emailAddress });
/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
/**
* 1. Set default font-family to sans-serif
* 2. Prevent iOS and IE text size adjust after device orientation change
* without disabling user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-ajust: 100%; /* 2 */
@Frelseren
Frelseren / index.html
Created July 17, 2018 13:21
TTT18 Test
<div class="container">
<nav class="nav">
<img src="https://digitalflask.com/img/digital-flask.svg" />
<span class="nav-links">
<a href="#">Home</a>
<a href="#">TTT18</a>
</span>
</nav>
</div>
<div class="container">
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { UrlSerializer } from '@angular/router';
import { AppComponent } from 'app/app.component';
import { CustomUrlSerializer } from './custom-url-serializer';
@NgModule({
imports: [
@Frelseren
Frelseren / custom-url-serializer.ts
Created May 29, 2018 14:13
A custom url serializer for Angular Router to support escape characters
import { UrlSerializer, UrlTree, DefaultUrlSerializer } from '@angular/router';
export class CustomUrlSerializer implements UrlSerializer {
parse(url: any): UrlTree {
const dus = new DefaultUrlSerializer();
return dus.parse(unescape(url));
}
serialize(tree: UrlTree): any {
const dus = new DefaultUrlSerializer();