AšŸ”Œ browser extension for SuttaCentral

I tried! It seems that browsers force an extension to put all of it’s things into one item. It kind of makes sense, otherwise the context menu could get real long. I mean, wouldn’t every extension maker want all of their features top level? I’ll keep asking around. I think if only one was enabled then it goes to the top level. So remind me to add a setting to disable them one by one, and that might fix it. And of course you could extract that feature into it’s own extension. The framework I’m using makes this super easy.

Yeah, this has to do with detecting the element being hovered over. To detect parents all the way up till you get to an <a> tag might be a drag on performance. Remember, with this feature it is listening for every element that you hover over on every web page you visit. I can’t remember if there is already debouncing going on or not.

It seems that in HTML5 it’s legal to wrap a block level element with a tags even though a tags are line level. ĀÆ\_(惄)_/ĀÆ

It may not be able to support blurbs in every single instance. For example on Mastodon it appears that the way links are shortened for display purposes also messes with this feature.

BTW, I have disabled this feature on the CIPS because pop up blurbs are native to the app. If there are other sites where the blurbs are problematic I can hard disable them. Once there are settings users could also disable specific sites I guess.

2 Likes

This will probably be the last release for several days, so now is a great time to get on board.

To install them you will have to unzip and then follow the instructions in this video

This release, Ronnie does the following:

New

  • Clicking on a segment number copies the URL to that sehment to the clipboard.
  • . to select only translation
  • , to select only root language
  • Similar to the additional translations notification, there is now a count of Pali parallels for the sutta. Please think about how you might want to customize this once settings are added.
  • attempts to make the view settings vertical instead of horizontal (ugly, needs CSS help)
  • As a proof of concept, all of the native hotkeys are now also spoofed to numbers 1–9. (Old keys still work too.) Once there are settings, this kind of feature will allow folks who use non-latin keyboards to use their own shortcuts. Or maybe numbers are enough since everyone has numbers?

other

  • possibly fixes the hovering over linked images issue @stu mentioned
  • h will now add the how long it takes to read instead of always being visible. (I’m running out of hotkey letters, lol) May change once there are settings.
  • Fix bug with extension hotkeys firing when in text field.

Single language selection:

This may not feel as natural or intuitive as you might like, but it works and it’s not terrible.

Number of Pali parallels

Vertical options

Ugly!!! But vertical. CSS first aid needed.


So this really completes everything I expected to do short of personal bookmarks and notes. But that will require a much more extensive level of coding. The only thing left is to get a working alternate menu system (if one is able to be made) and a settings interface.

More ideas/suggestions/bug reports always welcome.


PS: RE: clicking segment id copied to clipboard

My thinking is that clicking on the refs does something bot not much useful. Visually, it scrolls that segment to the top of the viewport and colors in the pill. Hidden, it appends the # to the URL. So what’s the point in clicking on it? No reason to scroll or change color. The only reason I see to do it is if you want to get a copy of the url to that segment. (Although I guess you could click in anticipation of bookmarking the page. In that case the cost would be putting something into your clipboard that you didn’t mean to. If this feature was ever implemented it might mean that clicking on the ref really does do something important, in which case this would be better to keep in an extension.)

2 Likes

Yep. I will take care of that when I’m done hand massaging the menu.
I’d start by making it half as wide :slight_smile:

4 Likes

It does. Thanks Bhante. But it has introduced a new ā€˜feature’

Here’s some link code:

<a href='https://suttacentral.net/mn101'>This is a refence for MN101—This text is outside the span. It behaves as I anticipate. I hover over it and the blurb appears, I move the cursor away and the blurb disappears....<span>This text is inside a span. When I hover over this text, the blurb appears. But when I move my cursor away it leaves the blurb behind</span> </a>

This is a refence for MN101—This text is outside the span. It behaves as I anticipate. I hover over it and the blurb appears, I move the cursor away and the blurb disappears…This text is inside a span. When I hover over this text, the blurb appears. But when I move my cursor away it leaves the blurb behind

2 Likes

Ugh. Thanks so much for this example. I can now consistently reproduce. I will trouble shoot. It’s trickier than it looks. But then again, everything looks tricky to me.

The original tricky bit was how to deal with the situation where the toast covered up the original link. I think the expectation is that as long as the cursor is in the toast it should stay active.

1 Like

OK, this release is titled ā€œHave it Your Wayā€

The major changes:

  • Lots of new themes that you get to pick
  • You can pick the color of root and translation text. Almost any modern css color can be entered, including words like lightgoldenrodyellow or lightsteelblue
  • Set your words per minute to calculate reading time.
  • Most (but not all!!) settings will update live while viewing the site
  • Notifications of existence of Pali parallels.
  • In Chrome (and Chromium type browsers) you can list the sites you don’t want to see the blurb popups. That setting is ignored in Firefox. You can turn them off completely, but you can’t customize what sites they appear on.

