Skip to content

Commit

Permalink
feat: API 59.0 update and refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dschach committed Oct 19, 2023
1 parent d2f1a6f commit 64cd1fe
Show file tree
Hide file tree
Showing 12 changed files with 2,324 additions and 1,286 deletions.
File renamed without changes.
1,184 changes: 1,184 additions & 0 deletions demo/scratchpad.html

Large diffs are not rendered by default.

163 changes: 163 additions & 0 deletions demo/testcode.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em
}
code.hljs {
padding: 3px 5px
}
/*!
Theme: Google Light
Author: Seth Wright (http://sethawright.com)
License: ~ MIT (or more permissive) [via base16-schemes-source]
Maintainer: @highlightjs/core-team
Version: 2021.09.0
*/
/*
WARNING: DO NOT EDIT THIS FILE DIRECTLY.
This theme file was auto-generated from the Base16 scheme google-light
by the Highlight.js Base16 template builder.
- https://github.com/highlightjs/base16-highlightjs
*/
/*
base00 #ffffff Default Background
base01 #e0e0e0 Lighter Background (Used for status bars, line number and folding marks)
base02 #c5c8c6 Selection Background
base03 #b4b7b4 Comments, Invisibles, Line Highlighting
base04 #969896 Dark Foreground (Used for status bars)
base05 #373b41 Default Foreground, Caret, Delimiters, Operators
base06 #282a2e Light Foreground (Not often used)
base07 #1d1f21 Light Background (Not often used)
base08 #CC342B Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted
base09 #F96A38 Integers, Boolean, Constants, XML Attributes, Markup Link Url
base0A #FBA922 Classes, Markup Bold, Search Text Background
base0B #198844 Strings, Inherited Class, Markup Code, Diff Inserted
base0C #3971ED Support, Regular Expressions, Escape Characters, Markup Quotes
base0D #3971ED Functions, Methods, Attribute IDs, Headings
base0E #A36AC7 Keywords, Storage, Selector, Markup Italic, Diff Changed
base0F #3971ED Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?>
*/
pre code.hljs {
display: block;
overflow-x: auto;
padding: 1em
}
code.hljs {
padding: 3px 5px
}
.hljs {
color: #373b41;
background: #ffffff
}
.hljs::selection,
.hljs ::selection {
background-color: #c5c8c6;
color: #373b41
}
/* purposely do not highlight these things */
.hljs-formula,
.hljs-params,
.hljs-property {

}
/* base03 - #b4b7b4 - Comments, Invisibles, Line Highlighting */
.hljs-comment {
color: #b4b7b4
}
/* base04 - #969896 - Dark Foreground (Used for status bars) */
.hljs-tag {
color: #969896
}
/* base05 - #373b41 - Default Foreground, Caret, Delimiters, Operators */
.hljs-subst,
.hljs-punctuation,
.hljs-operator {
color: #373b41
}
.hljs-operator {
opacity: 0.7
}
/* base08 - Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted */
.hljs-bullet,
.hljs-variable,
.hljs-template-variable,
.hljs-selector-tag,
.hljs-name,
.hljs-deletion {
color: #CC342B
}
/* base09 - Integers, Boolean, Constants, XML Attributes, Markup Link Url */
.hljs-symbol,
.hljs-number,
.hljs-link,
.hljs-attr,
.hljs-variable.constant_,
.hljs-literal {
color: #F96A38
}
/* base0A - Classes, Markup Bold, Search Text Background */
.hljs-title,
.hljs-class .hljs-title,
.hljs-title.class_ {
color: #FBA922
}
.hljs-strong {
font-weight: bold;
color: #FBA922
}
/* base0B - Strings, Inherited Class, Markup Code, Diff Inserted */
.hljs-code,
.hljs-addition,
.hljs-title.class_.inherited__,
.hljs-string {
color: #198844
}
/* base0C - Support, Regular Expressions, Escape Characters, Markup Quotes */
/* guessing */
.hljs-built_in,
.hljs-doctag,
.hljs-quote,
.hljs-keyword.hljs-atrule,
.hljs-regexp {
color: #3971ED
}
/* base0D - Functions, Methods, Attribute IDs, Headings */
.hljs-function .hljs-title,
.hljs-attribute,
.ruby .hljs-property,
.hljs-title.function_,
.hljs-section {
color: #3971ED
}
/* base0E - Keywords, Storage, Selector, Markup Italic, Diff Changed */
/* .hljs-selector-id, */
/* .hljs-selector-class, */
/* .hljs-selector-attr, */
/* .hljs-selector-pseudo, */
.hljs-type,
.hljs-template-tag,
.diff .hljs-meta,
.hljs-keyword {
color: #A36AC7
}
.hljs-emphasis {
color: #A36AC7;
font-style: italic
}
/* base0F - Deprecated, Opening/Closing Embedded Language Tags, e.g. <?php ?> */
/*
prevent top level .keyword and .string scopes
from leaking into meta by accident
*/
.hljs-meta,
.hljs-meta .hljs-keyword,
.hljs-meta .hljs-string {
color: #3971ED
}
/* for v10 compatible themes */
.hljs-meta .hljs-keyword,
.hljs-meta-keyword {
font-weight: bold
}
37 changes: 17 additions & 20 deletions demo/testcode.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
<meta charset="UTF-8" />
<script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release/build/highlight.min.js"></script>
<script charset="UTF-8" src="../dist/apex.min.js"></script>
<link rel="stylesheet" href="./highlight.css" />
<link rel="stylesheet" href="./testcode.css" />
<script>
//hljs.configure({ ignoreUnescapedHTML: true, ignoreIllegals: false });
hljs.debugMode();
hljs.highlightAll();
</script>
Expand All @@ -20,6 +19,20 @@
</head>

