-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:eyra/mono into dependabot/npm_and…
…_yarn/core/assets/stylelint-15.10.1 # Conflicts: # core/assets/package-lock.json
- Loading branch information
Showing
367 changed files
with
10,815 additions
and
8,588 deletions.
There are no files selected for viewing
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
const COLLAPSED = "collapsed"; | ||
const EXPANDED = "expanded"; | ||
|
||
const COLLAPSED_VIEW = "cell-collapsed-view"; | ||
const EXPANDED_VIEW = "cell-expanded-view"; | ||
|
||
const COLLAPSE_BUTTON = "cell-collapse-button"; | ||
const EXPAND_BUTTON = "cell-expand-button"; | ||
|
||
export const Cell = { | ||
mounted() { | ||
this.collapseButton = this.el.getElementsByClassName(COLLAPSE_BUTTON)[0]; | ||
this.collapsedView = this.el.getElementsByClassName(COLLAPSED_VIEW)[0]; | ||
|
||
this.expandButton = this.el.getElementsByClassName(EXPAND_BUTTON)[0]; | ||
this.expandedView = this.el.getElementsByClassName(EXPANDED_VIEW)[0]; | ||
|
||
this.collapseButton.addEventListener("click", (event) => { | ||
event.stopPropagation(); | ||
this.updateStatus(COLLAPSED); | ||
}); | ||
|
||
this.expandButton.addEventListener("click", (event) => { | ||
event.stopPropagation(); | ||
this.updateStatus(EXPANDED); | ||
}); | ||
|
||
var initialStatus = this.el.dataset.initialStatus | ||
? this.el.dataset.initialTab | ||
: COLLAPSED; | ||
|
||
var savedStatus = this.loadStatus(); | ||
this.status = savedStatus ? savedStatus : initialStatus; | ||
this.updateUI(); | ||
}, | ||
|
||
updated() { | ||
this.updateUI(); | ||
}, | ||
|
||
loadStatus() { | ||
const key = this.getStatusKey(); | ||
const status = window.localStorage.getItem(key); | ||
if (typeof status === "string") { | ||
return status; | ||
} | ||
return undefined; | ||
}, | ||
|
||
saveStatus() { | ||
console.info("saveStatus ", this.status); | ||
window.localStorage.setItem(this.getStatusKey(), this.status); | ||
}, | ||
|
||
getStatusKey() { | ||
return "cell://" + this.el.id + "/status"; | ||
}, | ||
|
||
updateStatus(status) { | ||
this.status = status; | ||
this.saveStatus(); | ||
this.updateUI(); | ||
}, | ||
|
||
updateUI() { | ||
if (this.status == EXPANDED) { | ||
this.hide(this.collapsedView); | ||
this.show(this.expandedView); | ||
} else { | ||
this.show(this.collapsedView); | ||
this.hide(this.expandedView); | ||
} | ||
}, | ||
hide(element) { | ||
if (!element.classList.contains("hidden")) { | ||
element.classList.add("hidden"); | ||
} | ||
}, | ||
show(element) { | ||
element.classList.remove("hidden"); | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export const FeldsparApp = { | ||
mounted() { | ||
console.log("FeldsparApp MOUNTED"); | ||
|
||
const iframe = this.getIframe(); | ||
iframe.addEventListener("load", () => { | ||
this.onFrameLoaded(); | ||
}); | ||
iframe.setAttribute("src", this.el.dataset.src); | ||
}, | ||
|
||
getIframe() { | ||
return this.el.querySelector("iframe"); | ||
}, | ||
|
||
onFrameLoaded() { | ||
console.log("Initializing iframe app"); | ||
this.channel = new MessageChannel(); | ||
this.channel.port1.onmessage = (e) => { | ||
this.handleMessage(e); | ||
}; | ||
this.getIframe().contentWindow.postMessage("init", "*", [ | ||
this.channel.port2, | ||
]); | ||
}, | ||
|
||
handleMessage(e) { | ||
this.pushEvent("app_event", e.data); | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.