Giter VIP home page Giter VIP logo

digitalpalireader's Introduction

Build Status Release Status License: CC BY-NC-SA 4.0

Digital Pāli Reader

Current backlog is maintained here.

The Digital Pāli Reader is a tool much like a hard-copy language reader. The tool includes the Pāli canon and related scriptures. It includes multiple dictionaries to facilitate reading the scriptures. In addition to enabling an immersive experience for the study of the Tipitaka, it is also useful in the study of the Pāli language at an advanced level. The Digital Pāli Reader is used by Buddhist monks in their Pāli studies, at Universities around the world and by lay users for study at home.

Build and test instructions

Run DPR on the local machine:

  1. Install dependencies: yarn
  2. Run "start" script in root folder: yarn start
  3. Browse to http://localhost:8085

Run tests:

yarn test

Lint:

yarn lint

Build service worker:

yarn build:sw

Modern HTML5/CSS3/ES6

webpack & friends

Working effectively with legacy code

The current codebase has organically evolved since the last decade. Every piece of code implements some critical functionality.

For the following reasons working with the code base is tricky:

  • Lots of students, professors, monastics depend on DPR for their day to day work.
  • Code and markup aren't cleanly separated, special care must be taken to not break stuff when changing the code.
  • Manual testing process are not yet streamlined.

Over a period of time with care and above infrastructure support (linters, prettiers, testing processes), the code base will evolve to be much easier to change.

Here is an excellent book for techniques for working effectively with legacy code.

Guidelines for contributions

This is a 'live' section. Feel free to suggest amendments through PRs.

  1. DO reuse existing code. Remember that features that are being ported over from XUL to Web are already working.
  2. DO make only the minimum changes necessary for implementing features, fixing bugs. VSCode will auto format those changes as per .editorconfig and other settings.
  3. DO abstract out HTML ids behind PAL interface. E.g. DPR_PAL.getDifId();
  4. DO ask for buddy testing.
  5. DO test all scenarios (TBD: Link to manual test scenarios that every commit must pass)
  6. DO resolve all PR comments through discussion.
  7. DO follow the project conventions for all new code: ES6, jQuery, HTML5, CSS3, Bootstrap.
  8. DON'T bulk format files. This makes it very hard to trace the exact changes in case a revert is required.
  9. DON'T do non-trivial refactoring. It becomes hard to track changes across commit and revert selectively when necessary.
  10. DON'T change HTML class names or ids. It is hard to tell which is being directly referenced form the code.

Upcoming Infrastructure support to make codebase easy to change

  • Linters.
  • Unit tests.
  • Effective manual testing process.

Useful links

digitalpalireader's People

Contributors

annieefu avatar arthurdamm avatar bhamiltoncx avatar bksubhuti avatar catalin-i avatar cesiumetta avatar dangeol avatar dpradmin avatar johnwang16 avatar marcusgaleotti avatar parthopdas avatar placoderm avatar rrogowski avatar smkvr98 avatar snuniverse avatar spal02482 avatar sumbodhi avatar sureshtadisetty avatar yuttadhammo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

digitalpalireader's Issues

Dictionary: DPR analysis results are always shown in the bottom pane. This is not consistent with DPRv1