<body>
<pre><code>
List&lt;SObject&gt; mylist = [SELECT Name, StreetAddress__c, COUNT(),
FROM Warehouse__c
WHERE DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi') < 20
AND Date__kav NOT IN LAST_N_DAYS:80
ORDER BY DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi')
LIMIT 10];
</code></pre>
<pre><code>
@IsTest
private without sharing class myTestClass {

}
</code></pre>
<pre><code>
/*
Copyright (c) 2022, salesforce.com, inc.
Expand Down Expand Up @@ -543,7 +556,7 @@
</code></pre>

<pre><code class="">
public without sharing class AccountSampleTriggerHandler extends TriggerHandler, Database.schedulable, Batchable&lt;SObject&gt; {
public without sharing class AccountSampleTriggerHandler extends Database.schedulable, TriggerHandler, Database.Batchable&lt;SObject&gt; {
private List&lt;Account&gt; newRecords;
private List&lt;Account&gt; oldRecords;
private Map&lt;Id, Account&gt; newRecordsMap;
Expand All @@ -553,21 +566,6 @@
when 'BEFORE_INSERT' {
this.triggerEvent = System.TriggerOperation.BEFORE_INSERT;
}
when 'BEFORE_UPDATE' {
this.triggerEvent = System.TriggerOperation.BEFORE_UPDATE;
}
when 'BEFORE_DELETE' {
this.triggerEvent = System.TriggerOperation.BEFORE_DELETE;
}
when 'AFTER_INSERT' {
this.triggerEvent = System.TriggerOperation.AFTER_INSERT;
}
when 'AFTER_UPDATE' {
this.triggerEvent = System.TriggerOperation.AFTER_UPDATE;
}
when 'AFTER_DELETE' {
this.triggerEvent = System.TriggerOperation.AFTER_DELETE;
}
when 'AFTER_UNDELETE' {
this.triggerEvent = System.TriggerOperation.AFTER_UNDELETE;
}
Expand Down Expand Up @@ -643,7 +641,6 @@
@InvocableMethod(label='my invocable')
public void moveTo(
integer x,
integer y,
integer z
) {

Expand All @@ -653,7 +650,7 @@
Boolean ai = (Boolean) false;
System.debug('Should not be called');
if (1 > 5) { // wtf!?
Database.insert(myAccounts);
Database.insert(myAccounts, AccessLevel.USER_MODE);
}
}

Expand Down
65 changes: 65 additions & 0 deletions demo/vs.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
Visual Studio-like style based on original C# coloring by Jason Diamond <[email protected]>
*/
.hljs {
background: white;
color: black;
}

.hljs-comment,
.hljs-quote,
.hljs-variable {
color: #008000;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag {
color: #00f;
}

.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition {
color: #a31515;
}

.hljs-deletion,
.hljs-selector-attr,
.hljs-selector-pseudo,
.hljs-meta {
color: #2b91af;
}

.hljs-doctag {
color: #808080;
}

.hljs-attr {
color: #f00;
}

.hljs-symbol,
.hljs-bullet,
.hljs-link {
color: #00b0e8;
}


.hljs-emphasis {
font-style: italic;
}

.hljs-strong {
font-weight: bold;
}
Loading

0 comments on commit 64cd1fe

Please sign in to comment.