Giter VIP home page Giter VIP logo

Comments (5)

radiac avatar radiac commented on June 12, 2024

That's a good point; ideally would be addressed by #11, to avoid running it through multiple parsers or risking regexps.

from django-yarr.

tiktuk avatar tiktuk commented on June 12, 2024

Could this be a preference? I prefer the opposite. But of course it should be consistent.

from django-yarr.

radiac avatar radiac commented on June 12, 2024

Sure, that sounds sensible - it would probably be best to have django consistently spit out the target="blank" everywhere, and then have some javascript strip it out again; that way it can be a per-user and per-device option (for example, I'd prefer new tabs on my phone, but the same tab on my desktop).

from django-yarr.

twm avatar twm commented on June 12, 2024

I absolutely agree it should be a pref, but why use JS instead of doing the processing server-side? To what extent is Yarr supposed to function without JS?

from django-yarr.

radiac avatar radiac commented on June 12, 2024

I should have said "it would probably be easiest" rather than "best"!

At the moment Yarr is fully functional without JS, but where the JS controls the layout, options are stored in JS cookies. This seemed like an easy way to let me have different defaults on my phone to my desktop, as well as to other users.

As target="blank" isn't a JS enhancement, I agree it would be better to do it server-side. However, I can't see an easy way to do per-user/per-device options without adding a Profile model, either giving users a UI to select and manage sets of options for different devices, or automatically creating a new profile for each new device. While that would work, it feels like overkill, at this stage at least. We can take another look when we have more server-side options to control.

Perhaps a more practical compromise would be to have a global default which controls the generated HTML, then the JS can either add or strip the target based on an option in a JS-managed cookie.

from django-yarr.

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.