Some general notes…

Personally I’m interested sometimes in knowing if a sutta has Pali parallels. But I know other people (@josephzizys ?) might be interested in more than just Pali. If I can hear a detailed request for how that should work, I’m open to changing it.

If you find bugs, please let me know what browser you are on.

4 Likes

This might be something we can have an icon for in the menu. It’s in the file that I will be pulling. However, I’m just setting myself up for more pain!

4 Likes

I’ll also mention that unless folks who have asked for bookmarking/note taking in the past (e.g. @hmong.buddhism, @mettazaremba, @Jhana4) come forward and sketch out how something like that would look, preferably by pointing to existing plugins that have the functionality they want, I’m not likely to implement that. Simply because it’s not something I would use and I don’t want to design it without even one person needing it.

I did try out this plugin (also available in Chrome store) and thought that the functionality would be fairly easy to re-create. I do have doubts, though, if it would be effective for hundreds of notes. I’m much more partial to using a dedicated notetaking app like Joplin. It already has a page clipper that someone could use to clip bits of suttas they liked. And the current feature of l to make a nice markdown link to a sutta has apps like that in mind. And I’m even open to how an extension for Joplin might be useful.

2 Likes

To install them you will have to unzip and then follow the instructions in this video

New in this release, vpMenu:

  • fully functioning alternative navigation
  • Unique favicon for this forum like it was in the past (sometimes working)
  • Add brackets to ā€œaddedā€ text instead of just having them be grey.
  • Insert custom CSS for the main site as well as this forum
  • More new themes

Alternative navigation

Thanks to the tireless work of Ven. @Pasanna, there is now a drop down/expanding menu.

Some items have blurbs under the (i) icon:

Please give it a thorough investigation. Now is the time for all those who have had issues with the native navigation system to come forward and offer specific feedback. (@Mkoll, @Thanuttamo, etc. etc.)

And if this menu doesn’t meet your needs, then you are welcome to build one that does. We can certainly have different options.

Unique favicon for this forum like it was in the past

image

This does not work very well! It’s a follow up on this thread: A request for sanity

It would be great if the @management Committee could take up this issue since it seems that a technical fix on the user’s end doesn’t work very well.

Add brackets to ā€œaddedā€ text instead of just having them be grey.

This restores (especially Bhante Bodhi’s texts) the print standard of indicating text ā€œaddedā€ by the translator that doesn’t strictly appear in the text. On SuttaCentral they are by default styled as gray text. Note: This doesn’t actually add the brackets into the text. It just styles them with brackets. So if you copy-paste they won’t be copied.

Insert custom CSS for the main site as well as this forum

While the plugin already adds some styling (new themes, root/translation text color, added text brackets) this allows you to add any css at all. It even allows you to break the styling of the site completely. So use with caution.

For example, if you are tired of accidentially hitting the top bar in the forum and being taken to the main site, you can add this to the forum css:

/* hide top bar that links to main SC site */
a#sc-backlink {
    display:none;
}

This is another issue that has been discussed on the forum that would be great if the @management Committee could take up.


Please take the time to try out this latest version. As soon as any wrinkles are ironed out of the new nav I will probably start trying to add to the various browser app stores. For free, of course.

7 Likes

Thanks Bhante Snowbird for all your tireless work too.
I’m going to still be fine tuning the navigation for a bit, but welcome people’s feedback.
(I know there are some wonky padding and hover issues)

4 Likes

Amazing, bhante! The navigation is so much easier with the extension. Thanks a lot for that and all the other features; sādhu 3x!

1 Like

The navigation is 100% Ven @Pasanna’s work. They have put hours into it and the latest version is even better. Hope to have that out soon. I know they would appreciate any feedback you may have.

4 Likes

Ah, I see. In this case, directed @pasanna: sādhu 3x for this handy improvement! :slight_smile:

2 Likes

Hi, do I need to install all the enhancements to date? Or does the latest version install all of the enhancements? Thanks!

1 Like

New Release: Legacy Roots

To install them you will have to unzip and then follow the instructions in this video

New:

  • Improved styling and tab navigation in alternate navigation (plus link fixes)
  • = to toggle new navigation
  • Custom copy link templating system
  • Show root text on legacy translations (experimental)
  • New seasonal theme

Improved styling and tab navigation in alternate navigation

Veen @Pasanna has been working tirelessly to improve the new navigation menu. Anumodana!

They have made it so that Tab will move you through, space will open a dropdown, and Enter will take you to the place. EXCEPT, I can’t get the focus to the menu automatically on opening, so it’s still not finished. But once you click in the menu it should work. (any help on this problem is most welcome). Perhaps now, @karl_lew, we are getting closer to a workable keyboard navigation system. Interested in your feedback.

Custom copy link templating system

Now instead of the hard coded copy Markdown link to clipboard, you can compose any kind of link you like:


And it doesn’t have to be Markdown. You could compose html or even just a plain text link.

