Opened 6 years ago

Closed 6 years ago

#1799 closed improve feature (fixed)

Refactor main.js

Reported by: planetcruiser Owned by: planetcruiser
Priority: major Milestone: 1.2
Component: unknown Keywords:
Cc: toub

Description (last modified by planetcruiser)

Issues:

  • OSM related additions to main.js feel hacky, because they mix scripts and CSS and contain browser dependent code
  • main.js should only deal with JS, not CSS
  • jQuery is loaded via CDN, undermining our users privacy
  • Debug console JS is included

Solutions:

  • Move CSS related logic to separate JS file
  • Keep local copy of jQuery
  • Remove console.js

Notes:

Related ticket:

Change History (9)

comment:1 Changed 6 years ago by planetcruiser

  • Cc toub added
  • Description modified (diff)
  • Owner set to planetcruiser
  • Status changed from new to accepted

doing this in the process with #1776

comment:2 Changed 6 years ago by planetcruiser

https://gitorious.org/bewelcome/rox/commit/98a0ee6: "move leaflet css includes and handle external js differently"

at the moment i see no reuse potential for css includes based on url in combination with js files. i think including a js file that includes css is cleaner.

comment:3 Changed 6 years ago by planetcruiser

https://gitorious.org/bewelcome/rox/commit/ec9ab1b: "local jquery for privacy reasons, upgrade jquery from 1.7.2 to 1.8.2 (latest)"

leaving console.js - didn't realise it's a generic fix. i added a new ticket for console debug output: #1800

comment:4 Changed 6 years ago by planetcruiser

deployed to alpha, please test

(clear browser cache if something behaves funnily, although this should not be needed any more)

comment:5 Changed 6 years ago by planetcruiser

oh, testing instructions: this effects all places where osm is used, so just click around osm maps and pages a bit to see if everything works as before my commits

comment:6 follow-up: Changed 6 years ago by toub

Well done. Just one question, I don't understand the privacy issue point.

What can be known by Google exactly, except that the user is browsing a web site that uses JQuery?

comment:7 in reply to: ↑ 6 Changed 6 years ago by planetcruiser

Replying to toub:

Well done. Just one question, I don't understand the privacy issue point.

What can be known by Google exactly, except that the user is browsing a web site that uses JQuery?

well, the first time a user loads our jquery version their ip address is submitted to google, along with the referrer (possibly containing search string etc).

also, some devs including me work on the site when offline, for example in a train or on a boat. it would be a hassle to always edit the main.js in those cases.

the idea was to become "google free" with this release (unless a user uses the google layer of course), but we are still including js from google (maps api), but this is not the place for discussing it. i will mail to the dev list about it.

comment:8 Changed 6 years ago by toub

Ok thanks, I didn't know that extra data could be submitted to google.

comment:9 Changed 6 years ago by planetcruiser

  • Resolution set to fixed
  • Status changed from accepted to closed

ok, if it's working for toub, i assume this is fixed now

Note: See TracTickets for help on using tickets.