Skip to content

Commit

Permalink
contextjs show focus again
Browse files Browse the repository at this point in the history
SQUASHED: contextjs-show-focus-again,
  • Loading branch information
JensLincke committed Jun 10, 2024
1 parent 893e43e commit 773ccfb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
21 changes: 21 additions & 0 deletions demos/contextjs/showfocuslayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# ShowFocus Layer

And I wrote it again.... Because I did not look for <edit://demos/contextjs/showfocuslayer.js> first

```js
import * as cop from "src/client/ContextJS/src/contextjs.js";

cop.layer(window, "ShowFocus").refineClass(HTMLElement, {

focus(...args) {
lively.showElement(this)
console.log("focus " + this, lively.stack())
return cop.proceed(...args)
}

})

ShowFocus.beGlobal()

ShowFocus.beNotGlobal()
```
2 changes: 1 addition & 1 deletion src/components/widgets/lively-code-mirror.js
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ export default class LivelyCodeMirror extends HTMLElement {
}

focus() {
// lively.notify("[codemirror] focus")
lively.notify("[codemirror] focus")
if (this.editor) {
// if (this.editor.options.readOnly == "nocursor") {
// // console.warn("[lively-code-mirror] prevent focus")
Expand Down
6 changes: 3 additions & 3 deletions src/systemjs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function isWorkspace(load) {
}


const WORKSPACE_REGEX = /^\/?workspace(async)?((js)|(ts))?:/
const WORKSPACE_REGEX = /^\/?workspace(async)?((js)|(ts)|(mjs))?:/

// export async function locate(load) {
// // does the resolving relative workspace urls belong here?
Expand Down Expand Up @@ -623,7 +623,7 @@ orginalResolve = orginalResolve.originalFunction || orginalResolve
function systemResolve(id, parentUrl) {
let result
try {
if (parentUrl && parentUrl.match(/workspace\:/) && id && id.match(/.*\.((js)|(ts))$/)) {
if (parentUrl && parentUrl.match(/workspace\:/) && id && id.match(/.*\.((js)|(ts)|(mjs))$/)) {

if (id.match(/^[a-zA-Z]/)) {
// Non relative files
Expand All @@ -634,7 +634,7 @@ function systemResolve(id, parentUrl) {
var baseId = m[1]
var targetModule = m[2]

if (targetModule.match(/\.((js)|(ts))$/)) {
if (targetModule.match(/\.((js)|(ts)|(mjs))$/)) {
var protocoll = new URL(lively4url).protocol
if (targetModule.match(/^lively-kernel\.org/)) {
protocoll = "https:" // accessing lively-kernel from localhost....
Expand Down

0 comments on commit 773ccfb

Please sign in to comment.