Cleanup assets
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
@tailwind typography;
|
||||
|
@@ -1,31 +0,0 @@
|
||||
import "../../../../slices/main/assets/builds/app.css";
|
||||
import "../css/app.css";
|
||||
|
||||
(function() {
|
||||
document.addEventListener('alpine:init', () => {
|
||||
Alpine.magic('clipboard', () => {
|
||||
return subject => navigator.clipboard.writeText(subject)
|
||||
})
|
||||
|
||||
Alpine.magic('textHighlighter', (el, {Alpine}) => {
|
||||
return {
|
||||
isOpen: false,
|
||||
anchorX: "0px",
|
||||
anchorY: "0px",
|
||||
selection: null,
|
||||
text: "",
|
||||
highlightText() {
|
||||
this.isOpen = false
|
||||
// document.
|
||||
this.selection = document.getSelection()
|
||||
this.text = this.selection.toString()
|
||||
const anchor = this.selection.focusNode.parentElement.getBoundingClientRect()
|
||||
this.isOpen = el.contains(this.selection.focusNode) && this.selection.focusOffset != this.selection.anchorOffset;
|
||||
|
||||
this.anchorX = `${anchor.left - 170}px`
|
||||
this.anchorY = `${anchor.top + window.scrollY}px`
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})();
|
36
slices/admin/assets/js/app.ts
Normal file
36
slices/admin/assets/js/app.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
// import "../../../../slices/main/assets/builds/app.css";
|
||||
import "@main/css/app.css";
|
||||
import "@app/builds/tailwind.css";
|
||||
import "../css/app.css";
|
||||
|
||||
(function () {
|
||||
document.addEventListener("alpine:init", () => {
|
||||
Alpine.magic("clipboard", () => {
|
||||
return (subject) => navigator.clipboard.writeText(subject);
|
||||
});
|
||||
|
||||
Alpine.magic("textHighlighter", (el, { Alpine }) => {
|
||||
return {
|
||||
isOpen: false,
|
||||
anchorX: "0px",
|
||||
anchorY: "0px",
|
||||
selection: null,
|
||||
text: "",
|
||||
highlightText() {
|
||||
this.isOpen = false;
|
||||
// document.
|
||||
this.selection = document.getSelection();
|
||||
this.text = this.selection.toString();
|
||||
const anchor =
|
||||
this.selection.focusNode.parentElement.getBoundingClientRect();
|
||||
this.isOpen =
|
||||
el.contains(this.selection.focusNode) &&
|
||||
this.selection.focusOffset != this.selection.anchorOffset;
|
||||
|
||||
this.anchorX = `${anchor.left - 170}px`;
|
||||
this.anchorY = `${anchor.top + window.scrollY}px`;
|
||||
},
|
||||
};
|
||||
});
|
||||
});
|
||||
})();
|
@@ -55,12 +55,12 @@ module Admin
|
||||
|
||||
def inline_image_sources
|
||||
inline_images
|
||||
&.select {|attr, _value| attr == "src"}
|
||||
&.map {|img| img[1] } || []
|
||||
&.select { |attr, _value| attr == "src" }
|
||||
&.map { |img| img[1] } || []
|
||||
end
|
||||
|
||||
def photo_sources
|
||||
photos.map{|photo| photo["value"]}
|
||||
photos.map { |photo| photo["value"] }
|
||||
end
|
||||
|
||||
def prefix_emoji
|
||||
@@ -146,7 +146,7 @@ module Admin
|
||||
end
|
||||
|
||||
def to_h
|
||||
clean_content = CGI::unescapeHTML(content.gsub(/<\/?[^>]*>/, "")).strip
|
||||
clean_content = CGI.unescapeHTML(content.gsub(/<\/?[^>]*>/, "")).strip
|
||||
clean_content = clean_content.gsub(prefix_emoji[0], "") if prefix_emoji
|
||||
{
|
||||
id: slug,
|
||||
|
Reference in New Issue
Block a user