From 723f25734656f21eba88fbb467c68c9ff3ae595e Mon Sep 17 00:00:00 2001 From: stevekaplan123 Date: Tue, 3 Sep 2024 12:30:06 +0300 Subject: [PATCH 1/2] chore: open source in new tab --- static/js/Sheet.jsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/static/js/Sheet.jsx b/static/js/Sheet.jsx index 185e7704b5..016bd3455f 100644 --- a/static/js/Sheet.jsx +++ b/static/js/Sheet.jsx @@ -87,12 +87,9 @@ class Sheet extends Component { } else if (Sefaria.isRef(path.slice(1))) { - e.preventDefault() - const currVersions = {en: params.get("ven"), he: params.get("vhe")}; - const options = {showHighlight: path.slice(1).indexOf("-") !== -1}; // showHighlight when ref is ranged - this.props.onCitationClick(path.slice(1), `Sheet ${this.props.sheetID}`, true, currVersions) + e.preventDefault(); + window.open(target.href); } - } } From 6d1a223ae58ce6a22f38879a904ccaede5e74529 Mon Sep 17 00:00:00 2001 From: stevekaplan123 Date: Sun, 10 Nov 2024 10:33:23 +0200 Subject: [PATCH 2/2] chore: modify SheetMetaDataBox --- static/js/Misc.jsx | 19 +++++++++++++++---- static/js/sheets/SheetContent.jsx | 31 ++++++++----------------------- 2 files changed, 23 insertions(+), 27 deletions(-) diff --git a/static/js/Misc.jsx b/static/js/Misc.jsx index 255b81f9bb..e7a381e67c 100644 --- a/static/js/Misc.jsx +++ b/static/js/Misc.jsx @@ -3042,11 +3042,22 @@ const TitleVariants = function({titles, update, options}) { } -const SheetMetaDataBox = (props) => ( -
- {props.children} +const SheetMetaDataBox = ({title, summary, authorUrl, authorStatement, authorImage, editable}) => { + return
+ + {summary && } +
-); +} const DivineNameReplacer = ({setDivineNameReplacement, divineNameReplacement}) => { return ( diff --git a/static/js/sheets/SheetContent.jsx b/static/js/sheets/SheetContent.jsx index 41a23df949..06254afced 100644 --- a/static/js/sheets/SheetContent.jsx +++ b/static/js/sheets/SheetContent.jsx @@ -2,10 +2,7 @@ import Component from "react-class"; import $ from "../sefaria/sefariaJquery"; import ReactDOM from "react-dom"; import Sefaria from "../sefaria/sefaria"; -import { - InterfaceText, ProfilePic, SheetAuthorStatement, - SheetMetaDataBox, SheetMetaDataBoxSegment -} from "../Misc"; +import {SheetMetaDataBox} from "../Misc"; import React from "react"; import classNames from "classnames"; @@ -196,8 +193,12 @@ class SheetContent extends Component { return (
- +
{sources}
@@ -212,22 +213,6 @@ class SheetContent extends Component { } } -const SheetContentMetaDataBox = ({title, summary, authorUrl, authorStatement, authorImage}) => { - return - - {summary && } - - -} class SheetSource extends Component { render() { @@ -332,7 +317,7 @@ class SheetComment extends Component { } } -class SheetHeader extends Component { +class SheetSegmentHeader extends Component { render() { const lang = Sefaria.hebrew.isHebrew(this.props.source.outsideText.stripHtml().replace(/\s+/g, ' ')) ? "he" : "en"; const containerClasses = classNames("sheetItem",