Giter Club home page Giter Club logo

localisr's Introduction

olane

Static site for www.olane.uk

Deployment

This is a 100% static site - there's no build. It's hosted on github pages via the master branch.

localisr's People

Contributors

green-s avatar lavelle avatar olane avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

localisr's Issues

Non visible tags are not excluded from conversion

Currently the program ignores <iframe>s, but still converts other tags, like <script> and <style>, that do not contain data that is displayed to the user and therefore should not be converted.

For example, on this page when you run the conversion, a string that looks like a price in a <style> tag containing CSS for social media buttons is converted, breaking the CSS and the appearance of the social media buttons as a result.

Ignoring these tags would also have the added benefit of making the program run faster.

We should create a list of all tags that should be ignored, then implement this.

As a minimum we should start with <script> and <style>.

This bug has always been present, but I didn't see it until I made the currency acronym detection case-insensitive, which has in fact turned out to be a great way to discover several bugs.

Improve styling and behaviour of options page

The options page looks fine right now, but it would be nice to make it match the look of the default Chrome settings page a bit more. However, I'm reluctant to do that manually because there are plans to add some default styling to extension's options pages. Doesn't seem very active though, so I'm not sure how far off it is.

Additionally, the interface could be easier to use. I'm not sure a drop-down is the right way to choose between hundreds of time zones, maybe an auto-completing text box and some validation? We could use Chosen for this.

To specify the list of URLs it would also be great to have something like this, where there are separate text boxes for each URL and a button to add a new one. Again, reluctant to do this manually because it may be supported by default in future, but we could be waiting a while.

Decide on and implement loading behaviour.

Currently the script is run when the extension's icon is pressed.

If we decide to continue with this, it would probably be best to make a second click restore the page.

Alternatively, if it isn't too slow, the script could run on every page, or just a user specified list (common foreign shops, blogs, podcasts etc.)

The method Chrome uses for language translation of showing a bar when the page is in a foreign language wont work, because basically every page ever has a dollar sign on it so it'll get annoying.

If it runs on every page or a list of pages, the extension's icon should display a popup with a button in it to reset the page to the original.

How should times with parentheses around the acronym be handled?

It would be trivial to just add an optional opening parenthesis before and an optional closing one after, but this would mean that strings like "8:32 (GMT" would be valid.

This could be a good thing, converting times where people have typed sloppily, but it could introduce more bugs.

It would be more difficult to enforce having either both parentheses or neither. I'm not sure you can do this with regular expressions, apart from having the entire list of acronyms in there twice, once with parentheses around and once without. This seems like it would run at half the speed, and would also not be very scalable (do we add the list a third time to support square brackets?)

Other solutions, like incrementing a counter for every opening parenthesis and decrementing it for every closing one and checking if the total for the string is zero also sound slow, and overkill for a relatively rare format.

It seems like the best solution is to just support unmatched parentheses, but then if we add square brackets in future it would allow strings like "10:32 [GMT)".

Again, debatable whether this is a good thing or not. I'm leaning towards just allowing them unmatched, and reconsidering if it causes any problems.

No feedback is given when values in an iframe are not converted

Due to cross-domain security restrictions you can't manipulate the content of an iframe on another domain, so we can't convert the prices and times. However, you can read the contents, so we could still check if there are prices and times within an iframe, and show a message to the user saying that they could not be converted.

Optionally also have a link to open the iframe's url in a new tab so that it can be converted there. This might not be the best idea, most stuff in iframes would look weird on its own.

Also, currently the extension is ignoring all iframes, but I'm pretty sure you can manipulate the DOM of iframes on the same domain as the parent page, so if there's a demand for it we could add support for this.

Implement caching of exchange rates API data

Essential if we decide to run on every page.

Even if not, it would make it easier to stay on the free API plan, exchange rates don't change much in an hour.

Can use localStorage for this.

Page reset breaks JavaScript-heavy pages

To restore the page to its original state the second time the user presses the button, the entire body element is replaced with an earlier version saved with jQuery.

I thought that this would preserve all scripts and event handlers, but on Google Reader (and presumably other sites) all interaction stops working.

Not sure what the solution is to this - it's not as though it's being replaced from a string of HTML, it's the original DOM element saved with $('body');. You could just make the second press reload the page, but then you may as well not have it at all.

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.