Show root text on legacy translations

Through the magic of the SuttaCentral APIs we can now see root texts for legacy (aka non-aligned) translations. There are some considerations:

  • It’s not possible to line up the translation and the root. That data just doesn’t exist. So both panels scroll independently
  • Turning this on and off is done only through the extension options interface. It is not connected at all to the native setting of showing the root side by side. So you could have this turned off in the native view menu but turned on for legacy texts in the extension options. Feedback is welcome.
  • Segment numbers are shown by default. Again, this is independent from the native settings. It’s difficult to get an extension to work with the native settings. But if someone needs to copy the root text without the segment numbers, then at least they can click on the segment number and change the url to go directly to the plain root text. Feedback is welcome.
  • It’s a little buggy. Feedback is welcome.

You will need to uninstall the old version and re-install the latest one. Until the extension is available from the plugin ā€œstoreā€, you need to do this manually. Once it is there, though, the updates will happen silently in the background.

I’m still open to hearing about new features that folks want. I have combed through the Feedback category and have tried to pull out as many suggestions as I could find there.

4 Likes

I hesitate to think that the possibility of alignment may be indeed so bleak as to warrant the words: ā€œnot possibleā€.

My recent experience with reading Mohan’s FR translation of MN1 comes to mind. And that experience indicates that a ā€œsuggestive alignmentā€ may indeed be possible. Indeed, such alignment would require consideration and care, but alignment of texts across languages is not a novel task. Indeed, alignment of texts across languages is actually a common academic practice.

So I would invite the Sangha to consider ā€œsuggestive/probable alignmentā€ for legacy translations. Technically, it should be quite possible to have a ā€œsegment alignment fileā€ for selected legacy texts. Then both SuttaCentral and Voice could display such alignments for all to see and hear.

Voice allows for triple text comparison (e.g., Pali/English/FR) for reading and listening. Suggestive alignment is actually on the Friends of Voice meeting agenda for today because of the recent publication on SC of Mohan’s legacy FR translations. We haven’t met yet, so I have no idea where we will end up. But most likely we will end up somewhere in the realm of ā€œpossible.ā€

:pray:

You may have missed all the post where Bhante Sujato said very clearly that no time/money/effort was going to be put into anything regarding the legacy texts. If someone wants to create their own website that does this they are free to as long as they adhere to the the copyright of the translation.

Obviously my statement was not saying that lining up texts is impossible. Of course it’s possible. But with the existing data is is not.

1 Like

I also once made that exact statement myself about deprecating support for legacy texts. Over time my own view has since changed. Perhaps the SuttaCentral Sangha also will reconsider at some time. But it is also not my place to say what the SuttaCentral Sangha should do or not do.

Currently, the Friends of Voice do indeed find continuing value in both segment alignment and legacy texts. We have agreed to research the topic in the Mohan context and will keep you informed of our progress over time. The core of our mission is to share the spoken words of the Buddha for all to hear.

Interestingly, we may end up with JSON documents having SuttaCentral segment ids which would be directly compatible with SuttaCentral. As you mentioned, copyright is definitely an issue. We are aware of the issue and working on it. Notably, these JSON documents will be created outside of Bilara and will be made available with non CC0 copyrights. The advent of such documents creates an interesting opportunity for SuttaCentral in that it could then offer these documents as "semi-aligned’ translations, possibly via the browser plugin for SuttaCentral mentioned in this thread. We look forward to viewing and hearing both aligned and semi-aligned translations side by side.

:pray:

2 Likes

Now live on the Chrome and Firefox store:

I would suggest uninstalling any previous versions you side-loaded and starting fresh with an install directly from the appropriate store.

Change Log

We should be considering this extension to be ā€œexperimentalā€ at the moment. There is no way that it can hurt your computer, but there is the chance it could slow down viewing longer pages on SuttaCentral.net. I’m working on that.

Please kindly report any problems below. It’s great if you can report exactly what you were trying to do when you had a problem.

In this release…

  • Many features are turned off by default now
  • lots of bug fixes
  • making hotkey mirroring optional
  • making
  • New Nord theme done by @anon56462148
  • rewritten random sutta script also by @anon56462148
  • greatly improved shrunken View Options layout by Ven. @Pasanna (Now you can also disable if you like)
  • incremental improvements to the new navigation by Ven. @Pasanna

New View Options layout

Still needs some tweaks.

Other notes…

There may be a discrepancy between version numbers on Chrome and Firefox. I’m trying to avoid too many updates to the stores.

Safari plans are in the works.

8 Likes

This feels familiar… Wait Survey: What filters would you like for šŸ” search? - #9 by bran

My approach to the languages problem was to frame it exactly like how the website navigation does it just so that it’s consistent and predictable (not that the original layout is perfect), but it looks like you’ve already decided the other way which is probably for the better. The furnished design looks outstanding by the way!

3 Likes