Giter Club home page Giter Club logo

Comments (5)

rlv-dan avatar rlv-dan commented on September 4, 2024

While I would not mind this, it would be better if someone else who actually uses RTL did it since I know nothing about it.

from snap2html.

Stamimail avatar Stamimail commented on September 4, 2024

I don't think it will be difficult.
As far as I understand, it just needs to inject, dir attribute (dir="rtl"), where needed.

https://www.w3schools.com/tags/att_global_dir.asp
https://www.w3schools.com/cssref/pr_text_direction.asp
https://www.w3schools.com/jsref/prop_style_direction.asp

The difficulty (for me) will be:

  1. How to make the Toggle mechanism
  2. Identify exactly which <div>s need to to be flipped
    and making them <div dir="rtl">

Searching the web, I can see they played with the CSS:
https://www.youtube.com/watch?v=3qQeCPl3cjk
http://www.moreonfew.com/how-to-convert-ltr-website-to-rtl-website/

from snap2html.

pyrescene avatar pyrescene commented on September 4, 2024

@Stamimail Add this into the template.html file:

<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
  var location = document.getElementsByClassName("app_header_stats")[0];
  var button = document.createElement("button");
  button.appendChild(document.createTextNode("Toggle LTR - RTL"));
  button.onclick = LtrRtlToggle;
  location.appendChild(button)
});

function LtrRtlToggle() {
  var button = document.getElementById("wrapper");
  button.dir = button.dir == "rtl" ? "ltr" : "rtl";
}
</script>

Does that work as expected?

from snap2html.

Stamimail avatar Stamimail commented on September 4, 2024

@pyrescene It does make changes and toggling LTR / RTL.
The problem is how to mark those elements that should be inverted, and which not.

  1. Identify exactly which <div>s need to to be flipped
    and making them <div dir="rtl">

For example:
The whole header shouldn't be inverted.
The navigation pane should be to the right of the main pane.
Folders and files in the NameColumn should be aligned to the right, with their icon to the right.

from snap2html.

Stamimail avatar Stamimail commented on September 4, 2024

Maybe we'll try to use class, inserting class in some elements, something like:
class="RTL_mark"
Can you make a script for class?
I guess a hotkey (Alt+V, View) for toggling LTR / RTL will be better for testing than a button.
Perhaps by trial and error of class injection we can solve this out.

from snap2html.

Related Issues (20)

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.