Skip to content

Commit da568d3

Browse files
committed
Fix bug with 'attach to body'
1 parent 43e8849 commit da568d3

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

dist/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,3 @@ Here are 2 small REST servers written in Python and PHP, which both perform the
55
These REST servers give your browser scripts read and write access to files on your own website and to remote servers if CORS has been set up.
66

77
The files `easycoder.php`, `ec-rest.txt` and `readme.txt` are for WordPress installations.
8-
9-
The `plugins` folder holds a variety of plugins, some documented better than others.

dist/easycoder-min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/easycoder.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3219,7 +3219,12 @@ const EasyCoder_Browser = {
32193219
let content = null;
32203220
let element = null;
32213221
if (command.cssId === `body`) {
3222-
element = document.body;
3222+
target.element[target.index] = document.body;
3223+
target.value[target.index] = {
3224+
type: `constant`,
3225+
numeric: false,
3226+
content
3227+
};
32233228
} else {
32243229
content = program.value.evaluate(program, command.cssId).content;
32253230
EasyCoder_Browser.Attach.getElementById(program, command, content, 100);

dist/easycoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
add_action('wp_enqueue_scripts', 'easycoder_enqueue_script', 2);
1717
function easycoder_enqueue_script() {
1818
wp_enqueue_script('easycoder_script',
19-
'https://easycoder.netlify.app/dist/easycoder.js', array(), '2.7.8');
19+
'https://cdn.jsdelivr.net/gh/easycoder/easycoder.github.io/dist/easycoder.js', array(), '2.7.8');
2020
}
2121

2222
// Set up default plugin and REST scripts

js/easycoder/Browser.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ const EasyCoder_Browser = {
121121
let content = null;
122122
let element = null;
123123
if (command.cssId === `body`) {
124-
element = document.body;
124+
target.element[target.index] = document.body;
125+
target.value[target.index] = {
126+
type: `constant`,
127+
numeric: false,
128+
content
129+
};
125130
} else {
126131
content = program.value.evaluate(program, command.cssId).content;
127132
EasyCoder_Browser.Attach.getElementById(program, command, content, 100);

0 commit comments

Comments
 (0)