[Split from #53]
4. To be discussed: DPR analysis results are always shown in the bottom pane. This is not consistent with DPRv1 where sometimes - depending on the context - results are shown in the main pane. However this was for me a way to quickly establish this functionality, as there were two divs with identical id divb which caused trouble, and I renamed one of them to divb2.

This must be also covered by this issue (was tracked by #53):
When doing a PED, DPPN or CPED, or combined term search and then clicking on a term, the bottom frame should open if it's closed, but doesn't. It should automatically open. Alternatively, the results should be displayed in the main frame instead of the bottom frame.

Navigation on iPad and mobile

Acceptance criteria:

  • sidebar should take up full screen
  • sidebar should behave well
  • bottom-panel should behave well
  • for iPad and mobile

Fix Search: handle multiple books and parts properly

The general search functionality is implemented, however the following issues need still to be resolved:

  • category Books in Set: properly send the selected books in searchBook

  • category Partial Book: properly send the selected part in searchPart

This might involve fixing web\navigation_sidebar.js
searchBook and searchPart are temporarily parsed as int

Search: RegEx not on par with DPRv1

Ticking RegEx check box or not makes no difference.

Ensure the following cases work before closing this issue:

  • āmi\b which should list hundreds of results -> this will be fixed by #56
  • For example when searching for arahan.* , it makes no difference whether Regex is checked or not. To be consistent with DPRv1, unticking RegEx should give no results for arahan.*

Search: broken functionality for strings containing diacritics

The letters with diacritical marks are converted into a UTF-8 hex format, causing troubles. This bug must have been introduced recently.
Using commit #408039f from three weeks ago, this bug was not yet there.

Ensure the following cases work before closing this issue:

  • karaṇīya
  • kara.niiya
  • dāna

This screenshot shows the problem for the search string dāna.
2020-02-16 14_17_01-Search_ 'd%C4%81na' in Multiple Sets

Migrate to SCSS

Migrate from CSS to SCSS for ease in parameterising styling .

GDPR stuff

@cesiumetta please use this text. I will work with @christopherdolan to get you the link to sirimangalo policy.

Digital Pāli Reader uses cookies and similar technologies on our website and platform to operate and our services, customize your experience with our services, test new changes and features, help us understand how you use our services. You can read more about this in our Cookie Policy.
OK, hide this

image

Navigation sidebar: Misc bugs

  • bugs in sidebar
    • close sidebar on selection
    • clicking on nav-meta button does not have any effect
    • clicking on nav-sutta nav-vagga etc buttons all behave the same
    • clicking on elsewhere on the sidebar closes it

Dictionary issues

As of Sunday 2/9/20 it seems the dictionary is less functional than before.

-I can’t get the case button to work

-Dictionary pane sometimes doesn’t load detailed definition information anymore (however still shows quick definition on top line of pane.) Clicking on the searched word on the top left line of dictionary pane does not make the detailed info pane below respond by bringing up the definition. For example, when clicking on either of the parts of a compound word.

-When clicking on bar to hide/show dictionary pane it often opens and closes 3 times (sometimes fewer) before remaining open or closed.

-After leaving the browser page (safari on iOS) temporarily to do other activity on my phone, upon return to the browser page that has DPR loaded the dictionary pane becomes blank and does not contain the previously visible searched word and definition.

Enable building on windows

Please add sanskrit/content/ and node-modules/ to .gitignore. The sanskrit/content/ folder contains filenames coming from Linux as a case-sensitive environment, which cause case conflicts in case-insensitive environments such as Windows.

Remove need for server

Local files can be read by making security.file.uri.strict to false It is safe and only allows current folder and subfolders to be accessed. Makes testing a breeze

Bugs in navigation

Following issues need to be fixed

  • chevron in bottom panel w/ rotating
  • watermark in the screen by default
  • scrolling in bottom panel hidden
  • unable to scroll main panel
  • background color is not set to colbk (should be picking up the value from prefload.js line 93)

Search: broken functionality for strings containing diacritics

The letters with diacritical marks are converted into a UTF-8 hex format, causing troubles. This bug must have been introduced recently.
Using commit #408039f from three weeks ago, this bug was not yet there. This screenshot shows the problem for the search string dāna.
2020-02-16 14_17_01-Search_ 'd%C4%81na' in Multiple Sets

include forms of words

DPRWeb needs forms of the words added to the definitions.
both verbs nouns and also adjectives.

Very helpful for beginners especially the irregular or advaced forms..
kar
or
bhagavant

This should already be accesssible in code or be fairly simple to implement for the dictionary parser to do. (It should already have this information). It is rarely seen in the old DPR if at all.

Old dpr used to have a declension display tab.
However, I'm asking for the actual declension to be displayed rather than a chart.

Please see the latest TPP vid I sent.. where I show grammar.. also the original TPP 17 min one I sent a while back. One of the dictionaries has this already. but this dictionary is not as "on mark" as the new dpr.

code will be available under bksubhuti soon

Perhaps it can be formulated as it is parsing codes are given. (There are many times multiple choices.. eg. data and gen are similar).
Then display that code as a fully transliterated form ..

Implement basic menu in the sidebar

While we sort out the final app structure, we need a temporary way to navigate between "Navigation", "Search" & "Dictionary".

Need to implement that in the sidebar.

For slow networks indicate percentage completion and hint that things havent stalled.

One of the issues (main issues) with dprweb is the slowness to load. It may be perceived as broken when in fact, it is a slow connection for those in Asia (a decent day is 50-60 KB/s
(thats a big B for Bytes). 100 KB/s and 200 speeds means things are working really well, usually in off hours.

Solution: Have the dots rotaing in a circle thing.
If possible show a feedback on loading progress because.. even though we get the "hourglass" if there is nothing happening for a while.. we still feedback.. percentage is good.
Perhaps load the light stuff first. Then load the heavy stuff.
There is an async
https://www.w3schools.com/tags/att_script_async.asp

Sidebar: some bugs regarding opening and closing of sidebar

  • When clicking the link to the sidebar for the first time, the sidebar comes up, the rest of the page goes blank and there is no way to go back. Also the sidebar takes a while to load the first time everything is blank. Suggest keeping the initial instructions on the main pane.

  • When clicking a link from the search results, the side bar shows up (instead of staying collapsed).

  • Side bar does not collapse automatically when using the dictionary as it does when using the navigation and search.

  • Sometimes nothing happens when clicking on the sidebar link (the three lines)

Broken Local Build

The local build does not work by itself.
Actually the project for HTML and web should be separated and a clean build should be made.
This is a high priority because the root build does lots of unneccessary things and is a security risk. Very undesirable to run for potential helpers.

Yarn should be listed as needed to be installed, but if these resultant files are text files then best to just include them in the project. IF they are binary. Include a note that these files need to be built and yarn needs to be installed.

The ability to build a system is essential and basic and critical root problem.

Dictionary: misc bugs concerning layout/behaviour

  1. When clicking on an item of the PED full-text search result page, the top navigation bar disappears fixed by #86

  2. When clicking on book references in term search or title search results, a new tab is opened instead of the current one reused this is actually consistent with DPRv1

  3. Sometimes, when clicking on a word in the text, and by clicking the dictionary search button, the bottom frame double angle up/down symbol rotates, but shouldn't. Reproduce by clicking on words here: http://127.0.0.1:8080/DPRHTML/index.html?loc=g.3.0.0.5.0.0.m&para=9&analysis=accuccasaddo as of 2020-02-20 can't reproduce this any more

  4. When doing a "PED, DPPN & CPED" term search and then clicking on a term, the bottom frame should open if it's closed, but doesn't. Alternatively, the results should be displayed in the main frame instead of the bottom frame. Tracked by #77

  5. When a book section text is displayed in the main frame, and you then perform a DPR analysis by entering a search term and clicking on dictButton, the main frame div paliTextContent is cleared. However, when just hitting enter key instead of clicking on dictButton, the content is not cleared. The content should not be cleared.

[Videos for most important scenarios] Product help

Currently help page is a copy of the XUL help.

  • Not all features are carried over to web/mobile.
  • There are minor tweaks in the features as well (e.g. deep links)

Need to ensure help page reflects the above

Switch back to history.pushState in DPRChrome.openDPRTab

history.pushState was originally used so as to not refresh the page.

however if you see history.pushState does not update the page when url params changes. e.g. when you change dict search options and hit search button, url gets updated by not the page.

any idea what might be happening?
for now i have just use location.href but its ugly as the entire page refreshes.
any idea what is a better fix?

Navigation, quick links: sending away of help box

Quick links: Once you click on the ? and the box with description appears, it is not easy to send that box away. Clicking in other places does not work - we have to click on the ? button again.
The box should go away by clicking elsewhere. Also, make the tooltip style consistent with all the other tooltips.

Landing page issues

  1. For the first point, suggest rephrasing to: To start, open the sidebar then choose a Set, Book, Book Hierarchy and click the => button to see the contents.
  2. Add it may be helpful to add the second way to see the contents: You could also view the sutta by directly entering the Set shortname and Sutta number (for instance mn 10) in quick links.
  3. Remove this for alpha: For detailed instructions, click here for the help page.
  4. Remove this and add the feedback form. "If you have questions or feedback, send email to [email protected]."
  5. [TBD by @shraddha314] Create a new dpr email address and create a feedback form

Enable mobile scenario

AC:

  1. Make DPR usable on mobile.

  2. First button under book heirarchy in navigation sidebar (next to brahmajalasuttam) looks strange as if there are two buttons layered on each other.
    E4E18F67-6057-44FF-8FB4-092D52662AF7

  3. Search can't find certain terms that I think are in the nikayas. For example Uggatasariiro.

  4. Once search does find a term, cant scroll down on search results page.

  5. Sometimes there are delayed responses to clicks and button presses. Sometimes dictionary pane doesnt respond at all to clicking on Pali words. Could be helpful to show a visual change on the Pali word as it is pressed to indicate it has been pressed.

  6. Because mobile clicks are hard to do with accuracy on small text, I have to zoom in, click on a Pali word, then scroll all the way down to the dictionary pane. The process is slowed down even more when a Pali word failed to respond to a click. Could be useful for dictionary pane to always stick to bottom of screen regardless of zoom or scroll.

  7. Box in upper left hand corner to open sidebar is tiny on mobile and hard to click.

  8. Any click in sidebar below all buttons and dropdowns makes sidebar collapse. I sometimes unintentionally collapse sidebar in this way when dragging to scroll.

  9. Autocorrect and predictive text slows down text entry for searches etc. Not sure if this can be turned off for certain text boxes.

  10. Would be useful for me if there was an option to open dictionary searches straight to the declension cases. The tiny c is hard to press and I find myself going to the cases often when using the dictionary to translate Pali texts outside of the DPR.

  11. Would be useful in certain instances for me if there was an option to present full English translations next to/below Pali version.

  12. However, wrapping text in dictionary pane seems to have caused a new problem with occasional inability to scroll down in dictionary pane.

  13. give feedback button seems big and may be blocking something? I can’t tell.

  14. context menu buttons are slow to respond, look askew a little with respect to each other, and are somewhat difficult to click on mobile
    C21D4F93-1CDA-4142-A453-51E5DD1F41C6

  15. definition section of dictionary pane becomes hidden and unscrollable sometimes. For example, when searching dārukkhaṇḍakena, and selecting the second breakup in the drop down, and clicking on “kkha,” the definition section is too low to be visible and cannot be touched or scrolled
    F581166D-A29A-4DBE-8568-7E02A2E90C6F

Search and Dictionary: Results sometimes not scrollable

The search behaves a bit strangely. When searching for certain terms the main pane is scrollable whereas when searching some other terms the main pane where the search results show up is not scrollable and I can only see whatever is visible - it is not possible to scroll down to see everything. Try searching "kaya" (main pane scrollable) and "cula" (main pane not scrollable).

Regarding the Dictionary: The results page is generally not scrollable. Test with "kar".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.